:root {
    --color-artist: #FF6B6B;
    --color-title: #4ECDC4;
    --color-decade: #FFE66D;
    --color-year5: #95E1D3;
    --color-year2: #C7CEEA;
    --bg-dark: #1a1a2e;
    --bg-light: #16213e;
    --text-light: #ffffff;
    --text-dark: #0f0f0f;
    --accent: #e94560;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    color: var(--text-light);
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5em;
    background: linear-gradient(45deg, var(--color-artist), var(--color-title), var(--color-decade));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin: 5px;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #f06292);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349, #f45c43);
    color: white;
}

.btn-large {
    width: 100%;
    padding: 20px;
    font-size: 1.3em;
    margin: 10px 0;
}

/* Settings Screen */
.settings-screen {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
}

/* Player Management */
.player-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.player-input-group input {
    flex: 1;
    min-width: 0; /* voorkomt overflow op mobiel */
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1em;
}

.player-input-group .btn {
    flex-shrink: 0; /* knop blijft altijd zichtbaar */
    white-space: nowrap;
    padding: 12px 16px;
    font-size: 0.95em;
}

.player-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.player-list {
    list-style: none;
    margin-top: 15px;
}

.player-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    transition: all 0.3s ease;
}

.player-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.player-item.dragging {
    opacity: 0.5;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-number {
    background: var(--accent);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.btn-remove {
    background: rgba(255, 0, 0, 0.6);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
}

/* Music Platform Selection */
.platform-options {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.platform-option {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.platform-option:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.platform-option.selected {
    background: linear-gradient(135deg, var(--accent), #f06292);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.platform-icon {
    font-size: 1.8em;
}

.platform-option small {
    font-size: 0.75em;
    opacity: 0.8;
}

/* Fragment duur knoppen */
.duration-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.duration-btn {
    flex: 1;
    min-width: 50px;
    padding: 12px 8px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.duration-btn:hover {
    background: rgba(255,255,255,0.2);
}

.duration-btn.selected {
    background: linear-gradient(135deg, var(--accent), #f06292);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(233,69,96,0.4);
}

/* Categorie punten badge */
.category-points-badge {
    display: inline-block;
    margin-top: 6px;
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-size: 0.95em;
    font-weight: bold;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

/* Song info box */
.song-info-box {
    position: relative;
}

.song-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.song-info-header h3 {
    margin: 0;
}

.btn-close-info {
    background: rgba(255,255,255,0.12);
    border: none;
    color: rgba(255,255,255,0.7);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1em;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-close-info:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* Onthul track knop */
.btn-info {
    background: linear-gradient(135deg, #4776e6, #8e54e9);
    color: white;
}

.btn-info:disabled {
    background: rgba(255,255,255,0.15);
    cursor: default;
    opacity: 0.7;
    box-shadow: none;
}

/* Points System */
.points-system {
    margin-top: 15px;
}

.points-option {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.points-option:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
}

.points-option.selected {
    background: linear-gradient(135deg, var(--accent), #f06292);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.points-option input[type="radio"] {
    display: none;
}

.variable-points {
    margin-top: 15px;
    display: none;
}

.variable-points.active {
    display: block;
}

.category-points {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.category-points.artist { border-left: 4px solid var(--color-artist); }
.category-points.title { border-left: 4px solid var(--color-title); }
.category-points.decade { border-left: 4px solid var(--color-decade); }
.category-points.year5 { border-left: 4px solid var(--color-year5); }
.category-points.year2 { border-left: 4px solid var(--color-year2); }

.points-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.points-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.points-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.points-value {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
}

/* Game Rules */
.game-rules {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    line-height: 1.8;
    text-align: left;
    max-height: 60vh;
    overflow-y: auto;
}

.game-rules h3 {
    color: var(--accent);
    margin-bottom: 10px;
    margin-top: 15px;
}

.game-rules h3:first-child {
    margin-top: 0;
}

.game-rules ul {
    margin-left: 20px;
}

.game-rules li {
    margin-bottom: 8px;
}

/* Game Screen */
.game-screen {
    display: none;
}

.game-screen.active {
    display: block;
}

/* Current Category */
.current-category {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    animation: pulse 2s infinite;
}

.current-category.artist { background: linear-gradient(135deg, var(--color-artist), #ff8787); }
.current-category.title { background: linear-gradient(135deg, var(--color-title), #6fd9d0); }
.current-category.decade { background: linear-gradient(135deg, var(--color-decade), #fff094); }
.current-category.year5 { background: linear-gradient(135deg, var(--color-year5), #b3f0e6); }
.current-category.year2 { background: linear-gradient(135deg, var(--color-year2), #dde2f4); }

.current-category h2 {
    font-size: 1.8em;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.current-category p {
    font-size: 1.1em;
    color: var(--text-dark);
    opacity: 0.8;
}

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

/* Top-right vignette — rechts boven, eerste 15 seconden
   Dekt de helft horizontaal (rechts) en ~20% verticaal (boven) */
.video-vignette-topright {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 20%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,1)   0%,
        rgba(0,0,0,1)   40%,
        rgba(0,0,0,0.7) 70%,
        rgba(0,0,0,0)   100%
    );
}

.video-vignette-topright.visible {
    opacity: 1;
}

.video-vignette-topright.fade-out {
    opacity: 0;
}

/* Vignette overlay boven YouTube iframe */
.video-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease;

    background: radial-gradient(ellipse at center,
        rgba(0,0,0,0)    25%,
        rgba(0,0,0,0.5)  45%,
        rgba(0,0,0,0.92) 62%,
        rgba(0,0,0,1)    72%,
        rgba(0,0,0,1)    100%
    );
}

.video-vignette.visible {
    opacity: 1;
}

.video-vignette.fade-out {
    opacity: 0;
}

/* Volledig zwart vlak aan het einde van de countdown,
   met transparant venster linksonder voor YouTube controls (~20%) */
.video-vignette.blackout {
    background:
        /* Transparant gat linksonder voor YouTube controls */
        radial-gradient(ellipse 38% 28% at 12% 91%,
            rgba(0,0,0,0)   0%,
            rgba(0,0,0,0)   55%,
            rgba(0,0,0,1)   100%
        );
    transition: opacity 0.4s ease;
}

/* Countdown display */
.countdown-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    line-height: 1;
}

.countdown-display span {
    /* 30% van iframe hoogte — iframe is 56.25% van breedte, container max 600px */
    font-size: clamp(80px, 30vw, 180px);
    font-weight: 900;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.15);
    text-shadow: 0 0 40px rgba(255,255,255,0.08);
    letter-spacing: -0.05em;
    display: block;
    text-align: center;
    /* Geen pointer-events zodat iframe bereikbaar blijft */
    user-select: none;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Scoreboard */
.scoreboard {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.scoreboard h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.score-item.correct {
    background: rgba(17, 153, 142, 0.25);
    border: 1px solid rgba(56, 239, 125, 0.4);
}

.score-player-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-name {
    font-weight: bold;
    font-size: 1.05em;
}

.player-score {
    font-size: 1em;
    font-weight: bold;
    color: #FFE66D;
}

/* Per-speler goed knop */
.btn-correct-player {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border: none;
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-correct-player:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(56, 239, 125, 0.4);
}

.btn-correct-player.is-correct {
    background: linear-gradient(135deg, #2d6a4f, #52b788);
    cursor: default;
    transform: none;
    opacity: 0.85;
}

/* Game Controls */
.game-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal-content h2 {
    margin-bottom: 15px;
    color: var(--accent);
}

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

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

/* Responsive */
@media (max-width: 480px) {
    .header h1 {
        font-size: 2em;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .btn-large {
        padding: 18px;
        font-size: 1.2em;
    }
    
    .current-category h2 {
        font-size: 1.5em;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
}

.loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
