:root {
  color-scheme: dark;
  --page-bg: #151110;
  --surface: #211917;
  --surface-muted: #2b201d;
  --ink: #fff2df;
  --muted: #cfbaaa;
  --border: #624135;
  --primary: #ff9d49;
  --primary-hover: #ffb36d;
  --exact: #2e694c;
  --partial: #89571f;
  --wrong: #76382e;
  --radius: 16px;
  --sans: Inter, system-ui, "Segoe UI", sans-serif;
  --display: "Archivo Black", "Arial Black", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page-bg); color: var(--ink); font: 16px/1.55 var(--sans); }
main { position: relative; isolation: isolate; }
main:has(.hero-section)::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: clamp(680px, 68vw, 940px);
  background: linear-gradient(180deg, #17191e56 0%, #170e0b0d 45%, var(--page-bg) 100%),
    url("../game/shinobi.webp") center 38% / cover no-repeat;
}
a { color: var(--primary); text-underline-offset: .2em; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 5; top: 8px; left: 8px; padding: 10px; background: var(--surface); }
.site-header { background: #181110; border-bottom: 1px solid #ffae682b; }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.header-inner { min-height: 70px; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 9px; font-size: 1.28rem; font-weight: 850; text-decoration: none; }
.brand img { border-radius: 9px; }
.brand-domain { color: var(--primary); }
.primary-nav, .footer-inner nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.primary-nav a, .footer-inner nav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 650; }
.primary-nav a:hover, .footer-inner nav a:hover, .primary-nav .nav-play { color: var(--primary); }

