:root {
  color-scheme: light;
  --paper: #fff3d7;
  --ink: #25212b;
  --muted: #625e65;
  --line: #25212b;
  --surface: #fffdf5;
  --normal: #087e77;
  --normal-soft: #c9f5e7;
  --weird: #de4e34;
  --weird-soft: #ffdbcf;
  --focus: #215cff;
  --color-bg: var(--paper);
  --color-surface: var(--surface);
  --color-text: var(--ink);
  --color-text-muted: var(--muted);
  --color-accent: var(--weird);
  --color-accent-hover: #a62d1e;
  font-family: ui-rounded, "Trebuchet MS", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1c1b28;
  --ink: #fff7e8;
  --muted: #c4bcc7;
  --line: #c4bcc7;
  --surface: #292838;
  --normal: #7ce0c7;
  --normal-soft: #164e4a;
  --weird: #ff9a78;
  --weird-soft: #613a37;
  --focus: #8eacff;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); display: flex; flex-direction: column; }
button, input, select { font: inherit; }
a { color: inherit; text-underline-offset: .22em; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 20; top: .75rem; left: .75rem; padding: .65rem .85rem; background: var(--ink); color: var(--paper); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.site-header { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; min-height: 76px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem; border-bottom: 3px solid var(--line); }
.wordmark { font-size: 1.45rem; font-weight: 950; letter-spacing: -.08em; text-decoration: none; transform: rotate(-3deg); }
.wordmark span { color: var(--weird); }
.site-nav { display: flex; justify-content: center; gap: clamp(.8rem, 3vw, 2rem); }
.site-nav a { color: var(--muted); font-size: .9rem; font-weight: 800; text-decoration: none; padding: .45rem .55rem; border-radius: 999px; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); }
.theme-button { width: 42px; height: 42px; border: 2px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface); cursor: pointer; }
.theme-button:hover { background: var(--surface); }

.judge-page { flex: 1; width: min(860px, calc(100% - 2rem)); margin: 0 auto; display: grid; align-content: start; gap: 1.25rem; padding: clamp(1.5rem, 5vh, 3.5rem) 0 2rem; }
.judge-stage { position: relative; min-height: 430px; padding: clamp(2rem, 5vw, 3.5rem) 1.5rem 2.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; border: 3px solid var(--line); border-radius: 28px; background: radial-gradient(circle at 10% 20%, color-mix(in srgb, var(--weird) 14%, transparent) 0 11px, transparent 12px), radial-gradient(circle at 88% 82%, color-mix(in srgb, var(--normal) 17%, transparent) 0 16px, transparent 17px), var(--surface); box-shadow: 9px 9px 0 color-mix(in srgb, var(--weird) 65%, var(--ink)); }
.judge-stage::before { content: "THE NAME GAME"; position: absolute; top: -16px; left: 1.5rem; padding: .35rem .8rem; border: 2px solid var(--line); border-radius: 999px; background: #ffe58d; color: #25212b; font-size: .68rem; font-weight: 950; letter-spacing: .12em; transform: rotate(-3deg); }
.eyebrow { width: max-content; max-width: 100%; margin: 0 0 1rem; padding: .45rem .8rem; border: 2px solid var(--line); border-radius: 999px; background: #e9d7ff; color: #25212b; font-size: .72rem; line-height: 1; font-weight: 950; letter-spacing: .16em; }
.judge-stage h1, .name-page h1 { max-width: 14ch; margin: 0; font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif; font-size: clamp(3.2rem, 10vw, 6.5rem); font-weight: 950; line-height: 1; letter-spacing: -.07em; overflow-wrap: anywhere; }
.judge-question { margin: 1.4rem 0 1.7rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); font-weight: 700; }
.judge-content { width: min(620px, 100%); min-height: 260px; display: grid; place-items: center; }
.judge-loading { margin: 0; padding: .8rem 1rem; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); font-weight: 800; }

