* {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
}

body {
        font-family: 'Georgia', serif;
        background: #0a0a0a;
        color: #fff;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
}

/* ===== SCREENS ===== */
.screen {
        display: none;
        width: 100vw;
        height: 100vh;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0;
        left: 0;
}
.screen.active {
        display: flex;
}

/* ===== HOME SCREEN ===== */
.home-header {
        display: flex;
        align-items: center;
        gap: 24px;
        margin-bottom: 48px;
}
.home-logo img {
        border-radius: 16px;
        background: rgba(255,255,255,0.08);
        padding: 8px;
        display: block;
}
.home-title {
        font-size: 3rem;
        font-weight: bold;
        letter-spacing: 2px;
        line-height: 1.1;
}
.home-subtitle {
        font-size: 1.1rem;
        color: rgba(255,255,255,0.55);
        margin-top: 6px;
}

.home-menu {
        display: flex;
        flex-direction: row;
        gap: 32px;
        margin-bottom: 48px;
}

.home-card {
        background: rgba(255,255,255,0.07);
        border: 2px solid rgba(255,255,255,0.1);
        border-radius: 20px;
        padding: 40px 36px;
        text-align: center;
        cursor: pointer;
        transition: background 0.2s, border-color 0.2s, transform 0.15s;
        min-width: 200px;
        outline: none;
}
.home-card:hover,
.home-card.focused {
        background: rgba(255,255,255,0.14);
        border-color: rgba(255,255,255,0.45);
        transform: scale(1.04);
}
.home-card-icon {
        font-size: 2.6rem;
        margin-bottom: 16px;
        opacity: 0.9;
}
.home-card-label {
        font-size: 1.2rem;
        font-weight: bold;
        letter-spacing: 2px;
        margin-bottom: 8px;
}
.home-card-desc {
        font-size: 0.85rem;
        color: rgba(255,255,255,0.5);
}

/* ===== HINTS BAR ===== */
.home-hint {
        position: absolute;
        bottom: 24px;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 0.8rem;
        color: rgba(255,255,255,0.3);
        letter-spacing: 1px;
}
.hint-key {
        display: inline-block;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 6px;
        padding: 2px 8px;
        margin: 0 4px;
        font-size: 0.75rem;
}

/* ===== LIST SCREENS (songs / themes) ===== */
.list-header-bar {
        display: flex;
        align-items: center;
        gap: 24px;
        width: 100%;
        max-width: 900px;
        padding: 24px 32px 16px;
        flex-shrink: 0;
}
.list-title {
        font-size: 1.8rem;
        font-weight: bold;
        letter-spacing: 1px;
}
.back-btn {
        background: rgba(255,255,255,0.08);
        border: 2px solid rgba(255,255,255,0.15);
        color: #fff;
        border-radius: 12px;
        padding: 10px 20px;
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.2s, border-color 0.2s;
        outline: none;
        white-space: nowrap;
}
.back-btn:hover,
.back-btn.focused {
        background: rgba(255,255,255,0.16);
        border-color: rgba(255,255,255,0.5);
}

/* ===== CATEGORY SWITCHER ===== */
.category-switcher {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        width: 100%;
        max-width: 900px;
        padding: 0 32px 12px;
        flex-shrink: 0;
}
.cat-arrow {
        background: rgba(255,255,255,0.08);
        border: 2px solid rgba(255,255,255,0.15);
        color: #fff;
        border-radius: 10px;
        padding: 8px 18px;
        font-size: 1.1rem;
        cursor: pointer;
        transition: background 0.2s, border-color 0.2s;
        outline: none;
}
.cat-arrow:hover,
.cat-arrow.focused {
        background: rgba(255,255,255,0.2);
        border-color: rgba(255,255,255,0.55);
}
.cat-label {
        font-size: 1.2rem;
        font-weight: bold;
        letter-spacing: 3px;
        color: #fff;
        min-width: 180px;
        text-align: center;
        padding: 8px 0;
        border-bottom: 2px solid rgba(255,255,255,0.3);
}

