:root {
  color-scheme: dark;
  --ink: #05050b;
  --night: #0a0b18;
  --panel: rgba(14, 14, 28, 0.9);
  --panel-solid: #11111f;
  --bone: #f0e8d4;
  --muted: #a7a1b2;
  --violet: #a943ff;
  --violet-bright: #d78bff;
  --cyan: #55e9ff;
  --crimson: #e6314c;
  --gold: #ffc35a;
  --green: #64e69c;
  --border: rgba(234, 222, 255, 0.16);
  --display: Georgia, "Times New Roman", serif;
  --ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tg-safe-top: 0px;
  --tg-safe-right: 0px;
  --tg-safe-bottom: 0px;
  --tg-safe-left: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--ui);
}

html[data-telegram="true"],
html[data-telegram="true"] body {
  height: var(--tg-viewport-height, 100%);
}

html[data-telegram="true"] .game-stage {
  padding:
    max(env(safe-area-inset-top), var(--tg-safe-top))
    max(env(safe-area-inset-right), var(--tg-safe-right))
    max(env(safe-area-inset-bottom), var(--tg-safe-bottom))
    max(env(safe-area-inset-left), var(--tg-safe-left));
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.game-shell,
.game-stage,
#gameCanvas {
  width: 100%;
  height: 100%;
}

.game-stage {
  position: relative;
  overflow: hidden;
  background: #070812;
  isolation: isolate;
}

#gameCanvas {
  display: block;
  outline: none;
  touch-action: none;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.18) 78%, rgba(0, 0, 0, 0.54) 112%),
    linear-gradient(180deg, rgba(2, 2, 8, 0.18), transparent 20%, transparent 80%, rgba(2, 2, 8, 0.36));
}

.damage-flash {
  position: absolute;
  inset: 0;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  box-shadow: inset 0 0 110px 26px rgba(228, 20, 55, 0.9);
  transition: opacity 160ms ease;
}

.damage-flash.active {
  opacity: 0.74;
}

.hud-top {
  position: absolute;
  z-index: 4;
  top: max(18px, env(safe-area-inset-top));
  left: 24px;
  right: 24px;
  display: grid;
  grid-template-columns: 190px 1fr 190px;
  align-items: start;
  gap: 18px;
  pointer-events: none;
}

.hud-brand {
  display: grid;
  gap: 1px;
  padding: 12px 15px;
  width: max-content;
  border: 1px solid var(--border);
  background: linear-gradient(115deg, rgba(9, 8, 18, 0.86), rgba(24, 12, 32, 0.58));
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 0 100%);
  backdrop-filter: blur(12px);
}

.hud-brand strong {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.11em;
}

.biome-name {
  display: block;
  margin-top: 0.26rem;
  color: rgba(205, 223, 255, 0.72);
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--violet-bright);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.21em;
  text-transform: uppercase;
}

.telegram-status {
  display: inline-flex;
  width: max-content;
  margin-top: 10px;
  padding: 5px 8px;
  border: 1px solid rgba(85, 233, 255, 0.34);
  border-radius: 999px;
  background: rgba(15, 69, 88, 0.28);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.telegram-status[data-status="error"] {
  border-color: rgba(255, 195, 90, 0.38);
  color: var(--gold);
}

.run-stats {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 104px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(8, 8, 16, 0.72);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.run-stat {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 9px 13px 8px;
}

.run-stat + .run-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: var(--border);
}

.run-stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.run-stat strong {
  font-family: var(--display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.run-stat--time strong {
  color: var(--gold);
}

.hud-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(8, 8, 17, 0.76);
  cursor: pointer;
  font-weight: 800;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
  backdrop-filter: blur(12px);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(215, 139, 255, 0.7);
  background: rgba(54, 20, 72, 0.8);
  transform: translateY(-1px);
  outline: none;
}

.weapon-panel {
  position: absolute;
  z-index: 4;
  top: 94px;
  left: 24px;
  width: 180px;
  padding: 12px;
  border-left: 2px solid rgba(169, 67, 255, 0.62);
  background: linear-gradient(90deg, rgba(8, 8, 16, 0.76), rgba(8, 8, 16, 0));
  pointer-events: none;
}

.weapon-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.weapon-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
}

.weapon-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(30, 20, 42, 0.82);
  color: var(--cyan);
  font-size: 18px;
}

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

