:root {
  color-scheme: dark;

  --ink:            #EEE8DC;
  --ink-2:          #C9CFD6;
  --ink-soft:       #9AA3AF;
  --ink-faint:      #7D8794;

  --page:           #0D1014;
  --surface:        #151A21;
  --stripe:         #1C222B;
  --line:           #222A35;
  --line-2:         #262E39;
  --field-edge:     #333D4A;

  --bar-bg:         #0D1014;
  --bar-ink:        #EEE8DC;
  --board:          #151A21;
  --board-edge:     #222A35;
  --on-board:       #EEE8DC;
  --punct:          #262E39;
  --punct-ink:      #C9CFD6;

  --primary:        #F5B83D;
  --primary-ink:    #1A1405;
  --primary-hover:  #F7C55E;

  --gold:           #F5B83D;
  --gold-deep:      #B9801A;
  --gold-ink:       #1A1405;
  --gold-ink-soft:  #5C3D05;
  --accent-text:    #F5B83D;
  --solved:         #202833;
  --solved-edge:    #2E3845;
  --gold-tint:      rgba(245, 184, 61, .14);
  --silver:         #C9CFD6;
  --bronze:         #D49A6A;

  --active:         #8AB4F8;
  --active-tint:    rgba(138, 180, 248, .12);
  --on-active:      #0D1014;

  --bad:            #F0956A;
  --apple:          #FFFFFF;
  --apple-ink:      #000000;
  --apple-hover:    #E8E8E8;
  --scrim:          rgba(5, 7, 10, .72);
  --shadow:         rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    color-scheme: light;

    --ink:            #1D1B17;
    --ink-2:          #3F3A31;
    --ink-soft:       #625C51;
    --ink-faint:      #7A7366;

    --page:           #F6F1E7;
    --surface:        #FFFDF8;
    --stripe:         #EEE7DA;
    --line:           #E4DCCD;
    --line-2:         #DDD4C3;
    --field-edge:     #CFC5B2;

    --bar-bg:         #FFFDF8;
    --bar-ink:        #1D1B17;
    --board:          #FFFDF8;
    --board-edge:     #E4DCCD;
    --on-board:       #1D1B17;
    --punct:          #DDD4C3;
    --punct-ink:      #3F3A31;

    --primary:        #F5B83D;
    --primary-ink:    #1A1405;
    --primary-hover:  #F7C55E;

    --gold:           #F5B83D;
    --gold-deep:      #B9801A;
    --gold-ink:       #1A1405;
    --gold-ink-soft:  #5C3D05;
    --accent-text:    #8F5A00;
    --solved:         #F3EBDB;
    --solved-edge:    #D8CDB8;
    --gold-tint:      rgba(143, 90, 0, .12);
    --silver:         #8A8F96;
    --bronze:         #A9662F;

    --active:         #2F5FB3;
    --active-tint:    rgba(47, 95, 179, .10);
    --on-active:      #FFFFFF;

    --bad:            #B4441C;
    --apple:          #000000;
    --apple-ink:      #FFFFFF;
    --apple-hover:    #1F1F1F;
    --scrim:          rgba(29, 27, 23, .45);
    --shadow:         rgba(29, 27, 23, .18);
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --ink:            #1D1B17;
  --ink-2:          #3F3A31;
  --ink-soft:       #625C51;
  --ink-faint:      #7A7366;

  --page:           #F6F1E7;
  --surface:        #FFFDF8;
  --stripe:         #EEE7DA;
  --line:           #E4DCCD;
  --line-2:         #DDD4C3;
  --field-edge:     #CFC5B2;

  --bar-bg:         #FFFDF8;
  --bar-ink:        #1D1B17;
  --board:          #FFFDF8;
  --board-edge:     #E4DCCD;
  --on-board:       #1D1B17;
  --punct:          #DDD4C3;
  --punct-ink:      #3F3A31;

  --primary:        #F5B83D;
  --primary-ink:    #1A1405;
  --primary-hover:  #F7C55E;

  --gold:           #F5B83D;
  --gold-deep:      #B9801A;
  --gold-ink:       #1A1405;
  --gold-ink-soft:  #5C3D05;
  --accent-text:    #8F5A00;
  --solved:         #F3EBDB;
  --solved-edge:    #D8CDB8;
  --gold-tint:      rgba(143, 90, 0, .12);
  --silver:         #8A8F96;
  --bronze:         #A9662F;

  --active:         #2F5FB3;
  --active-tint:    rgba(47, 95, 179, .10);
  --on-active:      #FFFFFF;

  --bad:            #B4441C;
  --apple:          #000000;
  --apple-ink:      #FFFFFF;
  --apple-hover:    #1F1F1F;
  --scrim:          rgba(29, 27, 23, .45);
  --shadow:         rgba(29, 27, 23, .18);
}

