/* ============================================
   SoundClash - Music Guessing Game
   Premium Dark Neon Gaming Theme
   ============================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
    /* Colors - TuneSwiper Palette */
    --bg-primary: #0f0c29;
    /* Deep purple/navy */
    --bg-secondary: #1a163e;
    --bg-tertiary: #241e4d;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --surface-active: rgba(255, 255, 255, 0.12);

    --text-primary: #ffffff;
    --text-secondary: #b0a0e0;
    --text-muted: #7a6e99;

    /* Vibrant Accents */
    --accent-green: #00e0ff;
    /* Cyan boost */
    --accent-green-glow: rgba(0, 224, 255, 0.4);

    --accent-pink: #ff0099;
    /* Deep magenta */
    --accent-pink-glow: rgba(255, 0, 153, 0.4);

    --accent-purple: #9d00ff;
    /* Electric purple */
    --accent-purple-glow: rgba(157, 0, 255, 0.3);

    --accent-blue: #4900ff;
    --accent-cyan: #00f2ea;
    --accent-orange: #ff5e00;
    --accent-yellow: #ffd700;

    --error: #ff3366;
    --success: #00ff9d;
    --warning: #ffcc00;

    --glass-bg: rgba(26, 22, 62, 0.85);
    /* Purple-tinted glass */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);

    /* Crown colors */
    --bronze: #cd7f32;
    --bronze-glow: rgba(205, 127, 50, 0.5);
    --silver: #e0e0ff;
    /* Bluish silver */
    --silver-glow: rgba(224, 224, 255, 0.5);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.6);

    /* Typography */
    --font-heading: 'Outfit',
        sans-serif;
    --font-body: 'Inter',
        sans-serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: var(--accent-green);
    text-decoration: none;
}

a:hover {
    color: var(--accent-cyan);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

/* ---------- Background Animation ---------- */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbFloat 20s infinite ease-in-out;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-pink);
    bottom: -80px;
    right: -80px;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 350px;
    height: 350px;
    background: var(--accent-orange);
    top: 40%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(40px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(30px, 40px) scale(1.02);
    }
}

/* ---------- Glass Panel ---------- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.glass-panel-inner {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green), #17a34a);
    color: white;
    box-shadow: 0 4px 15px var(--accent-green-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-green-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #333355;
    color: #666688;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px var(--accent-purple-glow);
}

.btn-spotify {
    background: var(--accent-green);
    color: white;
    font-size: 1.1rem;
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--accent-green-glow);
}

.btn-spotify:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--accent-green-glow);
    background: #1ed760;
}

.btn-guest {
    background: var(--surface) !important;
    color: #ffffff !important;
    font-size: 0.85rem !important;
    padding: 16px 32px !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    border: 1px solid var(--glass-border) !important;
}

.btn-guest:hover {
    transform: translateY(-2px);
    background: var(--surface-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--surface);
    border-color: var(--glass-border);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-icon-left {
    font-size: 1.2em;
}

/* ---------- Input Fields ---------- */
.input-field {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    outline: none;
}

.input-field:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-glow);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* ---------- Landing Page ---------- */
.landing-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.landing-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
    gap: 40px;
}

