@keyframes color-pulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.2) rotate(5deg); filter: brightness(1.5) drop-shadow(0 0 15px currentColor); }
    100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}

.cube-animate {
    animation: color-pulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Intro Animation Styles */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
}

#intro-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#intro-content {
    position: relative;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    pointer-events: none;
}

#intro-content * {
    pointer-events: auto;
}

#intro-title {
    font-size: 8rem;
    font-weight: 900;
    letter-spacing: 2rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    margin: 0;
    opacity: 0;
    transform: scale(0.5);
}

#intro-title.show-intro {
    animation: intro-title-zoom 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               intro-title-glow 3s infinite alternate ease-in-out 1.5s;
}

#intro-start-btn {
    margin-top: 40px;
    padding: 15px 40px;
    font-size: 1.2rem;
    letter-spacing: 0.5rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 900;
    transition: all 0.3s ease;
    animation: intro-fade-in 1.5s ease-out forwards;
    visibility: hidden; /* Hide initially until timer */
}

#intro-start-btn:not(.hidden) {
    visibility: visible;
}

#intro-start-btn:hover {
    transform: scale(1.1);
    background: #ff00ff;
    color: #fff;
    box-shadow: 0 0 30px #ff00ff;
}

#intro-skip-hint {
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    letter-spacing: 0.3rem;
    z-index: 10002;
    animation: intro-fade-in 1s ease-out forwards 0.5s;
    pointer-events: none;
}

@keyframes intro-title-zoom {
    0% { opacity: 0; transform: scale(0.5) blur(20px); filter: brightness(2); }
    100% { opacity: 1; transform: scale(1) blur(0px); filter: brightness(1); }
}

@keyframes intro-title-glow {
    0% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); color: #fff; }
    100% { text-shadow: 0 0 50px rgba(255, 0, 255, 0.8), 0 0 100px rgba(255, 0, 255, 0.4); color: #ff00ff; }
}

@keyframes intro-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes intro-fade-out {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

.intro-fade-out {
    animation: intro-fade-out 1s ease-in-out forwards !important;
}

/* Global Button Animations */
button {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    border: none;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    outline: none;
    position: relative;
    overflow: hidden;
    animation: button-entrance 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
    pointer-events: auto !important;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

button:hover::before {
    left: 100%;
}

@keyframes button-entrance {
    from { opacity: 0; transform: scale(0.8) translateY(20px); filter: blur(5px); }
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0px); }
}

button:hover {
    transform: scale(1.05) translateY(-2px);
    filter: brightness(1.2);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
}

button:active {
    transform: scale(0.95) translateY(0) !important;
    filter: brightness(0.9) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Menu Tier Entrance Animations */
.menu-tier {
    animation: menu-slide-up 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#custom-page, #game-over, #online-lobby, #pause-menu, #skills-page, #waiting-room {
    animation: overlay-slide-up 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

#custom-page h2, #game-over h2, #online-lobby h2, #skills-page h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(to bottom, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#menu h1 {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 1.5rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    opacity: 1;
    animation: title-entrance 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, idle-float 5s infinite ease-in-out 1s;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes title-entrance {
    from { opacity: 0; transform: translateY(-50px) scale(0.5); filter: blur(20px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0px); }
}

.cooldown-item {
    animation: side-slide 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.dash-item { animation-delay: 0.1s; }
.charge-item { animation-delay: 0.2s; }
.special-skill-item { animation-delay: 0.3s; }

@keyframes side-slide {
    from { opacity: 0; transform: translateX(50px); filter: blur(5px); }
    to { opacity: 1; transform: translateX(0); filter: blur(0px); }
}

.dash-item {
    animation-name: side-slide-left;
}

@keyframes side-slide-left {
    from { opacity: 0; transform: translateX(-50px); filter: blur(5px); }
    to { opacity: 1; transform: translateX(0); filter: blur(0px); }
}

#scoreboard {
    animation: score-entrance 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

#round-announcer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6000;
    pointer-events: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#countdown-text {
    font-size: 10rem;
    font-weight: 900;
    white-space: nowrap;
    margin: 0;
    line-height: 1;
    animation: countdown-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#round-text {
    font-size: 2.5rem;
    font-weight: 900;
    opacity: 0.8;
    margin: 0;
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
}

@keyframes countdown-pop {
    0% { transform: scale(0.5); opacity: 0; filter: blur(10px); }
    70% { transform: scale(1.2); opacity: 1; filter: blur(0px); }
    100% { transform: scale(1); opacity: 1; }
}

:root {
    --primary-color: #ff0000;
    --secondary-color: #00ffff;
    --accent-color: #00ffff;
    --font-family: 'Quicksand', sans-serif;
    --border-radius: 8px;
    --ui-scale: 0.8; /* Reverted global scale */
}

/* --- GLOBAL ANIMATIONS --- */
@keyframes menu-slide-up {
    from { opacity: 0; transform: translateY(30px) scale(0.95); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0px); }
}

@keyframes overlay-slide-up {
    from { 
        opacity: 0; 
        transform: translate(-50%, -45%) scale(0.95); 
        filter: blur(10px); 
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
        filter: blur(0px); 
    }
}

@keyframes menu-fade-in {
    from { opacity: 0; filter: blur(10px); }
    to { opacity: 1; filter: blur(0px); }
}

@keyframes idle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 0 25px rgba(255, 255, 255, 0.3); }
}

body {
    background: #000; 
    color: var(--primary-color);
    font-family: var(--font-family);
    margin: 0;
    overflow: hidden;
    animation: menu-fade-in 1s ease-out;
}

#status {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 5000;
    transform: scale(var(--ui-scale));
    transform-origin: bottom left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: menu-slide-up 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

#theme-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 5000;
    transform: scale(var(--ui-scale));
    transform-origin: bottom right;
    transition: all 0.1s ease;
}

.menu-tier:not(.hidden) {
    animation: menu-slide-up 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

/* --- THEME-SPECIFIC FONTS --- */
body.theme-ronk { font-family: 'Orbitron', sans-serif !important; }
body.theme-white-black { font-family: 'Quicksand', sans-serif !important; font-weight: 700 !important; }
/* --- PINKCORE THEME EFFECTS --- */
body.theme-pinkcore {
    background: #ffecf2 !important;
}

body.theme-pinkcore #menu h1 {
    color: #ff69b4;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
}

body.theme-pinkcore button:not(.nav-arrow) {
    background: rgba(255, 255, 255, 0.9);
    color: #ff69b4;
    border: 2px solid #ff69b4;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.2);
    font-family: 'Quicksand', sans-serif !important;
}

body.theme-pinkcore button:not(.nav-arrow):hover {
    background: #ff69b4;
    color: #fff;
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4);
}

