/* Host/TV specific styles */

body {
    overflow: hidden;
}

.host-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 40px;
}

/* Welcome screen */
#welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

#welcome-screen .logo {
    font-size: 5rem;
}

#welcome-screen .subtitle {
    font-size: 1.5rem;
    color: var(--gray);
    margin-bottom: 40px;
}

#welcome-screen .instructions {
    margin-top: 40px;
    font-size: 1.2rem;
    color: var(--gray);
    line-height: 2;
}

/* Lobby screen */
#lobby-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.lobby-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pin-display {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-bottom: 30px;
}

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

.pin-code {
    font-size: 6rem;
    font-weight: 800;
    letter-spacing: 15px;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.pin-url {
    font-size: 1.3rem;
    color: var(--light);
    margin-top: 15px;
}

.players-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.players-header h2 {
    font-size: 1.8rem;
}

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

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
}

.player-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.player-animal {
    font-size: 1.1rem;
    margin-right: 4px;
}

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

.auto-start-countdown {
    font-size: 1.5rem;
    color: var(--warning);
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.auto-start-countdown #countdown-timer {
    font-weight: 800;
    font-size: 2rem;
}

/* Question screen */
#question-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.question-number {
    font-size: 1.5rem;
    color: var(--gray);
}

.timer-display {
    font-size: 4rem;
    font-weight: 800;
    min-width: 100px;
    text-align: center;
}

.answers-progress {
    font-size: 1.2rem;
    color: var(--gray);
}

/* Main question area */
.question-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.question-text {
    font-size: 3.5rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    max-width: 90%;
}

/* Bottom panels */
.question-bottom {
    display: flex;
    gap: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-panel {
    flex: 1;
}

/* Active Powers */
.active-powers {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 20px;
    height: 100%;
}

.active-powers h3 {
    font-size: 1.2rem;
    color: var(--warning);
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Compact powers display */
.powers-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.power-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(236, 72, 153, 0.3) 100%);
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.power-badge .power-icon {
    font-size: 2rem;
}

.power-badge .power-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--light);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    flex: 1;
}

.option {
    display: flex;
    align-items: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    font-size: 1.6rem;
    transition: all 0.2s;
}

.option-letter {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 12px;
    font-weight: 700;
    margin-right: 20px;
    font-size: 1.8rem;
}

.option.correct {
    background: rgba(34, 197, 94, 0.3);
    border: 3px solid var(--success);
}

.option.correct .option-letter {
    background: var(--success);
}

.option.wrong {
    opacity: 0.5;
}

/* Mini leaderboard */
.mini-leaderboard {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 20px;
    height: 100%;
}

.mini-leaderboard h3 {
    margin-bottom: 15px;
    color: var(--gray);
    font-size: 1.2rem;
    text-transform: uppercase;
}

.mini-leaderboard .player-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-columns {
    display: flex;
    gap: 15px;
}

.leaderboard-col {
    flex: 1;
}

.mini-leaderboard .player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 1rem;
}

.mini-leaderboard .player-rank {
    color: var(--gray);
    font-weight: 600;
    min-width: 24px;
}

.mini-leaderboard .player-animal {
    font-size: 1.2rem;
}

.mini-leaderboard .player-name {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-leaderboard .player-score {
    color: var(--primary);
    font-weight: 700;
}

.leaderboard-more {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Results screen */
#results-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.correct-answer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 30px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    margin: 10px 0;
}

.correct-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.correct-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
}

.results-countdown {
    margin-top: 15px;
    font-size: 1.3rem;
    color: var(--warning);
}

.results-countdown span {
    font-weight: 800;
    font-size: 1.8rem;
}

.results-list {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 15px;
    padding: 10px;
    align-content: start;
}

.result-item {
    display: grid;
    grid-template-columns: 35px 1fr 70px 70px 90px;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 1rem;
    height: fit-content;
}

.result-rank {
    font-weight: 700;
    color: var(--primary);
}

.result-answer {
    text-align: center;
}

.result-answer.correct {
    color: var(--success);
}

.result-answer.wrong {
    color: var(--danger);
}

.result-points {
    text-align: center;
    color: var(--success);
    font-weight: 600;
}

.result-points.zero {
    color: var(--gray);
}

.result-total {
    text-align: right;
    font-weight: 700;
}

.events-list {
    margin-top: 20px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
}

.event-item {
    padding: 10px;
    font-size: 1.1rem;
}

