/* ============================================================
   SIMON SAYS — Premium Arcade CSS
   Design tokens → layout → components → animations → responsive
   ============================================================ */

/* ── 1. Design Tokens ─────────────────────────────────────── */
:root {
  /* Neon palette */
  --neon-green:   #00ff88;
  --neon-red:     #ff2255;
  --neon-yellow:  #ffe600;
  --neon-blue:    #00aaff;

  /* Button base colours (darker, lit by glow) */
  --btn-green:    #00c96a;
  --btn-red:      #cc1a44;
  --btn-yellow:   #ccb800;
  --btn-blue:     #0088dd;

  /* Button pressed colours */
  --btn-green-lit:  #aaffcc;
  --btn-red-lit:    #ffaabb;
  --btn-yellow-lit: #fff6aa;
  --btn-blue-lit:   #aaddff;

  /* Surfaces */
  --bg-void:      #020510;
  --glass-bg:     rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-shine:  rgba(255, 255, 255, 0.07);

  /* Typography */
  --font-display: 'Orbitron', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 32px;
  --gap-xl: 48px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-full: 9999px;

  /* Transitions */
  --ease-snap: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 80ms;
  --t-med:  200ms;
  --t-slow: 400ms;
}

/* ── 2. Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  font-size: 16px;
}

body {
  min-height: 100%;
  background: var(--bg-void);
  color: #e0e8ff;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

button:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 3px;
}

/* ── 3. Animated Background Canvas ───────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── 4. Confetti Layer ────────────────────────────────────── */
#confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg) scaleX(1);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg) scaleX(-1); opacity: 0; }
}

/* ── 5. App Wrapper ───────────────────────────────────────── */
.app-wrapper {
  position: relative;
  z-index: 1;
  width: min(480px, 96vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-md);
  padding: var(--gap-md) var(--gap-sm) var(--gap-lg);
}

/* ── 6. Glassmorphism Utility ─────────────────────────────── */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow:
    0 0 0 1px var(--glass-shine) inset,
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ── 7. HUD Header ────────────────────────────────────────── */
.hud {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap-sm);
  padding: var(--gap-sm) var(--gap-md);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hud-stat:first-child { align-items: flex-start; }
.hud-stat:last-child  { align-items: flex-end; }

.hud-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(160, 180, 220, 0.7);
}

.hud-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 170, 255, 0.6);
  line-height: 1;
  transition: color var(--t-med), text-shadow var(--t-med);
}

/* Center branding */
.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
}

.game-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  background: linear-gradient(135deg, #00aaff 0%, #00ff88 50%, #ffe600 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(0, 170, 255, 0.5));
  text-transform: uppercase;
}

/* Mode selector */
.mode-selector {
  display: flex;
  gap: 3px;
  background: rgba(0,0,0,0.3);
  padding: 3px;
  border-radius: var(--r-full);
  border: 1px solid var(--glass-border);
}

.mode-btn {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--r-full);
  color: rgba(180, 200, 240, 0.6);
  transition: all var(--t-med) var(--ease-out);
}

.mode-btn.active,
.mode-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(0,170,255,0.25), rgba(0,255,136,0.15));
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.mode-btn:hover:not(.active) { color: rgba(200, 220, 255, 0.85); }

/* ── 8. Progress Bar ──────────────────────────────────────── */
.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-full);
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
  box-shadow: 0 0 10px var(--neon-blue), 0 0 20px rgba(0,170,255,0.3);
  transition: width 0.5s var(--ease-out);
}

/* ── 9. Board Area ────────────────────────────────────────── */
.board-area {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 10. Countdown Overlay ────────────────────────────────── */
.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 5, 16, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 50%;
}

.countdown-overlay[hidden] { display: none; }

.countdown-digit {
  font-family: var(--font-display);
  font-size: 7rem;
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 0 20px var(--neon-blue),
    0 0 60px rgba(0, 170, 255, 0.5);
  animation: count-pop var(--t-slow) var(--ease-snap) both;
}

@keyframes count-pop {
  0%   { transform: scale(1.6); opacity: 0; }
  40%  { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── 11. Result Overlay ───────────────────────────────────── */
.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(2, 5, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in var(--t-slow) var(--ease-out) both;
}

.result-overlay[hidden] { display: none; }

.result-card {
  padding: var(--gap-lg) var(--gap-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
  animation: card-rise var(--t-slow) var(--ease-snap) both;
}

@keyframes card-rise {
  from { transform: translateY(24px) scale(0.92); opacity: 0; }
  to   { transform: translateY(0) scale(1);        opacity: 1; }
}

.result-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.result-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
}

.result-sub {
  font-size: 0.85rem;
  color: rgba(180, 200, 240, 0.8);
}

.result-sub strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
}

.result-best {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neon-yellow);
  text-shadow: 0 0 10px rgba(255, 230, 0, 0.5);
  letter-spacing: 0.05em;
}

.result-actions {
  display: flex;
  gap: var(--gap-sm);
  margin-top: var(--gap-sm);
}