body.theme-pinkcore button:not(.nav-arrow):active {
    transform: scale(0.95) rotate(-1deg);
}
body.theme-hacker { font-family: 'VT323', monospace !important; }
body.theme-pixel { font-family: 'Press Start 2P', cursive !important; }

/* Apply fonts to countdown and announcer */
body.theme-ronk #round-announcer, body.theme-ronk #countdown-text { font-family: 'Orbitron', sans-serif !important; }
body.theme-white-black #round-announcer, body.theme-white-black #countdown-text { font-family: 'Quicksand', sans-serif !important; font-weight: 900 !important; }
body.theme-pinkcore #round-announcer, body.theme-pinkcore #countdown-text { font-family: 'Quicksand', sans-serif !important; font-weight: 500 !important; }
body.theme-hacker #round-announcer, body.theme-hacker #countdown-text { font-family: 'VT323', monospace !important; }
body.theme-pixel #round-announcer, body.theme-pixel #countdown-text { font-family: 'Press Start 2P', cursive !important; font-size: 1.5rem !important; }

/* --- CYBERPUNK / RONK THEME EFFECTS --- */
body.theme-ronk #menu h1 {
    font-family: 'Orbitron', sans-serif;
    color: #ff0000;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 7rem; /* Even bigger for RONK */
    letter-spacing: 1.2rem;
    text-shadow: 0 0 25px rgba(255, 0, 0, 0.8), 0 0 50px rgba(255, 0, 0, 0.4);
    animation: ronk-flicker-main 4s infinite step-end;
    position: relative;
    z-index: 10;
}

/* Ronk Scanline Overlay */
body.theme-ronk::before {
    content: " ";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 10000;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    opacity: 0.3;
}

@keyframes ronk-flicker-main {
    0%, 95%, 100% { color: #ff0000; text-shadow: 0 0 15px rgba(255, 0, 0, 0.9); transform: none; filter: none; }
    96% { color: #fff; text-shadow: 0 0 20px #fff; transform: skewX(-15deg) scaleY(1.1); filter: invert(1); }
    97% { color: #000; text-shadow: none; transform: skewX(15deg) scaleY(0.9); }
    98% { color: #fff; text-shadow: 0 0 20px #fff; transform: translateX(-5px); filter: blur(2px); }
    99% { color: #ff0000; text-shadow: 0 0 40px red; transform: translateX(5px); }
}

body.theme-ronk button:not(.nav-arrow) {
    border-radius: 0;
    background: rgba(255, 0, 0, 0.05);
    border: 2px solid #ff0000;
    color: #ff0000;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

body.theme-ronk button:not(.nav-arrow):hover {
    background: #ff0000;
    color: #000;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.08) skewX(-2deg);
    text-shadow: none;
}

body.theme-ronk button:not(.nav-arrow)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 0, 0, 0.2), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

body.theme-ronk button:not(.nav-arrow):hover::after {
    transform: translateX(100%);
}

body.theme-ronk .nav-arrow:active {
    animation: nav-arrow-press-ronk 0.2s ease-out forwards;
}

#menu {
    position: relative;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

/* --- WHITE BLACK THEME EFFECTS --- */
body.theme-white-black {
    --bg-color: #000000;
    --primary-color: #ffffff;
    --accent-color: #ffffff;
    --grid-color: rgba(255, 255, 255, 0.2);
    --border-color: #ffffff;
    --canvas-bg: rgba(0, 0, 0, 0.95);
    background: #000 !important; /* Keep it black, container will be on top */
    color: #fff;
    font-family: 'Quicksand', sans-serif !important;
}

body.theme-white-black #menu h1 {
    font-family: 'Orbitron', sans-serif;
    color: #ffffff;
    font-size: 6rem;
    letter-spacing: 1.5rem;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.4);
    font-weight: 900;
    animation: white-black-pulse 3s ease-in-out infinite;
}

@keyframes white-black-pulse {
    0%, 100% { opacity: 1; filter: brightness(1.2); }
    50% { opacity: 0.9; filter: brightness(0.8); }
}

body.theme-white-black #round-announcer, body.theme-white-black #countdown-text {
    font-family: 'Orbitron', sans-serif !important;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

body.theme-white-black button:not(.nav-arrow) {
    border-radius: 4px;
    border: 1px solid #ffffff;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

body.theme-white-black button:not(.nav-arrow):hover {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    letter-spacing: 0.3rem; /* Elegant expansion */
}

body.theme-white-black .nav-arrow:active {
    animation: nav-arrow-press-white-black 0.2s ease-out forwards;
}

@keyframes white-black-float {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 10px rgba(255, 255, 255, 0.2); }
    50% { transform: translateY(-5px); box-shadow: 0 0 25px rgba(255, 255, 255, 0.4); }
}

/* --- DREAMCORE THEME EFFECTS --- */
body.theme-dreamcore #menu h1 {
    font-family: 'Quicksand', sans-serif;
    color: #fff;
    font-size: 6rem;
    opacity: 0.6;
    filter: blur(2px);
    animation: dream-drift 8s ease-in-out infinite;
}

@keyframes dream-drift {
    0%, 100% { transform: translate(0, 0); opacity: 0.4; }
    50% { transform: translate(10px, 5px); opacity: 0.7; filter: blur(0px); }
}

body.theme-dreamcore button:not(.nav-arrow) {
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

body.theme-dreamcore .nav-arrow:active {
    animation: nav-arrow-press-dreamcore 0.2s ease-out forwards;
}

/* --- HACKER THEME EFFECTS --- */
body.theme-hacker #menu h1 {
    font-family: 'VT323', monospace;
    color: #00ff41;
    font-size: 8rem;
    letter-spacing: 0.5rem;
    text-shadow: 0 0 10px #00ff41, 0 0 20px #00ff41;
}

body.theme-hacker #menu h1::after {
    content: '_';
    animation: hacker-blink 1s step-end infinite;
}

@keyframes hacker-blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

body.theme-hacker button:not(.nav-arrow) {
    border-radius: 0;
    font-family: 'VT323', monospace;
    border: 2px solid #00ff41;
    color: #00ff41;
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.2);
}

body.theme-hacker button:not(.nav-arrow):hover {
    background: #00ff41;
    color: #000;
    box-shadow: 0 0 20px #00ff41, inset 0 0 10px #000;
    transform: scale(1.05);
}

body.theme-hacker button:not(.nav-arrow)::before {
    content: "> ";
}

body.theme-hacker .nav-arrow:active {
    animation: nav-arrow-press-hacker 0.3s ease-out forwards;
}

/* --- PIXEL THEME EFFECTS --- */
body.theme-pixel #menu h1 {
    font-family: 'Press Start 2P', cursive;
    color: #fff;
    text-shadow: 8px 8px #ff0000;
    font-size: 4.5rem;
}

