:root {
  --black: #15100f;
  --deep: #251612;
  --panel: #4b2418;
  --panel-2: #6b2f1c;
  --cream: #ffe8a6;
  --paper: #fff0bf;
  --orange: #f47b20;
  --gold: #ffd43b;
  --red: #d43d2b;
  --green: #61b545;
  --cyan: #38b8c9;
  --blue: #2473c9;
  --purple: #7b4ab5;
  --shadow-hard: 6px 6px 0 #120c0a;
  --shadow-soft: 0 14px 0 rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--cream);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 5px),
    linear-gradient(135deg, #24120e, #432014 45%, #1a1111);
  font-family: Tahoma, Verdana, "Segoe UI", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(45deg, rgba(0, 0, 0, 0.16) 25%, transparent 25% 75%, rgba(0, 0, 0, 0.16) 75%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.16) 25%, transparent 25% 75%, rgba(0, 0, 0, 0.16) 75%);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  opacity: 0.45;
}

body.smash-shake {
  animation: smash-shake 140ms steps(2, end);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
.panel-title,
.menu-tab,
.mode-card strong,
.command-button,
.mode-button,
.mini-button,
.file-button {
  font-family: "Arial Black", Impact, Tahoma, sans-serif;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: clamp(2.5rem, 7vw, 5.7rem);
  line-height: 0.86;
  text-shadow:
    4px 4px 0 var(--red),
    8px 8px 0 #120c0a;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

h2 {
  margin-bottom: 0;
  color: var(--gold);
  text-shadow: 3px 3px 0 #120c0a;
}

.menu-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.menu-screen.hidden {
  display: none;
}

.menu-cabinet {
  width: min(1050px, 100%);
  display: grid;
  gap: 14px;
  padding: 14px;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(255, 212, 59, 0.12), transparent 26%),
    var(--panel);
  border: 4px solid var(--black);
  border-radius: 6px;
  box-shadow: var(--shadow-hard), var(--shadow-soft);
}

.menu-topbar,
.target-meta,
.keyboard-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--black);
  background: var(--gold);
  border: 3px solid var(--black);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.menu-hero {
  min-height: 270px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 16px;
  align-items: stretch;
}

.menu-title-block,
.menu-mascot,
.menu-panel,
.play-area,
.control-panel,
.result-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 38%),
    var(--panel-2);
  border: 4px solid var(--black);
  border-radius: 6px;
  box-shadow: 4px 4px 0 #120c0a;
}

.menu-title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.menu-mascot {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255, 212, 59, 0.16) 0 12px, transparent 12px 24px),
    #24201d;
}

.menu-mascot::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 4px solid #0e0908;
  background: #342c28;
  box-shadow: inset 0 0 0 8px rgba(255, 212, 59, 0.08);
}

.mascot-key {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 150px;
  height: 130px;
  display: grid;
  place-items: center;
  color: var(--black);
  background: var(--paper);
  border: 5px solid var(--black);
  border-bottom-width: 14px;
  border-radius: 6px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 4rem;
  transform: translate(-50%, -50%) rotate(-4deg);
  box-shadow: var(--shadow-hard);
}

.mascot-ant,
.mascot-ant::before,
.mascot-ant::after {
  position: absolute;
}

.mascot-ant {
  width: 68px;
  height: 34px;
  transform-origin: 50% 50%;
}

.mascot-ant::before {
  content: "";
  left: 20px;
  top: 12px;
  width: 30px;
  height: 16px;
  background: #0c0705;
  border-radius: 999px;
  box-shadow:
    -18px 2px 0 -5px #0c0705,
    22px -2px 0 -7px #0c0705;
}

.mascot-ant::after {
  content: "";
  left: 8px;
  top: 4px;
  width: 52px;
  height: 28px;
  background:
    linear-gradient(26deg, transparent 43%, #0c0705 44% 52%, transparent 53%),
    linear-gradient(-26deg, transparent 43%, #0c0705 44% 52%, transparent 53%),
    linear-gradient(90deg, transparent 20%, #0c0705 21% 25%, transparent 26% 48%, #0c0705 49% 53%, transparent 54% 75%, #0c0705 76% 80%, transparent 81%);
}

.mascot-ant.one {
  left: 26px;
  top: 38px;
  transform: rotate(18deg);
}

.mascot-ant.two {
  right: 22px;
  top: 62px;
  transform: rotate(138deg);
}

.mascot-ant.three {
  left: 62px;
  bottom: 30px;
  transform: rotate(-28deg);
}

.menu-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.menu-tab,
.mode-button,
.command-button,
.mini-button,
.file-button {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 8px 12px;
  color: var(--cream);
  text-align: center;
  background: #2f211c;
  border: 3px solid var(--black);
  border-radius: 4px;
  box-shadow: 3px 3px 0 #120c0a;
}

.menu-tab.active,
.mode-button.active,
.command-button.primary {
  color: var(--black);
  background: var(--gold);
}

.menu-tab:hover,
.mode-button:hover,
.command-button:hover,
.mini-button:hover,
.file-button:hover,
.mode-card:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #120c0a;
}

.menu-panel {
  display: none;
  padding: 16px;
}

.menu-panel.active {
  display: grid;
}

#menuPlayPanel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mode-card {
  min-height: 118px;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #fff4c6;
  text-align: center;
  background: var(--orange);
  border: 4px solid var(--black);
  border-radius: 4px;
  box-shadow: 4px 4px 0 #120c0a;
}

.mode-card strong {
  color: var(--black);
  font-size: 1.4rem;
  line-height: 1.05;
}

.challenge-card {
  background: var(--orange);
}

.endless-card {
  background: var(--cyan);
}

.custom-card {
  background: var(--green);
}

.settings-panel {
  gap: 12px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--black);
  background: var(--cream);
  border: 3px solid var(--black);
  border-radius: 4px;
  font-weight: 900;
  text-transform: uppercase;
}

.toggle-line input {
  width: 20px;
  height: 20px;
  accent-color: var(--orange);
}

.app-frame {
  width: min(1420px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-open .app-frame {
  display: none;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 4px solid var(--black);
  border-radius: 6px;
  box-shadow: var(--shadow-hard);
}

.masthead h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.9rem);
}

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

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
}

