/* Tetris Game - Premium Redesign */

/* Page Layout */
.page-wrapper {
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Navigation */
.game-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(10, 15, 37, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-home {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-home:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.nav-icon {
    font-size: 18px;
}

.nav-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #3b82f6 20%, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-spacer {
    width: 100px;
}

/* Main Layout */
.game-main {
    display: flex;
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sidebar */
.game-sidebar {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex-shrink: 0;
}

.info-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.info-row.highlight {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
}

.info-value {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.info-value.accent {
    color: #3b82f6;
}

.info-value.gold {
    color: #fbbf24;
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-play {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-play:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-pause {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.btn-pause:hover:not(:disabled) {
    background: rgba(251, 191, 36, 0.2);
}

.btn-reset {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.18);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-xl {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-icon {
    font-size: 16px;
}

/* Game Center */
.game-center {
    display: flex;
    justify-content: center;
}

.canvas-container {
    position: relative;
    background: linear-gradient(145deg, rgba(20, 30, 60, 0.95), rgba(10, 15, 35, 0.98));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(59, 130, 246, 0.08);
}

#game-canvas {
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.03), transparent 70%), #080c1a;
    border-radius: 12px;
    display: block;
}

/* Right Panel */
.preview-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.preview-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 14px;
}

.preview-canvas-wrap {
    display: flex;
    justify-content: center;
}

#next-canvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.controls-guide {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
}

.guide-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 14px;
}

.guide-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.guide-key {
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #60a5fa;
    min-width: 45px;
    text-align: center;
}

.guide-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

/* Overlays */
.overlay-panel,
.game-over {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 25, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 18px;
    z-index: 50;
}

.overlay-panel.hidden,
.game-over.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 28px;
    max-width: 280px;
}

.overlay-emoji {
    font-size: 56px;
    margin-bottom: 14px;
}

.overlay-title {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 10px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overlay-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 20px;
}

.final-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 18px;
}

.final-stat {
    text-align: center;
}

.fs-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.fs-value {
    font-size: 26px;
    font-weight: 800;
    color: #60a5fa;
}

.new-record {
    font-size: 16px;
    font-weight: 700;
    color: #fbbf24;
    margin: 14px 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.85;
        transform: scale(1.05);
    }
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    flex-direction: column;
    gap: 12px;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: rgba(10, 15, 37, 0.95);
    backdrop-filter: blur(12px);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mobile-btn {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mobile-btn:active {
    transform: scale(0.92);
    background: rgba(59, 130, 246, 0.3);
}

.mobile-btn.rotate {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.mobile-btn.drop {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}

.mobile-btn.pause {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.25);
}

/* Recommendations */
.recommendations-section {
    max-width: 800px;
    margin: 48px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #fff;
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.game-card-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.game-card-mini:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-4px);
}

.card-icon {
    font-size: 30px;
}

.card-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* Responsive */
@media (max-width: 900px) {
    .game-main {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .game-sidebar.left {
        order: 2;
        width: 100%;
        max-width: 330px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .game-sidebar.left .info-card {
        flex: 1;
        min-width: 150px;
    }

    .game-sidebar.left .action-buttons {
        flex: 1;
        min-width: 150px;
    }

    .game-center {
        order: 1;
    }

    .game-sidebar.right {
        order: 3;
        width: 100%;
        max-width: 330px;
        flex-direction: row;
    }

    .game-sidebar.right .preview-box,
    .game-sidebar.right .controls-guide {
        flex: 1;
    }

    .mobile-controls {
        display: flex;
    }
}

@media (max-width: 400px) {
    #game-canvas {
        width: 260px;
        height: 520px;
    }

    .canvas-container {
        padding: 10px;
    }

    .mobile-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}