:root {
  --bg: #0b1020; --bg2: #131a33;
  --panel: rgba(255,255,255,.05); --line: rgba(255,255,255,.10);
  --text: #e8ecff; --muted: #8b95bf;
  --accent: #4fd1ff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%;
  background: radial-gradient(1200px 800px at 50% -10%, #1a2450 0%, var(--bg) 55%, #070a16 100%);
  color: var(--text); overflow: hidden; overscroll-behavior: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
.app { height: 100%; display: grid; grid-template-columns: minmax(220px, 270px) 1fr;
  gap: clamp(10px, 1.4vw, 18px); padding: clamp(10px, 1.4vw, 18px); }
.sidebar { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; }
.logo { font-size: 24px; color: var(--accent); text-shadow: 0 0 18px rgba(79,209,255,.55); }
.brand h1 { margin: 0; font-size: clamp(17px, 1.7vw, 21px); font-weight: 700; }
.hud { display: flex; flex-direction: column; gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; display: flex; align-items: baseline; justify-content: space-between; }
.stat .k { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
#score { color: var(--accent); }
.side-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.ghost { padding: 9px 14px; border-radius: 12px; font-size: 13px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-family: inherit;
  transition: background .18s, transform .12s; }
.ghost:hover { background: rgba(255,255,255,.09); }
.ghost:active { transform: scale(.97); }
.ghost.primary-action { color: #06101f; background: linear-gradient(135deg, var(--accent), #9fe8ff);
  border: none; font-weight: 700; }
.ghost[aria-pressed="false"] { color: var(--muted); }
.hint { font-size: 11px; color: var(--muted); line-height: 1.7; opacity: .8; }
.stage { position: relative; min-width: 0; min-height: 0; display: flex; align-items: center;
  justify-content: center; border-radius: 20px;
  background: radial-gradient(600px 400px at 50% 50%, rgba(79,209,255,.07), transparent 70%), var(--bg2);
  border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.45); overflow: hidden; touch-action: none; }
#game { display: block; width: 100%; height: 100%; }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(7,10,22,.72); backdrop-filter: blur(6px); z-index: 50; animation: fade .25s ease; }
.overlay.hidden, .hidden { display: none !important; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.card { text-align: center; padding: 26px 36px 30px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(28,38,74,.96), rgba(16,22,44,.96));
  border: 1px solid rgba(79,209,255,.3);
  box-shadow: 0 24px 70px rgba(0,0,0,.55); animation: pop .32s cubic-bezier(.18,1.2,.4,1); }
@keyframes pop { from { transform: scale(.86) translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
.icon { font-size: 44px; color: var(--accent); text-shadow: 0 0 26px rgba(79,209,255,.5); }
.card h2 { margin: 8px 0; font-size: 24px; letter-spacing: 1px; }
.card .line { margin: 0; color: var(--muted); font-size: 14px; }
.primary { margin-top: 18px; padding: 12px 34px; border-radius: 999px; font-size: 16px; font-weight: 700;
  color: #06101f; background: linear-gradient(135deg, var(--accent), #9fe8ff); border: none; cursor: pointer;
  font-family: inherit; box-shadow: 0 10px 28px rgba(79,209,255,.3); }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); gap: 8px; padding: 8px 8px 6px; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .brand h1 { font-size: 16px; } .logo { font-size: 18px; }
  .hud { flex-direction: row; flex: 1; gap: 5px; min-width: 0; }
  .stat { flex-direction: column; align-items: flex-start; gap: 0; padding: 5px 8px; flex: 1; min-width: 0; }
  .stat .k { font-size: 10px; } .stat .v { font-size: 15px; }
  .side-actions { order: 3; width: 100%; flex-direction: row; gap: 6px; margin-top: 0; }
  .side-actions .ghost { flex: 1; padding: 8px 4px; font-size: 11px; }
  .hint { display: none; } .stage { border-radius: 14px; }
}
