/* ============================================================
   GuessTheElo.gg — shared stylesheet
   Plain CSS, no framework, no build step.
   Palette sampled from the splash art's charcoal-teal shadows.
   ============================================================ */

:root {
  --bg:            #0b1416;  /* page */
  --surface:       #0e1a1c;  /* cards, table */
  --surface-glass: rgba(14, 26, 28, .70);

  --text:       #e6f0ef;  /* headings / base */
  --text-body:  #cfdedb;  /* paragraphs */
  --text-muted: #8fb0ac;  /* secondary */
  --text-dim:   #6d8f8b;  /* labels, placeholder */
  --text-faint: #54706d;  /* legal line */
  --nav-idle:   #b9cfcc;  /* inactive nav link */

  --teal:        #3fd0c4;  /* accent voice */
  --teal-bright: #7fe4da;  /* hover */

  --gold:   #d9a441;  /* rank 1 / champion */
  --silver: #b9c2ca;  /* rank 2 */
  --bronze: #c98d5c;  /* rank 3 */

  --border:      rgba(63, 208, 196, .16);
  --border-soft: rgba(63, 208, 196, .08);
  --border-nav:  rgba(63, 208, 196, .14);
  --gold-border: rgba(217, 164, 65, .32);

  --font-display: 'Chakra Petch', sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;

  --page-max: 1060px;
  --read-max: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-bright); }

::placeholder { color: var(--text-dim); }

.display { font-family: var(--font-display); }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 0 14px;
  background: rgba(11, 20, 22, .94);
  border-bottom: 1px solid var(--border-nav);
  backdrop-filter: blur(10px);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.nav__brand:hover { color: var(--text); }
.nav__logo { width: 32px; height: 32px; object-fit: contain; }
.nav__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .04em;
}
.nav__wordmark span { color: var(--teal); }
.nav__links { display: flex; align-items: center; gap: 14px; }
.nav-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--nav-idle);
  letter-spacing: .02em;
}
.nav-link:hover { color: var(--teal-bright); }
.nav-link--active { color: var(--teal); }
.nav-link--active:hover { color: var(--teal); }
.nav-join {
  display: none; /* hidden on mobile, shown on wider screens */
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--bg);
  background: var(--teal);
  padding: 7px 14px;
  border-radius: 6px;
}
.nav-join:hover { background: var(--teal-bright); color: var(--bg); }

/* ---------- Hero band ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.hero__art {
  position: absolute;
  inset: 0;
  background-image: url('assets/hero-cat.webp?v=4');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: 38% top;
  opacity: .85;
}
.hero__scrim-side { display: none; }
.hero__scrim-bottom {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(11, 20, 22, .25) 0%,
    rgba(11, 20, 22, .72) 52%,
    var(--bg) 90%);
}
.hero__inner {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.hero__logo {
  width: 116px;
  height: 116px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .55));
}
.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: .01em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .65);
}
.hero__sub {
  margin: 0;
  font-size: 13.5px;
  color: #b6cfcb;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .6);
}

/* ---------- Waitlist form ---------- */
.waitlist-form {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 460px;
  background: rgba(14, 26, 28, .60);
  border: 1px solid rgba(127, 228, 218, .24);
  border-radius: 8px;
  padding: 5px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
}
.waitlist-form input[type="email"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  padding: 10px 12px;
}
.waitlist-form .btn {
  flex: none;
  background: var(--teal);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .08em;
  padding: 10px 22px;
  cursor: pointer;
}
.waitlist-form .btn:hover { background: var(--teal-bright); }
.waitlist-form .btn:disabled { opacity: .5; cursor: default; }

/* ---------- Main layout ---------- */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 8px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.main--read { max-width: var(--read-max); }

/* ---------- Champion row ---------- */
.champion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(to right, rgba(217, 164, 65, .08), rgba(217, 164, 65, .02));
  border: 1px solid var(--gold-border);
  border-radius: 8px;
}
.champion__crown { font-size: 20px; color: var(--gold); line-height: 1; }
.champion__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: #e9c877;
}
.champion__label { font-size: 12px; color: #b39a5e; letter-spacing: .04em; }

/* ---------- Leaderboard ---------- */
.lb { display: flex; flex-direction: column; gap: 10px; }
.lb__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.lb__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .03em;
}
.lb__status {
  margin: -4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.lb__status a { text-decoration: underline; text-underline-offset: 2px; }
.lb-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.lb-row {
  display: grid;
  grid-template-columns: 52px 1fr 72px;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.lb-row:last-child { border-bottom: none; }
.lb-empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  padding: 56px 24px;
}
.lb-empty__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .05em;
  color: var(--teal);
}
.lb-empty__sub {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 44ch;
}
.lb-empty__sub a { text-decoration: underline; text-underline-offset: 2px; }
/* No column headers floating above an empty board (falls back gracefully if
   :has() is unsupported — the head row simply stays visible). */