.play-area {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.typing-catcher {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  border: 0;
  pointer-events: none;
}

.control-panel {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.panel-title {
  color: var(--gold);
  font-size: 1.1rem;
  text-shadow: 3px 3px 0 #120c0a;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 8px;
}

.stat-tile {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 9px;
  color: var(--black);
  background: var(--cyan);
  border: 3px solid var(--black);
  border-radius: 4px;
  box-shadow: 3px 3px 0 #120c0a;
}

.stat-tile:nth-child(2) {
  background: var(--green);
}

.stat-tile:nth-child(3) {
  background: var(--gold);
}

.stat-tile:nth-child(5) {
  color: var(--cream);
  background: var(--purple);
}

.stat-tile:nth-child(6) {
  background: var(--orange);
}

.stat-tile.danger {
  color: var(--cream);
  background: var(--red);
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-tile strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

.target-wrap,
.keyboard-shell {
  overflow: hidden;
  background: #2c201a;
  border: 4px solid var(--black);
  border-radius: 6px;
  box-shadow: 4px 4px 0 #120c0a;
}

.target-wrap {
  min-height: 214px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.text-race {
  max-height: 224px;
  overflow: auto;
  padding: 16px;
  color: var(--cream);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 6px),
    #201815;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1.78;
}

.char {
  display: inline-block;
  min-width: 0.65ch;
  padding: 0 1px;
  border-radius: 2px;
}

.char.space {
  min-width: 0.8ch;
}

.char.current {
  color: var(--black);
  background: var(--gold);
  box-shadow: 0 3px 0 #120c0a;
}

.char.correct {
  color: #90ff6d;
}

.char.wrong {
  color: var(--cream);
  background: var(--red);
}

.keyboard-topline {
  border-width: 0 0 3px;
  border-radius: 0;
}

.keyboard {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 18px;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255, 212, 59, 0.12) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, #3a322d, #211a17);
}

.keyboard-row {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 7px;
}

.keyboard-row:nth-child(3) {
  padding-left: 18px;
}

.keyboard-row:nth-child(4) {
  padding-left: 42px;
}

.keyboard-row:nth-child(5) {
  padding: 0 120px;
}

.key {
  --grow: 1;
  position: relative;
  flex: var(--grow) 1 0;
  min-width: 36px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  color: var(--black);
  background: var(--paper);
  border: 3px solid var(--black);
  border-bottom-width: 7px;
  border-radius: 4px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.78rem;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
  transition: transform 80ms steps(2, end), background 80ms steps(2, end);
}

.key .sub {
  display: block;
  margin-top: 3px;
  color: #7b4d23;
  font-family: Tahoma, sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
}

.key.pressed {
  transform: translateY(5px);
  color: var(--cream);
  background: var(--blue);
  border-bottom-width: 3px;
}

.key.infested {
  background: var(--gold);
  outline: 4px solid rgba(212, 61, 43, 0.42);
}

.key.expected {
  background: #b5ff65;
}

.ants-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.ant {
  position: absolute;
  width: 48px;
  height: 24px;
  pointer-events: none;
  transform-origin: 50% 50%;
  background: url("assets/ant-sprite.png") center / contain no-repeat;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.34));
}

.ant.smashed {
  width: 44px;
  height: 32px;
  background:
    radial-gradient(circle at 50% 52%, rgba(212, 61, 43, 0.95) 0 36%, transparent 38%),
    radial-gradient(circle at 28% 34%, rgba(80, 13, 8, 0.85) 0 16%, transparent 18%),
    radial-gradient(circle at 72% 66%, rgba(80, 13, 8, 0.85) 0 14%, transparent 16%);
}

.ant.smashed::before,
.ant.smashed::after {
  display: none;
}

.button-row,
.button-stack {
  display: flex;
  gap: 8px;
}

.button-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.mode-button {
  flex: 1;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
}

select,
textarea {
  width: 100%;
  color: var(--black);
  background: var(--paper);
  border: 3px solid var(--black);
  border-radius: 4px;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.14);
}

select {
  min-height: 42px;
  padding: 8px 10px;
  font-weight: 900;
}

textarea {
  min-height: 136px;
  resize: vertical;
  padding: 10px;
  line-height: 1.4;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.result-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 5, 3, 0.78);
}

.result-dialog.hidden {
  display: none;
}

.result-panel {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.result-summary div {
  min-height: 62px;
  padding: 10px;
  color: var(--black);
  background: var(--paper);
  border: 3px solid var(--black);
  border-radius: 4px;
}

.result-summary span {
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-summary strong {
  display: block;
  margin-top: 4px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.35rem;
}

.low-motion *,
.low-motion *::before,
.low-motion *::after {
  animation-duration: 1ms !important;
  scroll-behavior: auto !important;
}

@keyframes smash-shake {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-4px, 3px);
  }
  66% {
    transform: translate(5px, -2px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@media (max-width: 1120px) {
  .game-layout,
  .menu-hero {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }
}

@media (max-width: 840px) {
  .menu-screen {
    padding: 10px;
  }

  .menu-cabinet {
    padding: 10px;
  }

  #menuPlayPanel,
  .menu-tabs {
    grid-template-columns: 1fr;
  }

  .menu-mascot {
    min-height: 210px;
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

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

  .text-race {
    font-size: 1rem;
    line-height: 1.65;
  }

  .keyboard {
    gap: 5px;
    padding: 10px;
  }

  .keyboard-row {
    gap: 4px;
  }

  .keyboard-row:nth-child(3),
  .keyboard-row:nth-child(4),
  .keyboard-row:nth-child(5) {
    padding-left: 0;
    padding-right: 0;
  }

  .key {
    min-width: 22px;
    height: 38px;
    padding: 0 4px;
    font-size: 0.58rem;
    border-width: 2px;
    border-bottom-width: 5px;
  }

  .key .sub {
    display: none;
  }

  .button-stack,
  .result-summary {
    grid-template-columns: 1fr;
  }
}

/* Expanded arcade build */
.logo-hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 18px;
  background: #1f1714;
  border: 4px solid var(--black);
  border-radius: 6px;
  box-shadow: 4px 4px 0 #120c0a;
}

.logo-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
}

.menu-tabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#menuPlayPanel {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.daily-card {
  background: var(--gold);
}

.daily-card strong {
  color: var(--black);
}

.split-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.level-card {
  min-height: 116px;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 12px;
  color: var(--black);
  text-align: left;
  background: var(--paper);
  border: 3px solid var(--black);
  border-radius: 4px;
  box-shadow: 4px 4px 0 #120c0a;
}

.level-card span,
.level-card small {
  font-weight: 900;
  text-transform: uppercase;
}

.level-card span {
  color: var(--red);
  font-size: 0.75rem;
}

.level-card strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.05rem;
  text-transform: uppercase;
}

.editor-panel,
.scores-panel {
  gap: 12px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 12px;
}

.editor-column {
  display: grid;
  gap: 10px;
  align-content: start;
}

.editor-path-studio {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 230px;
  gap: 10px;
  align-items: start;
}

.editor-path-board {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1000 / 420;
  overflow: hidden;
  touch-action: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 212, 59, 0.1) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, #3a322d, #211a17);
  border: 4px solid var(--black);
  border-radius: 6px;
  box-shadow: 4px 4px 0 #120c0a;
  user-select: none;
}

.editor-path-keys {
  position: absolute;
  inset: 14px;
  display: grid;
  grid-template-rows: repeat(5, minmax(42px, 1fr));
  gap: 6px;
  pointer-events: none;
}

.editor-key-row {
  display: flex;
  gap: 6px;
}

.editor-key-row:nth-child(3) {
  padding-left: 14px;
}

.editor-key-row:nth-child(4) {
  padding-left: 34px;
}

.editor-key-row:nth-child(5) {
  padding: 0 88px;
}

.editor-key {
  --grow: 1;
  flex: var(--grow) 1 0;
  min-width: 34px;
  display: grid;
  place-items: center;
  color: var(--black);
  background: rgba(255, 240, 191, 0.86);
  border: 2px solid var(--black);
  border-bottom-width: 5px;
  border-radius: 4px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.editor-path-svg {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#editorCurrentPath,
.saved-editor-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#editorCurrentPath {
  stroke: var(--gold);
  stroke-width: 12;
  filter: drop-shadow(3px 3px 0 #120c0a);
}

.saved-editor-path {
  stroke: rgba(56, 184, 201, 0.82);
  stroke-width: 7;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.55));
}

#editorPreviewAnt {
  fill: #0b0705;
  stroke: var(--red);
  stroke-width: 4;
  opacity: 0;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.42));
}

#editorPreviewAnt.active {
  opacity: 1;
}

