/* Elemental Clash Host Styles */

.arena-container {
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Element Colors */
:root {
    --fire: #ef4444;
    --fire-glow: rgba(239, 68, 68, 0.5);
    --water: #3b82f6;
    --water-glow: rgba(59, 130, 246, 0.5);
    --earth: #22c55e;
    --earth-glow: rgba(34, 197, 94, 0.5);
    --air: #a855f7;
    --air-glow: rgba(168, 85, 247, 0.5);
}

/* Lobby Screen */
.arena-title {
    text-align: center;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--fire) 0%, var(--water) 33%, var(--earth) 66%, var(--air) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: elementShift 8s ease-in-out infinite;
}

@keyframes elementShift {
    0%, 100% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(90deg); }
    50% { filter: hue-rotate(180deg); }
    75% { filter: hue-rotate(270deg); }
}

.pin-display {
    text-align: center;
    margin-bottom: 40px;
}

.pin-label {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.pin-code {
    font-size: 4rem;
    font-weight: bold;
    letter-spacing: 15px;
    color: var(--light);
    text-shadow: 0 0 30px var(--fire-glow);
}

/* Players Circle - Horizontal Oval for TV */
.players-circle {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    height: 400px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: radial-gradient(ellipse 60% 50% at center, rgba(255,255,255,0.05) 0%, transparent 70%);
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.player-slot {
    position: absolute;
    width: 100px;
    height: 120px;
    transform: translate(-50%, -50%);
    text-align: center;
    transition: all 0.3s;
}

.player-slot .avatar {
    font-size: 3rem;
    display: block;
    margin-bottom: 5px;
}

.player-slot .name {
    font-size: 0.9rem;
    color: var(--light);
    font-weight: bold;
    margin-bottom: 5px;
}

.player-slot .element {
    font-size: 1.5rem;
}

.player-slot.fire {
    filter: drop-shadow(0 0 15px var(--fire-glow));
}
.player-slot.water {
    filter: drop-shadow(0 0 15px var(--water-glow));
}
.player-slot.earth {
    filter: drop-shadow(0 0 15px var(--earth-glow));
}
.player-slot.air {
    filter: drop-shadow(0 0 15px var(--air-glow));
}

.player-slot .hp-bar-mini {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 5px auto 0;
    overflow: hidden;
}

.player-slot .hp-bar-mini .hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #84cc16);
    transition: width 0.3s;
}

/* Lobby Info */
.lobby-info {
    text-align: center;
    margin-bottom: 20px;
}

.player-count {
    font-size: 1.3rem;
    color: var(--gray);
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.auto-start-countdown {
    color: var(--gray);
    font-size: 1rem;
}

.btn-fire {
    background: linear-gradient(135deg, var(--fire) 0%, #f97316 100%);
    color: white;
    padding: 15px 50px;
    font-size: 1.3rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.btn-fire:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px var(--fire-glow);
}

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

/* Battle Screen */
#battle-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px 30px;
}

.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.match-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--light);
}

.timer-icon {
    font-size: 1.5rem;
}

.round-info {
    font-size: 1.5rem;
    color: var(--gray);
}

.turn-timer {
    font-size: 1.3rem;
    color: var(--fire);
    font-weight: bold;
}

/* Arena - Horizontal Oval for TV */
.arena {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 20px;
}

.arena-center {
    position: absolute;
    width: 280px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.1) 0%, transparent 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.element-cycle {
    display: flex;
    gap: 8px;
    font-size: 1.4rem;
    opacity: 0.6;
}

.element-cycle .beats {
    color: var(--gray);
}

.arena-player {
    position: absolute;
    text-align: center;
    transition: all 0.5s;
}

.arena-player .player-avatar {
    font-size: 4rem;
    display: block;
}

.arena-player .player-name {
    font-size: 1rem;
    color: var(--light);
    margin: 5px 0;
}

.arena-player .player-hp {
    width: 100px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.arena-player .player-hp .hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #84cc16);
    transition: width 0.5s;
}

.arena-player .player-element {
    font-size: 1.5rem;
    margin-top: 5px;
}

.arena-player.attacking {
    animation: attackPulse 0.5s ease-out;
}