.lb-table:has(.lb-empty) .lb-row--head { display: none; }
.lb-row--head {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-nav);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--text-dim);
}
.lb-rank {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
}
.lb-name {
  font-size: 14px;
  color: var(--text-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-lp {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-body);
}
.lb-row--head .lb-lp,
.lb-row--head .lb-name { color: var(--text-dim); }

/* Top-3 jewelry — gold / silver / bronze */
.lb-row.is-gold   { background: rgba(217, 164, 65, .07); }
.lb-row.is-silver { background: rgba(185, 194, 202, .06); }
.lb-row.is-bronze { background: rgba(181, 122, 74, .07); }
.is-gold   .lb-rank, .is-gold   .lb-lp { color: var(--gold);   font-weight: 700; font-size: 15px; }
.is-silver .lb-rank, .is-silver .lb-lp { color: var(--silver); font-weight: 700; font-size: 15px; }
.is-bronze .lb-rank, .is-bronze .lb-lp { color: var(--bronze); font-weight: 700; font-size: 15px; }
.is-gold   .lb-name { color: #f0e3c4; font-weight: 600; }
.is-silver .lb-name { color: #e3e9ed; font-weight: 600; }
.is-bronze .lb-name { color: #ecd9c6; font-weight: 600; }

/* ---------- Leaderboard pagination ---------- */
/* Author `display` on .lb-row/.lb-pager beats the UA [hidden] rule, so
   restore hiding explicitly. */
.lb-row[hidden],
.lb-pager[hidden] { display: none; }
.lb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}
.lb-pager__btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--teal);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
}
.lb-pager__btn:hover:not(:disabled) {
  border-color: rgba(63, 208, 196, .4);
  color: var(--teal-bright);
}
.lb-pager__btn:disabled { opacity: .35; cursor: default; }
.lb-pager__status {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--text-dim);
  min-width: 92px;
  text-align: center;
}


/* ---------- Rules ---------- */
.page-head { margin: 0 0 8px; }
.page-head h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: .03em;
}
.page-head p { margin: 0; font-size: 14px; color: var(--text-muted); }
.rules-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.rule-section { display: flex; flex-direction: column; gap: 10px; }
.rule-section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .05em;
  color: var(--teal);
}
.rule-section p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-body);
}
.rules-lead {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-body);
}

/* Scoring table */
.score-table {
  width: 100%;
  max-width: 260px;
  table-layout: fixed;   /* deterministic columns → header aligns over data */
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 14px;
}
.score-table th {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-nav);
}
.score-table td {
  padding: 7px 12px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-soft);
}
.score-table th:last-child,
.score-table td:last-child {
  width: 40%;            /* fixes the LP column; steps column takes the rest */
  text-align: right;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.score-table tr:last-child td { border-bottom: none; }
.score-table .is-exact td { color: var(--gold); font-weight: 600; }

/* ---------- About ---------- */
.about-strip {
  position: relative;
  height: 180px;
  overflow: hidden;
}
.about-strip__art {
  position: absolute;
  inset: 0;
  background-image: url('assets/forest-strip.webp');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center 30%;
  opacity: .55;
}
.about-strip__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(11, 20, 22, .35) 0%,
    rgba(11, 20, 22, .75) 55%,
    var(--bg) 100%);
}
.about-strip__inner {
  position: relative;
  max-width: var(--read-max);
  margin: 0 auto;
  padding: 0 18px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.about-strip__inner h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: .03em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
}
.prose { display: flex; flex-direction: column; gap: 16px; }
.prose p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text-body);
}
.prose strong { color: var(--text); font-weight: 600; }
.waitlist-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-glass);
  border: 1px solid rgba(127, 228, 218, .22);
  border-radius: 10px;
  padding: 24px;
  backdrop-filter: blur(12px);
}
.waitlist-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
}
.waitlist-card__sub { font-size: 13.5px; color: var(--text-muted); margin-top: -6px; }
.waitlist-card .waitlist-form { max-width: none; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(63, 208, 196, .12);
  padding: 20px 18px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer__copy { font-size: 12px; color: var(--text-dim); }
.footer__legal {
  font-size: 11px;
  color: var(--text-faint);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ---------- Success modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 20, 22, .8);
  backdrop-filter: blur(8px);
}
.modal__card {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid rgba(63, 208, 196, .3);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(63, 208, 196, .12);
  transform: scale(.95);
  transition: transform .3s ease;
}
.modal.is-open .modal__card { transform: scale(1); }
.modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(to bottom, rgba(63, 208, 196, .2), rgba(63, 208, 196, .05));
  border: 1px solid rgba(63, 208, 196, .4);
}
.modal__icon svg { width: 34px; height: 34px; color: var(--teal); }
.modal__card h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
}
.modal__card p {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}
.modal__btn {
  width: 100%;
  padding: 13px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--bg);
  background: var(--teal);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.modal__btn:hover { background: var(--teal-bright); }

