* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    @view-transition {
        navigation: auto;
    }
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@font-face {
    font-family: 'Arial Rounded MT';
    src: url('../fonts/ArialRoundedMT-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Arial Rounded MT';
    src: url('../fonts/ArialRoundedMT-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

:root {
    --primary-bg: #0a0e27;
    --text-white: #ffffff;
    --text-gray: #b8c1db;
    --card-bg: rgba(20, 26, 55, 0.6);
    --card-border: rgba(184, 193, 219, 0.12);
    --primary-blue: #4a6fa5;
    --primary-blue-hover: #5a7fb5;
    --gradient-blue: linear-gradient(135deg, #2b3a87 0%, #4a6fa5 100%);
    --gradient-blue-hover: linear-gradient(135deg, #3545a0 0%, #5a80c5 100%);
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --font-family: 'Arial Rounded MT', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --link-color: #4a9eff;
    --link-hover-color: #6bb3ff;
}

body {
    font-family: var(--font-family);
    background-color: var(--primary-bg);
    background-image: radial-gradient(ellipse 80% 40% at 50% -5%, #0f1a40 0%, rgba(15, 26, 64, 0.35) 45%, transparent 75%);
    background-attachment: fixed;
    color: var(--text-white);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
    animation: pageIn 0.25s ease-out;
}

#snow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    display: block;
}

.navbar {
    background: transparent;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom-color: rgba(184, 193, 219, 0.08);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-logo img {
    width: 40px;
    height: 40px;
}

.nav-app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    text-align: center;
    text-decoration: none;
    user-select: none;
}

.lang-switcher {
    display: flex;
    justify-content: flex-end;
    position: relative;
}

.lang-toggle {
    background: rgba(74, 111, 165, 0.15);
    border: 1px solid rgba(74, 111, 165, 0.3);
    color: var(--text-white);
    cursor: pointer;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease, border-color 0.3s ease;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-toggle:hover {
    background: rgba(74, 111, 165, 0.25);
    border-color: rgba(74, 111, 165, 0.5);
}

.globe-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.lang-toggle-text {
    min-width: 60px;
    text-align: left;
}

.lang-chevron {
    width: 10px;
    height: 10px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.lang-switcher.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 130px;
    margin-top: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-btn:hover {
    background: rgba(74, 111, 165, 0.2);
    color: var(--text-white);
}

.lang-btn.active {
    background: rgba(74, 111, 165, 0.3);
    color: var(--text-white);
}

.flag-icon {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
}

.screen {
    display: none;
    position: relative;
    z-index: 2;
    flex: 1;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

.screen.active {
    display: flex;
    animation: screenIn 0.22s ease-out;
}

@keyframes screenIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#auth-screen.active {
    flex-direction: column;
    gap: 1.25rem;
}

#mode-screen.active {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 2rem;
}

.setup-form.mode-btn-grid {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

.mode-col-play,
.mode-col-extra {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mode-col-play .btn,
.mode-col-extra .btn {
    padding-left: 1rem;
    padding-right: 1rem;
}

.mode-col-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-gray);
    opacity: 0.6;
    margin: 0 0 0.1rem;
}

.mode-col-divider {
    width: 1px;
    background: var(--card-border);
    margin: 0 1.25rem;
    flex-shrink: 0;
}

@media (max-width: 560px) {
    .setup-form.mode-btn-grid {
        flex-direction: column;
    }
    .mode-col-divider {
        display: none;
    }
    .mode-col-extra {
        margin-top: 0.75rem;
    }
}

#setup-screen.active {
    flex-direction: column;
    gap: 1rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 50px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
    background: var(--gradient-blue);
    color: var(--text-white);
    border: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: var(--gradient-blue-hover);
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 5px 15px rgba(74, 111, 165, 0.3);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    filter: saturate(0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--text-white);
    border: 2px solid rgba(184, 193, 219, 0.35);
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(184, 193, 219, 0.08);
    border-color: rgba(184, 193, 219, 0.65);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 111, 165, 0.15);
}

.btn-text {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
}

.btn-text:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(10, 20, 50, 0.35);
    transform: translateY(-1px);
}

.input-field {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(10, 14, 39, 0.6);
    color: var(--text-white);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: rgba(114, 164, 242, 0.65);
    background: rgba(10, 14, 39, 0.8);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.12);
}

.input-field::placeholder {
    color: var(--text-gray);
}

.input-field.valid {
    border-color: rgba(76, 175, 80, 0.55);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.input-field.invalid {
    border-color: rgba(244, 67, 54, 0.45);
}

.setting-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.setting-label-row label {
    margin-bottom: 0;
}

.slider-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-white);
}

.slider-field {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(74, 111, 165, 0.2);
    border-radius: 3px;
    cursor: pointer;
    outline: none;
}

.slider-field::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(
        to right,
        var(--primary-blue) 0%,
        var(--primary-blue) var(--fill, 33%),
        rgba(74, 111, 165, 0.2) var(--fill, 33%),
        rgba(74, 111, 165, 0.2) 100%
    );
    border-radius: 3px;
}

