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

:root {
    --navy: #0a1628;
    --red: #bf0a30;
    --gold: #ffd700;
    --white: #ffffff;
    --light-blue: #002868;
}

body {
    font-family: 'Staatliches', sans-serif;
    background: var(--navy);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    position: relative;
}

.app-container.shake {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.stage-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #0a1628 0%, #1a2a4a 50%, #0a1628 100%);
    z-index: -1;
    overflow: hidden;
}

.spotlight {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(255,215,0,0.15) 0%, transparent 70%);
    animation: spotlight 4s ease-in-out infinite;
}

@keyframes spotlight {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}

.flags {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 5%;
}

.flag {
    width: 60px;
    height: 100px;
    background: linear-gradient(180deg, 
        #bf0a30 0%, #bf0a30 7.7%,
        #fff 7.7%, #fff 15.4%,
        #bf0a30 15.4%, #bf0a30 23.1%,
        #fff 23.1%, #fff 30.8%,
        #bf0a30 30.8%, #bf0a30 38.5%,
        #fff 38.5%, #fff 46.2%,
        #bf0a30 46.2%, #bf0a30 53.9%,
        #fff 53.9%, #fff 61.6%,
        #bf0a30 61.6%, #bf0a30 69.3%,
        #fff 69.3%, #fff 77%,
        #bf0a30 77%, #bf0a30 84.7%,
        #fff 84.7%, #fff 92.4%,
        #bf0a30 92.4%, #bf0a30 100%
    );
    border-radius: 4px;
    animation: wave 3s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.flag.right {
    animation-delay: 0.5s;
}

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

.sound-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    background: rgba(0,0,0,0.5);
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s;
}

.sound-toggle:hover {
    transform: scale(1.1);
}

.title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 6vw, 4rem);
    color: var(--gold);
    text-shadow: 3px 3px 0 var(--red), 6px 6px 0 rgba(0,0,0,0.3);
    margin-top: 1rem;
    letter-spacing: 4px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 3px 3px 0 var(--red), 6px 6px 0 rgba(0,0,0,0.3); }
    50% { text-shadow: 3px 3px 10px var(--red), 6px 6px 20px rgba(191,10,48,0.5); }
}

.subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 1rem 0;
}

.character-area {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.speech-bubble {
    background: var(--white);
    color: var(--navy);
    padding: 1.5rem;
    border-radius: 20px;
    max-width: 400px;
    min-height: 100px;
    position: relative;
    margin-bottom: 1rem;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    line-height: 1.4;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.speech-bubble.visible {
    opacity: 1;
    transform: scale(1);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border: 15px solid transparent;
    border-top-color: var(--white);
}

.repeat-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--red);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.9rem;
    animation: bounce 0.5s ease;
}

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

.podium-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.character {
    position: relative;
    width: 120px;
    height: 200px;
    animation: idle 2s ease-in-out infinite;
}

@keyframes idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.head {
    position: relative;
    width: 80px;
    height: 90px;
    margin: 0 auto;
}

.hair {
    position: absolute;
    top: 0;
    left: 5px;
    width: 70px;
    height: 35px;
    background: #2a2a2a;
    border-radius: 35px 35px 0 0;
}

.face {
    position: absolute;
    top: 20px;
    left: 5px;
    width: 70px;
    height: 70px;
    background: #e8c4a0;
    border-radius: 50% 50% 45% 45%;
}

.eyebrows {
    position: absolute;
    top: 15px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
}

.eyebrow {
    width: 15px;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    transition: transform 0.3s;
}

.character.confused .eyebrow.left {
    transform: rotate(-20deg) translateY(-5px);
}

.character.confused .eyebrow.right {
    transform: rotate(20deg) translateY(-5px);
}

.character.intense .eyebrow {
    transform: translateY(3px);
}

.eyes {
    position: absolute;
    top: 25px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
}

.eye {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    animation: blink 4s ease-in-out infinite;
}

@keyframes blink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.pupil {
    width: 8px;
    height: 8px;
    background: #2a2a2a;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.character.intense .eye {
    transform: scale(1.3);
}

.sweat-drops {
    position: absolute;
    top: 10px;
    right: -5px;
}

.drop {
    width: 8px;
    height: 12px;
    background: #6ac4ff;
    border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
    margin: 2px;
    animation: drip 1s ease-in-out infinite;
}

.drop:nth-child(2) { animation-delay: 0.3s; }
.drop:nth-child(3) { animation-delay: 0.6s; }