/* Final screen */
#final-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.final-title {
    font-size: 3rem;
    margin-bottom: 50px;
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
}

.podium-place {
    text-align: center;
    padding: 30px;
    border-radius: 16px;
}

.podium-place.first {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: var(--dark);
    transform: scale(1.1);
    order: 2;
    min-height: 200px;
}

.podium-place.second {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: var(--dark);
    order: 1;
    min-height: 160px;
}

.podium-place.third {
    background: linear-gradient(135deg, #cd7f32 0%, #a05c20 100%);
    color: var(--dark);
    order: 3;
    min-height: 130px;
}

.podium-rank {
    font-size: 3rem;
    font-weight: 800;
}

.podium-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 10px 0;
}

.podium-score {
    font-size: 1.2rem;
}

.final-actions {
    display: flex;
    gap: 20px;
}

.final-countdown {
    margin: 30px 0;
    text-align: center;
    font-size: 1.5rem;
    color: var(--gray);
}

.final-countdown span {
    display: inline-block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 80px;
    animation: pulse 1s infinite;
}

/* Reactions overlay */
.reactions-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1000;
}

.reaction {
    position: absolute;
    font-size: 4rem;
    animation: floatUp 3s ease-out forwards;
    text-align: center;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-100px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0.8);
    }
}

/* Challenge Screen */
#challenge-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.challenge-header {
    margin-bottom: 30px;
}

.challenge-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 10px 30px;
    border-radius: 50px;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.challenge-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    font-size: 2.5rem;
    font-weight: 700;
}

.challenger-name {
    color: var(--primary);
}

.vs-text {
    color: var(--danger);
    font-size: 3rem;
    font-weight: 900;
}

.target-name {
    color: var(--secondary);
}

.challenge-stakes {
    margin-top: 15px;
    font-size: 1.2rem;
    color: var(--warning);
}

.challenge-timer-display {
    font-size: 5rem;
    font-weight: 800;
    margin: 30px 0;
}

.challenge-question {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 40px;
    max-width: 800px;
}

.challenge-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 700px;
    width: 100%;
}

.challenge-option {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 1.3rem;
}

.challenge-option .option-letter {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 10px;
    font-weight: 700;
    margin-right: 15px;
}

.challenge-option.correct {
    background: rgba(34, 197, 94, 0.3);
    border: 2px solid var(--success);
}

.remaining-challenges {
    margin-top: 30px;
    color: var(--gray);
    font-size: 1rem;
}

/* Challenge Result Screen */
#challenge-result-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.challenge-result-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    margin: 40px 0;
}

.challenge-player {
    text-align: center;
    padding: 30px 50px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.challenge-player.winner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(22, 163, 74, 0.3) 100%);
    border: 3px solid var(--success);
    transform: scale(1.1);
}

.challenge-player.loser {
    background: rgba(239, 68, 68, 0.2);
    border: 3px solid var(--danger);
    opacity: 0.7;
}

.challenge-player-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.challenge-player-answer {
    font-size: 3rem;
    font-weight: 800;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    border-radius: 15px;
    background: var(--primary);
}

.challenge-player-status {
    font-size: 1.2rem;
    font-weight: 600;
}

.challenge-player-status.correct {
    color: var(--success);
}

.challenge-player-status.wrong {
    color: var(--danger);
}

.challenge-winner-display {
    text-align: center;
}

.winner-icon {
    font-size: 5rem;
    margin-bottom: 10px;
}

.winner-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--warning);
}

.winner-text.draw {
    color: var(--gray);
}

.challenge-consequence {
    font-size: 1.5rem;
    color: var(--light);
    margin-top: 30px;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

/* Powers waiting status */
.powers-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px 30px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    margin-top: 10px;
}

.waiting-label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.waiting-progress {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    animation: pulse 1.5s infinite;
}

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

.results-countdown {
    font-size: 1.5rem;
    color: var(--success);
    margin-top: 10px;
    font-weight: 700;
}

/* Power popup animations */
.power-popup {
    position: absolute;
    bottom: 100px;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(109, 40, 217, 0.95) 100%);
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    z-index: 1000;
    animation: powerPopIn 0.5s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.power-popup-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.power-popup-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.power-popup.fade-out {
    animation: powerPopOut 0.5s ease-in forwards;
}

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

@keyframes powerPopOut {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.8);
    }
}
