:root {
  --bg: #0a0a0c;
  --surface: #131318;
  --surface-raised: #1a1a21;
  --surface-soft: #202029;
  --line: #30303a;
  --line-bright: #51515e;
  --ink: #f5f3ed;
  --ink-muted: #a2a1aa;
  --ink-faint: #6a6973;
  --accent: #ff5a36;
  --accent-hover: #ff704f;
  --yellow: #ffd33d;
  --green: #36d887;
  --red: #f04444;
  --reddit: #ff4500;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Syne", "Arial Black", sans-serif;
  --body: "Barlow Condensed", "Arial Narrow", sans-serif;
  --shadow: 6px 6px 0 #000;
  --radius: 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 90, 54, .12), transparent 34rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-family: var(--body);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

a {
  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;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  transform: translateY(-180%);
  padding: 10px 14px;
  background: var(--yellow);
  color: #000;
  font-weight: 800;
}

.skip-link:focus {
  transform: none;
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  border-bottom: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(27px, 3.4vw, 36px);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: 1;
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.language-select {
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(19, 19, 24, .88);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
}

.icon-button > span:first-child {
  color: var(--accent);
  font-size: 16px;
}

.icon-button:hover,
.language-select:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

.language-select {
  padding: 0 8px;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  min-height: 122px;
  padding: 16px 0 18px;
}

.eyebrow,
.panel-kicker,
.section-label {
  margin: 0 0 9px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 940px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .98;
  text-wrap: balance;
}

.intro-copy {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--ink-muted);
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.25;
}