.logo-section {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.logo-image {
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(233, 69, 96, 0.3), 0 0 60px rgba(83, 52, 131, 0.4);
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-top: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
}

.login-card {
    padding: 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.login-card h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-desc {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.login-card .btn-spotify {
    width: 100%;
    margin-bottom: 32px;
}

/* Equalizer Animation */
.equalizer-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 40px;
    margin-bottom: 24px;
}

.equalizer-bars span {
    width: 6px;
    background: var(--accent-green);
    border-radius: 3px;
    animation: eqBounce 1.2s ease-in-out infinite;
}

.equalizer-bars span:nth-child(1) {
    animation-delay: 0s;
    height: 20px;
}

.equalizer-bars span:nth-child(2) {
    animation-delay: 0.15s;
    height: 30px;
}

.equalizer-bars span:nth-child(3) {
    animation-delay: 0.3s;
    height: 40px;
}

.equalizer-bars span:nth-child(4) {
    animation-delay: 0.15s;
    height: 25px;
}

.equalizer-bars span:nth-child(5) {
    animation-delay: 0s;
    height: 15px;
}

@keyframes eqBounce {

    0%,
    100% {
        transform: scaleY(0.3);
    }

    50% {
        transform: scaleY(1);
    }
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

/* How to Play Button */
.btn-how-to-play {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 24px;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-how-to-play:hover {
    background: var(--surface);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-how-to-play svg {
    flex-shrink: 0;
}

/* How to Play Modal */
.how-to-play-modal {
    max-width: 480px !important;
    max-height: 70vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px 32px 32px;
}

@media (max-height: 700px) {
    .how-to-play-modal {
        max-height: 65vh;
    }
}

.how-to-play-modal .modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color var(--transition-fast);
}

.how-to-play-modal .modal-close:hover {
    color: var(--text-primary);
}

.how-to-play-modal h3 {
    font-size: 1.5rem !important;
    margin-bottom: 24px !important;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.how-to-play-content {
    text-align: left;
    overflow-y: auto;
    max-height: calc(70vh - 100px);
    padding-right: 8px;
}

@media (max-height: 700px) {
    .how-to-play-content {
        max-height: calc(65vh - 100px);
    }
}

.how-to-play-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    transition: background var(--transition-normal);
}

.how-to-play-step:hover {
    background: var(--surface-hover);
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
}

.step-text {
    flex: 1;
}

.step-text strong {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.step-text p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.how-to-play-tips {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(157, 0, 255, 0.15), rgba(255, 0, 153, 0.1));
    border: 1px solid var(--accent-purple-glow);
    border-radius: var(--radius-md);
}

.how-to-play-tips h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.how-to-play-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.how-to-play-tips li {
    position: relative;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.how-to-play-tips li:last-child {
    margin-bottom: 0;
}

.how-to-play-tips li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
}

/* Hide modal by default */
#howToPlayModal {
    display: none;
}

#howToPlayModal.active {
    display: flex;
}

/* Join Room Form */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.divider span {
    padding: 0 12px;
}

.join-room-form {
    width: 100%;
    margin-top: 16px;
}

.join-room-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.room-code-input {
    flex: 0.5 !important;
    padding: 10px 12px !important;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.room-code-input::placeholder {
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.room-code-input:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.feature-icon {
    font-size: 1.3rem;
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    animation: slideUp 0.4s ease, fadeOut 0.4s ease 4s forwards;
}

/* Landing Footer */
.landing-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* About Card */
.about-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    max-width: 440px;
    width: 100%;
    background: rgba(26, 22, 62, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 0.8rem;
}

.about-card .emojis {
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.about-card .tagline {
    color: white;
    font-size: 0.75rem;
}

.about-card .links {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    margin-top: 4px;
}

.about-card a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.about-card a:hover {
    text-decoration: underline;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--accent-green-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-green-glow), 0 0 40px var(--accent-green-glow);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* ---------- Top Navigation ---------- */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-img {
    height: 48px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.nav-title-main {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    color: #ffffff;
    letter-spacing: 1px;
}

.nav-subtitle {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.75rem;
    color: #e94560;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-center {
    display: flex;
    align-items: center;
}

.room-code-display {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.room-code-display strong {
    color: var(--accent-green);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 2px solid var(--accent-green);
}

.username-display {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

.modal {
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.modal .input-field {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ---------- Confirmation Modal ---------- */
.confirm-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.confirm-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1rem;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-1px);
}

/* ---------- Main Content ---------- */
.main-content {
    padding-top: 70px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.view {
    animation: fadeIn 0.4s ease;
}

/* App Layout: views + chat side by side */
.app-layout {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 70px);
}

.views-column {
    flex: 1;
    min-width: 0;
}

/* ---------- Lobby ---------- */
.lobby-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.lobby-card {
    padding: 40px;
    text-align: center;
}

.lobby-card h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.divider-text {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.join-form {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 350px;
}

.join-form .input-field {
    flex: 1;
}

/* Room Setup */
.room-setup {
    padding: 30px;
}

.room-setup h2 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Playlist Grid */
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.playlist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.playlist-card:hover {
    background: var(--surface-hover);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.playlist-card.selected {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px var(--accent-purple-glow);
}

.playlist-icon {
    font-size: 1.8rem;
}

.playlist-name {
    font-weight: 500;
    text-align: center;
}

.custom-playlist-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.custom-playlist-form .input-field {
    flex: 1;
}

.selected-playlist {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--accent-green);
}

.playlist-check {
    font-size: 1.2rem;
}

.playlist-label-container {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.playlist-actual-name {
    font-size: 0.65em;
    font-weight: 400;
    color: var(--text-secondary, #aaa);
    margin-top: 2px;
}

/* Invite Section */
.invite-section {
    margin: 24px 0;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
}

.invite-link-row {
    display: flex;
    gap: 12px;
}

.invite-link-row .input-field {
    flex: 1;
    font-size: 0.85rem;
}

/* Start Button */
.btn-start {
    width: 100%;
    margin-top: 20px;
}

.start-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Seats Preview */
.seats-preview {
    margin-top: 24px;
}

.seats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.seat-card {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-normal);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.seat-card.occupied {
    border-color: var(--accent-green);
    background: rgba(29, 185, 84, 0.08);
}

.seat-card.empty {
    border-style: dashed;
    opacity: 0.6;
}

.seat-number {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.seat-username {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.seat-empty-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Admin badge */
.admin-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--accent-orange);
    color: white;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Spectators */
.spectators-section {
    margin-top: 20px;
}

.spectators-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spectator-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Waiting Animation */
.waiting-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    position: relative;
}

.pulse-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--accent-green);
    border-radius: var(--radius-full);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.waiting-icon {
    font-size: 3rem;
}

.waiting-text {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 16px;
    font-size: 1.1rem;
}

/* ---------- Game View ---------- */
.game-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Admin Live Controls */
.admin-game-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 8px 0;
}

.admin-game-controls .btn {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.admin-game-controls .btn:hover {
    opacity: 1;
}

/* Player Seats in Game */
.player-seats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.player-card {
    padding: 10px 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    backdrop-filter: blur(10px);
}

.player-card.active-turn {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px var(--accent-green-glow);
}

.player-card.locked-out {
    opacity: 0.5;
    border-color: var(--error);
}

.player-card.correct-guess {
    border-color: var(--success);
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.4);
    animation: correctPulse 0.6s ease;
}

.player-card.wrong-guess {
    border-color: var(--error);
    animation: shake 0.4s ease;
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 2px solid var(--glass-border);
    margin: 0 auto 8px;
    object-fit: cover;
}

.player-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-score {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--accent-green);
    line-height: 1;
    margin-bottom: 4px;
}

.player-score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Crown Badges */
.player-crown {
    position: absolute;
    top: -8px;
    right: -4px;
    font-size: 1.4rem;
    filter: drop-shadow(0 0 4px var(--gold-glow));
    animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-3px) rotate(5deg);
    }
}

.crown-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 4px;
}

.crown-bronze {
    background: linear-gradient(135deg, var(--bronze), #8b6914);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.crown-silver {
    background: linear-gradient(135deg, var(--silver), #888);
    color: #1a1a1a;
}

.crown-gold {
    background: linear-gradient(135deg, var(--gold), #ff9500);
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: shimmer 3s linear infinite;
    background-size: 200% auto;
}

/* Bot Player Cards */
.player-card.bot-player {
    border-color: rgba(0, 210, 255, 0.3);
}

.bot-skill-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #00d2ff;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.25);
    border-radius: 8px;
    padding: 2px 6px;
    margin: 2px auto 0;
    display: inline-block;
}

.player-card.add-bot-card {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    transition: all 0.2s ease;
    background: transparent;
}

.player-card.add-bot-card:hover {
    border-color: rgba(0, 210, 255, 0.5);
    background: rgba(0, 210, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.15);
}

.add-bot-icon {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1;
}

.add-bot-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.add-bot-card:hover .add-bot-icon,
.add-bot-card:hover .add-bot-text {
    color: #00d2ff;
}

.remove-bot-btn,
.remove-player-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 2;
}

.remove-bot-btn:hover,
.remove-player-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.seat-card {
    position: relative;
}

/* Now Playing */
.now-playing {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

/* Visualizer */
.track-visualizer {
    width: 60px;
    flex-shrink: 0;
}

.viz-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 50px;
}

.viz-bars span {
    width: 4px;
    background: linear-gradient(to top, var(--accent-green), var(--accent-cyan));
    border-radius: 2px;
    animation: vizBounce 0.8s ease-in-out infinite;
    transform-origin: bottom;
}

.viz-bars span:nth-child(1) {
    animation-delay: 0s;
    height: 20%;
}

.viz-bars span:nth-child(2) {
    animation-delay: 0.1s;
    height: 40%;
}

.viz-bars span:nth-child(3) {
    animation-delay: 0.2s;
    height: 60%;
}

.viz-bars span:nth-child(4) {
    animation-delay: 0.05s;
    height: 80%;
}

.viz-bars span:nth-child(5) {
    animation-delay: 0.15s;
    height: 50%;
}

.viz-bars span:nth-child(6) {
    animation-delay: 0.25s;
    height: 70%;
}

.viz-bars span:nth-child(7) {
    animation-delay: 0.3s;
    height: 30%;
}

.viz-bars span:nth-child(8) {
    animation-delay: 0.08s;
    height: 90%;
}

.viz-bars span:nth-child(9) {
    animation-delay: 0.18s;
    height: 45%;
}

.viz-bars span:nth-child(10) {
    animation-delay: 0.28s;
    height: 65%;
}

.viz-bars span:nth-child(11) {
    animation-delay: 0.02s;
    height: 25%;
}

.viz-bars span:nth-child(12) {
    animation-delay: 0.12s;
    height: 55%;
}

.viz-bars span:nth-child(13) {
    animation-delay: 0.22s;
    height: 75%;
}

.viz-bars span:nth-child(14) {
    animation-delay: 0.07s;
    height: 35%;
}

.viz-bars span:nth-child(15) {
    animation-delay: 0.17s;
    height: 85%;
}

.viz-bars span:nth-child(16) {
    animation-delay: 0.27s;
    height: 40%;
}

.viz-bars span:nth-child(17) {
    animation-delay: 0.04s;
    height: 60%;
}

.viz-bars span:nth-child(18) {
    animation-delay: 0.14s;
    height: 50%;
}

.viz-bars span:nth-child(19) {
    animation-delay: 0.24s;
    height: 70%;
}

.viz-bars span:nth-child(20) {
    animation-delay: 0.09s;
    height: 30%;
}

.viz-bars.paused span {
    animation-play-state: paused;
    height: 4px !important;
}

@keyframes vizBounce {

    0%,
    100% {
        transform: scaleY(0.3);
    }

    50% {
        transform: scaleY(1);
    }
}

.track-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.track-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

.track-question {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Add to Playlist Button */
.add-to-playlist-btn {
    width: 70px;
    height: 70px;
    position: relative;
    flex-shrink: 0;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.add-to-playlist-btn svg {
    width: 28px;
    height: 28px;
    color: var(--accent-green);
    transition: all var(--transition-normal);
}

.add-to-playlist-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent-green);
    transform: scale(1.05);
}

.add-to-playlist-btn:hover svg {
    color: var(--text-primary);
    transform: scale(1.1);
}

.add-to-playlist-btn:active {
    transform: scale(0.95);
}

.add-to-playlist-btn.added {
    border-color: var(--success);
    background: rgba(0, 255, 157, 0.1);
}

.add-to-playlist-btn.added svg {
    color: var(--success);
}

.add-to-playlist-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-to-playlist-btn:disabled:hover {
    transform: none;
    border-color: var(--glass-border);
    background: var(--glass-bg);
}

.add-to-playlist-btn:disabled:hover svg {
    color: var(--accent-green);
    transform: none;
}

/* Timer */
.timer-container {
    width: 70px;
    height: 70px;
    position: relative;
    flex-shrink: 0;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-track {
    fill: none;
    stroke: var(--surface);
    stroke-width: 4;
}

.timer-fill {
    fill: none;
    stroke: var(--accent-green);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-fill.warning {
    stroke: var(--warning);
}

.timer-fill.danger {
    stroke: var(--error);
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
}

/* Choices Grid */
.choices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.choice-btn {
    padding: 20px 16px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-align: center;
    backdrop-filter: blur(10px);
}

.choice-btn:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-purple-glow);
}

.choice-btn:active:not(:disabled) {
    transform: translateY(0);
}

.choice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.choice-btn.correct {
    border-color: var(--success) !important;
    background: rgba(34, 197, 94, 0.15) !important;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.3);
    animation: correctPulse 0.6s ease;
}

.choice-btn.wrong {
    border-color: var(--error) !important;
    background: rgba(239, 68, 68, 0.15) !important;
    animation: shake 0.4s ease;
}

.choice-btn .choice-letter {
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* Round Result */
.round-result {
    padding: 24px;
    text-align: center;
    animation: fadeInUp 0.4s ease;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.result-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-answer {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.game-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 8px 0;
}

/* ---------- Player Cards (Game View) ---------- */
.player-seats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.player-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    text-align: center;
    position: relative;
    transition: all var(--transition-normal);
}

.player-card.active-turn {
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(29, 185, 84, 0.2);
}

.player-card.locked-out {
    opacity: 0.5;
    border-color: var(--error);
}

.player-card.player-finished {
    border-color: var(--accent-green);
    background: rgba(29, 185, 84, 0.06);
    box-shadow: 0 0 20px rgba(29, 185, 84, 0.15);
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    margin: 0 auto 4px;
}

.player-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-score {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-green);
    line-height: 1.1;
}

.player-score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.player-crown {
    font-size: 1.6rem;
    line-height: 1;
}

/* Crown Badges */
.crown-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crown-gold {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.crown-silver {
    background: rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
    border: 1px solid rgba(192, 192, 192, 0.4);
}

.crown-bronze {
    background: rgba(205, 127, 50, 0.2);
    color: #cd7f32;
    border: 1px solid rgba(205, 127, 50, 0.4);
}

/* Finished Badge */
.finished-badge {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(29, 185, 84, 0.2);
    color: var(--accent-green);
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

/* ---------- Winner / Podium Overlay ---------- */
.winner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.4s ease;
}

.winner-content {
    text-align: center;
    position: relative;
    max-width: 600px;
    width: 90%;
}

.winner-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #ffd700, #ff6b35, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 1.5s ease infinite;
}

.podium-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.podium-entry {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    min-width: 140px;
    flex: 1;
    max-width: 180px;
    animation: fadeInUp 0.5s ease both;
}

.podium-entry:nth-child(1) {
    animation-delay: 0s;
}

.podium-entry:nth-child(2) {
    animation-delay: 0.15s;
}

.podium-entry:nth-child(3) {
    animation-delay: 0.3s;
}

.podium-gold {
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.podium-silver {
    border: 2px solid rgba(192, 192, 192, 0.5);
    box-shadow: 0 0 25px rgba(192, 192, 192, 0.15);
}

.podium-bronze {
    border: 2px solid rgba(205, 127, 50, 0.5);
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.15);
}

.podium-crown {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 8px;
}

.podium-position {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 4px;
}

.podium-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.podium-score {
    font-size: 0.9rem;
    color: var(--accent-green);
    font-weight: 600;
}

/* Confetti */
.confetti-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    width: 320px;
    flex-shrink: 0;
    height: calc(100vh - 90px);
    position: sticky;
    top: 70px;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.chat-header h3 {
    font-size: 1rem;
}

.online-count {
    font-size: 0.8rem;
    color: var(--accent-green);
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.chat-msg {
    animation: fadeIn 0.2s ease;
}

.chat-msg-user {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.chat-msg-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chat-msg-system {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 0;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--glass-border);
}

.chat-input-area .input-field {
    flex: 1;
}

/* ---------- Winner Overlay ---------- */
.winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.5s ease;
}

.winner-content {
    text-align: center;
    padding: 60px;
    position: relative;
}

.winner-crown {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: crownBounce 1s ease infinite;
}

@keyframes crownBounce {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.1) rotate(-5deg);
    }

    50% {
        transform: scale(1.05) rotate(0deg);
    }

    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

.winner-title {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--accent-orange), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    animation: shimmer 2s linear infinite;
    background-size: 200% auto;
}

.winner-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.winner-score {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    pointer-events: none;
    overflow: visible;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-in-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

/* Player Colors for Chat */
.color-1 {
    color: #ff6b6b;
}

.color-2 {
    color: #4ecdc4;
}

.color-3 {
    color: #ffd93d;
}

.color-4 {
    color: #6c5ce7;
}

.color-5 {
    color: #ff9ff3;
}

.color-6 {
    color: #54a0ff;
}

.color-7 {
    color: #5f27cd;
}

.color-8 {
    color: #01a3a4;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }


    .chat-panel {
        position: relative;
        top: auto;
        width: 100%;
        height: 400px;
    }

    .player-seats {
        grid-template-columns: repeat(3, 1fr);
    }

    .seats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .logo-title {
        font-size: 2.5rem;
    }

    .login-card {
        padding: 24px;
    }

    /* Fix join room button overflow on mobile */
    .join-room-input-group {
        flex-direction: column;
    }

    .room-code-input {
        width: 100%;
    }

    .btn-guest {
        width: 100%;
    }

    /* Fix How to Play modal on mobile */
    .how-to-play-modal {
        max-width: 90% !important;
        max-height: 60vh;
        padding: 32px 20px 24px;
    }

    .how-to-play-content {
        max-height: calc(60vh - 80px);
    }

    .how-to-play-step {
        padding: 12px;
        gap: 12px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .step-text strong {
        font-size: 0.9rem;
    }

    .step-text p {
        font-size: 0.8rem;
    }

    .choices-grid {
        grid-template-columns: 1fr;
    }

    .player-seats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .nav-center {
        display: none;
    }

    .playlist-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Mobile fixes for Room Setup */

    /* Adjust nav for mobile */
    .top-nav {
        padding: 8px 12px;
    }

    .nav-left {
        min-width: 0;
    }

    /* 1. Show logo image only (hide text) in nav on mobile */
    .nav-logo {
        display: flex;
    }

    .nav-logo-text {
        display: none;
    }

    .nav-logo-img {
        height: 36px;
    }

    /* 2. Fix username display on right side - fully visible */
    .nav-right {
        flex: 1;
        justify-content: flex-end;
        min-width: 0;
    }

    .user-info {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .username-display {
        font-weight: 600;
        font-size: 0.85rem;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: visible;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    .avatar-small {
        width: 28px;
        height: 28px;
    }

    .btn-icon {
        padding: 4px 6px;
        font-size: 0.9rem;
    }

    /* 3. Make username editable on mobile - ensure button is visible */
    #editUsernameBtn {
        display: inline-flex !important;
        opacity: 1;
    }

    /* Hide logout button on small screens to save space for username */
    .nav-right .btn-ghost.btn-sm {
        display: none;
    }

    /* 4. Fix premium and continuous mode card overlap - stack vertically, toggle at bottom */
    .game-options-row {
        flex-direction: column;
        gap: 12px;
    }

    .option-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 12px;
    }

    .option-card .toggle-switch {
        order: 2;
        margin-top: 8px;
    }

    .premium-label,
    .continuous-label {
        order: 1;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .premium-hint,
    .continuous-hint {
        display: block;
    }

    /* 5. Fix player seats - 1 card per row, no overlap */
    .seats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .seat-card {
        min-width: 0;
        padding: 12px 8px;
    }

    .seat-number {
        font-size: 0.8rem;
    }

    .seat-username {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Fix now-playing section on mobile - put track info in new row */
    .now-playing {
        flex-wrap: wrap;
        padding: 16px;
        gap: 12px;
    }

    .track-visualizer {
        width: 50px;
    }

    .track-info {
        flex: 1 1 calc(100% - 90px);
        min-width: 0;
    }

    .track-image {
        width: 50px;
        height: 50px;
    }

    .track-question {
        font-size: 1rem;
    }

    .add-to-playlist-btn,
    .timer-container {
        width: 50px;
        height: 50px;
    }

    .add-to-playlist-btn svg {
        width: 22px;
        height: 22px;
    }
}

/* ---------- Notifications / Toast ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    z-index: 400;
    pointer-events: none;
}

.toast-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.toast-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.toast-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

/* ---------- Keyframe Animations ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes vizBounce {

    0%,
    100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1);
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ---------- Premium Mode Toggle ---------- */
.premium-toggle-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin: 16px 0;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.premium-toggle-row:has(input:checked) {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 26px;
    transition: all var(--transition-normal);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
    background: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.premium-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color var(--transition-normal);
    flex-wrap: wrap;
}

.premium-toggle-row:has(input:checked) .premium-label {
    color: #ffd700;
}

.premium-icon {
    font-size: 1.2rem;
}

.premium-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    width: 100%;
    margin-top: -2px;
}

.premium-toggle-row:has(input:checked) .premium-hint {
    color: rgba(255, 215, 0, 0.6);
}

/* ---------- Game Options Row (Premium + Continuous) ---------- */
.game-options-row {
    display: flex;
    gap: 16px;
    margin: 16px 0;
    width: 100%;
}

.option-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    min-width: 0;
}

.option-card:has(input:checked) {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.continuous-toggle-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin: 16px 0;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.continuous-toggle-row:has(input:checked) {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.continuous-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color var(--transition-normal);
    flex-wrap: wrap;
}

.continuous-toggle-row:has(input:checked) .continuous-label {
    color: #818cf8;
}

.continuous-icon {
    font-size: 1.2rem;
}

.continuous-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    width: 100%;
    margin-top: -2px;
}

.continuous-toggle-row:has(input:checked) .continuous-hint {
    color: rgba(129, 140, 248, 0.6);
}