.arena-player.defending {
    animation: defendPulse 0.5s ease-out;
}

.arena-player.damaged {
    animation: damagePulse 0.5s ease-out;
}

.arena-player.eliminated {
    opacity: 0.3;
    filter: grayscale(100%);
}

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

@keyframes defendPulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
    100% { box-shadow: 0 0 0 30px rgba(59, 130, 246, 0); }
}

@keyframes damagePulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(2) hue-rotate(180deg); }
}

/* Battle Log */
.battle-log {
    max-height: 100px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 10px 20px;
    flex-shrink: 0;
    margin-top: 10px;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    color: var(--gray);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry .damage {
    color: var(--fire);
    font-weight: bold;
}

.log-entry .heal {
    color: var(--earth);
    font-weight: bold;
}

.log-entry .block {
    color: var(--water);
    font-weight: bold;
}

/* Resolution Screen */
.resolution-title {
    text-align: center;
    font-size: 2rem;
    color: var(--light);
    margin-bottom: 30px;
}

.actions-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    min-width: 150px;
}

.action-card .player-name {
    font-size: 1rem;
    color: var(--light);
    margin-bottom: 10px;
}

.action-card .action-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.action-card .action-text {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Final Screen */
.winner-title {
    text-align: center;
    font-size: 3rem;
    color: #fbbf24;
    margin-bottom: 30px;
}

.winner-display {
    text-align: center;
    margin-bottom: 40px;
}

.winner-avatar {
    font-size: 8rem;
    display: block;
    margin-bottom: 20px;
    animation: winnerBounce 1s ease-in-out infinite;
}

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

.winner-name {
    font-size: 2.5rem;
    color: var(--light);
    margin-bottom: 10px;
}

.winner-element {
    font-size: 2rem;
}

.final-stats {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.final-countdown {
    text-align: center;
    color: var(--gray);
    margin-bottom: 20px;
}

#btn-new-game {
    display: block;
    margin: 0 auto;
}

/* Action Indicator */
.action-indicator {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.action-indicator.show {
    opacity: 1;
    animation: actionPop 0.5s ease-out;
}

@keyframes actionPop {
    0% { transform: translateX(-50%) scale(0); }
    50% { transform: translateX(-50%) scale(1.3); }
    100% { transform: translateX(-50%) scale(1); }
}

/* Focus Bar */
.focus-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 5px;
}

.focus-pip {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.focus-pip.filled {
    background: var(--air);
    border-color: var(--air);
    box-shadow: 0 0 10px var(--air-glow);
}

/* Attack Projectile */
.attack-projectile {
    position: absolute;
    font-size: 2rem;
    transform: translate(-50%, -50%);
    transition: left 0.5s ease-in-out, top 0.5s ease-in-out;
    z-index: 200;
    pointer-events: none;
}

.attack-projectile.fire {
    filter: drop-shadow(0 0 15px var(--fire));
}

.attack-projectile.water {
    filter: drop-shadow(0 0 15px var(--water));
}

.attack-projectile.earth {
    filter: drop-shadow(0 0 15px var(--earth));
}

.attack-projectile.air {
    filter: drop-shadow(0 0 15px var(--air));
}

.attack-projectile.flying {
    animation: projectileFly 0.5s ease-in-out;
}

@keyframes projectileFly {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.5); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Defense Shield */
.defense-shield {
    position: absolute;
    font-size: 4rem;
    transform: translate(-50%, -50%);
    z-index: 150;
    pointer-events: none;
    animation: shieldPulse 1s ease-out;
}

.defense-shield.mega {
    font-size: 5rem;
    animation: megaShieldPulse 1s ease-out;
}

@keyframes shieldPulse {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

@keyframes megaShieldPulse {
    0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.5) rotate(10deg); opacity: 1; }
    60% { transform: translate(-50%, -50%) scale(1.3) rotate(-5deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0; }
}

/* Focus Effect */
.focus-effect {
    position: absolute;
    font-size: 3rem;
    transform: translate(-50%, -50%);
    z-index: 150;
    pointer-events: none;
    animation: focusPulse 1s ease-out;
}

@keyframes focusPulse {
    0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.5) rotate(180deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(360deg); opacity: 0; }
}

.focus-sparkle {
    position: absolute;
    font-size: 1.5rem;
    transform: translate(-50%, -50%);
    z-index: 151;
    pointer-events: none;
    animation: sparkleOrbit 1s ease-out forwards;
}

@keyframes sparkleOrbit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(0px);
        opacity: 0;
    }
    30% { opacity: 1; }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) translateX(60px);
        opacity: 0;
    }
}