.weapon-meta strong {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
}

.weapon-meta span,
.weapon-level {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weapon-level {
  color: var(--gold);
}

.vitals {
  position: absolute;
  z-index: 4;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, calc(100% - 40px));
  transform: translateX(-50%);
  pointer-events: none;
}

.level-medallion {
  display: grid;
  flex: 0 0 66px;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 2px solid rgba(255, 195, 90, 0.6);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(73, 32, 88, 0.96), rgba(10, 9, 18, 0.98) 72%);
  box-shadow: 0 0 24px rgba(169, 67, 255, 0.3), inset 0 0 0 4px rgba(0, 0, 0, 0.45);
}

.level-medallion span {
  align-self: end;
  color: var(--gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.level-medallion strong {
  align-self: start;
  margin-top: -2px;
  font-family: var(--display);
  font-size: 27px;
}

.vital-bars {
  display: grid;
  flex: 1;
  gap: 7px;
}

.bar-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 6px;
}

.bar-icon {
  color: #ff566b;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 53, 82, 0.8);
}

.bar-icon--xp {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(85, 233, 255, 0.8);
}

.bar-track {
  position: relative;
  height: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  transform: skewX(-8deg);
  background: rgba(5, 5, 11, 0.82);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.bar-track > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: skewX(8deg);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px #000;
}

.bar-fill {
  width: 100%;
  height: 100%;
  transition: width 150ms ease;
}

.bar-track--health .bar-fill {
  background: linear-gradient(90deg, #97172e, #ed3554);
  box-shadow: 0 0 14px rgba(230, 49, 76, 0.45);
}

.bar-track--xp {
  height: 15px;
}

.bar-track--xp .bar-fill {
  width: 0;
  background: linear-gradient(90deg, #1d7d9f, #58eaff);
  box-shadow: 0 0 14px rgba(85, 233, 255, 0.45);
}

.boss-bar {
  position: absolute;
  z-index: 4;
  top: 94px;
  left: 50%;
  width: min(500px, calc(100% - 40px));
  transform: translateX(-50%);
  pointer-events: none;
}

.boss-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #dfcfff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.17em;
}

.boss-track {
  height: 9px;
  padding: 2px;
  border: 1px solid rgba(215, 139, 255, 0.42);
  background: rgba(5, 5, 12, 0.8);
}

#bossHpBar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #7e18a3, #d765ff);
  box-shadow: 0 0 17px rgba(183, 70, 255, 0.65);
}

.toast {
  position: absolute;
  z-index: 8;
  top: 26%;
  left: 50%;
  padding: 10px 18px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 195, 90, 0.45);
  background: rgba(8, 8, 16, 0.88);
  color: var(--gold);
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.06em;
  pointer-events: none;
  animation: toast-in 1.8s ease both;
  backdrop-filter: blur(8px);
}

@keyframes toast-in {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  18%, 74% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(4, 4, 10, 0.74);
  backdrop-filter: blur(8px);
}

.overlay--start {
  justify-items: start;
  background:
    linear-gradient(90deg, rgba(4, 4, 10, 0.98) 0%, rgba(5, 5, 12, 0.9) 32%, rgba(5, 5, 12, 0.15) 72%),
    linear-gradient(0deg, rgba(3, 3, 8, 0.55), transparent 45%),
    url("/assets/nightfall-expansion-concept.png") center / cover no-repeat;
  backdrop-filter: none;
}

.start-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 3, 8, 0.14), rgba(3, 3, 8, 0.26));
}

.start-card {
  position: relative;
  z-index: 1;
  width: min(530px, 92vw);
  margin-left: clamp(8px, 6vw, 100px);
  padding: clamp(24px, 4vw, 56px);
  border-left: 1px solid rgba(215, 139, 255, 0.4);
  background: linear-gradient(90deg, rgba(7, 7, 14, 0.72), rgba(7, 7, 14, 0));
}

.start-card h1 {
  margin: 12px 0 18px;
  font-family: var(--display);
  font-size: clamp(50px, 7vw, 96px);
  font-weight: 500;
  line-height: 0.72;
  letter-spacing: -0.055em;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.65);
}

