:root {
  color-scheme: dark;
  --bg: #191a1c;
  --bg-deep: #151618;
  --surface: #222427;
  --surface-strong: #292c2f;
  --text: #e8e4dc;
  --text-soft: #d0ccc3;
  --muted: #9a9c9c;
  --faint: #44484b;
  --accent: #e9b949;
  --accent-soft: #997a35;
  --cool: #78a6a0;
  --error: #c36a62;
  --line: rgba(232, 228, 220, 0.1);
  --shadow: rgba(0, 0, 0, 0.34);
  --font: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f2;
  --bg-deep: #e8ece7;
  --surface: #dfe4df;
  --surface-strong: #d0d7d1;
  --text: #292a2c;
  --text-soft: #4e5051;
  --muted: #6f706c;
  --faint: #bec6bf;
  --accent: #a66f08;
  --accent-soft: #c09849;
  --cool: #4c7c77;
  --error: #a84f47;
  --line: rgba(41, 42, 44, 0.11);
  --shadow: rgba(50, 46, 38, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  letter-spacing: 0;
  transition: background-color 180ms ease, color 180ms ease;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.game {
  position: relative;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 54px;
  width: 100%;
  height: 100dvh;
  isolation: isolate;
  --pressure: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(10vw - 1px), rgba(255, 255, 255, 0.013) 10vw),
    repeating-linear-gradient(0deg, transparent 0, transparent 79px, rgba(255, 255, 255, 0.012) 80px),
    linear-gradient(180deg, var(--bg-deep) 0, var(--bg) 18%, var(--bg) 100%);
}

.game::before {
  content: "";
  position: absolute;
  inset: 72px 0 54px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
  background: linear-gradient(112deg, transparent 0 48%, var(--line) 48.08% 48.16%, transparent 48.24% 100%);
}

.game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.23;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

.topbar,
.footer {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  width: 100%;
  padding-inline: clamp(18px, 4vw, 64px);
}

.topbar {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  width: 112px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}

.brand strong,
.idle-mark strong,
.game-over h1 strong {
  color: var(--accent);
  font-weight: 700;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3.2vw, 52px);
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.game[data-state="playing"] .hud,
.game[data-state="paused"] .hud {
  opacity: 1;
  transform: translateY(0);
}

.stat {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.stat span,
.results span {
  color: var(--muted);
  font-size: 12px;
  text-transform: lowercase;
}

.stat strong {
  min-width: 2ch;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stat-score strong {
  min-width: 5ch;
  color: var(--text);
}

.lives {
  display: flex;
  gap: 7px;
  width: 53px;
}

.life {
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
  background: var(--accent);
  transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.life.is-lost {
  opacity: 0.2;
  background: transparent;
  transform: rotate(45deg) scale(0.7);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 130ms ease, background-color 130ms ease;
}

.icon-button:hover {
  color: var(--text);
}

.playfield {
  position: relative;
  min-height: 0;
  overflow: hidden;
  cursor: text;
}

.depth-line {
  position: absolute;
  right: 0;
  bottom: 45px;
  left: 0;
  height: 1px;
  opacity: 0;
  background: var(--error);
  transition: opacity 150ms ease;
}

.game[data-state="playing"] .depth-line {
  opacity: 0.14;
}

.word {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 5px 7px;
  color: var(--muted);
  font-size: clamp(17px, 1.45vw, 23px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  will-change: transform;
  transform: translate3d(0, -40px, 0);
  transition: color 120ms ease, opacity 140ms ease, filter 140ms ease;
}

.word::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 2px;
  height: 0;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height 120ms ease;
}

.word.is-active {
  color: var(--text-soft);
}

.word.is-active::before {
  height: 70%;
}

.word .typed {
  color: var(--accent);
}

.word.is-error {
  color: var(--error);
  filter: brightness(1.08);
}

.word.is-complete {
  opacity: 0;
  filter: blur(2px);
  animation: word-complete 150ms ease-out forwards;
}

.word.is-missed {
  color: var(--error);
  opacity: 0;
  transition-duration: 180ms;
}

@keyframes word-complete {
  from { transform: translate3d(var(--word-x), var(--word-y), 0) scale(1); }
  to { transform: translate3d(var(--word-x), calc(var(--word-y) - 7px), 0) scale(1.045); }
}

.dust {
  position: absolute;
  z-index: 3;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  animation: dust-out 180ms ease-out forwards;
}

@keyframes dust-out {
  to {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.4);
  }
}

.state-panel {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  visibility: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.state-panel.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.idle {
  justify-content: flex-start;
  padding-top: clamp(120px, 21vh, 220px);
}

.idle-mark {
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 400;
  line-height: 1;
}

.idle p {
  margin: 20px 0 32px;
  color: var(--text-soft);
  font-size: clamp(13px, 1.2vw, 16px);
}

.start-hint {
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: text;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

@keyframes hint-pulse {
  50% { color: var(--text-soft); }
}

.pause {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
}

.pause h1,
.game-over h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 40px);
  font-weight: 500;
}

.pause p {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.game-over {
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: clamp(52px, 10vh, 110px);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.results {
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  gap: clamp(18px, 3vw, 45px);
  margin: clamp(38px, 6vh, 65px) 0 31px;
}

.results div {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: center;
}

.results strong {
  color: var(--text);
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.new-best {
  height: 17px;
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  opacity: 0;
}

.new-best.is-visible {
  opacity: 1;
  animation: best-in 600ms ease-out;
}

@keyframes best-in {
  from { letter-spacing: 0.12em; opacity: 0; }
  to { letter-spacing: 0; opacity: 1; }
}

.actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 24px;
}

.primary-button,
.text-button,
.reset-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  min-height: 44px;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--bg-deep);
  font-size: 14px;
  font-weight: 700;
  transition: transform 120ms ease, filter 120ms ease;
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.text-button {
  min-height: 44px;
  padding: 12px 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
}

.text-button:hover {
  color: var(--accent);
}

.progress-message,
.combo-message,
.miss-message {
  position: absolute;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
}

.progress-message {
  top: 18%;
  left: 50%;
  color: var(--muted);
  font-size: 13px;
  transform: translateX(-50%);
}

.progress-message.is-visible {
  animation: message-in 1.6s ease both;
}

.combo-message {
  top: 29%;
  right: 7%;
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}

.combo-message.is-visible {
  animation: combo-in 900ms ease both;
}

.miss-message {
  right: 5%;
  bottom: 62px;
  color: var(--error);
  font-size: 13px;
}

.miss-message.is-visible {
  animation: message-in 650ms ease both;
}

@keyframes message-in {
  0% { opacity: 0; transform: translate(-50%, 5px); }
  18%, 72% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}

@keyframes combo-in {
  0% { opacity: 0; transform: translateY(6px); }
  20%, 72% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

.footer {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.best {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.best strong {
  color: var(--text-soft);
  font-weight: 500;
}

.sound-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 8px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.sound-button:hover {
  color: var(--text-soft);
}

.sound-bars {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 10px;
}

.sound-bars i {
  display: block;
  width: 2px;
  background: var(--accent);
}

.sound-bars i:nth-child(1) { height: 4px; }
.sound-bars i:nth-child(2) { height: 8px; }
.sound-bars i:nth-child(3) { height: 6px; }
.sound-button.is-muted .sound-bars i { height: 2px; background: var(--muted); }

.mobile-input {
  position: fixed;
  bottom: -20px;
  left: 50%;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
}

.toast {
  position: fixed;
  bottom: 67px;
  left: 50%;
  z-index: 40;
  padding: 8px 11px;
  background: var(--surface-strong);
  color: var(--text-soft);
  font-size: 12px;
  box-shadow: 0 8px 25px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity 150ms ease, transform 150ms ease;
}

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

.settings {
  width: min(390px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px var(--shadow);
}

.settings::backdrop {
  background: rgba(8, 9, 10, 0.52);
  backdrop-filter: blur(3px);
}

.settings form {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px;
}

.settings-head,
.setting-row,
.volume-row > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-head {
  margin-bottom: 14px;
}

.settings h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-button {
  font-size: 24px;
}

.setting-row,
.volume-row,
.settings fieldset {
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.setting-row span,
.volume-row > span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.setting-row strong,
.volume-row strong,
.settings legend {
  font-size: 13px;
  font-weight: 500;
}

.setting-row small {
  color: var(--muted);
  font-size: 11px;
}

.setting-row input {
  position: relative;
  width: 34px;
  height: 18px;
  margin: 0;
  appearance: none;
  border-radius: 9px;
  background: var(--faint);
  cursor: pointer;
}

.setting-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-soft);
  transition: transform 120ms ease, background-color 120ms ease;
}

.setting-row input:checked {
  background: var(--accent-soft);
}

.setting-row input:checked::after {
  background: var(--accent);
  transform: translateX(16px);
}

.volume-row output {
  color: var(--muted);
  font-size: 12px;
}

.volume-row input {
  width: 100%;
  height: 3px;
  margin: 18px 0 2px;
  appearance: none;
  background: var(--faint);
  accent-color: var(--accent);
  cursor: pointer;
}

.volume-row input::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  appearance: none;
  border-radius: 50%;
  background: var(--accent);
}

.settings fieldset {
  margin: 0;
}

.settings legend {
  margin-bottom: 13px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: var(--bg-deep);
}

.segmented label {
  position: relative;
  text-align: center;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: block;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.segmented input:checked + span {
  background: var(--surface-strong);
  color: var(--text);
}

.reset-button {
  align-self: flex-start;
  margin-top: 5px;
  padding: 10px 0;
  background: transparent;
  color: var(--error);
  font-size: 12px;
}

.brand-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 170px;
}

.run-label {
  margin-top: -8px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.hud {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -5px);
}

.game[data-state="playing"] .hud,
.game[data-state="paused"] .hud {
  transform: translate(-50%, 0);
}

.field-legend {
  position: absolute;
  top: 18px;
  right: clamp(48px, 6vw, 96px);
  left: clamp(18px, 4vw, 64px);
  z-index: 1;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.55;
}

.field-watermark {
  position: absolute;
  top: 50%;
  right: clamp(55px, 8vw, 150px);
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: transparent;
  font-size: clamp(54px, 8vw, 130px);
  font-weight: 700;
  line-height: 0.72;
  text-transform: uppercase;
  -webkit-text-stroke: 1px var(--faint);
  opacity: 0.22;
  transform: translateY(-50%);
}

.field-watermark strong {
  color: var(--faint);
  font-weight: 700;
  -webkit-text-stroke: 0;
}

.pressure-haze {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  height: 46%;
  pointer-events: none;
  opacity: calc(0.03 + var(--pressure) * 0.18);
  background: linear-gradient(0deg, color-mix(in srgb, var(--error) 42%, transparent), transparent 78%);
  transition: opacity 80ms linear;
}

.pressure-rail {
  position: absolute;
  top: 50%;
  right: clamp(16px, 3vw, 48px);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(-50%);
}

.pressure-rail > span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.pressure-rail i {
  position: relative;
  display: block;
  width: 2px;
  height: clamp(110px, 22vh, 190px);
  overflow: hidden;
  background: var(--faint);
}

.pressure-rail b {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(0deg, var(--error), var(--accent));
  transform: scaleY(var(--pressure));
  transform-origin: bottom;
  transition: transform 80ms linear;
}

.game[data-state="playing"] .depth-line {
  opacity: calc(0.18 + var(--pressure) * 0.35);
}

.word[data-weight="3"],
.word[data-weight="4"] {
  color: color-mix(in srgb, var(--muted) 72%, var(--cool));
  font-weight: 600;
}

.dust {
  width: 7px;
  height: 2px;
  border-radius: 0;
}

.idle {
  align-items: flex-start;
  justify-content: center;
  padding: 0 clamp(28px, 11vw, 180px);
  text-align: left;
}

.idle::after {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: clamp(17px, 6vw, 94px);
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--cool), transparent);
  opacity: 0.28;
}

.idle-kicker {
  margin: 0 0 14px !important;
  color: var(--cool) !important;
  font-size: 11px !important;
  text-transform: uppercase;
}

.idle > p:not(.idle-kicker) {
  margin: 20px 0 30px;
}

.run-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(290px, 100%);
  border-bottom: 1px solid var(--faint);
}

.run-mode button {
  position: relative;
  padding: 11px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.run-mode button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 140ms ease;
}

.run-mode button.is-selected {
  color: var(--text);
}

.run-mode button.is-selected::after {
  transform: scaleX(1);
}

.run-mode button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.run-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.start-hint {
  margin-top: 25px;
  padding-inline: 0;
}

.run-verdict {
  margin: 16px 0 0;
  color: var(--cool);
  font-size: 14px;
  text-transform: uppercase;
}

.buried-by {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.buried-by strong {
  color: var(--error);
  font-weight: 500;
}

.game-over {
  background: color-mix(in srgb, var(--bg) 91%, transparent);
}

.results {
  margin: clamp(30px, 4.5vh, 52px) 0 25px;
}

.actions {
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 2vw, 24px);
}

/* Large-display type system */
body {
  font-size: 20px;
}

.game {
  grid-template-rows: 92px minmax(0, 1fr) 64px;
}

.game::before {
  inset: 92px 0 64px;
}

.brand-cluster {
  width: 210px;
}

.brand {
  width: 145px;
  font-size: 29px;
}

.run-label {
  margin-top: -5px;
  font-size: 15px;
}

.hud {
  gap: clamp(28px, 3.5vw, 64px);
}

.stat {
  gap: 10px;
}

.stat span,
.results span {
  font-size: 17px;
}

.stat strong {
  font-size: 24px;
}

.lives {
  gap: 10px;
  width: 70px;
}

.life {
  width: 13px;
  height: 13px;
}

.icon-button {
  width: 50px;
  height: 50px;
  font-size: 24px;
}

.field-legend {
  top: 22px;
  font-size: 16px;
  opacity: 0.72;
}

.field-watermark {
  font-size: clamp(72px, 9vw, 150px);
  line-height: 0.78;
}

.pressure-rail > span {
  font-size: 16px;
}

.pressure-rail i {
  width: 4px;
}

.word {
  padding: 8px 10px;
  font-size: clamp(38px, 3.2vw, 54px);
}

.word::before {
  left: -7px;
  width: 3px;
}

.idle-mark {
  font-size: clamp(64px, 7vw, 102px);
}

.idle-kicker {
  margin-bottom: 20px !important;
  font-size: 16px !important;
}

.idle > p:not(.idle-kicker) {
  margin: 26px 0 38px;
  font-size: clamp(20px, 1.6vw, 25px);
}

.run-mode {
  width: min(410px, 100%);
}

.run-mode button {
  min-height: 52px;
  font-size: 18px;
}

.run-note {
  margin-top: 16px;
  font-size: 17px;
}

.start-hint {
  margin-top: 32px;
  min-height: 48px;
  font-size: 20px;
}

.pause h1,
.game-over h1 {
  font-size: clamp(38px, 4vw, 58px);
}

.pause p {
  font-size: 18px;
}

.eyebrow {
  font-size: 16px;
}

.run-verdict {
  font-size: 20px;
}

.buried-by {
  font-size: 19px;
}

.results {
  gap: clamp(24px, 3.5vw, 60px);
}

.results strong {
  font-size: clamp(25px, 2.4vw, 36px);
}

.new-best,
.progress-message,
.miss-message {
  font-size: 19px;
}

.combo-message {
  font-size: 32px;
}

.primary-button,
.text-button {
  min-height: 52px;
  font-size: 19px;
}

.footer,
.sound-button {
  font-size: 17px;
}

.settings {
  width: min(470px, calc(100vw - 28px));
}

.settings form {
  padding: 28px;
}

.settings h2 {
  font-size: 26px;
}

.setting-row strong,
.volume-row strong,
.settings legend {
  font-size: 17px;
}

.setting-row small,
.volume-row output,
.segmented span,
.reset-button,
.toast {
  font-size: 16px;
}

.setting-row input {
  width: 44px;
  height: 24px;
  border-radius: 12px;
}

.setting-row input::after {
  width: 16px;
  height: 16px;
  top: 4px;
  left: 4px;
}

.setting-row input:checked::after {
  transform: translateX(20px);
}

.game-keyboard-dock {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: auto;
  padding: 14px clamp(16px, 4vw, 56px) 22px;
  border-top: 1px solid color-mix(in srgb, var(--cool) 35%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 52%, transparent), var(--bg-deep) 24%),
    var(--bg-deep);
  box-shadow: 0 -24px 60px color-mix(in srgb, var(--bg-deep) 72%, transparent);
  cursor: default;
}

.game-keyboard-label {
  display: flex;
  justify-content: space-between;
  width: min(980px, 100%);
  margin: 0 auto 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.gameplay-keyboard {
  --key-gap: 5px;
  --row-gap: 6px;
  --key-height: clamp(30px, 4vh, 40px);
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--cool) 30%, #555752);
  border-radius: 6px;
  background: #1f201e;
  box-shadow: 0 8px 0 #10110f, 0 18px 34px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
  transform: none;
  transition: background-color 240ms ease, border-color 240ms ease;
}

.keyboard-demo.gameplay-keyboard {
  width: min(980px, 100%);
}

.gameplay-keyboard .demo-key {
  border: 1px solid #4f514c;
  border-radius: 4px;
  background: #353733;
  color: #d8d4ca;
  font-size: clamp(8px, 1.1vh, 11px);
  box-shadow: 0 3px 0 #171815, 0 5px 8px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.1);
  cursor: default;
}

.gameplay-keyboard[data-model="showcase"] .demo-key.is-pressed {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 1px 0 #171815, 0 0 18px color-mix(in srgb, var(--accent) 58%, transparent);
  color: #171816;
  transform: translateY(3px) scale(0.985);
}

.gameplay-keyboard[data-model="mechanical"] {
  border-color: #53534f;
  background: #2b2b29;
}

.gameplay-keyboard[data-model="mechanical"] .demo-key {
  border-color: #ebe8df;
  background: linear-gradient(180deg, #faf9f4, #dad7cf);
  color: #30302d;
  box-shadow: 0 3px 0 #aaa79f, 0 5px 8px rgba(0, 0, 0, 0.38), inset 0 1px #fff;
  font-weight: 700;
}

.gameplay-keyboard[data-model="mechanical"] :is(
  [data-code="Escape"], [data-code="Backspace"], [data-code="Tab"], [data-code="CapsLock"],
  [data-code="Enter"], [data-code="ShiftLeft"], [data-code="ShiftRight"], [data-code="ControlLeft"],
  [data-code="MetaLeft"], [data-code="AltLeft"], [data-code="AltRight"]
) {
  border-color: #d29a31;
  background: linear-gradient(180deg, #efbc51, #c98520);
  color: #25231f;
  box-shadow: 0 3px 0 #845718, 0 5px 8px rgba(0, 0, 0, 0.4), inset 0 1px #ffe4a2;
}

.gameplay-keyboard[data-model="mechanical"] .demo-key.is-pressed {
  background: #f4cf79;
  box-shadow: 0 1px 0 #8e8b83, 0 2px 10px rgba(233, 185, 73, 0.35);
  transform: translateY(3px) scale(0.98);
}

.game[data-state="idle"] .idle {
  bottom: var(--keyboard-height, 260px);
}

.depth-line {
  bottom: calc(var(--keyboard-height, 260px) + 12px);
}

@media (min-width: 1181px) {
  .topbar,
  .footer {
    padding-inline: clamp(54px, 7vw, 108px);
  }

  .field-legend {
    right: clamp(54px, 7vw, 108px);
    left: clamp(54px, 7vw, 108px);
  }

  .game[data-state="idle"] .idle {
    bottom: 0;
    right: auto;
    width: 37%;
    justify-content: center;
    padding: 0 0 0 clamp(54px, 7vw, 108px);
  }

  .game[data-state="idle"] .game-keyboard-dock {
    top: 50%;
    right: clamp(54px, 7vw, 108px);
    bottom: auto;
    left: auto;
    width: min(52vw, 980px);
    padding: 0;
    border-top: 0;
    background: transparent;
    box-shadow: none;
    transform: translateY(-50%);
  }

  .game[data-state="idle"] .game-keyboard-label,
  .game[data-state="idle"] .gameplay-keyboard {
    width: 100%;
  }

  .game:not([data-state="idle"]) .game-keyboard-label,
  .game:not([data-state="idle"]) .gameplay-keyboard {
    width: min(52vw, 980px);
  }
}

.poop-splash {
  position: absolute;
  z-index: 7;
  width: var(--splash-size);
  height: var(--splash-size);
  border-radius: 58% 42% 52% 48%;
  background: #79502d;
  box-shadow: inset -2px -2px 0 rgba(44, 25, 13, 0.28);
  pointer-events: none;
  animation: poop-splash-out 360ms cubic-bezier(0.15, 0.65, 0.25, 1) forwards;
}

.poop-splash.is-poop {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-family: "Segoe UI Emoji", sans-serif;
  font-size: 18px;
  filter: saturate(0.7) brightness(0.78);
}

@keyframes poop-splash-out {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(0.75); }
  70% { opacity: 0.92; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--spin)) scale(0.25); }
}

@media (max-width: 760px) {
  .game { grid-template-rows: 112px minmax(0, 1fr) 58px; }
  .game::before { inset: 112px 0 58px; }
  .topbar, .footer { padding-inline: 16px; }
  .topbar { align-items: flex-start; padding-top: 10px; }
  .brand-cluster { width: 120px; }
  .brand { width: auto; font-size: 24px; }
  .run-label { font-size: 13px; }
  .hud { bottom: 12px; gap: clamp(12px, 4vw, 24px); }
  .stat { display: flex; flex-direction: column; gap: 2px; text-align: center; }
  .stat span { font-size: 13px; }
  .stat strong, .stat-score strong { min-width: 0; font-size: 18px; }
  .lives { gap: 7px; width: 52px; }
  .life { width: 10px; height: 10px; }
  .word { font-size: clamp(34px, 9vw, 42px); }
  .field-legend { top: 14px; right: 42px; left: 16px; font-size: 14px; }
  .field-watermark { right: 38px; font-size: clamp(48px, 16vw, 88px); opacity: 0.16; }
  .pressure-rail { right: 10px; gap: 6px; }
  .pressure-rail i { height: 104px; }
  .idle { justify-content: center; padding: 0 28px; }
  .idle::after { left: 16px; }
  .run-mode { width: min(340px, 86vw); }
  .results { grid-template-columns: repeat(3, 1fr); gap: 24px 18px; }
  .results div:nth-child(4), .results div:nth-child(5) { transform: translateX(50%); }
  .game-over { padding: 35px 18px 24px; }
  .actions { max-width: 330px; }
  .game-keyboard-dock { height: 164px; padding: 8px 8px 10px; }
  .game-keyboard-label { margin-bottom: 5px; font-size: 9px; }
  .gameplay-keyboard { --key-gap: 3px; --row-gap: 3px; --key-height: 23px; padding: 6px; overflow-x: auto; }
  .gameplay-keyboard .keyboard-rows { min-width: 0; }
  .gameplay-keyboard .demo-key { font-size: 8px; }
  .depth-line { bottom: 176px; }
}

@media (max-width: 430px) {
  .landing-nav .logo-emblem { display: none; }
  .hud { gap: 10px; width: calc(100% - 28px); }
  .stat span { font-size: 13px; }
  .stat strong { font-size: 18px; }
  .lives { width: 45px; }
  .brand-cluster { width: 110px; }
  .brand { font-size: 23px; }
  .run-label { display: none; }
  .topbar .icon-button { width: 44px; height: 44px; }
  .field-legend span:first-child { display: none; }
  .field-legend { justify-content: flex-start; left: 16px; }
  .field-watermark { right: 28px; }
  .pressure-rail > span { display: none; }
  .idle-mark { font-size: 58px; }
  .idle-kicker { font-size: 13px !important; }
  .idle > p:not(.idle-kicker) { margin: 20px 0 30px; font-size: 18px; }
  .run-mode button { font-size: 16px; }
  .run-note { font-size: 14px; }
  .start-hint { font-size: 18px; }
  .start-hint { margin-top: 18px; }
  .results { width: 100%; max-width: 310px; }
  .run-verdict { margin-top: 12px; }
  .buried-by { margin-top: 7px; }
  .game-over .results { margin: 24px 0 18px; }
  .game-over .actions { margin-top: 16px; }
  .game-over .text-button { font-size: 15px; }
  .footer { font-size: 15px; }
  .sound-button { font-size: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}

html[data-reduced-motion="true"] *,
html[data-reduced-motion="true"] *::before,
html[data-reduced-motion="true"] *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
}

/* Keyboard-led home */
body.landing-active {
  overflow-y: auto;
  overflow-x: hidden;
  background: #171816;
}

.landing {
  min-height: 100dvh;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(8.333vw - 1px), rgba(232, 228, 220, 0.035) 8.333vw),
    #171816;
  color: #ece8df;
}