/* Heal Effect */
.heal-effect {
    position: absolute;
    font-size: 2rem;
    color: #22c55e;
    transform: translate(-50%, -50%);
    z-index: 150;
    pointer-events: none;
    animation: healFloat 1s ease-out forwards;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
}

@keyframes healFloat {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30% { transform: translate(-50%, -70%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1); opacity: 0; }
}

.heal-particle {
    position: absolute;
    font-size: 1.2rem;
    color: #22c55e;
    transform: translate(-50%, -50%);
    z-index: 149;
    pointer-events: none;
    animation: healParticleRise 1s ease-out forwards;
}

@keyframes healParticleRise {
    0% { transform: translate(-50%, 0) scale(0); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translate(-50%, -80px) scale(1); opacity: 0; }
}

/* Counter Effect */
.counter-effect {
    position: absolute;
    font-size: 4rem;
    transform: translate(-50%, -50%);
    z-index: 150;
    pointer-events: none;
    animation: counterSpin 1s ease-out;
}

@keyframes counterSpin {
    0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.3) rotate(180deg); opacity: 1; }
    60% { transform: translate(-50%, -50%) scale(1.1) rotate(540deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(720deg); opacity: 0; }
}

/* Damage Number */
.damage-number {
    position: absolute;
    font-size: 2rem;
    font-weight: bold;
    transform: translateX(-50%);
    z-index: 200;
    pointer-events: none;
    animation: damageFloat 1.5s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.damage-number.damage {
    color: var(--fire);
}

.damage-number.blocked {
    color: var(--water);
}

.damage-number.counter {
    color: var(--air);
}

@keyframes damageFloat {
    0% { transform: translateX(-50%) translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateX(-50%) translateY(-20px) scale(1.2); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-80px) scale(1); opacity: 0; }
}

/* Explosion Particles */
.explosion-particle {
    position: absolute;
    font-size: 1.5rem;
    transform: translate(-50%, -50%);
    z-index: 200;
    pointer-events: none;
    animation: explode 1s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(0px) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(100px) scale(0);
        opacity: 0;
    }
}

/* Elimination Skull */
.elimination-skull {
    position: absolute;
    font-size: 5rem;
    transform: translate(-50%, -50%);
    z-index: 210;
    pointer-events: none;
    animation: skullAppear 1.5s ease-out forwards;
}

@keyframes skullAppear {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-20deg); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.5) rotate(10deg); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2) rotate(-5deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3) rotate(0deg); opacity: 0; }
}

/* Player Damage/Defending animations */
.arena-player.damaged {
    animation: playerDamaged 0.6s ease-out;
}

@keyframes playerDamaged {
    0%, 100% { filter: brightness(1); }
    25% { filter: brightness(2) hue-rotate(-30deg); transform: translate(-50%, -50%) scale(1.1); }
    50% { filter: brightness(0.5); transform: translate(-50%, -50%) scale(0.95); }
    75% { filter: brightness(1.5); transform: translate(-50%, -50%) scale(1.05); }
}

.arena-player.defending {
    animation: playerDefending 0.6s ease-out;
}

@keyframes playerDefending {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 30px 10px var(--water-glow); }
}

.arena-player.eliminating {
    animation: playerEliminating 1s ease-out forwards;
}

@keyframes playerEliminating {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* ============ MINI-GAME SCREEN ============ */
#minigame-screen, #minigame-results-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
}

.minigame-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.round-badge {
    background: linear-gradient(135deg, var(--air) 0%, var(--water) 100%);
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
}

.minigame-timer-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fire) 0%, var(--air) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px var(--fire-glow);
    animation: timerPulse 1s ease-in-out infinite;
}

