:root {
  color-scheme: dark;
  --bg: #170f24;
  --panel: rgba(25, 21, 44, 0.74);
  --stroke: rgba(255,255,255,0.1);
  --accent: #ff8a65;
  --accent-2: #7ee7ff;
  --good: #ffe56b;
  --text: #fff7f0;
  --muted: #d3c7df;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top, #2c1b4d, #120b1f 58%); font-family: Inter, system-ui, sans-serif; color: var(--text); }
body { display: flex; justify-content: center; }
button, select { font: inherit; }
.app-shell { width: min(100vw, 940px); min-height: 100vh; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.hud-top, .control-dock { display: flex; justify-content: space-between; gap: 12px; }
.hud-top { align-items: center; background: var(--panel); border: 1px solid var(--stroke); border-radius: 22px; padding: 14px 16px; backdrop-filter: blur(16px); }
.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-block h1 { margin: 0; font-size: clamp(20px, 4vw, 28px); }
.brand-block p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.brand-pill, .overlay-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; background: rgba(255,138,101,0.16); border: 1px solid rgba(255,138,101,0.35); color: #ffd7ca; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.scoreboard { display: grid; grid-template-columns: repeat(4, minmax(64px, 1fr)); gap: 8px; }
.scoreboard div { background: rgba(255,255,255,0.05); border-radius: 16px; padding: 8px 12px; text-align: center; border: 1px solid rgba(255,255,255,0.08); }
.scoreboard span { display: block; color: var(--muted); font-size: 12px; }
.scoreboard strong { display: block; font-size: 18px; margin-top: 4px; }
.game-frame { position: relative; flex: 1; min-height: 58vh; border-radius: 28px; overflow: hidden; border: 1px solid var(--stroke); background: linear-gradient(180deg, #4b2e7d 0%, #2d1a4a 40%, #1a0f2d 100%); box-shadow: 0 20px 40px rgba(0,0,0,0.28); }
#game { display: block; width: 100%; height: 100%; touch-action: none; }
.buff-strip { position: absolute; left: 16px; bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 4; }
.buff-chip { padding: 8px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid rgba(255,255,255,0.14); background: rgba(20,12,32,0.74); color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,0.22); }
.install-fab { position: absolute; right: 16px; bottom: 16px; z-index: 4; border: 0; border-radius: 999px; padding: 12px 16px; font-weight: 800; color: #2b1830; background: linear-gradient(135deg, #ffe56b, #ffb469); box-shadow: 0 10px 22px rgba(255,180,105,0.35); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 5, 18, 0.38); }
.overlay[hidden] { display: none; }
.overlay-card { width: min(100%, 440px); background: rgba(22, 16, 35, 0.84); border: 1px solid rgba(255,255,255,0.1); border-radius: 28px; padding: 22px; text-align: center; backdrop-filter: blur(14px); box-shadow: 0 24px 50px rgba(0,0,0,0.35); }
.overlay-card h2 { margin: 12px 0 8px; font-size: clamp(28px, 6vw, 42px); }
.overlay-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.overlay-card button { width: 100%; border: 0; border-radius: 18px; padding: 16px; color: #25131b; font-weight: 900; font-size: 18px; background: linear-gradient(135deg, #ffe56b, #ff9f68); box-shadow: 0 12px 26px rgba(255, 153, 102, 0.45); }
.overlay-card small { display: block; margin-top: 12px; color: #f3dff4; }
.setting-block { display: grid; gap: 8px; margin-bottom: 16px; text-align: left; }
.setting-block label { font-size: 13px; color: var(--muted); }
.setting-block select { width: 100%; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: white; padding: 12px 14px; }
.control-dock { position: sticky; bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
.control { flex: 1; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; min-height: 72px; color: white; font-size: 22px; font-weight: 900; backdrop-filter: blur(14px); }
.control.jump { background: linear-gradient(135deg, rgba(126,231,255,0.26), rgba(70,146,255,0.36)); }
.control.slide { background: linear-gradient(135deg, rgba(255,138,101,0.28), rgba(255,99,71,0.36)); }
@media (max-width: 640px) {
  .hud-top { flex-direction: column; align-items: stretch; }
  .scoreboard { grid-template-columns: repeat(2, 1fr); }
  .control { min-height: 82px; }
}
