:root {
  color-scheme: light;
  --background: #f5f3fc;
  --surface: #fff;
  --ink: #201932;
  --muted: #605775;
  --border: #e1dcef;
  --accent: #5637ca;
  --accent-dark: #4126aa;
  --accent-soft: #eee8ff;
  --stage-base: #231743;
  --mint: #b7efef;
  --pink: #f5ceee;
  --sun: #f9dfab;
  --lime: #d9fa82;
  --heading: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--ink); font: 400 16px/1.6 var(--body); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.12; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(100% - 80px, 1264px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 8px; transform: translateY(-180%); padding: 8px 16px; background: var(--surface); }
.skip-link:focus-visible { transform: none; }
.topbar { background: color-mix(in srgb, var(--surface) 76%, var(--background)); border-bottom: 1px solid var(--border); }
.topbar-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; color: var(--ink); font: 800 24px/1 var(--heading); letter-spacing: -.055em; text-decoration: none; }
.brand img, .game-tab img, .stage-icon, .guide-label img, .collection-link img { image-rendering: pixelated; }
.brand-accent { color: var(--accent); }
.site-nav, .footer-inner nav { display: flex; align-items: center; gap: 24px; }
.site-nav a, .footer-inner nav a { color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.site-nav a:hover, .footer-inner nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current] { color: var(--accent-dark); }

.play-shell {
  min-height: min(calc(100svh - 73px), 880px);
  padding: 32px 0 48px;
  background-image: radial-gradient(var(--border) 0.8px, transparent 0.8px);
  background-size: 16px 16px;
}
.play-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 22px; }
.play-heading h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 800; letter-spacing: -.075em; }
.heading-link { color: var(--accent-dark); font-size: 14px; font-weight: 700; text-decoration: none; }
.heading-link:hover, .rail-link:hover { text-decoration: underline; }

.collection-intro { max-width: 84ch; margin: 0 0 26px; }
.collection-intro h2 { font-size: clamp(23px, 3vw, 29px); letter-spacing: -.035em; }
.collection-intro p { margin: 6px 0; }
.collection-intro a { display: inline-block; margin-top: 4px; font-weight: 700; }

.play-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.play-layout.play-layout-single { grid-template-columns: minmax(0, 1fr); }
.game-nav { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 4%, transparent); }
.game-nav-title { display: flex; align-items: center; justify-content: space-between; padding: 15px 15px 12px; }
.game-nav-title h2 { font-size: 17px; letter-spacing: -.03em; }
.game-nav-title > span { color: var(--muted); font: 700 12px/1 var(--body); }
.game-nav-list { display: grid; gap: 4px; margin: 0; padding: 0 8px 8px; list-style: none; }
.game-nav-list[data-collection-games] { max-height: 444px; overflow-y: auto; scrollbar-width: thin; }
.game-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.game-tab:hover { border-color: var(--border); background: var(--background); }
.game-tab[aria-current] { border-color: color-mix(in srgb, var(--accent) 42%, var(--surface)); background: var(--accent-soft); }
.game-tab img { border-radius: 8px; }
.game-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); font: 800 12px/1 var(--heading); }
.stage-icon.game-mark { width: 56px; height: 56px; border-radius: 12px; font-size: 18px; }
.tab-text { display: grid; gap: 1px; line-height: 1.28; }
.tab-text strong { font: 800 16px/1.18 var(--heading); letter-spacing: -.02em; }
.tab-text small { color: var(--muted); font-size: 12px; }
.tab-cue { color: var(--accent-dark); font-size: 15px; }
.rail-link { display: block; margin: 4px 15px 16px; font-size: 13px; font-weight: 700; text-decoration: none; }

