:root {
  color-scheme: dark;
  --bg1: #101827;
  --bg2: #233a5e;
  --panel: rgba(255,255,255,.10);
  --panel2: rgba(255,255,255,.16);
  --text: #fff7df;
  --muted: #cdd7ee;
  --accent: #ffcc33;
  --accent2: #ff6b47;
  --blue: #56b5ff;
  --shadow: rgba(0,0,0,.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top, var(--bg2), var(--bg1)); color: var(--text); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow-x: hidden; }
body { touch-action: manipulation; }
.app { width: min(1100px, 100%); margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.eyebrow { margin: 0 0 2px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-size: 12px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(24px, 6vw, 44px); line-height: 1; text-shadow: 0 5px 0 var(--shadow); }
.gameCard { position: relative; border-radius: 24px; padding: 8px; background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.05)); box-shadow: 0 20px 60px var(--shadow); border: 1px solid rgba(255,255,255,.18); }
canvas { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; background: #6ec6ff; image-rendering: auto; touch-action: none; }
.overlay { position: absolute; inset: 8px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(rgba(16,24,39,.45), rgba(16,24,39,.76)); padding: 16px; }
.overlay.hidden { display: none; }
.panel { width: min(560px, 92%); text-align: center; border-radius: 24px; background: rgba(17,24,39,.86); border: 1px solid rgba(255,255,255,.2); padding: 22px; box-shadow: 0 16px 40px rgba(0,0,0,.32); backdrop-filter: blur(8px); }
.panel h2 { margin: 0 0 8px; font-size: clamp(24px, 5vw, 38px); }
.panel p { margin: 0 auto 16px; color: var(--muted); line-height: 1.55; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; user-select: none; }
.primaryBtn, .ghostBtn, .smallBtn { border-radius: 999px; font-weight: 900; box-shadow: 0 7px 0 rgba(0,0,0,.25); transition: transform .05s ease, box-shadow .05s ease; }
.primaryBtn:active, .ghostBtn:active, .smallBtn:active, .controlBtn:active, .jumpBtn:active { transform: translateY(3px) scale(.99); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.primaryBtn { background: linear-gradient(180deg, #ffe16b, #ff9e2d); color: #4a2400; padding: 14px 26px; font-size: 18px; }
.ghostBtn { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28); padding: 14px 20px; }
.smallBtn { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.25); padding: 10px 14px; min-width: 82px; }
.note { font-size: 12px; opacity: .85; }
.hudBar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.hudBar div { text-align: center; padding: 10px 7px; border-radius: 16px; background: var(--panel); border: 1px solid rgba(255,255,255,.14); font-size: clamp(12px, 3.5vw, 16px); }
.hudBar strong { color: var(--accent); font-size: 1.2em; }
.controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 4px; }
.dpad { display: grid; grid-template-columns: repeat(2, minmax(82px, 1fr)); gap: 10px; width: min(48vw, 260px); }
.controlBtn, .jumpBtn { height: 68px; border-radius: 22px; font-weight: 1000; box-shadow: 0 8px 0 rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.18); touch-action: none; }
.controlBtn { background: linear-gradient(180deg, #4baeff, #1771d5); font-size: 30px; }
.jumpBtn { width: min(42vw, 250px); background: linear-gradient(180deg, #ff795f, #dd2c2c); font-size: 22px; letter-spacing: .06em; }
@media (max-width: 700px) {
  .app { padding-left: 8px; padding-right: 8px; }
  .gameCard { border-radius: 18px; padding: 5px; }
  canvas, .overlay { border-radius: 14px; }
  .overlay { inset: 5px; }
  .panel { padding: 18px 14px; }
  .hudBar { gap: 6px; }
  .hudBar div { padding: 8px 4px; border-radius: 12px; }
  .controlBtn, .jumpBtn { height: 74px; border-radius: 20px; }
}
