:root {
  color-scheme: dark;
  --bg: #070912;
  --panel: #111725;
  --panel-2: #151827;
  --line: #31415c;
  --line-soft: rgba(255, 255, 255, 0.11);
  --text: #edf4ff;
  --muted: #96a6bd;
  --cyan: #25d9ff;
  --gold: #ffd24a;
  --pink: #ff4fb6;
  --green: #57f287;
  --red: #ff6b5f;
  --violet: #9c88ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

:root[data-theme="arcade"] {
  --cyan: #36f3ff;
  --gold: #ffcf33;
  --pink: #ff3b8f;
  --green: #72ff6a;
}

:root[data-theme="minimal"] {
  --bg: #07090d;
  --panel: #11151d;
  --panel-2: #0d1118;
  --cyan: #9ecfff;
  --gold: #f2d16b;
  --pink: #f08bad;
  --green: #9be6a8;
}

:root[data-theme="contrast"],
.accessibility-mode {
  --bg: #000000;
  --panel: #050505;
  --panel-2: #0a0a0a;
  --line: #ffffff;
  --text: #ffffff;
  --muted: #dedede;
  --cyan: #00ffff;
  --gold: #ffff00;
  --pink: #ff66ff;
  --green: #00ff66;
  --red: #ff4444;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(37, 217, 255, 0.1), transparent 38%),
    radial-gradient(circle at 18% 74%, rgba(255, 79, 182, 0.08), transparent 30%),
    linear-gradient(180deg, #080912 0%, #0d0b17 44%, #06070c 100%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.game-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(238px, 24vw, 300px);
  grid-template-rows: auto minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100svh;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(37, 217, 255, 0.045), transparent 38%),
    linear-gradient(315deg, rgba(255, 79, 182, 0.04), transparent 42%);
}

.hud {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(148px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px clamp(10px, 2.6vw, 26px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 10, 18, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.18);
}

.brand,
.stats,
.actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand {
  gap: 10px;
  color: var(--text);
  font-size: clamp(0.88rem, 1.5vw, 1rem);
  font-weight: 850;
  text-shadow: 0 0 14px rgba(37, 217, 255, 0.2);
  white-space: nowrap;
}

.brand strong {
  color: var(--gold);
  font-size: 0.78em;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, #ffe66d, #ff9e44 54%, #ff4fb6);
  border-radius: 2px;
  box-shadow: 0 0 18px rgba(255, 210, 74, 0.46);
}

.stats {
  justify-content: end;
  gap: 7px;
  color: var(--muted);
  font-size: clamp(0.68rem, 1.3vw, 0.9rem);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.stats span,
.option-stats span,
.speed-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  max-width: 100%;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(17, 21, 32, 0.78);
  box-shadow: inset 0 0 16px rgba(37, 217, 255, 0.035);
  white-space: nowrap;
}

#score,
#best-score,
#level-record {
  color: var(--gold);
}

#level-record {
  color: var(--cyan);
}

.lives {
  color: var(--red);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(255, 107, 95, 0.68);
}

.stats span.unlocked,
.option-stats span.unlocked {
  color: #05120a;
  border-color: rgba(87, 242, 135, 0.65);
  background: var(--green);
}

.speed-control {
  gap: 7px;
}

.speed-control strong {
  color: var(--gold);
  font-weight: 850;
}

.speed-control input {
  width: 74px;
  accent-color: var(--gold);
  cursor: pointer;
}

.actions {
  justify-content: end;
  gap: 8px;
}

.options-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: clamp(10px, 2.6vw, 26px);
  z-index: 8;
  display: none;
  gap: 10px;
  width: min(330px, calc(100vw - 20px));
  padding: 12px;
  border: 1px solid rgba(37, 217, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 10, 18, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.44), inset 0 0 22px rgba(37, 217, 255, 0.04);
  backdrop-filter: blur(18px);
}

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

.options-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.options-head strong {
  color: var(--gold);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.option-stats,
.option-actions {
  display: grid;
  gap: 8px;
}

.option-stats {
  grid-template-columns: 1fr;
}

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

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

.option-grid label,
.option-toggles label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}

.option-grid select,
.option-grid input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #070b12;
  color: var(--text);
  padding: 0 8px;
}

.option-toggles {
  display: grid;
  gap: 7px;
}

.option-toggles label {
  grid-template-columns: 20px 1fr;
  align-items: center;
}

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

.tab-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(17, 21, 32, 0.86);
  color: var(--muted);
  cursor: pointer;
}

.tab-button.active {
  border-color: rgba(255, 210, 74, 0.68);
  color: #06130a;
  background: var(--gold);
}

.option-actions .icon-button {
  width: 100%;
}

.option-scoreboards {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}

.compact-score-box {
  min-height: 0;
}

.compact-score-box .score-list {
  max-height: 210px;
  overflow: auto;
}