.minigame-timer {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

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

.minigame-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.minigame-title {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--fire) 0%, var(--air) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.minigame-description {
    font-size: 1.3rem;
    color: var(--gray);
    margin-bottom: 30px;
}

.minigame-display {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Color Touch Mini-game */
.color-challenge {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.target-color {
    width: 250px;
    height: 250px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: targetPulse 0.8s ease-in-out infinite;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

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

/* Stroop Challenge */
.stroop-challenge {
    text-align: center;
    margin-bottom: 20px;
}

.stroop-instruction {
    font-size: 2rem;
    color: var(--gray);
    margin-bottom: 20px;
}

.stroop-target {
    font-size: 5rem;
    font-weight: bold;
    color: var(--light);
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
    animation: stroopPulse 0.6s ease-in-out infinite;
}

@keyframes stroopPulse {
    0%, 100% { transform: scale(1); text-shadow: 0 0 40px rgba(255, 255, 255, 0.5); }
    50% { transform: scale(1.05); text-shadow: 0 0 60px rgba(255, 255, 255, 0.8); }
}

.color-display {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.color-option {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: colorPulse 1.5s ease-in-out infinite;
}

.color-option.red { animation-delay: 0s; }
.color-option.blue { animation-delay: 0.2s; }
.color-option.green { animation-delay: 0.4s; }
.color-option.yellow { animation-delay: 0.6s; }

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

/* Dodge Mini-game */
.dodge-display {
    text-align: center;
}

.attack-direction {
    font-size: 8rem;
    animation: attackArrow 0.5s ease-out infinite;
}

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

.dodge-hint {
    font-size: 1.5rem;
    color: var(--fire);
    font-weight: bold;
    margin-top: 20px;
}

/* Lucky Symbol Mini-game */
.symbols-display {
    display: flex;
    gap: 30px;
}

.symbol-option {
    font-size: 4rem;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    animation: symbolBounce 1s ease-in-out infinite;
}

.symbol-option:nth-child(1) { animation-delay: 0s; }
.symbol-option:nth-child(2) { animation-delay: 0.15s; }
.symbol-option:nth-child(3) { animation-delay: 0.3s; }
.symbol-option:nth-child(4) { animation-delay: 0.45s; }

.symbol-option.missing {
    background: rgba(239, 68, 68, 0.3);
    border: 3px dashed var(--fire);
    animation: missingPulse 1s ease-in-out infinite;
}

@keyframes missingPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

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

/* Coin Flip Mini-game */
.coin-flip-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.coin {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.5), inset 0 -5px 20px rgba(0,0,0,0.2);
    border: 6px solid #fcd34d;
}

.coin.spinning {
    animation: coinSpin 0.8s linear infinite;
}

.coin-side {
    font-size: 6rem;
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.coin-options {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 1.8rem;
    color: var(--light);
}

.coin-option {
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.coin-vs {
    color: var(--gray);
    font-style: italic;
}

/* Legacy risk styles */
.risk-display {
    display: flex;
    align-items: center;
    gap: 30px;
}

.risk-option {
    padding: 30px 40px;
    border-radius: 16px;
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
}

.risk-option.risk {
    background: linear-gradient(135deg, var(--fire) 0%, #f97316 100%);
    color: white;
    animation: riskGlow 1s ease-in-out infinite;
}

.risk-option.safe {
    background: linear-gradient(135deg, var(--water) 0%, var(--air) 100%);
    color: white;
}

.risk-option small {
    display: block;
    margin-top: 10px;
    font-weight: normal;
    font-size: 0.9rem;
    opacity: 0.9;
}

.vs {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gray);
}

@keyframes riskGlow {
    0%, 100% { box-shadow: 0 0 20px var(--fire-glow); }
    50% { box-shadow: 0 0 40px var(--fire-glow); }
}

/* Element Boost Mini-game */
.elements-display {
    display: flex;
    gap: 20px;
}

.element-option {
    font-size: 4rem;
    padding: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: transform 0.3s;
}

.element-option.fire { box-shadow: 0 0 30px var(--fire-glow); }
.element-option.water { box-shadow: 0 0 30px var(--water-glow); }
.element-option.earth { box-shadow: 0 0 30px var(--earth-glow); }
.element-option.air { box-shadow: 0 0 30px var(--air-glow); }

/* Element Challenge - Batti l'Elemento */
.element-challenge {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.challenge-element {
    font-size: 10rem;
    padding: 40px;
    border-radius: 50%;
    animation: elementPulse 1s ease-in-out infinite;
}

.challenge-element.fire {
    background: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 60px var(--fire-glow);
}
.challenge-element.water {
    background: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 60px var(--water-glow);
}
.challenge-element.earth {
    background: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 60px var(--earth-glow);
}
.challenge-element.air {
    background: rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 60px var(--air-glow);
}

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

/* Reflex Mini-game */
.reflex-display {
    text-align: center;
}

.reflex-signal {
    font-size: 8rem;
    font-weight: bold;
    padding: 60px 100px;
    border-radius: 24px;
    background: rgba(100, 100, 100, 0.3);
    color: var(--gray);
    transition: all 0.1s;
}

.reflex-signal.go {
    background: linear-gradient(135deg, var(--earth) 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 0 80px var(--earth-glow);
    animation: goFlash 0.3s ease-out;
}

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

/* Memory Flash Mini-game */
.memory-display {
    text-align: center;
}

.memory-instruction {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--light);
    margin-bottom: 30px;
    animation: instructionPulse 0.5s ease-in-out infinite;
}

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

.memory-sequence {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.5s;
}

.memory-sequence.hidden-mode {
    background: rgba(100, 100, 100, 0.2);
}

.memory-icon {
    font-size: 5rem;
    animation: iconAppear 0.3s ease-out;
}

.memory-icon:nth-child(1) { animation-delay: 0s; }
.memory-icon:nth-child(2) { animation-delay: 0.15s; }
.memory-icon:nth-child(3) { animation-delay: 0.3s; }

@keyframes iconAppear {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.memory-hidden {
    font-size: 4rem;
    color: var(--gray);
    letter-spacing: 20px;
}

/* Generic hint */
.hint {
    font-size: 1.2rem;
    color: var(--gray);
    margin-top: 15px;
}

/* Mini-game Players Status */
.minigame-players {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    max-width: 800px;
}

.minigame-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s;
}

.minigame-player.waiting {
    opacity: 0.7;
}

.minigame-player.answered {
    background: rgba(34, 197, 94, 0.3);
    border: 2px solid var(--earth);
}

.minigame-player .avatar {
    font-size: 1.5rem;
}

.minigame-player .name {
    color: var(--light);
    font-size: 1rem;
}

.minigame-player .status {
    font-size: 1.2rem;
}

/* ============ MINI-GAME RESULTS SCREEN ============ */
.minigame-results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-title {
    font-size: 2.5rem;
    color: var(--light);
    margin-bottom: 15px;
}

.correct-answer {
    font-size: 1.3rem;
    color: var(--earth);
    padding: 15px 30px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    display: inline-block;
}

.minigame-rankings {
    width: 100%;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 20px;
}

.ranking-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.3s;
}

.ranking-row:last-child {
    margin-bottom: 0;
}

.ranking-row.first {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3) 0%, rgba(245, 158, 11, 0.2) 100%);
    border: 2px solid #fbbf24;
    animation: firstPlaceGlow 1s ease-in-out infinite;
}

.ranking-row.second {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 2px solid var(--air);
}

.ranking-row.last {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
}

@keyframes firstPlaceGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.3); }
    50% { box-shadow: 0 0 25px rgba(251, 191, 36, 0.5); }
}

.ranking-row .rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--light);
    min-width: 50px;
}

