/* ===== Aussieevault THEME ===== */
:root {
    --play-navy: #0f172a;
    --play-navy-mid: #1e293b;
    --play-accent: #2563eb;
    --play-accent-hover: #1d4ed8;
    --play-bg: #f8fafc;
    --play-white: #fff;
}

/* ===== GENERAL STYLING ===== */

body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
    background: var(--play-navy);
    color: var(--play-white);
}

/* ===== WELCOME SCREEN ONLY ===== */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, var(--play-navy-mid) 0%, var(--play-navy) 70%, #0a0f1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    gap: 32px;
    box-shadow: 0 0 60px 10px rgba(37, 99, 235, 0.25);
    overflow: hidden;
    animation: welcomeFadeIn 0.8s ease-out;
}

@keyframes welcomeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.welcome-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.12;
    background-image:
        repeating-linear-gradient(0deg, var(--play-accent) 0px, var(--play-accent) 6px, transparent 6px, transparent 64px),
        repeating-linear-gradient(90deg, var(--play-accent-hover) 0px, var(--play-accent-hover) 6px, transparent 6px, transparent 64px);
    background-size: 64px 64px, 64px 64px;
    background-repeat: repeat;
    animation: gridColorMove 8s linear infinite;
    pointer-events: none;
    box-shadow: 0 0 32px 8px rgba(37, 99, 235, 0.3), 0 0 48px 16px rgba(29, 78, 216, 0.2);
    background-blend-mode: lighten;
}

@keyframes gridColorMove {
    0% {
        background-position: 0 0, 0 0;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 32px 32px, 32px 32px;
        filter: hue-rotate(60deg);
    }
    100% {
        background-position: 64px 64px, 64px 64px;
        filter: hue-rotate(0deg);
    }
}

.welcome-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 60%, var(--play-navy) 100%);
    opacity: 0.6;
    animation: none;
}

.welcome-screen h2 {
    font-size: 2.7rem;
    margin-bottom: 20px;
    color: var(--play-white);
    text-shadow: 0 0 18px var(--play-accent), 0 0 32px rgba(37, 99, 235, 0.5);
    animation: titleBounce 1.5s infinite alternate;
    letter-spacing: 2px;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    position: relative;
    z-index: 1;
}

@keyframes titleBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.welcome-screen h2 .pong-emoji {
    text-shadow: none !important;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    color: inherit;
    filter: none;
    font-size: 3.2rem;
    margin: 0 10px;
    vertical-align: middle;
    animation: emojiWobble 0.8s infinite alternate;
    transition: transform 0.2s;
    z-index: 1;
}

@keyframes emojiWobble {
    0%   { transform: rotate(-10deg) scale(1); }
    50%  { transform: rotate(10deg) scale(1.15); }
    100% { transform: rotate(-10deg) scale(1); }
}

.avatar-select-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    z-index: 2;
}

.avatar-select-label {
    font-size: 1.1rem;
    color: var(--play-accent);
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--play-navy-mid);
}

.avatar-options {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.avatar-option {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--play-navy-mid);
    border: 2.5px solid var(--play-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.35);
    position: relative;
    user-select: none;
}

.avatar-option.selected,
.avatar-option:hover {
    border-color: var(--play-accent-hover);
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.5);
    transform: scale(1.18) rotate(-8deg);
}

.avatar-option::after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 0 var(--play-accent);
    transition: box-shadow 0.2s;
}

.avatar-option.selected::after {
    box-shadow: 0 0 12px 4px rgba(37, 99, 235, 0.5);
}

.profile-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 0 0;
    font-size: 1.3rem;
    background: rgba(30, 41, 59, 0.85);
    border-radius: 12px;
    padding: 10px 22px;
    box-shadow: 0 0 12px var(--play-accent);
    color: var(--play-white);
    z-index: 2;
    transition: all 0.3s;
}

.profile-avatar {
    font-size: 2.2rem;
    border-radius: 50%;
    background: var(--play-navy-mid);
    border: 2px solid var(--play-accent);
    padding: 6px;
    box-shadow: 0 0 8px var(--play-accent);
}

.profile-name {
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 1.2rem;
}

#playerNameInput {
    padding: 14px 24px;
    width: 320px;
    border: 2px solid var(--play-accent);
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.9);
    color: var(--play-white);
    font-size: 1.1rem;
    text-align: center;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    z-index: 1;
}

#playerNameInput:focus {
    outline: none;
    border-color: var(--play-accent-hover);
    box-shadow: 0 0 14px var(--play-accent);
    background: rgba(30, 41, 59, 0.95);
}

.welcome-screen button {
    padding: 14px 36px;
    font-size: 1.2rem;
    background: linear-gradient(90deg, var(--play-accent) 40%, var(--play-accent-hover) 100%);
    color: var(--play-white);
    border-radius: 30px;
    box-shadow: 0 0 12px var(--play-accent), 0 0 6px rgba(29, 78, 216, 0.4) inset;
    border: none;
    animation: buttonPulse 2s infinite;
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 0 12px var(--play-accent), 0 0 6px var(--play-accent-hover) inset; }
    50% { box-shadow: 0 0 24px var(--play-accent-hover), 0 0 12px var(--play-accent) inset; }
}