/* ===== SEARCH BAR ===== */
.search-bar-wrap {
        width: 100%;
        max-width: 900px;
        padding: 0 32px 12px;
        flex-shrink: 0;
}
.song-search-input {
        width: 100%;
        background: rgba(255,255,255,0.07);
        border: 2px solid rgba(255,255,255,0.15);
        border-radius: 12px;
        color: #fff;
        font-size: 1rem;
        padding: 12px 20px;
        outline: none;
        transition: border-color 0.2s, background 0.2s;
        font-family: 'Georgia', serif;
}
.song-search-input::placeholder {
        color: rgba(255,255,255,0.35);
}
.song-search-input:focus {
        border-color: rgba(255,255,255,0.5);
        background: rgba(255,255,255,0.11);
}

/* ===== SONG LIST ===== */
.song-list-container {
        flex: 1;
        width: 100%;
        max-width: 900px;
        overflow-y: auto;
        padding: 0 32px 16px;
}
.song-list-container::-webkit-scrollbar {
        width: 6px;
}
.song-list-container::-webkit-scrollbar-track {
        background: rgba(255,255,255,0.05);
        border-radius: 3px;
}
.song-list-container::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 3px;
}

.song-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
}

.song-item {
        display: flex;
        align-items: center;
        gap: 16px;
        background: rgba(255,255,255,0.05);
        border: 2px solid rgba(255,255,255,0.07);
        border-radius: 14px;
        padding: 18px 24px;
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s, transform 0.1s;
        outline: none;
}
.song-item:hover,
.song-item.focused {
        background: rgba(255,255,255,0.12);
        border-color: rgba(255,255,255,0.35);
        transform: translateX(4px);
}
.song-item.loading {
        color: rgba(255,255,255,0.35);
        cursor: default;
        border-color: transparent;
        background: transparent;
}
.song-number {
        font-size: 1rem;
        color: rgba(255,255,255,0.35);
        min-width: 36px;
        font-family: monospace;
}
.song-name {
        font-size: 1.2rem;
        flex: 1;
}

/* ===== QUEUE HUD (corner list) ===== */
.queue-hud {
        position: absolute;
        top: 80px;
        right: 20px;
        background: rgba(0,0,0,0.65);
        backdrop-filter: blur(6px);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 14px;
        padding: 12px 16px;
        min-width: 200px;
        max-width: 280px;
        z-index: 30;
        opacity: 0;
        transform: translateX(20px);
        pointer-events: none;
        transition: opacity 0.3s, transform 0.3s;
}
.queue-hud.visible {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
}
.queue-hud-title {
        font-size: 0.72rem;
        letter-spacing: 2px;
        color: rgba(255,255,255,0.45);
        margin-bottom: 8px;
        font-weight: bold;
}
.queue-hud-item {
        font-size: 0.88rem;
        color: rgba(255,255,255,0.85);
        padding: 4px 0;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
}
.queue-hud-item:last-child { border-bottom: none; }
.queue-hud-more {
        color: rgba(255,255,255,0.4);
        font-size: 0.78rem;
}

/* ===== QUEUE NUMBER INPUT PANEL ===== */
.queue-number-panel {
        position: absolute;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%) translateY(16px);
        background: rgba(0,0,0,0.8);
        backdrop-filter: blur(8px);
        border: 2px solid rgba(255,255,255,0.2);
        border-radius: 18px;
        padding: 20px 36px;
        text-align: center;
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s, transform 0.2s;
        min-width: 240px;
}
.queue-number-panel.visible {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
}
.queue-number-panel.flash {
        border-color: rgba(111,217,140,0.6);
}
.queue-number-hint {
        font-size: 0.75rem;
        color: rgba(255,255,255,0.45);
        letter-spacing: 2px;
        margin-bottom: 8px;
        text-transform: uppercase;
}
.queue-number-display {
        display: flex;
        align-items: baseline;
        justify-content: center;
        gap: 4px;
        margin-bottom: 10px;
}
.queue-number-hash {
        font-size: 2rem;
        color: rgba(255,255,255,0.4);
}
.queue-number-digits {
        font-size: 2.8rem;
        font-weight: bold;
        font-family: monospace;
        color: #fff;
        letter-spacing: 4px;
        min-width: 60px;
}
.queue-number-sub {
        font-size: 0.7rem;
        color: rgba(255,255,255,0.3);
        letter-spacing: 1px;
}