body.theme-pixel button:not(.nav-arrow) {
    border-radius: 0;
    border: 4px solid #fff;
    box-shadow: 6px 6px #000;
    font-family: 'Press Start 2P', cursive;
    image-rendering: pixelated;
    background: #4a4a4a;
    transition: none; /* Pixel games often have instant state changes */
}

body.theme-pixel button:not(.nav-arrow):hover {
    background: #ff00ff;
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px #000;
}

body.theme-pixel button:not(.nav-arrow):active {
    box-shadow: 2px 2px #000;
    transform: translate(4px, 4px);
}

body.theme-pixel .nav-arrow:active {
    animation: nav-arrow-press-pixel 0.2s ease-out forwards;
}

button:not(.nav-arrow) {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    outline: none;
    user-select: none;
}

button:not(.nav-arrow):active {
    transform: scale(0.92) translateY(2px) !important;
    filter: brightness(1.5) contrast(1.2);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.2) !important;
}

/* Staying there animation for active/selected buttons */
button.active-state, button:focus:not(:active) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-width: 2px;
}

.menu-tier button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 12px 30px;
    font-size: 1rem;
    letter-spacing: 0.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
}

.menu-tier button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.menu-tier button:active {
    transform: scale(0.95) translateY(0px);
}

/* Tutorial Overlay */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    backdrop-filter: blur(10px);
}

.tutorial-box {
    text-align: center;
    max-width: 800px; /* Increased from 400px to 800px to prevent overflow */
    padding: 60px;
    background: rgba(0, 0, 0, 0.8); /* Added a subtle background since we removed the main box */
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#tutorial-text {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.5rem;
    margin-bottom: 30px;
    color: #fff;
}

#tutorial-keys {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.key {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #fff;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: 700;
}

#tutorial-next {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2rem;
}

#top-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5000;
}

#scoreboard-container {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) scale(var(--ui-scale));
    display: flex;
    justify-content: center;
}

.player-hud {
    position: absolute;
    top: 50%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(-50%) scale(var(--ui-scale));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.player-hud.visible {
    opacity: 1;
    pointer-events: auto;
}

.player-hud.left {
    left: 3rem;
    transform-origin: center left;
    align-items: flex-start;
    text-align: left;
}

.player-hud.right {
    right: 3rem;
    transform-origin: center right;
    align-items: flex-end;
    text-align: right;
}

.player-name-tag {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.2rem;
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    display: inline-block;
}

.hud-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#scoreboard {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 10px 40px;
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
}

#p1-score-val, #p2-score-val {
    font-size: 2rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
}

.score-vs {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.5;
}

.cooldown-letter-item {
    display: flex;
    align-items: center;
    height: 40px;
    pointer-events: none;
    white-space: nowrap;
}

.player-hud.left .cooldown-letter-item {
    justify-content: flex-start;
}

.player-hud.right .cooldown-letter-item {
    justify-content: flex-end;
}

.cooldown-letter {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.25rem;
    font-family: 'Quicksand', sans-serif;
    color: #000; 
    text-shadow: 0 0 5px rgba(255, 255, 255, 0);
    transition: color 0.1s linear, text-shadow 0.1s linear;
    text-transform: uppercase;
}

.cooldown-letter.ready {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}

@keyframes skill-entrance {
    from { opacity: 0; transform: translateY(-10px) scale(0.9); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0px); }
}

/* Pixel Flappy Background - ONLY IN PIXEL THEME */
.pixel-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    display: none;
    background: #70c5ce; /* Flappy Bird sky blue */
}

body.theme-pixel .pixel-bg-container {
    display: block;
}

.pixel-cloud {
    position: absolute;
    width: 120px;
    height: 60px;
    background: #fff;
    box-shadow: 
        10px 0 #fff, -10px 0 #fff, 0 10px #fff, 0 -10px #fff,
        20px 10px #fff, -20px 10px #fff, 10px 20px #fff, -10px 20px #fff;
    opacity: 0.8;
    animation: pixelScroll linear infinite;
}

.pixel-pipe {
    position: absolute;
    width: 80px;
    background: #73be2e; /* Flappy Bird green */
    border: 4px solid #000;
    box-shadow: inset -10px 0 rgba(0,0,0,0.2), 10px 0 rgba(0,0,0,0.1);
    animation: pixelScroll linear infinite;
}

.pixel-pipe::before {
    content: "";
    position: absolute;
    left: -10px;
    width: calc(100% + 20px);
    height: 40px;
    background: #73be2e;
    border: 4px solid #000;
}

.pixel-pipe.top { top: 0; border-top: none; }
.pixel-pipe.top::before { bottom: -4px; }
.pixel-pipe.bottom { bottom: 0; border-bottom: none; }
.pixel-pipe.bottom::before { top: -4px; }

@keyframes pixelScroll {
    from { transform: translateX(100vw); }
    to { transform: translateX(-200px); }
}

/* Hacker Matrix Background - ONLY IN HACKER THEME */
.matrix-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    display: none;
}

body.theme-hacker .matrix-container {
    display: block;
}

.matrix-line {
    position: absolute;
    top: -100px;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    white-space: nowrap;
    text-shadow: 0 0 10px #00ff41;
    opacity: 0.8;
    user-select: none;
    animation: matrixFall linear infinite;
}

@keyframes matrixFall {
    to { transform: translateY(calc(100vh + 200px)); }
}

/* Cloud background elements - ONLY VISIBLE IN DREAMCORE */
.clouds-container, .liquid-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Above body background, below menu */
    overflow: hidden;
    display: none;
    background: transparent;
}

body.theme-white-black .liquid-container {
    display: block;
    background: #000;
}

.liquid-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    filter: none;
    opacity: 0.9;
}

body.theme-dreamcore .clouds-container {
    display: block;
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
    filter: blur(20px);
    animation: float linear infinite;
}

@keyframes float {
    from { transform: translateX(-200px); }
    to { transform: translateX(calc(100vw + 200px)); }
}

/* --- THEME SPECIALIZATION (SHAPES & STYLES) --- */

/* RONK: Industrial, Sharp, Hex-like */
body.theme-ronk button:not(.nav-arrow) {
    border-radius: 0;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    border: 2px solid #ff0000;
    background: rgba(30, 0, 0, 0.9);
    padding: 10px 25px !important;
    font-size: 0.9rem !important;
}

body.theme-ronk #status {
    border-radius: 0;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    border: 2px solid #ff0000;
}

body.theme-ronk .bar-container {
    border-radius: 0;
    border: 2px solid #ff0000;
}

body.theme-ronk #game-over, body.theme-ronk #custom-page, body.theme-ronk #online-lobby {
    border-radius: 0;
    clip-path: polygon(5% 0, 100% 0, 100% 95%, 95% 100%, 0 100%, 0 5%);
    border: 3px solid #ff0000;
}