@keyframes drip {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

.nose {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 15px;
    background: #d4a574;
    border-radius: 50%;
}

.mouth {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 8px;
    background: #8b4a4a;
    border-radius: 0 0 10px 10px;
    transition: all 0.1s;
}

.mouth.talking {
    animation: talk 0.15s ease-in-out infinite;
}

@keyframes talk {
    0%, 100% { height: 8px; }
    50% { height: 15px; border-radius: 50%; }
}

.character.drinking .mouth {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.body {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.suit {
    width: 80px;
    height: 80px;
    background: #1a1a3a;
    margin: 0 auto;
    border-radius: 10px 10px 0 0;
    position: relative;
}

.tie {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 50px;
    background: var(--red);
    clip-path: polygon(30% 0%, 70% 0%, 80% 20%, 60% 100%, 40% 100%, 20% 20%);
}

.arm {
    position: absolute;
    width: 20px;
    height: 60px;
    background: #1a1a3a;
    border-radius: 10px;
    top: 10px;
    transition: transform 0.3s;
}

.arm.left {
    left: -5px;
    transform-origin: top center;
}

.arm.right {
    right: -5px;
    transform-origin: top center;
}

.arm.pointing {
    transform: rotate(-45deg) translateX(-20px);
}

.arm.right.drinking {
    transform: rotate(-60deg) translateX(10px) translateY(-20px);
}

.podium {
    width: 150px;
    height: 100px;
    background: linear-gradient(180deg, #2a3a5a 0%, #1a2a4a 100%);
    border-radius: 10px 10px 0 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.podium-front {
    font-size: 2rem;
}

.water-bottle {
    position: absolute;
    top: -40px;
    right: 20px;
    cursor: pointer;
    transition: all 0.3s;
    animation: glowPulse 2s ease-in-out infinite;
}

.water-bottle:hover {
    transform: scale(1.1);
}

.water-bottle.grabbed {
    transform: translateY(-50px) translateX(30px) rotate(-45deg);
}

@keyframes glowPulse {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(100,200,255,0.5)); }
    50% { filter: drop-shadow(0 0 15px rgba(100,200,255,0.8)); }
}

.bottle-cap {
    width: 15px;
    height: 8px;
    background: #4a90c2;
    margin: 0 auto;
    border-radius: 3px 3px 0 0;
}

.bottle-body {
    width: 25px;
    height: 45px;
    background: rgba(200,230,255,0.3);
    border: 2px solid rgba(100,180,255,0.5);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.water-level {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #6ac4ff 0%, #3a94cf 100%);
    transition: height 0.5s;
}

.bottle-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(ellipse at center, rgba(100,200,255,0.3) 0%, transparent 70%);
    pointer-events: none;
}

.stats-panel {
    background: rgba(0,0,0,0.7);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 1.5rem;
    min-width: 280px;
    box-shadow: 0 0 30px rgba(255,215,0,0.2);
}

.stats-panel h2 {
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 2px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.8rem 0;
    padding: 0.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.stat-icon {
    font-size: 1.3rem;
    width: 30px;
    text-align: center;
}

.stat-label {
    flex: 1;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.stat-value {
    color: #00ff00;
    font-size: 1.2rem;
}

.lcd {
    font-family: 'VT323', monospace;
    background: #001100;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #003300;
}

.blink {
    animation: lcdBlink 1s ease-in-out infinite;
}

@keyframes lcdBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.stat.hydration {
    flex-wrap: wrap;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #001133;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #003366;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #ffff00 50%, #00ff00 100%);
    transition: width 0.5s;
    border-radius: 8px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    padding: 0 1rem;
}

.btn {
    font-family: 'Staatliches', sans-serif;
    font-size: 1.1rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: linear-gradient(180deg, #bf0a30 0%, #8a0724 100%);
    color: white;
}

.btn.primary.active {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(191,10,48,0.7); }
    50% { box-shadow: 0 0 0 15px rgba(191,10,48,0); }
}

.btn.water {
    background: linear-gradient(180deg, #4a90c2 0%, #2a5a8a 100%);
    color: white;
}

.btn.loop {
    background: linear-gradient(180deg, #ffd700 0%, #b8960a 100%);
    color: #1a1a3a;
}

.btn.loop.active {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { box-shadow: 0 0 20px var(--gold); }
    to { box-shadow: 0 0 40px var(--gold); }
}

.btn.debate {
    background: linear-gradient(180deg, #ff6b35 0%, #cc4a1a 100%);
    color: white;
}

.btn.debate.active {
    animation: debatePulse 0.5s ease-in-out infinite;
}

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

.btn.reset {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    color: white;
}

.footer {
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

.disclaimer {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-family: sans-serif;
}

.remix-link {
    color: var(--gold);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
}

.remix-link:hover {
    text-shadow: 0 0 10px var(--gold);
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-panel {
        width: 100%;
        max-width: 350px;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .btn {
        width: 100%;
    }
    
    .speech-bubble {
        max-width: 90vw;
        font-size: 1rem;
    }
    
    .flags {
        display: none;
    }
}