:root {
    --bg-color: #050505;
    --primary-color: #00f3ff;
    /* Cyan Neon */
    --secondary-color: #ff0055;
    /* Pink Neon */
    --accent-color: #ccff00;
    /* Lime Neon */
    --text-color: #ffffff;
    --font-main: 'Courier New', Courier, monospace;
    /* Placeholder for a tech font */
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    /* Prevent default touch actions like scrolling */
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Startup loader to avoid EN -> FR text flash */
#app-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #101010 0%, #000 70%);
}

.app-loader-box {
    text-align: center;
}

.loader-dots {
    display: inline-flex;
    gap: 8px;
    margin-top: 8px;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
    animation: loaderPulse 1s infinite ease-in-out;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.12s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.24s;
}

@keyframes loaderPulse {
    0%, 80%, 100% {
        transform: scale(0.75);
        opacity: 0.45;
    }
    40% {
        transform: scale(1.15);
        opacity: 1;
    }
}

body.app-loading #app-loader {
    display: flex;
}

body.app-loading #game-container {
    visibility: hidden;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    /* Mobile aspect ratio constraint on desktop */
    max-height: 900px;
    background: #111;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

/* Layers */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through by default */
}

#game-layer {
    position: absolute;
    top: 60px;
    /* Below HUD top bar */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    pointer-events: auto;
    /* Game layer needs interaction */
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    overflow: hidden;
}

#ui-layer {
    pointer-events: none;
    z-index: 10;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

.active {
    opacity: 1;
    pointer-events: auto;
}

/* Tutorial Focus Halo */
.tutorial-focus-halo {
    position: absolute;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color), inset 0 0 10px var(--primary-color);
    pointer-events: none;
    z-index: 10001;
    animation: halo-pulse 1.5s infinite;
}

@keyframes halo-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 0.3; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* Landing Screen Tweak */
#landing-screen {
    z-index: 100;
}

/* Typography & Buttons */
h1,
h2 {
    text-transform: uppercase;
    letter-spacing: 4px;
    text-align: center;
    text-shadow: 0 0 10px var(--primary-color);
}



.glitch-title {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 0;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    text-shadow: 0 0 5px var(--secondary-color);
}

#main-menu h2.subtitle {
    margin-bottom: 1rem !important;
    margin-top: 0rem !important;
}

#main-menu .glitch-title {
    margin-top: 0.2rem !important;
}

.neon-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 15px 30px;
    font-size: 1.5rem;
    font-family: var(--font-main);
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 10px var(--primary-color), inset 0 0 10px var(--primary-color);
    transition: all 0.2s;
}

.neon-btn:active {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 20px var(--primary-color), inset 0 0 20px var(--primary-color);
}

.neon-btn.small {
    padding: 10px 20px;
    font-size: 1rem;
}

.neon-input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--secondary-color);
    color: white;
    padding: 15px;
    font-family: var(--font-main);
    font-size: 1.2rem;
    margin-bottom: 15px;
    width: 100%;
    outline: none;
    box-shadow: 0 0 5px var(--secondary-color);
    transition: all 0.2s;
}

.neon-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

/* Login Screen */
.login-form {
    display: flex;
    flex-direction: column;
    width: 300px;
    align-items: center;
}

.login-actions {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

/* HUD - Unified 3-block layout */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    /* Let clicks pass through to game */
}

/* TOP BLOCK: Score / Lives / Quit */
.hud-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    position: relative;
    width: 100%;
    height: 60px;
    padding: 0 60px 0 20px;
    /* Right padding for quit button */
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    flex-shrink: 0;
}

.hud-stat-box {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    white-space: nowrap;
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 0 0 5px var(--primary-color);
}

.hud-divider {
    width: 2px;
    height: 28px;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.hud-quit-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
}

/* MIDDLE BLOCK: Transparent spacer (game shows through) */
.hud-spacer {
    flex: 1;
    pointer-events: none;
}

/* BOTTOM BLOCK: Timer bar */
.timer-bar {
    width: 100%;
    height: 8px;
    background: #222;
    flex-shrink: 0;
    pointer-events: none;
}

#timer-fill {
    width: 100%;
    height: 100%;
    background: var(--secondary-color);
    box-shadow: 0 0 8px var(--secondary-color);
    transform-origin: left;
}