.path-side-panel {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  background: #2a1b16;
  border: 4px solid var(--black);
  border-radius: 6px;
  box-shadow: 4px 4px 0 #120c0a;
}

.path-side-panel label {
  display: grid;
  gap: 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.path-side-panel input,
.path-side-panel select {
  min-height: 38px;
  padding: 7px 9px;
  color: var(--black);
  background: var(--paper);
  border: 3px solid var(--black);
  border-radius: 4px;
  font-weight: 900;
}

.path-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.random-path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  align-items: stretch;
}

.random-path-row input {
  width: 100%;
  text-align: center;
}

.path-side-panel .button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#saveDrawnPathButton {
  grid-column: 1 / -1;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.number-grid label,
.path-row label {
  display: grid;
  gap: 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.number-grid input,
.number-grid select,
.path-row input,
.path-row select,
#playerName,
#editorName {
  min-height: 38px;
  padding: 7px 9px;
  color: var(--black);
  background: var(--paper);
  border: 3px solid var(--black);
  border-radius: 4px;
  font-weight: 900;
}

.editor-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--gold);
  font-family: "Arial Black", Impact, sans-serif;
  text-transform: uppercase;
}

.path-list {
  max-height: 330px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.path-row {
  display: grid;
  grid-template-columns: 76px minmax(120px, 1fr) 96px 90px 80px 88px;
  gap: 6px;
  align-items: end;
  padding: 8px;
  background: #2a1b16;
  border: 3px solid var(--black);
  border-radius: 4px;
}

.path-card {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  color: var(--cream);
}

.path-card strong {
  color: var(--gold);
  font-family: "Arial Black", Impact, sans-serif;
  text-transform: uppercase;
}

.path-card span {
  align-self: center;
  color: var(--paper);
  font-weight: 900;
}

.path-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger-button {
  color: var(--cream);
  background: var(--red);
}

.wrap {
  flex-wrap: wrap;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.score-empty,
.score-row {
  padding: 10px;
  color: var(--black);
  background: var(--paper);
  border: 3px solid var(--black);
  border-radius: 4px;
  font-weight: 900;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
}

.score-row {
  display: grid;
  gap: 4px;
}

.score-row strong {
  font-family: "Arial Black", Impact, sans-serif;
  text-transform: uppercase;
}

.score-row span {
  font-size: 0.86rem;
}

.hidden {
  display: none !important;
}

.run-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  color: var(--black);
  background: var(--paper);
  border: 3px solid var(--black);
  border-radius: 4px;
  font-weight: 900;
}

.run-card strong {
  font-family: "Arial Black", Impact, sans-serif;
  text-transform: uppercase;
}

.endless-live-controls {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #2a1b16;
  border: 3px solid var(--black);
  border-radius: 4px;
}

.announcer {
  position: fixed;
  left: 50%;
  top: 18%;
  z-index: 50;
  width: min(720px, calc(100% - 28px));
  transform: translateX(-50%);
  padding: 18px;
  color: var(--gold);
  text-align: center;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(2rem, 7vw, 5rem);
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--red), 8px 8px 0 #120c0a;
  pointer-events: none;
}

.announcer.pop {
  animation: announcer-pop 760ms steps(4, end);
}

.key.damaged {
  background: #b86f3a;
  color: var(--cream);
  outline: 4px solid rgba(0, 0, 0, 0.34);
}

.key.fever {
  box-shadow: 0 0 0 4px rgba(255, 212, 59, 0.34), inset 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.fever-mode .masthead,
.fever-mode .keyboard-shell {
  animation: fever-pulse 480ms steps(2, end) infinite;
}

@keyframes announcer-pop {
  0% {
    transform: translateX(-50%) scale(0.55) rotate(-5deg);
    opacity: 0;
  }
  22% {
    transform: translateX(-50%) scale(1.12) rotate(2deg);
    opacity: 1;
  }
  70% {
    transform: translateX(-50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(0.92);
    opacity: 0;
  }
}

@keyframes fever-pulse {
  0% {
    filter: saturate(1);
  }
  100% {
    filter: saturate(1.65) contrast(1.08);
  }
}

@media (max-width: 1080px) {
  .menu-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #menuPlayPanel,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .path-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-path-studio {
    grid-template-columns: 1fr;
  }

  .editor-path-board {
    min-height: 320px;
    overflow-x: auto;
  }

  .editor-path-keys,
  .editor-path-svg {
    min-width: 760px;
  }
}

@media (max-width: 720px) {
  .logo-hero {
    min-height: 360px;
    padding: 10px;
  }

  .menu-tabs,
  #menuPlayPanel,
  .number-grid,
  .split-row {
    grid-template-columns: 1fr;
  }
}

/* Polished browser-game shell */
:root {
  --ink: #110b09;
  --chrome: #2b1a15;
  --chrome-2: #3b241c;
  --screen: #1a1210;
  --screen-2: #241813;
  --rim: #fff2b4;
  --ui-shadow: 0 22px 45px rgba(0, 0, 0, 0.42);
  --ui-inset: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

body {
  min-width: 320px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, #120c0a 0%, #321910 38%, #191110 68%, #071417 100%);
  overflow-x: hidden;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 212, 59, 0.05), transparent 18%, transparent 82%, rgba(56, 184, 201, 0.05)),
    linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25% 75%, rgba(0, 0, 0, 0.2) 75%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.16) 25%, transparent 25% 75%, rgba(0, 0, 0, 0.16) 75%);
  background-position: 0 0, 0 0, 12px 12px;
  background-size: auto, 24px 24px, 24px 24px;
  opacity: 0.72;
}

h1,
h2,
.panel-title,
.menu-tab,
.mode-card strong,
.command-button,
.mode-button,
.mini-button,
.file-button,
.level-card strong,
.run-card strong {
  font-family: "Trebuchet MS", "Arial Black", Impact, Tahoma, sans-serif;
}

.menu-screen {
  min-height: 100vh;
  align-items: start;
  padding: clamp(10px, 2vw, 22px);
}

.menu-cabinet {
  width: min(1180px, 100%);
  min-height: calc(100vh - clamp(20px, 4vw, 44px));
  gap: 0;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 232, 166, 0.12), transparent 18%),
    linear-gradient(180deg, #4a2519, #291711 76%, #1a100d);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow:
    0 0 0 2px rgba(255, 232, 166, 0.24),
    8px 8px 0 #0b0706,
    var(--ui-shadow);
}

.menu-cabinet::before {
  content: "";
  height: 8px;
  display: block;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--cyan), var(--green), var(--orange));
  border-bottom: 3px solid var(--ink);
}

.menu-topbar {
  min-height: 44px;
  padding: 8px 14px;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    #17100e;
  border: 0;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
  font-size: 0.78rem;
}

#menuBestStat {
  color: var(--gold);
}

.logo-hero {
  min-height: clamp(230px, 34vw, 340px);
  padding: clamp(8px, 1.2vw, 14px);
  background:
    linear-gradient(180deg, rgba(255, 212, 59, 0.12), transparent 34%),
    linear-gradient(180deg, #231611, #140d0b);
  border: 0;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: inset 0 -18px 30px rgba(0, 0, 0, 0.28);
}

.logo-art {
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.42));
}

.menu-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px 0;
  background:
    linear-gradient(180deg, #2e1b14, #21130f);
  border-bottom: 3px solid var(--ink);
}

.menu-tabs .menu-tab {
  min-height: 48px;
  padding: 9px 10px;
  color: #ffd98d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 46%),
    #362018;
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.24);
}

