:root{color-scheme:light;--ink:#28233d;--muted:#89849a;--violet:#4b388e;--hot:#ef9be6;--mint:#63d6b0;--line:#e7e3ed}
*{box-sizing:border-box}
body{margin:0;background:#f7f6f9;color:var(--ink);font-family:var(--font)}
button,a{-webkit-tap-highlight-color:transparent}
.game-page{width:min(960px,100%);min-height:calc(100svh - 56px);margin:auto;padding:24px 30px 18px;display:flex;flex-direction:column}
.page-head{height:64px;display:flex;align-items:center;gap:17px;border-bottom:1px solid var(--line);padding-bottom:17px}
.icon-button{width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:var(--radius-sm);text-decoration:none;font-size:23px}
.page-head h1{font-size:21px;line-height:1.15;margin:0;font-weight:750}.page-head h1 span{font-weight:500;color:#827c91}
.eyebrow{font:10px "DM Mono",monospace;letter-spacing:1.5px;color:#958da5;margin:0 0 4px}
.icon-button{margin-left:auto;font-size:21px;cursor:pointer}.icon-button.muted{color:#aaa4b5}
.game-layout{display:grid;grid-template-columns:minmax(300px,420px) minmax(190px,1fr);gap:40px;align-items:center;justify-content:center;flex:1;padding:20px 0}
.cabinet{width:100%;max-width:420px;justify-self:center;background:#35266f;border:7px solid #49378a;border-radius:4px;box-shadow:0 12px 30px #33235a22, inset 0 0 0 1px #8263c8;padding:10px 10px 8px;color:#fff}
.hud{height:74px;display:grid;grid-template-columns:.7fr 1.3fr .7fr 72px;align-items:center;gap:7px;padding:0 4px 8px;font-family:"DM Mono",monospace}
.hud>div:not(.next-piece){display:flex;flex-direction:column;gap:4px}.hud span{font-size:9px;color:#d4c9f0;letter-spacing:.6px}.hud strong{font-size:15px;font-weight:500;color:#fff}.hud .score strong{font-size:18px}
.next-piece{height:64px;border:1px solid #7159b0;background:#3e2f7e;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0}.next-piece canvas{width:48px;height:48px}
.board-wrap{position:relative;overflow:hidden;background:#261d55;border:1px solid #7865b5;line-height:0}
#board{display:block;width:100%;height:auto;aspect-ratio:1/2;touch-action:none}
.game-overlay{position:absolute;inset:0;display:grid;place-items:center;background:#21194ac9;backdrop-filter:blur(2px);line-height:1.4;transition:opacity .2s ease}
.game-overlay.hidden{opacity:0;pointer-events:none}.overlay-card{width:min(82%,300px);padding:22px 20px 20px;text-align:center;border:1px solid #9479ce;background:#382875;box-shadow:0 10px 35px #17103566}
.overlay-mark{font-size:30px;color:#f3a1e9}.overlay-card h2{font-size:19px;margin:6px 0;color:#fff}.overlay-card p{font-size:12px;line-height:1.6;color:#d1c6ec;margin:0 0 17px}.primary-button{width:100%;height:42px;border:0;background:#ee9de4;color:#352460;font-weight:750;font-size:14px;cursor:pointer;border-radius:var(--radius-sm)}.primary-button:hover{background:#ffc0f4}
.cabinet-foot{height:20px;display:flex;align-items:end;justify-content:space-between;font:8px "DM Mono",monospace;letter-spacing:.4px;color:#c6b8e8}.cabinet-foot b{color:#ffb5ed;font-weight:500}
.side-panel{width:100%;max-width:290px;justify-self:center;align-self:center}.mission{height:38px;display:flex;align-items:center;gap:8px;font-size:12px;color:#777185;border-bottom:1px solid var(--line);white-space:nowrap}.mission b{font-weight:700;color:var(--ink)}.live-dot{width:7px;height:7px;border-radius:50%;background:#c4bdcc}.live-dot.active{background:#5bcea7;box-shadow:0 0 0 3px #5bcea722}.mission-rule{height:14px;border-left:1px solid var(--line);margin:0 4px}
.next-info{padding:22px 0 24px}.next-info>div:first-child{display:flex;align-items:baseline;justify-content:space-between}.label{font-size:13px;color:#777185}.next-info strong{font:14px "DM Mono",monospace;color:var(--violet)}.surge-meter{height:5px;margin-top:11px;background:#e7e2ed;overflow:hidden}.surge-meter i{display:block;width:0;height:100%;background:#e997df;transition:width .2s}
.pause-button{width:100%;height:42px;border:1px solid #dcd7e5;background:#fff;color:#4b455d;border-radius:var(--radius-sm);font-size:13px;cursor:pointer}.pause-button span{font-weight:bold;margin-right:5px}.pause-button:disabled{opacity:.45;cursor:default}.desktop-hint{font-size:11px;color:#a09aaa;margin:14px 0 0;text-align:center;white-space:nowrap}
.touch-controls{display:none}.page-foot{height:34px;border-top:1px solid var(--line);display:flex;align-items:end;justify-content:space-between;color:#9993a4;font-size:11px}
@media(max-width:680px){.game-page{min-height:100svh;padding:12px 14px calc(12px + env(safe-area-inset-bottom))}.page-head{height:53px;padding-bottom:9px;gap:10px}.page-head h1{font-size:18px}.eyebrow{font-size:8px}.icon-button{width:34px;height:34px}.game-layout{display:flex;flex:1;min-height:0;padding:12px 0 10px;gap:0;align-items:center;justify-content:center}.cabinet{height:min(67svh,690px);width:auto;max-width:100%;aspect-ratio:1/2;display:flex;flex-direction:column;padding:7px 7px 6px;border-width:5px}.hud{height:56px;flex:none;grid-template-columns:.7fr 1.3fr .7fr 48px;gap:4px;padding:0 2px 5px}.hud span{font-size:7px}.hud strong{font-size:12px}.hud .score strong{font-size:14px}.next-piece{height:47px}.next-piece canvas{width:37px;height:37px}.board-wrap{flex:1;min-height:0;display:flex;align-items:center}.board-wrap #board{height:100%;width:100%;object-fit:fill}.cabinet-foot{height:16px;font-size:6px;flex:none}.side-panel{display:none}.touch-controls{display:flex;align-items:stretch;justify-content:center;gap:9px;height:72px;padding:5px 0 7px}.touch-controls button{min-width:62px;border:1px solid #ddd8e6;background:#fff;color:#514a63;border-radius:var(--radius-sm);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;font-size:25px;touch-action:none;user-select:none}.touch-controls button:active{background:#eee8f8;border-color:#9b89c1}.touch-controls small{font-size:10px}.move-controls{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.move-controls button{min-width:47px;font-size:22px}.page-foot{height:24px;font-size:9px;align-items:end}.page-foot span:last-child{max-width:55%;text-align:right}}
@media(max-height:700px) and (max-width:680px){.cabinet{height:61svh}.touch-controls{height:64px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}
