:root {
    --bg-color: #0f172a;
    --player-color: #22d3ee;
    --cpu-color: #f472b6;
    --puck-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    touch-action: none;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: white;
    overflow: hidden;
    height: calc(var(--vh, 1vh) * 100);
    width: 100vw;
}

/* ====== MAIN CONTAINER — matches class="app-container" in HTML ====== */
.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    gap: 6px;
}

/* ====== HEADER / SCOREBOARD ====== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.powerup-legend-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    margin-top: 6px;
    text-align: left;
}

.pu-row {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.85;
}

.pu-row span {
    font-size: 1rem;
}

.pu-row.bad {
    color: #f87171;
}

header {
    padding: 6px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    width: 100%;
    max-width: 500px;
}

h1 {
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--player-color), var(--cpu-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.scoreboard {
    display: flex;
    gap: 24px;
}

/* matches class="score-card" in HTML */
.score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-card .label {
    font-size: 0.7rem;
    opacity: 0.6;
    letter-spacing: 1px;
}

.score-card .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--player-color);
    text-shadow: 0 0 10px var(--player-color);
}

.score-card:last-child .value {
    color: var(--cpu-color);
    text-shadow: 0 0 10px var(--cpu-color);
}

/* ====== GAME AREA — matches class="game-area" in HTML ====== */
.game-area {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 500px;
    position: relative;
    background: #050a15;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ====== OVERLAY / MENU ====== */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.92);
    z-index: 10;
}

.menu {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 380px;
    width: 90%;
}

.menu p {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ====== SETTINGS UI ====== */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.settings-group label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    color: rgba(255, 255, 255, 0.5);
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

.diff-btn {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    border-radius: 0.6rem;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.diff-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.diff-btn.active,
.mode-btn.active {
    background: var(--player-color);
    border-color: var(--player-color);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 12px var(--player-color);
}

.mode-btn {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    border-radius: 0.6rem;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#win-score,
#time-limit {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    outline: none;
}

/* ====== BUTTONS ====== */
.primary-btn {
    background: white;
    color: black;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.secondary-btn {
    background: transparent;
    color: white;
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ====== FOOTER ====== */
footer {
    padding: 6px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    width: 100%;
    max-width: 500px;
}

/* ====== MOBILE ====== */
@media (max-height: 700px) {
    header {
        padding: 4px 12px;
    }

    .score-card .value {
        font-size: 1.2rem;
    }

    .score-card .label {
        font-size: 0.6rem;
    }

    footer {
        padding: 4px;
        gap: 6px;
    }

    .secondary-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

@media (max-width: 400px) {
    .secondary-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .app-container {
        padding: 4px;
        gap: 4px;
    }
}