/* Dreamcore: Ethereal, Floating, Soft */
body.theme-dreamcore button:not(.nav-arrow) {
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    padding: 10px 25px !important;
    font-size: 0.9rem !important;
}

body.theme-dreamcore #status {
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dreamcore .bar-container {
    border-radius: 20px;
}

body.theme-dreamcore #game-over, body.theme-dreamcore #custom-page, body.theme-dreamcore #online-lobby {
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Hacker: Terminal, Matrix, Blocky */
body.theme-hacker {
    --bg-color: #000;
    --primary-color: #00ff41;
    --accent-color: #00ff41;
    --grid-color: rgba(0, 255, 65, 0.3);
    --border-color: #00ff41;
    --canvas-bg: rgba(0, 5, 0, 0.9);
    font-family: 'VT323', monospace !important;
}

body.theme-hacker #menu h1 {
    font-family: 'VT323', monospace !important;
    color: #00ff41 !important;
    text-shadow: 0 0 10px #00ff41 !important;
    letter-spacing: 0.5rem !important;
}

body.theme-hacker #round-announcer, body.theme-hacker #countdown-text {
    font-family: 'VT323', monospace !important;
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
}

body.theme-hacker button:not(.nav-arrow) {
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 10px 25px !important;
    font-size: 1.2rem !important;
    font-family: 'VT323', monospace !important;
    border-radius: 0;
}

body.theme-hacker #status {
    border-radius: 0;
    border: 1px solid #00ff41;
    background: rgba(0, 10, 0, 0.8);
}

body.theme-hacker .bar-container {
    border-radius: 0;
    border: 1px solid #00ff41;
}

body.theme-hacker button:not(.nav-arrow)::before {
    content: "> ";
}

body.theme-hacker #game-over, body.theme-hacker #custom-page, body.theme-hacker #online-lobby {
    border-radius: 0;
    border: 2px solid #00ff41;
    background: rgba(0, 5, 0, 0.95);
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.2);
}

body.theme-hacker #scoreboard, body.theme-hacker #round-announcer, body.theme-hacker .cooldown-item {
    font-family: 'VT323', monospace !important;
    border-color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    background: #000;
    border-radius: 0;
}

body.theme-hacker #p1-score-val, body.theme-hacker #p2-score-val, 
body.theme-hacker #round-text, body.theme-hacker #countdown-text {
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
}

body.theme-hacker #theme-btn {
    border-color: #00ff41;
    color: #00ff41;
    background: #000;
    border-radius: 0;
}

/* Pixel: Retro, Stepped, Offset */
body.theme-pixel {
    --bg-color: #000;
    --primary-color: #fff;
    --accent-color: #ff0040;
    --grid-color: rgba(255, 255, 255, 0.4);
    --border-color: #fff;
    --canvas-bg: rgba(0, 0, 0, 0.9);
    font-family: 'Press Start 2P', cursive !important;
}

body.theme-pixel #menu h1 {
    font-family: 'Press Start 2P', cursive !important;
    color: #ffec27 !important;
    text-shadow: 6px 6px 0 #000 !important;
    letter-spacing: 0.2rem !important;
    font-size: 2rem !important;
}

body.theme-pixel #round-announcer, body.theme-pixel #countdown-text {
    font-family: 'Press Start 2P', cursive !important;
    color: #fff;
    text-shadow: 4px 4px 0 #000;
    font-size: 1.5rem !important;
}

body.theme-pixel button:not(.nav-arrow) {
    border-radius: 0;
    background: #ff0040;
    border: none;
    box-shadow: 
        -4px 0 0 0 #000,
        4px 0 0 0 #000,
        0 -4px 0 0 #000,
        0 4px 0 0 #000,
        4px 4px 0 0 #000;
    color: #ffec27;
    font-family: 'Press Start 2P', cursive !important;
    image-rendering: pixelated;
    padding: 1rem 2rem !important;
    font-size: 0.8rem !important;
}

body.theme-pixel #status {
    border-radius: 0;
    box-shadow: 6px 6px 0 0 #000;
    background: #000;
}

body.theme-pixel .bar-container {
    border-radius: 0;
    box-shadow: 4px 4px 0 0 #000;
    background: #555;
    border: 2px solid #fff;
}

body.theme-pixel #game-over, body.theme-pixel #custom-page, body.theme-pixel #online-lobby {
    border-radius: 0;
    background: #73be2e;
    box-shadow: 
        -8px 0 0 0 #000,
        8px 0 0 0 #000,
        0 -8px 0 0 #000,
        0 8px 0 0 #000;
}

body.theme-pixel #scoreboard, body.theme-pixel #round-announcer, body.theme-pixel .cooldown-item {
    font-family: 'Press Start 2P', cursive !important;
    border: 4px solid #fff;
    background: #000;
    border-radius: 0;
    box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.5);
}

body.theme-pixel #p1-score-val, body.theme-pixel #p2-score-val, 
body.theme-pixel #round-text, body.theme-pixel #countdown-text {
    color: #fff;
    text-shadow: 4px 4px 0 #000;
}

body.theme-pixel #theme-btn {
    border: 4px solid #fff;
    color: #ffec27;
    background: #000;
    border-radius: 0;
    box-shadow: 4px 4px 0 #ff0040;
}

/* --- THEMES --- */

/* --- PINKCORE THEME EFFECTS (DREAMCORE + PINKLAND) --- */
body.theme-pinkcore {
    --bg-color: #ff00ff;
    --primary-color: #ffffff;
    --accent-color: #ff69b4;
    --grid-color: rgba(255, 105, 180, 0.4);
    --border-color: #ffffff;
    --canvas-bg: rgba(255, 192, 203, 0.4);
    background: linear-gradient(135deg, #ff99cc 0%, #ffccff 100%) !important;
    font-family: 'Quicksand', sans-serif !important;
}

body.theme-pinkcore #menu h1 {
    font-family: 'Pacifico', cursive !important;
    color: #fff !important;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.6) !important;
    letter-spacing: 0.5rem !important;
    font-weight: 400 !important;
}

body.theme-pinkcore #round-announcer, body.theme-pinkcore #countdown-text {
    font-family: 'Quicksand', sans-serif !important;
    color: #fff;
    text-shadow: 0 0 20px #ff00ff;
}

body.theme-pinkcore button:not(.nav-arrow) {
    border-radius: 50px;
    border: 2px solid #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    font-family: 'Quicksand', sans-serif !important;
    font-weight: 700;
}

body.theme-pinkcore .nav-arrow:active {
    animation: nav-arrow-press-pinkcore 0.2s ease-out forwards;
}

