:root { color-scheme: light dark; }
html, body { overscroll-behavior: none; }
* { box-sizing: border-box; }
body { margin: 0; background: #0b0e14; color: #e6e1cf; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Helvetica, Arial; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #1f2937; }
.topbar h1 { margin: 0; font-size: 18px; }
.back { color: #94a3b8; text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.controls { display: grid; gap: 10px; margin-bottom: 12px; }
.mode { display: flex; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.muted { color: #94a3b8; font-size: 14px; }
.help { margin-top: 6px; }
button { background: #0f172a; color: inherit; border: 1px solid #1f2937; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
button:hover { border-color: #475569; }
.primary { background: #1d4ed8; border-color: #1d4ed8; color: white; }
input { background: #0f172a; color: inherit; border: 1px solid #1f2937; border-radius: 10px; padding: 8px 12px; min-width: 140px; }
.hidden { display: none; }
.game { position: relative; display: grid; place-items: center; min-height: calc(100svh - var(--header-h, 56px)); }
canvas { width: 100%; height: auto; background: #0b0e14; border: 1px solid #1f2937; border-radius: 12px; display: block; touch-action: none; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #94a3b8; pointer-events: none; font-size: 18px; text-align: center; padding: 12px; }
.overlay.interactive { background: rgba(0,0,0,0.5); pointer-events: auto; color: #e6e1cf; }
.overlay .panel { background: rgba(15,23,42,0.9); border: 1px solid #1f2937; border-radius: 12px; padding: 18px 20px; min-width: 260px; max-width: 90%; }
.overlay .actions { margin-top: 12px; display: flex; gap: 10px; justify-content: center; }

/* Landscape-only hint on mobile */
.rotate-hint { display: none; position: fixed; inset: 0; z-index: 5; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.rotate-hint .panel { background: rgba(15,23,42,0.9); border:1px solid #1f2937; color:#e6e1cf; border-radius: 12px; padding: 16px 18px; max-width: 420px; }
@media (orientation: portrait) and (pointer: coarse) {
  .rotate-hint { display: flex; }
  .game { filter: blur(2px); pointer-events: none; }
}