.landing button {
  font-family: var(--font);
}

.landing-nav {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 96px;
  padding: 16px clamp(24px, 5vw, 80px);
  border-bottom: 1px solid rgba(232, 228, 220, 0.14);
  background: rgba(23, 24, 22, 0.88);
  backdrop-filter: blur(16px);
}

.landing-nav-actions,
.landing-theme,
.hero-actions {
  display: flex;
  align-items: center;
}

.landing-nav-actions {
  justify-self: end;
  gap: 12px;
}

.landing-theme {
  gap: 3px;
  padding: 3px;
  border: 1px solid #474944;
  background: #20211f;
}

.landing-theme button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8f918b;
  font-size: 18px;
  cursor: pointer;
}

.landing-theme button.is-active {
  background: #e9b949;
  color: #171816;
}

.logo-lockup {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 14px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.logo-emblem {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 58px;
  height: 50px;
  padding: 5px;
  border: 1px solid #4b4d48;
  background: #242522;
  box-shadow: 0 6px 0 #0d0e0d, inset 0 1px rgba(255, 255, 255, 0.1);
  transform: rotate(-3deg);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.logo-lockup:hover .logo-emblem {
  box-shadow: 0 3px 0 #0d0e0d, inset 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(3px) rotate(0);
}

.logo-emblem i,
.logo-emblem b {
  display: grid;
  place-items: center;
  font-size: 19px;
  font-style: normal;
  line-height: 1;
}

.logo-emblem i {
  color: #ece8df;
}

.logo-emblem b {
  background: #e9b949;
  color: #171816;
}

.logo-emblem em {
  position: absolute;
  right: -6px;
  bottom: -7px;
  width: 13px;
  height: 8px;
  border-radius: 50% 45% 55% 40%;
  background: #78502e;
  transform: rotate(18deg);
}

.logo-name {
  color: #ece8df;
  font-size: 30px;
  line-height: 1;
}

.logo-name strong {
  color: #e9b949;
}

.landing-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a7aaa4;
  font-size: 14px;
  text-transform: uppercase;
}

.landing-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8aa66b;
  box-shadow: 0 0 14px rgba(138, 166, 107, 0.55);
}