.hero-section { padding: clamp(21px, 3vw, 40px) 0 18px; text-align: center; }
.hero-section h1 {
  font-family: var(--display); color: #ffbd7a; text-transform: uppercase;
  font-size: clamp(2.65rem, 8vw, 5.25rem); line-height: 1; font-weight: 950; letter-spacing: -.065em;
  text-shadow: 0 2px #913722, 0 5px #582716, 0 6px 20px #170b08;
}
.hero-section p { margin: 8px auto 0; color: #fff0df; font-size: 1rem; font-weight: 700; text-shadow: 0 2px 8px #190c08, 0 1px 3px #190c08; }
.game-shell { width: min(720px, calc(100% - 32px)); scroll-margin-top: 15px; }
.round-switch {
  display: flex; width: fit-content; margin: 0 auto 9px; gap: 4px; padding: 4px;
  background: #211817; border: 1px solid var(--border); border-radius: 100px;
}
.round-switch button { border: 0; background: transparent; border-radius: 100px; min-height: 44px; padding: 5px 16px; color: var(--muted); font-weight: 750; }
.round-switch button[aria-pressed="true"] { color: #1c1009; background: var(--primary); }
.mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(100%, 430px); margin: 0 auto 14px; }
.mode-card {
  display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 64px;
  background: #231a18; border: 1px solid #8b604c; color: var(--ink); border-radius: 10px; padding: 6px 4px;
}
.mode-card img { width: 28px; height: 27px; object-fit: contain; }
.mode-card strong { font-size: .87rem; line-height: 1.2; }
.mode-card:hover, .mode-card[aria-pressed="true"] { border-color: var(--primary); background: #3b261d; }
.mode-card[aria-pressed="true"] { box-shadow: inset 0 -3px #ff9d4970; }

.play-card {
  color-scheme: light;
  --ink: #2c1b15; --muted: #625047; --border: #c7a88f; --surface-muted: #f1e1cc; --ink-accent: #994421;
  padding: clamp(14px, 3vw, 22px); color: var(--ink); background: #fff3df;
  border: 1px solid #6d382c; border-top: 5px solid #8c3829; border-radius: var(--radius); box-shadow: 0 15px 46px #120b0869;
}
.play-card :focus-visible { outline-color: var(--ink-accent); }
.play-heading { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.round-label { font-size: .75rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; color: var(--ink-accent); }
.play-heading h2 { margin-block: 3px 4px; font-size: clamp(1.28rem, 4vw, 1.8rem); line-height: 1.16; letter-spacing: -.025em; }
.play-heading p:not(.round-label) { color: var(--muted); font-size: .91rem; }
.help-link { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 100%; border: 1px solid var(--border); color: var(--ink); text-decoration: none; font-weight: 800; }
.help-link:hover { border-color: var(--ink-accent); color: var(--ink-accent); }
.guess-form { display: flex; gap: 8px; margin-top: 12px; }
.guess-field { position: relative; flex: 1; min-width: 0; }
.guess-field > svg { position: absolute; left: 13px; top: 14px; width: 22px; height: 22px; pointer-events: none; stroke: var(--muted); stroke-width: 1.7; }
.guess-field input { width: 100%; height: 50px; border-radius: 9px; border: 1px solid #986f55; background: #fffaf1; color: var(--ink); padding: 0 10px 0 43px; }
.guess-field input::placeholder { color: #735b4f; }
.guess-field input:disabled { opacity: .7; }
.primary-button {
  display: inline-flex; justify-content: center; align-items: center; background: var(--primary); color: #24130a;
  border: 1px solid transparent; border-radius: 9px; padding: 8px 21px; min-height: 45px;
  font-weight: 850; text-decoration: none; white-space: nowrap;
}
.primary-button:hover { background: var(--primary-hover); }
.primary-button:disabled { cursor: default; background: #654a39; color: #dfcabe; }
#character-options {
  position: absolute; z-index: 2; top: calc(100% + 3px); inset-inline: 0; overflow: auto; max-height: 235px;
  padding: 4px; margin: 0; border: 1px solid #95624a; border-radius: 9px; background: #fffaf1; list-style: none;
}
#character-options li { display: flex; align-items: center; gap: 11px; padding: 6px 9px; border-radius: 5px; min-height: 44px; cursor: pointer; }
#character-options li:hover, #character-options li[aria-selected="true"] { background: #f0d6b7; }
#character-options img, .guess-item img { width: 32px; height: 32px; border-radius: 5px; }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 15px; margin-top: 8px; color: var(--muted); font-size: .86rem; }
.game-meta button, .round-result button, .clue-controls button {
  background: transparent; border: 1px solid var(--border); border-radius: 7px;
  min-height: 44px; padding: 4px 10px; color: var(--ink-accent); font-weight: 750;
}
.game-meta button:disabled { opacity: .62; cursor: default; }
.game-status { color: var(--ink-accent); font-size: .92rem; font-weight: 700; }
.game-status:empty { display: none; }
.hint-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.hint-slot { background: var(--surface-muted); border: 1px solid var(--border); border-radius: 8px; }
.hint-slot button { display: grid; width: 100%; border: 0; border-radius: 7px; min-height: 46px; background: transparent; color: var(--ink-accent); padding: 4px 8px; text-align: left; }
.hint-slot button:disabled { cursor: default; color: var(--ink); }
.hint-slot button:not(:disabled):hover { background: #f4d0a9; }
.hint-slot button span { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.hint-slot p { padding: 0 8px 7px; overflow-wrap: anywhere; font-size: .85rem; }
.clue-legend { display: flex; flex-wrap: wrap; gap: 4px 13px; color: var(--muted); font-size: .79rem; margin-top: 11px; }
.clue-legend span { display: inline-flex; gap: 6px; align-items: center; }
.clue-legend i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; font-style: normal; color: #fff; }
.clue-legend b { color: var(--ink-accent); font-size: 1rem; }
.exact { background: var(--exact); }
.partial { background: var(--partial); }
.wrong { background: var(--wrong); }
.clue-display { margin-top: 17px; }
.clue-display blockquote { margin: 0; padding: 14px 18px; background: var(--surface-muted); border-left: 3px solid var(--primary); border-radius: 6px; font-size: 1.22rem; }
.clue-media { width: min(100%, 340px); height: 144px; display: grid; place-items: center; overflow: hidden; margin-inline: auto; border-radius: 10px; background: #161012; border: 1px solid var(--border); }
.clue-media img { width: 156px; height: 156px; object-fit: cover; transform-origin: var(--eye-x, 50%) var(--eye-y, 47%); transform: translate(var(--offset-x, 0), var(--offset-y, 0)) scale(var(--zoom, 1)); transition: transform .24s ease; }
.clue-media img.technique-clip { width: 100%; height: 100%; object-fit: contain; transform: none; filter: blur(var(--clue-blur, 0)); }
.clue-controls { display: flex; justify-content: center; margin-top: 6px; color: var(--muted); font-size: .85rem; }
.clue-description { text-align: center; margin-top: 7px; color: var(--muted); font-size: .86rem; }
.table-scroll { position: relative; overflow-x: auto; margin-block: 12px; border-radius: 6px; }
.clue-table { width: 100%; min-width: 650px; border-spacing: 3px; table-layout: fixed; margin: 0; font-size: .75rem; text-align: center; }
.clue-table thead th { color: var(--muted); padding: 3px 2px; }
.clue-table tbody th, .clue-table td { height: 59px; padding: 4px; border-radius: 5px; overflow-wrap: anywhere; }
.clue-table td, .guess-item { color: #fffaf1; }
.clue-table td small { display: block; font-weight: 850; font-size: .7rem; margin-bottom: 2px; }
.clue-table tbody th { background: var(--surface-muted); font-weight: 750; }
.clue-table th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-muted); box-shadow: 2px 0 #d5b89f; }
.clue-table img { width: 33px; height: 33px; display: block; margin: 0 auto 3px; border-radius: 5px; }
.guess-list { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 10px 0; }
.guess-item { border-radius: 6px; display: flex; align-items: center; gap: 7px; padding: 6px 10px; font-size: .88rem; }
.round-result { border-top: 1px solid var(--border); display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; padding-top: 12px; font-weight: 800; }
.round-result textarea { width: 100%; color: var(--ink); background: #fffaf1; border: 1px solid var(--border); border-radius: 6px; min-height: 95px; padding: 6px; }
.daily-footer { display: flex; align-items: flex-start; justify-content: center; flex-wrap: wrap; gap: 2px 10px; margin: 9px auto 0; }
.reset-clock, .yesterday { padding: 0 9px; margin: 0; border-radius: 8px; background: #211917; color: #ead5c3; font-size: .82rem; }
.reset-clock { line-height: 44px; font-variant-numeric: tabular-nums; text-align: center; }
.yesterday summary { line-height: 44px; cursor: pointer; font-weight: 750; }
.yesterday div { display: flex; gap: 7px; align-items: center; padding-bottom: 7px; }
.yesterday img { border-radius: 4px; }

.content-section, .info-page { width: min(850px, calc(100% - 32px)); padding-top: 56px; scroll-margin-top: 10px; }
.content-section > h2, .info-page h1 { font-size: clamp(1.65rem, 4.5vw, 2.6rem); line-height: 1.14; letter-spacing: -.04em; }
.section-lead { color: var(--muted); margin-top: 10px; }
.roster-card { margin-top: 18px; padding: clamp(12px, 2vw, 20px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.roster-toolbar { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px 14px; }
.roster-control { display: grid; gap: 4px; min-width: 0; }
.roster-control label { font-size: .85rem; font-weight: 750; }
.roster-control input, .roster-control select { min-width: 0; width: 100%; min-height: 44px; border: 1px solid #95624a; border-radius: 8px; background: var(--page-bg); color: var(--ink); padding: 6px 9px; font: inherit; }
.roster-count { margin: 9px 0; color: var(--muted); font-size: .88rem; }
.roster-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.roster-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; text-align: left; font-size: .86rem; }
.roster-table thead th { position: sticky; z-index: 1; top: 0; background: var(--surface-muted); }
.roster-table th, .roster-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.roster-table th:first-child { width: 40%; }
.roster-table td { color: var(--muted); }
.roster-table tbody tr:last-child > * { border-bottom: 0; }
.roster-pick { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; color: var(--primary); text-align: left; font: inherit; font-weight: 750; }
.roster-pick:hover:not(:disabled) { text-decoration: underline; }
.roster-pick:disabled { color: var(--ink); cursor: default; }
.roster-pick img { flex: none; border-radius: 6px; }
.roster-empty { padding-block: 9px; color: var(--muted); }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 20px; }
.guide-card, .editorial-card, .faq-list details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(14px, 3vw, 24px); }
.guide-card p, .editorial-card p, .faq-list p { margin-top: 8px; color: var(--muted); }
.guide-card a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 4px; font-weight: 750; }
.editorial-card { margin-top: 14px; }
.faq-list { margin-top: 17px; display: grid; gap: 8px; }
.faq-list details { padding-block: 0; }
.faq-list summary { cursor: pointer; padding-block: 12px; font-weight: 800; min-height: 44px; }
.faq-list p { margin: 0 0 14px; }
.back-to-play { margin-top: 18px; }
.site-footer { margin-top: 57px; border-top: 1px solid var(--border); background: #181110; }
.footer-inner { padding-block: 23px; align-items: flex-start; }
.footer-inner p { color: var(--muted); font-size: .86rem; margin-top: 7px; }
.footer-inner nav a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 690px) {
  main:has(.hero-section)::before {
    background-image: linear-gradient(180deg, #19151973, #2b181549 40%, var(--page-bg)), url("../game/shinobi.webp");
    background-position: center, 32% top;
  }
  .guide-grid { grid-template-columns: 1fr; }
  .footer-inner { display: grid; gap: 10px; }
  .footer-inner nav { gap: 9px 17px; }
}
@media (max-width: 420px) {
  .header-inner { width: calc(100% - 28px); min-height: 61px; gap: 8px; }
  .brand { font-size: 1.02rem; }
  .brand img { width: 34px; height: 34px; }
  .primary-nav { gap: 0 9px; }
  .primary-nav a { font-size: .77rem; min-height: 44px; display: inline-flex; align-items: center; }
  .mode-grid { gap: 5px; }
  .mode-card { min-height: 58px; }
  .mode-card img { width: 25px; height: 24px; }
  .play-heading h2 { font-size: 1.2rem; }
  .round-label { letter-spacing: .015em; }
  .guess-form .primary-button { padding-inline: 12px; }
  .guess-field input { padding-left: 34px; font-size: 16px; }
  .guess-field > svg { left: 9px; width: 18px; }
  .primary-nav a[href="/#faq"] { display: none; }
  .roster-toolbar { grid-template-columns: 1fr; }
  .roster-table th, .roster-table td { padding: 5px; font-size: .76rem; }
  .roster-pick { gap: 5px; }
  .roster-pick img { width: 24px; height: 24px; }
}
@media (max-width: 380px) {
  .primary-nav a[href="/#how-to-play"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