.slider-field::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    margin-top: -6px;
}

.slider-field::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-blue-hover);
}

.slider-field::-moz-range-track {
    height: 6px;
    background: rgba(74, 111, 165, 0.2);
    border-radius: 3px;
}

.slider-field::-moz-range-progress {
    height: 6px;
    background: var(--primary-blue);
    border-radius: 3px;
}

.slider-field::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-blue);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.slider-field::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-blue-hover);
}

.setup-container {
    background: rgba(14, 19, 45, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.setup-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 193, 219, 0.25), transparent);
    pointer-events: none;
}

.login-header {
    margin-bottom: 1.25rem;
}

.login-logo-wrap {
    display: inline-flex;
    flex-shrink: 0;
    margin-bottom: 1rem;
    animation: floatLogo 3.5s ease-in-out infinite;
}

.login-logo {
    width: 90px;
    height: 90px;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.login-header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(-8px); }
    50%       { transform: translateY(8px);  }
}

@media (min-width: 500px) {
    .setup-container {
        max-width: 560px;
    }

    .login-header {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        text-align: left;
        margin-bottom: 1.5rem;
    }

    .login-logo-wrap {
        margin-bottom: 0;
    }

    .login-logo {
        width: 130px;
        height: 130px;
    }

    .login-header-text {
        align-items: flex-start;
        flex: 1;
        min-width: 0;
    }

    .login-title-row {
        justify-content: flex-start;
    }

    .last-game-card {
        margin-top: 0;
    }
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.login-subtitle {
    font-size: 0.95rem;
    color: rgba(184, 193, 219, 0.6);
}

.login-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.login-title-row .login-title {
    margin-bottom: 0;
}

.version-number {
    font-size: 0.75rem;
    color: var(--text-gray);
    opacity: 0.5;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: opacity 0.2s;
}

.version-number:hover {
    opacity: 1;
    text-decoration: underline;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-white);
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 0.5rem;
    opacity: 0.8;
}

.settings-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-gray);
    margin: 0.5rem 0 0;
    opacity: 0.8;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.setting-item {
    text-align: left;
}

.setting-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-gray);
}

.setting-item .input-field {
    width: 100%;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem;
    color: var(--text-gray);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(74, 111, 165, 0.3);
    border-top-color: #4a6fa5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: rgba(40, 12, 10, 0.5);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    color: #ff6b6b;
    font-size: 0.95rem;
    text-align: center;
}

.error-message.hidden {
    display: none;
}

.donation-cta {
    margin-top: 0;
    padding: 1.25rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(114, 164, 242, 0.1) 0%, rgba(74, 111, 165, 0.1) 100%);
    border-radius: 16px;
    border: 1px solid rgba(114, 164, 242, 0.2);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.donation-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(114, 164, 242, 0.12), transparent 70%);
    pointer-events: none;
}

.donation-cta h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-white);
}

.donation-cta p {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.kofi-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #3f6bb0 0%, #2e4f80 100%);
    color: white;
    text-decoration: none;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(114, 164, 242, 0.3);
}

.kofi-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(114, 164, 242, 0.5);
}

.kofi-icon-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

#game-screen.active {
    flex-direction: column;
    gap: 2rem;
}

.game-container {
    width: 100%;
    max-width: 800px;
}

.game-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--card-border);
}

.game-header .round-info {
    justify-self: start;
}

.game-header .timer-display {
    justify-self: center;
}

.game-header .score-display {
    justify-self: end;
}

.round-info {
    font-size: 1.5rem;
    font-weight: 700;
}

.round-info #current-round {
    color: var(--primary-blue);
}

.score-display {
    font-size: 1.3rem;
    font-weight: 600;
}

.score-display #score {
    color: var(--success-color);
    transition: color 0.2s ease;
}

.score-display #score.flash-up {
    animation: scoreFlash 0.5s ease-out;
}