@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/zilla-slab-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/zilla-slab-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/zilla-slab-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-style: italic; font-weight: 600; font-display: swap; src: url('/fonts/zilla-slab-latin-600-italic.woff2') format('woff2'); }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/fonts/karla-latin-wght-normal.woff2') format('woff2'); }

:root {
  --bar:   48px;
  --ad-inset: 0px;
  --radius: 4px;

  --sans: "Karla", "Helvetica Neue", Arial, sans-serif;
  --display: "Zilla Slab", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: contain; touch-action: manipulation; }

body {
  margin: 0;
  font: 400 16px/1.5 var(--sans);
  color: var(--ink);
  background: var(--page);
  overscroll-behavior-y: contain;
}

button, input { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.screen {
  max-width: 760px;
  margin: 0 auto;
  padding: 0px 12px calc(40px + env(safe-area-inset-bottom));
}
#screen-home, #screen-board { max-width: none; padding: 0 0 max(env(safe-area-inset-bottom), var(--ad-inset)); }
.screen.is-peek { position: fixed; left: 0; right: 0; bottom: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.screen.is-peek::after { content: ""; position: absolute; inset: 0; background: var(--page); opacity: var(--peek-dim, 0); }
.screen.is-peeked { position: relative; z-index: 1; min-height: 100vh; background: var(--page); }
.screen-loading { display: grid; place-items: center; min-height: 60vh; }

.policy { max-width: 640px; }
.policy article { padding: 8px 4px 0; }
.policy h2 { margin: 20px 0 2px; font-family: var(--display); font-weight: 600; font-size: 26px; }
.policy h3 { margin: 26px 0 6px; font-size: 17px; }
.policy p, .policy li { color: var(--ink); }
.policy ul { padding-left: 20px; }
.policy li { margin: 6px 0; }
.policy a { color: inherit; }
.policy-date { margin: 0 0 16px; color: var(--ink-soft); font-size: 14px; }

.btn {
  padding: 11px 18px;
  border: 2px solid var(--field-edge);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn:disabled { opacity: .5; cursor: default; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px 16px calc(16px + var(--ad-inset));
  background: var(--scrim);
  overflow-y: auto;
}
.sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 22px 22px;
  border-radius: 12px;
  background: var(--surface);
}
.sheet-x {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: none; color: var(--ink-soft);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.sheet-x:hover { background: var(--stripe); }

.result-title { margin: 0 0 4px; text-align: center; font-size: 27px; }
.result-sub { margin: 0 0 10px; text-align: center; color: var(--ink-soft); }
.result-line { margin: 12px 0 0; text-align: center; color: var(--ink-soft); }
.result-rewards:not(:empty) { margin: 14px 0 0; }
.result-board { display: grid; gap: 10px; justify-items: start; margin: 18px 0 0; }
.result-board .home-leaders { width: 100%; }
.result-board-title { margin: 0; font-size: 18px; }

.acrostic-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.acrostic-tiles .tile {
  display: grid; place-items: center;
  width: 30px; height: 32px;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 800;
}
.acrostic-tiles .tile.is-space { background: none; width: 10px; }

.result-quote {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: var(--stripe);
  border-radius: 0 6px 6px 0;
  font-size: 15px;
}
.result-attrib { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 14px; }

.answers { margin: 16px 0 0; padding: 0; list-style: none; }
.answers li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.answers .a-word { font-weight: 700; min-width: 96px; }
.answers .a-clue { color: var(--ink-soft); }
.answers .a-miss .a-word { color: var(--bad); }

.howto-lead { margin: 0 0 12px; text-align: center; color: var(--ink-soft); }
.howto-list { margin: 12px 0; padding-left: 20px; }
.howto-list li { margin: 6px 0; }
.howto-foot { color: var(--ink-soft); font-size: 14px; }
.chip { display: inline-block; width: 13px; height: 13px; border-radius: 3px; background: var(--gold); vertical-align: -1px; }


.result-guest { margin: 14px 0 0; padding: 14px; border-radius: 12px; background: var(--gold-tint); text-align: center; }
.result-guest-text { margin: 0 0 10px; font-size: 14px; }

.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + max(env(safe-area-inset-bottom), var(--ad-inset)));
  z-index: 80;
  transform: translateX(-50%);
  max-width: min(460px, calc(100vw - 24px));
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--board);
  color: var(--on-board);
  font-size: 14px;
  box-shadow: 0 10px 28px var(--shadow);
}
