* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: #e9f3ff;
  background:
    radial-gradient(circle at top center, rgba(149, 121, 62, 0.18), transparent 28rem),
    radial-gradient(circle at top left, rgba(54, 82, 119, 0.22), transparent 34rem),
    linear-gradient(180deg, #060b11 0%, #09111a 42%, #0b1118 100%);
}

body {
  position: relative;
}

.desktop-only-screen {
  display: none;
}

.desktop-only-card {
  width: min(560px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 26px;
  border: 1px solid rgba(201, 166, 93, 0.34);
  background: linear-gradient(160deg, rgba(10, 16, 24, 0.98), rgba(5, 9, 15, 0.96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
  text-align: center;
}

.desktop-only-card img {
  width: min(300px, 78vw);
  height: auto;
  margin-bottom: 14px;
}

.desktop-only-card h1 {
  margin: 0 0 10px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
}

.desktop-only-card p {
  margin: 0;
  color: #d7c9ad;
  line-height: 1.55;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.bg-ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(22px);
  opacity: 0.32;
  animation: drift 14s ease-in-out infinite;
}

.orb-a {
  width: 360px;
  height: 360px;
  left: -80px;
  top: -30px;
  background: rgba(201, 166, 93, 0.14);
}

.orb-b {
  width: 460px;
  height: 460px;
  right: -100px;
  top: 180px;
  background: rgba(47, 97, 148, 0.14);
  animation-duration: 18s;
}

.orb-c {
  width: 340px;
  height: 340px;
  bottom: -90px;
  left: 38%;
  background: rgba(44, 104, 71, 0.12);
  animation-duration: 16s;
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(22px, -18px, 0) scale(1.06); }
}

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

.menu-card {
  width: min(760px, 100%);
  padding: 28px 28px 24px;
  border: 1px solid rgba(171, 144, 88, 0.34);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(10, 16, 24, 0.96), rgba(8, 12, 18, 0.92));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(255,255,255,0.03);
  backdrop-filter: blur(14px);
  text-align: center;
  animation: cardIn 0.55s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.menu-logo-slot {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.logo-placeholder {
  width: min(360px, 100%);
  min-height: 110px;
  padding: 16px 20px;
  border: 1px dashed rgba(201, 166, 93, 0.45);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(18, 26, 38, 0.94), rgba(11, 16, 24, 0.9));
  display: grid;
  place-items: center;
  color: #d8c79c;
  box-shadow: inset 0 0 26px rgba(201, 166, 93, 0.08), 0 0 30px rgba(0,0,0,0.25);
  animation: pulseGlow 2.8s ease-in-out infinite;
}

.logo-placeholder span {
  display: block;
  font-weight: 900;
  letter-spacing: 0.18em;
  font-size: 1rem;
}

.logo-placeholder small {
  display: block;
  margin-top: 6px;
  color: #9ca7b6;
  letter-spacing: 0.04em;
}

.logo-placeholder.compact {
  width: 260px;
  min-height: 64px;
  padding: 10px 14px;
}

.complete-placeholder {
  margin: 0 auto 12px;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: inset 0 0 26px rgba(201, 166, 93, 0.08), 0 0 30px rgba(0,0,0,0.25); }
  50% { box-shadow: inset 0 0 38px rgba(201, 166, 93, 0.12), 0 0 36px rgba(201,166,93,0.12); }
}

.menu-heading h1,
.brand h1,
.panel h2,
.complete-screen h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}

.menu-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
}

.menu-heading p {
  margin: 8px 0 0;
  color: #d3b06b;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.menu-buttons {
  display: grid;
  gap: 12px;
  margin: 24px auto 12px;
  width: min(360px, 100%);
}

.menu-btn,
#restart-button {
  appearance: none;
  border: 1px solid rgba(171, 144, 88, 0.38);
  background: linear-gradient(180deg, rgba(18, 27, 40, 0.95), rgba(10, 15, 22, 0.95));
  color: #f6f3ec;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.menu-btn:hover,
#restart-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.28), 0 0 18px rgba(201,166,93,0.12);
  border-color: rgba(201, 166, 93, 0.55);
}

.menu-btn.primary {
  background: linear-gradient(180deg, rgba(46, 67, 94, 0.98), rgba(20, 36, 54, 0.98));
}

.menu-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(8, 12, 18, 0.72);
  border: 1px solid rgba(171, 144, 88, 0.2);
  text-align: left;
}

.compact-note {
  margin: 0 0 14px;
}

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

.options-group {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(171, 144, 88, 0.22);
  background: rgba(5, 10, 16, 0.45);
}