@keyframes scoreFlash {
    0%   { transform: scale(1);    color: var(--success-color); }
    30%  { transform: scale(1.35); color: #a5ffaa; }
    100% { transform: scale(1);    color: var(--success-color); }
}

.max-score-display {
    font-size: 0.85em;
    color: var(--text-gray);
    font-weight: 500;
    margin-left: 2px;
}

.game-playlist-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-white);
    margin: 0 0 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timer-bar {
    width: 150px;
    height: 8px;
    background: rgba(74, 111, 165, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.timer-progress {
    height: 100%;
    background: linear-gradient(135deg, #2b3a87 0%, #4a6fa5 100%);
    border-radius: 4px;
    transition: width 0.1s linear;
    width: 100%;
}

.timer-progress.warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.timer-progress.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

#timer-text {
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 40px;
}

.player-container {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 2rem;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-container.spotify-player {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
    border: 1px solid rgba(74, 111, 165, 0.3);
    transition: box-shadow 0.4s ease;
}

.player-container.playing {
    box-shadow: 0 0 0 1px rgba(74, 111, 165, 0.4), 0 0 30px rgba(74, 111, 165, 0.18);
    animation: playerPulse 2.5s ease-in-out infinite;
}

@keyframes playerPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(74, 111, 165, 0.4), 0 0 20px rgba(74, 111, 165, 0.12); }
    50%       { box-shadow: 0 0 0 1px rgba(74, 111, 165, 0.55), 0 0 40px rgba(74, 111, 165, 0.25); }
}

.audio-visualizer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    height: 120px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-visualizer.active,
.audio-visualizer.paused {
    opacity: 1;
}

.audio-visualizer .bar {
    width: 16px;
    background: linear-gradient(to top, var(--primary-blue), #72a4f2);
    border-radius: 8px;
    animation: none;
    transition: height 0.06s ease-out;
}

.audio-visualizer.active .bar {
    animation: visualizer 0.5s ease-in-out infinite alternate;
}


.audio-visualizer .bar:nth-child(1) { height: 40px; animation-delay: 0s; }
.audio-visualizer .bar:nth-child(2) { height: 70px; animation-delay: 0.1s; }
.audio-visualizer .bar:nth-child(3) { height: 100px; animation-delay: 0.2s; }
.audio-visualizer .bar:nth-child(4) { height: 70px; animation-delay: 0.3s; }
.audio-visualizer .bar:nth-child(5) { height: 40px; animation-delay: 0.4s; }

.audio-visualizer.paused .bar:nth-child(1),
.audio-visualizer.paused .bar:nth-child(2),
.audio-visualizer.paused .bar:nth-child(3),
.audio-visualizer.paused .bar:nth-child(4),
.audio-visualizer.paused .bar:nth-child(5) { height: 6px; animation-delay: 0s; }

@keyframes visualizer {
    0% { transform: scaleY(0.3); }
    100% { transform: scaleY(1); }
}

.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(25, 20, 20, 0.95) 0%, rgba(26, 26, 46, 0.95) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 10;
}

.player-overlay:hover {
    background: linear-gradient(135deg, rgba(74, 111, 165, 0.2) 0%, rgba(26, 26, 46, 0.95) 100%);
}

.player-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(74, 111, 165, 0.4);
}

.play-icon svg {
    width: 40px;
    height: 40px;
    color: #fff;
    margin-left: 5px;
}

.player-overlay:hover .play-icon {
    transform: scale(1.1);
    background: var(--primary-blue-hover);
    box-shadow: 0 10px 30px rgba(74, 111, 165, 0.5);
}

.player-overlay span {
    font-size: 1.1rem;
    color: var(--text-white);
    opacity: 0.9;
}

.volume-control {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 20px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.volume-control:hover {
    opacity: 1;
}

.volume-icon {
    width: 20px;
    height: 20px;
    background-color: var(--text-white);
    cursor: pointer;
    flex-shrink: 0;
    display: block;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-blue);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(to right, var(--primary-blue) 0%, var(--primary-blue) var(--volume-percent, 100%), rgba(255, 255, 255, 0.3) var(--volume-percent, 100%), rgba(255, 255, 255, 0.3) 100%);
    border-radius: 2px;
}

.volume-slider::-moz-range-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.guess-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.guess-container .input-group {
    margin-bottom: 0;
}

.guess-actions {
    display: flex;
    gap: 1rem;
}

.guess-actions .btn {
    flex: 1;
}

#change-playlist-btn {
    margin-top: 1rem;
    width: 100%;
}

.result-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    z-index: 100;
    animation: popIn 0.3s ease;
    min-width: 300px;
}

.result-feedback.hidden {
    display: none;
}

.result-cover {
    width: 140px;
    height: 140px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

@keyframes popIn {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.88) translateY(8px); }
    60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.02) translateY(-2px); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) translateY(0); }
}

.result-feedback.correct {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.06);
}

.result-feedback.incorrect {
    border-color: rgba(244, 67, 54, 0.5);
    background: rgba(244, 67, 54, 0.06);
}

