/* Game Hub Styles */
:root {
    --game-primary: #6c5ce7;
    --game-secondary: #a29bfe;
    --game-bg: #dfe6e9;
    --game-card-bg: #ffffff;
    --game-text: #2d3436;
}

.games-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: var(--game-card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--game-text);
}

.game-desc {
    font-size: 0.9rem;
    color: #636e72;
    margin-bottom: 1rem;
}

/* Modal / Game Screen */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    /* hidden by default */
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.game-modal.active {
    display: flex;
}

.game-frame {
    background: #000;
    width: 95%;
    max-width: 1280px;
    height: 85vh;
    min-height: 600px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.game-header-bar {
    height: 50px;
    background: #2d3436;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    color: #fff;
}

.game-header-title {
    font-weight: bold;
}

.game-controls-top {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--game-secondary);
}

.game-canvas-area {
    flex: 1;
    position: relative;
    background: #1e272e;
    /* universal dark bg */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-start {
    background: var(--game-primary);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    font-weight: bold;
}

.btn-start:hover {
    background: #5d4de1;
    transform: scale(1.05);
}

.hud-score {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-frame {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}