/* =========================================
   GAMES SECTION
========================================= */

.games-section {
    padding: 120px 7%;
    background: #080808;
    color: #f5f5f5;
    border-top: 1px solid #222;
}

.games-intro {
    max-width: 700px;
    margin: 0 auto 60px;
    text-align: center;
}

.games-intro p {
    color: #999;
    font-size: 16px;
    line-height: 1.8;
}

/* Games Grid */

.games-grid {
    max-width: 1100px;
    margin: auto;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Game Card */

.game-card {
    position: relative;

    min-height: 330px;
    padding: 40px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    text-decoration: none;
    color: inherit;

    background: #0d0d0d;
    border: 1px solid #292929;

    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}

.game-card:hover {
    transform: translateY(-6px);
    border-color: #666;
    background: #111;
}

.game-card-number {
    font-family: monospace;
    font-size: 13px;
    color: #666;
}

.game-card-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.game-card-content > span:first-child {
    margin-bottom: 10px;

    font-family: monospace;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;

    color: #777;
}

.game-card h3 {
    margin: 0 0 15px;

    font-size: 32px;
    font-weight: 500;
    letter-spacing: -1px;
}

.game-card p {
    max-width: 450px;
    margin: 0 0 30px;

    color: #888;
    line-height: 1.7;
}

.game-card-link {
    font-family: monospace;
    font-size: 13px;

    color: #ddd !important;

    transition: transform 0.25s ease;
}

.game-card:hover .game-card-link {
    transform: translateX(6px);
}

/* =========================================
   GAME PAGE
========================================= */

.game-page {
    min-height: 100vh;
    padding: 40px 20px;

    background: #080808;
    color: #eee;
}

.game-page-header {
    width: min(1100px, 100%);
    margin: 0 auto 30px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-page-title h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
}

.game-page-title p {
    margin: 8px 0 0;
    color: #777;
}

.back-button {
    padding: 10px 16px;

    color: #ccc;
    text-decoration: none;

    border: 1px solid #333;

    font-family: monospace;
    font-size: 13px;

    transition: 0.2s ease;
}

.back-button:hover {
    background: #eee;
    color: #080808;
}

/* Game Container */

.game-wrapper {
    width: min(1100px, 100%);
    margin: auto;

    padding: 25px;

    background: #0d0d0d;
    border: 1px solid #292929;
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 25px;
}

/* Canvas */

.game-canvas-container {
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 600px;

    background: #050505;
    border: 1px solid #222;

    overflow: hidden;
}

.game-canvas {
    display: block;

    max-width: 100%;
    max-height: 80vh;

    image-rendering: pixelated;
}

/* Sidebar */

.game-sidebar {
    padding: 20px;

    background: #0a0a0a;
    border: 1px solid #222;
}

.game-stat {
    padding: 18px 0;
    border-bottom: 1px solid #222;
}

.game-stat:last-child {
    border-bottom: 0;
}

.game-stat-label {
    display: block;

    margin-bottom: 6px;

    color: #666;

    font-family: monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-stat-value {
    font-family: monospace;
    font-size: 25px;
}

.game-button {
    width: 100%;

    margin-top: 12px;
    padding: 13px;

    background: #eee;
    color: #080808;

    border: 0;

    font-family: monospace;
    font-size: 13px;

    cursor: pointer;

    transition: 0.2s ease;
}

.game-button:hover {
    background: #bbb;
}

.game-button.secondary {
    background: transparent;
    color: #bbb;
    border: 1px solid #333;
}

/* Overlay */

.game-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.75);
}

.game-overlay.hidden {
    display: none;
}

.game-overlay-box {
    width: min(350px, 90%);

    padding: 35px;

    text-align: center;

    background: #0c0c0c;
    border: 1px solid #444;
}

.game-overlay-box h2 {
    margin: 0 0 10px;
    font-size: 28px;
}

.game-overlay-box p {
    margin-bottom: 25px;
    color: #888;
}

/* Mobile controls */

.game-controls {
    display: none;

    grid-template-columns: repeat(3, 1fr);
    gap: 8px;

    margin-top: 15px;
}

.game-control {
    padding: 14px;

    background: #111;
    color: #ddd;

    border: 1px solid #333;

    font-family: monospace;
    font-size: 18px;

    cursor: pointer;
}

.game-control:active {
    background: #ddd;
    color: #080808;
}

/* Responsive */

@media (max-width: 850px) {

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .game-canvas-container {
        min-height: auto;
    }

    .game-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .game-sidebar .game-button {
        margin-top: 0;
    }

    .game-controls {
        display: grid;
    }
}

@media (max-width: 600px) {

    .games-section {
        padding: 80px 5%;
    }

    .game-card {
        min-height: 280px;
        padding: 28px;
    }

    .game-card h3 {
        font-size: 27px;
    }

    .game-page {
        padding: 20px 10px;
    }

    .game-page-header {
        align-items: flex-start;
        gap: 15px;
    }

    .game-page-title h1 {
        font-size: 25px;
    }

    .game-wrapper {
        padding: 10px;
    }

    .game-sidebar {
        grid-template-columns: 1fr 1fr;
    }
}