/* Clouds container for PinkCore theme */
body.theme-pinkcore .clouds-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: block; /* Only show in pinkcore */
}

body.theme-pinkcore #status { 
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff; 
    border-radius: 40px;
}

body.theme-pinkcore .bar-container { 
    background: rgba(255, 255, 255, 0.2); 
    border-color: #ffffff; 
    border-radius: 20px;
}

body.theme-pinkcore #game-over, body.theme-pinkcore #custom-page, body.theme-pinkcore #online-lobby {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid #ffffff;
    backdrop-filter: blur(15px);
    border-radius: 100px;
}

body.theme-pinkcore #scoreboard, body.theme-pinkcore #round-announcer, body.theme-pinkcore .cooldown-item {
    font-family: 'Quicksand', sans-serif !important;
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border-radius: 30px;
}

body.theme-pinkcore #p1-score-val, body.theme-pinkcore #p2-score-val, 
body.theme-pinkcore #round-text, body.theme-pinkcore #countdown-text {
    color: #ffffff;
    text-shadow: 0 0 20px #ff00ff;
}

body.theme-pinkcore #theme-btn {
    border-color: #ffffff;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    border-radius: 50px;
}

/* Hacker: Matrix, green/black, monospace */
body.theme-hacker {
    --bg-color: #000000;
    --grid-color: rgba(0, 255, 65, 0.3);
    --font-family: 'VT323', monospace;
    --canvas-bg: rgba(0, 5, 0, 0.98);
    --border-color: #00ff41;
    --btn-color: #00ff41;
    --btn-glow: 0 0 30px rgba(0, 255, 65, 0.5);
    --btn-bg: rgba(0, 10, 0, 0.9);
    color: #00ff41; 
    background: #000000 !important;
}
body.theme-hacker h1 { 
    font-family: 'VT323', monospace !important;
    color: #00ff41 !important; 
    text-shadow: 0 0 15px #00ff41 !important; 
    font-weight: 900 !important; 
    opacity: 1 !important;
}
body.theme-hacker #status { background: rgba(0, 0, 0, 0.9); border: 1px solid #00ff41; color: #00ff41; box-shadow: 0 0 20px rgba(0, 255, 65, 0.2); }
body.theme-hacker .bar { background: #00ff41; box-shadow: 0 0 15px #00ff41; }

/* Pixel: Retro, blocky, vibrant */
body.theme-pixel {
    --bg-color: #70c5ce; /* Flappy Bird Sky Blue */
    --pink: #ff0040;
    --yellow: #ffec27;
    --purple: #7e2553;
    --grid-color: rgba(255, 255, 255, 0.5);
    --font-family: 'Press Start 2P', cursive;
    --canvas-bg: transparent;
    --border-color: #ffffff;
    --btn-color: #ffec27;
    --btn-glow: 4px 4px #000;
    --btn-bg: #ff0040;
    color: #fff;
    image-rendering: pixelated;
    background: #70c5ce !important; /* Force sky blue */
}

body.theme-pixel h1 { 
    color: #ffec27 !important; 
    text-shadow: 6px 6px #000 !important; 
    opacity: 1 !important; 
    font-size: clamp(2rem, 8vw, 4rem) !important;
}

body.theme-pixel #theme-btn {
    border: 4px solid #000;
    border-radius: 0;
    box-shadow: 4px 4px #000;
    background: #ff0040;
    color: #ffec27;
    text-shadow: 2px 2px #000;
    padding: 8px 14px;
    min-width: 160px;
    font-size: 0.8rem !important;
}

body.theme-pixel #status { 
    background: #73be2e; /* Pipe Green */
    border: 4px solid #000; 
    box-shadow: 6px 6px #000; 
    color: #fff; 
    font-size: 1rem; 
}

body.theme-pixel .cooldown-item span { 
    color: #fff; 
    font-size: 0.8rem; 
    text-shadow: 2px 2px #000;
}

body.theme-pixel .bar-container {
    border: 3px solid #000;
    border-radius: 0;
    height: 18px;
}

body.theme-pixel button:not(.nav-arrow) { 
    border: 4px solid #000; 
    border-radius: 0; 
    box-shadow: 4px 4px #000; 
    padding: 10px 20px !important;
    font-size: 1rem !important;
}

/* RONK: Industrial, High Contrast, Red/Black/Metal */
body.theme-ronk {
    --bg-color: #0a0a0a;
    --grid-color: rgba(255, 0, 0, 0.2);
    --font-family: 'Orbitron', sans-serif;
    --canvas-bg: rgba(15, 15, 15, 0.95);
    --border-color: #ff0000;
    --btn-color: #ff0000;
    --btn-glow: 0 0 25px rgba(255, 0, 0, 0.6);
    --btn-bg: rgba(30, 0, 0, 0.8);
    color: #ff0000;
    background: #000000 !important;
}

body.theme-ronk h1 { 
    color: #ff0000 !important; 
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.8) !important; 
    opacity: 1 !important;
}

body.theme-ronk #status { 
    background: #111; 
    border: 2px solid #ff0000; 
    color: #ff0000; 
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.2); 
    text-shadow: 0 0 10px #ff0000;
}

body.theme-ronk .bar { 
    background: #ff0000; 
    box-shadow: 0 0 20px #ff0000; 
}

body.theme-ronk button:not(.nav-arrow) {
    border: 2px solid #ff0000;
    background: rgba(20, 0, 0, 0.9);
    /* Removed clip-path for perfect centering */
}

body.theme-ronk button:not(.nav-arrow):hover {
    background: #ff0000;
    color: #000;
}

/* Background overlay for RONK theme */
.ronk-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    display: none;
    background: repeating-linear-gradient(
        45deg,
        #000,
        #000 10px,
        #050000 10px,
        #050000 20px
    );
    opacity: 0.5;
}

body.theme-ronk .ronk-container {
    display: block;
}

body.theme-ronk .ronk-container {
    display: block;
}

#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none !important; /* Ensure this container doesn't intercept clicks */
    z-index: 10000; /* Higher than menu but let children handle clicks */
}

#menu, #custom-page, #game-ui, #theme-btn, #game-over, #online-lobby {
    pointer-events: auto !important;
    transition: all var(--transition-speed) var(--easing);
}

#game-ui {
    pointer-events: none !important; /* The container should be passthrough */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

/* --- SPECIAL SKILLS UI (Arrow Navigation) --- */
#skills-page {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 2px solid var(--primary-color);
    padding: 3rem;
    z-index: 6000;
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 20px;
}

.skill-section {
    width: 100%;
    margin: 2rem 0;
}

