@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter-cyrillic.woff2") format("woff2");
  unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter-latin-ext.woff2") format("woff2");
  unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter-latin.woff2") format("woff2");
  unicode-range: U+0-FF,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: light dark;
  --background: light-dark(oklch(1 0 0), oklch(.145 0 0));
  --foreground: light-dark(oklch(.145 0 0), oklch(.985 0 0));
  --card: light-dark(oklch(1 0 0), oklch(.205 0 0));
  --muted: light-dark(oklch(.97 0 0), oklch(.269 0 0));
  --muted-foreground: light-dark(oklch(.556 0 0), oklch(.708 0 0));
  --border: light-dark(oklch(.922 0 0), oklch(1 0 0 / 10%));
  --ring: light-dark(oklch(.708 0 0), oklch(.556 0 0));
  --radius: .625rem;
  font-family: Inter, Arial, sans-serif;
  scroll-padding-top: 5rem;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.sun, :root[data-theme="dark"] .moon { display: none; }
:root[data-theme="dark"] .sun { display: inline; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .sun { display: inline; }
  :root:not([data-theme]) .moon { display: none; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], .symbols { display: none !important; }
body { margin: 0; background: var(--background); color: var(--foreground); }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

.shell {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 80%, transparent);
  backdrop-filter: blur(8px);
}

.header-content {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.brand { display: flex; align-items: center; gap: .5rem; font-size: 1.125rem; font-weight: 700; letter-spacing: -.025em; }
.controls { display: flex; align-items: center; gap: .5rem; }
.current { display: none; padding: .625rem .75rem; border-radius: var(--radius); background: var(--muted); font-size: .875rem; font-weight: 500; text-transform: lowercase; }
#theme, #language {
  display: grid;
  min-width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

#theme:hover, #language:hover, #language[aria-expanded="true"] { background: var(--muted); }
.language-control { position: relative; }
#language {
  grid-auto-flow: column;
  gap: .375rem;
  padding-inline: .625rem;
  font-size: .75rem;
  font-weight: 600;
}

#language-list {
  position: absolute;
  inset-block-start: calc(100% + .25rem);
  inset-inline-end: 0;
  width: 11rem;
  margin: 0;
  padding: .25rem;
  border-radius: .75rem;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--border), 0 8px 18px #0002;
  list-style: none;
  font-size: .875rem;
}

#language-list a {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: space-between;
  padding-inline: .75rem;
  border-radius: .5rem;
}

#language-list a:is(:hover, :focus-visible) { background: var(--muted); outline-offset: -2px; }

