:root { color-scheme: dark; --ink: #eef0ff; --dim: #9aa0bd; --edge: #ffffff1f; --accent: #3fd7a5; --gold: #ffd166; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0a0b12; color: var(--ink); font: 14px/1.3 ui-sans-serif, system-ui, -apple-system, sans-serif; overflow: hidden; -webkit-user-select: none; user-select: none; }
body { display: flex; flex-direction: column; height: 100dvh; }
.hud { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 10px 8px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; min-width: 54px; padding: 3px 10px; border: 1px solid var(--edge); border-radius: 10px; background: #12141f; }
.stat span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.stat strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.badge { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--edge); color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.badge[data-done="true"] { color: #062b1f; background: var(--accent); border-color: var(--accent); font-weight: 600; }
#solved[data-done="true"] { background: var(--gold); border-color: var(--gold); color: #2b2206; }
.spacer { flex: 1; }
button { min-height: 44px; border-radius: 22px; border: 1px solid var(--edge); background: #12141f; color: var(--ink); padding: 0 14px; font: inherit; font-weight: 600; touch-action: manipulation; }
button:disabled { opacity: .4; }
button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.stage { position: relative; flex: 1; min-height: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.toast { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); margin: 0; max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 14px; background: #12141fee; border: 1px solid var(--gold); color: var(--gold); font-weight: 600; text-align: center; }
.actions { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; border-radius: 28px; background: #12141fee; border: 1px solid var(--edge); }
.actions[hidden] { display: none; }
.dock { border-top: 1px solid var(--edge); background: #0e1018; padding: 6px 0 calc(env(safe-area-inset-bottom) + 6px); }
.hint { margin: 0 12px 6px; color: var(--dim); font-size: 12px; min-height: 16px; }
.tray { display: flex; gap: 14px; overflow-x: auto; padding: 2px 12px 4px; scrollbar-width: thin; }
.group { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); writing-mode: vertical-rl; transform: rotate(180deg); }
.piece { display: grid; place-items: center; gap: 2px; width: 48px; height: 48px; min-height: 48px; padding: 5px; border-radius: 10px; background: #1a1c27; }
.piece i { display: block; border-radius: 3px; box-shadow: inset 0 0 0 1px #0006; }
.piece.corner { grid-template-columns: 1fr 1fr; }
.piece.corner i { width: 15px; height: 15px; }
.piece.corner i:first-child { grid-column: 1 / span 2; }
.piece.edge { grid-template-columns: 1fr 1fr; }
.piece.edge i { width: 16px; height: 22px; }
.piece.center i { width: 26px; height: 26px; }
.piece[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: 1px; }
.empty { margin: 6px 0; color: var(--dim); }
@media (max-width: 480px) {
  .badge { padding: 5px 8px; font-size: 11px; }
  .actions button { padding: 0 10px; }
}
