/* Tetris page styles (used by game_tetris.html) */

.game-details {
    padding-top: 110px; /* avoid navbar overlap */
}

.tetris-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 12px 14px;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    font-weight: 600;
}

.tetris-stats .stat strong {
    color: var(--primary-color);
}

.tetris-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tetris-mode-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tetris-mode-selector .mode-btn {
    padding: 10px 14px;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    border: 1px solid rgba(26, 35, 126, 0.18);
}

.tetris-mode-selector .mode-btn:hover {
    transform: translateY(-1px);
    background-color: rgba(255, 255, 255, 1);
}

.tetris-mode-selector .mode-btn.active {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-color: transparent;
}

.tetris-extra-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.tetris-extra-stats .stat {
    white-space: nowrap;
}

.tetris-layout {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.tetris-board {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    aspect-ratio: 1 / 2;
    background-color: var(--tetris-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
}

#tetris-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.tetris-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
}

.tetris-overlay.active {
    display: flex;
}

.tetris-overlay-card {
    width: min(420px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--border-radius);
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.tetris-overlay-card h2 {
    margin-bottom: 8px;
}

.tetris-overlay-card p {
    margin-bottom: 14px;
    color: #444;
}

.tetris-overlay-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.tetris-side {
    display: grid;
    gap: 14px;
}

.panel {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.panel h3 {
    margin-bottom: 10px;
}

.mini-canvas {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    display: block;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    margin: 0 auto;
}

.hint {
    text-align: center;
    margin-top: 8px;
    color: #666;
    font-size: 0.95rem;
}

.controls-list {
    list-style: none;
    padding-left: 0;
    color: #444;
}

.controls-list li {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.controls-list li:last-child {
    border-bottom: none;
}

.tetris-touch {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 420px;
    margin: 14px auto 0;
}

.tetris-touch .control-btn {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tetris-touch .control-btn.secondary {
    background-color: var(--secondary-color);
}

.tetris-touch .control-btn.danger {
    background-color: var(--accent-color);
}

@media (max-width: 920px) {
    .tetris-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tetris-modes {
        justify-content: center;
    }

    .tetris-extra-stats {
        justify-content: center;
    }

    .tetris-touch {
        display: grid;
    }
}