/* Quit Button (general — override old absolute positioning) */
#quit-btn {
    z-index: 1000;
}

.icon-btn {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0055;
    color: #ff0055;
    font-size: 1.5rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    pointer-events: auto;
    box-shadow: 0 0 10px #ff0055;
}

.icon-btn:hover {
    background: #ff0055;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px #ff0055;
}

.icon-btn:active {
    transform: scale(0.9);
}

/* Transition Screen */
#transition-screen {
    background: var(--primary-color);
    color: #000;
}

#instruction-text {
    font-size: 3rem;
    color: #000;
    text-shadow: none;
    font-weight: 900;
}

/* Microgame Elements */
.tap-target {
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--secondary-color);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--secondary-color);
    transform: translate(-50%, -50%);
    animation: pulse 0.5s infinite alternate;
    cursor: pointer;
}

.swipe-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10rem;
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-color);
}

.swipe-arrow.up {
    transform: translate(-50%, -50%) rotate(-90deg);
}

.swipe-arrow.down {
    transform: translate(-50%, -50%) rotate(90deg);
}

.swipe-arrow.left {
    transform: translate(-50%, -50%) rotate(180deg);
}

.swipe-arrow.right {
    transform: translate(-50%, -50%) rotate(0deg);
}

@keyframes pulse {
    from {
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.dont-move-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    25% {
        transform: translate(-50%, -50%) rotate(-5deg);
    }

    75% {
        transform: translate(-50%, -50%) rotate(5deg);
    }

}

/* All Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 90%;
    max-height: 60%;
    overflow-y: auto;
    padding: 10px;
}

.game-card {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--primary-color);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-card:hover {
    background: var(--primary-color);
    cursor: pointer;
    transition: transform 0.1s, background 0.1s;
}

.game-card:active {
    transform: scale(0.95);
}

.game-card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}


.game-card.locked {
    background: rgba(40, 40, 40, 0.4);
    border: 1px dashed #555;
    opacity: 0.6;
    cursor: default;
    filter: grayscale(1);
    pointer-events: none;
}

.game-card.locked .game-card-title {
    color: #666;
    text-shadow: none;
}

/* Tutorial Badge */
.tutorial-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 5px var(--accent-color);
    transition: all 0.2s;
    z-index: 5;
}

.tutorial-badge:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 10px var(--accent-color);
    transform: scale(1.1);
}

/* Tutorial Overlay & Modal */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tutorial-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tutorial-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

.tutorial-modal {
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3), inset 0 0 15px rgba(0, 243, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tutorial-overlay.active .tutorial-modal {
    transform: scale(1);
}

.tutorial-modal-icon {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.tutorial-modal-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--primary-color);
}

.tutorial-section {
    width: 100%;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
}

.tutorial-section-label {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.tutorial-section-text {
    font-size: 1rem;
    color: #fff;
    line-height: 1.4;
}

.tutorial-btn-row {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.tutorial-close-btn {
    border-color: #555 !important;
    color: #aaa !important;
    box-shadow: none !important;
}

.tutorial-close-btn:hover {
    background: #333 !important;
    color: #fff !important;
}

.tutorial-play-btn {
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
    box-shadow: 0 0 10px var(--accent-color), inset 0 0 5px var(--accent-color) !important;
}

.tutorial-play-btn:hover {
    background: var(--accent-color) !important;
    color: #000 !important;
}

/* ========== PLAYBACK TUTORIAL SYSTEM ========== */

.playback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

.playback-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.playback-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

/* Game container — fully visible, no veil */
.playback-game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    filter: none;
    pointer-events: none;
    z-index: 1;
    background: transparent;
}

/* Ghost Cursor */
.playback-ghost-cursor {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.1) 60%, transparent 70%);
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4), 0 0 30px var(--primary-color, #00f3ff);
    transform: translate(-50%, -50%);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.playback-overlay.active .playback-ghost-cursor {
    opacity: 1;
}

.playback-cursor-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    transition: transform 0.15s, opacity 0.15s;
}

/* Tap animation */
.playback-ghost-cursor.tapping {
    animation: playback-tap-pulse 0.3s ease-out;
}

.playback-ghost-cursor.tapping .playback-cursor-inner {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0.5;
}