.result-feedback.partial {
    border-color: rgba(255, 152, 0, 0.5);
    background: rgba(255, 152, 0, 0.06);
}

.result-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.correct-answer {
    color: var(--text-gray);
    font-size: 1.1rem;
}

.correct-answer strong {
    color: var(--text-white);
}

#end-screen.active {
    flex-direction: column;
    gap: 1.25rem;
}

.end-container {
    width: 100%;
    max-width: 700px;
    text-align: center;
}

.end-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.final-score-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
}

.final-score {
    margin-bottom: 1.5rem;
}

.final-score #final-score-value,
.final-score .final-score-value {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2b3a87 0%, #4a6fa5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-label {
    display: block;
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-top: 0.5rem;
}

.score-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(184, 193, 219, 0.1);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.detail-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.end-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.results-list {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: left;
}

.results-list h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

#results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border-left: 4px solid;
}

.result-item.correct  { background: rgba(76, 175, 80, 0.05); border-left-color: var(--success-color); }
.result-item.incorrect { background: rgba(244, 67, 54, 0.04); border-left-color: var(--error-color); }
.result-item.partial  { background: rgba(255, 152, 0, 0.04); border-left-color: var(--warning-color); }

.result-item-number {
    width: 30px;
    height: 30px;
    background: rgba(74, 111, 165, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.result-item.correct .result-item-number {
    background: rgba(12, 32, 14, 0.55);
    color: #7ec880;
}

.result-item.incorrect .result-item-number {
    background: rgba(40, 12, 10, 0.5);
    color: #f28b82;
}

.result-item.partial .result-item-number {
    background: rgba(40, 24, 4, 0.5);
    color: #ffb74d;
}

.result-item-cover {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.result-item-content {
    flex: 1;
}

.result-item-song {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.result-item-guess {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.result-item-points {
    font-weight: 700;
    font-size: 1.1rem;
}

.result-item-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.result-item.correct .result-item-points {
    color: var(--success-color);
}

.result-item.incorrect .result-item-points {
    color: var(--error-color);
}

.result-item.partial .result-item-points {
    color: var(--warning-color);
}

footer {
    text-align: center;
    padding: 1.5rem 2rem;
    color: var(--text-gray);
    font-size: 0.95rem;
    font-weight: 400;
    position: relative;
    z-index: 2;
    margin-top: auto;
    opacity: 0.65;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.footer-sep {
    opacity: 0.4;
}

footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--text-white);
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .nav-logo span {
        display: none;
    }

    .setup-container {
        padding: 2rem;
    }

    .login-title {
        font-size: 2rem;
    }

    .settings-group {
        grid-template-columns: 1fr;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .guess-actions {
        flex-direction: column;
    }

    .score-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .end-actions {
        grid-template-columns: 1fr;
    }

    .end-title {
        font-size: 2.5rem;
    }

    .final-score #final-score-value,
    .final-score .final-score-value {
        font-size: 4rem;
    }

    .game-header {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .game-header .round-info {
        justify-self: start;
    }

    .game-header .score-display {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .game-header .timer-display {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: center;
    }

    .timer-bar {
        flex: 1;
        max-width: 200px;
    }
}

@media (max-width: 600px) {
    .lang-toggle-text {
        display: none;
    }

    .lang-toggle {
        padding: 0.5rem;
    }
}

.mp-discord-name-info {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-gray);
    margin: 0.5rem 0 1rem;
}

.mp-discord-name-info strong {
    color: var(--text-primary, #fff);
    font-weight: 600;
}

.mp-code-field {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 1.2rem;
    text-align: center;
}

.mp-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-gray);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.mp-divider::before,
.mp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

#mp-host-setup {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(74, 111, 165, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
}

.mp-waiting-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.mp-players-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(20, 25, 50, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem;
}

@media (min-width: 768px) {
    #mp-lobby-screen .setup-container {
        max-width: 880px;
        text-align: left;
    }

    #mp-lobby-screen .login-header,
    #mp-name-section {
        text-align: center;
    }

    .mp-waiting-layout {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 2.5rem;
    }

    #mp-host-setup {
        order: -1;
        flex: 1;
        min-width: 0;
    }

    .mp-players-col {
        flex: 0 0 290px;
    }
}

.mp-game-code-display {
    background: linear-gradient(135deg, rgba(43, 58, 135, 0.3) 0%, rgba(74, 111, 165, 0.12) 100%);
    border: 2px solid rgba(74, 111, 165, 0.5);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 1rem;
    color: var(--text-gray);
}

.mp-game-code-display strong {
    display: block;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: 0.4em;
    text-indent: 0.4em;
    margin-top: 0.25rem;
    text-shadow: 0 0 20px rgba(74, 111, 165, 0.4);
}

.mp-player-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mp-player-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.mp-player-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mp-player-item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.5);
}

