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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.5));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(72, 219, 251, 0.8));
    }
}

h2 {
    font-size: 1.5rem;
    color: #feca57;
    letter-spacing: 8px;
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.1rem;
    margin-top: 10px;
}

.instructions {
    color: #48dbfb;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.player-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
    margin: 20px 0;
}

.player-inputs input {
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #48dbfb;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: center;
    transition: all 0.3s ease;
}

.player-inputs input:focus {
    outline: none;
    border-color: #ff6b6b;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.player-inputs input::placeholder {
    color: #666;
}

.code-input-wrapper {
    margin: 30px 0;
}

#game-code-input {
    padding: 20px 30px;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 15px;
    text-align: center;
    border: 3px solid #feca57;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: #feca57;
    width: 200px;
    text-transform: uppercase;
}

#game-code-input:focus {
    outline: none;
    box-shadow: 0 0 30px rgba(254, 202, 87, 0.4);
}

#game-code-input::placeholder {
    color: #666;
    letter-spacing: 10px;
}

.game-header-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.game-code-display {
    background: rgba(254, 202, 87, 0.2);
    border: 2px solid #feca57;
    border-radius: 10px;
    padding: 10px 25px;
    font-size: 1.2rem;
    color: #feca57;
}

.game-code-display span {
    font-weight: bold;
    font-size: 1.5rem;
    letter-spacing: 5px;
}

.countdown-display {
    background: rgba(72, 219, 251, 0.2);
    border: 2px solid #48dbfb;
    border-radius: 10px;
    padding: 8px 20px;
}

#countdown-timer {
    font-size: 1.8rem;
    font-weight: bold;
    color: #48dbfb;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
}

#countdown-timer.warning {
    color: #ff6b6b;
    animation: blink 1s ease-in-out infinite;
}

#countdown-timer.times-up {
    color: #ff6b6b;
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btn-primary {
    padding: 18px 50px;
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.btn-secondary {
    padding: 18px 50px;
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: 2px solid #48dbfb;
    border-radius: 50px;
    background: transparent;
    color: #48dbfb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #48dbfb;
    color: #1a1a2e;
}

.btn-back {
    padding: 12px 30px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid #666;
    border-radius: 50px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-back:hover {
    border-color: #fff;
    color: #fff;
}

.players-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    max-width: 500px;
    margin: 15px 0;
}

.player-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid #48dbfb;
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-card:hover {
    transform: translateY(-5px);
    border-color: #ff6b6b;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.player-card:active {
    transform: scale(0.95);
}

.player-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
}

.drink-count {
    font-size: 0.85rem;
    color: #feca57;
}

.drink-count .count {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #2a2a4a, #1a1a2e);
    border: 3px solid #ff6b6b;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    animation: popIn 0.4s ease;
    max-width: 90%;
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 2.5rem;
    color: #ff6b6b;
    letter-spacing: 5px;
    margin-bottom: 15px;
    animation: pulse 0.5s ease infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.loser-name {
    font-size: 1.8rem;
    color: #feca57;
    font-weight: bold;
    margin-bottom: 15px;
}

.chaser-photo {
    margin: 15px 0;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid #feca57;
    box-shadow: 0 0 20px rgba(254, 202, 87, 0.4);
}

.chaser-photo img {
    width: 100%;
    max-width: 250px;
    max-height: 250px;
    object-fit: cover;
    display: block;
}

.chaser-animation {
    margin: 15px 0;
}

.shot-glass {
    font-size: 4rem;
    display: inline-block;
    animation: shake 0.5s ease infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.btn-drank {
    padding: 18px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(90deg, #00b894, #00cec9);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-drank:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(0, 184, 148, 0.6);
}

/* Rules Button */
.rules-btn {
    position: fixed;
    bottom: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #ff9ff3;
    background: rgba(255, 159, 243, 0.2);
    color: #ff9ff3;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.rules-btn:hover {
    background: #ff9ff3;
    color: #1a1a2e;
    transform: scale(1.1);
}

/* Video Modal */
.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
}

.video-modal-content video {
    width: 100%;
    display: block;
}

.close-video-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-video-btn:hover {
    background: #ff6b6b;
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #feca57;
}

.status-text {
    color: #888;
}

/* Responsive */
@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1rem;
        letter-spacing: 4px;
    }

    .game-code-display {
        font-size: 1rem;
        padding: 8px 20px;
    }

    .game-code-display span {
        font-size: 1.3rem;
    }

    #countdown-timer {
        font-size: 1.4rem;
    }

    .players-grid {
        gap: 10px;
    }

    .player-card {
        padding: 20px 10px;
    }

    .player-name {
        font-size: 1.1rem;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .modal-content h2 {
        font-size: 2rem;
    }

    .loser-name {
        font-size: 1.4rem;
    }

    .shot-glass {
        font-size: 3rem;
    }

    .btn-drank {
        padding: 15px 30px;
        font-size: 1.1rem;
    }

    .btn-primary, .btn-secondary {
        padding: 15px 40px;
        font-size: 1.1rem;
    }

    #game-code-input {
        font-size: 2rem;
        padding: 15px 20px;
        width: 180px;
    }
}
