/* ====================================================
   Peyton Tetris — game-specific styles
   ==================================================== */

/* Layout: leaderboard | [hold] [canvas] [next+stats] */
.tetris-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    justify-content: center;
}

.tetris-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* ---- Meta row: hold | stats | next ---- */
.tetris-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.tetris-side-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.tetris-side-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--text-gray);
    text-transform: uppercase;
}

.tetris-preview-canvas {
    border: 1px solid rgba(201, 169, 68, 0.2);
    border-radius: 4px;
    background: #0b0b0b;
    width: 80px;
    height: 80px;
    display: block;
}

.tetris-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

/* Score and Best get full width each; Level and Lines share the second row */
.tetris-stats .stat-box {
    flex: unset;
    min-width: 0;
}

/* ---- Canvas ---- */
.tetris-board-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
}

.tetris-canvas {
    border: 1px solid rgba(201, 169, 68, 0.25);
    border-radius: 4px;
    background: #0b0b0b;
    display: block;
    /* width/height set dynamically by JS */
}

/* ---- Desktop hint ---- */
.tetris-hint-desktop {
    display: inline;
}

/* ---- Mobile controls ---- */
.tetris-mobile-controls {
    display: none;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    margin-top: 4px;
}

.tetris-btn-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.tetris-btn {
    flex: 1;
    min-height: 52px;
    background: rgba(201, 169, 68, 0.12);
    border: 1px solid rgba(201, 169, 68, 0.35);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1.3rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: background 0.1s;
}

.tetris-btn:active {
    background: rgba(201, 169, 68, 0.28);
}

.tetris-btn-wide {
    flex: 1.4;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

.tetris-btn-drop {
    background: rgba(201, 169, 68, 0.18);
}

/* ---- Responsive ---- */

/* Narrow: show mobile controls, hide keyboard hint */
@media (max-width: 600px) {
    .tetris-layout {
        flex-direction: column;
        align-items: center;
    }

    .tetris-hint-desktop {
        display: none;
    }

    .tetris-mobile-controls {
        display: flex;
    }

    .tetris-meta-row {
        gap: 8px;
    }

    .tetris-preview-canvas {
        width: 60px;
        height: 60px;
    }

    /* Hide sidebar leaderboard on mobile — it scrolls below instead */
    .tetris-layout .leaderboard-sidebar {
        display: none;
    }
}

/* Medium: no sidebar leaderboard, stack below */
@media (max-width: 900px) and (min-width: 601px) {
    .tetris-layout {
        flex-direction: column;
        align-items: center;
    }

    .tetris-layout .leaderboard-sidebar {
        display: none;
    }
}