.mp-player-item.host {
    background: rgba(74, 111, 165, 0.12);
    border-color: rgba(74, 111, 165, 0.35);
}

.mp-player-item.host::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url('../img/icons/star.svg') no-repeat center / contain;
    margin-left: auto;
    flex-shrink: 0;
}

.mp-player-item.disconnected {
    opacity: 0.35;
}

.mp-player-item.disconnected::before {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

#mp-playlist-info {
    font-size: 0.85rem;
    color: var(--text-gray);
    text-align: center;
    margin: 0.25rem 0;
}

#mp-playlist-info em,
.mp-waiting-hint em {
    color: var(--text-white);
    font-style: italic;
}

.mp-waiting-hint {
    color: var(--text-muted, #aaa);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.75rem;
    font-style: italic;
}

@media (max-width: 499px) {
    #mp-lobby-screen .login-logo {
        width: 80px;
        height: 80px;
    }
}

#mp-name-section {
    max-width: 500px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

#mp-settings-group.settings-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--card-border);
    margin-bottom: 0;
}

#mp-settings-group .setting-item {
    flex: 1;
    min-width: 140px;
}

#mp-settings-group .settings-section-title {
    width: 100%;
    margin: 0 0 0.25rem;
}

.mp-scoreboard {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mp-score-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    font-size: 0.88rem;
}

.mp-score-row.me {
    background: rgba(74, 111, 165, 0.2);
    font-weight: 700;
}

.mp-rank {
    width: 1.4rem;
    text-align: right;
    color: var(--text-gray);
    flex-shrink: 0;
}

.mp-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-score {
    min-width: 1.8rem;
    text-align: right;
    font-weight: 600;
    flex-shrink: 0;
}

.mp-round-points {
    min-width: 2rem;
    text-align: right;
    color: var(--success-color);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.mp-results-container {
    width: 100%;
    max-width: 640px;
    text-align: center;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mp-results-container .mp-scoreboard {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 0.75rem;
    gap: 0.5rem;
}

.mp-results-round {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-gray);
}

.mp-correct-answer {
    font-size: 1.3rem;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.mp-result-cover {
    width: 130px;
    height: 130px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.mp-correct-answer strong {
    color: var(--primary-blue-hover);
}

.mp-my-result {
    margin-top: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.mp-my-result.result-correct  { color: var(--success-color); }
.mp-my-result.result-partial   { color: #ffa726; }
.mp-my-result.result-incorrect { color: var(--error-color); }

.mp-score-row.has-guess .mp-name {
    flex: 0 0 auto;
}

.mp-player-guess {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 0.5rem;
    font-size: 0.72rem;
    overflow: hidden;
}

.mp-guess-part {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-guess-part.correct  { color: var(--success-color); }
.mp-guess-part.incorrect { color: var(--text-gray); opacity: 0.7; }

.mp-guess-icon { flex-shrink: 0; }

.mp-results-countdown {
    font-size: 1rem;
    color: var(--text-gray);
}

.mp-results-countdown #mp-results-timer {
    font-weight: 700;
    color: var(--text-white);
}

#mp-results-screen.active,
#mp-end-screen.active {
    flex-direction: column;
    gap: 2rem;
}

#mp-end-screen .end-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

#mp-end-screen .end-actions {
    display: flex;
    justify-content: center;
}

.mp-scoreboard.mp-final .mp-score-row {
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.mp-scoreboard.mp-final .mp-score-row.me {
    background: rgba(74, 111, 165, 0.2);
}

.mp-scoreboard.mp-final .mp-score {
    font-size: 1.1rem;
    min-width: 2.5rem;
}

#mp-end-round-history {
    width: 100%;
    max-width: 700px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


#mp-end-round-history .results-list-title {
    font-size: 1.5rem;
    margin-bottom: 0;
    text-align: center;
}



@media (max-height: 620px) {
    .login-logo-wrap {
        margin-bottom: 0.75rem;
    }
    .login-logo {
        width: 70px;
        height: 70px;
    }
    .login-header {
        margin-bottom: 1rem;
    }
    .setup-container {
        padding: 1.5rem;
    }
    #auth-screen.active,
    #mode-screen.active {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .nav-logo img {
        width: 32px;
        height: 32px;
    }

    .nav-app-title {
        font-size: 1.1rem;
    }

    .screen {
        padding: 1rem;
    }

    .setup-container,
    .guess-container,
    .final-score-card,
    .results-list {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 1.8rem;
    }

    .login-logo {
        width: 80px;
        height: 80px;
    }

    .login-header {
        margin-bottom: 1.25rem;
    }

    .round-info {
        font-size: 1.2rem;
    }

    .score-display {
        font-size: 1.1rem;
    }

    .result-feedback {
        padding: 1.5rem;
        left: 1rem;
        right: 1rem;
        width: auto;
        transform: translateY(-50%);
        animation: popInMobile 0.3s ease;
    }

    @keyframes popInMobile {
        from { opacity: 0; transform: translateY(-50%) scale(0.8); }
        to   { opacity: 1; transform: translateY(-50%) scale(1); }
    }

    footer {
        font-size: 0.75rem;
        padding: 1.5rem 1rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .result-item {
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .result-item-number {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }

    .result-item-cover {
        width: 36px;
        height: 36px;
    }

    .result-item-meta {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.1rem;
    }

    .result-item-points {
        font-size: 0.95rem;
    }

    #mp-lobby-screen:has(#mp-waiting-section:not(.hidden)) .login-header {
        display: none;
    }

    #mp-lobby-screen:has(#mp-waiting-section:not(.hidden)) .setup-container {
        padding: 1rem;
    }

    .mp-game-code-display strong {
        font-size: 1.8rem;
        letter-spacing: 0.25em;
        text-indent: 0.25em;
    }

    #mp-host-setup {
        padding: 1rem;
    }
}

.featured-playlists {
    width: 100%;
    margin-bottom: 0.5rem;
}

.featured-playlists-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-gray);
    margin-bottom: 0.75rem;
}

