#fade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
  z-index: 10;
}
#fade-overlay.active {
  opacity: 1;
}
#secret-btn {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 48px;
  height: 48px;
  z-index: 5;
  cursor: default;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background-color: #ffffff;
  text-align: center;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Header Styling */
header {
  font-size: clamp(50px, 13vmin, 13vh);
  font-weight: normal;
  height: 13vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Subheader Styling */
.subheader {
  font-size: clamp(10px, 3vmin, 3vh);
  font-weight: normal;
  margin-bottom: 5vh;
}

/* Main should fill available space and center content */
main {
  flex: 1 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Square Image Container - fills all available vertical space under header */
#random-image-container, #slider {
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1 / 1;
  height: calc(100vh - 13vh);
  cursor: pointer;
  width: auto;
  max-width: 90vw;
  max-height: calc(100vh - 13vh);
  min-width: 200px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
  background: #fff;
}

#random-image, #slider img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  margin: auto;
}

/* Link Styling */
a {
  text-decoration: none;
  color: rgb(0, 0, 0);
  transition: color .25s;
}

a:hover {
  color: #e1e1e1;
}

/* Remove default ul padding/margin */
ul {
  padding: 0;
  margin: 0;
}

/* Unordered List for Big Items */
ul.biglist {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  list-style-type: none;
  list-style-image: none;
}

ul.biglist li {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

ul.biglist a {
  text-decoration: none;
  font-size: clamp(40px, 6vmin, 5vh);
  color: #000000;
  transition: color .25s;
}
.biglist-title {
  font-size: clamp(18px, 4vmin, 4vh);
  margin: 0.75em 0;
  letter-spacing: 0.02em;
}

ul.biglist a:hover {
  color: #e1e1e1;
}

/* Constrain and center the <hr> inside .biglist */
hr {
  width: 20vw;
  margin: 20px auto;
  border: none;
  border-top: 2px solid #000000;
}

/* Rules List */
.rules {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  text-align: center;
  display: block;
}

.rules .subheader {
  line-height: normal;
  margin: auto;
}

.rules .spacer {
  height: 1em;
  list-style: none;
}

.rules a {
  text-decoration: underline;
}
.diagram {
  aspect-ratio: 1 / 1;
  width: 90vw;
  max-width: 800px;
  min-width: 200px;
  margin: 0 auto 2.25em auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  background: #fff;
}

.diagram img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Paragraph and Raw Text Blocks */
p, .rawtext {
  margin-top: 3em;
  width: 90vw;
  min-width: 350px;
  max-width: 800px;
  font-size: clamp(1em, 2.5vmin, 2vh);
  font-weight: 300;
  line-height: 1.5;
  color: #000000;
  margin-bottom: 1em;
}

/* Discord widget images */
.biglist img,
.rules img {
  max-width: 100%;
  height: auto;
}

/* QR code images */
.qr {
  display: block;
  width: 100%;
  max-width: 600px;              /* Prevents QR codes from being too wide */
  max-height: 35vh;              /* Two QRs: each can be up to 45% of viewport height */
  height: auto;
  margin: 2vh auto;
  object-fit: contain;
  background: #fff;
  padding: 1em;
  box-sizing: border-box;
}


/* --- Mobile Layout Fixes --- */
@media (max-width: 600px) {
  body {
    /* Ensure content is not covered by the camera notch */
    padding-top: env(safe-area-inset-top, 16px);
    box-sizing: border-box;
  }

  header {
    font-size: clamp(24px, 10vw, 50px); /* Optimized for one-line display */
    height: auto;
    padding: 2vw 0;
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* Always one line */
    overflow: hidden; /* Prevent overflow */
    background: #fff;
  }

  header a {
    display: inline-block;
    font-size: inherit;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100vw;
  }

  .subheader {
    font-size: 4vw;
    margin-bottom: 4vw;
  }

  main {
    min-height: 0;
    padding: 0;
  }

  #random-image-container, #slider {
    aspect-ratio: 1 / 1;
    width: 92vw;
    margin-left: 4vw;
    margin-right: 4vw;
    max-width: 92vw;
    max-height: calc(100vh - 10vw);
    min-width: 120px;
    min-height: 120px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  ul.biglist a {
    font-size: 7vw;
  }
  
  .qr {
    max-width: 90vw;
    max-height: 35vh;            /* Slightly smaller for mobile, allows for spacing */
    
  }
}