#options-toggle {
  display: none;
}

.icon-button,
.primary,
.touch-pad button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(17, 21, 32, 0.96);
  cursor: pointer;
}

.icon-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  font-weight: 850;
}

.icon-button.is-muted {
  color: var(--muted);
  border-color: rgba(255, 107, 95, 0.45);
}

.icon-button:hover,
.primary:hover,
.touch-pad button:hover {
  border-color: rgba(37, 217, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(37, 217, 255, 0.12);
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  touch-action: none;
}

.touch-pad {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: clamp(12px, 3vw, 26px);
  transform: translateX(-50%);
  z-index: 7;
  display: none;
  grid-template-areas: "left up down right";
  grid-template-columns: repeat(4, 52px);
  grid-template-rows: 52px;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 210, 74, 0.24);
  border-radius: 8px;
  background: rgba(5, 7, 13, 0.46);
  opacity: 0.9;
  user-select: none;
  backdrop-filter: blur(10px);
}

.touch-pad button {
  width: 52px;
  height: 52px;
  color: #061018;
  border-color: rgba(255, 210, 74, 0.58);
  background: rgba(255, 210, 74, 0.9);
  font-size: 1.05rem;
  font-weight: 950;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.34);
}

.touch-pad button:active {
  transform: translateY(1px) scale(0.98);
  background: #ffe66d;
}

.touch-pad button[data-dir="up"] {
  grid-area: up;
}

.touch-pad button[data-dir="left"] {
  grid-area: left;
}

.touch-pad button[data-dir="down"] {
  grid-area: down;
}

.touch-pad button[data-dir="right"] {
  grid-area: right;
}

.arcade-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 14px;
  border-left: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(23, 20, 36, 0.94), rgba(7, 10, 16, 0.94)),
    var(--panel-2);
  overflow: auto;
}

.score-box {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(17, 21, 32, 0.76);
  box-shadow: inset 0 0 22px rgba(37, 217, 255, 0.04);
}

.score-box h2 {
  margin: 0;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 210, 74, 0.24);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.score-list,
#top-scores,
#level-records {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

.score-list li,
#top-scores li,
#level-records li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(5, 7, 13, 0.5);
  color: var(--muted);
  font-size: 0.8rem;
}

.score-list strong,
#top-scores strong,
#level-records strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-list b,
#top-scores b,
#level-records b {
  color: var(--gold);
  font-weight: 850;
}

[data-level-records] li,
#level-records li {
  grid-template-columns: 32px 1fr auto;
}

[data-level-records] b,
#level-records b {
  color: var(--cyan);
}

.mobile-objective {
  display: none;
}

.arcade-modal {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 13, 0.82);
  backdrop-filter: blur(8px);
}

.arcade-modal[hidden] {
  display: none;
}

.modal-panel {
  display: grid;
  gap: 14px;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100svh - 28px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(37, 217, 255, 0.28);
  border-radius: 8px;
  background: rgba(13, 17, 26, 0.96);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.48);
}

.wide-panel {
  width: min(980px, calc(100vw - 24px));
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h1 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.6rem);
}

.version-label {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.mode-grid,
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
}

.mode-card {
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 21, 32, 0.86);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.mode-card.selected {
  border-color: rgba(255, 210, 74, 0.86);
  background:
    linear-gradient(135deg, rgba(255, 210, 74, 0.18), transparent 54%),
    rgba(17, 21, 32, 0.96);
  box-shadow: 0 0 0 3px rgba(255, 210, 74, 0.12), inset 0 0 22px rgba(255, 210, 74, 0.05);
}

.mode-card strong {
  color: var(--gold);
}

.mode-card span,
.mini-list span {
  color: var(--muted);
  font-size: 0.8rem;
}

.mini-list {
  display: grid;
  gap: 6px;
}

.mode-summary {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(87, 242, 135, 0.36);
  border-radius: 8px;
  background: rgba(87, 242, 135, 0.08);
  color: var(--green);
  font-weight: 850;
}

.mini-list .done {
  color: var(--green);
}

.secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(17, 21, 32, 0.96);
}

.reduced-effects *,
.reduced-effects *::before,
.reduced-effects *::after {
  animation-duration: 1ms !important;
  transition-duration: 1ms !important;
}

.shape-box {
  color: var(--muted);
  font-size: 0.82rem;
}

.shape-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.shape {
  display: inline-block;
  width: 17px;
  height: 17px;
  background: var(--violet);
  box-shadow: 0 0 14px rgba(156, 136, 255, 0.56);
}

.shape.circle {
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(37, 217, 255, 0.56);
}

.shape.triangle {
  width: 0;
  height: 0;
  border-right: 9px solid transparent;
  border-bottom: 17px solid var(--pink);
  border-left: 9px solid transparent;
  background: transparent;
  box-shadow: none;
}