.menu-tabs .menu-tab.active {
  color: var(--black);
  background:
    linear-gradient(180deg, #fff3a8, var(--gold) 48%, #f6aa1d);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 4px 0 #120c0a;
}

.menu-tabs .menu-tab:hover {
  transform: translateY(1px);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    0 3px 0 #120c0a;
}

.menu-panel,
.play-area,
.control-panel,
.result-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 32%),
    linear-gradient(180deg, var(--chrome-2), #271711);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow:
    var(--ui-inset),
    5px 5px 0 rgba(11, 7, 6, 0.96);
}

.menu-panel {
  min-height: 192px;
  padding: clamp(14px, 2vw, 22px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#menuPlayPanel {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 16px);
  align-items: stretch;
}

.mode-card {
  position: relative;
  min-height: clamp(112px, 12vw, 154px);
  align-content: end;
  justify-items: start;
  overflow: hidden;
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.34),
    inset 0 -7px 0 rgba(0, 0, 0, 0.22),
    5px 5px 0 #0b0706;
}

.mode-card::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 54px;
  height: 10px;
  background: rgba(17, 11, 9, 0.48);
  border: 2px solid rgba(255, 242, 180, 0.5);
  border-radius: 999px;
}

.mode-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% 18%;
  height: 88px;
  transform: rotate(-9deg);
  background: rgba(255, 255, 255, 0.13);
  pointer-events: none;
}

.mode-card strong {
  position: relative;
  z-index: 1;
  max-width: 9ch;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  text-align: left;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.26);
}