.controls svg, .arrow {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page { padding-block: 1.5rem; }
.catalog-intro { max-width: 48rem; margin-inline: auto; padding-block: .75rem; text-align: center; }
.catalog-intro h1 { margin: 0; font-size: 1.875rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.catalog-intro .description { margin: 1rem auto 0; max-width: 42rem; color: var(--muted-foreground); line-height: 1.625; }
.catalog-intro h1, .game-link strong { overflow-wrap: anywhere; text-wrap: balance; }
.catalog-intro, .game-list { text-transform: lowercase; }
.game-list { display: grid; gap: 1rem; margin-top: 2rem; }
.game-link {
  --card-padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 12rem;
  padding: var(--card-padding);
  border-radius: calc(var(--radius) * 1.4);
  background: var(--card);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent);
}
.game-link.featured { min-height: 13rem; }
a.game-link { transition: box-shadow .2s; }
a.game-link:hover { box-shadow: 0 0 0 1px var(--border), 0 4px 6px -1px #0002, 0 2px 4px -2px #0002; }
.tile-top { margin-bottom: auto; padding-bottom: 1.5rem; }
.emoji { font-size: 1.875rem; line-height: 1.2; }
.arrow {
  position: absolute;
  inset-block-start: var(--card-padding);
  inset-inline-end: var(--card-padding);
  color: color-mix(in oklab, var(--muted-foreground) 50%, transparent);
}
a.game-link:hover .arrow { color: var(--foreground); }
.game-link strong, .game-link small { display: block; }
.game-link strong { font-size: 1.125rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.55; }
.game-link small { max-width: 32rem; margin-top: .5rem; color: var(--muted-foreground); font-size: .875rem; line-height: 1.6; }
.label { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; color: var(--muted-foreground); font-size: .75rem; }
.label::before { content: ""; width: .375rem; height: .375rem; border-radius: 50%; background: #22c55e; }

@media (min-width: 40rem) {
  .shell { padding-inline: 1.5rem; }
  .page { padding-block: 2.5rem; }
  .brand { font-size: 1.25rem; }
  .current { display: block; margin-right: .75rem; }
  .catalog-intro { padding-block: 1.5rem; }
  .catalog-intro h1 { font-size: 2.25rem; line-height: 1.1; }
  .catalog-intro .description { font-size: 1.125rem; }
  .game-list { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.25rem; margin-top: 3rem; }
  .game-link { --card-padding: 1.75rem; grid-column: span 5; min-height: 16rem; }
  .game-link.featured { grid-column: span 7; min-height: 16rem; }
  .featured .emoji { font-size: 2.25rem; }
  .featured strong { font-size: 1.25rem; }
  .game-link.upcoming { min-height: 13rem; }
  .game-link.upcoming:last-child { grid-column: span 7; }
}

@media (min-width: 64rem) {
  .shell { padding-inline: 2rem; }
  .catalog-intro h1 { font-size: 3rem; line-height: 1; }
}

.game-panel {
  --card: light-dark(#fff, #1b1b1b);
  --border: light-dark(#e5e5e5, #333);
  --muted: light-dark(#646464, #b3b3b3);
  --badge: light-dark(#f7f7f7, #242424);
  --status: light-dark(#168354, #56c493);
  --accent: light-dark(#eff8f3, #202d27);
  --accent-border: light-dark(#c6e1d2, #3b594a);
  --go: light-dark(#d6f3e3, #245239);
  --early: light-dark(#fff0e9, #432c26);
  width: min(100%, 34rem);
  margin-inline: auto;
  padding: clamp(1.25rem, 6vw, 3rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--card);
  box-shadow: 0 12px 38px #0000000a;
}

.game-panel h1 { margin: 0; font-size: clamp(1.85rem, 7vw, 3.3rem); font-weight: 650; letter-spacing: -.055em; line-height: 1.12; }
.game-panel .description { margin: .85rem 0 0; max-width: 24rem; color: var(--muted); line-height: 1.55; text-wrap: pretty; }
.back { display: inline-flex; gap: .4rem; margin-bottom: .8rem; color: var(--muted); font-size: .875rem; }
.back:hover { color: var(--foreground); }

.construction-page {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: 2rem;
  padding: 2rem 0;
  text-align: center;
}
.construction-page::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 1rem;
  background-image: linear-gradient(#8080800b 1px, transparent 1px),
    linear-gradient(90deg, #8080800b 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(black, transparent);
  content: "";
}
.construction-intro { width: min(100%, 36rem); }
.construction-intro .label {
  display: inline-flex;
  margin: 0 0 1rem;
  padding: .375rem .75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted) 30%, transparent);
  line-height: 1rem;
}
.construction-intro h1 { margin: 0; font-size: 1.875rem; font-weight: 700; letter-spacing: -.025em; line-height: 2.25rem; text-transform: lowercase; }
.construction-intro .description { margin: 1rem 0 0; color: var(--muted-foreground); line-height: 1.625; }
.construction-terminal {
  width: min(100%, 36rem);
  overflow: hidden;
  border: 1px solid #262626;
  border-radius: var(--radius);
  background: #171717;
  color: #e5e5e5;
  box-shadow: 0 25px 50px -12px #0004;
  font-size: .75rem;
  line-height: 1rem;
  text-align: start;
}

.terminal-bar {
  position: relative;
  padding: .75rem 1rem;
  background: #262626;
  color: #a3a3a3;
  text-align: center;
}
.terminal-dots { position: absolute; inset-inline-start: 1rem; top: 50%; display: flex; gap: .375rem; transform: translateY(-50%); }
.terminal-dots i { width: .75rem; height: .75rem; border-radius: 50%; background: #ef4444; }
.terminal-dots i:nth-child(2) { background: #eab308; }
.terminal-dots i:nth-child(3) { background: #22c55e; }
.terminal-body { height: 16rem; overflow-y: auto; padding: 1rem; overflow-wrap: anywhere; line-height: 1.625; }
.terminal-body p { margin: 0; }
.terminal-command { color: #737373; }
.terminal-command span:first-child { color: #0ea5e9; }
.terminal-command span:nth-child(2) { color: #38bdf8; }
.terminal-command code { display: inline-block; color: #6ee7b7; font: inherit; }
.terminal-output { color: #a3a3a3; }
.terminal-prompt b { display: inline-block; width: .5rem; height: .9rem; background: #d4d4d4; vertical-align: middle; }
@media (min-width: 40rem) {
  .construction-page { gap: 2.5rem; padding: 3rem 0; }
  .construction-intro h1 { font-size: 2.25rem; line-height: 2.5rem; }
  .construction-intro .description { font-size: 1.125rem; }
  .terminal-body { height: 20rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .construction-intro .label::before { animation: status-pulse 1.5s ease-out infinite; }
  .terminal-entry { --delay: .25s; }
  .terminal-entry:nth-child(2) { --delay: 1s; }
  .terminal-entry:nth-child(3) { --delay: 1.75s; }
  .terminal-entry .terminal-command { animation: terminal-reveal .01s step-end var(--delay) both; }
  .terminal-command code { animation: terminal-type .42s steps(13, end) var(--delay) both; }
  .terminal-output { animation: terminal-reveal .01s step-end calc(var(--delay) + .5s) both; }
  .terminal-prompt { animation: terminal-reveal .01s step-end 2.45s both; }
}

@keyframes status-pulse {
  from { box-shadow: 0 0 0 0 #4ade80b3; }
  to { box-shadow: 0 0 0 .35rem #4ade8000; }
}

@keyframes terminal-type {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}

@keyframes terminal-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reaction-pad {
  width: 100%;
  min-height: 10rem;
  margin-top: 1.3rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: .85rem;
  background: var(--badge);
  font-size: clamp(1.1rem, 5vw, 1.6rem);
  font-weight: 650;
  touch-action: manipulation;
  user-select: none;
}

.reaction-pad[data-state="wait"] { background: var(--card); }
.reaction-pad[data-state="go"] { background: var(--go); border-color: var(--status); }
.reaction-pad[data-state="early"] { background: var(--early); }
.reaction-pad[data-state="hit"], .reaction-pad[data-state="done"] { background: var(--accent); border-color: var(--accent-border); }
.game-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem .8rem;
  margin-top: .8rem;
  color: var(--muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.game-detail { min-height: 2.7em; margin: .65rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.shade-stats { margin-top: 1.15rem; }
.shade-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: .35rem;
  width: min(100%, 20rem);
  margin: .75rem auto 0;
}

.tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: .5rem;
  background: var(--tile);
  color: #151515;
  font-weight: 800;
  touch-action: manipulation;
}

.tile:focus-visible { outline-color: var(--foreground); }
.tile:disabled { cursor: default; }
.tile.revealed { outline: 2px solid var(--foreground); outline-offset: -4px; }
.shade-result { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1rem; }
.shade-result p { margin: 0; color: var(--muted); font-size: .875rem; }
.action { padding: .5rem .75rem; border: 1px solid var(--border); border-radius: .6rem; background: var(--badge); font-size: .875rem; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