@keyframes playback-tap-pulse {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 15px rgba(255,255,255,0.4), 0 0 30px var(--primary-color); }
    50% { transform: translate(-50%, -50%) scale(1.4); box-shadow: 0 0 25px rgba(255,255,255,0.7), 0 0 50px var(--primary-color); }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 15px rgba(255,255,255,0.4), 0 0 30px var(--primary-color); }
}

/* Swipe animation */
.playback-ghost-cursor.swiping {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 40px var(--primary-color);
}

.playback-ghost-cursor.swiping::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0.3;
    animation: playback-trail-fade 0.6s ease-out;
}

@keyframes playback-trail-fade {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(2); opacity: 0; }
}

/* Hold animation */
.playback-ghost-cursor.holding {
    animation: playback-hold-pulse 0.8s ease-in-out infinite;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color), 0 0 40px var(--accent-color);
}

@keyframes playback-hold-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* Instructions Panel — frosted glass card */
.playback-instructions {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    text-align: center;
    width: 88%;
    max-width: 420px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: playback-instructions-in 0.5s ease-out 0.3s both;
}

@keyframes playback-instructions-in {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.playback-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 0 15px var(--primary-color);
}

.playback-objective {
    font-size: 0.95rem;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 8px;
    padding: 0;
}

.playback-controls {
    font-size: 0.8rem;
    color: var(--secondary-color);
    line-height: 1.3;
    font-style: italic;
    opacity: 0.8;
}

/* Bottom Bar */
.playback-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 30px 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    animation: playback-bar-in 0.4s ease-out 0.5s both;
}

@keyframes playback-bar-in {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Circular Timer */
.playback-timer-container {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.playback-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.playback-timer-bg {
    fill: none;
    stroke: #333;
    stroke-width: 3;
}

.playback-timer-circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke 0.3s;
    filter: drop-shadow(0 0 4px var(--primary-color));
}

.playback-timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
    transition: color 0.3s;
}

/* Skip Button */
.playback-skip-btn {
    padding: 12px 35px;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
    box-shadow: 0 0 15px var(--accent-color), inset 0 0 8px var(--accent-color) !important;
    animation: playback-btn-glow 2s infinite alternate;
}

.playback-skip-btn:hover {
    background: var(--accent-color) !important;
    color: #000 !important;
    transform: scale(1.05);
}

.playback-disable-btn {
    padding: 10px 18px;
    font-size: 0.8rem;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    box-shadow: 0 0 8px var(--primary-color), inset 0 0 4px var(--primary-color) !important;
}

.playback-disable-btn:hover {
    background: var(--primary-color) !important;
    color: #000 !important;
}

@keyframes playback-btn-glow {
    0% { box-shadow: 0 0 10px var(--accent-color), inset 0 0 5px var(--accent-color); }
    100% { box-shadow: 0 0 20px var(--accent-color), 0 0 40px var(--accent-color), inset 0 0 10px var(--accent-color); }
}

/* ========== END PLAYBACK TUTORIAL ========== */

.menu-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    margin-bottom: 5px;
    font-style: italic;
    text-align: center;
    max-width: 250px;
}

.all-games-banner {
    background: rgba(var(--primary-color-rgb, 0, 243, 255), 0.1);
    border: 1px solid var(--primary-color);
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    width: 90%;
    animation: neon-pulse 2s infinite;
}

/* Lose Life Animation */
#lose-life-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s;
}

#lose-life-overlay.active {
    opacity: 1;
}

.neon-cross {
    position: relative;
    width: 200px;
    height: 200px;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#lose-life-overlay.active .neon-cross {
    transform: scale(1);
}

.neon-cross::before,
.neon-cross::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 20px;
    background: #ff0055;
    border-radius: 10px;
    box-shadow: 0 0 20px #ff0055, 0 0 40px #ff0055;
}

.neon-cross::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.neon-cross::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Practice Result Overlay */
#practice-result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#practice-result-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.neon-check {
    width: 80px;
    height: 40px;
    border-left: 10px solid #ccff00;
    border-bottom: 10px solid #ccff00;
    transform: rotate(-45deg) translate(10px, -20px);
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 0 10px #ccff00) drop-shadow(0 0 20px #ccff00);
}

.neon-cross-large {
    position: relative;
    width: 150px;
    height: 150px;
}

