:root {
  color-scheme: light;
  --paper: #f2eddf;
  --paper-deep: #ded5c1;
  --ink: #151515;
  --ink-soft: #36342f;
  --line: #b8af9d;
  --signal: #f04b23;
  --signal-hot: #ff6339;
  --acid: #d6ed42;
  --tile-exact: #167b57;
  --tile-partial: #d39414;
  --tile-miss: #403f3b;
  --tile-unknown: #c7beab;
  --white: #fffdf6;
  --panel: var(--paper-deep);
  --muted: var(--ink-soft);
  --pink: var(--signal);
}

[data-colorblind] { --tile-exact: #116f9f; --tile-partial: #d36d19; }
* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, #1515150d 3px 4px);
  mix-blend-mode: multiply;
}
::selection { background: var(--acid); color: var(--ink); }

.top-rule {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 8px max(20px, calc((100vw - 1080px) / 2));
  background: var(--ink);
  color: var(--paper);
  font: 800 10px/1 monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 40px; }
.hero { position: relative; margin-bottom: 30px; border-bottom: 8px solid var(--ink); }
.hero::before { content: ""; position: absolute; right: 4%; top: -110px; width: 260px; height: 260px; border: 2px solid var(--line); border-radius: 50%; opacity: .65; }
.hero-top { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 24px; }
.brand-lockup { position: relative; z-index: 1; min-width: 0; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--signal); font: 900 11px/1 monospace; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 800px; font-size: clamp(58px, 11vw, 134px); font-weight: 950; line-height: .75; letter-spacing: -.075em; text-transform: uppercase; }
.hero h1::first-letter { color: var(--signal); }
.hero-footer { display: flex; align-items: end; justify-content: space-between; margin-top: 28px; }
.hero p { margin: 0 0 10px; font: 700 clamp(15px, 2vw, 20px)/1.2 monospace; text-transform: uppercase; }
.round-stamp { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: -8px; border: 3px solid var(--ink); border-radius: 50%; background: var(--acid); font: 950 24px/1 sans-serif; transform: rotate(8deg); }