.challenge-card {
  background:
    linear-gradient(145deg, #ffba26 0%, var(--orange) 58%, #c13b1f 100%);
}

.daily-card {
  background:
    linear-gradient(145deg, #fff09a 0%, var(--gold) 48%, #e3811f 100%);
}

.endless-card {
  background:
    linear-gradient(145deg, #84e9e8 0%, var(--cyan) 52%, #1868a8 100%);
}

.custom-card {
  background:
    linear-gradient(145deg, #a9e35e 0%, var(--green) 55%, #19704f 100%);
}

.mode-card:hover,
.level-card:hover,
.command-button:hover,
.mini-button:hover,
.file-button:hover,
.leaderboard-tabs .menu-tab:hover {
  transform: translate(1px, 1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    3px 3px 0 #0b0706;
}

.split-row {
  padding: 10px;
  background: rgba(17, 11, 9, 0.28);
  border: 2px solid rgba(255, 232, 166, 0.2);
  border-radius: 7px;
}

.level-grid,
.leaderboard-list,
.path-list {
  scrollbar-color: var(--gold) #20130f;
}

.level-card,
.score-empty,
.score-row,
.run-card,
.toggle-line {
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.38),
    4px 4px 0 #0b0706;
}

.level-card {
  min-height: 112px;
  background:
    linear-gradient(180deg, #fff6cd, var(--paper) 62%, #eac36e);
}

.level-card small {
  color: #5f311e;
}

.leaderboard-tabs {
  padding: 6px;
  background: rgba(17, 11, 9, 0.28);
  border: 2px solid rgba(255, 232, 166, 0.2);
  border-radius: 7px;
}

.leaderboard-tabs .menu-tab {
  border-radius: 6px;
}

select,
textarea,
.path-side-panel input,
.path-side-panel select,
.number-grid input,
.number-grid select,
.path-row input,
.path-row select,
#playerName,
#editorName {
  border-width: 2px;
  border-radius: 6px;
  box-shadow:
    inset 3px 3px 0 rgba(0, 0, 0, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.25);
}

.command-button,
.mini-button,
.file-button,
.mode-button {
  min-height: 42px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48%),
    #31201b;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.22),
    3px 3px 0 #0b0706;
}

.command-button.primary,
.mode-button.active {
  background:
    linear-gradient(180deg, #fff1a3, var(--gold) 48%, #e68a21);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 0 rgba(0, 0, 0, 0.16),
    3px 3px 0 #0b0706;
}

.app-frame {
  width: min(1500px, calc(100% - 18px));
  min-height: calc(100vh - 23px);
  margin: 17px auto 6px;
  gap: 10px;
}

.masthead {
  min-height: 76px;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(90deg, #3c2018, #1b1210 72%, #091b20);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow:
    0 0 0 2px rgba(255, 232, 166, 0.16),
    5px 5px 0 #0b0706;
}

.masthead h1 {
  color: var(--gold);
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  text-shadow: 2px 2px 0 var(--red), 4px 4px 0 #0b0706;
}

.masthead .eyebrow {
  margin-bottom: 4px;
}

.header-actions {
  min-width: 190px;
}

.mini-button {
  min-width: 88px;
}

.game-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 10px;
}

.play-area,
.control-panel {
  padding: 12px;
}

.control-panel {
  top: 9px;
}

.panel-title {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 2px;
  color: var(--gold);
  font-size: 1rem;
}

.run-card {
  min-height: 54px;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(255, 212, 59, 0.12), transparent),
    #20130f;
}

.button-stack {
  gap: 9px;
}

.stats-grid {
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 7px;
}

.stat-tile {
  min-height: 64px;
  padding: 8px 9px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.24),
    inset 0 -5px 0 rgba(0, 0, 0, 0.16);
}

.stat-tile strong {
  font-size: clamp(1rem, 1.7vw, 1.32rem);
}

.stat-label {
  font-size: 0.64rem;
}

.target-wrap,
.keyboard-shell,
.editor-path-board,
.path-side-panel,
.path-row,
.endless-live-controls {
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    5px 5px 0 #0b0706;
}

.target-meta,
.keyboard-topline {
  min-height: 36px;
  padding: 7px 11px;
  background:
    linear-gradient(180deg, #fff1a3, var(--gold) 55%, #e58c24);
  border-color: var(--ink);
}

.target-wrap {
  min-height: 150px;
}

.text-race {
  max-height: 142px;
  padding: 15px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #211613, #17100e);
}

.keyboard {
  gap: clamp(5px, 0.55vw, 8px);
  padding: clamp(12px, 1.3vw, 18px);
  background:
    repeating-linear-gradient(90deg, rgba(255, 212, 59, 0.1) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, #3f342d, #201713);
}

.keyboard-row {
  gap: clamp(4px, 0.48vw, 7px);
}

.keyboard-row:nth-child(3) {
  padding-left: clamp(12px, 1.5vw, 18px);
}

.keyboard-row:nth-child(4) {
  padding-left: clamp(24px, 3.4vw, 42px);
}

.keyboard-row:nth-child(5) {
  padding: 0 clamp(38px, 9vw, 118px);
}

.key {
  min-width: 34px;
  height: clamp(42px, 4.3vw, 50px);
  border: 2px solid var(--ink);
  border-bottom-width: 6px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, #fff8d4, var(--paper) 60%, #d9b062);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    0 2px 0 rgba(0, 0, 0, 0.16);
}

.key[data-key="space"] {
  min-height: 44px;
}

.key.expected {
  background:
    linear-gradient(180deg, #d9ff8a, #91df49);
}

.key.infested {
  background:
    linear-gradient(180deg, #ffe880, var(--gold));
}

.key.pressed {
  background:
    linear-gradient(180deg, #56c9ee, var(--blue));
}

.editor-path-studio {
  grid-template-columns: minmax(610px, 1fr) minmax(220px, 240px);
}

.editor-path-board {
  background:
    repeating-linear-gradient(90deg, rgba(255, 212, 59, 0.08) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, #3c312a, #1d1512);
}

.path-side-panel,
.path-row,
.endless-live-controls {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    #20130f;
}

.path-side-panel .button-row,
.random-path-row {
  gap: 7px;
}

.path-card span {
  font-size: 0.8rem;
}

.result-dialog {
  background:
    rgba(8, 5, 4, 0.84);
  backdrop-filter: blur(2px);
}

.result-panel {
  border-radius: 8px;
}

.result-summary div {
  border: 2px solid var(--ink);
  border-radius: 7px;
  background:
    linear-gradient(180deg, #fff6cb, var(--paper) 68%, #e3bd68);
}

.announcer {
  color: #fff1a3;
  text-shadow: 3px 3px 0 var(--red), 7px 7px 0 #0b0706;
}

@media (max-width: 1180px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

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

  .control-panel {
    position: static;
    grid-template-columns: minmax(150px, 0.65fr) minmax(260px, 1.35fr);
    align-items: end;
  }

  .panel-title {
    grid-column: 1 / -1;
  }

  .button-stack {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
  }
}

@media (max-width: 940px) {
  .menu-tabs {
    grid-template-columns: repeat(5, minmax(74px, 1fr));
    overflow-x: auto;
  }

  #menuPlayPanel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .keyboard-shell {
    overflow-x: auto;
  }

  .keyboard {
    min-width: 760px;
  }

  .keyboard-row:nth-child(3),
  .keyboard-row:nth-child(4),
  .keyboard-row:nth-child(5) {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .menu-screen {
    padding: 8px;
  }

  .menu-cabinet {
    min-height: calc(100vh - 16px);
  }

  .logo-hero {
    min-height: clamp(210px, 62vw, 310px);
  }

  .menu-tabs {
    grid-template-columns: repeat(5, minmax(82px, 1fr));
    padding-inline: 8px;
  }

  #menuPlayPanel {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 104px;
  }

  .app-frame {
    width: calc(100% - 12px);
    margin: 6px auto;
  }

  .masthead {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    min-width: 0;
    justify-content: stretch;
  }

  .header-actions .mini-button {
    flex: 1;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .button-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .keyboard {
    min-width: 700px;
  }
}

/* Logo + big-button main menu */
body.menu-open {
  background:
    linear-gradient(180deg, rgba(5, 4, 3, 0.08), rgba(5, 4, 3, 0.46) 72%, rgba(5, 4, 3, 0.74)),
    url("assets/menu-office-background.png") center top / cover no-repeat fixed,
    #140d0b;
}

body.menu-open::before {
  content: none;
  display: none;
  background: none;
  opacity: 0;
}

.menu-screen {
  display: block;
  padding: 0 clamp(12px, 2vw, 24px);
}

.menu-cabinet {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0;
  gap: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.menu-cabinet::before,
.menu-topbar,
.menu-tabs {
  display: none !important;
}

.logo-hero {
  position: relative;
  min-height: clamp(300px, 45vh, 430px);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: visible;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.menu-logo-file {
  position: relative;
  z-index: 4;
  width: min(980px, 86vw);
  max-height: min(330px, 38vh);
  object-fit: contain;
  filter: none;
}

.menu-title-art {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 4px;
  margin: 0;
  color: #ffe27a;
  text-align: center;
  font-family: "Trebuchet MS", "Arial Black", Impact, Tahoma, sans-serif;
  line-height: 0.82;
  text-transform: uppercase;
  letter-spacing: 0;
  transform: rotate(-1deg);
  text-shadow:
    0 4px 0 #0a0504,
    5px 7px 0 #b93322,
    10px 12px 0 rgba(0, 0, 0, 0.62),
    0 0 28px rgba(255, 133, 33, 0.46);
  filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.48));
}

.menu-title-art span {
  font-size: clamp(2.1rem, 5.4vw, 5.8rem);
}

.menu-title-art strong {
  color: #fff1a3;
  font-size: clamp(2.8rem, 7.2vw, 7.8rem);
  font-weight: 950;
  -webkit-text-stroke: 3px #100805;
  text-shadow:
    0 4px 0 #0a0504,
    6px 8px 0 #f47b20,
    11px 13px 0 rgba(0, 0, 0, 0.66),
    0 0 24px rgba(56, 184, 201, 0.42);
}

.ambient-ant {
  position: absolute;
  z-index: 3;
  width: 26px;
  height: 13px;
  background: url("assets/ant-sprite.png") center / contain no-repeat;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.62));
  opacity: 0;
  pointer-events: none;
  transform-origin: 50% 50%;
}

.desk-ant-one {
  left: 12%;
  top: 18%;
  animation: desk-ant-peek-one 9s ease-in-out infinite 800ms;
}

.desk-ant-two {
  right: 17%;
  top: 26%;
  animation: desk-ant-peek-two 11s ease-in-out infinite 2.4s;
}

.desk-ant-three {
  left: 28%;
  bottom: 19%;
  animation: desk-ant-peek-three 10.5s ease-in-out infinite 4.2s;
}

.desk-ant-four {
  right: 8%;
  bottom: 12%;
  animation: desk-ant-peek-four 12s ease-in-out infinite 6s;
}

@keyframes desk-ant-peek-one {
  0%,
  12%,
  100% {
    opacity: 0;
    transform: translate(-34px, -4px) rotate(8deg) scale(0.86);
  }
  22%,
  66% {
    opacity: 0.92;
  }
  46% {
    transform: translate(58px, 22px) rotate(14deg) scale(1);
  }
  76% {
    opacity: 0;
    transform: translate(116px, 8px) rotate(-8deg) scale(0.9);
  }
}

@keyframes desk-ant-peek-two {
  0%,
  15%,
  100% {
    opacity: 0;
    transform: translate(34px, -18px) rotate(188deg) scale(0.84);
  }
  28%,
  64% {
    opacity: 0.88;
  }
  48% {
    transform: translate(-42px, 28px) rotate(166deg) scale(1);
  }
  76% {
    opacity: 0;
    transform: translate(-92px, 12px) rotate(202deg) scale(0.88);
  }
}

@keyframes desk-ant-peek-three {
  0%,
  18%,
  100% {
    opacity: 0;
    transform: translate(-28px, 38px) rotate(-34deg) scale(0.82);
  }
  30%,
  60% {
    opacity: 0.86;
  }
  46% {
    transform: translate(24px, -14px) rotate(-10deg) scale(0.98);
  }
  73% {
    opacity: 0;
    transform: translate(66px, -34px) rotate(18deg) scale(0.86);
  }
}

@keyframes desk-ant-peek-four {
  0%,
  16%,
  100% {
    opacity: 0;
    transform: translate(24px, 28px) rotate(150deg) scale(0.82);
  }
  30%,
  62% {
    opacity: 0.82;
  }
  47% {
    transform: translate(-54px, -16px) rotate(184deg) scale(0.96);
  }
  76% {
    opacity: 0;
    transform: translate(-112px, 22px) rotate(146deg) scale(0.84);
  }
}

.logo-side-scene {
  position: absolute;
  top: clamp(30px, 5vh, 58px);
  bottom: clamp(48px, 8vh, 86px);
  z-index: 3;
  width: min(28vw, 340px);
  pointer-events: none;
  opacity: 0.96;
}

.logo-side-left {
  left: clamp(12px, 4vw, 62px);
}

.logo-side-right {
  right: clamp(12px, 4vw, 62px);
}

.office-prop {
  display: none;
}

.office-monitor {
  left: 14%;
  top: 16%;
  width: 58%;
  height: 42%;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(56, 184, 201, 0.22), rgba(56, 184, 201, 0.04)),
    #17100e;
}

.office-monitor::before {
  content: "";
  position: absolute;
  left: 34%;
  right: 34%;
  bottom: -23%;
  height: 20%;
  background: #2b1a14;
  border: 3px solid #090504;
  border-top: 0;
}

.office-monitor::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -34%;
  height: 10%;
  background: #3c2318;
  border: 3px solid #090504;
  border-radius: 999px;
}

.office-monitor span {
  position: absolute;
  left: 14%;
  height: 7%;
  border-radius: 999px;
  background: rgba(255, 212, 59, 0.58);
}

.office-monitor span:nth-child(1) {
  top: 24%;
  width: 48%;
}

.office-monitor span:nth-child(2) {
  top: 42%;
  width: 68%;
  background: rgba(56, 184, 201, 0.62);
}

.office-monitor span:nth-child(3) {
  top: 60%;
  width: 36%;
  background: rgba(97, 181, 69, 0.6);
}

.office-keypad {
  left: 5%;
  bottom: 18%;
  width: 60%;
  height: 16%;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 232, 166, 0.58) 0 8px, transparent 8px 15px),
    linear-gradient(180deg, #3d2d23, #1c120e);
  transform: rotate(-5deg);
}

.office-sticky {
  right: 12%;
  bottom: 27%;
  width: 26%;
  height: 23%;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #fff2a3, #f4a92e);
  transform: rotate(9deg);
}

.office-sticky::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 24%;
  height: 8%;
  background: rgba(17, 11, 9, 0.38);
  box-shadow: 0 13px 0 rgba(17, 11, 9, 0.28);
}

.office-mug {
  right: 16%;
  top: 18%;
  width: 36%;
  height: 42%;
  border-radius: 10px 10px 18px 18px;
  background:
    linear-gradient(180deg, #fff0bf, #df8b25 62%, #6b2f1c);
}

.office-mug::before {
  content: "";
  position: absolute;
  right: -26%;
  top: 28%;
  width: 34%;
  height: 34%;
  border: 6px solid #090504;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.office-mug span {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 13%;
  height: 10%;
  border-radius: 999px;
  background: rgba(17, 11, 9, 0.48);
}

.office-mouse {
  left: 18%;
  bottom: 18%;
  width: 48%;
  height: 28%;
  border-radius: 54% 54% 44% 44%;
  background:
    linear-gradient(90deg, transparent 48%, rgba(17, 11, 9, 0.72) 49% 51%, transparent 52%),
    linear-gradient(180deg, #d8d1bd, #73675d);
  transform: rotate(8deg);
}

.office-paperclip {
  right: 15%;
  bottom: 22%;
  width: 28%;
  height: 20%;
  border: 7px solid var(--cyan);
  border-left-width: 4px;
  border-radius: 999px;
  background: transparent;
  transform: rotate(-18deg);
}

.office-paperclip::after {
  content: "";
  position: absolute;
  inset: 8px 10px;
  border: 5px solid var(--cyan);
  border-left-width: 3px;
  border-radius: 999px;
}

.menu-ant {
  position: absolute;
  width: 34px;
  height: 17px;
  background: url("assets/ant-sprite.png") center / contain no-repeat;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.55));
  transform-origin: 50% 50%;
}

.ant-left-one {
  left: 8%;
  top: 9%;
  animation: crawl-left-monitor 4.8s linear infinite;
}

.ant-left-two {
  left: 2%;
  bottom: 20%;
  animation: crawl-left-keypad 5.6s linear infinite 700ms;
}

.ant-left-three {
  right: 8%;
  bottom: 32%;
  animation: crawl-left-note 3.9s linear infinite 1.2s;
}

.ant-right-one {
  right: 12%;
  top: 10%;
  animation: crawl-right-mug 4.6s linear infinite 320ms;
}

.ant-right-two {
  left: 13%;
  bottom: 13%;
  animation: crawl-right-mouse 5.4s linear infinite 900ms;
}

.ant-right-three {
  right: 7%;
  bottom: 28%;
  animation: crawl-right-clip 4.2s linear infinite 1.5s;
}

@keyframes crawl-left-monitor {
  0% {
    transform: translate(0, 0) rotate(8deg);
  }
  38% {
    transform: translate(78px, 28px) rotate(18deg);
  }
  72% {
    transform: translate(138px, 4px) rotate(-6deg);
  }
  100% {
    transform: translate(188px, 52px) rotate(16deg);
  }
}

@keyframes crawl-left-keypad {
  0% {
    transform: translate(0, 0) rotate(-7deg);
  }
  42% {
    transform: translate(88px, -26px) rotate(-18deg);
  }
  76% {
    transform: translate(150px, 8px) rotate(10deg);
  }
  100% {
    transform: translate(210px, -18px) rotate(-4deg);
  }
}

@keyframes crawl-left-note {
  0% {
    transform: translate(0, 0) rotate(82deg);
  }
  52% {
    transform: translate(-46px, -46px) rotate(104deg);
  }
  100% {
    transform: translate(-88px, 20px) rotate(132deg);
  }
}

@keyframes crawl-right-mug {
  0% {
    transform: translate(0, 0) rotate(188deg);
  }
  45% {
    transform: translate(-56px, 42px) rotate(168deg);
  }
  100% {
    transform: translate(-124px, 16px) rotate(196deg);
  }
}

@keyframes crawl-right-mouse {
  0% {
    transform: translate(0, 0) rotate(-12deg);
  }
  50% {
    transform: translate(86px, -38px) rotate(20deg);
  }
  100% {
    transform: translate(176px, -12px) rotate(-8deg);
  }
}

@keyframes crawl-right-clip {
  0% {
    transform: translate(0, 0) rotate(160deg);
  }
  48% {
    transform: translate(-68px, -22px) rotate(192deg);
  }
  100% {
    transform: translate(-132px, 34px) rotate(150deg);
  }
}

.low-motion .menu-ant,
.low-motion .ambient-ant {
  animation-duration: 1ms !important;
}

.menu-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 0 28px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#menuPlayPanel {
  width: min(940px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: clamp(84px, 10.5vw, 116px);
  align-content: start;
  gap: 12px;
  margin-top: clamp(-8px, -1vh, 0px);
}

.mode-card {
  position: relative;
  height: 100%;
  min-height: clamp(84px, 10.5vw, 116px);
  overflow: hidden;
  padding: 15px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.38),
    inset 0 -8px 0 rgba(0, 0, 0, 0.22),
    6px 6px 0 #070403;
  transition:
    transform 150ms ease,
    filter 150ms ease,
    box-shadow 150ms ease;
}

.mode-card::before {
  left: 18px;
  top: 18px;
  width: 58px;
  height: 12px;
  transform: none;
  background: rgba(17, 11, 9, 0.45);
  border: 2px solid rgba(255, 242, 180, 0.5);
  border-radius: 999px;
}

.mode-card::after {
  inset: 0;
  height: auto;
  transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  transition: transform 320ms ease;
}

.mode-card:hover {
  transform: translateY(-6px) scale(1.015);
  filter: saturate(1.12) brightness(1.04);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -8px 0 rgba(0, 0, 0, 0.2),
    9px 10px 0 #070403;
}

.mode-card:hover::after {
  transform: translateX(120%) skewX(-18deg);
}

.mode-card strong {
  align-self: end;
  max-width: 10ch;
  font-size: clamp(0.95rem, 1.9vw, 1.5rem);
}

.scores-card {
  background:
    linear-gradient(145deg, #a889ff 0%, var(--purple) 54%, #432167 100%);
}

.scores-card strong {
  color: #fff4c6;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.26);
}

.settings-card {
  background:
    linear-gradient(145deg, #ffbb6d 0%, #b86f3a 56%, #5d291c 100%);
}

.settings-card strong {
  color: #120b09;
}

.panel-back-button {
  justify-self: start;
  min-width: 150px;
  margin-bottom: 12px;
}

.menu-panel.active:not(#menuPlayPanel) {
  display: grid;
  gap: 12px;
  padding: 16px 0 34px;
}

@keyframes big-button-idle {
  0%,
  100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.08) brightness(1.03);
  }
}

@media (prefers-reduced-motion: no-preference) {
  #menuPlayPanel .mode-card {
    animation: big-button-idle 2400ms ease-in-out infinite;
  }

  #menuPlayPanel .mode-card:nth-child(2) {
    animation-delay: 120ms;
  }

  #menuPlayPanel .mode-card:nth-child(3) {
    animation-delay: 240ms;
  }

  #menuPlayPanel .mode-card:nth-child(4) {
    animation-delay: 360ms;
  }

  #menuPlayPanel .mode-card:nth-child(5) {
    animation-delay: 480ms;
  }

  #menuPlayPanel .mode-card:nth-child(6) {
    animation-delay: 600ms;
  }
}