.ranking-row.first .rank {
    color: #fbbf24;
}

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

.ranking-row .nickname {
    font-size: 1.2rem;
    color: var(--light);
}

.ranking-row .bonus {
    font-size: 1rem;
    color: var(--gray);
    text-align: right;
}

.ranking-row.first .bonus {
    color: #fbbf24;
    font-weight: bold;
}

/* Responsive - keep horizontal layout for TV */
@media (max-width: 1200px) {
    .arena-title {
        font-size: 2.5rem;
    }

    .players-circle {
        width: 95vw;
        height: 350px;
    }

    .player-slot {
        width: 80px;
        height: 100px;
    }

    .player-slot .avatar {
        font-size: 2.5rem;
    }

    .player-slot .name {
        font-size: 0.8rem;
    }

    .arena-player .player-avatar {
        font-size: 3rem;
    }

    .arena-player .player-name {
        font-size: 0.9rem;
    }
}

@media (max-width: 800px) {
    .arena-title {
        font-size: 2rem;
    }

    .players-circle {
        height: 300px;
    }

    .player-slot {
        width: 60px;
        height: 80px;
    }

    .player-slot .avatar {
        font-size: 2rem;
    }

    .player-slot .name {
        font-size: 0.7rem;
    }

    .minigame-title {
        font-size: 1.8rem;
    }

    .minigame-timer-container {
        width: 70px;
        height: 70px;
    }

    .minigame-timer {
        font-size: 2rem;
    }

    .color-option {
        width: 60px;
        height: 60px;
    }

    .symbol-option {
        font-size: 2.5rem;
    }

    .risk-display {
        flex-direction: column;
    }

    .battle-header {
        padding: 10px 15px;
    }

    .match-timer {
        font-size: 1.5rem;
    }

    .round-info {
        font-size: 1.2rem;
    }
}