/* ===== COUNTDOWN OVERLAY ===== */
.queue-countdown-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.82);
        backdrop-filter: blur(10px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 50;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s;
        gap: 16px;
}
.queue-countdown-overlay.visible {
        opacity: 1;
        pointer-events: auto;
}
.countdown-label {
        font-size: 0.9rem;
        letter-spacing: 4px;
        color: rgba(255,255,255,0.5);
        text-transform: uppercase;
}
.countdown-song-title {
        font-size: 2rem;
        font-weight: bold;
        color: #fff;
        text-align: center;
        max-width: 80%;
        line-height: 1.3;
}
.countdown-timer {
        font-size: 5rem;
        font-weight: bold;
        font-family: monospace;
        color: #fff;
        line-height: 1;
        animation: countdown-pulse 1s ease-in-out infinite;
}
@keyframes countdown-pulse {
        0%   { transform: scale(1);    opacity: 1; }
        50%  { transform: scale(1.12); opacity: 0.85; }
        100% { transform: scale(1);    opacity: 1; }
}
.countdown-sub {
        font-size: 0.8rem;
        color: rgba(255,255,255,0.3);
        letter-spacing: 2px;
}

/* ===== UPLOAD SCREEN ===== */
.upload-body {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        width: 100%;
        max-width: 700px;
        padding: 0 32px 24px;
        flex: 1;
        overflow-y: auto;
}
.upload-category-row {
        display: flex;
        align-items: center;
        gap: 24px;
        background: rgba(255,255,255,0.06);
        border: 2px solid rgba(255,255,255,0.12);
        border-radius: 14px;
        padding: 16px 28px;
        width: 100%;
}
.upload-label {
        font-size: 1rem;
        font-weight: bold;
        letter-spacing: 1px;
        color: rgba(255,255,255,0.7);
        margin-right: 8px;
}
.upload-radio-label {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 1.05rem;
        cursor: pointer;
        color: #fff;
}
.upload-radio-label input[type="radio"] {
        width: 18px;
        height: 18px;
        accent-color: rgba(255,255,255,0.8);
        cursor: pointer;
}
.upload-drop-zone {
        width: 100%;
        border: 2px dashed rgba(255,255,255,0.25);
        border-radius: 18px;
        padding: 40px 32px;
        text-align: center;
        cursor: pointer;
        transition: border-color 0.2s, background 0.2s;
        background: rgba(255,255,255,0.04);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
}
.upload-drop-zone:hover,
.upload-drop-zone.dragover {
        border-color: rgba(255,255,255,0.6);
        background: rgba(255,255,255,0.09);
}
.upload-drop-icon {
        font-size: 2.8rem;
        color: rgba(255,255,255,0.5);
}
.upload-drop-text {
        font-size: 1.05rem;
        color: rgba(255,255,255,0.85);
        font-weight: bold;
}
.upload-drop-sub {
        font-size: 0.82rem;
        color: rgba(255,255,255,0.4);
}
.upload-file-list {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
}
.upload-file-item {
        display: flex;
        align-items: center;
        gap: 14px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 10px;
        padding: 12px 18px;
}
.upload-file-icon {
        font-size: 1.2rem;
        color: rgba(255,255,255,0.5);
}
.upload-file-name {
        font-size: 0.95rem;
        color: rgba(255,255,255,0.85);
        word-break: break-all;
}
.upload-status {
        font-size: 0.92rem;
        min-height: 24px;
        text-align: left;
        width: 100%;
        line-height: 1.7;
        background: rgba(255,255,255,0.04);
        border-radius: 10px;
        padding: 10px 16px;
}
.upload-status:empty { display: none; }
.upload-status.loading { color: rgba(255,255,255,0.6); }
.upload-status.success { color: #6fd98c; }
.upload-status.error   { color: #f0a070; }
.upload-actions {
        width: 100%;
        display: flex;
        justify-content: center;
}
.upload-btn {
        background: rgba(255,255,255,0.1);
        border: 2px solid rgba(255,255,255,0.2);
        color: #fff;
        border-radius: 14px;
        padding: 14px 40px;
        font-size: 1.05rem;
        font-weight: bold;
        cursor: pointer;
        letter-spacing: 1px;
        transition: background 0.2s, border-color 0.2s, opacity 0.2s;
        outline: none;
}
.upload-btn:not(:disabled):hover,
.upload-btn.focused:not(:disabled) {
        background: rgba(255,255,255,0.2);
        border-color: rgba(255,255,255,0.55);
}
.upload-btn:disabled {
        opacity: 0.35;
        cursor: default;
}

/* ===== THEMES SCREEN ===== */
.theme-grid {
        display: flex;
        flex-direction: row;
        gap: 32px;
        margin-bottom: 48px;
}
.theme-card {
        border: 3px solid rgba(255,255,255,0.1);
        border-radius: 20px;
        overflow: hidden;
        cursor: pointer;
        transition: border-color 0.2s, transform 0.15s;
        outline: none;
        min-width: 220px;
}
.theme-card:hover,
.theme-card.focused {
        border-color: rgba(255,255,255,0.6);
        transform: scale(1.04);
}
.theme-card.selected {
        border-color: #fff;
}
.theme-preview {
        padding: 24px 20px;
        font-size: 1rem;
        text-align: center;
        min-height: 100px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
}
.theme-name {
        background: rgba(0,0,0,0.4);
        text-align: center;
        padding: 12px;
        font-size: 1rem;
        font-weight: bold;
        letter-spacing: 2px;
        color: #fff;
}

/* ===== PLAYER SCREEN ===== */
#screen-player {
        justify-content: flex-start;
}

.player-hud {
        display: flex;
        align-items: center;
        gap: 24px;
        width: 100%;
        padding: 16px 32px;
        background: rgba(0,0,0,0.55);
        backdrop-filter: blur(4px);
        flex-shrink: 0;
        position: relative;
        z-index: 10;
}
.player-hud-left {
        flex: 1;
        min-width: 0;
}
.hud-song-name {
        font-size: 1rem;
        font-weight: bold;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        color: rgba(255,255,255,0.9);
}
.player-hud-center {
        flex: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
}
.player-progress-bar {
        width: 100%;
        height: 6px;
        background: rgba(255,255,255,0.15);
        border-radius: 3px;
        overflow: hidden;
}
.progress-fill {
        height: 100%;
        width: 0%;
        background: rgba(255,255,255,0.7);
        border-radius: 3px;
        transition: width 0.3s linear;
}
.hud-time {
        font-size: 0.8rem;
        color: rgba(255,255,255,0.5);
        font-family: monospace;
}
.player-hud-right {
        flex: 0 0 auto;
}
.hud-state {
        font-size: 1.2rem;
        color: rgba(255,255,255,0.6);
}

/* ===== PLAYER BACKGROUND IMAGE ===== */
#screen-player {
        position: relative;
}
.player-bg-image {
        position: absolute;
        inset: 0;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        z-index: 0;
        transition: background-image 0.6s ease;
}
.player-bg-tint {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.62);
        z-index: 1;
        pointer-events: none;
}
/* Flex children that must sit above the background layers */
#player-hud,
.karaoke-display,
#player-controls-bar {
        position: relative;
        z-index: 2;
}