.option-group-title {
  color: #e6c27d;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.menu-subpanel h2 {
  margin: 0 0 12px 0;
}

.menu-note,
.help-level-card p,
.help-level-card li {
  color: #c7c1b3;
  line-height: 1.55;
}

.help-level-card ul {
  margin: 12px 0 0 18px;
  padding: 0;
}

.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: #eef3fb;
}

.option-row.slim {
  padding: 6px 0;
}

.small-toggle {
  border: 1px solid rgba(171, 144, 88, 0.35);
  background: #0b131d;
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.small-toggle.on {
  background: #213449;
  color: #e8d19f;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px 22px 24px;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto 16px auto;
  max-width: 1480px;
  padding: 14px 16px;
  border: 1px solid rgba(171, 144, 88, 0.28);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(11, 18, 28, 0.97), rgba(7, 12, 20, 0.96));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.54), inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -1px 0 rgba(161,133,69,0.18);
  backdrop-filter: blur(14px);
  position: relative;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 290px;
  width: 100%;
  text-align: center;
}

.logo-slot {
  width: 100%;
  display: flex;
  justify-content: center;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.1vw, 2.15rem);
  line-height: 1.05;
  color: #ffffff;
}

.brand p {
  margin: 5px 0 0 0;
  color: #b9a06a;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hud-strip {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.hud-card {
  min-width: 142px;
  padding: 10px 12px;
  border: 1px solid rgba(166, 139, 82, 0.24);
  border-radius: 14px;
  background: rgba(10, 15, 24, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hud-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  font-weight: 800;
  color: #b59a63;
  margin-bottom: 6px;
}

.hud-value {
  display: block;
  font-size: 1.38rem;
  line-height: 1;
  color: #fff;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.hud-value.small {
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1rem;
  color: #c7eeff;
}

.heat-card {
  min-width: 206px;
}

.heat-track {
  width: 100%;
  height: 17px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(9, 23, 38, 0.9), rgba(13, 36, 53, 0.9));
  border: 1px solid rgba(144, 189, 223, 0.24);
}

.heat-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4dd5ff 0%, #ffe066 58%, #ff5e5e 100%);
  box-shadow: 0 0 14px rgba(255, 114, 92, 0.42);
  transition: width 0.09s linear;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(640px, 1000px) minmax(220px, 280px);
  gap: 16px;
  align-items: start;
  justify-content: center;
  max-width: 1480px;
  margin: 0 auto;
}

.panel,
.stage-card {
  border: 1px solid rgba(171, 144, 88, 0.24);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(10, 16, 24, 0.94), rgba(8, 12, 18, 0.88));
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 0 0 0 1px rgba(161,133,69,0.05);
  backdrop-filter: blur(12px);
}

.panel {
  padding: 18px 22px 24px;
  min-height: 340px;
}

.panel h2 {
  margin: 0 0 10px 0;
  color: #fff;
}

.panel p {
  margin: 0 0 16px 0;
  color: #c7c1b3;
  line-height: 1.5;
  font-size: 0.94rem;
}

.task-list {
  display: grid;
  gap: 10px;
  color: #d7efff;
  font-size: 0.92rem;
}

.task-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: #c9a65d;
  box-shadow: 0 0 12px rgba(201, 166, 93, 0.7);
}

.mini-legend {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(151, 194, 221, 0.16);
  display: grid;
  gap: 9px;
  color: #cfc5b4;
  font-size: 0.9rem;
}

.legend-circle {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: -2px;
}

