/* Fun fonts from Google */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;700&display=swap');

/* ===== CSS Variables - Easy to change colors! ===== */
:root {
    --court-green: #2d8a4e;
    --court-dark: #1a5c32;
    --accent-yellow: #f5c842;
    --accent-pink: #E91E63;
    --text-light: #ffffff;
    --text-dark: #1a1a2e;
    --bg-gradient-start: #0f2027;
    --bg-gradient-mid: #203a43;
    --bg-gradient-end: #2c5364;
}

/* ===== Base Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Make filled icons the default */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ===== Page Background - Stadium night sky ===== */
body {
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
    display: flex;
    justify-content: center;
    padding: 10px;
    color: var(--text-light);
}

/* ===== Game Container ===== */
.game-container {
    max-width: 540px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ===== Header ===== */
header {
    text-align: center;
    width: 100%;
}

/* Back button to return to game portal */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-yellow);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95em;
    margin-bottom: 8px;
    transition: opacity 0.2s;
}

.back-button:hover {
    opacity: 0.8;
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8em;
    color: var(--accent-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

h1 .material-symbols-rounded {
    font-size: 36px;
    color: #7ccf4e;
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1em;
    margin-top: 4px;
}

/* ===== Score Board ===== */
.score-board {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px 20px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-score,
.opponent-score {
    text-align: center;
    flex: 1;
}

.player-label {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1em;
    display: block;
    margin-bottom: 2px;
}

.player-score .player-label {
    color: #4fc3f7;
}

.opponent-score .player-label {
    color: #ef5350;
}

.score-detail {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
}

.vs {
    font-family: 'Fredoka One', cursive;
    font-size: 1em;
    color: var(--accent-yellow);
}

/* ===== Canvas Wrapper ===== */
main {
    position: relative;
    width: 500px;
    max-width: 100%;
}

#game-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===== Overlays (Start, Point, Match Over) ===== */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2em;
    color: var(--accent-yellow);
    display: flex;
    align-items: center;
    gap: 10px;
}

.overlay .title-icon {
    font-size: 40px;
    color: #7ccf4e;
}

.overlay p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
    text-align: center;
    padding: 0 20px;
}

/* ===== Difficulty Buttons ===== */
.difficulty-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 22px;
    border: none;
    border-radius: 14px;
    font-family: 'Fredoka One', cursive;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
}

.difficulty-btn:hover {
    transform: scale(1.08);
}

.difficulty-btn .material-symbols-rounded {
    font-size: 32px;
}

.difficulty-btn.easy {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.difficulty-btn.medium {
    background: linear-gradient(135deg, #FF9800, #FFB74D);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.difficulty-btn.hard {
    background: linear-gradient(135deg, #f44336, #EF5350);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

/* ===== Play / Continue Button ===== */
.play-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

/* ===== Instructions ===== */
.instructions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85em;
    text-align: center;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 8px;
}

.created-by {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1em;
    padding: 8px 24px;
    color: #fff;
    background: linear-gradient(135deg, #E91E63, #FF4081);
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

.created-by .material-symbols-rounded {
    font-size: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
    main {
        width: 100%;
    }

    h1 {
        font-size: 1.4em;
    }

    .difficulty-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .score-board {
        padding: 8px 12px;
        font-size: 0.9em;
    }
}