.low-motion #menuPlayPanel .mode-card {
  animation: none;
}

@media (max-width: 900px) {
  .logo-hero {
    min-height: clamp(260px, 48vh, 390px);
  }

  .logo-side-scene {
    opacity: 0.55;
    transform: scale(0.82);
    transform-origin: top center;
  }

  #menuPlayPanel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .logo-side-scene {
    display: none;
  }
}

@media (max-width: 560px) {
  .logo-hero {
    min-height: 240px;
  }

  .menu-logo-file {
    width: min(94vw, 620px);
    max-height: 210px;
  }

  #menuPlayPanel {
    grid-template-columns: 1fr;
    margin-top: -18px;
  }

  .mode-card {
    min-height: 96px;
  }
}

/* Progression list + arcade controls */
#menuCampaignPanel {
  width: min(980px, 100%);
}

.level-grid {
  width: 100%;
  max-height: min(68vh, 680px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 4px 10px 12px 0;
  overflow-y: auto;
}

.level-card {
  position: relative;
  min-height: clamp(96px, 10vw, 124px);
  display: grid;
  grid-template-columns: minmax(96px, 130px) minmax(0, 1fr) minmax(84px, 112px);
  grid-template-areas:
    "num title status"
    "num meta status";
  gap: 4px 14px;
  align-items: center;
  overflow: hidden;
  padding: 15px 18px;
  color: var(--ink, #110b09);
  text-align: left;
  border: 3px solid var(--ink, #110b09);
  border-radius: 8px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -9px 0 rgba(0, 0, 0, 0.2),
    6px 6px 0 #070403;
  transition:
    transform 150ms ease,
    filter 150ms ease,
    box-shadow 150ms ease;
}

.level-card::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 16px;
  width: 58px;
  height: 12px;
  background: rgba(17, 11, 9, 0.38);
  border: 2px solid rgba(255, 242, 180, 0.48);
  border-radius: 999px;
}

.level-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-125%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: transform 320ms ease;
}

.level-card:hover:not(:disabled) {
  transform: translateY(-5px) scale(1.01);
  filter: saturate(1.12) brightness(1.04);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.48),
    inset 0 -9px 0 rgba(0, 0, 0, 0.18),
    9px 10px 0 #070403;
}