.landing-play {
  border: 0;
  cursor: pointer;
}

.nav-play {
  justify-self: end;
  min-height: 50px;
  padding: 0 20px;
  background: #e9b949;
  color: #171816;
  font-size: 16px;
  font-weight: 700;
}

.landing-hero {
  position: relative;
  display: flex;
  min-height: calc(100dvh - 96px);
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(70px, 10vh, 120px) clamp(24px, 8vw, 128px) 46px;
  border-bottom: 1px solid rgba(232, 228, 220, 0.14);
  background:
    linear-gradient(112deg, transparent 0 58%, rgba(233, 185, 73, 0.055) 58.1% 58.2%, transparent 58.3%),
    #171816;
}

.landing-hero::before {
  content: "SHIT HAPPENS / TYPE FASTER";
  position: absolute;
  top: 16%;
  right: -25px;
  color: transparent;
  font-size: clamp(55px, 9vw, 150px);
  font-weight: 700;
  line-height: 0.8;
  writing-mode: vertical-rl;
  -webkit-text-stroke: 1px rgba(232, 228, 220, 0.08);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(880px, 100%);
  animation: landing-copy-in 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-kicker,
.keyboard-feature-head,
.keyboard-console-foot {
  color: #8fa49b;
  font-size: 15px;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 20px 0 0;
  font-size: clamp(92px, 15vw, 230px);
  font-weight: 500;
  line-height: 0.72;
}

.hero-copy h1 strong {
  color: #e9b949;
}

.hero-tagline {
  margin: 40px 0 0;
  color: #c9c5bc;
  font-size: clamp(24px, 2.5vw, 38px);
  line-height: 1.3;
}

.hero-play,
.cta-play {
  display: inline-flex;
  align-items: center;
  gap: 38px;
  min-height: 64px;
  margin-top: 38px;
  padding: 0 24px;
  background: #e9b949;
  color: #171816;
  font-size: 18px;
  font-weight: 700;
  transition: gap 160ms ease, background-color 160ms ease;
}

.hero-play:hover,
.cta-play:hover {
  gap: 50px;
  background: #f2c960;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.hero-actions .hero-play {
  margin-top: 0;
}

.hero-challenge {
  min-height: 64px;
  padding: 0 22px;
  border: 1px solid #555750;
  background: transparent;
  color: #d0ccc3;
  font-size: 16px;
  cursor: pointer;
}

.hero-challenge:hover {
  border-color: #e9b949;
  color: #e9b949;
}

.keyboard-feature {
  position: relative;
  z-index: 3;
  width: min(1180px, 100%);
  margin: 70px auto 0;
  animation: landing-keyboard-in 900ms 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.keyboard-feature-head,
.keyboard-console-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.keyboard-feature > p {
  margin: 18px 0 0;
  color: #a7aaa4;
  font-size: 16px;
  text-align: center;
}

.keyboard-demo {
  position: relative;
  width: 100%;
  outline: none;
  user-select: none;
}

.keyboard-rows {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--row-gap);
}

.keyboard-row {
  display: flex;
  gap: var(--key-gap);
  width: 100%;
}

.demo-key,
.key-spacer {
  min-width: 0;
  flex: var(--key-width, 1) 1 0;
}

.demo-key {
  position: relative;
  display: grid;
  height: var(--key-height);
  place-items: center;
  padding: 0 5px;
  overflow: hidden;
  border: 0;
  color: inherit;
  font-size: clamp(10px, 1vw, 15px);
  line-height: 1;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 90ms ease, color 90ms ease, background-color 90ms ease;
}

.demo-key.is-pressed {
  transform: translateY(5px) scale(0.985);
}

.demo-key.is-pressed::after {
  content: "";
  position: absolute;
  inset: -14px;
  border: 2px solid currentColor;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  animation: key-ripple 360ms ease-out;
}

.mac-keyboard {
  --key-gap: 8px;
  --row-gap: 9px;
  --key-height: clamp(42px, 4.3vw, 62px);
  padding: clamp(16px, 2vw, 28px);
  border: 1px solid #555752;
  border-radius: 8px;
  background: #2d2f2b;
  box-shadow: 0 26px 0 #10110f, 0 42px 70px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.12);
  transform: perspective(1400px) rotateX(5deg);
}

.mac-keyboard::after {
  content: "";
  position: absolute;
  right: 4%;
  bottom: -38px;
  left: 4%;
  height: 30px;
  background: rgba(0, 0, 0, 0.34);
  filter: blur(16px);
}

.mac-keyboard .demo-key {
  border: 1px solid #d9d4ca;
  border-radius: 6px;
  background: #d7d2c7;
  color: #292a27;
  box-shadow: 0 7px 0 #8e8b83, 0 10px 16px rgba(0, 0, 0, 0.38), inset 0 1px #fff;
  font-weight: 700;
}

.mac-keyboard .demo-key.is-pressed {
  background: #e9b949;
  box-shadow: 0 2px 0 #8e7130, 0 7px 15px rgba(233, 185, 73, 0.28);
}

.keyboard-loadout {
  display: grid;
  grid-template-columns: minmax(270px, 0.58fr) minmax(0, 1.7fr);
  gap: clamp(48px, 6vw, 108px);
  min-height: 980px;
  padding: 120px clamp(24px, 6vw, 104px);
  border-bottom: 1px solid rgba(232, 228, 220, 0.14);
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 99px, rgba(232, 228, 220, 0.035) 100px),
    #20211e;
}

