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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: block;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-top: 50px;
}

h1 {
    text-align: center;
    color: #667eea;
    font-size: 3em;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.input-group {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.btn {
    flex: 1;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
    margin-top: 20px;
}

.btn-danger:hover {
    background: #ee5a5a;
}

.hidden {
    display: none !important;
}

/* Ensure player section is visible when needed */
#playerSection:not(.hidden) {
    display: block !important;
}

/* Lobby Screen */
.lobby-code {
    text-align: center;
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.players-list {
    margin: 30px 0;
}

.players-list h3 {
    margin-bottom: 15px;
    color: #667eea;
}

#playersList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Game Screen */
#gameScreen {
    max-width: 100dvw;
    margin: 0 auto;
}

.game-header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.game-header h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.video-input {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.video-input h3 {
    margin-bottom: 15px;
    color: #667eea;
}

#playerSection {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

#youtubePlayer {
    max-width: 640px;
    margin: 0 auto;
    display: none; /* Video verstecken */
}

#videoInfo {
    margin-top: 15px;
    font-size: 1.1em;
    color: #666;
    text-align: center;
}

#playPauseBtn {
    font-size: 1.2em;
    padding: 15px 40px;
    min-width: 200px;
}

/* Volume Slider Styling */
#volumeSlider {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

#volumeSlider:hover {
    opacity: 1;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

#volumeSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

#volumeSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

#volumeSlider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

#volumeValue {
    color: #667eea;
    font-weight: bold;
    min-width: 45px;
    text-align: right;
}

#placementSection {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

#placementSection h3 {
    color: #667eea;
    margin-bottom: 10px;
}

/* Timelines */
#timelinesContainer {
    background: white;
    padding: 20px;
    border-radius: 15px;
}

#timelinesContainer h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.timeline-player {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 15px;
}

.timeline-player.current {
    border: 3px solid #667eea;
    background: #fff;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.timeline-header h3 {
    color: #667eea;
}

.score {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.timeline {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 80px;
    padding: 10px;
    overflow-x: auto;
}

/* Timeline Slot - neues Design mit Strichen */
.timeline-slot {
    width: 4px;
    height: 80px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    margin: 0 10px;
}

.timeline-slot::before {
    content: '▼';
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2em;
    color: #999;
    opacity: 1;
    transition: all 0.3s;
}

.timeline-slot:hover::before {
    color: #667eea;
    transform: translateX(-50%) scale(1.2);
}

.timeline-slot:hover {
    background: #667eea;
    transform: scaleX(1.5);
}

.timeline-slot.active {
    background: #667eea;
    transform: scaleX(1.5);
}

.timeline-slot.active::before {
    color: #667eea;
    transform: translateX(-50%) scale(1.2);
}

.timeline-slot.selected {
    background: #4caf50;
    transform: scaleX(2);
}

.timeline-slot.selected::before {
    color: #4caf50;
    transform: translateX(-50%) scale(1.3);
}

.timeline-slot.occupied {
    background: #ff6b6b;
    transform: scaleX(2);
    cursor: not-allowed !important;
}

.timeline-slot.occupied::before {
    display: none; /* Pfeil verstecken wenn Badge da ist */
}

.timeline-slot.player-choice {
    background: #ffd700;
    transform: scaleX(2);
    cursor: not-allowed !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.timeline-slot.player-choice::before {
    display: none; /* Pfeil verstecken wenn Badge da ist */
}

.video-card {
    min-width: 120px;
    max-width: 120px;
    padding: 20px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    text-align: center;
    cursor: default;
    transition: transform 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.video-card:hover {
    transform: scale(1.05);
}

.video-card .year {
    font-size: 1.8em;
    font-weight: bold;
}

.video-card .title {
    font-size: 0.8em;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 5px solid #4caf50;
}

.notification.error {
    border-left: 5px solid #f44336;
}

.notification.info {
    border-left: 5px solid #2196f3;
}

/* Betting Banner (nicht blockierend!) */
.betting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none; /* Lässt Klicks durch! */
}

.betting-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

.betting-content h2 {
    margin: 0;
    font-size: 1.3em;
}

.timer-display {
    font-size: 2.5em;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.guesses {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.9em;
}

#lockInBtn, #betLockInBtn {
    animation: pulse 2s infinite;
}

/* Bet Badge - über dem Strich */
.bet-badge {
    position: absolute;
    transform: translate(-30%, -20%);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    color: #333 !important;
    padding: 8px 15px;
    border-radius: 18px;
    font-size: 0.85em !important;
    font-weight: bold !important;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border: 2px solid white;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Player Choice Badge - über dem Strich */
.player-choice-badge {
    position: absolute;
    transform: translate(-30%, -20%);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%) !important;
    color: #333 !important;
    padding: 8px 15px;
    border-radius: 18px;
    font-size: 0.85em !important;
    font-weight: bold !important;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border: 2px solid white;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Selected Badge - über dem Strich (noch nicht gelockt) */
.selected-badge {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%) !important;
    color: white !important;
    padding: 8px 15px;
    border-radius: 18px;
    font-size: 0.85em !important;
    font-weight: bold !important;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border: 2px solid white;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#lockInSection, #bettingLockInSection {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .button-group {
        flex-direction: column;
    }

    .timeline {
        flex-wrap: wrap;
    }
    
    .betting-content {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .timer-display {
        font-size: 2em;
    }
    
    .betting-overlay {
        padding: 10px;
    }
}

