/* ============================================ */
/* KAIM TRIVIA - MAIN STYLES                  */
/* ============================================ */

/* Question Intro Animation */
.question-intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 19, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.question-intro-overlay.active {
    opacity: 1;
    transform: scale(1);
}

.question-intro-content {
    text-align: center;
    max-width: 80%;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.question-intro-category {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-intro-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.question-intro-image {
    margin: 1.5rem 0;
}

.question-intro-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.question-intro-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.question-intro-hint {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.question-intro-countdown {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    min-width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}

.question-intro-countdown.pulse {
    animation: countdownPulse 0.8s ease-out;
}

.question-intro-countdown.go-pulse {
    animation: goPulse 0.5s ease-out;
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .question-intro-content {
        max-width: 95%;
        padding: 1.5rem;
    }
    
    .question-intro-text {
        font-size: 1.4rem;
    }
    
    .question-intro-footer {
        flex-direction: column;
        gap: 1rem;
    }
}

/* CSS Custom Properties */
:root {
    --primary-color: #3b82f6;
    --primary-rgb: 59, 130, 246;
    --primary-hover: #2563eb;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --font-family: Inter, sans-serif;
    --font-size: 16px;
    
    /* Dark theme colors - #121213 base */
    --bg-primary: #121213;
    --bg-secondary: #1a1b1c;
    --bg-tertiary: #242527;
    --text-primary: #ffffff;
    --text-secondary: #b8b9ba;
    --text-muted: #6b6c6d;
    --border-color: #2d2e2f;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    /* Borders */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
}

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Animations */
.no-animations * {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-error {
    background: var(--error-color);
    color: white;
}

.btn-toggle {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    position: relative;
}

.btn-toggle:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.btn-toggle.active {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.btn-toggle.active:hover:not(:disabled) {
    background: #059669;
}

/* Game Header */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.game-header .game-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 1;
}

.game-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
}

.game-subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.game-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error-color);
    animation: pulse 2s infinite;
}

.connection-dot.connected {
    background: var(--success-color);
    animation: none;
}

.connection-dot.partial {
    background: var(--warning-color);
}

.connection-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.host-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    z-index: 2;
}

/* Phase Indicator */
.phase-indicator {
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.phase-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    min-width: 120px;
    position: relative;
    opacity: 0.5;
    transition: all var(--transition-normal);
}

.phase-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2px;
    background: var(--border-color);
}

.phase-step.active {
    opacity: 1;
    background: var(--bg-tertiary);
}

.phase-step.completed {
    opacity: 1;
    color: var(--success-color);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.phase-step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.phase-step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Podium Area */
.podium-area {
    height: 0; /* Start hidden */
    overflow: hidden;
    transition: height 0.5s ease-out;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), rgba(var(--primary-rgb), 0.1));
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.2);
    position: relative;
}

.podium-area.active {
    height: 250px; /* Show podium when active */
}