.skill-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.skill-preview-container {
    width: 300px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.skill-card-single {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--primary-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    width: 100%;
    box-shadow: 0 0 20px rgba(var(--primary-color-rgb, 255, 0, 0), 0.2);
    transition: all 0.3s ease;
}

.skill-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.skill-card-single h3 {
    font-size: 1.2rem;
    letter-spacing: 0.15rem;
    margin-bottom: 1rem;
    color: #fff;
}

.skill-card-single p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.5;
    color: #fff;
}

#close-skills-btn {
    margin-top: 1rem;
}

.special-skill-item {
    /* Positioned automatically by flex in top-ui */
}

/* Cooldown Bar Colors */
#dash-bar { background: #00ffff; }
#charge-bar { background: #ff00ff; }
#skill-bar { background: #ffcc00; }

#gameCanvas {
    pointer-events: none !important;
}

/* Removed old fixed scoreboard to allow flex layout in top-ui */

/* We removed the old relative cooldown-item block to prevent duplicates */
.cooldown-label {
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.dash-item {
    /* moved to top-ui section */
}

.charge-item {
    /* moved to top-ui section */
}

.bar-container {
    width: 120px; /* Horizontal bars */
    height: 12px; 
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.bar {
    width: 0%; /* Fills from left */
    height: 100%; 
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.1s ease, background 0.3s ease;
    background: rgba(255, 255, 255, 0.3); /* Filling color */
}

.bar.ready {
    background: #fff;
    box-shadow: 0 0 20px #fff;
}

#multiplayer-vote-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

#vote-status {
    font-size: 0.8rem;
    opacity: 0.6;
    letter-spacing: 0.1rem;
}

#round-announcer {
    position: fixed;
    top: 45%; 
    left: 50%;
    transform: translate(-50%, -50%) scale(var(--ui-scale)); /* Added UI scale back */
    text-align: center;
    pointer-events: none;
    z-index: 9000; 
}

#round-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    color: #fff;
    text-shadow: 0 0 30px var(--border-color);
    margin-bottom: 20px;
    animation: pulse 1s ease-in-out infinite;
}

#countdown-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 6rem;
    color: #fff;
    text-shadow: 0 0 50px #fff;
    animation: pop 1s ease-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    20% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

#game-over {
    pointer-events: auto !important; /* But interactive elements inside should work */
}

#menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

#theme-btn {
    position: fixed;
    bottom: 20px; 
    left: 20px; 
    right: auto; /* override any previous right */
    width: auto; /* prevent stretching */
    max-width: none;
    z-index: 10000; /* bump z-index to ensure it's on top */
    padding: 6px 12px; 
    font-size: 0.7rem; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 5px;
    transition: all 0.3s ease;
}

body.theme-ronk #scoreboard, body.theme-ronk .cooldown-item, body.theme-ronk #theme-btn {
    font-family: 'Orbitron', sans-serif;
    border-color: #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    border-radius: 0;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

body.theme-ronk #round-announcer {
    border: none;
    background: none;
    box-shadow: none;
    clip-path: none;
}

body.theme-ronk #p1-score-val, body.theme-ronk #p2-score-val {
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000;
}

body.theme-white-black #scoreboard, body.theme-white-black .cooldown-item {
    font-family: 'Orbitron', sans-serif !important;
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.6);
}

body.theme-white-black #round-announcer {
    border: none;
    background: none;
    box-shadow: none;
}

body.theme-white-black #p1-score-val, body.theme-white-black #p2-score-val {
    color: #ffffff;
    text-shadow: 0 0 15px #ffffff;
}

body.theme-dreamcore #scoreboard, body.theme-dreamcore .cooldown-item {
    font-family: 'Quicksand', sans-serif;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

body.theme-dreamcore #round-announcer {
    border: none;
    background: none;
    box-shadow: none;
}

body.theme-dreamcore #p1-score-val, body.theme-dreamcore #p2-score-val, 
body.theme-dreamcore #round-text, body.theme-dreamcore #countdown-text {
    font-family: 'Quicksand', sans-serif !important;
    font-weight: 300;
    text-shadow: 0 0 15px #fff;
}

/* Hacker Theme Scoreboard */

body.theme-hacker #scoreboard, body.theme-hacker .cooldown-item {
    font-family: 'Courier New', monospace;
    background: rgba(0, 20, 0, 0.9);
    border: 1px solid #00ff41;
    border-radius: 0;
    box-shadow: 0 0 15px #00ff41;
}

body.theme-hacker #round-announcer {
    border: none;
    background: none;
    box-shadow: none;
}

body.theme-hacker #p1-score-val, body.theme-hacker #p2-score-val,
body.theme-hacker #round-text, body.theme-hacker #countdown-text {
    font-family: 'Courier New', monospace !important;
    color: #00ff41;
    text-shadow: 0 0 8px #00ff41;
}

body.theme-pixel #scoreboard, body.theme-pixel .cooldown-item {
    font-family: 'Press Start 2P', cursive;
    background: #fff;
    border: 4px solid #000;
    border-radius: 0;
    box-shadow: 6px 6px #000;
    color: #000;
}

body.theme-pixel #round-announcer {
    border: none;
    background: none;
    box-shadow: none;
}

body.theme-pixel #p1-score-val, body.theme-pixel #p2-score-val,
body.theme-pixel #round-text, body.theme-pixel #countdown-text {
    font-family: 'Press Start 2P', cursive !important;
    color: #000;
    text-shadow: none;
}

body.theme-ronk #theme-btn {
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

body.theme-dreamcore #theme-btn {
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

body.theme-white-black #theme-btn {
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    border-radius: 0;
}

/* Theme Selection Arrows */

body.theme-hacker #theme-btn {
    border-color: #00ff41;
    color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

#theme-btn:hover {
    background: var(--btn-color);
    color: #000;
    box-shadow: 0 0 40px var(--btn-color);
    text-shadow: none;
    transform: scale(1.05);
}

#theme-btn:active {
    transform: scale(0.98);
}

#online-lobby {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    width: 700px;
    max-height: 95vh;
}

#online-lobby h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    text-shadow: var(--btn-glow);
    letter-spacing: 0.5rem;
}

#player-nickname {
    width: 280px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px;
    color: #fff;
    text-align: center;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.1rem;
    margin-bottom: 0.4rem;
}

.lobby-buttons {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.8rem;
    justify-content: center;
}

#online-lobby input#join-id {
    width: 280px;
}

#lobby-status {
    margin: 1.2rem 0 0.4rem 0;
    font-size: 0.8rem;
    opacity: 0.6;
    letter-spacing: 0.2rem;
}

#lobby-log {
    font-family: 'VT323', monospace;
    font-size: 0.7rem;
    color: #ff0040;
    background: rgba(0,0,0,0.3);
    padding: 6px 12px;
    border-radius: 5px;
    margin-bottom: 1rem;
    width: 380px;
    text-align: center;
    border: 1px solid rgba(255,0,0,0.1);
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    align-items: center;
}