.locale-toggle { position: relative; z-index: 2; display: flex; gap: 2px; padding: 3px; border: 2px solid var(--ink); background: var(--paper); }
.locale-toggle button { min-height: 32px; border: 0; background: transparent; color: var(--ink); font: 900 11px/1 monospace; }
.locale-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.controls { position: relative; padding: 20px; margin-bottom: 18px; border: 2px solid var(--ink); background: var(--white); box-shadow: 7px 7px 0 var(--ink); }
.controls::before { content: "SELECT YOUR FIGHTER"; display: block; margin-bottom: 12px; font: 900 10px/1 monospace; letter-spacing: .15em; }
.guess-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.guess-picker { position: relative; min-width: 0; }
.character-options { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; left: 0; max-height: 280px; overflow-y: auto; border: 2px solid var(--ink); background: var(--paper); box-shadow: 5px 5px 0 var(--ink); }
.character-option { display: block; width: 100%; min-height: 42px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 800 13px/1.2 monospace; text-align: left; }
.character-option-name { display: block; }
.character-option-franchise { display: block; margin-top: 4px; padding: 3px 6px; border-left: 4px solid var(--pink); background: var(--panel); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.character-option-context { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.character-option:last-child { border-bottom: 0; }
.character-option:hover, .character-option:focus-visible { background: var(--acid); transform: none; outline: 0; }
.character-option[aria-selected="true"] { background: var(--acid); }
input, button { min-height: 52px; border: 2px solid var(--ink); border-radius: 0; font: inherit; }
input { width: 100%; min-width: 0; padding: 0 16px; background: var(--paper); color: var(--ink); font: 700 17px/1 monospace; }
input::placeholder { color: #777065; }
input:focus { outline: 4px solid var(--acid); outline-offset: -6px; }
button { padding: 0 24px; background: var(--signal); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; transition: transform 100ms ease, background 100ms ease; }
button:hover:not(:disabled) { background: var(--signal-hot); transform: translate(-2px, -2px); }
button:focus-visible { outline: 4px solid var(--acid); outline-offset: 2px; }
button.secondary, .setting-toggle { background: var(--paper); }
button:disabled { cursor: not-allowed; opacity: .42; }
.control-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint-budget, .status { margin: 12px 0 0; font: 800 11px/1.2 monospace; text-transform: uppercase; }
.status { color: var(--signal); }
.status.error { background: var(--signal); color: var(--white); }
.status.clue-twin { padding: 6px 8px; background: var(--acid); color: var(--ink); }
.reset-button { min-height: 30px; margin-top: 10px; padding: 0 10px; font: 900 10px/1 monospace; white-space: nowrap; }
.reset-actions { display: flex; gap: 7px; }
.help-panel { margin-bottom: 24px; border-bottom: 2px solid var(--ink); }
.help-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; cursor: pointer; list-style: none; font-size: 13px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.help-panel summary::after { content: "+"; color: var(--signal); font-size: 24px; line-height: .5; }
.help-panel[open] summary::after { content: "−"; }
.help-panel summary::-webkit-details-marker { display: none; }
.help-list { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0 0 18px; }
.help-chip { display: inline-flex; align-items: center; gap: 7px; font: 800 11px/1 monospace; text-transform: uppercase; }
.help-chip i { display: grid; min-width: 18px; height: 18px; place-items: center; color: var(--white); font-style: normal; font-size: 8px; }
.help-chip.exact i { background: var(--tile-exact); }
.help-chip.partial i { background: var(--tile-partial); }
.help-chip.miss i { background: var(--tile-miss); }
.help-chip.arrow i { min-width: 32px; background: var(--tile-miss); }
.help-chip.unknown i { background: var(--tile-unknown); color: var(--ink); }

.grid-wrap { margin: 28px 0; overflow-x: visible; }
.grid { min-width: 0; display: grid; gap: 7px; }
.grid-row { display: grid; grid-template-columns: 1.15fr .8fr 1.1fr 1.05fr 1.65fr .72fr 1.05fr; gap: 7px; }
.column-header { padding: 0 8px 3px; color: var(--ink-soft); font: 900 9px/1 monospace; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
.tile { position: relative; min-width: 0; min-height: 78px; display: flex; flex-direction: column; justify-content: end; padding: 11px; border: 2px solid var(--ink); background: var(--paper-deep); overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 0 70%, #ffffff17 70%); }
.tile.exact { background: var(--tile-exact); color: var(--white); }
.tile.partial { background: var(--tile-partial); color: var(--white); }
.tile.miss { background: var(--tile-miss); color: var(--white); }
.tile.unknown { background: var(--tile-unknown); color: var(--ink); }
.tile.guess-name { color: var(--paper); }
.tile.guess-name.miss { background: var(--ink); }
.tile.guess-name.exact { background: var(--tile-exact); }
.tile.guess-name { flex-direction: row; align-items: center; gap: 7px; }
.tile.guess-name strong { flex: 1; }
.guess-portrait { width: 30px; height: 30px; flex: 0 0 30px; padding: 2px; border-width: 1px; transform: none; }
.guess-portrait .portrait-label { font-size: 11px; }
.guess-portrait .portrait-policy { display: none; }
.tile.has-version-note { z-index: 2; overflow: visible; }
.tile.has-version-note strong { padding-right: 26px; }
.tile.has-identity-note { z-index: 2; overflow: visible; }
.tile.has-identity-note strong { padding-right: 26px; }
.tile .label { display: none; }
.tile strong { position: relative; font-size: clamp(10px, 1.1vw, 14px); font-weight: 950; line-height: 1.05; overflow-wrap: anywhere; text-transform: uppercase; }

.hint-panel { margin: 20px 0; padding: 18px 20px; border-left: 8px solid var(--signal); background: var(--ink); color: var(--paper); font: 700 13px/1.5 monospace; }
.hint-panel p { margin: 0; }
.hint-panel p + p { margin-top: 8px; }
.reveal-card { display: grid; grid-template-columns: 130px 1fr; gap: 26px; align-items: center; margin: 36px 0 20px; padding: 22px; border: 3px solid var(--ink); background: var(--acid); box-shadow: 9px 9px 0 var(--signal); animation: reveal-in 280ms ease-out both; }
.reveal-card, .reveal-card * { min-width: 0; }
.reveal-card p { overflow-wrap: anywhere; }
.portrait-frame { width: 130px; height: 130px; display: grid; place-items: center; padding: 10px; border: 3px solid var(--ink); background: var(--ink); color: var(--white); text-align: center; transform: rotate(-2deg); }
.portrait-label { font-size: 34px; font-weight: 950; line-height: .9; }
.portrait-policy { align-self: end; font: 800 8px/1 monospace; letter-spacing: .1em; text-transform: uppercase; }
.portrait-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-frame[data-image-fallback="true"] .portrait-label { display: grid; place-items: center; width: 100%; height: 100%; }
.reveal-kicker { margin: 0 0 2px; color: var(--signal); font: 950 11px/1 monospace; letter-spacing: .15em; text-transform: uppercase; }
.reveal-card h2 { margin: 0 0 9px; font-size: clamp(38px, 7vw, 72px); font-weight: 950; line-height: .85; letter-spacing: -.06em; text-transform: uppercase; }
.reveal-facts p, .identity-note, .flavor-line { margin: 3px 0 0; font: 700 12px/1.35 monospace; }
.flavor-line { margin-top: 9px; font-style: italic; }
.report-link { display: inline-block; margin-top: 12px; color: var(--ink); font: 950 11px/1 monospace; text-transform: uppercase; }

.tile-info-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: 900 11px/1 sans-serif;
  text-transform: none;
}
.tile-info-button:hover::after,
.tile-info-button:focus-visible::after,
.tile-info-button:focus::after {
  content: attr(data-note);
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(288px, 75vw);
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: 700 12px/1.35 monospace;
  text-align: left;
  text-transform: none;
  white-space: normal;
}
/* Character tiles are the leftmost desktop column, so their identity notes
   must grow inward instead of beyond the viewport's left edge. */
.tile.guess-name .tile-info-button:hover::after,
.tile.guess-name .tile-info-button:focus-visible::after,
.tile.guess-name .tile-info-button:focus::after {
  right: auto;
  left: 0;
}
.tile-info-button:hover:not(:disabled) { background: transparent; color: inherit; transform: none; }

.stats-panel { margin: 26px 0 16px; padding: 22px; border: 2px solid var(--ink); background: var(--white); }
.stats-panel h2 { margin: 0 0 18px; font-size: 12px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 18px; padding: 0; border: 2px solid var(--ink); }
.stats-grid div { padding: 12px; border-right: 2px solid var(--ink); text-align: center; }
.stats-grid div:last-child { border-right: 0; }
.stats-grid dt { font: 900 9px/1 monospace; letter-spacing: .1em; text-transform: uppercase; }
.stats-grid dd { margin: 5px 0 0; font-size: 34px; font-weight: 950; line-height: 1; }
.stats-distribution, .next-puzzle-countdown, .yesterday-answer { margin: 5px 0 0; font: 700 11px/1.4 monospace; }
.next-puzzle-countdown { color: var(--signal); font-weight: 900; text-transform: uppercase; }
.setting-toggle { width: 100%; margin-top: 15px; min-height: 42px; }
.setting-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.share-panel { margin: 18px 0; }
.share-panel button { width: 100%; background: var(--signal); }
.pilot-panel { margin: 18px 0; padding: 18px; border: 2px solid var(--ink); background: var(--white); }
.pilot-panel h2 { margin: 0 0 8px; font-size: 12px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.pilot-panel p { margin: 0; font: 700 11px/1.45 monospace; }
.pilot-result-summary { margin-top: 7px !important; color: var(--signal); }
.pilot-actions { display: grid; gap: 8px; margin-top: 14px; }
.pilot-actions button { width: 100%; }
.pilot-actions button:first-child { background: var(--signal); }
.pilot-feedback { display: grid; gap: 8px; margin-top: 14px; }
.pilot-feedback fieldset { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.pilot-feedback legend, .pilot-feedback label { font: 700 11px/1.4 monospace; }
.pilot-feedback input#pilot-comment { width: 100%; box-sizing: border-box; border: 1px solid var(--ink); padding: 8px; font: 12px/1.4 monospace; }
.pilot-outbox-status { margin-top: 8px !important; color: var(--signal); }
.copy-buffer { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.site-footer { display: flex; justify-content: space-between; margin-top: 42px; padding-top: 12px; border-top: 2px solid var(--ink); font: 900 9px/1 monospace; letter-spacing: .12em; text-transform: uppercase; }
.hidden { display: none; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(12px) rotate(-1deg); } to { opacity: 1; transform: none; } }

@media (min-width: 800px) {
  .controls { width: min(760px, 76%); margin-left: auto; }
  .help-panel { width: min(760px, 76%); margin-left: auto; }
}
@media (max-width: 620px) {
  .top-rule span:last-child { display: none; }
  .shell { width: min(calc(100% - 28px), 1080px); padding-top: 40px; }
  .hero::before { width: 150px; height: 150px; top: -60px; }
  .hero-top { gap: 8px; }
  .locale-toggle button { padding: 0 12px; }
  .hero h1 { max-width: 100%; font-size: clamp(46px, 17vw, 68px); line-height: .8; overflow-wrap: anywhere; }
  .hero-footer { min-width: 0; gap: 8px; }
  .hero p { min-width: 0; overflow-wrap: anywhere; }
  .eyebrow { max-width: 210px; }
  .round-stamp { width: 45px; height: 45px; font-size: 18px; }
  .controls { padding: 14px; box-shadow: 5px 5px 0 var(--ink); }
  .guess-row { grid-template-columns: 1fr 1fr; }
  .guess-picker { grid-column: 1 / -1; }
  .guess-row button { width: 100%; padding: 0 10px; }
  .control-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .control-meta .status { grid-column: 2; }
  .control-meta .reset-actions { grid-column: 2; display: grid; }
  .help-list { min-width: 0; }
  .help-chip { min-width: 0; }
  .help-chip.gender-note, .help-chip.company-note { flex: 1 1 100%; align-items: flex-start; line-height: 1.25; }
  .help-chip span { min-width: 0; overflow-wrap: anywhere; }
  .grid { gap: 13px; }
  .grid-row:first-child { display: none; }
  .grid-row { grid-template-columns: 1fr; gap: 4px; padding: 7px; border: 2px solid var(--ink); background: var(--ink); }
  .tile { min-height: 46px; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 0; }
  .tile .label { display: block; flex: 0 0 34%; font: 800 9px/1 monospace; letter-spacing: .08em; text-transform: uppercase; opacity: .74; }
  .tile strong { flex: 1; font-size: 14px; text-align: right; }
  .tile.guess-name { flex-direction: row; }
  .guess-portrait { width: 32px; height: 32px; flex-basis: 32px; }
  /* Stacked character cards place the identity icon at the right edge. */
  .tile.guess-name .tile-info-button:hover::after,
  .tile.guess-name .tile-info-button:focus-visible::after,
  .tile.guess-name .tile-info-button:focus::after {
    right: 0;
    left: auto;
  }
  .reveal-card { grid-template-columns: 90px 1fr; gap: 16px; padding: 14px; box-shadow: 6px 6px 0 var(--signal); }
  .portrait-frame { width: 90px; height: 100px; }
  .portrait-label { font-size: 25px; }
  .stats-panel { padding: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid div { border-bottom: 2px solid var(--ink); }
  .stats-grid div:nth-child(2) { border-right: 0; }
  .stats-grid div:nth-child(n+3) { border-bottom: 0; }
  .site-footer { gap: 16px; margin-top: 32px; }
  .site-footer span { min-width: 0; text-align: right; overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
  .locale-toggle { position: absolute; right: 0; top: -28px; }
  .reveal-card { grid-template-columns: 1fr; text-align: center; }
  .portrait-frame { margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