/* ── 12. Simon Ring & Buttons ─────────────────────────────── */
.simon-ring {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(10,20,50,0.9) 0%, rgba(2,5,16,0.98) 70%);
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.05),
    0 0 60px rgba(0, 0, 0, 0.8),
    inset 0 0 40px rgba(0,0,0,0.5);
}

/* ── Simon button base ── */
.simon-btn {
  position: relative;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform var(--t-fast) var(--ease-snap),
    box-shadow var(--t-fast) var(--ease-out),
    filter var(--t-fast) var(--ease-out);

  /* 3D base surface */
  background: radial-gradient(ellipse at 35% 30%, rgba(255,255,255,0.18) 0%, transparent 60%),
              var(--btn-color);

  /* Resting shadow: bottom-heavy = depth illusion */
  box-shadow:
    0 6px 0 0 var(--shadow-color),
    0 8px 16px rgba(0,0,0,0.6),
    0 0 30px -4px var(--glow-color),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -2px 4px rgba(0,0,0,0.4);
}

/* Shimmer layer */
.simon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 50%);
  pointer-events: none;
}

/* Glow halo (hidden at rest, shown on flash/press) */
.simon-btn::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--glow-color) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
}

/* ── Individual button colours & tokens ── */
#btn-green {
  --btn-color:   var(--btn-green);
  --shadow-color: #004d2a;
  --glow-color:   var(--neon-green);
  grid-area: 1 / 1;
  border-radius: 50% 10% 50% 50%;
}

#btn-red {
  --btn-color:   var(--btn-red);
  --shadow-color: #5a0018;
  --glow-color:   var(--neon-red);
  grid-area: 1 / 2;
  border-radius: 10% 50% 50% 50%;
}

#btn-yellow {
  --btn-color:   var(--btn-yellow);
  --shadow-color: #5a4d00;
  --glow-color:   var(--neon-yellow);
  grid-area: 2 / 1;
  border-radius: 50% 50% 50% 10%;
}

#btn-blue {
  --btn-color:   var(--btn-blue);
  --shadow-color: #003566;
  --glow-color:   var(--neon-blue);
  grid-area: 2 / 2;
  border-radius: 50% 50% 10% 50%;
}

/* ── Hover state ── */
.simon-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 0 0 var(--shadow-color),
    0 12px 24px rgba(0,0,0,0.6),
    0 0 40px -2px var(--glow-color),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.4);
}

.simon-btn:hover::after { opacity: 0.35; }

/* ── Active / pressed state ── */
.simon-btn:active,
.simon-btn.pressed {
  transform: translateY(5px) scale(0.96);
  box-shadow:
    0 1px 0 0 var(--shadow-color),
    0 2px 8px rgba(0,0,0,0.5),
    0 0 60px 4px var(--glow-color),
    inset 0 4px 8px rgba(0,0,0,0.5);
  filter: brightness(1.6) saturate(1.3);
}

.simon-btn.pressed::after { opacity: 0.7; }

/* ── Flash animation (Simon playback) ── */
.simon-btn.flash {
  transform: translateY(4px) scale(0.97);
  filter: brightness(2) saturate(1.4);
  box-shadow:
    0 1px 0 0 var(--shadow-color),
    0 0 80px 12px var(--glow-color),
    inset 0 4px 8px rgba(0,0,0,0.3);
}

.simon-btn.flash::after { opacity: 0.9; }

/* ── Disabled state (during Simon playback) ── */
.simon-btn:disabled {
  cursor: not-allowed;
  filter: brightness(0.6) saturate(0.5);
}

/* ── 13. Centre Hub ───────────────────────────────────────── */
.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 40% 35%, rgba(255,255,255,0.1) 0%, transparent 60%),
    radial-gradient(ellipse at center, #0a1428 0%, #020510 80%);
  border: 2px solid rgba(255,255,255,0.08);
  box-shadow:
    0 0 20px rgba(0,0,0,0.9),
    0 0 0 6px rgba(2,5,16,0.95),
    0 0 0 8px rgba(255,255,255,0.04),
    inset 0 2px 4px rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  z-index: 10;
  pointer-events: none;
}

.hub-score {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.6rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 12px var(--neon-blue);
  transition: transform var(--t-med) var(--ease-snap), text-shadow var(--t-med);
}

.hub-score.pop {
  animation: hub-pop var(--t-slow) var(--ease-snap);
}

@keyframes hub-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.hub-label-small {
  font-family: var(--font-body);
  font-size: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(140, 165, 210, 0.6);
}

/* ── 14. Keyboard Hint ────────────────────────────────────── */
.key-hint {
  font-size: 0.62rem;
  color: rgba(140, 165, 210, 0.45);
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: var(--gap-xs);
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(200,220,255,0.7);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

/* ── 15. Control Bar ──────────────────────────────────────── */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
  width: 100%;
}

/* Icon control button */
.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: rgba(180, 200, 240, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: all var(--t-med) var(--ease-out);
}

.ctrl-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 12px rgba(0,170,255,0.2);
  transform: translateY(-2px);
}

.ctrl-btn:active { transform: translateY(0) scale(0.94); }