.neon-cross-large::before,
.neon-cross-large::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 15px;
    background: #ff0055;
    box-shadow: 0 0 20px #ff0055;
    border-radius: 8px;
}

.neon-cross-large::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.neon-cross-large::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.speed-up-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid #ccff00;
    margin-left: 10px;
    filter: drop-shadow(0 0 10px #ccff00);
    animation: bounce 0.5s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

/* Skin Card */
.skin-card {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.skin-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.skin-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--preview-primary) 50%, var(--preview-secondary) 50%);
    box-shadow: 0 0 10px var(--preview-primary);
}

.skin-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

/* --- LOGIN & ECONOMY CSS --- */
.neon-input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--secondary-color);
    color: white;
    padding: 15px;
    font-family: var(--font-main);
    font-size: 1.2rem;
    margin-bottom: 15px;
    width: 100%;
    outline: none;
    box-shadow: 0 0 5px var(--secondary-color);
    transition: all 0.2s;
}

.neon-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.login-form {
    display: flex;
    flex-direction: column;
    width: 300px;
    align-items: center;
}

.login-actions {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.neon-btn.small {
    padding: 10px 20px;
    font-size: 1rem;
}

.coins-container {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 5px var(--text-color);
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #333;
    color: var(--accent-color);
}

.skin-price {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-top: 5px;
}

.skin-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #888;
    z-index: 10;
}

.skin-card.locked {
    opacity: 0.7;
    filter: grayscale(0.8);
    border-color: #555 !important;
    box-shadow: none !important;
}

.skin-card.locked:hover {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 10px var(--accent-color) !important;
    cursor: pointer;
}

/* Checkmark for Selected Skins */
.skin-card.selected::after {
    content: '✔';
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--accent-color);
    color: #000;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    text-align: center;
    line-height: 25px;
    font-weight: bold;
    box-shadow: 0 0 10px var(--accent-color);
    border: 2px solid #fff;
    z-index: 15;
}


/* --- PROGRESSION CSS --- */
.coin-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color), 0 0 5px var(--secondary-color) inset;
    text-align: center;
    line-height: 22px;
    font-size: 0;
    margin-right: 5px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.bolt-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    fill: var(--secondary-color);
    filter: drop-shadow(0 0 4px var(--secondary-color));
    margin-right: 5px;
    animation: flash 2s infinite;
    vertical-align: middle;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 10px #ffeb3b;
    }

    50% {
        opacity: 0.7;
        text-shadow: 0 0 5px #ffeb3b;
    }
}

.level-badge {
    position: absolute;
    top: 55px;
    /* Below HUD Top */
    right: 15px;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 5px var(--primary-color);
}


/* --- PROFILE SCREEN --- */
.profile-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#profile-screen {
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 24px 0 40px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#profile-screen::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

#profile-screen .profile-card {
    margin-top: 12px;
    margin-bottom: 20px;
}

#profile-screen #language-select {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    background-color: rgba(0, 0, 0, 0.92) !important;
    border-color: var(--secondary-color) !important;
    appearance: none;
    -webkit-appearance: none;
    padding: 0 10px !important;
    margin-bottom: 0 !important;
    height: 34px !important;
    line-height: 34px;
    font-size: 0.9rem !important;
    text-align: center;
}

#profile-screen #language-select:focus,
#profile-screen #language-select:active {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    background-color: rgba(0, 0, 0, 0.92) !important;
}

#profile-screen #language-select option {
    color: #fff !important;
    background-color: #111 !important;
}

.level-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color), inset 0 0 15px var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
}

.xp-bar-bg {
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #555;
}

.xp-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    transition: width 0.5s ease-out;
}

/* --- UNIFORM BUTTONS --- */
.menu-btn {
    width: 250px !important;
    /* Force width for uniform look */
    max-width: 90%;
}


/* --- LARGE BUTTONS --- */
.menu-btn {
    width: 280px !important;
    /* Increased from 250px */
    max-width: 95%;
    font-size: 1.2rem;
    padding: 15px 20px;
}


/* --- FIXES --- */
.skin-card.locked .skin-price {
    /* Ensure visibility behind lock */
    z-index: 11;
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    /* Darken bg to read text */
    padding: 2px 5px;
    border-radius: 4px;
}