.daily-panel {
  width: 220px;
  min-width: 0;
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.daily-number {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.daily-number strong {
  color: var(--yellow);
  font-size: 19px;
}

.daily-meta {
  display: grid;
  gap: 5px;
  padding: 8px 11px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.daily-meta span {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.daily-meta b {
  color: var(--ink);
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, .85fr);
  align-items: stretch;
  gap: 22px;
  min-height: 540px;
}

.panel,
.result-panel {
  border: 2px solid var(--ink);
  background: rgba(19, 19, 24, .96);
  box-shadow: var(--shadow);
}

.panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: clamp(16px, 2vw, 22px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.panel-heading.compact {
  align-items: center;
}

.panel-heading h2,
.share-block h3,
.community h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -.035em;
  line-height: 1;
}

.dimension-pill {
  flex-shrink: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.heatmap-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.heatmap-expand {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line-bright);
  background: var(--surface-raised);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.heatmap-expand:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.heatmap-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-bright) var(--surface);
}

.heatmap-loading {
  min-height: 100%;
  display: grid;
  place-items: center;
  gap: 16px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.skeleton-grid {
  width: min(420px, 88%);
  height: 190px;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent),
    repeating-linear-gradient(0deg, var(--surface-soft) 0 18px, transparent 18px 23px),
    repeating-linear-gradient(90deg, var(--surface-soft) 0 26px, transparent 26px 31px);
  background-size: 200% 100%, auto, auto;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0, 0 0, 0 0; }
}

table.heatmap {
  border-collapse: separate;
  border-spacing: 3px;
  margin: 0 auto;
}

table.heatmap th {
  min-width: 34px;
  padding: 0 2px 5px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

table.heatmap th.corner {
  min-width: 23px;
}

table.heatmap .episode-number {
  width: 24px;
  padding-right: 4px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  text-align: right;
}

.heat-cell {
  width: 36px;
  height: 29px;
  border: 1px solid rgba(0,0,0,.5);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
  transition: transform .12s ease;
}

.heat-cell:not(.empty):hover,
.heat-cell:not(.empty):focus-visible {
  position: relative;
  z-index: 2;
  transform: scale(1.2);
  border-color: #fff;
  outline: 2px solid #fff;
  outline-offset: 1px;
}

table.heatmap th.axis-active {
  color: var(--yellow);
}

.heat-cell.axis-active:not(.empty) {
  border-color: rgba(255,255,255,.82);
  filter: saturate(1.1) brightness(1.08);
}

.heat-cell.empty {
  border-color: transparent;
  background: transparent;
}

.legend {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.legend-bar {
  height: 9px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, hsl(0 75% 43%), hsl(45 80% 45%), hsl(90 70% 42%), hsl(125 70% 40%));
}

.color-safe-heatmap .legend-bar {
  background: linear-gradient(90deg, #440154, #21918c, #fde725);
}

.heatmap-expand[aria-pressed="true"] {
  border-color: var(--yellow);
  color: var(--yellow);
}

.heatmap-tip {
  margin: 7px 0 0;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
}

.cell-detail {
  min-height: 18px;
  margin: 7px 0 0;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
  text-transform: uppercase;
}

.heatmap-summary {
  margin-top: 5px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
}

.heatmap-summary summary {
  width: fit-content;
  margin: 0 auto;
  color: var(--ink-muted);
  cursor: pointer;
  text-transform: uppercase;
}

.heatmap-summary p {
  margin: 8px 0 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
}

.heatmap-dialog {
  box-sizing: border-box;
  width: min(1180px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  height: min(860px, calc(100svh - 28px));
  max-height: calc(100svh - 28px);
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 8px 8px 0 #000;
}

.heatmap-dialog::backdrop {
  background: rgba(0,0,0,.86);
  backdrop-filter: blur(4px);
}

.heatmap-dialog-card {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(18px, 3vw, 32px);
}

.heatmap-dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.heatmap-dialog-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 46px);
}

.fullscreen-heatmap-scroll {
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
  overscroll-behavior: contain;
}

.fullscreen-heatmap-scroll .heat-cell {
  width: clamp(36px, 5vw, 64px);
  height: clamp(32px, 4vw, 52px);
  font-size: clamp(10px, 1.25vw, 15px);
}

.modal-close.static {
  position: static;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.loading-value {
  min-width: 3ch;
  color: transparent !important;
  background: linear-gradient(90deg, var(--surface-soft), var(--line-bright), var(--surface-soft));
  background-size: 220% 100%;
  animation: loading-pulse 1.2s linear infinite;
}

@keyframes loading-pulse {
  to { background-position: -220% 0; }
}

.returning-player:not(.game-complete) .intro {
  min-height: 88px;
  padding-block: 12px;
}

.returning-player:not(.game-complete) .intro .eyebrow,
.returning-player:not(.game-complete) .intro-copy {
  display: none;
}

.returning-player:not(.game-complete) .intro h1 {
  font-size: clamp(26px, 2.7vw, 34px);
}

.attempt-dots {
  display: flex;
  gap: 5px;
}

.attempt-dot {
  width: 13px;
  height: 13px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background: transparent;
}

.game-progress {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: #101015;
}

.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.progress-heading > div:first-child {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 10px;
}

.progress-heading .section-label {
  margin: 0;
}

.progress-heading strong {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.clue-progress {
  padding: 10px 12px 12px;
}

.clue-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
}

.clue-heading .section-label {
  margin: 0;
}

.attempt-dot.used {
  border-color: var(--red);
  background: var(--red);
}

.attempt-dot.correct {
  border-color: var(--green);
  background: var(--green);
}

.guess-field {
  position: relative;
}

.guess-input {
  width: 100%;
  height: 58px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 0 15px;
}

.guess-input::placeholder {
  color: var(--ink-faint);
  font-weight: 500;
}

.guess-input:focus {
  border-color: var(--accent);
  outline: none;
}

.guess-input:disabled {
  opacity: .5;
}

.suggestions {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
  border: 2px solid var(--accent);
  background: var(--surface-raised);
  box-shadow: 4px 4px 0 #000;
}

.suggestion {
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.suggestion-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.suggestion-copy strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-copy small,
.suggestion-alias {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.suggestion-alias {
  overflow: hidden;
  max-width: 35%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion:hover .suggestion-copy small,
.suggestion:hover .suggestion-alias,
.suggestion.active .suggestion-copy small,
.suggestion.active .suggestion-alias {
  color: rgba(0,0,0,.7);
}

.guess-input[aria-invalid="true"] {
  border-color: var(--red);
}

.suggestion:hover,
.suggestion.active {
  background: var(--accent);
  color: #000;
}

.primary-button,
.secondary-button,
.reddit-button {
  min-height: 50px;
  border: 2px solid var(--ink);
  border-radius: 0;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 11px;
  padding: 0 16px;
  background: var(--accent);
  color: #080808;
  box-shadow: 4px 4px 0 #000;
}

.play-panel #activeGame .primary-button {
  min-height: 58px;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.secondary-button,
.reddit-button {
  padding: 0 16px;
  background: var(--surface-soft);
  color: var(--ink);
}

.reddit-button {
  border-color: var(--reddit);
  color: #fff;
}

.reddit-button span {
  color: var(--reddit);
}

.secondary-button:hover,
.reddit-button:hover {
  background: var(--line);
}

.form-note {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

.hints,
.guess-history {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.hints {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.hint-row,
.history-row {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 11px;
  border-left: 3px solid var(--yellow);
  background: var(--surface-raised);
  animation: slide-in .22s ease;
}

.hint-row {
  grid-template-columns: 1fr;
  gap: 3px;
  min-height: 50px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--yellow);
}

.hint-row.locked {
  border-left-color: var(--line-bright);
  background: var(--surface);
}

.hint-row.locked .hint-value {
  color: var(--ink-faint);
  font-size: 10px;
  font-family: var(--mono);
}

.hint-row.latest {
  animation: clue-unlock .45s ease;
}

@keyframes clue-unlock {
  0% { outline: 0 solid rgba(255,211,61,.7); }
  55% { outline: 5px solid rgba(255,211,61,.22); }
  100% { outline: 0 solid transparent; }
}

.hint-key,
.history-mark {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hint-value,
.history-title {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.history-row {
  grid-template-columns: 18px minmax(0, 1fr);
  border-left-color: var(--red);
}

.history-section {
  margin-top: 15px;
}

.history-section .section-label {
  margin-bottom: 7px;
}

.guess-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.history-row {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid rgba(240,68,68,.5);
  border-left: 3px solid var(--red);
  background: rgba(240,68,68,.08);
}

.history-row .history-title {
  font-size: 13px;
  text-decoration: line-through;
}

.history-row.correct {
  border-left-color: var(--green);
}

.history-row.correct .history-mark {
  color: var(--green);
}

.history-row:not(.correct) .history-mark {
  color: var(--red);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}

.status-message {
  min-height: 20px;
  margin: 13px 0 0;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.play-panel {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-bright) var(--surface);
}

.result-panel {
  position: relative;
  margin-top: 24px;
  overflow: hidden;
}

.result-panel[hidden] {
  display: none;
}

.game-complete .intro,
.game-complete .game-grid,
.game-complete .trust-row,
.game-complete .site-footer {
  display: none;
}

.game-complete .result-panel {
  max-height: calc(100svh - 82px);
  margin-top: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-bright) var(--surface);
}

.result-stripe {
  height: 7px;
  background: var(--green);
}

.result-panel.lost .result-stripe {
  background: var(--red);
}

.result-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 28px;
  padding: clamp(22px, 4vw, 38px);
}

.result-label {
  margin: 0 0 10px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.lost .result-label {
  color: var(--red);
}

.result-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 62px);
  letter-spacing: -.055em;
  line-height: .95;
}

.result-performance {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.performance-chip {
  padding: 7px 9px;
  border: 1px solid var(--line-bright);
  background: var(--surface-raised);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.streak-chip {
  border-color: var(--yellow);
  color: var(--yellow);
}

.result-meta {
  margin: 11px 0 0;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  text-transform: uppercase;
}

.result-overview {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--ink-muted);
  line-height: 1.45;
}

.poster-frame {
  position: relative;
  width: 150px;
  height: 220px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: linear-gradient(135deg, #352020, #12121c);
  display: flex;
  align-items: flex-end;
  padding: 11px;
}

.poster-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-frame span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  line-height: .95;
  text-transform: uppercase;
}

.episode-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.episode-card {
  padding: 14px 16px;
  background: var(--surface);
}

.episode-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.episode-card strong {
  color: var(--green);
  font-family: var(--mono);
  font-size: 18px;
}

.episode-card.worst strong {
  color: var(--red);
}

.result-insight {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 18px clamp(22px, 4vw, 38px);
  border-top: 1px solid var(--line);
  background: rgba(255,211,61,.055);
}

.result-insight-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-family: var(--mono);
  font-weight: 800;
}

.result-insight p {
  max-width: 780px;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.share-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 24px clamp(22px, 4vw, 38px);
  border-top: 1px solid var(--line);
  background: #101015;
}

.share-actions {
  display: flex;
  gap: 8px;
}

.share-actions .primary-button {
  width: auto;
  min-width: 190px;
  margin: 0;
  gap: 22px;
}

.result-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(22px, 4vw, 38px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.result-tools h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(19px, 2.5vw, 25px);
}

.result-tools .secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: var(--yellow);
}

.result-tools .secondary-button > span:first-child {
  color: var(--yellow);
}

.community {
  padding: clamp(22px, 4vw, 38px);
  border-top: 1px solid var(--line);
}

.community[hidden] {
  display: none;
}

.community-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.community-summary {
  display: flex;
  gap: clamp(18px, 5vw, 44px);
}

.community-summary span {
  display: grid;
  text-align: center;
}

.community-summary b {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 20px;
}

.community-summary small {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(26px, 6vw, 70px);
}

.distribution-row {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
}

.distribution-track {
  height: 18px;
  background: var(--surface-soft);
}

.distribution-bar {
  min-width: 2px;
  height: 100%;
  background: var(--green);
}

.distribution-row.fail .distribution-bar {
  background: var(--red);
}

.distribution-row.mine .distribution-bar {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
}

.leaderboard-rank {
  color: var(--ink-muted);
}

.leaderboard-row:nth-child(1) .leaderboard-rank { color: #ffd700; }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #c0c0c0; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #cd7f32; }

.leaderboard-dots {
  display: flex;
  gap: 3px;
}

.leaderboard-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.leaderboard-dots i.on {
  background: var(--green);
}

.leaderboard-time {
  color: var(--yellow);
  font-weight: 700;
}

.your-rank {
  margin: 10px 0 0;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 10px;
}

.empty-state {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
}

.trust-row {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  margin: 42px 0;
  border: 1px solid var(--line);
}

.trust-row > div {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.trust-row > div:last-child {
  border: 0;
}

.trust-row strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 20px;
}

.trust-row span {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.site-footer {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.7;
}

.modal-attribution {
  margin: 22px 0 14px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.65;
  text-align: center;
}

.modal-attribution a {
  color: var(--ink-muted);
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
}

.modal {
  box-sizing: border-box;
  width: min(600px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 8px 8px 0 #000;
}

.modal::backdrop {
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  min-width: 0;
  padding: clamp(26px, 6vw, 46px);
}

.modal-card h2 {
  max-width: 450px;
  margin: 0;
  padding-right: 42px;
  font-family: var(--display);
  font-size: clamp(30px, 6vw, 48px);
  letter-spacing: -.05em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 24px;
}

.creator-modal {
  width: min(940px, calc(100vw - 28px));
}

.creator-modal-card {
  padding: clamp(24px, 4vw, 38px);
}

.creator-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(26px, 5vw, 52px);
}

.creator-preview-shell {
  min-width: 0;
  max-height: calc(100svh - 86px);
  display: grid;
  place-items: center;
}

.creator-preview-shell canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100svh - 92px);
  border: 1px solid var(--line-bright);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.creator-copy {
  min-width: 0;
}

.creator-copy h2 {
  max-width: 540px;
  padding-right: 34px;
}

.creator-intro {
  max-width: 540px;
  margin: 17px 0 0;
  color: var(--ink-muted);
  font-size: 20px;
  line-height: 1.35;
}

.creator-points {
  display: grid;
  gap: 1px;
  margin: 22px 0;
  background: var(--line);
}

.creator-points > div {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  background: var(--surface-raised);
}

.creator-points span {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.creator-points p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.25;
}

.creator-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.creator-actions .primary-button {
  grid-column: 1 / -1;
  margin: 0;
}

.creator-note {
  margin: 13px 0 0;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  text-transform: uppercase;
}

.how-grid {
  display: grid;
  gap: 18px;
  margin: 28px 0;
}

.how-grid > div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  min-width: 0;
}

.how-grid > div > div {
  min-width: 0;
}

.how-grid > div > span {
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.how-grid h3 {
  margin: 0 0 3px;
  font-size: 20px;
  text-transform: uppercase;
}

.how-grid p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.35;
}

.full-width {
  width: 100%;
}

.personal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 28px 0;
  background: var(--line);
}

.personal-stats div {
  display: grid;
  gap: 5px;
  padding: 15px 8px;
  background: var(--surface-raised);
  text-align: center;
}

.personal-stats strong {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 20px;
}

.personal-stats span {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100% - 30px);
  padding: 11px 17px;
  border: 2px solid #000;
  background: var(--ink);
  color: #000;
  box-shadow: 4px 4px 0 var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, 120px);
  transition: transform .22s ease;
}

.toast.visible {
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 200;
  padding: 15px;
  background: var(--red);
  color: #fff;
  text-align: center;
}

@media (max-width: 900px) {
  .game-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    min-height: 0;
  }

  .heatmap-panel {
    min-height: min(560px, 68svh);
  }
}

@media (max-width: 660px) {
  .site-header {
    width: calc(100% - 22px);
    min-height: 56px;
    gap: 8px;
  }

  .brand {
    min-width: 0;
    font-size: 21px;
  }

  .header-actions {
    flex-shrink: 0;
    gap: 4px;
  }

  .button-label {
    display: none;
  }

  .icon-button {
    width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
  }

  .language-select {
    min-height: 44px;
    padding: 0 5px;
  }

  .intro {
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 10px;
    min-height: 100px;
    padding: 10px 0 12px;
  }

  .intro .eyebrow,
  .intro-copy {
    display: none;
  }

  .intro h1 {
    font-size: clamp(25px, 7.4vw, 30px);
    line-height: .98;
  }

  .intro h1 br {
    display: none;
  }

  .daily-panel {
    width: 108px;
    box-shadow: 3px 3px 0 #000;
  }

  .daily-number {
    padding: 7px 8px;
    font-size: 8px;
  }

  .daily-number strong {
    font-size: 14px;
  }

  .daily-meta {
    gap: 4px;
    padding: 7px 8px;
    font-size: 7px;
  }

  .daily-meta span {
    display: grid;
    gap: 1px;
  }

  .game-grid {
    min-height: 0;
    max-height: none;
    grid-template-rows: auto auto;
    gap: 10px;
  }

  .heatmap-panel {
    min-height: min(520px, 66svh);
  }

  .panel {
    padding: 12px 11px 13px;
  }

  .panel-heading {
    display: grid;
    gap: 7px;
    margin-bottom: 9px;
  }

  .panel-heading.compact {
    grid-template-columns: 1fr auto;
  }

  .dimension-pill {
    justify-self: start;
  }

  .heatmap-actions {
    justify-content: space-between;
  }

  .panel-kicker {
    margin-bottom: 5px;
    font-size: 8px;
  }

  .panel-heading h2 {
    font-size: 22px;
  }

  .heatmap-tip {
    display: none;
  }

  .legend {
    margin-top: 7px;
  }

  .play-panel {
    max-height: none;
  }

  .guess-input {
    height: 46px;
    font-size: 19px;
  }

  .primary-button,
  .secondary-button,
  .reddit-button {
    min-height: 44px;
  }

  .play-panel #activeGame .primary-button {
    min-height: 46px;
  }

  .form-note {
    margin-top: 8px;
  }

  .clue-heading {
    display: grid;
    gap: 3px;
  }

  .heat-cell {
    width: 31px;
    height: 27px;
    font-size: 9px;
  }

  table.heatmap th {
    min-width: 29px;
  }

  .result-content {
    grid-template-columns: 1fr 96px;
    gap: 15px;
  }

  .poster-frame {
    width: 96px;
    height: 142px;
  }

  .result-overview {
    grid-column: 1 / -1;
  }

  .episode-highlights {
    grid-template-columns: repeat(2, 1fr);
  }

  .share-block,
  .community-heading,
  .result-tools {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .share-actions .share-primary {
    grid-column: 1 / -1;
    width: 100%;
  }

  .community-summary {
    justify-content: space-between;
  }

  .community-grid {
    grid-template-columns: 1fr;
  }

  .heatmap-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: calc(100svh - 16px);
    max-height: calc(100svh - 16px);
  }

  .heatmap-dialog-card {
    padding: 14px;
  }

  .trust-row {
    grid-template-columns: 1fr;
  }

  .trust-row > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .site-footer {
    display: none;
  }

  .creator-modal-card {
    padding: 22px;
  }

  .creator-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .creator-preview-shell {
    max-height: 300px;
  }

  .creator-preview-shell canvas {
    max-height: 290px;
  }

  .creator-copy h2 {
    font-size: 30px;
  }

  .creator-intro {
    font-size: 17px;
  }

  .creator-points {
    margin: 16px 0;
  }
}

@media (max-width: 430px) {
  .site-header,
  .page-shell,
  .site-footer {
    width: min(100% - 22px, 1180px);
  }

  .result-content {
    grid-template-columns: 1fr;
  }

  .poster-frame {
    grid-row: 1;
    width: 82px;
    height: 120px;
  }

  .personal-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .hints {
    grid-template-columns: 1fr;
  }

  .heatmap-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .heatmap-actions .dimension-pill {
    grid-column: 1 / -1;
  }

  .heatmap-actions .heatmap-expand {
    width: 100%;
  }

  .progress-heading {
    align-items: flex-end;
  }

  .result-insight {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  .result-insight-mark {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 360px) {
  .brand {
    font-size: 17px;
  }

  .site-header {
    gap: 4px;
  }
}

@media (forced-colors: active) {
  .heat-cell:not(.empty) {
    border: 2px solid CanvasText;
    forced-color-adjust: none;
  }

  .attempt-dot.used,
  .attempt-dot.correct {
    background: CanvasText;
  }
}

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