.vote-actions { width: min(620px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.vote-button { min-height: 74px; padding: 1rem 1.2rem; border: 3px solid var(--line); border-radius: 16px; font-size: clamp(1rem, 3vw, 1.25rem); font-weight: 950; letter-spacing: .08em; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .8rem; box-shadow: 0 5px 0 var(--line); transition: transform 100ms ease, box-shadow 100ms ease; }
.vote-button kbd { padding: .1rem .35rem; border: 1px solid currentColor; border-radius: 3px; font-size: .66rem; opacity: .65; }
.key-group { display: inline-flex; gap: .3rem; }
.vote-normal { color: var(--ink); background: var(--normal-soft); }
.vote-weird { color: var(--ink); background: var(--weird-soft); }
.vote-button:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 0 var(--line); }
.vote-button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.vote-button:disabled { cursor: wait; opacity: .58; }

.result-panel { width: min(620px, 100%); min-height: 204px; }
.result-primary { display: flex; align-items: baseline; justify-content: center; gap: .55rem; }
.result-primary strong { font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif; font-size: clamp(3.3rem, 9vw, 5.5rem); font-weight: 950; line-height: 1; }
.result-primary span { font-weight: 900; letter-spacing: .1em; }
.result-meter { height: 18px; margin: 1.2rem 0 .7rem; overflow: hidden; border: 2px solid var(--line); border-radius: 999px; background: var(--normal); }
.result-meter span { display: block; width: 50%; height: 100%; background: var(--weird); transition: width 180ms ease; }
.result-split { display: flex; justify-content: space-between; font-size: .9rem; }
.result-panel > p { color: var(--muted); }
.result-actions { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.2rem; }
.next-button, .text-button { min-height: 48px; border: 2px solid var(--line); border-radius: 12px; padding: .7rem 1rem; color: var(--paper); background: var(--ink); font-weight: 900; text-decoration: none; cursor: pointer; }
.next-button kbd { margin-left:.35rem; padding:.12rem .3rem; border:1px solid currentColor; border-radius:3px; font-size:.62rem; opacity:.7; }
.text-button { color: var(--ink); background: var(--surface); }
.next-button:hover, .text-button:hover { transform: translateY(-1px); }
.status-line { min-height: 1.5em; margin: .85rem 0 0; color: var(--muted); font-size: .9rem; }
.error-state { width: min(560px, 100%); border-top: 2px solid var(--weird); padding: 1rem; }
.error-state p { margin-top: 0; }
.session-note { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .55rem; color: var(--muted); font-size: .82rem; padding: .8rem; font-weight: 800; }
.session-note > span[aria-hidden="true"] { display: none; }
.session-note a, .session-note #session-count { padding: .5rem .7rem; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; }
.session-note #session-count { background: #e9d7ff; color: #25212b; }
.session-note a:hover { background: var(--normal-soft); }
.session-summary { max-width: 620px; margin: .8rem auto 0; padding: .9rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: center; font-weight: 800; }

.submission-grid { display: grid; gap: 1rem; align-items: start; margin-top: 2rem; }
.submission-card { padding: 1.5rem; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 5px 5px 0 var(--line); }
.submission-card h2 { margin: 0 0 1.2rem; font-size: 1.5rem; }
.submission-card form { display: grid; gap: .9rem; }
.submission-card label { display: grid; gap: .35rem; color: var(--ink); font-weight: 700; }
.submission-card input, .submission-card textarea, .submission-card select { width: 100%; padding: .8rem; border: 2px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--paper); }
.submission-card textarea { min-height: 110px; resize: vertical; }
.submission-preview { display:grid; gap:.55rem; padding:1rem; border:2px dashed var(--line); border-radius: 12px; background:var(--paper); }
.submission-preview[hidden] { display:none; }
.submission-preview .eyebrow { margin:0; }
.submission-preview h3,.submission-preview p { margin:0; overflow-wrap:anywhere; }
.preview-image { width:100%; max-height:280px; object-fit:cover; border-radius:3px; }
.preview-state { padding-top:.55rem; border-top:1px solid var(--line); color:var(--muted); font-size:.82rem; }
.preview-state[data-state="success"] { color:var(--normal); font-weight:800; }
.preview-state[data-state="error"] { color:var(--weird); font-weight:800; }
.form-note, .form-status { color: var(--muted); font-size: .9rem; }
.honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.discovery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-top: 2rem; }
.discovery-card { display: grid; gap: .5rem; padding: 1rem; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 4px 4px 0 var(--line); text-decoration: none; transition: transform 100ms ease; }
.discovery-card:hover { transform: translateY(-3px); }
.discovery-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.discovery-card strong { font-size: 1.5rem; font-weight: 950; }
.name-page > .cat-photo { width: min(420px, 100%); height: auto; aspect-ratio: 1; margin: 1.2rem auto; border: 1px solid var(--line); object-fit: cover; }
.category-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.category-tabs a { padding: .6rem .8rem; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-weight: 850; }
.category-tabs a:hover, .category-tabs a[aria-current="page"] { background: var(--normal-soft); color: #25212b; }
[data-theme="dark"] .category-tabs a:hover, [data-theme="dark"] .category-tabs a[aria-current="page"] { color: var(--ink); }
.local-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.local-stats div { display: grid; padding: 1rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.local-stats strong { font: 950 2rem ui-rounded, "Trebuchet MS", system-ui, sans-serif; }.local-stats span,.local-row span,.local-row time { color: var(--muted); font-size: .85rem; }
.local-list { display: grid; gap: .5rem; margin-bottom: 1.5rem; }
.local-row { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.local-row strong { overflow-wrap: anywhere; }
.local-actions { display:flex; flex-wrap:wrap; gap:.7rem; margin-top:1rem; }
.favorite-button[aria-pressed="true"] { background: var(--weird-soft); color: var(--weird); }

.site-footer { width: min(1120px, calc(100% - 2rem)); margin: auto auto 0; padding: 1.5rem 0 2rem; border-top: 2px solid var(--line); color: var(--muted); font-size: .78rem; display: flex; justify-content: space-between; gap: 1rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }

.page-intro { max-width: 650px; }
.page-intro h1, .content-page h1 { margin: 0; font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif; font-size: clamp(2.8rem, 8vw, 5.5rem); font-weight: 950; line-height: 1.05; letter-spacing: -.065em; }
.page-intro > p:last-child { color: var(--muted); font-size: 1.08rem; }
.content-page { flex: 1; width: min(760px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 6vw, 4.5rem) 0; }
.content-page .eyebrow, .page-intro .eyebrow { margin-bottom: 1rem; color: #25212b; }
.content-page[data-wide], body[data-surface="submit"] .content-page { width: min(1020px, calc(100% - 2rem)); }
.content-page h2 { margin-top: 2.5rem; }
.content-page p, .content-page li { color: var(--muted); line-height: 1.7; }
.content-page .lede { color: var(--ink); font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 700; line-height: 1.5; }
.simple-callout { margin: 2rem 0; padding: 1.2rem 0; border-block: 1px solid var(--line); }
.about-page { width: min(940px, calc(100% - 2rem)); }
.about-page .lede { max-width: 55ch; }
.how-to-play { margin-top: 2.5rem; }
.how-to-play h2 { margin: 0 0 1rem; font-size: clamp(1.55rem, 3vw, 2rem); }
.play-steps { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.play-steps li { padding: 1.3rem; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 4px 4px 0 var(--line); }
.step-number { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border: 2px solid var(--line); border-radius: 50%; background: var(--normal-soft); color: var(--ink); font-size: .85rem; font-weight: 950; }
.play-steps li:nth-child(2) .step-number { background: var(--weird-soft); }
.play-steps li:nth-child(3) .step-number { background: #e9d7ff; color: #25212b; }
.play-steps h3 { margin: .9rem 0 .35rem; font-size: 1.22rem; }
.play-steps p { margin: 0; line-height: 1.5; }
.about-note { max-width: 75ch; margin: 1.5rem 0 0; }
.support-panel { margin-top: 3rem; padding: clamp(1.3rem, 4vw, 2rem); border: 3px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 7px 7px 0 color-mix(in srgb, var(--weird) 70%, var(--ink)); }
.support-panel .eyebrow { margin-bottom: .8rem; background: #ffe58d; }
.support-panel h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.support-panel p:not(.eyebrow) { max-width: 65ch; margin: .6rem 0 0; }
.support-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.3rem; }
.support-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; }
.support-actions .support-button { border: 2px solid var(--line); background: var(--weird-soft); color: var(--ink); box-shadow: 0 4px 0 var(--line); }
.support-actions .support-button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
.loading-state, .empty-state { padding: 3rem 0; color: var(--muted); text-align: center; }

.container { flex: 1; width: min(1000px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0; }

@media (max-width: 700px) {
  .site-header { min-height: 64px; grid-template-columns: 1fr auto; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; padding: 0 0 .8rem; }
  .theme-button { grid-column: 2; grid-row: 1; }
  .judge-page { padding-top: 2rem; }
  .judge-stage { min-height: 360px; }
  .judge-content { min-height: 300px; }
  .site-footer { flex-direction: column; }
}

@media (min-width: 700px) { .submission-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 700px) { .local-stats { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (min-width: 700px) { .play-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 450px) {
  .site-nav { flex-wrap: wrap; gap: .2rem; overflow: visible; }
  .site-nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: .8rem; padding: .45rem .3rem; }
  .vote-actions { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .vote-button { min-height: 64px; padding: .8rem .3rem; font-size: .95rem; }
  .vote-button kbd { display: none; }
  .next-button kbd { display:inline; }
  .result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .result-actions > * { min-width: 0; min-height: 48px; padding: .5rem .35rem; display: flex; align-items: center; justify-content: center; font-size: .82rem; }
  .next-button kbd { display: none; }
  .judge-stage { padding-inline: .8rem; }
  .judge-stage h1, .name-page h1 { font-size: clamp(2.8rem, 13vw, 5rem); }
  .session-note { gap: .35rem; }
  .support-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