/* XP Bar in Menu */
.menu-xp-container {
    display: inline-block;
    width: 100px;
    height: 10px;
    background: #333;
    border: 1px solid #555;
    border-radius: 5px;
    margin-left: 10px;
    position: relative;
    vertical-align: middle;
    overflow: hidden;
}

.menu-xp-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
}

.menu-level-text {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-left: 5px;
    font-weight: bold;
}


/* --- STYLIZED SCROLLBAR --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-left: 1px solid var(--primary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
    box-shadow: 0 0 10px var(--primary-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
    box-shadow: 0 0 15px var(--secondary-color);
}


/* --- SOCIAL / FRIENDS --- */
.friend-card {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid #333;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px;
    transition: all 0.2s;
}

.friend-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.friend-name {
    font-weight: bold;
    color: #fff;
}

.friend-details {
    font-size: 0.8rem;
    color: #aaa;
}

.friend-highscores {
    font-size: 0.7rem;
    color: var(--accent-color);
    margin-top: 5px;
}

#friends-list {
    width: 100%;
    max-height: 400px;
    /* Scrollable list */
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Custom Scrollbar for friends list */
#friends-list::-webkit-scrollbar {
    width: 8px;
}

#friends-list::-webkit-scrollbar-track {
    background: #111;
}

#friends-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

#friends-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.share-btn {
    background: #1da1f2;
    /* Twitter Blue-ish */
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: var(--font-main);
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(29, 161, 242, 0.5);
    transition: all 0.2s;
    margin-top: 10px;
}

.share-btn:hover {
    transform: scale(1.05);
    background: #4db5f5;
}

.friend-code-display {
    background: #000;
    border: 1px dashed var(--secondary-color);
    color: var(--secondary-color);
    padding: 10px;
    font-family: monospace;
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin: 10px 0;
    cursor: pointer;
}

.friend-code-display:active {
    background: #220011;
}

/* ENABLE TOUCH SCROLLING FOR MENUS */
.games-grid,
#leaderboard-list,
#skins-grid,
#skins-grid-effects,
#friends-list,
#profile-bests-list,
#profile-screen,
#admin-screen,
.admin-panel {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* Allow children to trigger scroll too (overriding the global * touch-action: none) */
.games-grid *,
#leaderboard-list *,
#skins-grid *,
#skins-grid-effects *,
#friends-list *,
#profile-bests-list *,
#profile-screen *,
#admin-screen *,
.admin-panel * {
    touch-action: pan-y !important;
}

/* Large Challenge Card */
.challenge-card-large {
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: fadeSlideUp 0.3s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.challenge-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.challenge-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.challenge-stars {
    font-size: 1.2rem;
}

.challenge-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    text-shadow: 0 0 20px var(--primary-color);
}

.challenge-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 10px;
}

.challenge-desc {
    font-size: 1rem;
    color: #ccc;
    text-align: center;
    margin-bottom: 20px;
    font-style: italic;
}

.challenge-goals {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
}

.goal-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Utilities */
.shake {
    animation: shake-anim 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake-anim {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}


/* Neon Stars */
.neon-star {
    font-size: 1.5rem;
    /* Adjust as needed */
    display: inline-block;
}

.neon-star.filled {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px var(--primary-color));
    animation: pulseStar 2s infinite;
}

.neon-star.empty {
    color: #333;
    /* Dark gray for empty */
    text-shadow: none;
    opacity: 0.5;
}

@keyframes pulseStar {
    0% {
        filter: drop-shadow(0 0 5px var(--primary-color));
    }

    50% {
        filter: drop-shadow(0 0 10px var(--secondary-color));
    }

    100% {
        filter: drop-shadow(0 0 5px var(--primary-color));
    }
}


/* Neon Notifications */
.neon-notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.neon-notification {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--primary-color);
    border-left: 5px solid var(--secondary-color);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 0 15px var(--primary-color);
    font-family: var(--font-main);
    font-size: 1.1rem;
    text-transform: uppercase;
    animation: slideInDown 0.3s ease-out forwards;
    pointer-events: auto;
    min-width: 300px;
    text-align: center;
}

.neon-notification.hiding {
    animation: fadeOutUp 0.3s ease-in forwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}


/* Big Stars for Challenge Result */
.challenge-big-stars {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px 0 20px 0;
}

.big-star-slot {
    width: 40px;
    height: 40px;
    position: relative;
    display: inline-block;
}