.featured-playlists-grid {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-block: 4px;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) transparent;
}

.featured-playlists-grid::-webkit-scrollbar {
    height: 4px;
}

.featured-playlists-grid::-webkit-scrollbar-track {
    background: transparent;
}

.featured-playlists-grid::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 2px;
}

.playlist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.625rem;
    cursor: pointer;
    min-width: 110px;
    max-width: 110px;
    transition: border-color 0.2s, transform 0.15s, background 0.2s;
    text-align: center;
    flex-shrink: 0;
    font-family: var(--font-family);
    color: var(--text-white);
}

.playlist-card:hover {
    border-color: var(--primary-blue);
    background: rgba(74, 111, 165, 0.15);
}

.playlist-card-cover {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    flex-shrink: 0;
}

.playlist-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
}

.playlist-card-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.2;
    overflow: hidden;
    max-height: 2.4em;
}

.playlist-card-author {
    font-size: 0.68rem;
    color: var(--text-gray);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.featured-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-gray);
    font-size: 0.8rem;
}

.featured-divider::before,
.featured-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.playlist-browser-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.playlist-browser-panel {
    background: #0f1530;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: min(520px, 90vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.playlist-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.playlist-browser-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-white);
}

.playlist-browser-close {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    font-family: var(--font-family);
}

.playlist-browser-close:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.08);
}

.playlist-browser-search {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.playlist-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-white);
    font-family: var(--font-family);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    outline: none;
    transition: border-color 0.2s;
}

.playlist-search-input::placeholder {
    color: var(--text-gray);
}

.playlist-search-input:focus {
    border-color: var(--primary-blue);
}

.playlist-search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.playlist-browser-filters {
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.playlist-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-gray);
    font-family: var(--font-family);
    font-size: 0.72rem;
    padding: 0.22rem 0.7rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--primary-blue);
    color: var(--text-white);
}

.filter-chip.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--text-white);
}

.playlist-browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) transparent;
}

.playlist-browser-grid::-webkit-scrollbar {
    width: 4px;
}

.playlist-browser-grid::-webkit-scrollbar-track {
    background: transparent;
}

.playlist-browser-grid::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 2px;
}

.playlist-browser-empty {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.875rem;
    padding: 2rem 1.25rem;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .setup-container {
        max-width: 700px;
        padding: 3.5rem 4rem;
    }

    .playlist-browser-panel {
        max-width: min(780px, 80vw);
    }

    .playlist-browser-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .settings-group {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .game-container {
        max-width: 1100px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem 2rem;
        /* Pas "stretch" : ça étire .player-container à la hauteur de
           .guess-container (souvent plus haut), et le contrôle de volume,
           positionné en absolu par rapport au bas de la carte, se retrouve
           loin des barres audio centrées dedans. */
        align-items: start;
    }

    .game-container .game-header {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .game-container .player-container {
        height: auto;
        min-height: 200px;
        margin-bottom: 0;
    }

    .game-container .guess-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .game-container .input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .end-container {
        max-width: 900px;
    }

    #mp-lobby-screen .setup-container {
        max-width: 960px;
        padding: 2.5rem 3rem;
    }

    #mp-lobby-screen .mp-players-col {
        flex: 0 0 300px;
        position: sticky;
        top: 90px;
        align-self: flex-start;
    }

    #mp-lobby-screen .mp-waiting-layout {
        align-items: flex-start;
    }
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.btn-text .btn-icon,
.page-back .btn-icon {
    filter: brightness(0) invert(0.45);
    transition: filter 0.15s ease;
}

