/* game-styles.css */
:root {
    --bg-dark: #030712;
    --card-bg: rgba(15, 23, 42, 0.8);
    --accent-cyan: #00ffcc;
    --accent-pink: #ff007f;
    --accent-purple: #a855f7;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.stars-bg {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, rgba(168, 85, 247, 0.15), rgba(3, 7, 18, 0.95));
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Header */
.game-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: white;
    transform: translateX(-4px);
}

.hub-logo {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: var(--accent-pink);
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sfx-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sfx-btn:hover {
    background: rgba(0, 255, 204, 0.2);
    transform: scale(1.08);
}

/* Main Hub Content */
.hub-main {
    flex-grow: 1;
    position: relative;
    z-index: 1;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.hub-hero {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.hub-badge {
    display: inline-block;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    color: var(--accent-cyan);
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.hub-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hub-hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Game Selector Cards Grid */
.game-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.game-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    position: relative;
}

.game-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 255, 204, 0.2);
}

.game-card.active {
    border-color: var(--accent-pink);
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.3);
}

.game-card-icon {
    font-size: 2.5rem;
    color: var(--accent-cyan);
}

.game-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
}

.game-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    flex-grow: 1;
}

.btn-play {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    padding: 0.8rem 1.6rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-play:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 20px rgba(0, 255, 204, 0.4);
}

/* Arcade Screen Container */
.arcade-screen-container {
    background: #080c18;
    border: 2px solid var(--accent-cyan);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 255, 204, 0.25);
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

.screen-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mac-buttons {
    display: flex;
    gap: 8px;
}
.mac-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.mac-buttons .close { background: #ff5f56; }
.mac-buttons .minimize { background: #ffbd2e; }
.mac-buttons .maximize { background: #27c93f; }

.screen-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    color: var(--accent-cyan);
}

.screen-score {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.85rem;
    color: var(--accent-pink);
}

.screen-body {
    position: relative;
    display: flex;
    justify-content: center;
    background: #000;
}

#hubCanvas {
    width: 100%;
    height: auto;
    aspect-ratio: 800 / 420;
    display: block;
    background: #030712;
    touch-action: none;
}

.screen-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    text-align: center;
    padding: 2rem;
}

.screen-overlay h2 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    color: var(--accent-pink);
    text-shadow: 0 0 15px rgba(255, 0, 127, 0.6);
}

.screen-overlay p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 450px;
}

.btn-start-game {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    border: none;
    color: white;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.85rem;
    padding: 1.2rem 2.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.5);
}

.btn-start-game:hover {
    transform: scale(1.08);
    box-shadow: 0 0 35px rgba(255, 0, 127, 0.8);
}

/* Touch Controls Container */
.touch-controls-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(3, 7, 18, 0.95);
    border-top: 1px solid rgba(0, 255, 204, 0.2);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.touch-dpad {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.touch-actions {
    display: flex;
    align-items: center;
}

.touch-btn {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(0, 255, 204, 0.4);
    color: var(--accent-cyan);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.65rem 0.95rem;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    min-width: 58px;
    min-height: 44px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.touch-btn:active,
.touch-btn.active {
    background: rgba(0, 255, 204, 0.25);
    border-color: var(--accent-cyan);
    color: #ffffff;
    transform: scale(0.94);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.6);
}

.touch-btn-action {
    background: linear-gradient(135deg, rgba(255, 0, 127, 0.25), rgba(168, 85, 247, 0.35));
    border-color: var(--accent-pink);
    color: #ffffff;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.3);
}

.touch-btn-action:active,
.touch-btn-action.active {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.8);
    transform: scale(0.94);
}

.screen-controls-footer {
    background: rgba(0, 0, 0, 0.6);
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.screen-controls-footer strong {
    color: var(--accent-cyan);
}

.game-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile & Touch Responsive Styles (<768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .game-header {
        padding: 0.75rem 0;
    }

    .hub-logo {
        font-size: 0.62rem;
        white-space: nowrap;
    }

    .back-link {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .hub-main {
        padding: 1.5rem 0.25rem;
        gap: 2rem;
    }

    .hub-hero h1 {
        font-size: 2rem;
    }

    .hub-hero p {
        font-size: 0.95rem;
    }

    .game-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .game-card {
        padding: 1.25rem;
    }

    .arcade-screen-container {
        border-radius: 16px;
    }

    .screen-header {
        padding: 0.75rem 1rem;
    }

    .screen-title {
        font-size: 0.68rem;
    }

    .screen-score {
        font-size: 0.72rem;
    }

    #hubCanvas {
        width: 100%;
        height: auto;
        aspect-ratio: 800 / 420;
    }

    .screen-overlay {
        padding: 1.25rem;
    }

    .screen-overlay h2 {
        font-size: 1.1rem;
    }

    .screen-overlay p {
        font-size: 0.85rem;
    }

    .btn-start-game {
        font-size: 0.75rem;
        padding: 0.9rem 1.5rem;
    }

    .touch-controls-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0.75rem 0.85rem;
    }

    .touch-dpad {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3rem;
        width: 100%;
    }

    .touch-btn {
        padding: 0.5rem 0.15rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        justify-content: center !important;
    }

    .touch-actions {
        width: 100%;
    }

    .touch-btn-action {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.65rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    .screen-controls-footer {
        flex-direction: column;
        gap: 0.4rem;
        text-align: center;
        padding: 0.75rem 1rem;
    }
}