.shape.player-dot {
  background: var(--gold);
  box-shadow: 0 0 14px rgba(255, 210, 74, 0.6);
}

.shape.triangle.player-dot {
  border-bottom-color: var(--gold);
  background: transparent;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(5, 7, 13, 0.76);
  backdrop-filter: blur(4px);
}

.overlay[hidden] {
  display: none;
}

.level-transition {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(37, 217, 255, 0.16), transparent 34%),
    rgba(5, 7, 13, 0.5);
  animation: transition-fade 920ms ease both;
}

.level-transition[hidden] {
  display: none;
}

.level-transition div {
  display: grid;
  gap: 8px;
  text-align: center;
  text-transform: uppercase;
  filter: drop-shadow(0 0 22px rgba(37, 217, 255, 0.4));
}

.level-transition h1,
.level-transition p {
  margin: 0;
}

.level-transition h1 {
  color: var(--gold);
  font-size: clamp(2rem, 8vw, 5rem);
  line-height: 0.92;
}

.level-transition p {
  color: var(--cyan);
  font-weight: 850;
}

@keyframes transition-fade {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  18%,
  76% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.03);
  }
}

.result {
  display: grid;
  gap: 13px;
  width: min(390px, 100%);
  padding: 24px;
  border: 1px solid rgba(87, 242, 135, 0.48);
  border-radius: 8px;
  background: rgba(17, 21, 32, 0.97);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.46), 0 0 32px rgba(37, 217, 255, 0.12);
  text-align: center;
}

.result h1,
.result p {
  margin: 0;
}

.result h1 {
  font-size: clamp(1.38rem, 5vw, 2rem);
  line-height: 1.08;
}

.result p {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.score-entry {
  display: grid;
  gap: 8px;
  margin: 0;
}

.score-entry[hidden] {
  display: none;
}

.score-entry label {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 850;
}

.score-entry div {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
}

.score-entry input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #070b12;
  color: var(--text);
  text-align: center;
  text-transform: uppercase;
  font-weight: 950;
  letter-spacing: 0;
}

.primary {
  min-height: 42px;
  padding: 0 16px;
  color: #06130a;
  border-color: transparent;
  background: var(--green);
  font-weight: 850;
}

@media (max-width: 980px) and (hover: none), (pointer: coarse) {
  .game-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  #options-toggle {
    display: inline-grid;
  }

  .options-panel:not([hidden]) {
    display: grid;
  }

  .options-head {
    display: flex;
  }

  .option-scoreboards {
    display: grid;
  }

  .leaderboard-tabs {
    display: grid;
  }

  .desktop-action,
  .desktop-speed,
  .stats #best-score,
  .stats #level-record,
  .stats #exit-state {
    display: none;
  }

  .touch-pad {
    display: grid;
  }

  .arcade-panel {
    display: none;
  }

  .mobile-objective {
    position: fixed;
    left: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 7;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    max-width: min(210px, calc(100vw - 24px));
    padding: 0 10px;
    border: 1px solid rgba(255, 210, 74, 0.36);
    border-radius: 7px;
    background: rgba(7, 10, 18, 0.72);
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 850;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(10px);
    pointer-events: none;
  }

  .mobile-objective.unlocked {
    color: #06130a;
    border-color: rgba(87, 242, 135, 0.72);
    background: rgba(87, 242, 135, 0.9);
  }
}

