/* Tetris game. A standalone rules engine tracks the board, active piece, score, and timers; the page maps input to engine actions.
 * Page-specific layout and controls; shared theme colors are supplied by /Theme.css.
 */
html,body { margin: 0; min-height: 100%; }
body { min-height: 100dvh; }
#nav-placeholder { position: sticky; top: 0; z-index: 1030; background: var(--site-surface); }
.tetris-layout { display: grid; grid-template-columns: minmax(230px,400px) 280px; justify-content: center; gap: 24px; padding: 24px; }
#tetris-view { position: relative; width: 100%; aspect-ratio: 1 / 2; border: 1px solid var(--site-border); border-radius: 8px; overflow: hidden; background: var(--site-bg); }
#tetris-view > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tetris-panel { padding: 20px; border: 1px solid var(--site-border); border-radius: 8px; background: var(--site-surface); }
.tetris-panel h1 { font-size: 2rem; }.tetris-panel h2 { font-size: .85rem; color: var(--site-muted); }
#game-status { color: var(--site-accent); }
.stats { display: flex; justify-content: space-between; gap: 12px; }.stats dt { font-size: .75rem; color: var(--site-muted); }.stats dd { font-size: 1.3rem; margin-bottom: 0; }
.previews { display: flex; gap: 12px; }.previews section { flex: 1; min-width: 0; }.previews canvas { max-width: 100%; display: block; background: var(--site-bg); border-radius: 6px; }
.actions { display: flex; gap: 10px; margin: 16px 0; }.actions button { flex: 1; font-size: .85rem; }
.touch-controls { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 16px; }
.touch-controls button { min-height: 44px; touch-action: none; user-select: none; border: 1px solid var(--site-border); border-radius: 6px; color: var(--site-text); background: var(--site-raised); }
.touch-controls button:hover { color: var(--site-accent); background: var(--site-hover); }
.tetris-panel small { display: block; font-size: .75rem; color: var(--site-muted); line-height: 1.7; }
#game-overlay { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px; text-align: center; background: color-mix(in srgb,var(--site-bg) 90%,transparent); }
#game-overlay[hidden] { display: none; }#game-overlay h2 { font-size: 1.7rem; }#game-overlay p { color: var(--site-muted); }
#scene-error { position: absolute; inset: 20px; z-index: 3; padding: 20px; background: var(--site-surface); }
/* Stack or resize the project layout on narrower screens. */
@media (max-width: 650px) { .tetris-layout { grid-template-columns: minmax(0,1fr) 140px; gap: 10px; padding: 10px; }.tetris-panel { padding: 10px; }.tetris-panel h1 { font-size: 1.4rem; }.stats { flex-wrap: wrap; gap: 8px; }.stats dd { font-size: 1rem; }.previews { gap: 6px; }.actions { flex-direction: column; }.touch-controls { grid-template-columns: repeat(2,1fr); }.tetris-panel small { font-size: .65rem; } }
/* Stack or resize the project layout on narrower screens. */
@media (max-width: 380px) { .tetris-layout { grid-template-columns: minmax(0,1fr); } .tetris-panel { max-width: 100%; }.previews canvas { max-height: 110px; width: auto; }.touch-controls { grid-template-columns: repeat(3,1fr); } }