.loadout-copy {
  align-self: center;
}

.loadout-copy > p,
.landing-challenge p {
  color: #8fa49b;
  font-size: 15px;
  text-transform: uppercase;
}

.loadout-copy h2,
.landing-challenge h2,
.landing-cta h2 {
  margin: 24px 0;
  font-size: clamp(58px, 7vw, 112px);
  font-weight: 500;
  line-height: 0.86;
}

.loadout-copy h2 strong,
.landing-challenge h2 strong {
  color: #e9b949;
}

.loadout-copy > span {
  display: block;
  max-width: 390px;
  color: #aaa9a2;
  font-size: 20px;
  line-height: 1.5;
}

.loadout-selector {
  align-self: center;
  min-width: 0;
}

.loadout-rail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.loadout-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid #484a45;
  background: #272825;
  color: #aaa9a2;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.loadout-option:hover {
  border-color: #777971;
  transform: translateY(-2px);
}

.loadout-option.is-selected {
  border-color: #e9b949;
  background: #323126;
  color: #ece8df;
}

.loadout-number {
  color: #787b75;
  font-size: 13px;
}

.loadout-option strong,
.loadout-option small {
  display: block;
}

.loadout-option strong {
  margin-bottom: 6px;
  font-size: 18px;
}

.loadout-option small {
  color: #8f928b;
  font-size: 12px;
}

.loadout-option b {
  color: #e9b949;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.loadout-stage {
  position: relative;
  min-width: 0;
  padding: 20px 0 48px;
  perspective: 1200px;
}

.loadout-stage::before {
  content: "";
  position: absolute;
  right: 10%;
  bottom: 28px;
  left: 10%;
  height: 45px;
  background: rgba(0, 0, 0, 0.5);
  filter: blur(24px);
  transform: perspective(400px) rotateX(65deg);
}

.loadout-stage.is-swapping .loadout-stage-head,
.loadout-stage.is-swapping .loadout-plinth {
  opacity: 0.45;
}

.loadout-stage-head,
.loadout-plinth {
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 180ms ease;
}

.loadout-stage-head {
  margin-bottom: 12px;
  color: #868981;
  font-size: 12px;
  text-transform: uppercase;
}

.loadout-stage-head strong {
  color: #e9b949;
  font-size: 14px;
}

.loadout-plinth {
  position: relative;
  z-index: 0;
  width: 92%;
  height: 48px;
  margin: 2px auto 0;
  padding: 0 22px;
  border: 1px solid #50524d;
  border-top: 0;
  background: linear-gradient(180deg, #292a27, #171816);
  color: #777a74;
  font-size: 10px;
  transform: perspective(600px) rotateX(-18deg);
  transform-origin: top;
}

.loadout-plinth i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e9b949;
  box-shadow: 0 0 12px rgba(233, 185, 73, 0.6);
}

.loadout-plinth b {
  color: #e9b949;
}

.keyboard-feature-framer {
  width: 100%;
  margin: 0;
  padding: clamp(18px, 2vw, 28px);
  border: 1px solid #4b4d48;
  border-radius: 8px;
  background: #2a2b28;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 255, 255, 0.08);
}

.keyboard-console-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  margin-bottom: 24px;
}