.big-star-bg {
    font-size: 40px;
    color: #333;
    position: absolute;
    top: 0;
    left: 0;
}

.big-star-fill {
    font-size: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--primary-color));
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.big-star-fill.awarded {
    opacity: 1;
    transform: scale(1);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 480px) {
    .hud-top {
        padding: 0 10px;
    }

    .hud-stat-box {
        font-size: 0.9rem;
    }

    #quit-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

/* --- Versus Mode Extras --- */

/* Neon Heart */
.neon-heart {
    display: inline-block;
    color: var(--secondary-color);
    text-shadow: 0 0 5px var(--secondary-color), 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color);
    font-size: 1.2em;
    margin: 0 2px;
}

/* Neon Loader/Waiter */
.neon-loader {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    margin-right: 20px;
}

.neon-loader div {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    animation: neon-pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    box-shadow: 0 0 10px var(--primary-color);
}

.neon-loader div:nth-child(2) {
    animation-delay: 0.6s;
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-color);
}

.neon-loader div:nth-child(3) {
    animation-delay: 1.2s;
    border-color: var(--primary-color);
}

@keyframes neon-pulse-ring {
    0% {
        transform: scale(0.1);
        opacity: 1;
    }

    80% {
        transform: scale(1);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

.leaderboard-table {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    border-collapse: collapse;
    color: #fff;
    font-size: 1.2rem;
}

.leaderboard-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-table .highlight {
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 5px var(--primary-color);
}

/* ============================
   ADMIN PANEL STYLES
   ============================ */

#admin-screen {
    justify-content: flex-start;
    padding-top: 20px;
    overflow-y: auto;
}

.admin-header {
    width: 90%;
    max-width: 500px;
    text-align: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.admin-title {
    color: var(--secondary-color);
    text-shadow: 0 0 15px var(--secondary-color), 0 0 5px var(--secondary-color);
    font-size: 1.8rem;
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.admin-tab {
    background: transparent;
    border: 2px solid #444;
    color: #888;
    padding: 8px 24px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.admin-tab.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3), inset 0 0 10px rgba(0, 243, 255, 0.1);
    text-shadow: 0 0 8px var(--primary-color);
}

.admin-tab:hover:not(.active) {
    border-color: #666;
    color: #ccc;
}

.admin-panel {
    width: 90%;
    max-width: 500px;
    flex: 1;
    overflow-y: visible;
    margin-bottom: 10px;
}

.admin-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.admin-search-bar .neon-input {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
    margin-bottom: 0;
    flex: 1;
}

.admin-search-bar .neon-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.admin-count {
    color: #888;
    font-size: 0.85rem;
    white-space: nowrap;
}

.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 5px;
}

.admin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 10px 0;
}

.admin-pagination-btn {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    padding: 6px 14px;
    font-family: var(--font-main);
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
    border-radius: 4px;
}

.admin-pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.3);
}

.admin-pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.admin-pagination-info {
    color: #888;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.admin-user-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    position: relative;
}

.admin-user-card:hover {
    border-color: #ff3333;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.admin-user-card.blocked {
    border-color: #ff0055;
    background: rgba(255, 0, 85, 0.1);
    opacity: 0.7;
}

.admin-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    background: rgba(0, 243, 255, 0.1);
    flex-shrink: 0;
}

.admin-user-info {
    flex: 1;
    min-width: 0;
}

.admin-user-name {
    font-weight: bold;
    color: #fff;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-user-name .admin-badge {
    font-size: 0.65rem;
    background: #ff3333;
    color: #000;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: bold;
}

.admin-user-name .blocked-badge {
    font-size: 0.65rem;
    background: #ff0055;
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
}

.admin-user-name .premium-badge {
    font-size: 0.65rem;
    background: #FFD700;
    color: #000;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 5px;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    font-weight: bold;
}

.admin-user-meta {
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
}

.admin-user-stats {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.admin-user-stat {
    text-align: center;
    font-size: 0.7rem;
    color: #888;
}

.admin-user-stat .stat-val {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.admin-user-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.admin-action-btn {
    background: transparent;
    border: 1px solid #555;
    color: #888;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.admin-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.4);
}

.admin-action-btn.danger:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: rgba(255, 0, 85, 0.15);
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.3);
}