.game-panel { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 14px 36px color-mix(in srgb, var(--ink) 8%, transparent); }
.game-panel + .game-panel:not([hidden]) { margin-top: 16px; }
.game-stage { --highlight: var(--accent-soft); --stage: color-mix(in srgb, var(--stage-base) 95%, var(--highlight)); --glow: color-mix(in srgb, var(--stage) 67%, var(--highlight)); position: relative; min-height: 460px; min-height: clamp(426px, 57vh, 620px); isolation: isolate; background: var(--stage, var(--stage-base)); color: var(--surface); }
.theme-cosmillion, .theme-wonderhop { --highlight: var(--mint); }
.theme-unicorner { --highlight: var(--lime); }
.theme-orbs { --highlight: var(--pink); }
.theme-karman { --highlight: var(--sun); }

.stage-cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: 24px;
  padding: clamp(24px, 4vw, 52px);
  background:
    radial-gradient(circle at 78% 50%, var(--glow), transparent 56%),
    radial-gradient(color-mix(in srgb, var(--surface) 16%, transparent) 0.7px, transparent 0.7px) 0 0 / 16px 16px;
}
.stage-copy { position: relative; z-index: 1; max-width: 420px; }
.stage-icon { margin-bottom: 14px; border-radius: 12px; }
.stage-label { color: var(--highlight); font: 700 12px/1.2 var(--body); letter-spacing: .11em; text-transform: uppercase; }
.stage-copy h2 { margin-top: 8px; color: var(--surface); font-size: clamp(32px, 4.8vw, 67px); font-weight: 800; letter-spacing: -.065em; }
.stage-pitch { max-width: 31ch; margin-top: 12px; color: var(--background); line-height: 1.45; }
.stage-action { margin-top: 24px; }
.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--lime);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--lime) 59%, var(--stage-base));
  color: var(--ink);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}