.legend-circle.coolant { background: #41ddff; }
.legend-circle.turbo { background: #7dff7a; }
.legend-circle.time { background: #ffd166; }
.legend-circle.duck { background: #ff6b6b; }

.stage-card {
  position: relative;
  padding: 10px;
}

.stage-card::before {
  content: "PRESIDENTIAL MAINTENANCE OPERATIONS";
  position: absolute;
  top: -11px;
  left: 22px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #0a1018;
  border: 1px solid rgba(171,144,88,0.3);
  color: #bda16c;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  font-weight: 800;
}

#gameCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background: #0e1117;
}

.canvas-help {
  position: absolute;
  left: 20px;
  bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(6, 12, 18, 0.84);
  border: 1px solid rgba(171, 144, 88, 0.22);
  color: #e5dfd4;
  font-size: 0.86rem;
}

.event-banner {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 3;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(201, 166, 93, 0.5);
  background: rgba(25, 15, 3, 0.9);
  color: #dfbc78;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 28px rgba(201, 166, 93, 0.26);
  animation: pulseBanner 0.9s ease-in-out infinite alternate;
}

@keyframes pulseBanner {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.03); }
}

.operation-log {
  height: 360px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  position: relative;
}

.right-panel {
  height: 540px;
  display: flex;
  flex-direction: column;
}

.log-entry {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(7, 12, 18, 0.82);
  border: 1px solid rgba(171, 144, 88, 0.18);
  animation: feedDrop 0.28s ease both;
}

@keyframes feedDrop {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-tag {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #d2ae6c;
  margin-bottom: 4px;
}

.log-entry p {
  margin: 0;
  font-size: 0.86rem;
}

.complete-screen {
  position: absolute;
  inset: 14px;
  z-index: 5;
  border-radius: 18px;
  background: rgba(7, 12, 20, 0.92);
  border: 1px solid rgba(171, 144, 88, 0.26);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
}

.complete-screen p {
  color: #d4ccbc;
}

.score-box {
  margin: 12px 0;
  padding: 14px 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(26, 35, 48, 0.95), rgba(11, 17, 25, 0.96));
  border: 1px solid rgba(171, 144, 88, 0.34);
}

#final-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: white;
}

.final-details {
  max-width: 600px;
}

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

  .panel {
    min-height: unset;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .menu-card {
    padding: 20px 16px 18px;
  }

  .canvas-help {
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 14px;
  }
}

.logo-ready {
  border-style: solid;
  min-height: auto;
}

.game-logo-img {
  width: min(420px, 100%);
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0,0,0,0.38));
}

.compact-logo-img {
  max-height: 70px;
  width: auto;
  max-width: 260px;
}

.range-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  color: #eef3fb;
}

.compact-range {
  padding: 8px 0 4px;
}

.range-row input {
  width: 100%;
  accent-color: #c9a65d;
}

.playlist-preview {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(171, 144, 88, 0.22);
  background: rgba(5, 10, 16, 0.55);
  color: #cfc5b4;
}

.playlist-preview strong {
  display: block;
  color: #e6c27d;
  margin-bottom: 6px;
}

.music-player-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(171, 144, 88, 0.24);
  background: rgba(5, 10, 16, 0.58);
  color: #cfc5b4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.music-player-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.music-player-head strong {
  color: #e6c27d;
}

.music-player-current {
  color: #f2ead7;
  font-weight: 800;
  font-size: 0.9rem;
  text-align: right;
}

.music-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 10px;
}

.music-controls .small-toggle {
  min-width: 84px;
}

.playlist-list {
  display: grid;
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
  padding-right: 4px;
  color: #cfc5b4;
}

.playlist-track {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 5px 8px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  color: #edf5ff;
  cursor: pointer;
  text-align: left;
}

.playlist-track:hover {
  border-color: rgba(201, 166, 93, 0.36);
  background: rgba(201, 166, 93, 0.08);
}

.playlist-track.active {
  border-color: rgba(91, 159, 255, 0.56);
  background: linear-gradient(90deg, rgba(21, 87, 174, 0.34), rgba(201, 166, 93, 0.08));
  box-shadow: 0 0 18px rgba(43, 116, 214, 0.12);
}

.playlist-track-number {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: #e6c27d;
  font-weight: 900;
}

.playlist-track-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 850;
}

.playlist-track-src {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #8fa4bc;
  font-size: 0.78rem;
}

.options-music-player,
.pause-music-player {
  text-align: left;
}

.countdown-screen,
.pause-screen {
  position: absolute;
  inset: 10px;
  z-index: 6;
  border-radius: 18px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.countdown-screen {
  background: radial-gradient(circle, rgba(8, 13, 20, 0.16), rgba(0, 0, 0, 0.1));
}

.countdown-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  color: #fff;
  font-weight: 900;
  text-shadow: 0 8px 28px rgba(0,0,0,0.65), 0 0 18px rgba(201,166,93,0.26);
  animation: countdownPop 0.55s ease both;
  text-align: center;
}

.countdown-text.go-call {
  font-size: clamp(1.35rem, 2.8vw, 2.15rem);
  letter-spacing: 0.06em;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(7, 12, 18, 0.74);
  border: 1px solid rgba(201, 166, 93, 0.28);
}