.admin-action-btn.unblock {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.admin-action-btn.gift {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.admin-action-btn.gift:hover {
    background: rgba(0, 243, 255, 0.15);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.admin-action-btn.premium {
    border-color: #FFD700;
    color: #FFD700;
}

.admin-action-btn.premium:hover {
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Stats Panel */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.admin-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
}

.admin-stat-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.2);
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
    display: block;
    line-height: 1;
}

.admin-stat-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    display: block;
}

.admin-charts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.admin-chart-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
}

.admin-chart-title {
    color: #ff3333;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(255, 51, 51, 0.4);
    margin-bottom: 10px;
    margin-top: 0;
}

.admin-top-games {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-game-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-game-bar-label {
    font-size: 0.75rem;
    color: #ccc;
    width: 80px;
    text-align: right;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-game-bar-track {
    flex: 1;
    height: 20px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.admin-game-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #ff3333, var(--primary-color));
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.4);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-size: 0.65rem;
    color: #fff;
    font-weight: bold;
}

.admin-level-dist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-level-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-level-bar-label {
    font-size: 0.75rem;
    color: #ccc;
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}

.admin-level-bar-track {
    flex: 1;
    height: 18px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
}

.admin-level-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    box-shadow: 0 0 6px rgba(0, 243, 255, 0.3);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-size: 0.6rem;
    color: #fff;
    font-weight: bold;
}

/* Admin confirm modal */
.admin-confirm-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: 99999;
}

.admin-confirm-box {
    background: #111;
    border: 2px solid #ff3333;
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.3);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
}

.admin-confirm-box p {
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.5;
}

.admin-confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.admin-confirm-actions .neon-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Gift All button */
.admin-gift-all-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.admin-gift-all-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 16px;
    font-family: var(--font-main);
    font-size: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    border-radius: 4px;
}

.admin-gift-all-btn:hover {
    background: rgba(0, 243, 255, 0.15);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

/* Gift button in user card */
.admin-action-btn.gift {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.admin-action-btn.gift:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(204, 255, 0, 0.15);
    box-shadow: 0 0 8px rgba(204, 255, 0, 0.3);
}

/* Gift Modal */
.admin-gift-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.admin-gift-box {
    background: #111;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(204, 255, 0, 0.2), 0 0 60px rgba(204, 255, 0, 0.1);
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 340px;
    text-align: center;
}

.admin-gift-box h3 {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(204, 255, 0, 0.5);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.admin-gift-recipient {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-bottom: 15px;
    text-shadow: 0 0 5px var(--primary-color);
}

.admin-gift-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    color: #fff;
    padding: 10px 12px;
    font-family: var(--font-main);
    font-size: 1rem;
    width: 100%;
    outline: none;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.admin-gift-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(204, 255, 0, 0.2);
}

.admin-gift-input::placeholder {
    color: #555;
}

.admin-gift-textarea {
    resize: none;
    height: 60px;
}

.admin-gift-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.admin-gift-actions .neon-btn {
    padding: 8px 20px;
    font-size: 0.85rem;
}

/* ============================
   GIFT NOTIFICATION POPUP
   ============================ */

/* GIFT NOTIFICATION STYLES */
.gift-notif-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
    pointer-events: auto;
}

.gift-notif-card {
    background: linear-gradient(135deg, rgba(5, 5, 5, 0.95), rgba(20, 20, 20, 0.95));
    border: 2px solid var(--secondary-color);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow:
        0 0 30px rgba(255, 0, 85, 0.2),
        inset 0 0 20px rgba(255, 0, 85, 0.1);
    position: relative;
    overflow: hidden;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gift-notif-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 0, 85, 0.1) 0%, transparent 60%);
    animation: rotate 10s linear infinite;
    pointer-events: none;
}

/* CUSTOM NEON GIFT ICON */
.neon-gift-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
    position: relative;
    animation: bounce 2s infinite ease-in-out;
}

.neon-gift-box {
    width: 60px;
    height: 50px;
    background: transparent;
    border: 3px solid var(--primary-color);
    border-radius: 4px;
    position: absolute;
    bottom: 0;
    left: 10px;
    box-shadow:
        0 0 10px var(--primary-color),
        inset 0 0 10px var(--primary-color);
}