.play-button:hover { background: color-mix(in srgb, var(--lime) 70%, var(--surface)); }
.play-button:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--lime) 59%, var(--stage-base)); }
.play-symbol { width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent currentColor; }
.stage-art { position: relative; min-width: 0; padding: 6px; border: 1px solid color-mix(in srgb, var(--surface) 36%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--stage-base) 28%, transparent); box-shadow: 0 18px 34px color-mix(in srgb, var(--ink) 42%, transparent); transform: rotate(2deg); }
.stage-art img { width: 100%; height: auto; aspect-ratio: 1.48; object-fit: cover; object-position: center; border-radius: 10px; }
.stage-cover.stage-cover--credited {
  position: relative;
  min-height: inherit;
  grid-template-rows: auto;
}
.stage-cover--credited .stage-art {
  width: min(100%, 520px);
  justify-self: center;
  transform: none;
}
.stage-cover--credited .stage-art img { max-height: none; }
.stage-art-caption { padding: 6px 4px 2px; color: var(--surface); font: 700 12px/1.4 var(--body); }
.stage-art::before, .stage-art::after {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--highlight);
  clip-path: polygon(42% 0, 58% 0, 58% 30%, 70% 30%, 70% 42%, 100% 42%, 100% 58%, 70% 58%, 70% 70%, 58% 70%, 58% 100%, 42% 100%, 42% 70%, 30% 70%, 30% 58%, 0 58%, 0 42%, 30% 42%, 30% 30%, 42% 30%);
  content: "";
}
.stage-art::before { top: -16px; right: 7%; }
.stage-art::after { bottom: -16px; left: 7%; transform: scale(.68); }
.stage-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--stage); font-weight: 700; }
.spinner { width: 32px; height: 32px; border: 3px solid color-mix(in srgb, var(--surface) 30%, transparent); border-top-color: var(--lime); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.game-frame[aria-hidden="true"] { visibility: hidden; }
.game-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.theme-watercooler-word-ladder:has(.game-frame) { min-height: 600px; }
.game-stage:fullscreen { width: 100%; height: 100%; }
.game-toolbar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 16px; background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1.25; }
.play-status { display: flex; align-items: center; gap: 7px; }
.play-status > span { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.game-actions { display: flex; align-items: center; gap: 16px; }
.game-actions a, .quiet-button { color: var(--accent-dark); font-size: inherit; font-weight: 700; white-space: nowrap; }
.guide-link { color: var(--accent-dark); font-weight: 700; }
.quiet-button { min-height: 36px; padding: 0; border: 0; background: transparent; }
.quiet-button:hover { text-decoration: underline; }

.editorial { padding: 64px 0 72px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 76%, var(--background)); }
.game-guide { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); align-items: start; gap: clamp(24px, 5vw, 64px); }
.game-guide + .game-guide:not([hidden]) { margin-top: 64px; }
.guide-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.guide-label img { border-radius: 7px; }
.guide-copy h2, .collections h2, .prose h2, .faq h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.05em; }
.guide-copy h3, .prose h3 { font-size: 21px; letter-spacing: -.025em; }
.guide-copy p { margin-top: 10px; }
.guide-copy > h3 { margin-top: 24px; }
.guide-copy ol { margin: 8px 0 20px; padding-left: 22px; }
.guide-copy li + li { margin-top: 5px; }
.why-pick { padding: 14px 16px; border-left: 4px solid color-mix(in srgb, var(--accent) 72%, var(--surface)); border-radius: 0 10px 10px 0; background: var(--accent-soft); }
.why-pick p { margin-top: 6px; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 13px; font-weight: 700; }
.guide-figure { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 5%, transparent); }
.guide-figure img { width: 100%; height: auto; }
.guide-figure figcaption { padding: 10px 14px; color: var(--muted); font-size: 13px; }
.summary, .faq, .collections { margin-top: 64px; }
.summary { max-width: 76ch; }
.prose p, .prose ul { margin: 12px 0 0; }
.prose table { max-width: 100%; overflow-wrap: anywhere; }
.game-comparison { margin-top: 48px; }
.comparison-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.comparison-jumps a { padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 700; }
.comparison-scroll { max-width: 100%; margin-top: 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.comparison-scroll table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.comparison-scroll th, .comparison-scroll td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.comparison-scroll thead th { background: var(--surface); }
.comparison-group th { background: var(--background); }
.comparison-group:target th { background: var(--accent-soft); }
.comparison-scroll tbody:last-child tr:last-child > * { border-bottom: 0; }
.prose h2:not(:first-child), .prose h3:not(:first-child) { margin: 28px 0 8px; }
.faq { max-width: 800px; }
.faq h2, .collections h2 { margin-bottom: 16px; }
.faq details { border-top: 1px solid var(--border); }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { padding: 15px 4px; font-weight: 700; cursor: pointer; }
.faq p { margin: 0 0 16px; padding-left: 4px; color: var(--muted); }
.collection-link { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; max-width: 580px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.collection-link + .collection-link { margin-top: 10px; }
.collection-link:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.collection-link img { border-radius: 9px; }
.collection-link strong { display: block; font: 800 20px/1.15 var(--heading); }
.collection-link small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.3; }

.single-game .game-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.single-game .game-toolbar, .single-game .game-actions { flex-wrap: wrap; }
.single-game [data-gf-liked] { color: var(--accent-dark); }
.game-source { margin-top: 20px; }
.game-comments { margin-top: 20px; }
.game-comment { padding: 12px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.game-comment time { color: var(--muted); font-size: 13px; }

.standalone { max-width: 700px; min-height: 60vh; padding: 48px 0 72px; }
.standalone h1 { font-size: clamp(36px, 5vw, 54px); letter-spacing: -.06em; }
.contact-form { display: grid; gap: 8px; max-width: 540px; margin-top: 24px; }
.contact-form label { font-weight: 700; }
.contact-form label span { color: var(--muted); font-weight: 400; }
.contact-form input, .contact-form textarea { width: 100%; margin-bottom: 8px; padding: 10px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 8px; background: var(--surface); color: var(--ink); }
.contact-form textarea { resize: vertical; }
.contact-form button { justify-self: start; }
.site-footer { background: color-mix(in srgb, var(--background) 78%, var(--accent-soft)); border-top: 1px solid var(--border); }
.footer-inner { min-height: 80px; }
.footer-inner nav { flex-wrap: wrap; }
.footer-inner .brand { font-size: 20px; }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - 48px); }
  .play-layout { grid-template-columns: 208px minmax(0, 1fr); }
  .stage-cover { gap: 16px; }
}
@media (max-width: 750px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-inner { flex-wrap: wrap; min-height: 58px; gap: 10px; padding-block: 8px; }
  .brand { gap: 6px; font-size: 20px; }
  .brand img { width: 32px; height: 32px; }
  .site-nav { gap: 10px; }
  .site-nav a { font-size: 12px; line-height: 1.25; }
  .play-shell { min-height: calc(100svh - 59px); padding: 22px 0 32px; }
  .play-heading { margin-bottom: 14px; gap: 6px 12px; }
  .play-heading h1 { font-size: clamp(32px, 8vw, 45px); }
  .heading-link { font-size: 13px; }
  .play-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .game-nav-title { padding: 9px 10px 5px; }
  .game-nav-title h2 { font-size: 14px; }
  .game-nav-list { display: flex; overflow-x: auto; padding: 0 6px 6px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 38%, var(--border)) transparent; }
  .game-nav-list[data-collection-games] { max-height: none; overflow-y: hidden; }
  .game-nav-list li { min-width: max-content; }
  .game-tab { gap: 6px; padding: 5px; }
  .game-tab img, .game-tab .game-mark { width: 30px; height: 30px; }
  .tab-text strong { font-size: 14px; }
  .tab-text small { font-size: 12px; }
  .tab-cue { padding-right: 3px; }
  .rail-link { margin: 4px 10px 10px; }
  .game-stage { min-height: 505px; }
  .stage-cover { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); align-items: start; gap: 22px; padding: 18px 20px 24px; background: radial-gradient(ellipse at 50% 76%, var(--glow), transparent 65%), radial-gradient(color-mix(in srgb, var(--surface) 16%, transparent) .7px, transparent .7px) 0 0 / 16px 16px; }
  .stage-copy { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
  .stage-icon { grid-row: 1 / 3; width: 42px; height: 42px; margin: 0; border-radius: 9px; }
  .stage-icon.game-mark { width: 42px; height: 42px; border-radius: 9px; }
  .stage-label { font-size: 12px; }
  .stage-copy h2 { margin-top: 3px; font-size: 35px; }
  .stage-pitch, .stage-action { grid-column: 1 / -1; }
  .stage-pitch { max-width: 40ch; margin-top: 10px; font-size: 15px; }
  .stage-action { margin-top: 14px; }
  .stage-art { align-self: center; justify-self: center; width: min(100%, 410px); }
  .stage-art img { max-height: 252px; }
  .game-toolbar { padding-inline: 10px; font-size: 12px; }
  .game-actions { gap: 8px; }
  .editorial { padding: 40px 0 56px; }
  .game-guide { grid-template-columns: 1fr; gap: 24px; }
  .footer-inner { flex-wrap: wrap; padding-block: 12px; gap: 12px 20px; }
  .footer-inner nav { gap: 16px; }
  .collections, .summary, .faq { margin-top: 44px; }
}
@media (max-width: 520px) {
  .topbar-inner { align-items: center; }
  .site-nav { display: flex; flex: 1 1 100%; gap: 12px; max-width: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
}
@media (max-width: 370px) {
  .stage-cover { padding-inline: 14px; }
  .footer-inner { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}


/* Panels for games without a capture yet: single-column stage */
.stage-cover:not(:has(.stage-art)) { grid-template-columns: minmax(0, 1fr); }
.stage-cover:not(:has(.stage-art)) .stage-copy { max-width: 640px; margin-inline: auto; }
.game-stage:not(:has(.stage-art)) { min-height: 0; }

/* Panels for games without a capture yet: single-column stage */
.stage-cover:not(:has(.stage-art)) { grid-template-columns: minmax(0, 1fr); }
.stage-cover:not(:has(.stage-art)) .stage-copy { max-width: 560px; }

/* 2026-11-22: keep the stage copy above the theme decoration */
.stage-copy { position: relative; z-index: 2; }
.theme-poople, .theme-weaver, .theme-word-labyrinth, .theme-wordle-global-ladder, .theme-bored-word-ladder { --ladder: var(--sun); }
