* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #171923; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; letter-spacing: 0; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .42; }
button:focus-visible { outline: 3px solid #58d9d1; outline-offset: 3px; }
#game { position: relative; width: 100%; max-width: 600px; height: 100%; height: 100dvh; margin: auto; overflow: hidden; background: #202330; }
#board { display: block; width: 100%; height: 100%; touch-action: none; }
.hud { position: absolute; top: 0; left: 0; right: 0; padding: max(18px, env(safe-area-inset-top)) 22px 12px; display: flex; justify-content: space-between; gap: 12px; pointer-events: none; font-size: 13px; color: #ced0db; }
.hud strong { display: block; margin-top: 4px; font-size: 30px; color: #ff8a3d; }
.hud-right { display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
#status { color: #58d9d1; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom)); background: #11131ac7; }
.overlay[hidden], [hidden] { display: none !important; }
.panel { width: 100%; max-width: 350px; max-height: 100%; overflow-y: auto; border: 1px solid #575660; background: #292c38; border-radius: 8px; padding: 24px; }
h1, h2 { font-size: 23px; line-height: 1.4; margin: 0 0 10px; }
p { color: #c5c8d4; font-size: 14px; line-height: 1.7; margin: 8px 0 18px; }
.mode { display: flex; gap: 10px; margin: 20px 0; }
button { border-radius: 8px; min-height: 48px; border: 1px solid #5c606f; background: #393d4b; color: #fff; padding: 11px 16px; }
.mode button { flex: 1; padding: 10px 6px; }
.mode button[aria-pressed="true"], button.primary { background: #ff8a3d; border-color: #ff8a3d; color: #24170d; font-weight: 700; }
.mode small { display: block; font-size: 11px; margin-top: 5px; font-weight: 400; }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 22px; }
.levels button { padding: 8px 4px; }
.levels button.selected { border-color: #ff8a3d; color: #ffac75; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.stats { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0; }
.stats span { font-size: 13px; color: #c5c8d4; }
.stats strong { display: block; font-size: 28px; color: #ffad76; margin-top: 5px; }
#shield { position: absolute; top: 104px; left: 0; right: 0; text-align: center; color: #58d9d1; font-size: 15px; pointer-events: none; }
#notice { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 20px; right: 20px; text-align: center; font-size: 12px; margin: 0; pointer-events: none; }
@media (max-height: 560px) { .panel { padding: 16px; } .mode { margin: 10px 0; } .levels { margin-bottom: 10px; } }