.neon-gift-lid {
    width: 70px;
    height: 15px;
    background: transparent;
    border: 3px solid var(--primary-color);
    border-radius: 4px;
    position: absolute;
    top: 15px;
    left: 5px;
    box-shadow:
        0 0 10px var(--primary-color),
        inset 0 0 10px var(--primary-color);
    z-index: 2;
}

.neon-gift-ribbon-v {
    width: 10px;
    height: 65px;
    background: var(--secondary-color);
    position: absolute;
    top: 15px;
    left: 35px;
    box-shadow: 0 0 10px var(--secondary-color);
    z-index: 3;
}

.neon-gift-ribbon-h {
    width: 70px;
    height: 0;
    border-top: 3px solid var(--secondary-color);
    position: absolute;
    top: 22px;
    left: 5px;
    z-index: 4;
}

.neon-gift-bow-left,
.neon-gift-bow-right {
    width: 20px;
    height: 20px;
    border: 3px solid var(--secondary-color);
    border-radius: 50% 50% 0 50%;
    position: absolute;
    top: 0;
    box-shadow: 0 0 8px var(--secondary-color);
}

.neon-gift-bow-left {
    left: 20px;
    transform: rotate(45deg);
}

.neon-gift-bow-right {
    right: 20px;
    transform: rotate(45deg) scaleX(-1);
    border-radius: 50% 50% 50% 0;
}

.gift-notif-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
    margin-bottom: 5px;
    font-weight: bold;
    letter-spacing: 2px;
}

.gift-notif-coins {
    font-size: 3rem;
    color: var(--secondary-color);
    text-shadow: 0 0 15px var(--secondary-color);
    margin: 10px 0 20px 0;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.gift-notif-message {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 30px;
    font-style: italic;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-notif-ok {
    width: 80%;
    margin-top: 10px;
    font-size: 1.2rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    cursor: pointer;
    padding: 10px;
    text-transform: uppercase;
    font-weight: bold;
    transition: all 0.3s ease;
}

.gift-notif-ok:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
}

/* Animations */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* SHOP PREVIEW STYLES */
.skin-preview-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    font-size: 1rem;
    color: #fff;
    transition: all 0.2s;
}

.skin-preview-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--primary-color);
}

.preview-overlay {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 99999;
    color: #fff;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 0 20px var(--primary-color);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 50px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}
#login-to-guest-link:hover {
    color: var(--secondary-color) !important;
    text-shadow: 0 0 5px var(--secondary-color);
}

/* Versus mode selection grid */
.vs-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 85%;
    max-width: 360px;
    margin: 10px auto;
}

.vs-mode-btn {
    padding: 14px 8px;
    font-size: 0.95rem;
    border-color: var(--primary-color);
    color: var(--primary-color);
    min-width: 0;
}

.vs-mode-btn[data-mode="VS100"],
.vs-mode-btn[data-mode="VS50"] {
    grid-column: span 1;
}

.vs-mode-badge {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-color);
    margin-bottom: 10px;
}

.vs-lobby-progress {
    width: 85%;
    max-width: 400px;
    margin: 0 auto 15px;
}

.vs-progress-bar {
    width: 100%;
    height: 8px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #444;
}

.vs-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--primary-color);
}

.vs-lobby-timer {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #aaa;
    text-align: center;
}

/* VS FRIENDS room setup */
.vs-friend-create {
    width: 92%;
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
}

.vs-setting-row {
    margin-bottom: 18px;
}

.vs-setting-label {
    display: block;
    color: #aaa;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.vs-lives-picker {
    display: flex;
    gap: 8px;
}

.vs-life-btn {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: 2px solid #444;
    color: #888;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.vs-life-btn.active {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    box-shadow: 0 0 8px var(--secondary-color);
}

.vs-max-select {
    width: 100%;
    padding: 10px;
}

.vs-games-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.vs-games-search {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
}

.vs-games-toolbar .neon-btn.small {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-width: 0;
}

.vs-games-count {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.vs-games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    border-radius: 6px;
}

.vs-game-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: #ccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
}

.vs-game-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vs-game-toggle input {
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.vs-game-toggle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-create-actions {
    text-align: center;
    margin-top: 20px;
}

.vs-private-settings {
    width: 90%;
    max-width: 400px;
    margin: 0 auto 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-radius: 6px;
    text-align: center;
}

.vs-settings-summary {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 8px;
}

.vs-private-player-count {
    font-size: 1rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
}