/* Game Container */
.game-container {
    flex: 1;
    padding: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.game-content {
    position: relative;
    min-height: 500px;
}

.game-phase {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.game-phase.active {
    display: block;
}

/* Waiting State */
.waiting-state {
    text-align: center;
    padding: var(--spacing-2xl);
}

.waiting-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

.waiting-state h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.waiting-state p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.platform-status {
    margin: var(--spacing-xl) 0;
}

.platform-status h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.platform-list {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.platform-item.connected {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.platform-item.disconnected {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.platform-item.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.platform-item.clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.platform-item .status-icon {
    font-size: 1.1rem;
}

.platform-icon {
    width: 16px;
    height: 16px;
}

/* Start Game Section */
.start-game-section {
    text-align: center;
    margin: var(--spacing-xl) 0;
}

.btn-large {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 200px;
}

.btn-large svg {
    width: 20px;
    height: 20px;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    transform: translateY(-1px);
}


/* Category Voting */
.voting-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.voting-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

.timer-bar {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin: 0 auto var(--spacing-md);
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.1s linear;
    width: 100%;
}

.timer-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xl);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden; /* Ensure progress background doesn't overflow */
}

/* Progress bar background that fills the card from bottom */
.category-progress-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

/* Content layer above the progress background */
.category-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Gradient classes for different ranks - vertical gradients for bottom-up fill */
.gradient-first {
    background: linear-gradient(0deg, #ff0088 0%, #ffcc00 100%);
}

.gradient-second {
    background: linear-gradient(0deg, #0066ff 0%, #00c0ff 100%);
}

.gradient-third {
    background: linear-gradient(0deg, #10b981 0%, #34d399 100%);
}

.gradient-fourth {
    background: linear-gradient(0deg, #8b5cf6 0%, #a78bfa 100%);
}

.gradient-default {
    background: linear-gradient(0deg, #6b7280 0%, #9ca3af 100%);
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.category-card.voted {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.category-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
}

.category-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-md);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.category-option {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.vote-count {
    margin-top: var(--spacing-md);
    background: rgba(18, 18, 19, 0.85);
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    text-align: center;
    display: inline-block;
}

.voting-info {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.voting-info p {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: var(--spacing-lg);
    line-height: 1.4;
    color: var(--text-primary);
}

.vote-counter {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Question Display */
.question-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.question-category {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    border-radius: var(--border-radius-lg);
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: categoryPulse 2s ease-in-out infinite;
}

@keyframes categoryPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.4);
    }
}

.category-icon-img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: cover;
}

.question-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    line-height: 1.4;
}

.question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--spacing-lg);
    max-width: 800px;
    margin: 0 auto;
}

.question-option {
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    transition: all var(--transition-fast);
    cursor: pointer;
    min-height: 90px;
    display: flex;
    align-items: center;
    text-align: left;
}

.question-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.question-option .option-letter {
    font-weight: 800;
    color: var(--primary-color);
    margin-right: var(--spacing-md);
    font-size: 1.3rem;
    background: var(--bg-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    min-width: 30px;
    text-align: center;
    flex-shrink: 0;
}

/* Responsive design for multiple choice options */
@media (max-width: 768px) {
    .question-options {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        max-width: 100%;
        gap: var(--spacing-md);
    }
    
    .question-option {
        min-height: 70px;
        padding: var(--spacing-md);
        font-size: 1.1rem;
        font-weight: 500;
    }
    
    .question-option .option-letter {
        font-size: 1.1rem;
        min-width: 25px;
        margin-right: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .question-options {
        gap: var(--spacing-sm);
    }
    
    .question-option {
        min-height: 60px;
        padding: var(--spacing-sm);
        font-size: 1rem;
        font-weight: 500;
    }
    
    .question-option .option-letter {
        font-size: 1rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* Ultra-wide screens - keep options reasonable size */
@media (min-width: 1400px) {
    .question-options {
        max-width: 1000px;
    }
    
    .question-option {
        min-height: 110px;
        font-size: 1.35rem;
        font-weight: 500;
    }
}

.question-image {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.question-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

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

.answer-counter {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.answer-hint {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

/* Results Display */
.results-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

.correct-answer {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--success-color);
    color: white;
    border-radius: var(--border-radius);
    font-size: 1.125rem;
    font-weight: 600;
}

.answer-explanation {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.explanation-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.explanation-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

.results-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.leaderboard-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.leaderboard {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 32px 40px 40px 1fr auto auto;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item:hover {
    background: var(--bg-tertiary);
}

.leaderboard-item.winner {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
}

.leaderboard-platform {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.platform-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.leaderboard-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.875rem;
}

.leaderboard-rank.first {
    background: #ffd700;
    color: #000;
}

.leaderboard-rank.second {
    background: #c0c0c0;
    color: #000;
}

.leaderboard-rank.third {
    background: #cd7f32;
    color: #fff;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

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

.score-points {
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
    min-width: 60px;
}

.score-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: right;
    min-width: 50px;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

/* Winner Celebration Overlay */
.winner-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.winner-celebration.show {
    opacity: 1;
    visibility: visible;
}

.winner-content {
    text-align: center;
    position: relative;
    transform: translateY(-100vh);
    animation: slideDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideDown {
    0% {
        transform: translateY(-100vh);
    }
    70% {
        transform: translateY(20px);
    }
    100% {
        transform: translateY(0);
    }
}

.winner-avatar-container {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.winner-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    overflow: hidden;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.6);
    animation: avatarGlow 2s ease-in-out infinite;
}

@keyframes avatarGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.6);
    }
    50% {
        box-shadow: 0 0 50px rgba(var(--primary-rgb), 0.9);
    }
}

.winner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.winner-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 700;
    font-size: 3rem;
}

.winner-platform-icon {
    position: absolute;
    bottom: 10px;
    right: calc(50% - 70px);
    width: 32px;
    height: 32px;
    background: var(--bg-primary);
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-platform-icon .platform-icon {
    width: 20px;
    height: 20px;
}

.winner-text {
    margin-bottom: var(--spacing-xl);
}

.winner-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: nameGlow 1.5s ease-in-out infinite;
}

@keyframes nameGlow {
    0%, 100% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    50% {
        text-shadow: 0 2px 20px rgba(var(--primary-rgb), 0.8);
    }
}

.winner-label {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: labelPulse 1s ease-in-out infinite;
}

.winner-correct-answer {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(var(--success-rgb), 0.2);
    border: 1px solid var(--success-color);
    border-radius: var(--border-radius);
    text-align: center;
}

.correct-answer-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-xs);
}

.correct-answer-text {
    font-size: 1rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

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

/* Confetti Animation */
.winner-confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    animation: confettiFall 3s linear infinite;
}

.confetti:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    background: #ff6b6b;
}

.confetti:nth-child(2) {
    left: 30%;
    animation-delay: 0.5s;
    background: #4ecdc4;
}

.confetti:nth-child(3) {
    left: 50%;
    animation-delay: 1s;
    background: #45b7d1;
}

.confetti:nth-child(4) {
    left: 70%;
    animation-delay: 1.5s;
    background: #f9ca24;
}

.confetti:nth-child(5) {
    left: 90%;
    animation-delay: 2s;
    background: #6c5ce7;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .winner-avatar {
        width: 80px;
        height: 80px;
    }
    
    .winner-avatar .avatar-placeholder {
        font-size: 2rem;
    }
    
    .winner-name {
        font-size: 1.8rem;
    }
    
    .winner-label {
        font-size: 1.2rem;
    }
}

/* Participants Counter */
.participants-counter {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(var(--bg-secondary-rgb), 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    z-index: 100;
}

.counter-icon {
    font-size: 1.25rem;
}

.counter-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Compact Mode */
.compact-mode {
    --spacing-xs: 0.125rem;
    --spacing-sm: 0.25rem;
    --spacing-md: 0.5rem;
    --spacing-lg: 0.75rem;
    --spacing-xl: 1rem;
    --spacing-2xl: 1.5rem;
    --font-size: 14px;
}

.compact-mode .game-header {
    padding: var(--spacing-md) var(--spacing-lg);
}

.compact-mode .game-title h1 {
    font-size: 1.25rem;
}

.compact-mode .voting-header h2,
.compact-mode .results-header h2 {
    font-size: 1.5rem;
}

.compact-mode .question-text {
    font-size: 1.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .host-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .phase-indicator {
        overflow-x: auto;
        justify-content: flex-start;
        padding: var(--spacing-md);
    }
    
    .phase-step {
        min-width: 100px;
        flex-shrink: 0;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .results-content {
        grid-template-columns: 1fr;
    }
    
    .participants-counter {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .podium-area.active {
        height: 200px; /* Smaller on mobile */
    }
    
    .game-container {
        padding: var(--spacing-md);
    }
    
    .waiting-state {
        padding: var(--spacing-lg);
    }
    
    .waiting-icon {
        font-size: 3rem;
    }
    
    .waiting-state h2 {
        font-size: 1.5rem;
    }
    
}