.btn-text:hover .btn-icon,
.page-back:hover .btn-icon {
    filter: brightness(0) invert(0.8);
}

.settings-extras {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.settings-extras-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.6rem 0;
}

.settings-extras-group + .settings-extras-group {
    border-top: 1px solid var(--card-border);
}

.settings-extras-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-gray);
    margin: 0;
    opacity: 0.8;
}

.mode-selector,
.bonus-selector {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.mode-option,
.bonus-option {
    cursor: pointer;
}

.mode-option input,
.bonus-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-option-content,
.bonus-option-content {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.8rem;
    border-radius: 20px;
    border: 1.5px solid var(--card-border);
    background: transparent;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-gray);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    user-select: none;
}

.mode-option-content:hover,
.bonus-option-content:hover {
    border-color: rgba(74, 111, 165, 0.6);
    background: rgba(74, 111, 165, 0.08);
    color: var(--text-white);
}

.mode-option input:checked + .mode-option-content,
.bonus-option input:checked + .bonus-option-content {
    background: rgba(74, 111, 165, 0.25);
    border-color: var(--primary-blue);
    color: var(--text-white);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.mode-icon {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(0.55);
    flex-shrink: 0;
}

.mode-option input:checked + .mode-option-content .mode-icon,
.bonus-option input:checked + .bonus-option-content .mode-icon {
    filter: brightness(0) invert(1);
}

.mode-pct {
    font-size: 0.65rem;
    font-weight: 700;
    opacity: 0.6;
    margin-left: 0.05rem;
}

.mode-pct-pos { color: #7ec880; }
.mode-pct-neg { color: #f28b82; }

.mode-option input:checked + .mode-option-content .mode-pct,
.bonus-option input:checked + .bonus-option-content .mode-pct {
    opacity: 1;
}

.setup-form .btn-text {
    margin-top: 0.25rem;
}

.mode-leaderboard-link {
    text-decoration: none;
    width: 100%;
    color: var(--text-gray);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    background: transparent;
}

.mode-leaderboard-link:hover {
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.mode-leaderboard-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(0.7);
    transition: filter 0.3s ease;
}

.mode-leaderboard-link:hover .mode-leaderboard-icon {
    filter: brightness(0) invert(1);
}

.last-game-card {
    flex-shrink: 0;
    margin-top: 0.85rem;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(184, 193, 219, 0.11);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    align-self: stretch;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.last-game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 193, 219, 0.18), transparent);
    pointer-events: none;
}

.last-game-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(184, 193, 219, 0.5);
}

