:root {
  --cyan: #67e8ff;
  --blue: #2e6dff;
  --green: #7dffb2;
  --danger: #ff4f76;
  --glass: rgba(2, 9, 28, .66);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #020718; font-family: system-ui, Segoe UI, sans-serif; color: white; touch-action: none; }
#game-root, #game-canvas { width: 100vw; height: 100vh; display: block; }
#game-canvas { background: radial-gradient(circle at center, #07183f 0, #020718 52%, #000 100%); }

.panel {
  position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); padding: 28px;
  border: 1px solid rgba(103, 232, 255, .42); border-radius: 24px;
  background: linear-gradient(180deg, rgba(7, 20, 58, .86), rgba(1, 4, 16, .8));
  box-shadow: 0 0 44px rgba(46,109,255,.32), inset 0 0 28px rgba(103,232,255,.07);
  text-align: center; backdrop-filter: blur(12px); z-index: 20;
}
.panel h1, .panel h2 { margin: 10px 0; letter-spacing: .04em; text-transform: uppercase; }
.panel p { line-height: 1.5; color: #ccecff; }
.logo { color: var(--cyan); font-weight: 900; letter-spacing: .14em; text-shadow: 0 0 16px rgba(103,232,255,.9); }
.logo.danger { color: var(--danger); text-shadow: 0 0 18px rgba(255,79,118,.9); }
.primary {
  margin: 16px 0 10px; padding: 14px 24px; border: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan)); color: #001126; font-weight: 900;
  box-shadow: 0 0 24px rgba(103,232,255,.5); cursor: pointer;
}
.panel small { display: block; color: #9acde1; }
.hidden { display: none !important; }

#hud {
  position: fixed; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: center; gap: 14px; z-index: 10; pointer-events: none;
}
#hud div, #pause-btn {
  min-width: 112px; padding: 8px 14px; border: 1px solid rgba(103,232,255,.35); border-radius: 14px;
  background: var(--glass); box-shadow: 0 0 18px rgba(46,109,255,.18); text-align: center;
}
#hud span { display: block; font-size: 11px; color: #8ddfff; letter-spacing: .14em; }
#hud strong { color: var(--green); font-size: 20px; font-family: ui-monospace, Consolas, monospace; }
#pause-btn { min-width: 48px; color: white; pointer-events: auto; cursor: pointer; }

#touch-controls { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.left-pad, .right-pad { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; gap: 14px; pointer-events: auto; }
.left-pad { left: max(20px, env(safe-area-inset-left)); }
.right-pad { right: max(20px, env(safe-area-inset-right)); }
.control {
  width: 66px; height: 66px; border-radius: 50%; border: 1px solid rgba(103,232,255,.55);
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.25), rgba(46,109,255,.38));
  color: #eaffff; font-size: 24px; font-weight: 900; box-shadow: 0 0 22px rgba(103,232,255,.32); backdrop-filter: blur(8px);
}
.control:active, .control.active { transform: scale(.94); background: radial-gradient(circle, rgba(125,255,178,.44), rgba(46,109,255,.45)); }
.rotate-icon { font-size: 56px; }

@media (orientation: portrait) and (max-width: 900px) {
  #rotate-panel:not(.hidden) { display: block !important; }
}
@media (max-height: 430px) {
  .panel { padding: 16px; }
  .panel h1 { font-size: 22px; }
  .panel p { margin: 8px 0; }
  .control { width: 58px; height: 58px; }
  #hud div { min-width: 88px; padding: 6px 10px; }
}