@media (max-width: 720px) and (hover: none), (max-width: 720px) and (pointer: coarse) {
  body {
    background:
      radial-gradient(circle at 50% 22%, rgba(37, 217, 255, 0.09), transparent 42%),
      linear-gradient(180deg, #070912 0%, #06070c 100%);
  }

  .game-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hud {
    grid-template-columns: 1fr auto;
    gap: 6px;
    min-height: 54px;
    padding: 7px 9px;
  }

  .brand {
    gap: 8px;
    font-size: 0.78rem;
  }

  .brand > span:nth-child(2) {
    display: none;
  }

  .brand strong {
    font-size: 0.76rem;
  }

  .stats {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 5px;
  }

  .stats span {
    flex: 1 1 0;
    min-width: 0;
    min-height: 26px;
    padding: 0 5px;
    font-size: 0.64rem;
  }

  .stats #glyph-count {
    flex: 1.25 1 0;
  }

  .lives {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
  }

  .options-panel {
    position: fixed;
    inset: 0;
    top: 0;
    right: 0;
    left: 0;
    width: auto;
    max-height: none;
    height: 100vh;
    height: 100svh;
    align-content: start;
    padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    overflow: auto;
  }

  .option-scoreboards {
    grid-template-columns: 1fr;
  }

  .option-scoreboards [data-score-panel][hidden] {
    display: none;
  }

  .compact-score-box .score-list {
    max-height: 28svh;
  }

  .speed-control {
    justify-content: space-between;
    min-height: 42px;
    gap: 10px;
    padding: 0 10px;
  }

  .speed-control input {
    width: min(170px, 42vw);
  }

  .touch-pad {
    bottom: max(10px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(4, minmax(52px, 1fr));
    grid-template-rows: 54px;
    width: min(292px, calc(100vw - 22px));
    gap: 6px;
    padding: 6px;
  }

  .touch-pad button {
    width: 100%;
    height: 54px;
    font-size: 1.1rem;
  }

  .overlay {
    padding: 12px;
  }

  .result {
    width: min(430px, calc(100vw - 24px));
    gap: 12px;
    padding: 18px;
  }

  .result h1 {
    font-size: clamp(1.32rem, 8vw, 2rem);
  }

  .result p {
    font-size: 0.9rem;
  }

  .primary {
    min-height: 48px;
    font-size: 1rem;
  }

  .score-entry div {
    grid-template-columns: 1fr 82px;
  }

  .score-entry input {
    min-height: 48px;
  }

  .arcade-panel {
    display: none;
  }
}

@media (max-width: 440px) and (hover: none), (max-width: 440px) and (pointer: coarse) {
  .brand {
    font-size: 0.82rem;
  }

  .mark {
    width: 16px;
    height: 16px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .touch-pad {
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) and (hover: none), (max-width: 900px) and (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .hud {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 46px;
    padding: 5px 8px;
  }

  .brand > span:nth-child(2),
  .stats #glyph-count {
    display: none;
  }

  .stats {
    grid-column: auto;
    grid-row: auto;
    justify-content: end;
  }

  .stats span {
    flex: 0 1 auto;
    min-height: 28px;
    font-size: 0.66rem;
  }

  .touch-pad {
    width: min(280px, calc(100vw - 20px));
    grid-template-rows: 46px;
    bottom: 7px;
  }

  .touch-pad button {
    height: 46px;
  }

  .mobile-objective {
    display: none;
  }
}

.touch-input .game-shell {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.touch-input #options-toggle {
  display: inline-grid;
}

.touch-input .options-panel:not([hidden]) {
  display: grid;
}

.touch-input .options-head {
  display: flex;
}

.touch-input .option-scoreboards {
  display: grid;
}

.touch-input .leaderboard-tabs {
  display: grid;
}

.touch-input .desktop-action,
.touch-input .desktop-speed,
.touch-input .stats #best-score,
.touch-input .stats #level-record,
.touch-input .stats #exit-state,
.touch-input .arcade-panel {
  display: none;
}

.touch-input .touch-pad {
  position: fixed;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 7;
  display: grid;
}

.touch-input .mobile-objective {
  position: fixed;
  left: 10px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 7;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: min(210px, calc(100vw - 24px));
  padding: 0 10px;
  border: 1px solid rgba(255, 210, 74, 0.36);
  border-radius: 7px;
  background: rgba(7, 10, 18, 0.72);
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 850;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.touch-input .mobile-objective.unlocked {
  color: #06130a;
  border-color: rgba(87, 242, 135, 0.72);
  background: rgba(87, 242, 135, 0.9);
}

@media (max-width: 720px) {
  .touch-input .hud {
    grid-template-columns: 1fr auto;
    gap: 6px;
    min-height: 54px;
    padding: 7px 9px;
  }

  .touch-input .brand {
    gap: 8px;
    font-size: 0.78rem;
  }

  .touch-input .brand > span:nth-child(2) {
    display: none;
  }

  .touch-input .stats {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 5px;
  }

  .touch-input .stats span {
    flex: 1 1 0;
    min-width: 0;
    min-height: 26px;
    padding: 0 5px;
    font-size: 0.64rem;
  }

  .touch-input .options-panel {
    position: fixed;
    inset: 0;
    width: auto;
    max-height: none;
    height: 100vh;
    height: 100svh;
    align-content: start;
    padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    overflow: auto;
  }

  .touch-input .option-scoreboards {
    grid-template-columns: 1fr;
  }

  .touch-input .option-scoreboards [data-score-panel][hidden] {
    display: none;
  }

  .touch-input .compact-score-box .score-list {
    max-height: 28svh;
  }

  .touch-input .touch-pad {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
    grid-template-rows: 54px;
    width: min(292px, calc(100vw - 22px));
    gap: 6px;
    padding: 6px;
  }

  .touch-input .touch-pad button {
    width: 100%;
    height: 54px;
    font-size: 1.1rem;
  }

  .touch-input .overlay {
    padding: 12px;
  }

  .touch-input .result {
    width: min(430px, calc(100vw - 24px));
    gap: 12px;
    padding: 18px;
  }

  .touch-input .primary,
  .touch-input .score-entry input {
    min-height: 48px;
  }
}