/* ============================================================
   Wider screens (>= 768px): desktop hero, roomier spacing.
   Mobile-first above; these are the enhancements.
   ============================================================ */
@media (min-width: 768px) {
  .nav { height: 56px; padding: 0 28px; gap: 24px; }
  .nav__logo { width: 38px; height: 38px; }
  .nav__wordmark { font-size: 15px; }
  .nav__links { gap: 26px; }
  .nav-link { font-size: 13.5px; }
  .nav-join { display: inline-block; }

  .hero__art {
    left: auto;
    width: 56%;
    /* `cover` always fills the band (no gaps → no tiling at any width). The
       zoom that makes the cat read bigger and lifts his eye-line comes from a
       transform, which only ever enlarges — so it can never leave a gap for
       the background to repeat into. Anchored right; origin low so scaling
       lifts his face toward the tagline. */
    background-position: right center;
    transform: scale(1.2);
    transform-origin: right 72%;
    /* Feather the left crop edge to transparent so it dissolves into the
       charcoal instead of ending on a crisp line (which sub-pixel rounding
       otherwise reveals as a thin seam at some widths). Part of the element,
       so it scales with the transform and stays aligned. */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 15%);
    mask-image: linear-gradient(to right, transparent 0, #000 15%);
    opacity: 1;
  }
  .hero__scrim-side {
    display: block;
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 56%;
    /* Wide, multi-stop fade so the art-to-charcoal blend has no visible
       vertical seam near the page middle. Same width/anchor as .hero__art, so
       the identical transform below keeps the scrim locked to the scaled art —
       otherwise the art's enlarged left edge peeks out as a bright strip. */
    background: linear-gradient(to right,
      var(--bg) 0%,
      rgba(11, 20, 22, .88) 14%,
      rgba(11, 20, 22, .62) 30%,
      rgba(11, 20, 22, .34) 48%,
      rgba(11, 20, 22, .12) 66%,
      rgba(11, 20, 22, 0) 82%);
    transform: scale(1.2);
    transform-origin: right 72%;
  }
  .hero__scrim-bottom {
    top: auto;
    height: 55%;
    background: linear-gradient(to bottom,
      rgba(11, 20, 22, 0) 0%,
      rgba(11, 20, 22, .85) 62%,
      var(--bg) 100%);
  }
  .hero__inner {
    align-items: flex-start;
    text-align: left;
    padding: 44px 28px 40px;
    gap: 18px;
  }
  .hero__logo { width: 150px; height: 150px; margin: -8px 0 -6px -10px; }
  .hero__title { font-size: 34px; line-height: 1.15; max-width: 520px; text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
  .hero__sub { font-size: 15px; color: #a7c4c0; max-width: 440px; }

  .main { padding: 8px 28px 56px; gap: 28px; }

  .champion { padding: 14px 20px; gap: 14px; }
  .champion__crown { font-size: 22px; }
  .champion__name { font-size: 16px; }
  .champion__label { font-size: 13px; }

  .lb__head h2 { font-size: 20px; }
  .lb__status { font-size: 13.5px; }
  .lb-row { grid-template-columns: 90px 1fr 110px; gap: 12px; padding: 12px 20px; }
  .lb-row--head { padding: 10px 20px; font-size: 11.5px; }
  .lb-name { font-size: 14.5px; }


  .page-head h1 { font-size: 28px; }
  .rules-card { padding: 36px 40px; gap: 34px; }
  .about-strip__inner h1 { font-size: 28px; }

  .footer { padding: 24px 28px 30px; }
  .footer__copy { font-size: 12.5px; }
  .footer__legal { font-size: 12px; }
}