.start-card h1 em {
  color: var(--violet-bright);
  font-size: 0.52em;
  font-style: normal;
  letter-spacing: 0.18em;
}

.start-copy {
  max-width: 470px;
  margin: 0 0 24px;
  color: #d2cad8;
  font-family: var(--display);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.5;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.09em;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-width: 260px;
  min-height: 54px;
  padding: 14px 18px;
  background: linear-gradient(110deg, #7624ad, #be49ec);
  box-shadow: 0 12px 28px rgba(119, 27, 164, 0.32), inset 0 1px rgba(255, 255, 255, 0.2);
}

.primary-button small {
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.72);
  font-size: 8px;
}

.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.14);
  outline: none;
}

.primary-button--small {
  min-width: 132px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 11px;
}

.secondary-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: rgba(18, 15, 28, 0.92);
  font-size: 11px;
}

.controls-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 26px;
}

.controls-grid div {
  display: grid;
  gap: 5px;
}

kbd {
  width: max-content;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--bone);
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.3);
}

.controls-grid span,
.start-footer {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.start-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.start-footer a {
  color: var(--violet-bright);
  text-underline-offset: 3px;
}

.choice-panel,
.pause-card,
.gameover-card {
  width: min(980px, 96vw);
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(215, 139, 255, 0.26);
  background:
    radial-gradient(circle at 50% 0, rgba(112, 42, 145, 0.24), transparent 48%),
    linear-gradient(160deg, rgba(19, 16, 30, 0.98), rgba(8, 8, 15, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
  text-align: center;
}

.choice-panel h2,
.pause-card h2,
.gameover-card h2 {
  margin: 9px 0 6px;
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 500;
}

.choice-panel > p,
.pause-card > p {
  margin: 0 0 24px;
  color: var(--muted);
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-top: 26px;
}

.upgrade-choice {
  position: relative;
  min-height: 238px;
  padding: 24px 20px 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(49, 25, 63, 0.7), rgba(12, 11, 21, 0.98)),
    var(--panel-solid);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.upgrade-choice::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -50px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(215, 139, 255, 0.13);
  transform: rotate(45deg);
}

.upgrade-choice:hover,
.upgrade-choice:focus-visible {
  z-index: 2;
  border-color: rgba(215, 139, 255, 0.7);
  transform: translateY(-7px);
  box-shadow: 0 20px 44px rgba(82, 24, 105, 0.38);
  outline: none;
}

.upgrade-choice .choice-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 28px;
  border: 1px solid rgba(215, 139, 255, 0.36);
  border-radius: 50%;
  background: rgba(122, 41, 157, 0.18);
  color: var(--cyan);
  font-size: 29px;
  box-shadow: 0 0 24px rgba(105, 37, 139, 0.26);
}

.upgrade-choice .choice-type {
  color: var(--gold);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.17em;
}

.upgrade-choice h3 {
  margin: 6px 0 9px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}

.upgrade-choice p {
  margin: 0;
  color: #bcb5c5;
  font-size: 13px;
  line-height: 1.5;
}

.pause-card {
  width: min(440px, 94vw);
}

.pause-card .primary-button {
  margin-top: 10px;
}

.gameover-card {
  width: min(650px, 96vw);
}

.final-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 24px 0;
}

.final-stat {
  padding: 12px 8px;
  border: 1px solid var(--border);
  background: rgba(6, 6, 13, 0.52);
}

.final-stat span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.17em;
}

.final-stat strong {
  font-family: var(--display);
  font-size: 23px;
}

#scoreForm {
  width: min(500px, 100%);
  margin: 0 auto 18px;
  text-align: left;
}

#scoreForm label {
  display: block;
  margin-bottom: 7px;
  color: #d6cfdb;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.score-form-row {
  display: flex;
  gap: 7px;
}

#scoreForm input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 11px 13px;
  background: rgba(4, 4, 10, 0.9);
  color: var(--bone);
  outline: none;
}

#scoreForm input:focus {
  border-color: rgba(215, 139, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(169, 67, 255, 0.12);
}

#submitStatus {
  min-height: 18px;
  margin: 7px 0 0;
  color: var(--green);
  font-size: 11px;
}

