:root { --tetris-well: #233f4b; }
body { background: #f1f6f7; }
.tetris-page .game-layout { grid-template-columns: minmax(0, 1.32fr) minmax(300px, 1fr); max-width: 1060px; }
.tetris-page .game-brand { font-size: 29px; letter-spacing: 1px; color: #286a79; }
.game-brand > span { display: block; margin-top: 7px; color: #84999f; font-size: 10px; font-weight: 400; letter-spacing: 0; }
.tetris-stage { display: grid; grid-template-columns: minmax(0, 300px) minmax(88px, 1fr); gap: 22px; padding: 18px; border: 1px solid #dce9ec; border-radius: 16px; background: #edf4f5; }
.tetris-board { display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(20, 1fr); width: 100%; aspect-ratio: 1 / 2; padding: 4px; overflow: hidden; border: 1px solid #385562; border-radius: 8px; background: var(--tetris-well); box-shadow: inset 0 2px 12px #0b23352b; touch-action: pan-y; }
.tetris-cell { min-width: 0; min-height: 0; border: 1px solid #ffffff07; border-radius: 2px; }
.tetris-cell.filled, .mini-cell.filled { background: var(--block); border: 1px solid #ffffff40; box-shadow: inset 2px 2px 0 #ffffff30, inset -2px -2px 0 #00000014; }
[data-value="1"] { --block: #5cbcc8; } [data-value="2"] { --block: #6994d2; } [data-value="3"] { --block: #e2aa72; } [data-value="4"] { --block: #d7c175; } [data-value="5"] { --block: #7dbfa0; } [data-value="6"] { --block: #aa91c8; } [data-value="7"] { --block: #d48e9b; }
.tetris-cell.ghost { border: 1px dashed #a3c6ce; background: #8dbbc215; box-shadow: none; }
.tetris-sidebar { display: flex; flex-direction: column; gap: 15px; min-width: 0; padding: 5px 0; }
.next-panel h2 { margin: 0 0 12px; color: #718b93; font-size: 11px; font-weight: 500; }
.next-pieces { display: grid; gap: 12px; }
.next-piece { display: grid; grid-template-columns: repeat(4, 16px); grid-template-rows: repeat(2, 16px); justify-content: center; gap: 2px; min-height: 34px; }
.next-piece:not(:first-child) { opacity: .65; }
.mini-cell { border-radius: 3px; }
.tetris-stat { padding-top: 12px; border-top: 1px solid #d9e6e9; }
.tetris-stat span { display: block; color: #7c939b; font-size: 10px; }
.tetris-stat strong { display: block; margin-top: 5px; font-size: 25px; color: #365f6e; font-variant-numeric: tabular-nums; }
.speed-track { height: 4px; overflow: hidden; border-radius: 5px; background: #d9e6e9; }
.speed-track span { display: block; height: 100%; width: 0; background: #639ca5; }
.level-hint, .ghost-hint { margin: -5px 0 0; color: #607e88; font-size: 10px; line-height: 1.8; }
.tetris-sidebar .button { padding: 10px 5px; font-size: 12px; }
.tetris-sidebar .secondary { border: 1px solid #d5e2e6; background: #f9fcfc; }
.ghost-hint { margin-top: auto; }
.tetris-controls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.tetris-controls button { min-height: 55px; border: 1px solid #dce8ec; border-radius: 9px; background: #f4f8f9; color: #436c7b; font-size: 23px; line-height: 1.1; touch-action: none; user-select: none; -webkit-user-select: none; }
.tetris-controls button span { display: block; margin-top: 4px; font-size: 10px; }
.tetris-controls button:active { background: #dcecef; }
.tetris-page .game-overlay { padding: 16px; background: #edf5f4f0; }
.tetris-page .game-overlay h2 { font-size: 23px; }
.tetris-page .game-overlay p { color: #527a7d; font-size: 12px; }
@media (max-width: 900px) { .tetris-page .game-layout { grid-template-columns: 1fr; max-width: 560px; } .tetris-page .side-column { grid-template-rows: auto auto; } }
@media (max-width: 575.98px) { .tetris-page .game-brand { font-size: 26px; } .game-brand > span { font-size: 9px; } .tetris-stage { gap: 14px; padding: 12px; grid-template-columns: minmax(0, 1fr) 86px; } .tetris-sidebar { gap: 12px; } .tetris-page .board-caption { flex-wrap: wrap; font-size: 9px; } }
@media (max-width: 360px) { .tetris-page .game-card { padding: 12px; } .tetris-stage { padding: 8px; gap: 10px; grid-template-columns: minmax(0, 1fr) 72px; } .tetris-sidebar { gap: 9px; } .next-piece { grid-template-columns: repeat(4, 13px); grid-template-rows: repeat(2, 13px); min-height: 28px; } .tetris-stat strong { font-size: 21px; } .ghost-hint { display: none; } }
/* Keep the overlay on the playfield; compact the info rail on narrow phones. */
.tetris-stage > .board-wrap { align-self: start; }
@media (max-width: 575.98px) {
    .tetris-sidebar { gap: 10px; }
    .next-panel h2 { margin-bottom: 8px; }
    .next-pieces { gap: 8px; }
    .next-piece { grid-template-columns: repeat(4, 13px); grid-template-rows: repeat(2, 13px); min-height: 28px; }
    .tetris-stat { padding-top: 8px; }
    .tetris-stat strong { font-size: 21px; }
    .level-hint, .ghost-hint { display: none; }
}