@keyframes countdownPop {
  from { transform: scale(0.55); opacity: 0; }
  45% { transform: scale(1.14); opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}

.pause-screen {
  pointer-events: auto;
  background: rgba(3, 7, 12, 0.72);
  backdrop-filter: blur(8px);
}

.pause-card {
  width: min(420px, calc(100% - 28px));
  padding: 24px;
  text-align: center;
  border-radius: 22px;
  border: 1px solid rgba(201, 166, 93, 0.34);
  background: linear-gradient(160deg, rgba(10, 16, 24, 0.96), rgba(8, 12, 18, 0.94));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.pause-card h2 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
}

.track-title {
  margin: 14px 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: #e6c27d;
  font-weight: 800;
}

.pause-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.pause-controls .small-toggle {
  min-width: 84px;
}

.demo-message {
  display: grid;
  gap: 7px;
  margin: 12px auto 18px;
  padding: 14px 18px;
  max-width: 560px;
  border-radius: 16px;
  background: rgba(8, 12, 18, 0.65);
  border: 1px solid rgba(201, 166, 93, 0.24);
  color: #d8d0c4;
}

.demo-message strong {
  color: #e6c27d;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.demo-message a {
  color: #86c7ff;
  font-weight: 900;
}

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

/* v3 polish */
.logo-ready {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  animation: none !important;
}

.menu-logo-slot .logo-placeholder {
  width: min(860px, 96vw);
}

.game-logo-img {
  width: min(720px, 100%) !important;
  filter: drop-shadow(0 20px 36px rgba(0,0,0,0.46));
}

.compact-logo-img {
  max-height: 112px !important;
  max-width: 520px !important;
  width: auto !important;
}

.pause-card {
  width: min(620px, calc(100% - 28px));
}

.pause-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
  text-align: left;
}

.pause-options-group {
  padding: 12px;
}

.complete-screen {
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.complete-screen:not(.hidden) {
  opacity: 1;
  transform: scale(1);
}

.final-details {
  font-size: 1.05rem;
  color: #f4e6c6 !important;
}

@media (max-width: 720px) {
  .pause-options-grid {
    grid-template-columns: 1fr;
  }
}


/* Level 2 additions */
.menu-btn {
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.legend-circle.blue-layer { background: #1d6dde; }
.legend-circle.thin-layer { background: #7dbdff; }
.legend-circle.thick-layer { background: #f4d88a; }

.completion-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.completion-actions .menu-btn,
.completion-actions #restart-button {
  min-width: 170px;
}

@media (max-width: 720px) {
  .completion-actions {
    flex-direction: column;
  }

  .completion-actions .menu-btn,
  .completion-actions #restart-button {
    width: 100%;
  }
}

@media (max-width: 900px), (pointer: coarse) {
  body {
    overflow: hidden;
  }

  .menu-screen,
  .app-shell {
    display: none !important;
  }

  .desktop-only-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
      radial-gradient(circle at top, rgba(201, 166, 93, 0.14), transparent 28rem),
      linear-gradient(180deg, #05080d 0%, #09111a 100%);
  }
}

/* v5 single-window level shell */
.level-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  background:
    radial-gradient(circle at 20% 0%, rgba(201, 166, 93, 0.14), transparent 26rem),
    linear-gradient(180deg, #060a11 0%, #0b1320 100%);
}

.level-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

.menu-btn.disabled,
.menu-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Music-reactive logo beat pulse */
:root {
  --music-beat: 0;
}

.logo-ready {
  transform: translateY(calc(var(--music-beat) * -3px)) scale(calc(1 + var(--music-beat) * 0.018));
  transition: transform 85ms linear, filter 85ms linear;
  will-change: transform;
}

.game-logo-img,
.desktop-only-card img {
  transform:
    translateY(calc(var(--music-beat) * -8px))
    rotate(calc((var(--music-beat) - 0.18) * 2.6deg))
    scale(calc(1 + var(--music-beat) * 0.055));
  transform-origin: 50% 62%;
  transition: transform 80ms linear, filter 80ms linear;
  will-change: transform, filter;
}

.compact-logo-img {
  transform:
    translateY(calc(var(--music-beat) * -6px))
    rotate(calc((var(--music-beat) - 0.18) * 2deg))
    scale(calc(1 + var(--music-beat) * 0.048));
}

body.music-reactive .game-logo-img,
body.music-reactive .desktop-only-card img {
  filter:
    drop-shadow(0 20px 36px rgba(0,0,0,0.46))
    drop-shadow(0 0 calc(5px + var(--music-beat) * 12px) rgba(66, 143, 255, 0.22));
}

.menu-logo-slot .logo-placeholder.logo-ready {
  transform: translateY(calc(var(--music-beat) * -5px)) scale(calc(1 + var(--music-beat) * 0.024));
}