#submitStatus.error {
  color: #ff6d7e;
}

.gameover-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.leaderboard-drawer {
  position: absolute;
  z-index: 35;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100%;
  padding: clamp(22px, 4vw, 42px);
  overflow: auto;
  border-left: 1px solid var(--border);
  transform: translateX(103%);
  background:
    radial-gradient(circle at 100% 0, rgba(111, 34, 148, 0.26), transparent 38%),
    rgba(9, 8, 16, 0.98);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.5);
  transition: transform 220ms ease;
  backdrop-filter: blur(16px);
}

.leaderboard-drawer.open {
  transform: translateX(0);
}

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

.leaderboard-head h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
}

.leaderboard-drawer > p {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  margin-bottom: 14px;
  overflow: auto;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  white-space: nowrap;
}

th {
  background: rgba(169, 67, 255, 0.1);
  color: var(--violet-bright);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.mobile-stick {
  position: absolute;
  z-index: 5;
  bottom: max(32px, env(safe-area-inset-bottom));
  left: 30px;
  display: none;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(8, 8, 18, 0.42);
  touch-action: none;
  backdrop-filter: blur(5px);
}

.mobile-stick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(215, 139, 255, 0.58);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(115, 34, 151, 0.72);
  box-shadow: 0 0 20px rgba(169, 67, 255, 0.34);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hud-top {
    grid-template-columns: auto 1fr auto;
    top: max(10px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
  }

  .hud-brand {
    padding: 8px 10px;
  }

  .hud-brand strong {
    font-size: 13px;
  }

  .run-stats {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
  }

  .run-stat {
    padding: 7px 8px;
  }

  .run-stat span {
    font-size: 7px;
  }

  .run-stat strong {
    font-size: 16px;
  }

  .weapon-panel {
    top: 76px;
    left: 12px;
  }

  .boss-bar {
    top: 75px;
  }
}

@media (max-width: 680px), (pointer: coarse) {
  .hud-brand,
  .weapon-panel {
    display: none;
  }

  .hud-top {
    grid-template-columns: 1fr auto;
  }

  .run-stats {
    justify-self: stretch;
  }

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

  #muteButton {
    display: none;
  }

  .vitals {
    bottom: max(18px, env(safe-area-inset-bottom));
    left: auto;
    right: 14px;
    width: min(320px, calc(100% - 155px));
    transform: none;
  }

  .level-medallion {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
  }

  .level-medallion strong {
    font-size: 22px;
  }

  .mobile-stick {
    display: block;
  }

  .overlay {
    padding: 14px;
  }

  .overlay--start {
    align-items: end;
    justify-items: stretch;
    background:
      linear-gradient(0deg, rgba(4, 4, 10, 0.98) 0%, rgba(4, 4, 10, 0.74) 48%, rgba(4, 4, 10, 0.08) 100%),
      url("/assets/nightfall-expansion-concept.png") 61% center / cover no-repeat;
  }

  .start-card {
    width: 100%;
    margin: 0;
    padding: 20px 12px 8px;
    border-left: 0;
    background: transparent;
  }

  .start-card h1 {
    margin: 8px 0 12px;
    font-size: clamp(42px, 14vw, 64px);
  }

  .start-copy {
    max-width: 410px;
    margin-bottom: 16px;
    font-size: 15px;
  }

  .primary-button {
    min-width: min(320px, 100%);
  }

  .controls-grid,
  .start-footer {
    display: none;
  }

  .choice-panel,
  .gameover-card,
  .pause-card {
    padding: 24px 16px;
  }

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

  .upgrade-choice {
    min-height: 120px;
    padding: 16px 16px 15px 86px;
  }

  .upgrade-choice .choice-icon {
    position: absolute;
    top: 20px;
    left: 17px;
    width: 52px;
    height: 52px;
    margin: 0;
  }

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

  .score-form-row,
  .gameover-actions {
    flex-direction: column;
  }

  .primary-button--small {
    min-width: 100%;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .start-card {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .start-card h1 {
    font-size: 58px;
  }

  .start-copy,
  .controls-grid,
  .start-footer {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .upgrade-choice {
    min-height: 185px;
  }

  .upgrade-choice .choice-icon {
    margin-bottom: 15px;
  }
}