/* ===== KARAOKE DISPLAY ===== */
.karaoke-display {
        flex: 1;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 24px 48px;
        overflow: hidden;
        gap: 28px;
}

/* ── Current lyric line ── */
.lyric-line {
        font-size: 2.8rem;
        font-weight: bold;
        line-height: 1.4;
        text-align: center;
        max-width: 90%;
        word-break: break-word;
}

/* Already-sung syllables → red/warm highlight */
.lyric-sung {
        color: #e84040;
        text-shadow: 0 0 18px rgba(232, 64, 64, 0.55);
        transition: none;
}

/* Still-to-be-sung syllables → muted gray */
.lyric-pending {
        color: rgba(255, 255, 255, 0.55);
}

/* Smaller preview of the NEXT line */
.lyric-next-preview {
        font-size: 1.4rem;
        color: rgba(255, 255, 255, 0.28);
        line-height: 1.3;
        max-width: 80%;
        word-break: break-word;
}

/* ── Line-change animations ── */
@keyframes lyric-slide-up {
        0%   { transform: translateY(0);    opacity: 1; }
        100% { transform: translateY(-70px); opacity: 0; }
}
@keyframes lyric-slide-in {
        0%   { transform: translateY(60px); opacity: 0; }
        100% { transform: translateY(0);    opacity: 1; }
}
.lyric-exit {
        animation: lyric-slide-up 0.30s ease-in forwards;
}
.lyric-enter {
        animation: lyric-slide-in 0.36s ease-out forwards;
}