.level-card:hover:not(:disabled)::after {
  transform: translateX(125%) skewX(-18deg);
}

.level-card .level-number {
  grid-area: num;
  align-self: end;
  color: rgba(17, 11, 9, 0.86);
  font-family: "Arial Black", Impact, Tahoma, sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.level-card strong {
  grid-area: title;
  position: relative;
  z-index: 1;
  color: #120b09;
  font-size: clamp(1.1rem, 2.2vw, 1.8rem);
  line-height: 0.95;
  text-shadow: 0 2px 0 rgba(255, 245, 184, 0.25);
}

.level-card small {
  grid-area: meta;
  position: relative;
  z-index: 1;
  color: rgba(18, 11, 9, 0.78);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.level-card em {
  grid-area: status;
  position: relative;
  z-index: 1;
  justify-self: end;
  min-width: 78px;
  padding: 8px 10px;
  color: #fff3b0;
  background: rgba(17, 11, 9, 0.72);
  border: 2px solid rgba(255, 243, 176, 0.55);
  border-radius: 999px;
  font-family: "Arial Black", Impact, Tahoma, sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  text-align: center;
  text-transform: uppercase;
}

.level-card.current {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.level-card.cleared em {
  color: #0f210a;
  background: #8fea4e;
  border-color: #0f210a;
}

.level-card.locked {
  color: #f5dfb1;
  background:
    linear-gradient(145deg, #746152 0%, #3d2d25 60%, #1d1512 100%);
  cursor: not-allowed;
  filter: saturate(0.58) brightness(0.84);
}

.level-card.locked strong,
.level-card.locked small,
.level-card.locked .level-number {
  color: rgba(255, 232, 166, 0.68);
}

.level-card.locked em {
  color: #ffe8a6;
  background: rgba(15, 9, 7, 0.76);
}

.level-tone-1 {
  background: linear-gradient(145deg, #ffe66a 0%, #ff9f1f 50%, #f05a24 100%);
}

.level-tone-2 {
  background: linear-gradient(145deg, #fff59b 0%, #ffd43b 48%, #f08a24 100%);
}

.level-tone-3 {
  background: linear-gradient(145deg, #60edf3 0%, #38b8c9 54%, #157099 100%);
}

.level-tone-4 {
  background: linear-gradient(145deg, #9ff36a 0%, #61b545 54%, #247b35 100%);
}

.level-tone-5 {
  background: linear-gradient(145deg, #c89cff 0%, #7b4ab5 54%, #432167 100%);
}

.level-tone-6 {
  background: linear-gradient(145deg, #ffbe75 0%, #f47b20 54%, #8f321d 100%);
}

.command-button,
.mini-button,
.file-button,
.mode-button,
.leaderboard-tabs .menu-tab {
  min-height: 48px;
  padding: 12px 16px;
  color: #120b09;
  background:
    linear-gradient(145deg, #66eef3 0%, #38b8c9 52%, #19748e 100%);
  border: 3px solid var(--ink, #110b09);
  border-radius: 8px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -7px 0 rgba(0, 0, 0, 0.2),
    5px 5px 0 #070403;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
  transition:
    transform 150ms ease,
    filter 150ms ease,
    box-shadow 150ms ease;
}

.command-button:hover,
.mini-button:hover,
.file-button:hover,
.mode-button:hover,
.leaderboard-tabs .menu-tab:hover {
  transform: translateY(-4px) scale(1.015);
  filter: saturate(1.12) brightness(1.04);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.48),
    inset 0 -7px 0 rgba(0, 0, 0, 0.18),
    8px 8px 0 #070403;
}

.command-button.primary,
.mode-button.active,
.leaderboard-tabs .menu-tab.active {
  background:
    linear-gradient(145deg, #fff59b 0%, #ffd43b 48%, #f08a24 100%);
}

.panel-back-button,
#stopButton,
#resultMenuButton,
#closeResultButton,
#clearScoresButton {
  background:
    linear-gradient(145deg, #ffbe75 0%, #f47b20 54%, #8f321d 100%);
}

#replayButton,
#againButton,
#levelSelectButton,
#resultNextButton,
#nextLevelButton {
  background:
    linear-gradient(145deg, #9ff36a 0%, #61b545 54%, #247b35 100%);
}

#runButton,
#playEditorButton,
#endlessStartButton {
  background:
    linear-gradient(145deg, #fff59b 0%, #ffd43b 48%, #f08a24 100%);
}

.button-stack .command-button {
  min-height: 64px;
  font-size: clamp(1rem, 1.4vw, 1.28rem);
}

.mini-button {
  min-height: 44px;
  padding-inline: 14px;
}

.command-button:disabled,
.mini-button:disabled,
.file-button:disabled,
.mode-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5) brightness(0.75);
}

@media (max-width: 640px) {
  .level-card {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "num status"
      "title title"
      "meta meta";
    min-height: 118px;
  }

  .level-card em {
    align-self: start;
  }
}

/* Mobile-game style campaign list */
body.menu-open[data-menu-panel="campaign"] .menu-screen {
  place-items: start center;
  padding: clamp(10px, 2vw, 18px);
}

body.menu-open[data-menu-panel="campaign"] .menu-cabinet {
  gap: 8px;
}

body.menu-open[data-menu-panel="campaign"] .logo-hero {
  min-height: clamp(118px, 20vh, 190px);
}

body.menu-open[data-menu-panel="campaign"] .menu-logo-file {
  width: min(620px, 70vw);
  max-height: min(150px, 18vh);
}

#menuCampaignPanel {
  width: min(820px, 100%);
  justify-self: center;
  gap: 10px;
  padding: 0 0 18px;
}

#menuCampaignPanel .panel-back-button {
  margin-left: 4px;
}

#menuCampaignPanel .level-grid {
  width: min(780px, 100%);
  max-height: max(300px, min(53vh, calc(100vh - 340px), 540px));
  justify-self: center;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 auto;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background:
    linear-gradient(180deg, rgba(255, 232, 166, 0.14), rgba(0, 0, 0, 0.16)),
    rgba(20, 12, 9, 0.72);
  border: 3px solid var(--ink, #110b09);
  border-radius: 8px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    6px 6px 0 #070403;
}

.level-difficulty-group {
  display: grid;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 232, 166, 0.08);
  border: 2px solid rgba(255, 232, 166, 0.22);
  border-radius: 8px;
}

.difficulty-heading {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title cleared"
    "title unlocked";
  gap: 2px 12px;
  align-items: center;
  padding: 10px 12px;
  color: #120b09;
  background:
    linear-gradient(145deg, #fff59b 0%, #ffd43b 48%, #f08a24 100%);
  border: 3px solid var(--ink, #110b09);
  border-radius: 8px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -6px 0 rgba(0, 0, 0, 0.16),
    4px 4px 0 #070403;
}

.difficulty-heading span {
  grid-area: title;
  font-family: "Arial Black", Impact, Tahoma, sans-serif;
  font-size: clamp(1.15rem, 3.2vw, 1.85rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.difficulty-heading strong,
.difficulty-heading small {
  justify-self: end;
  font-weight: 900;
  text-transform: uppercase;
}

.difficulty-heading strong {
  grid-area: cleared;
  font-size: 0.82rem;
}

.difficulty-heading small {
  grid-area: unlocked;
  color: rgba(18, 11, 9, 0.72);
  font-size: 0.68rem;
}

.difficulty-level-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

#menuCampaignPanel .level-card {
  width: 100%;
  min-height: 82px;
  grid-template-columns: minmax(66px, 88px) minmax(0, 1fr) minmax(70px, 92px);
  gap: 3px 10px;
  padding: 12px;
  border-radius: 8px;
}

#menuCampaignPanel .level-card::before {
  left: 12px;
  top: 12px;
  width: 42px;
  height: 9px;
}

#menuCampaignPanel .level-card .level-number {
  font-size: clamp(0.86rem, 2.5vw, 1.12rem);
}

#menuCampaignPanel .level-card strong {
  font-size: clamp(0.96rem, 2.7vw, 1.35rem);
}

#menuCampaignPanel .level-card small {
  font-size: 0.66rem;
}

#menuCampaignPanel .level-card em {
  min-width: 62px;
  padding: 7px 8px;
  font-size: 0.62rem;
}

@media (max-width: 720px) {
  body.menu-open[data-menu-panel="campaign"] .logo-hero {
    min-height: 112px;
  }

  body.menu-open[data-menu-panel="campaign"] .menu-logo-file {
    width: min(88vw, 520px);
    max-height: 126px;
  }

  #menuCampaignPanel .level-grid {
    max-height: max(290px, min(58vh, calc(100vh - 290px), 600px));
    padding: 10px;
  }

  .difficulty-heading {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "cleared"
      "unlocked";
    justify-items: start;
  }

  .difficulty-heading strong,
  .difficulty-heading small {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  body.menu-open[data-menu-panel="campaign"] .menu-screen {
    padding: 8px;
  }

  #menuCampaignPanel .level-grid {
    width: 100%;
    max-height: max(280px, min(62vh, calc(100vh - 250px)));
    padding: 8px;
  }

  .level-difficulty-group {
    padding: 6px;
  }

  #menuCampaignPanel .level-card {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "num status"
      "title title"
      "meta meta";
    min-height: 104px;
  }
}

/* Coming soon menu cards */
.coming-soon-card {
  isolation: isolate;
  cursor: help;
}

.coming-soon-card strong {
  max-width: 9ch;
}

.coming-soon-card .coming-soon-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 5px 8px;
  color: #ffe8a6;
  background: rgba(17, 11, 9, 0.78);
  border: 2px solid rgba(255, 232, 166, 0.62);
  border-radius: 999px;
  font-family: "Arial Black", Impact, Tahoma, sans-serif;
  font-size: clamp(0.56rem, 1vw, 0.72rem);
  line-height: 1;
  text-transform: uppercase;
}

.coming-soon-card::before {
  z-index: 5;
  left: 50%;
  top: 50%;
  width: 132%;
  height: 30px;
  transform: translate(-50%, -50%) rotate(-11deg);
  background:
    repeating-linear-gradient(135deg, #17100d 0 12px, #17100d 12px 22px, #ffd43b 22px 34px, #ffd43b 34px 46px);
  border: 3px solid #17100d;
  border-radius: 0;
  box-shadow:
    0 3px 0 rgba(255, 255, 255, 0.22) inset,
    0 5px 0 rgba(0, 0, 0, 0.38);
  opacity: 0.96;
}

.coming-soon-card::after {
  content: "COMING SOON";
  z-index: 6;
  inset: auto;
  left: 50%;
  top: 50%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%) rotate(-11deg);
  color: #17100d;
  background: transparent;
  font-family: "Arial Black", Impact, Tahoma, sans-serif;
  font-size: clamp(0.72rem, 1.5vw, 1rem);
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(255, 232, 166, 0.5);
  white-space: nowrap;
  transition: none;
}

.coming-soon-card:hover::after {
  transform: translate(-50%, -50%) rotate(-11deg);
}