.welcome-screen button:hover {
    background: linear-gradient(90deg, var(--play-accent-hover) 40%, #2563eb 100%);
    box-shadow: 0 0 18px var(--play-accent), 0 0 8px var(--play-accent-hover) inset;
    transform: scale(1.07) rotate(-2deg);
}

/* Hide elements utility */
.hidden {
    display: none !important;
}

/* ===== MAIN GAME PAGE STYLES ===== */
.main-game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding-top: 0; /* Remove extra top padding */
    margin-top: 18px; /* Small margin for breathing room */
    z-index: 1;
}

.main-game-container h1 {
    font-size: 2.2rem;
    margin-bottom: 18px;
    color: var(--play-white);
    text-shadow: 0 0 8px var(--play-accent);
}

.score {
    font-size: 1.2rem;
    color: var(--play-white);
    margin: 10px 0;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--play-accent);
}

.game-controls {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin: 18px 0;
}

canvas#gameCanvas {
    background: linear-gradient(135deg, var(--play-navy) 60%, var(--play-navy-mid) 100%);
    border: 3px solid var(--play-accent);
    border-radius: 18px;
    box-shadow: 0 0 32px rgba(37, 99, 235, 0.35), 0 0 24px rgba(29, 78, 216, 0.2) inset;
    margin-bottom: 18px;
    transition: box-shadow 0.3s;
}

/* Modal Styles (How to Play) */
.modal-content {
    background: linear-gradient(135deg, var(--play-navy-mid) 60%, var(--play-accent) 100%);
    padding: 32px;
    border-radius: 18px;
    max-width: 500px;
    width: 92%;
    box-shadow: 0 0 40px var(--play-accent), 0 0 80px rgba(29, 78, 216, 0.3);
    border: 2.5px solid var(--play-accent-hover);
    position: relative;
    transform: translateY(-50px) scale(0.92);
    transition: transform 0.5s ease;
    color: var(--play-white);
    overflow: hidden;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-content h3 {
    font-size: 2rem;
    margin-bottom: 18px;
    color: var(--play-white);
    text-align: center;
    text-shadow: 0 0 18px var(--play-accent);
    letter-spacing: 2px;
}

.modal-content ul {
    margin: 20px 0;
    padding-left: 0;
    list-style: none;
}

.modal-content li {
    margin-bottom: 16px;
    line-height: 1.7;
    padding: 12px 18px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.85);
    border-left: 6px solid var(--play-accent);
    font-size: 1.1rem;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.25);
    transition: all 0.3s ease;
    position: relative;
}

.modal-content li::before {
    content: "🎮";
    margin-right: 10px;
    font-size: 1.2rem;
    vertical-align: middle;
}

.modal-content li:hover {
    transform: translateX(8px) scale(1.04);
    border-left: 6px solid var(--play-accent-hover);
    background: rgba(37, 99, 235, 0.15);
}

#closeHowToPlayBtn, #closeHowToPlay {
    display: block;
    margin: 24px auto 0;
    padding: 12px 32px;
    background: linear-gradient(90deg, var(--play-accent), var(--play-accent-hover));
    border-radius: 30px;
    color: var(--play-white);
    font-weight: bold;
    font-size: 1.1rem;
    border: none;
    box-shadow: 0 0 12px var(--play-accent);
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s;
}

#closeHowToPlayBtn:hover, #closeHowToPlay:hover {
    background: linear-gradient(90deg, var(--play-accent-hover), var(--play-accent));
    box-shadow: 0 0 18px var(--play-accent);
    transform: scale(1.07);
}

.scoreboard {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 0 0 16px 0;
    font-size: 1.3rem;
    background: rgba(30, 41, 59, 0.92);
    border-radius: 16px;
    box-shadow: 0 0 18px var(--play-accent);
    padding: 18px 40px;
    position: relative;
    top: 0;
}

.score-player, .score-ai {
    display: flex;
    align-items: center;
    gap: 14px;
}

.score-avatar {
    font-size: 2.1rem;
    border-radius: 50%;
    background: var(--play-navy-mid);
    border: 2px solid var(--play-accent);
    padding: 4px 8px;
    box-shadow: 0 0 8px var(--play-accent);
}

.score-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--play-accent);
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--play-navy-mid);
}

.score-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--play-white);
    margin-left: 8px;
    text-shadow: 0 0 8px var(--play-accent);
}

/* Interactive select dropdowns */
.game-controls select,
#difficulty,
#themeSelector {
    padding: 10px 18px;
    font-size: 1.05rem;
    border-radius: 18px;
    border: 2px solid var(--play-accent);
    background: linear-gradient(90deg, var(--play-navy-mid) 60%, var(--play-accent) 100%);
    color: var(--play-white);
    font-weight: bold;
    box-shadow: 0 0 8px var(--play-accent);
    margin: 0 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.game-controls select:focus,
#difficulty:focus,
#themeSelector:focus {
    border-color: var(--play-accent-hover);
    box-shadow: 0 0 14px var(--play-accent);
    outline: none;
}