.last-game-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.last-game-cover {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.last-game-info {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

.last-game-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.last-game-player {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.last-game-avatar {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.last-game-username {
    font-size: 0.73rem;
    color: rgba(184, 193, 219, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-game-time {
    font-size: 0.65rem;
    color: rgba(184, 193, 219, 0.35);
    margin-top: 0.05rem;
}

@media (max-width: 599px) {
    .last-game-card { display: none; }
}

@media (min-width: 600px) {
    .last-game-card { flex: 1; }
}

#mp-back-btn {
    margin-top: 1.25rem;
}

.setting-item-full {
    width: 100%;
    flex: 0 0 100% !important;
}

.mp-extras-section {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border-top: 1px solid var(--card-border);
    padding-top: 0.75rem;
}

.mp-extras-section .settings-extras-group {
    padding: 0;
    border-top: none;
}

.pochette-cover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    transition: filter 0.5s linear;
    z-index: 5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.player-container.has-pochette .audio-visualizer {
    top: auto;
    left: 14px;
    transform: none;
    bottom: 12px;
    right: auto;
    height: 50px;
    gap: 6px;
}

.player-container.has-pochette .audio-visualizer .bar {
    width: 10px;
}

.player-container.has-pochette .audio-visualizer .bar:nth-child(1) { height: 18px; }
.player-container.has-pochette .audio-visualizer .bar:nth-child(2) { height: 30px; }
.player-container.has-pochette .audio-visualizer .bar:nth-child(3) { height: 44px; }
.player-container.has-pochette .audio-visualizer .bar:nth-child(4) { height: 30px; }
.player-container.has-pochette .audio-visualizer .bar:nth-child(5) { height: 18px; }

.mp-ingame-panel {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    margin-bottom: 0.25rem;
}

.mp-ingame-scores {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.mp-ingame-score-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    white-space: nowrap;
}

.mp-ingame-score-item.me {
    background: rgba(74, 111, 165, 0.2);
    border-color: rgba(74, 111, 165, 0.4);
}

.mp-ingame-score-item.submitted .mp-ingame-score-name::after {
    content: ' ✓';
    color: #4ade80;
    font-weight: bold;
}

.mp-ingame-score-name {
    color: var(--text-gray);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-ingame-score-pts {
    color: var(--text-white);
    font-weight: 700;
    font-size: 0.9rem;
}

.result-item-time {
    font-size: 0.78rem;
    color: var(--text-gray);
    text-align: right;
}

.host-disconnect-warning {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(180, 60, 60, 0.9);
    border: 1px solid rgba(220, 80, 80, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    color: #fff;
    font-weight: 600;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.host-disconnect-warning .btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    width: auto;
}

.inner-page {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2rem 1.5rem 4rem;
    position: relative;
    z-index: 2;
}

.inner-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    padding: 2.5rem 3rem;
    width: 100%;
}

.inner-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.inner-header .login-logo-wrap {
    animation: none;
    margin-bottom: 1rem;
}

.inner-header .login-logo {
    width: 60px;
    height: 60px;
}

.inner-header h1 {
    font-size: 1.8rem;
    color: var(--text-white);
    margin-bottom: 0.4rem;
}

.inner-header p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.page-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2rem;
    padding: 0.875rem 2rem;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.page-back:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(10, 20, 50, 0.35);
}

#mode-screen .setup-container {
    padding-bottom: 0;
    width: fit-content;
    max-width: calc(100vw - 4rem);
    min-width: min(500px, calc(100vw - 4rem));
}

@media (min-width: 500px) {
    #mode-screen .login-header-text {
        flex: 0 0 auto;
        min-width: auto;
    }
}

@media (min-width: 600px) {
    #mode-screen .last-game-card {
        min-width: 190px;
    }
}

#discord-login-hint {
    width: 100%;
    margin-top: 0.75rem;
}

.credits-link {
    display: inline-block;
    padding: 1.25rem 0.5rem;
    font-size: 0.875rem;
    color: rgba(184, 193, 219, 0.5);
    text-decoration: none;
    transition: color 0.2s;
}

.credits-link:hover {
    color: rgba(184, 193, 219, 0.85);
}

@media (max-width: 600px) {
    .inner-container { padding: 1.5rem 1.25rem; }
    .inner-header h1  { font-size: 1.4rem; }
}

.btn-discord {
    background: #5865F2;
    color: #fff;
    border: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
}
.btn-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.35);
}

.discord-icon {
    width: 22px;
    height: 17px;
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-gray);
    font-size: 0.875rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.mode-greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.6rem;
}

.mode-greeting-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.greeting-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.85;
}

.greeting-text {
    font-size: 1.15rem;
    color: var(--text-gray);
}

.greeting-logout-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.2s, background 0.2s;
    margin-left: 0.1rem;
}

.greeting-logout-btn img {
    width: 16px;
    height: 16px;
    opacity: 1;
    filter: invert(1);
}

.greeting-logout-btn:hover {
    color: rgba(255, 80, 80, 0.85);
    background: rgba(40, 10, 10, 0.4);
}

.greeting-logout-btn:hover img {
    filter: invert(40%) sepia(1) saturate(5) hue-rotate(320deg);
}

.discord-login-hint {
    margin-top: 1rem;
    text-align: center;
}

.discord-login-hint-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: rgba(120, 130, 250, 0.75);
    font-family: var(--font-family);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.2s;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.discord-login-hint-btn:hover {
    color: rgba(120, 130, 250, 1);
}

.discord-icon-small {
    width: 14px;
    height: 11px;
    flex-shrink: 0;
}

.history-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.history-modal-container {
    background: #111628;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.history-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
}

.history-modal-close {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}
.history-modal-close:hover {
    color: var(--text-white);
}

.history-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.25rem 0;
}

:focus-visible {
    outline: 2px solid rgba(74, 111, 165, 0.85);
    outline-offset: 3px;
    border-radius: 4px;
}

.nav-logo:focus-visible,
.lang-toggle:focus-visible,
.lang-btn:focus-visible,
.btn:focus-visible,
.input-field:focus-visible {
    outline: 2px solid rgba(74, 111, 165, 0.85);
    outline-offset: 3px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    body {
        animation: none !important;
    }
}