#join-id {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--btn-color);
    padding: 0.8rem;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    border-radius: 12px;
    text-align: center;
    outline: none;
    width: 100%;
    max-width: 380px;
    margin: 0;
}

#join-id::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body {
    background-color: #000;
    color: white;
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    transition: background-color 1s ease;
}

/* GALAXY BACKGROUND - Enhanced for vibrant purple nebula look */
body:not([class*="theme-"]) {
    background: radial-gradient(circle at 50% 50%, #1a0b2e 0%, #0a0a1a 60%, #000 100%) !important;
}

/* GALAXY STARDUST - ONLY IN DEFAULT THEME */
body:not([class*="theme-"])::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
    opacity: 0.4; /* Reduced opacity */
    pointer-events: none;
    z-index: 1;
}

/* Simplified Nebula - just subtle pulsing/moving instead of 200% rotation */
body:not([class*="theme-"])::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 0, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: nebulaPulse 10s ease-in-out infinite;
}

@keyframes nebulaPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Menu Tier Styles */
.menu-tier {
    display: flex;
    flex-direction: column;
    gap: 0.8rem; /* Further reduced gap */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    padding: 10px; /* Reduced padding */
}

.menu-tier button {
    width: 100%;
    margin-bottom: 0.2rem; /* Reduced margin */
    padding: 12px 25px !important; /* Slightly more compact padding */
}

.menu-tier.hidden {
    display: none !important;
}

.back-tier-btn {
    margin-top: 1rem !important;
    font-size: 0.9rem !important;
    padding: 0.8rem 2rem !important;
    opacity: 0.8;
}

.back-tier-btn:hover {
    opacity: 1;
}

#gameCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    pointer-events: none !important;
    background: transparent;
    margin: 0; 
    position: relative;
    z-index: 5;
}

#room-selection {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    width: 600px;
    justify-content: center;
}

.room-column {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 280px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

#refresh-rooms {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 2px 8px;
    font-size: 0.55rem;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

#refresh-rooms:hover {
    background: rgba(255, 255, 255, 0.2);
}

.room-header {
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.2rem;
    opacity: 0.5;
    text-align: left;
}

.room-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.player-count {
    font-size: 0.6rem;
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
}

.room-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.room-item.full {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.room-item.full .player-count {
    color: #ff3131;
    background: rgba(255, 49, 49, 0.2);
}

.room-item.empty {
    cursor: default;
    opacity: 0.3;
    font-weight: 400;
}

.room-item.empty:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.05);
}

#waiting-room {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 4rem; /* Increased padding */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
    width: 900px; /* Increased width from 700px to 900px */
}

.players-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.player-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 220px;
    gap: 1.2rem;
}

.slot-label {
    font-size: 0.6rem;
    opacity: 0.5;
    letter-spacing: 0.2rem;
}

.player-preview {
    width: 100px;
    height: 100px;
    background: #ff00ff;
    border-radius: 12px;
    box-shadow: 0 0 25px currentColor;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
}

.player-name {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.1rem;
}

.ready-indicator {
    padding: 6px 15px;
    background: rgba(255, 0, 0, 0.2);
    color: #ff3131;
    border: 1px solid #ff3131;
    border-radius: 20px;
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    transition: all 0.3s ease;
}

.ready-indicator.is-ready {
    background: rgba(0, 255, 65, 0.2);
    color: #00ff41;
    border-color: #00ff41;
}

.vs-divider {
    font-size: 2.5rem;
    font-weight: 900;
    font-style: italic;
    opacity: 0.2;
}

.waiting-room-controls {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

#waiting-exit-btn {
    margin-top: 1.5rem;
}

#lobby-back-btn {
    margin-top: 1rem;
}

/* --- GALAXY THEME EFFECTS (RESTORED) --- */
body.theme-galaxy {
    background: radial-gradient(circle at 50% 50%, #1a0b2e 0%, #0a0a1a 60%, #000 100%) !important;
}

body.theme-galaxy::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

body.theme-galaxy::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 0, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: nebulaPulse 10s ease-in-out infinite;
}

body.theme-galaxy #menu h1 {
    font-family: 'Pacifico', cursive;
    color: #ff00ff;
    font-size: 8rem;
    text-shadow: 0 0 20px #ff00ff, 0 0 40px #00ffff;
}

body.theme-galaxy button:not(.nav-arrow) {
    border-radius: 15px;
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid #ff00ff;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

body.theme-galaxy button:not(.nav-arrow):hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.6);
}

body.theme-galaxy .nav-arrow:active {
    animation: nav-arrow-press-galaxy 0.2s ease-out forwards;
}

/* --- CUSTOMIZE CUBE --- */
.custom-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 1.5rem;
    margin: 2rem 0;
}

.cube-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    width: 100%;
}

.cube-preview-container {
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.color-cube {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    background-color: #ff00ff; /* Fallback */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 5px solid rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-size: cover;
    background-position: center;
    position: relative;
}

.nav-arrow {
    background: transparent;
    border: none;
    color: white;
    font-size: 4rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.nav-arrow:hover {
    transform: scale(1.2);
}

.upload-overlay {
    text-align: center;
    color: white;
}

.plus-icon {
    font-size: 4rem;
    font-weight: bold;
}

#custom-page {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 5000 !important;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 4rem; /* Increased padding */
    border-radius: 40px; /* Increased border-radius */
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem; /* Increased gap */
    min-width: 600px; /* Added min-width */
    box-sizing: border-box !important;
}

#custom-page.hidden {
    display: none !important;
}

#custom-title {
    font-size: 3.5rem; /* Increased font size */
    margin: 0 0 1rem 0;
    text-shadow: var(--btn-glow);
}

.hidden {
    display: none !important;
}

#menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    gap: 1.5rem;
    text-align: center;
    background: transparent;
}

#menu h1 {
    font-size: clamp(2rem, 8vw, 4rem);
    margin: 0 0 1.5rem 0;
    padding: 0;
    width: auto;
    max-width: 90vw;
}

.menu-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.menu-tier button {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
}

#game-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

#top-ui {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    z-index: 5000;
    pointer-events: none;
    transition: all 0.3s ease;
    width: 100%;
}

#scoreboard {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.5rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--border-color, #fff);
    border-radius: 8px;
    position: absolute; /* Force it to the absolute center of top-ui */
    left: 50%;
    transform: translateX(-50%) scale(var(--ui-scale));
    z-index: 5000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cooldown-item {
    position: absolute;
    transform: scale(var(--ui-scale));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 120px;
    pointer-events: auto;
    z-index: 5000;
}

.dash-item {
    left: 20px; /* Lock to left side */
}

.charge-item {
    right: 20px; /* Lock to right side */
}