/* Nicer buttons */
.game-controls button,
#pauseButton, #restartButton, #fullscreenButton {
    padding: 12px 28px;
    font-size: 1.1rem;
    background: linear-gradient(90deg, var(--play-accent) 40%, var(--play-accent-hover) 100%);
    color: var(--play-white);
    border-radius: 24px;
    border: none;
    box-shadow: 0 0 12px var(--play-accent), 0 0 6px rgba(29, 78, 216, 0.4) inset;
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    margin: 0 6px;
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s, filter 0.2s;
    position: relative;
    overflow: hidden;
}

.game-controls button:active,
#pauseButton:active, #restartButton:active, #fullscreenButton:active {
    filter: brightness(1.2) drop-shadow(0 0 8px var(--play-accent));
    transform: scale(0.97);
}

.game-controls button:hover,
#pauseButton:hover, #restartButton:hover, #fullscreenButton:hover {
    background: linear-gradient(90deg, var(--play-accent-hover) 40%, var(--play-accent) 100%);
    box-shadow: 0 0 18px var(--play-accent), 0 0 8px var(--play-accent-hover) inset;
    transform: scale(1.07) rotate(-2deg);
}

/* Game Over Screen - show winner/loser differently */
.game-over-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(44,45,70,0.95);
    z-index: 200;
    animation: fadeIn 0.6s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#gameOverMessage {
    font-size: 2.2rem;
    margin-bottom: 28px;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 18px #4cc9f0, 0 0 32px #f72585;
    letter-spacing: 2px;
    padding: 18px 36px;
    border-radius: 16px;
    background: linear-gradient(90deg, #23243a 60%, #f72585 100%);
    box-shadow: 0 0 24px #f72585;
    border: 2px solid #4cc9f0;
}

.game-over-screen.winner #gameOverMessage {
    background: linear-gradient(90deg, #23243a 60%, #4cc9f0 100%);
    color: #4cc9f0;
    border-color: #f72585;
    box-shadow: 0 0 32px #4cc9f0;
}

.game-over-screen.loser #gameOverMessage {
    background: linear-gradient(90deg, #23243a 60%, #f72585 100%);
    color: #f72585;
    border-color: #4cc9f0;
    box-shadow: 0 0 32px #f72585;
}

/* Make Play Again button more vibrant and animated */
#playAgainButton {
    padding: 16px 40px;
    font-size: 1.25rem;
    background: linear-gradient(90deg, #f72585 40%, #4cc9f0 100%);
    color: #fff;
    border-radius: 32px;
    border: none;
    box-shadow: 0 0 18px #f72585, 0 0 10px #4cc9f0 inset;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    margin: 0 6px;
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
    position: relative;
    overflow: hidden;
    animation: buttonPulse 1.5s infinite;
}

#playAgainButton:hover {
    background: linear-gradient(90deg, #4895ef 40%, #b5179e 100%);
    box-shadow: 0 0 24px #4cc9f0, 0 0 14px #f72585 inset;
    transform: scale(1.09) rotate(-2deg);
}

/* Difficulty and Theme labels */
.game-controls label[for="difficulty"],
.game-controls label[for="themeSelector"],
label[for="difficulty"],
label[for="themeSelector"] {
    font-size: 1.15rem;
    color: var(--play-accent);
    font-weight: bold;
    letter-spacing: 1px;
    margin-right: 10px;
    text-shadow: 0 0 10px var(--play-navy-mid);
    padding: 2px 8px;
    display: inline-block;
}

.game-controls label[for="difficulty"]:hover,
.game-controls label[for="themeSelector"]:hover,
label[for="difficulty"]:hover,
label[for="themeSelector"]:hover {
    color: var(--play-accent-hover);
    text-shadow: 0 0 12px var(--play-accent);
}

/* Ping pong ball and paddle SVG animation for welcome screen */
.welcome-screen .pong-animation {
    position: absolute;
    bottom: 40px;
    right: 60px;
    width: 120px;
    height: 80px;
    z-index: 2;
    pointer-events: none;
}

.welcome-screen .pong-ball {
    position: absolute;
    left: 70px;
    top: 18px;
    width: 28px;
    height: 28px;
    animation: pongBallBounce 1.2s cubic-bezier(.5,1.5,.5,1) infinite;
}

.welcome-screen .pong-paddle {
    position: absolute;
    left: 10px;
    top: 38px;
    width: 80px;
    height: 28px;
    animation: pongPaddleMove 1.2s cubic-bezier(.5,1.5,.5,1) infinite;
}

@keyframes pongBallBounce {
    0%   { transform: translateY(0) scale(1); }
    40%  { transform: translateY(-32px) scale(1.1); }
    60%  { transform: translateY(-32px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes pongPaddleMove {
    0%   { transform: rotate(-8deg) scale(1); }
    40%  { transform: rotate(8deg) scale(1.05); }
    60%  { transform: rotate(8deg) scale(1.05); }
    100% { transform: rotate(-8deg) scale(1); }
}

/* Add any other needed styles below... */