/* ============ TURBO RUNNER RACING ============ */
.race-display {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.race-track {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.8) 0%, rgba(50, 50, 50, 0.8) 100%);
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.race-start, .race-finish {
    font-size: 4rem;
    animation: flagWave 0.5s ease-in-out infinite alternate;
}

@keyframes flagWave {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

.race-lanes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.race-lane {
    position: relative;
    height: 60px;
    background: linear-gradient(90deg,
        rgba(100, 100, 100, 0.3) 0%,
        rgba(150, 150, 150, 0.2) 50%,
        rgba(100, 100, 100, 0.3) 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: visible;
}

.race-lane::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.3) 0px,
        rgba(255, 255, 255, 0.3) 20px,
        transparent 20px,
        transparent 40px
    );
    transform: translateY(-50%);
}

.runner {
    position: absolute;
    left: 0%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: left 0.15s ease-out;
    z-index: 10;
}

.runner-avatar {
    font-size: 2.5rem;
    animation: runnerBounce 0.3s ease-in-out infinite;
}

.runner-name {
    font-size: 0.8rem;
    color: var(--light);
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

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

.runner.finished {
    animation: winnerCelebrate 0.5s ease-out;
}

.runner.finished .runner-avatar {
    animation: winnerSpin 0.5s ease-out;
}

@keyframes winnerCelebrate {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes winnerSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lane-progress {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--gray);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 8px;
}

.race-hint {
    font-size: 1.3rem;
    color: var(--gray);
    margin-top: 15px;
}

/* ============ QUICK OPPOSITES ============ */
.opposites-display {
    text-align: center;
}

.opposites-round {
    font-size: 2rem;
    color: var(--light);
    margin-bottom: 30px;
}

.opposites-direction {
    margin-bottom: 30px;
}

.opposites-direction .direction-arrow {
    font-size: 12rem;
    animation: arrowPulse 0.5s ease-in-out infinite;
}

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

.opposites-hint {
    font-size: 2rem;
    font-weight: bold;
    color: var(--fire);
    animation: hintFlash 0.8s ease-in-out infinite;
}

@keyframes hintFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============ POSITION SHUFFLE ============ */
.shuffle-announcement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
    animation: shuffleAnnounce 0.5s ease-out;
}

.shuffle-icon {
    font-size: 8rem;
    animation: shuffleSpin 1s linear infinite;
}

.shuffle-text {
    font-size: 3rem;
    font-weight: bold;
    color: var(--light);
    text-shadow: 0 0 30px var(--air-glow);
    margin-top: 20px;
}

@keyframes shuffleAnnounce {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes shuffleSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.shuffle-announcement.fade-out {
    animation: shuffleFadeOut 0.5s ease-out forwards;
}

@keyframes shuffleFadeOut {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Player shuffling animation */
.arena-player.shuffling {
    transition: left 0.8s ease-in-out, top 0.8s ease-in-out;
    z-index: 100;
}

.arena-player.shuffling::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, var(--air-glow) 0%, transparent 70%);
    animation: shuffleGlow 0.5s ease-in-out infinite;
    z-index: -1;
}

@keyframes shuffleGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
}
