:root {
  color-scheme: dark;
  --gold: #ffd15c;
  --orange: #ff7a1a;
  --cyan: #42f5ff;
  --purple: #8d5cff;
  --dark: rgba(18, 8, 28, 0.78);
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #120819; touch-action: none; }
#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#ui-overlay { position: fixed; inset: 0; pointer-events: none; color: white; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
#ui-overlay button, #ui-overlay .panel, #hud, #mobileControls { pointer-events: auto; }
.panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 620px); padding: clamp(22px, 5vw, 42px);
  border: 1px solid rgba(255, 209, 92, .35); border-radius: 28px;
  background: linear-gradient(145deg, rgba(43, 15, 52, .88), rgba(89, 38, 24, .82));
  box-shadow: 0 24px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.14);
  text-align: center; backdrop-filter: blur(12px);
}
.hero h1 { margin: 10px 0 12px; font-size: clamp(42px, 8vw, 76px); line-height: .9; letter-spacing: -0.05em; }
.hero h1 span { color: var(--gold); filter: drop-shadow(0 0 18px rgba(255,209,92,.45)); }
.hero p { margin: 0 auto 22px; max-width: 54ch; opacity: .9; font-weight: 600; }
.badge { display: inline-flex; padding: 8px 12px; border-radius: 99px; background: rgba(66,245,255,.16); color: var(--cyan); font-weight: 800; }
.loading { display: inline-flex; gap: 10px; align-items: center; margin: 10px 0 10px; font-weight: 800; color: #ffe5a5; }
.loading span { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 18px var(--gold); animation: pulse 0.8s infinite alternate; }
.miner-select { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.miner-choice { min-width: 150px; border: 1px solid rgba(255, 209, 92, .28); background: rgba(255,255,255,.1); color: #fff2c1; }
.miner-choice.selected { color: #2a1200; background: linear-gradient(135deg, var(--gold), #fff0a5); box-shadow: 0 0 22px rgba(255,209,92,.32), inset 0 1px 0 rgba(255,255,255,.35); }
button {
  border: 0; border-radius: 16px; padding: 12px 18px; margin: 6px;
  color: white; background: rgba(255,255,255,.14); font-weight: 900; font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 8px 18px rgba(0,0,0,.25); cursor: pointer;
}
button.primary { background: linear-gradient(135deg, var(--orange), var(--gold)); color: #2a1200; font-size: 20px; padding: 15px 28px; }
button:disabled { opacity: .55; cursor: wait; }
.controls-help { margin-top: 16px; font-size: clamp(12px, 2.8vw, 14px); opacity: .75; }
#hud { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.stat { min-width: 82px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: var(--dark); backdrop-filter: blur(9px); }
.stat small { display: block; color: #c9b7ff; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.stat strong { display: block; color: white; font-size: clamp(16px, 4vw, 23px); }
.stat.coin strong { color: var(--gold); }
.effects { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: min(480px, 70vw); }
.effect-pill { padding: 8px 10px; border-radius: 99px; background: rgba(66,245,255,.16); border: 1px solid rgba(66,245,255,.32); color: var(--cyan); font-weight: 900; }
.hud-buttons { margin-left: auto; display: flex; gap: 4px; }
.hud-buttons button { width: 44px; height: 44px; padding: 0; border-radius: 14px; }
.compact { width: min(90vw, 420px); }
.compact h2 { margin: 0 0 10px; font-size: 38px; color: var(--gold); }
#mobileControls { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: none; gap: 12px; }
#mobileControls button { width: 62px; height: 58px; border-radius: 22px; background: rgba(30, 11, 42, .78); border: 1px solid rgba(255,255,255,.2); font-size: 24px; }
@media (pointer: coarse), (max-width: 760px) {
  #mobileControls { display: flex; }
  #hud { gap: 6px; }
  .stat { min-width: 72px; padding: 7px 9px; }
  .hud-buttons { order: 5; margin-left: 0; }
}
@keyframes pulse { from { transform: scale(.78); opacity: .55; } to { transform: scale(1.15); opacity: 1; } }