/* Ronk Scoreboard Override */
body.theme-ronk #scoreboard {
    border-color: #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    border-radius: 0;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

/* White Black Scoreboard Override */
body.theme-white-black #scoreboard {
    border-color: #ffffff;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 0;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* PinkCore Scoreboard Override */
body.theme-pinkcore #scoreboard {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.3);
    border-radius: 30px;
    backdrop-filter: blur(20px);
}

/* Hacker Scoreboard Override */
body.theme-hacker #scoreboard {
    border-color: #00ff00;
    background: #000;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

/* Pixel Scoreboard Override */
body.theme-pixel #scoreboard {
    border: 4px solid #fff;
    background: #000;
    border-radius: 0;
    box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.5);
}

#pause-menu {
    background: rgba(0, 0, 0, 0.95);
    padding: 60px;
    border: 3px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    z-index: 10000; /* Increased to be above everything */
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.9);
    pointer-events: auto;
    transition: all 0.3s ease;
}

/* --- THEME-SPECIFIC PAUSE MENUS --- */

/* RONK */
body.theme-ronk #pause-menu {
    border-color: #ff0000;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.3), inset 0 0 30px rgba(255, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(20, 0, 0, 0.95), rgba(0, 0, 0, 0.98));
    clip-path: polygon(5% 0, 100% 0, 100% 95%, 95% 100%, 0 100%, 0 5%);
}

/* WHITE BLACK */
body.theme-white-black #pause-menu {
    border-color: #fff;
    background: rgba(0, 0, 0, 0.98);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
    border-radius: 0;
}

/* PINKCORE */
body.theme-pinkcore #pause-menu {
    border-color: #ff00ff;
    background: rgba(20, 0, 20, 0.9);
    box-shadow: 0 0 60px rgba(255, 0, 255, 0.4);
    border-radius: 40px;
    backdrop-filter: blur(20px);
}

/* HACKER */
body.theme-hacker #pause-menu {
    border-color: #00ff41;
    background: #000;
    box-shadow: 0 0 20px #00ff41;
    border-radius: 0;
    font-family: 'VT323', monospace;
}

body.theme-hacker #pause-menu h2 {
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
}

/* PIXEL */
body.theme-pixel #pause-menu {
    border: 6px solid #fff;
    background: #000;
    box-shadow: 10px 10px 0 #ff0000;
    border-radius: 0;
}

body.theme-pixel #pause-menu h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2rem;
    text-shadow: 4px 4px #ff0000;
}

#pause-menu h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    margin-bottom: 30px;
    letter-spacing: 0.5rem;
    color: #fff;
    text-shadow: 0 0 20px var(--border-color);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.score-item.pop {
    transform: scale(1.3);
}

.score-label {
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.4;
    margin-bottom: 2px;
}

#p1-score-val, #p2-score-val {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 0.9;
    text-shadow: 0 0 20px currentColor;
    transition: all 0.2s ease;
}

.score-vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    opacity: 0.1;
    margin-top: 10px;
}

#status, #game-over, #theme-btn, .menu-tier, #menu h1, #custom-page, #online-lobby, #gameCanvas {
    pointer-events: auto !important; /* Re-enable for specific elements */
}

button:not(.nav-arrow) {
    pointer-events: auto !important;
    z-index: 10000 !important;
    background: transparent;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 25px;
    font-size: 0.9rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: 0.2rem;
    border-radius: var(--border-radius);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    text-align: center;
}

button:not(.nav-arrow):hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

button:not(.nav-arrow):active {
    transform: translateY(0px);
    background: rgba(255, 255, 255, 0.1);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nav-arrow {
    background: transparent !important;
    border: none !important;
    color: white !important;
    font-size: 5rem !important;
    cursor: pointer;
    transition: transform 0.2s, text-shadow 0.2s;
    padding: 0 1rem !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* .nav-arrow::after { display: none !important; } */

.nav-arrow:hover {
    transform: scale(1.3) !important;
    text-shadow: 0 0 20px white;
}

@keyframes pulseTitle {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.08); opacity: 1; }
}

#status {
    position: fixed;
    top: 90px; 
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    display: flex; 
    gap: 3rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 12px 40px;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    backdrop-filter: blur(15px);
    font-size: 1.1rem;
    z-index: 100;
    opacity: 0.9;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.cooldown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px; /* Reduced gap */
    pointer-events: none;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.cooldown-label {
    font-size: 0.6rem; /* Smaller font */
    letter-spacing: 0.1rem;
    opacity: 0.8;
    color: #fff;
}

.bar-container {
    width: 80px; /* More compact bars */
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
}

.bar.ready {
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}


#game-over {
    background: rgba(10, 5, 20, 0.95);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border: 3px solid var(--btn-color);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), var(--btn-glow);
    text-align: center;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 25px;
    color: white;
    width: 90%;
    max-width: 400px;
}

#game-over h2 {
    font-size: 2.5rem;
    margin: 0 0 1.5rem 0;
    color: white;
    text-shadow: var(--btn-glow);
    letter-spacing: 0.7rem;
}

#game-over button {
    margin: 0.5rem 0 !important;
    width: 100% !important;
    max-width: 400px !important;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Screen transitions */
.hidden {
    display: none !important;
}

/* Smooth UI Transitions */

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

#game-over {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 60px;
    backdrop-filter: blur(20px);
}

#winner-msg {
    font-weight: 300;
    font-size: 3rem;
    letter-spacing: 1rem;
    margin-bottom: 40px;
}

.float-up-menu {
    animation: fadeIn 1.4s ease-out forwards;
}

/* Specific animations for centered overlays */
.overlay-fade-in {
    animation: overlayFadeIn 1.5s ease-out forwards;
}

@keyframes overlayFadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes nav-arrow-press-ronk {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes nav-arrow-press-white-black {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes nav-arrow-press-pinkcore {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
        color: #ff69b4; /* Hot pink */
    }
    100% {
        transform: scale(1);
    }
}

@keyframes nav-arrow-press-hacker {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    25% {
        transform: translate(2px, 2px) scale(1.05);
        opacity: 0.8;
    }
    50% {
        transform: translate(-2px, -2px) scale(0.95);
        opacity: 1;
    }
    75% {
        transform: translate(1px, -1px) scale(1.02);
        opacity: 0.9;
    }
}

@keyframes nav-arrow-press-pixel {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.8);
        filter: brightness(1.5);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes nav-arrow-press-dreamcore {
    0% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
        filter: hue-rotate(90deg);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

@keyframes nav-arrow-press-galaxy {
    0% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 0 0 15px rgba(255, 255, 255, 1);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
    }
}








#custom-page, #online-lobby {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
}

/* Custom Preview Overrides moved to Customization Page Fixes section above */