/* ===== PLAYER CONTROLS BAR ===== */
.player-controls-bar {
        display: flex;
        gap: 16px;
        padding: 16px 32px;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(4px);
        width: 100%;
        justify-content: center;
        flex-shrink: 0;
        transition: opacity 0.4s, transform 0.4s;
}
.player-controls-bar.hidden-controls {
        opacity: 0;
        transform: translateY(100%);
        pointer-events: none;
}
.player-controls-bar.show-controls {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
}

.ctrl-btn {
        background: rgba(255,255,255,0.1);
        border: 2px solid rgba(255,255,255,0.15);
        color: #fff;
        border-radius: 12px;
        padding: 12px 24px;
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.2s, border-color 0.2s;
        outline: none;
        white-space: nowrap;
}
.ctrl-btn:hover,
.ctrl-btn.focused {
        background: rgba(255,255,255,0.2);
        border-color: rgba(255,255,255,0.5);
}

/* ===== THEME PREVIEWS ===== */
.theme-preview.basic {
        background: #1a1a2e;
        text-shadow: 1px 1px 1px #333, -1px -1px 1px #333;
}
.theme-preview.basic .active { color: #F80; }
.theme-preview.basic .inactive { color: #ddd; }
.theme-preview.basic .previous { color: #888; }

.theme-preview.sunset {
        background: #2a1510;
        text-shadow: 1px 1px 1px #ccc, -1px -1px 1px #ccc;
        font-family: 'Georgia', serif;
}
.theme-preview.sunset .active { color: red; }
.theme-preview.sunset .inactive { color: #bbb; }
.theme-preview.sunset .previous { color: #888; }

.theme-preview.christmas {
        background: #0a2010;
        text-shadow: 1px 1px 1px #ccc, -1px -1px 1px #ccc;
}
.theme-preview.christmas .active { color: #B00; }
.theme-preview.christmas .inactive { color: #4a4; }
.theme-preview.christmas .previous { color: #484; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
        .home-title { font-size: 2rem; }
        .home-menu { flex-direction: column; gap: 16px; }
        .home-card { padding: 24px 20px; min-width: unset; }
        .theme-grid { flex-direction: column; gap: 16px; }
        .karaoke-display { font-size: 1.8rem; padding: 16px 24px; }
        .player-hud { padding: 12px 16px; gap: 12px; }
        .song-list-container { padding: 0 16px 8px; }
        .list-header-bar { padding: 16px 16px 8px; }
}

@media (min-width: 1200px) {
        .home-title { font-size: 4rem; }
        .home-card { min-width: 240px; padding: 48px 40px; }
        .karaoke-display { font-size: 3.6rem; }
        .song-name { font-size: 1.4rem; }
        .ctrl-btn { font-size: 1.1rem; padding: 14px 28px; }
}
