/* Feces of the Species — the void, the stars, the gilded frame. No CDNs, no frameworks.
   Restored to the 2013 aesthetic: a black starfield, Tangerine cursive in sandybrown,
   and specimens that twirl in from the deep. */

@font-face {
  font-family: Tangerine;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/tangerine-400.woff2") format("woff2");
}

@font-face {
  font-family: Tangerine;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/tangerine-700.woff2") format("woff2");
}

:root {
  --title: sandybrown;
  --gold: #c9a227;
  --gold-bright: #e6c766;
  --plaque: #f3ecd9;
  --plaque-ink: #35301f;
  --ink: #efe9d8;
  --wrong: #8c2f2f;
  --right: #2f6b3a;
  --cursive: Tangerine, "Brush Script MT", cursive;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: #000;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
}

/* The universe. Content floats above it; the canvas handles the rest. */
.fullScreen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: -1;
}

.fullScreen canvas { display: block; width: 100%; height: 100%; }

#app {
  margin: auto; /* centers vertically and horizontally, degrades kindly when content is tall */
  width: 100%;
  max-width: 40rem;
  padding: 2rem 1.25rem;
}

h1 {
  font-family: var(--cursive);
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 6.5rem);
  line-height: 1;
  color: var(--title);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
  margin: 0.5rem 0 1.25rem;
}

h2 {
  font-family: var(--cursive);
  font-weight: 400;
  font-size: clamp(2.75rem, 10vw, 4rem);
  line-height: 1.05;
  color: var(--title);
  margin: 0.25rem 0 1rem;
}

/* Engraved plaques, hovering politely in space. */
.plaque {
  background: linear-gradient(160deg, var(--plaque), #e2d7bb);
  color: var(--plaque-ink);
  border: 1px solid #b9a869;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(185, 168, 105, 0.35), 0 6px 24px rgba(0, 0, 0, 0.7);
  padding: 1.25rem 1.5rem;
  margin: 0 auto 1.5rem;
  max-width: 34rem;
  font-size: 1.15rem;
  line-height: 1.5;
}

.plaque p { margin: 0.4rem 0; }

/* On phones, scale the plaque type with the viewport so each engraved line stays one line. */
@media (max-width: 520px) {
  .plaque {
    font-size: clamp(0.8rem, 3.4vw, 1.05rem);
    padding: 1rem 0.75rem;
  }
}

/* The gilded frame: photo sits in the punched-out window of the overlay PNG. */
.framed {
  position: relative;
  width: min(92vw, 460px);
  aspect-ratio: 420 / 370;
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.8));
}

.frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.specimen {
  position: absolute;
  left: 22.6%;
  top: 25.7%;
  width: 54.4%;
  height: 48.6%;
  object-fit: cover;
  z-index: 1;
  background: #d8d2c2;
}

/* The 2013 entrance: specimens twirl in from the void. */
.feces-animation {
  animation: feces-animation 2.5s ease-in-out 0.2s both;
}

@keyframes feces-animation {
  0% {
    transform-origin: center;
    transform: rotate(-300deg) scale(0);
    opacity: 0.2;
  }
  100% {
    transform-origin: center;
    transform: none;
    opacity: 1;
  }
}

.btn {
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 0.6rem 1.4rem;
  margin: 0.3rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}

.btn:hover, .btn:focus-visible { background: rgba(201, 162, 39, 0.25); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--gold);
  color: #241f10;
  font-weight: bold;
}

.btn.primary:hover, .btn.primary:focus-visible { background: var(--gold-bright); }

/* Six options: two rows of three, collapsing to two columns on narrow screens. */
.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  max-width: 34rem;
  margin: 0 auto 1rem;
}

@media (max-width: 480px) {
  .choices { grid-template-columns: repeat(2, 1fr); }
}

.choice { min-width: 0; margin: 0; }
.choice:disabled { cursor: default; opacity: 0.75; }
.choice.is-answer { background: var(--right); border-color: var(--right); color: #fff; opacity: 1; }
.choice.is-wrong { background: var(--wrong); border-color: var(--wrong); color: #fff; opacity: 1; }

.verdict {
  min-height: 3.5rem;
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 32rem;
  margin: 0 auto 0.5rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.verdict .fun-fact {
  display: block;
  margin-top: 0.4rem;
  font-style: italic;
  color: var(--gold-bright);
}

.progress {
  color: rgba(239, 233, 216, 0.7);
  font-size: 0.95rem;
  font-variant: small-caps;
  letter-spacing: 0.08em;
}

.next { display: block; margin: 1rem auto 0; }

.results .score-line { font-size: 1.25rem; }
.results .rank { font-size: 1.35rem; line-height: 1.4; }
.results .rank strong { color: #7a5c14; font-variant: small-caps; letter-spacing: 0.04em; }
.results .remark { font-style: italic; }

.best-score {
  color: var(--gold-bright);
  font-variant: small-caps;
  letter-spacing: 0.06em;
}

.home-actions { margin: 1rem 0; }

/* The /submit page's "how it works" list. */
.steps { margin: 0.5rem 0 0; padding-left: 1.3rem; line-height: 1.55; }
.steps li { margin: 0.5rem 0; }
a.btn { display: inline-block; text-decoration: none; }

.colophon {
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: rgba(239, 233, 216, 0.65);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.colophon a { color: var(--gold-bright); }

/* Fade-ins. The lobby gets the full 2013 ceremony while the stars flow. */
.fade-in { opacity: 0; animation: fadeIn 1s ease-in forwards; }
.fade-in.fast { animation-delay: 0.5s; }
.fade-in.medium { animation-delay: 1.5s; }
.fade-in.slow { animation-delay: 2.5s; }
.fade-in.slowest { animation-delay: 3.5s; }

@keyframes fadeIn { to { opacity: 1; } }

/* Mid-game the ceremony belongs to the twirling frame; everything else stays brisk. */
.question .fade-in, .results .fade-in { animation-duration: 0.5s; }
.question .fade-in.fast { animation-delay: 0s; }
.question .fade-in.slow { animation-delay: 1.1s; }
.results .fade-in.fast { animation-delay: 0.2s; }
.results .fade-in.medium { animation-delay: 0.8s; }
.results .fade-in.slow { animation-delay: 1.4s; }

@media (prefers-reduced-motion: reduce) {
  .fade-in, .feces-animation { animation: none; opacity: 1; }
}