.ctrl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Start button — primary CTA */
.primary-ctrl {
  width: auto;
  min-width: 120px;
  height: 52px;
  border-radius: var(--r-full);
  padding: 0 var(--gap-lg);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #0066cc 0%, #0044aa 100%);
  border: 1px solid rgba(0, 170, 255, 0.4);
  box-shadow:
    0 4px 0 #002266,
    0 6px 20px rgba(0, 100, 200, 0.4),
    0 0 30px rgba(0, 170, 255, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all var(--t-med) var(--ease-snap);
}

.primary-ctrl:hover {
  background: linear-gradient(135deg, #0077ee 0%, #0055cc 100%);
  box-shadow:
    0 6px 0 #002266,
    0 10px 30px rgba(0, 100, 200, 0.5),
    0 0 50px rgba(0, 170, 255, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

.primary-ctrl:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #002266,
    0 2px 8px rgba(0,0,0,0.4),
    inset 0 2px 4px rgba(0,0,0,0.3);
}

/* ── 16. Action Buttons (result overlay) ──────────────────── */
.action-btn {
  padding: 10px 22px;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: all var(--t-med) var(--ease-snap);
}

.action-btn.primary {
  background: linear-gradient(135deg, #00aa55 0%, #007733 100%);
  color: #fff;
  border: 1px solid rgba(0, 255, 136, 0.35);
  box-shadow:
    0 3px 0 #003d1a,
    0 0 20px rgba(0, 200, 100, 0.3);
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, #00cc66 0%, #009944 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #003d1a, 0 0 30px rgba(0, 255, 136, 0.4);
}

.action-btn.secondary {
  background: rgba(255,255,255,0.06);
  color: rgba(200, 220, 255, 0.75);
  border: 1px solid rgba(255,255,255,0.12);
}

.action-btn.secondary:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  transform: translateY(-1px);
}

/* ── 17. Screen Shake ─────────────────────────────────────── */
@keyframes screen-shake {
  0%,100% { transform: translateX(0) rotate(0); }
  10%     { transform: translateX(-8px) rotate(-0.5deg); }
  20%     { transform: translateX(8px) rotate(0.5deg); }
  30%     { transform: translateX(-10px) rotate(-0.3deg); }
  40%     { transform: translateX(10px) rotate(0.3deg); }
  50%     { transform: translateX(-6px) rotate(-0.2deg); }
  60%     { transform: translateX(6px) rotate(0.2deg); }
  70%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
  90%     { transform: translateX(-2px); }
}

.app-wrapper.shake {
  animation: screen-shake 0.6s var(--ease-out) both;
}

/* ── 18. Game-Over Body State ─────────────────────────────── */
body.game-over::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(200, 0, 40, 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 998;
  animation: gameover-flash 0.5s ease both;
}

@keyframes gameover-flash {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── 19. Misc Animations ──────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 16px 2px var(--glow-color); }
  50%       { box-shadow: 0 0 32px 8px var(--glow-color); }
}

/* HUD value pulse on level-up */
@keyframes hud-pulse {
  0%   { transform: scale(1); color: #fff; }
  50%  { transform: scale(1.3); color: var(--neon-green); }
  100% { transform: scale(1); color: #fff; }
}

.hud-value.pulse {
  animation: hud-pulse 0.4s var(--ease-snap) both;
}

/* ── 20. Sound-muted icon swap ────────────────────────────── */
#btn-sound[aria-pressed="false"] .icon-sound-on  { display: none; }
#btn-sound[aria-pressed="false"] .icon-sound-off { display: block !important; }
#btn-sound[aria-pressed="true"]  .icon-sound-off { display: none; }

/* ── 21. Reduced Motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 22. Responsive — Tablet ──────────────────────────────── */
@media (max-width: 520px) {
  .app-wrapper { gap: var(--gap-sm); padding-bottom: var(--gap-md); }
  .game-title  { font-size: 1.2rem; }
  .hud-value   { font-size: 1.2rem; }
}

/* ── 23. Responsive — Mobile ──────────────────────────────── */
@media (max-width: 380px) {
  .game-title      { font-size: 1rem; letter-spacing: 0.2em; }
  .mode-btn        { font-size: 0.55rem; padding: 3px 8px; }
  .primary-ctrl    { min-width: 100px; font-size: 0.7rem; }
  .ctrl-btn        { width: 42px; height: 42px; }
  .result-card     { padding: var(--gap-md); }
  .result-heading  { font-size: 1.1rem; }
  .action-btn      { padding: 8px 16px; font-size: 0.65rem; }
  .key-hint        { display: none; }
}

/* ── 24. Landscape mobile ─────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .app-wrapper { flex-direction: row; flex-wrap: wrap; max-width: 720px; width: 96vw; }
  .hud         { order: 0; width: 100%; }
  .progress-track { order: 1; width: 100%; }
  .board-area  { order: 2; width: 44vw; aspect-ratio: 1; }
  .controls    { order: 3; flex-direction: column; width: auto; }
  .key-hint    { display: none; }
}