.typing-preview {
  min-height: 52px;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid #4a4c47;
  background: #1d1e1b;
  color: #d8d4ca;
  font-size: 17px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.clear-preview,
.keyboard-profiles button {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #51534e;
  background: #353633;
  color: #b8b6af;
  font-size: 14px;
  cursor: pointer;
}

.keyboard-profiles {
  display: flex;
  gap: 4px;
}

.keyboard-profiles button.is-active {
  border-color: #e9b949;
  background: #e9b949;
  color: #171816;
}

.showcase-keyboard {
  --key-gap: 7px;
  --row-gap: 8px;
  --key-height: clamp(40px, 3.8vw, 58px);
  padding: 18px;
  border: 1px solid #444640;
  border-radius: 5px;
  background: #1f201e;
  box-shadow: inset 0 16px 35px rgba(0, 0, 0, 0.25);
}

.showcase-keyboard .demo-key {
  border: 1px solid #4f514c;
  border-radius: 5px;
  background: #353733;
  color: #d8d4ca;
  box-shadow: 0 6px 0 #171815, 0 8px 13px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.1);
}

.showcase-keyboard .demo-key[data-code="KeyW"],
.showcase-keyboard .demo-key[data-code="KeyA"],
.showcase-keyboard .demo-key[data-code="KeyS"],
.showcase-keyboard .demo-key[data-code="KeyD"] {
  border-color: #8c7138;
  color: #e9b949;
}

.showcase-keyboard .demo-key.is-pressed {
  background: #78502e;
  color: #fff3d5;
  box-shadow: 0 1px 0 #171815, 0 0 28px rgba(233, 185, 73, 0.35);
}

.showcase-keyboard[data-model="showcase"] .demo-key.is-pressed {
  animation: showcase-key-flash 320ms ease-out;
}

.showcase-keyboard[data-model="mechanical"] {
  border-color: #555650;
  background: #2b2b29;
  box-shadow: 0 12px 0 #151513, 0 24px 45px rgba(0, 0, 0, 0.36), inset 0 1px rgba(255, 255, 255, 0.1);
}

.showcase-keyboard[data-model="mechanical"] .demo-key {
  border-color: #ebe8df;
  background: linear-gradient(180deg, #faf9f4, #d8d5cc);
  color: #30302d;
  box-shadow: 0 6px 0 #aaa79f, 0 9px 13px rgba(0, 0, 0, 0.34), inset 0 1px #fff;
  font-weight: 700;
}

.showcase-keyboard[data-model="mechanical"] :is(
  [data-code="Escape"], [data-code="Backspace"], [data-code="Tab"], [data-code="CapsLock"],
  [data-code="Enter"], [data-code="ShiftLeft"], [data-code="ShiftRight"], [data-code="ControlLeft"],
  [data-code="MetaLeft"], [data-code="AltLeft"], [data-code="AltRight"]
) {
  border-color: #d49b31;
  background: linear-gradient(180deg, #efbc51, #c98520);
  color: #25231f;
  box-shadow: 0 6px 0 #845718, 0 9px 13px rgba(0, 0, 0, 0.38), inset 0 1px #ffe4a2;
}

.showcase-keyboard[data-model="mechanical"] .demo-key.is-pressed {
  background: #f5d27e;
  color: #25231f;
  box-shadow: 0 2px 0 #8e8b83, 0 5px 12px rgba(233, 185, 73, 0.28);
  transform: translateY(5px) scale(0.98);
}

.showcase-keyboard[data-switch="tactile"] .demo-key.is-pressed {
  transform: translateY(4px) scale(0.97) rotate(0.3deg);
}

.showcase-keyboard[data-switch="clicky"] .demo-key.is-pressed {
  background: #e9b949;
  color: #171816;
  transform: translateY(6px) scale(0.96);
}

.keyboard-console-foot {
  margin: 22px 0 0;
  color: #9b9e97;
  font-size: 13px;
}

.keyboard-console-foot b {
  color: #e9b949;
}

.landing-challenge {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 60px;
  align-items: end;
  min-height: 610px;
  padding: 110px clamp(24px, 8vw, 128px);
  border-bottom: 1px solid rgba(232, 228, 220, 0.14);
  background:
    linear-gradient(135deg, transparent 0 62%, rgba(120, 166, 160, 0.08) 62.1% 62.2%, transparent 62.3%),
    #181917;
}

.landing-challenge h2 {
  max-width: 880px;
  font-size: clamp(56px, 7.2vw, 116px);
}

.challenge-callout {
  padding: 28px 0 0 28px;
  border-left: 1px solid #51534e;
}

.challenge-callout > span {
  display: block;
  margin-bottom: 24px;
  color: #aaa9a2;
  font-size: 18px;
  line-height: 1.5;
}

.challenge-callout button {
  width: 100%;
  min-height: 62px;
  padding: 0 20px;
  border: 0;
  background: #78a6a0;
  color: #171816;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease;
}

.challenge-callout button:hover {
  background: #96bbb6;
  transform: translateY(-3px);
}

@keyframes landing-copy-in {
  from { opacity: 0; transform: translateY(34px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes landing-keyboard-in {
  from { opacity: 0; transform: perspective(1200px) translateY(54px) rotateX(12deg); }
  to { opacity: 1; transform: perspective(1200px) translateY(0) rotateX(0); }
}

@keyframes key-ripple {
  from { opacity: 0.65; transform: scale(0.55); }
  to { opacity: 0; transform: scale(1.55); }
}

@keyframes showcase-key-flash {
  50% { filter: drop-shadow(0 0 14px rgba(233, 185, 73, 0.65)); }
}

.landing-cta {
  position: relative;
  min-height: 700px;
  padding: 130px clamp(24px, 9vw, 145px);
  background: #e9b949;
  color: #171816;
}

.landing-cta::after {
  content: "\01F4A9";
  position: absolute;
  right: 7%;
  bottom: 3%;
  font-family: "Segoe UI Emoji", sans-serif;
  font-size: clamp(170px, 25vw, 390px);
  filter: saturate(0.65) brightness(0.7);
  opacity: 0.42;
  transform: rotate(8deg);
}

.landing-cta p {
  margin: 0;
  font-size: 18px;
  text-transform: uppercase;
}

.landing-cta h2 {
  position: relative;
  z-index: 2;
  max-width: 930px;
  font-size: clamp(68px, 9vw, 148px);
}

.cta-play {
  position: relative;
  z-index: 2;
  border: 2px solid #171816;
  background: #171816;
  color: #ece8df;
}

.cta-play:hover {
  background: #352116;
}

.landing-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 120px;
  padding: 24px clamp(24px, 5vw, 80px);
  background: #171816;
  color: #999b96;
  font-size: 14px;
}

.landing-footer > span:last-child {
  justify-self: end;
}

@media (max-width: 1000px) {
  .landing-hero {
    min-height: auto;
  }

  .keyboard-loadout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .loadout-copy > span {
    max-width: 650px;
  }

  .landing-challenge {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .keyboard-console-head {
    grid-template-columns: 1fr auto;
  }

  .keyboard-profiles {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .landing-nav {
    grid-template-columns: 1fr auto;
    min-height: 82px;
    padding-inline: 16px;
  }

  .landing-status {
    display: none;
  }

  .logo-emblem {
    width: 48px;
    height: 42px;
  }

  .logo-name {
    font-size: 24px;
  }

  .nav-play {
    min-height: 46px;
    padding-inline: 14px;
    font-size: 14px;
  }

  .landing-nav-actions { gap: 7px; }
  .landing-theme button { width: 36px; height: 38px; font-size: 15px; }
  .nav-play span { display: none; }

  .landing-hero {
    padding: 70px 16px 55px;
  }

  .hero-copy h1 {
    font-size: clamp(72px, 25vw, 110px);
  }

  .hero-tagline {
    font-size: 22px;
  }

  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions button { justify-content: space-between; width: 100%; }

  .keyboard-feature {
    margin-top: 70px;
  }

  .keyboard-feature-head {
    font-size: 11px;
  }

  .mac-keyboard,
  .showcase-keyboard {
    --key-gap: 3px;
    --row-gap: 4px;
    --key-height: 36px;
    padding: 8px;
    overflow-x: auto;
  }

  .keyboard-rows {
    min-width: 610px;
  }

  .demo-key {
    font-size: 9px;
  }

  .keyboard-loadout {
    gap: 60px;
    padding: 90px 16px;
  }

  .loadout-copy h2 {
    font-size: 64px;
  }

  .loadout-rail { grid-template-columns: 1fr; }
  .loadout-option { min-height: 76px; }
  .loadout-stage-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .loadout-plinth { font-size: 8px; }

  .keyboard-feature-framer {
    padding: 12px;
  }

  .keyboard-console-head {
    grid-template-columns: 1fr auto;
  }

  .keyboard-profiles {
    width: 100%;
    overflow-x: auto;
  }

  .keyboard-profiles button {
    flex: 1;
  }

  .keyboard-console-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
  }

  .landing-challenge { min-height: 0; padding: 90px 20px; }
  .landing-challenge h2 { font-size: 58px; }
  .challenge-callout { padding: 24px 0 0; border-top: 1px solid #51534e; border-left: 0; }

  .landing-cta {
    min-height: 620px;
    padding: 100px 20px;
  }

  .landing-cta h2 {
    font-size: 67px;
  }

  .landing-footer {
    grid-template-columns: 1fr auto;
    gap: 20px;
  }

  .landing-footer > span:first-of-type {
    display: none;
  }
}

html[data-theme="light"] body.landing-active {
  background: #f3f5f2;
}

html[data-theme="light"] .landing {
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(8.333vw - 1px), rgba(41, 42, 44, 0.05) 8.333vw),
    #f3f5f2;
  color: #292a2c;
}

html[data-theme="light"] .landing-nav {
  border-bottom-color: rgba(41, 42, 44, 0.14);
  background: rgba(243, 245, 242, 0.9);
}

html[data-theme="light"] .logo-name,
html[data-theme="light"] .hero-tagline {
  color: #292a2c;
}

html[data-theme="light"] .landing-theme {
  border-color: #bbb8af;
  background: #dfe4df;
}

html[data-theme="light"] .landing-theme button {
  color: #686a66;
}

html[data-theme="light"] .landing-theme button.is-active {
  color: #171816;
}

html[data-theme="light"] .landing-hero {
  border-bottom-color: rgba(41, 42, 44, 0.14);
  background:
    linear-gradient(112deg, transparent 0 58%, rgba(166, 111, 8, 0.08) 58.1% 58.2%, transparent 58.3%),
    #f3f5f2;
}

html[data-theme="light"] .landing-hero::before {
  -webkit-text-stroke-color: rgba(41, 42, 44, 0.09);
}

html[data-theme="light"] .hero-challenge {
  border-color: #a9a69d;
  color: #4e5051;
}

html[data-theme="light"] .keyboard-feature > p,
html[data-theme="light"] .loadout-copy > span,
html[data-theme="light"] .challenge-callout > span,
html[data-theme="light"] .landing-status {
  color: #6f706c;
}

html[data-theme="light"] .keyboard-loadout {
  border-bottom-color: rgba(41, 42, 44, 0.13);
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 99px, rgba(41, 42, 44, 0.045) 100px),
    #e8ece7;
}

html[data-theme="light"] .loadout-option {
  border-color: #bab7ae;
  background: #dce2dc;
  color: #4e5051;
}

html[data-theme="light"] .loadout-option.is-selected {
  border-color: #a66f08;
  background: #e9efd9;
  color: #292a2c;
}

html[data-theme="light"] .loadout-option small,
html[data-theme="light"] .loadout-number,
html[data-theme="light"] .loadout-stage-head {
  color: #6f706c;
}

html[data-theme="light"] .loadout-plinth {
  border-color: #9d9a92;
  background: linear-gradient(180deg, #d2d9d3, #a5aea7);
  color: #41423f;
}

html[data-theme="light"] .landing-challenge {
  border-bottom-color: rgba(41, 42, 44, 0.13);
  background:
    linear-gradient(135deg, transparent 0 62%, rgba(76, 124, 119, 0.1) 62.1% 62.2%, transparent 62.3%),
    #f3f5f2;
}

html[data-theme="light"] .landing-footer {
  background: #d9dfda;
  color: #666863;
}

/* First-viewport keyboard carousel */
.landing-nav {
  grid-template-columns: auto minmax(300px, 1fr) auto;
  min-height: 78px;
  padding-block: 10px;
}

.landing-nav .logo-emblem {
  width: 48px;
  height: 42px;
}

.landing-nav .logo-name {
  font-size: 25px;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 48px);
}

.landing-nav-links button {
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: #a7aaa4;
  font-size: 13px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 140ms ease;
}

.landing-nav-links button:hover {
  color: #e9b949;
}

.landing-nav-links .landing-challenge-button {
  color: #e9b949;
}

.landing-nav .landing-theme button {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.landing-nav .nav-play {
  min-height: 44px;
  padding-inline: 17px;
  font-size: 14px;
}

.landing-hero {
  justify-content: flex-start;
}

.hero-keyboard-carousel {
  width: min(980px, calc(100% - 80px));
}

.hero-keyboard-carousel .keyboard-feature-head {
  margin-bottom: 8px;
  font-size: 12px;
}

.hero-keyboard-carousel .keyboard-feature-head b {
  color: #e9b949;
  font-weight: 600;
}

.keyboard-carousel-stage {
  position: relative;
  perspective: 1200px;
  touch-action: pan-y;
}

.keyboard-carousel-board {
  position: relative;
  min-width: 0;
}

.keyboard-carousel-board::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: -18px;
  left: 8%;
  height: 24px;
  background: rgba(0, 0, 0, 0.45);
  filter: blur(16px);
  pointer-events: none;
}

.hero-keyboard-carousel .showcase-keyboard {
  --key-gap: 5px;
  --row-gap: 6px;
  --key-height: clamp(30px, 4vh, 40px);
  padding: 12px;
  border-radius: 7px;
  cursor: grab;
}

.hero-keyboard-carousel .showcase-keyboard:active {
  cursor: grabbing;
}

.hero-keyboard-carousel .demo-key {
  font-size: clamp(8px, 0.8vw, 11px);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: grid;
  width: 46px;
  height: 58px;
  place-items: center;
  padding: 0;
  border: 1px solid #50524d;
  background: #20211f;
  color: #d9d5cc;
  font-size: 22px;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.carousel-arrow:hover {
  border-color: #e9b949;
  color: #e9b949;
}

.carousel-arrow:active {
  transform: translateY(-47%);
}

.carousel-arrow-prev {
  left: -62px;
}

.carousel-arrow-next {
  right: -62px;
}

.keyboard-carousel-footer {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(0, 1.7fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.keyboard-model-copy strong,
.keyboard-model-copy span {
  display: block;
}

.keyboard-model-copy strong {
  color: #ece8df;
  font-size: 15px;
}

.keyboard-model-copy span {
  margin-top: 4px;
  color: #858881;
  font-size: 10px;
  text-transform: uppercase;
}

.keyboard-model-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.keyboard-model-picker button {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  border: 1px solid #444641;
  background: #242522;
  color: #8f928b;
  font-size: 9px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.keyboard-model-picker button i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e9b949;
  box-shadow: 0 0 8px rgba(233, 185, 73, 0.35);
}

.keyboard-model-picker button[data-keyboard-model="mechanical"] i { background: #ece8df; }
.keyboard-model-picker button[data-keyboard-model="sakura"] i { background: #ff7eb0; box-shadow: 0 0 8px rgba(255, 126, 176, 0.55); }
.keyboard-model-picker button[data-keyboard-model="violet"] i { background: #9b7cff; box-shadow: 0 0 8px rgba(155, 124, 255, 0.6); }
.keyboard-model-picker button[data-keyboard-model="toxic"] i { background: #87ff5a; box-shadow: 0 0 8px rgba(135, 255, 90, 0.65); }

.keyboard-model-picker button.is-selected {
  border-color: #e9b949;
  background: #303128;
  color: #ece8df;
}

.swipe-hint {
  color: #777a74;
  font-size: 9px;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (min-width: 1001px) {
  .landing-hero {
    height: calc(100dvh - 78px);
    min-height: 650px;
    padding: clamp(22px, 3.6vh, 36px) clamp(54px, 7vw, 108px) 18px;
    overflow: hidden;
  }

  .hero-copy h1 {
    margin-top: 8px;
    font-size: clamp(82px, 10vw, 142px);
  }

  .hero-tagline {
    margin-top: 14px;
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.2;
  }

  .hero-actions {
    margin-top: 16px;
  }

  .hero-actions .hero-play {
    min-height: 50px;
    padding-inline: 20px;
    font-size: 14px;
  }

  .hero-keyboard-carousel {
    margin-top: clamp(16px, 2.5vh, 26px);
  }
}

@media (min-width: 1181px) {
  .landing-hero {
    display: grid;
    grid-template-columns: minmax(390px, 0.72fr) minmax(0, 1.35fr);
    gap: clamp(52px, 5vw, 80px);
    align-items: center;
    padding: 24px clamp(54px, 7vw, 108px) 30px;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(76px, 6.6vw, 104px);
  }

  .hero-tagline {
    margin-top: 20px;
  }

  .hero-keyboard-carousel {
    width: 100%;
    margin: 0;
  }
}

/* Gaming chassis */
.keyboard-demo[data-model="sakura"] {
  border-color: #b65d82;
  background: linear-gradient(145deg, #432331, #27171f);
  box-shadow: 0 10px 0 #160b10, 0 20px 48px rgba(255, 92, 149, 0.2), inset 0 1px rgba(255, 223, 235, 0.16);
}

.keyboard-demo[data-model="sakura"] .demo-key {
  border-color: #ffd4e2;
  background: linear-gradient(180deg, #ffd9e6, #e9a5bd);
  color: #5b2438;
  box-shadow: 0 5px 0 #a65f78, 0 7px 12px rgba(21, 7, 13, 0.38), inset 0 1px #fff4f8;
  font-weight: 700;
}

.keyboard-demo[data-model="sakura"] :is([data-code="Escape"], [data-code="Enter"], [data-code="Space"], [data-code="Backspace"]) {
  background: linear-gradient(180deg, #ff86b2, #db4f83);
  color: #fff5f8;
  box-shadow: 0 5px 0 #8e2b50, 0 7px 13px rgba(33, 8, 18, 0.4), inset 0 1px #ffc4d9;
}

.keyboard-demo[data-model="sakura"] .demo-key.is-pressed {
  background: #fff0f5;
  color: #7a2948;
  box-shadow: 0 1px 0 #9d536d, 0 0 22px rgba(255, 110, 164, 0.8);
}

.keyboard-demo[data-model="violet"] {
  border-color: #7258d6;
  background: linear-gradient(145deg, #221b42, #100d22);
  box-shadow: 0 10px 0 #090714, 0 20px 52px rgba(119, 84, 255, 0.3), inset 0 1px rgba(218, 207, 255, 0.16);
}

.keyboard-demo[data-model="violet"] .demo-key {
  border-color: #6f5cb1;
  background: linear-gradient(180deg, #46377b, #2e2554);
  color: #ece5ff;
  box-shadow: 0 5px 0 #17102f, 0 7px 12px rgba(0, 0, 0, 0.46), inset 0 1px rgba(255, 255, 255, 0.16);
}

.keyboard-demo[data-model="violet"] :is([data-code="KeyW"], [data-code="KeyA"], [data-code="KeyS"], [data-code="KeyD"], [data-code="Space"]) {
  border-color: #b7a3ff;
  background: linear-gradient(180deg, #9b7cff, #6748d5);
  color: #140d2b;
}

.keyboard-demo[data-model="violet"] .demo-key.is-pressed {
  background: #c0afff;
  color: #1a1038;
  box-shadow: 0 1px 0 #352575, 0 0 24px rgba(155, 124, 255, 0.9);
}

.keyboard-demo[data-model="toxic"] {
  border-color: #4fd01f;
  background:
    linear-gradient(120deg, transparent 0 48%, rgba(118, 255, 64, 0.08) 48.2% 49%, transparent 49.2%),
    #101b13;
  box-shadow: 0 10px 0 #061008, 0 20px 54px rgba(84, 255, 35, 0.25), inset 0 1px rgba(194, 255, 171, 0.13);
}

.keyboard-demo[data-model="toxic"] .demo-key {
  border-color: #315e31;
  background: linear-gradient(180deg, #203d27, #152b1b);
  color: #bcff9f;
  box-shadow: 0 5px 0 #07180c, 0 7px 12px rgba(0, 0, 0, 0.5), inset 0 1px rgba(207, 255, 189, 0.15);
  font-weight: 700;
}

.keyboard-demo[data-model="toxic"] :is([data-code="KeyQ"], [data-code="KeyW"], [data-code="KeyE"], [data-code="KeyR"], [data-code="Space"]) {
  border-color: #b9ff9f;
  background: linear-gradient(180deg, #91ff64, #4ac623);
  color: #0b1a0c;
  box-shadow: 0 5px 0 #287915, 0 0 16px rgba(125, 255, 76, 0.46);
}

.keyboard-demo[data-model="toxic"] .demo-key.is-pressed {
  background: #d0ffbc;
  color: #102313;
  box-shadow: 0 1px 0 #277817, 0 0 26px rgba(126, 255, 75, 0.95);
}

html[data-theme="light"] .landing-nav-links button,
html[data-theme="light"] .swipe-hint,
html[data-theme="light"] .keyboard-model-copy span {
  color: #666b66;
}

html[data-theme="light"] .landing-nav-links .landing-challenge-button {
  color: #a66f08;
}

html[data-theme="light"] .keyboard-model-copy strong {
  color: #292a2c;
}

html[data-theme="light"] .keyboard-model-picker button,
html[data-theme="light"] .carousel-arrow {
  border-color: #abb2ac;
  background: #e1e6e1;
  color: #525752;
}

html[data-theme="light"] .keyboard-model-picker button.is-selected {
  border-color: #a66f08;
  background: #edf1e8;
  color: #292a2c;
}

@media (max-width: 1000px) {
  .landing-nav {
    grid-template-columns: auto 1fr auto;
  }

  .landing-nav-links {
    gap: 18px;
  }

  .landing-hero {
    min-height: calc(100dvh - 78px);
    padding: 36px clamp(20px, 6vw, 54px) 28px;
  }

  .hero-keyboard-carousel {
    width: min(840px, calc(100% - 70px));
    margin-top: 34px;
  }

  .keyboard-carousel-footer {
    grid-template-columns: minmax(180px, 0.6fr) minmax(380px, 1.5fr);
  }

  .swipe-hint {
    display: none;
  }
}

@media (max-width: 680px) {
  .landing-nav {
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
    min-height: 112px;
    padding: 8px 14px;
  }

  .landing-nav-links {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 16px;
    padding-top: 5px;
    border-top: 1px solid rgba(232, 228, 220, 0.1);
  }

  .landing-nav-links button {
    padding: 5px 0;
    font-size: 10px;
  }

  .landing-nav .logo-name {
    font-size: 22px;
  }

  .landing-nav .landing-theme button {
    width: 30px;
    height: 32px;
  }

  .landing-nav .nav-play {
    min-height: 38px;
    padding-inline: 11px;
    font-size: 11px;
  }

  .landing-hero {
    min-height: calc(100dvh - 112px);
    padding: 20px 12px 18px;
  }

  .hero-copy h1 {
    margin-top: 6px;
    font-size: clamp(62px, 20vw, 82px);
  }

  .hero-tagline {
    margin-top: 10px;
    font-size: 18px;
    line-height: 1.15;
  }

  .hero-actions {
    margin-top: 12px;
  }

  .hero-actions .hero-play {
    min-height: 44px;
    font-size: 12px;
  }

  .hero-keyboard-carousel {
    width: 100%;
    margin-top: 16px;
  }

  .hero-keyboard-carousel .showcase-keyboard {
    --key-gap: 2px;
    --row-gap: 2px;
    --key-height: 22px;
    padding: 6px;
    overflow: visible;
  }

  .hero-keyboard-carousel .keyboard-rows {
    min-width: 0;
  }

  .hero-keyboard-carousel .demo-key {
    padding: 0 1px;
    font-size: 6px;
  }

  .carousel-arrow {
    top: -27px;
    width: 32px;
    height: 24px;
    font-size: 14px;
    transform: none;
  }

  .carousel-arrow:active {
    transform: translateY(2px);
  }

  .carousel-arrow-prev { right: 38px; left: auto; }
  .carousel-arrow-next { right: 0; }

  .keyboard-carousel-footer {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .keyboard-model-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .keyboard-model-copy span {
    margin-top: 0;
    text-align: right;
  }

  .keyboard-model-picker {
    gap: 3px;
  }

  .keyboard-model-picker button {
    min-height: 30px;
    padding: 0 3px;
    font-size: 7px;
  }

  .keyboard-model-picker button i {
    width: 5px;
    height: 5px;
  }
}

/* Challenge rooms */
.landing-challenge {
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 0.9fr) minmax(230px, 0.55fr);
  gap: clamp(34px, 4vw, 72px);
  align-items: center;
}

.challenge-intro > span {
  display: block;
  max-width: 610px;
  color: #aaa9a2;
  font-size: 16px;
  line-height: 1.6;
}

.landing-challenge .challenge-intro h2 {
  margin-bottom: 30px;
  font-size: clamp(52px, 5.7vw, 92px);
}

.challenge-flow {
  border-top: 1px solid #51534e;
}

.challenge-flow > div {
  display: grid;
  grid-template-columns: 34px 95px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid #41433f;
}

.challenge-flow b {
  color: #78a6a0;
  font-size: 11px;
  font-weight: 500;
}

.challenge-flow strong {
  color: #ece8df;
  font-size: 14px;
  text-transform: uppercase;
}

.challenge-flow span {
  color: #91948d;
  font-size: 12px;
  line-height: 1.5;
}

.challenge-callout > div {
  display: grid;
  gap: 8px;
}

.challenge-callout .challenge-join-action {
  border: 1px solid #555952;
  background: transparent;
  color: #d6d2c8;
}

.challenge-callout .challenge-join-action:hover {
  border-color: #78a6a0;
  background: #222521;
}

.challenge-dialog {
  width: min(780px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid #555851;
  border-radius: 4px;
  background: #191b19;
  color: #ece8df;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}

.challenge-dialog::backdrop {
  background: rgba(7, 9, 8, 0.72);
  backdrop-filter: blur(7px);
}

.challenge-dialog-shell {
  padding: clamp(20px, 4vw, 38px);
  background:
    linear-gradient(118deg, transparent 0 66%, rgba(120, 166, 160, 0.07) 66.1% 66.25%, transparent 66.35%),
    #191b19;
}

.challenge-dialog-head,
.challenge-dialog-head > div,
.challenge-created label,
.challenge-form > label {
  display: flex;
  flex-direction: column;
}

.challenge-dialog-head {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.challenge-dialog-head span,
.challenge-form label > span,
.challenge-form legend,
.challenge-created > span,
.challenge-created label > span {
  color: #8fa49b;
  font-size: 10px;
  text-transform: uppercase;
}

.challenge-dialog-head h2 {
  margin: 8px 0 0;
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 500;
}

.challenge-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 26px;
  border-bottom: 1px solid #484b45;
}

.challenge-tabs button {
  min-height: 46px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #858980;
  font-size: 12px;
  cursor: pointer;
}

.challenge-tabs button[aria-selected="true"] {
  border-bottom-color: #e9b949;
  color: #ece8df;
}

.challenge-form {
  display: grid;
  gap: 22px;
}

.challenge-form > label,
.challenge-created label {
  gap: 9px;
}

.challenge-form input,
.challenge-created input,
.challenge-created textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #4d514a;
  border-radius: 0;
  outline: 0;
  background: #222421;
  color: #ece8df;
  font-size: 14px;
}

.challenge-form input:focus,
.challenge-created input:focus,
.challenge-created textarea:focus {
  border-color: #78a6a0;
}

.challenge-code-input {
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.challenge-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.challenge-form legend {
  margin-bottom: 10px;
}

.challenge-keyboards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.challenge-keyboards label {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 58px;
  place-items: center;
  padding: 8px 4px;
  border: 1px solid #484b45;
  background: #222421;
  color: #8f928b;
  font-size: 9px;
  text-align: center;
  cursor: pointer;
}

.challenge-keyboards input {
  position: absolute;
  opacity: 0;
}

.challenge-keyboards i {
  width: 14px;
  height: 8px;
  border: 1px solid currentColor;
  background: #e9b949;
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 60%, transparent);
}

.challenge-keyboards label[data-model="mechanical"] i { background: #ece8df; }
.challenge-keyboards label[data-model="sakura"] i { background: #ff7eb0; color: #ff7eb0; }
.challenge-keyboards label[data-model="violet"] i { background: #9b7cff; color: #9b7cff; }
.challenge-keyboards label[data-model="toxic"] i { background: #87ff5a; color: #87ff5a; }

.challenge-keyboards label:has(input:checked) {
  border-color: #e9b949;
  background: #303128;
  color: #ece8df;
}

.challenge-keyboard-preview {
  min-width: 0;
  padding: 12px;
  border: 1px solid #40443e;
  background: #141613;
}

.challenge-keyboard-preview > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.challenge-keyboard-preview strong {
  color: #ece8df;
  font-size: 11px;
}

.challenge-keyboard-preview span {
  color: #858a82;
  font-size: 8px;
  text-align: right;
  text-transform: uppercase;
}

.challenge-preview-keyboard,
.challenge-keyboard-preview .keyboard-demo {
  --key-gap: 2px;
  --row-gap: 3px;
  --key-height: 19px;
  padding: 6px;
  border-radius: 4px;
  pointer-events: none;
}

.challenge-keyboard-preview .demo-key {
  padding: 0 2px;
  font-size: 6px;
}

.challenge-submit,
.challenge-created-actions > button {
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  background: #e9b949;
  color: #171816;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.challenge-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.challenge-submit:disabled {
  opacity: 0.5;
  cursor: wait;
}

.challenge-form-error {
  min-height: 17px;
  margin: -10px 0 0;
  color: #e48b80;
  font-size: 11px;
}

.challenge-created {
  display: grid;
  gap: 20px;
}

.challenge-created[hidden] {
  display: none;
}

.challenge-created > strong {
  color: #e9b949;
  font-size: clamp(48px, 10vw, 76px);
  line-height: 1;
  letter-spacing: 0.08em;
}

.challenge-created label > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.challenge-created label > div button,
.challenge-created-actions > button:first-child {
  padding: 0 16px;
  border: 1px solid #555851;
  background: #292c28;
  color: #d5d2c9;
  font-size: 11px;
  cursor: pointer;
}

.challenge-created textarea {
  resize: none;
  line-height: 1.5;
}

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

.room-leaderboard {
  position: absolute;
  top: 58px;
  right: clamp(20px, 3vw, 48px);
  z-index: 8;
  width: min(270px, 23vw);
  border: 1px solid color-mix(in srgb, var(--cool) 34%, var(--line));
  background: color-mix(in srgb, var(--bg-deep) 91%, transparent);
  box-shadow: 0 18px 45px color-mix(in srgb, var(--bg-deep) 62%, transparent);
  backdrop-filter: blur(10px);
}

.room-leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.room-leaderboard-head span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.room-leaderboard-head i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #87ff5a;
  box-shadow: 0 0 8px rgba(135, 255, 90, 0.7);
}

.room-leaderboard-head button {
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
}

.room-leaderboard ol {
  max-height: 222px;
  margin: 0;
  padding: 5px 0;
  overflow-y: auto;
  list-style: none;
}

.game[data-state="idle"] .room-leaderboard ol {
  max-height: 124px;
}

.room-score-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 10px;
}

.room-score-row.is-self {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-soft);
}

.room-score-rank {
  color: color-mix(in srgb, var(--muted) 68%, transparent);
}

.room-score-player {
  min-width: 0;
}

.room-score-player strong,
.room-score-player span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-score-player strong {
  color: inherit;
  font-size: 10px;
  font-weight: 500;
}

.room-score-player span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.room-score-value {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

html[data-theme="light"] .challenge-flow strong,
html[data-theme="light"] .challenge-dialog,
html[data-theme="light"] .challenge-dialog-head h2 {
  color: #292a2c;
}

html[data-theme="light"] .challenge-intro > span,
html[data-theme="light"] .challenge-flow span {
  color: #626661;
}

html[data-theme="light"] .challenge-dialog,
html[data-theme="light"] .challenge-dialog-shell {
  background-color: #f3f5f2;
}

html[data-theme="light"] .challenge-form input,
html[data-theme="light"] .challenge-created input,
html[data-theme="light"] .challenge-created textarea,
html[data-theme="light"] .challenge-keyboards label {
  border-color: #b7bdb7;
  background: #e3e8e2;
  color: #4d524d;
}

@media (max-width: 1100px) {
  .landing-challenge {
    grid-template-columns: 1fr 1fr;
  }

  .challenge-intro {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .room-leaderboard {
    top: 48px;
    right: 10px;
    width: 190px;
  }

  .room-leaderboard ol {
    max-height: 124px;
  }

  .room-score-row {
    min-height: 32px;
  }
}

@media (max-width: 680px) {
  .landing-nav-links {
    gap: 18px;
  }

  .landing-challenge {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .challenge-intro {
    grid-column: auto;
  }

  .challenge-flow > div {
    grid-template-columns: 28px 78px minmax(0, 1fr);
  }

  .challenge-keyboards {
    grid-template-columns: repeat(3, 1fr);
  }

  .challenge-created-actions {
    grid-template-columns: 1fr;
  }
}

/* Classic typing test */
.hero-classic,
.landing-classic-button {
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid #555952;
  background: transparent;
  color: #d7d3ca;
  font-size: 12px;
  cursor: pointer;
}

.hero-classic:hover,
.landing-classic-button:hover {
  border-color: #78a6a0;
  color: #9ec4bf;
}

.landing-classic {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: clamp(60px, 8vw, 140px);
  align-items: center;
  min-height: 650px;
  padding: 110px clamp(24px, 8vw, 128px);
  border-bottom: 1px solid rgba(232, 228, 220, 0.14);
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 79px, rgba(232, 228, 220, 0.025) 80px),
    #20211e;
}

.landing-classic-copy > p {
  color: #8fa49b;
  font-size: 13px;
  text-transform: uppercase;
}

.landing-classic-copy h2 {
  margin: 24px 0 30px;
  color: #ece8df;
  font-size: clamp(52px, 6.5vw, 104px);
  font-weight: 500;
  line-height: 0.9;
}

.landing-classic-copy h2 strong {
  color: #78a6a0;
}

.landing-classic-copy > span {
  display: block;
  max-width: 700px;
  color: #aaa9a2;
  font-size: 17px;
  line-height: 1.65;
}

.landing-classic-copy > button {
  margin-top: 34px;
  border: 0;
  background: #78a6a0;
  color: #171816;
  font-weight: 700;
}

.classic-preview {
  border-top: 1px solid #51534e;
}

.classic-preview > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 0;
  border-bottom: 1px solid #41433f;
}

.classic-preview strong {
  color: #ece8df;
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 500;
}

.classic-preview span {
  color: #858981;
  font-size: 11px;
  text-transform: uppercase;
}

.run-mode {
  grid-template-columns: repeat(3, 1fr);
}

.classic-test {
  position: absolute;
  inset: 0 0 var(--keyboard-height, 260px);
  z-index: 7;
  padding: clamp(60px, 9vh, 100px) clamp(24px, 8vw, 128px) 28px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
}

.classic-test[hidden] {
  display: none;
}

.classic-test-shell {
  display: flex;
  width: min(1040px, 100%);
  height: 100%;
  margin: 0 auto;
  flex-direction: column;
}

.classic-test-head {
  display: grid;
  grid-template-columns: 1fr auto 80px;
  gap: 24px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.classic-test-head > div:first-child span,
.classic-test-head > div:first-child strong {
  display: block;
  text-transform: uppercase;
}

.classic-test-head > div:first-child span {
  color: var(--muted);
  font-size: 9px;
}

.classic-test-head > div:first-child strong {
  margin-top: 5px;
  color: var(--cool);
  font-size: 11px;
  font-weight: 500;
}

.classic-duration {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  border: 1px solid var(--faint);
}

.classic-duration button {
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.classic-duration button.is-selected {
  background: var(--cool);
  color: var(--bg-deep);
}

.classic-test-head output {
  color: var(--text);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.classic-passage {
  flex: 1;
  margin: clamp(28px, 6vh, 62px) 0 20px;
  overflow: hidden;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  font-size: clamp(22px, 2.35vw, 34px);
  line-height: 1.65;
  white-space: pre-wrap;
}

.classic-passage span {
  position: relative;
}

.classic-passage .is-correct {
  color: var(--text-soft);
}

.classic-passage .is-error {
  color: var(--error);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.classic-passage .is-current::before {
  content: "";
  position: absolute;
  top: 5%;
  bottom: 5%;
  left: -1px;
  width: 2px;
  background: var(--accent);
  animation: classic-caret 900ms steps(1) infinite;
}

@keyframes classic-caret {
  50% { opacity: 0; }
}

.classic-test-foot {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.classic-test-foot b {
  color: var(--text-soft);
  font-weight: 500;
}

.classic-results {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  text-align: center;
}

.classic-results[hidden] {
  display: none;
}

.classic-results p {
  margin: 0 0 12px;
  color: var(--cool);
  font-size: 11px;
  text-transform: uppercase;
}

.classic-results h2 {
  margin: 0;
  color: var(--muted);
  font-size: clamp(34px, 5vw, 66px);
  font-weight: 500;
}

.classic-results h2 strong {
  color: var(--accent);
  font-size: 1.25em;
}

.classic-results > div:not(.classic-result-actions) {
  display: flex;
  gap: clamp(24px, 5vw, 70px);
  margin-top: 34px;
}

.classic-results > div span {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.classic-results > div b {
  color: var(--text-soft);
  font-size: 18px;
  font-weight: 500;
}

.classic-result-actions {
  display: flex;
  gap: 24px;
  margin-top: 36px;
}

.game[data-state="classic"] .hud,
.game[data-state="classic-paused"] .hud,
.game[data-state="classic-result"] .hud {
  opacity: 1;
  transform: translate(-50%, 0);
}

.game[data-state^="classic"] :is(.field-legend, .field-watermark, .pressure-rail, .pressure-haze, .depth-line) {
  visibility: hidden;
}

.game[data-state^="classic"] .lives {
  visibility: hidden;
}

html[data-theme="light"] .landing-classic {
  border-bottom-color: rgba(41, 42, 44, 0.13);
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 79px, rgba(41, 42, 44, 0.035) 80px),
    #e8ece7;
}

html[data-theme="light"] .landing-classic-copy h2,
html[data-theme="light"] .classic-preview strong {
  color: #292a2c;
}

html[data-theme="light"] .landing-classic-copy > span,
html[data-theme="light"] .classic-preview span {
  color: #666a65;
}

@media (max-width: 900px) {
  .landing-classic {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .classic-preview {
    max-width: 680px;
  }
}

@media (max-width: 680px) {
  .hero-classic {
    width: 100%;
  }

  .landing-classic {
    min-height: 0;
    padding: 90px 20px;
  }

  .landing-classic-copy h2 {
    font-size: 54px;
  }

  .classic-test {
    padding: 30px 16px 18px;
  }

  .classic-test-head {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .classic-test-head > div:first-child {
    display: none;
  }

  .classic-test-head output {
    font-size: 28px;
  }

  .classic-duration {
    grid-template-columns: repeat(3, 40px);
  }

  .classic-passage {
    margin-top: 24px;
    font-size: 21px;
    line-height: 1.55;
  }

  .classic-results > div:not(.classic-result-actions) {
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
  }
}

/* Game-over impact */
.game-over {
  isolation: isolate;
}

.game-over-content {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.game-over-impact {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.impact-splat {
  position: absolute;
  top: 44%;
  left: 50%;
  width: min(680px, 72vw);
  aspect-ratio: 1.25;
  transform: translate(-50%, -50%);
}

.impact-splat::before,
.impact-splat::after {
  content: "";
  position: absolute;
  inset: 8% 5%;
  background: #9e7b2f;
  clip-path: polygon(4% 43%, 17% 34%, 11% 18%, 31% 24%, 43% 5%, 54% 25%, 75% 13%, 73% 33%, 96% 40%, 79% 54%, 89% 78%, 65% 71%, 52% 95%, 39% 73%, 15% 84%, 22% 61%);
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.38));
}

.impact-splat::after {
  inset: 19% 16%;
  background: #66733c;
  clip-path: polygon(2% 49%, 24% 34%, 18% 8%, 44% 25%, 60% 4%, 66% 29%, 98% 42%, 75% 61%, 83% 90%, 53% 74%, 28% 96%, 31% 68%);
  mix-blend-mode: screen;
  opacity: 0.78;
}

.impact-splat i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--drop-size, 28px);
  aspect-ratio: 1;
  border-radius: 62% 38% 55% 45%;
  background: var(--drop-color, #9e7b2f);
  opacity: 0;
}

.impact-splat i:nth-child(1) { --drop-x: -330px; --drop-y: -135px; --drop-size: 35px; transform: rotate(18deg); }
.impact-splat i:nth-child(2) { --drop-x: 300px; --drop-y: -155px; --drop-size: 22px; --drop-color: #697945; }
.impact-splat i:nth-child(3) { --drop-x: -385px; --drop-y: 42px; --drop-size: 18px; }
.impact-splat i:nth-child(4) { --drop-x: 370px; --drop-y: 52px; --drop-size: 42px; --drop-color: #b88b34; }
.impact-splat i:nth-child(5) { --drop-x: -245px; --drop-y: 215px; --drop-size: 26px; --drop-color: #65703a; }
.impact-splat i:nth-child(6) { --drop-x: 255px; --drop-y: 205px; --drop-size: 17px; }
.impact-splat i:nth-child(7) { --drop-x: -75px; --drop-y: -235px; --drop-size: 20px; --drop-color: #bd5f4f; }
.impact-splat i:nth-child(8) { --drop-x: 95px; --drop-y: 240px; --drop-size: 34px; --drop-color: #bd5f4f; }

.impact-score {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: #f4f0e6;
  text-shadow: 0 5px 22px rgba(0, 0, 0, 0.52);
  transform: translate(-50%, -50%);
}

.impact-score span {
  font-size: 12px;
  text-transform: uppercase;
}

.impact-score strong {
  font-size: clamp(72px, 11vw, 158px);
  font-weight: 700;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.game[data-state="gameover"] .game-over-impact {
  animation: impact-stage 1.55s ease both;
}

.game[data-state="gameover"] .impact-splat::before {
  animation: impact-core 1.4s cubic-bezier(0.16, 0.84, 0.28, 1) both;
}

.game[data-state="gameover"] .impact-splat::after {
  animation: impact-core-inner 1.45s cubic-bezier(0.16, 0.84, 0.28, 1) both;
}

.game[data-state="gameover"] .impact-splat i {
  animation: impact-drop 1.25s cubic-bezier(0.12, 0.76, 0.26, 1) both;
}

.game[data-state="gameover"] .impact-score {
  animation: impact-score-in 1.35s cubic-bezier(0.16, 0.84, 0.28, 1) both;
}

.game[data-state="gameover"] .game-over-content {
  animation: results-arrive 650ms 980ms ease-out both;
}

@keyframes impact-stage {
  0% { opacity: 0; }
  10%, 68% { opacity: 1; }
  100% { opacity: 0.13; }
}

@keyframes impact-core {
  0% { opacity: 0; transform: scale(0.06) rotate(-18deg); }
  38% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 0.6; transform: scale(1) rotate(0); }
}

@keyframes impact-core-inner {
  0% { opacity: 0; transform: scale(0.03) rotate(22deg); }
  42% { opacity: 0.78; transform: scale(1.12) rotate(-3deg); }
  100% { opacity: 0.45; transform: scale(1) rotate(0); }
}

@keyframes impact-drop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.1); }
  24% { opacity: 1; }
  72% { opacity: 1; transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y))) scale(1); }
  100% { opacity: 0.35; transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y))) scale(0.86); }
}

@keyframes impact-score-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  24%, 68% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(1.04); }
}

@keyframes results-arrive {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .impact-splat {
    width: 125vw;
  }

  .impact-splat i:nth-child(1) { --drop-x: -180px; --drop-y: -105px; }
  .impact-splat i:nth-child(2) { --drop-x: 165px; --drop-y: -115px; }
  .impact-splat i:nth-child(3) { --drop-x: -205px; --drop-y: 30px; }
  .impact-splat i:nth-child(4) { --drop-x: 195px; --drop-y: 40px; }
  .impact-splat i:nth-child(5) { --drop-x: -135px; --drop-y: 155px; }
  .impact-splat i:nth-child(6) { --drop-x: 140px; --drop-y: 150px; }
  .impact-splat i:nth-child(7) { --drop-x: -45px; --drop-y: -170px; }
  .impact-splat i:nth-child(8) { --drop-x: 55px; --drop-y: 175px; }
}

@media (prefers-reduced-motion: reduce) {
  .game[data-state="gameover"] .game-over-impact {
    opacity: 0.12;
  }

  .game[data-state="gameover"] .impact-score {
    display: none;
  }

  .game[data-state="gameover"] .game-over-content {
    opacity: 1;
    transform: none;
  }
}