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

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fallback-background {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Main Layout */
.main-content {
    display: flex;
    height: 100vh;
}

/* Game Screen (75%) */
.game-screen {
    flex: 3;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    /* backdrop-filter: blur(10px); */
}

.game-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    color: white;
}

.game-title {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Noto Sans', sans-serif;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.game-status {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    visibility: hidden;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ecdc4;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-weight: 500;
    font-size: 0.9rem;
    font-family: 'Noto Sans', sans-serif;
}

/* Players Section */
.players-section {
    margin-bottom: 2rem;
}

.players-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
    font-family: 'Noto Sans', sans-serif;
}

.players-list {
    /* display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem; */
    display: flex;
    flex-wrap: nowrap;
    /* Tek satır */
    gap: 1rem;
    overflow-x: auto !important;
    max-width: 70vw;
}

.player-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    /* padding: 1rem; */
    padding: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex: 0 0 auto;
    /* flex-direction: column; */
    flex-direction: row;
    gap: 0.6rem;
    /* min-height: 90px; */
    height: 100px;
    max-width: 180px;
    min-width: 180px;
    align-items: center;
    /* width: 100%; */
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.player-card.main-controller {
    border-left: 4px solid blue !important;

    background: rgba(255, 215, 0, 0.1);
    /* box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2); */
}

.player-avatar-section {
    height: 51px;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.3s ease;
}

.player-username-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.player-username-label {
    font-size: 0.6rem;
    font-weight: 500;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    font-family: 'Noto Sans', sans-serif;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    font-family: 'Noto Sans', sans-serif;
    word-break: break-word;
}

.player-status-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.player-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ecdc4;
    animation: breathe 2s ease-in-out infinite;
}

.player-status-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-family: 'Noto Sans', sans-serif;
}

@keyframes breathe {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.4);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.1);
    }
}

/* Game Area */
.game-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.waiting-message {
    text-align: center;
    color: white;
    font-family: 'Noto Sans', sans-serif;
}

.waiting-message h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    font-family: 'Noto Sans', sans-serif;
}

.waiting-message p {
    font-size: 1.2rem;
    opacity: 0.7;
    font-family: 'Noto Sans', sans-serif;
}

/* Controller Panel (25%) */
.controller-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.panel-content {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Logo stays at top */
.logo-container {
    align-self: center;
    margin-bottom: 1.5rem;
}

/* Centered content wrapper */
.centered-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

/* Override for specific elements that need their own layout */
.controller-panel h2,
.qr-container,
.connection-info {
    flex: none;
    margin-bottom: 1.5rem;
}

/* Logo */
.logo-container {
    margin-bottom: 1.5rem;
}

.panel-logo {
    max-width: 120px;
    height: auto;
    filter: brightness(1.1);
}

.controller-panel h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
    font-family: 'Noto Sans', sans-serif;
}

/* QR Code Container */
.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    /* width: 100%; */
    max-width: 300px;
    aspect-ratio: 1;
}

#qrcode {
    border-radius: 10px;
    background: white;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode canvas,
#qrcode img {
    max-width: 100%;
    height: auto;
}

/* Connection Info */
.connection-info {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

.connection-info-item {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.info-label {
    color: #4ecdc4;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: 'Noto Sans', sans-serif;
}

.copyable-url {
    background: rgba(78, 205, 196, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(78, 205, 196, 0.3);
    font-family: 'Noto Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.2px;
    display: block;
    word-break: break-all;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #4ecdc4;
    text-align: center;
}

.copyable-url:hover {
    background: rgba(78, 205, 196, 0.2);
    border-color: rgba(78, 205, 196, 0.5);
    transform: scale(1.02);
    white-space: normal;
    max-width: 300px;
    overflow: visible;
    text-overflow: unset;
}

.match-info {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.match-id {
    color: #00b103;
    font-weight: 500;
    font-family: 'Noto Sans', sans-serif;
}

.copyable-match-id {
    background: rgba(0, 177, 3, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 177, 3, 0.3);
    font-family: 'Noto Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    display: block;
    margin-top: 0.5rem;
    color: #00b103;
    text-align: center;
}

.copyable-match-id:hover {
    background: rgba(0, 177, 3, 0.3);
    border-color: rgba(0, 177, 3, 0.5);
    transform: scale(1.05);
}

/* No Players Message */
.no-players {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-size: 1rem;
    font-family: 'Noto Sans', sans-serif;
}

/* Game Status - positioned at bottom */
.controller-panel .game-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin-bottom: 2rem;
    margin-left: 2rem;
    margin-right: 2rem;
    justify-content: center;
}

/* Game Controls */
.game-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Player Count Display */
.player-count-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 15px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-count-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.player-count-item.total {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 8px;
    margin-top: 4px;
}

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

.count-value {
    color: #4ecdc4;
    font-weight: 600;
    font-size: 1rem;
    min-width: 24px;
    text-align: center;
    background: rgba(78, 205, 196, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.player-count-item.total .count-value {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

#playerCount {
    color: #4ecdc4;
    font-weight: 600;
}

/* Error message styles */
.error-message,
.no-players {
    text-align: center;
    color: #ff6b6b;
    padding: 2rem;
}

.error-message h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.error-message p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.no-players {
    opacity: 0.6;
    font-style: italic;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.player-card.main-controller {
    /* border: 2px solid #ffd700; */
    border-left: 4px solid blue !important;

    background: rgba(255, 215, 0, 0.1);
    /* box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2); */
}

.player-card.active-controller {
    border-left: 4px solid #4ecdc4;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    background: rgba(78, 205, 196, 0.08);
}

.player-card.waiting-player {
    border-left: 4px solid #ff9800;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    background: rgba(255, 152, 0, 0.08);
    opacity: 0.9;
}

.player-status-indicator.active {
    background: #4ecdc4;
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.4);
}

.player-status-indicator.waiting {
    background: #ff9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
    animation: waitingPulse 2s infinite;
}

@keyframes waitingPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Question Display Styles */
.question-display {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    color: white;
    /* background-color: rgba(0, 0, 0, 0.2) !important; */
    background-color: transparent !important;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.question-counter {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.timer-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timer-bar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#4caf50 360deg, rgba(255, 255, 255, 0.1) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s linear;
}

.timer-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    min-width: 3rem;
    text-align: center;
    transition: color 0.3s ease;
}

.question-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 2rem;
}

.question-text {
    color: #fff;
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.4;
    max-width: 80%;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.answers-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.answer-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    /* Required for absolutely positioned player initials */
}

.answer-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.answer-letter {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.answer-text {
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.3;
}

.answer-option.correct {
    background: rgba(76, 175, 80, 0.3);
    background-color: #4caf50 !important;
    border-color: #4caf50;
    color: white;

}

.answer-option.blur {
    background: rgba(76, 175, 80, 0.3);
    background-color: grey !important;
    border-color: grey;
    color: white;

}

.answer-option.incorrect {
    background: rgba(244, 67, 54, 0.3);
    background-color: #f44336 !important;
    border-color: #f44336;
    color: white;

}

.answer-option.player-selected {
    background: rgba(33, 150, 243, 0.3);
    border-color: #2196f3;
}

.correct-answer-indicator {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #4caf50;
    background: rgba(76, 175, 80, 0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #4caf50;
}

/* Timer color transitions */
.timer-green {
    --timer-color: #4caf50;
}

.timer-blue {
    --timer-color: #2196f3;
}

.timer-yellow {
    --timer-color: #ffc107;
}

.timer-orange {
    --timer-color: #ff9800;
}

.timer-red {
    --timer-color: #f44336;
}

/* Game Over Styles */
.game-over {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: white;
}

.game-over.enhanced {
    padding: 1rem;
    overflow-y: auto;
    height: 100vh;
    max-height: 100vh;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow: hidden;
}

.game-complete-header {
    margin-bottom: 1.5rem;
    animation: fadeInDown 1s ease-out;
}

.celebration-emoji {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

.game-complete-title {
    font-size: 2.5rem;
    margin-bottom: 0.3rem;
    background: linear-gradient(45deg, #4ecdc4, #44a08d, #ffd700);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
}

.game-complete-subtitle {
    font-size: 1rem;
    margin-bottom: 0;
    opacity: 0.8;
    color: #ffffff;
}

.game-over h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #4ecdc4;
}

.game-over p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

/* Pause Overlay for Screen */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.pause-overlay .pause-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 90%;
}

.pause-overlay .pause-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.pause-overlay .pause-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.pause-overlay .loading-spinner {
    margin: 1.5rem 0;
}

.pause-overlay .loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4ecdc4;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .game-screen {
        flex: 2;
    }

    .controller-panel {
        flex: 1;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .game-title {
        font-size: 2rem;
    }

    .panel-content {
        padding: 1rem;
    }

    .qr-container {
        padding: 0.5rem;
    }
}

@media (max-width: 768px) {
    .game-screen {
        padding: 1rem;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .waiting-message h3 {
        font-size: 1.5rem;
    }

    .waiting-message p {
        font-size: 1rem;
    }

    .question-text {
        font-size: 1.5rem;
    }

    .answers-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .answer-option {
        padding: 0.8rem 1rem;
    }

    .answer-text {
        font-size: 1rem;
    }

    .question-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .timer-text {
        font-size: 1.2rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4ecdc4;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced Leaderboard Styles */
.leaderboard-section {
    margin: 1rem 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.8s ease-out;
    max-height: 70vh;
    overflow-y: auto;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.trophy-animation {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    animation: trophyBounce 2s ease-in-out infinite;
}

.leaderboard-title {
    font-size: 1.8rem;
    background: linear-gradient(45deg, #ffd700, #ffed4a, #f39c12);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
    margin-bottom: 0.5rem;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.confetti {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #ffd93d);
    animation: confettiFall 3s infinite;
}

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

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

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

.confetti-piece:nth-child(4) {
    left: 20px;
    animation-delay: 1.5s;
    background: #ffd93d;
}

.confetti-piece:nth-child(5) {
    left: 40px;
    animation-delay: 2s;
    background: #ff8e53;
}

/* Podium Styles */
.podium-container {
    display: flex;
    justify-content: center;
    /* align-items: flex-start; */
    /* Changed from flex-end to flex-start for top alignment */
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 0;
    transform: translateY(50px);
}

.player-avatar {
    position: relative;
    margin-bottom: 0.8rem;
}

.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.podium-1 .avatar-circle {
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.podium-2 .avatar-circle {
    background: linear-gradient(45deg, #c0c0c0, #e8e8e8);
    border-color: #c0c0c0;
}

.podium-3 .avatar-circle {
    background: linear-gradient(45deg, #cd7f32, #d4af37);
    border-color: #cd7f32;
}

.avatar-initial {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.medal-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.5rem;
    animation: medalSpin 3s infinite;
}

.winner-crown {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.3rem;
    animation: crownFloat 2s ease-in-out infinite;
}

.player-details {
    text-align: center;
    margin-bottom: 0.8rem;
    min-width: 100px;
}

.podium-place .player-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.player-score {
    font-size: 1.3rem;
    font-weight: bold;
    color: #4ecdc4;
    margin-bottom: 0.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.podium-1 .player-score {
    color: #ffd700;
    font-size: 1.5rem;
}

.player-accuracy {
    font-size: 0.7rem;
    color: #48CAE4;
    margin-bottom: 0.1rem;
}

.correct-answers {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.7);
}

.podium-base {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px 8px 0 0;
    width: 80px;
    position: relative;
    display: flex;
    align-items: flex-start;

    justify-content: center;
    padding-top: 0.8rem;
    /* Set different heights for podium visual effect but avatars stay aligned */
    margin-top: auto;
    /* This pushes podium bases to bottom while keeping avatars at top */
}

.podium-1 .podium-base {
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    height: 100px;
    /* Highest podium for winner */
}

.podium-2 .podium-base {
    background: linear-gradient(to bottom, rgba(192, 192, 192, 0.3), rgba(192, 192, 192, 0.1));
    border-color: rgba(192, 192, 192, 0.5);
    height: 80px;
    /* Medium height for second place */
}

.podium-3 .podium-base {
    background: linear-gradient(to bottom, rgba(205, 127, 50, 0.3), rgba(205, 127, 50, 0.1));
    border-color: rgba(205, 127, 50, 0.5);
    height: 60px;
    /* Shortest podium for third place */
}

.podium-rank {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Rest of Leaderboard */
.rest-of-leaderboard {
    margin-top: 1.5rem;
}

.other-players-title {
    text-align: center;
    color: #4ecdc4;
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.2);
    border-color: rgba(78, 205, 196, 0.3);
}

.player-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.avatar-initial-small {
    font-size: 1rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.rank-badge {
    font-size: 1rem;
    font-weight: bold;
    min-width: 35px;
    text-align: center;
    color: #4ecdc4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.player-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.player-stats {
    display: flex;
    gap: 0.8rem;
    font-size: 0.75rem;
    opacity: 0.8;
    flex-wrap: wrap;
}

.score {
    color: #4ecdc4;
    font-weight: bold;
}

.accuracy {
    color: #48CAE4;
}

.correct-count {
    color: #48CAE4;
}

/* Game Stats Footer */
.game-stats-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 80px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4ecdc4;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thank-you-message {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.thank-you-message p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #4ecdc4;
}

.sparkles {
    font-size: 1.2rem;
    animation: sparkleRotate 3s infinite;
}

.no-scores-message {
    text-align: center;
    padding: 2rem;
}

.participation-badge {
    font-size: 3rem;
    margin: 0.5rem 0;
    animation: bounce 2s infinite;
}

/* Animations */
@keyframes podiumRise {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translateY(0);
    }

    40%,
    43% {
        transform: translateY(-15px);
    }

    70% {
        transform: translateY(-7px);
    }

    90% {
        transform: translateY(-3px);
    }
}

@keyframes trophyBounce {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(-5deg);
    }

    50% {
        transform: translateY(-5px) rotate(0deg);
    }

    75% {
        transform: translateY(-10px) rotate(5deg);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes medalSpin {

    0%,
    90%,
    100% {
        transform: rotateY(0deg);
    }

    20%,
    60% {
        transform: rotateY(180deg);
    }
}

@keyframes crownFloat {

    0%,
    100% {
        transform: translateX(-50%) translateY(0px);
    }

    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@keyframes sparkleRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.play-again-section {
    margin-top: 1.5rem;
    text-align: center;
}

.play-again-section .btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.play-again-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

/* Responsive adjustments for enhanced leaderboard */
@media (max-width: 1024px) {
    .podium-container {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }

    .avatar-circle {
        width: 55px;
        height: 55px;
    }

    .avatar-initial {
        font-size: 1.3rem;
    }

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

    .podium-1 .player-score {
        font-size: 1.4rem;
    }

    .podium-base {
        width: 75px;
    }

    .podium-1 .podium-base {
        height: 90px;
    }

    .podium-2 .podium-base {
        height: 70px;
    }

    .podium-3 .podium-base {
        height: 50px;
    }

    .stats-container {
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .leaderboard-section {
        max-height: 75vh;
    }
}

@media (max-width: 768px) {
    .game-over.enhanced {
        padding: 0.5rem;
        height: 100vh;
    }

    .game-complete-title {
        font-size: 2rem;
    }

    .celebration-emoji {
        font-size: 2rem;
    }

    .trophy-animation {
        font-size: 2rem;
    }

    .leaderboard-title {
        font-size: 1.5rem;
    }

    .leaderboard-section {
        max-height: 80vh;
        padding: 1rem;
        margin: 0.5rem 0;
    }

    .podium-container {
        gap: 0.3rem;
        margin-bottom: 1rem;
    }

    .avatar-circle {
        width: 45px;
        height: 45px;
    }

    .avatar-initial {
        font-size: 1.1rem;
    }

    .medal-badge {
        font-size: 1.2rem;
        top: -6px;
        right: -6px;
    }

    .winner-crown {
        font-size: 1rem;
        top: -15px;
    }

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

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

    .podium-1 .player-score {
        font-size: 1.3rem;
    }

    .player-accuracy {
        font-size: 0.6rem;
    }

    .correct-answers {
        font-size: 0.55rem;
    }

    .podium-base {
        width: 60px;
        padding-top: 0.6rem;
    }

    .podium-1 .podium-base {
        height: 70px;
    }

    .podium-2 .podium-base {
        height: 55px;
    }

    .podium-3 .podium-base {
        height: 40px;
    }

    .podium-rank {
        font-size: 0.9rem;
    }

    .leaderboard-item {
        padding: 0.6rem;
        gap: 0.6rem;
    }

    .rank-badge {
        font-size: 0.9rem;
        min-width: 30px;
    }

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

    .player-stats {
        font-size: 0.7rem;
        gap: 0.6rem;
    }

    .player-avatar-small {
        width: 35px;
        height: 35px;
    }

    .avatar-initial-small {
        font-size: 0.9rem;
    }

    .stats-container {
        gap: 0.8rem;
    }

    .stat-item {
        padding: 0.8rem;
        min-width: 70px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .thank-you-message {
        padding: 0.8rem;
    }

    .thank-you-message p {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .sparkles {
        font-size: 1rem;
    }

    .other-players-title {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }

    .leaderboard-list {
        max-height: 150px;
        gap: 0.4rem;
    }
}

@media (max-width: 480px) {
    .leaderboard-section {
        padding: 0.8rem;
        margin: 0.3rem 0;
        max-height: 85vh;
    }

    .game-complete-title {
        font-size: 1.8rem;
    }

    .leaderboard-title {
        font-size: 1.3rem;
    }

    .podium-container {
        gap: 0.2rem;
    }

    .avatar-circle {
        width: 40px;
        height: 40px;
    }

    .avatar-initial {
        font-size: 1rem;
    }

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

    .player-score {
        font-size: 1rem;
    }

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

    .player-accuracy,
    .correct-answers {
        font-size: 0.5rem;
    }

    .podium-base {
        width: 50px;
    }

    .podium-1 .podium-base {
        height: 60px;
    }

    .podium-2 .podium-base {
        height: 45px;
    }

    .podium-3 .podium-base {
        height: 30px;
    }

    .podium-rank {
        font-size: 0.8rem;
    }

    .medal-badge {
        font-size: 1rem;
        top: -5px;
        right: -5px;
    }

    .winner-crown {
        font-size: 0.9rem;
        top: -12px;
    }

    .confetti-piece {
        width: 4px;
        height: 4px;
    }

    .stats-container {
        margin-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.6rem;
        min-width: 60px;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .game-stats-footer {
        margin-top: 1rem;
    }

    .leaderboard-list {
        max-height: 120px;
    }

    .leaderboard-item {
        padding: 0.5rem;
    }

    .player-avatar-small {
        width: 30px;
        height: 30px;
    }

    .avatar-initial-small {
        font-size: 0.8rem;
    }
}

/* Status Indicator Corner */
.status-indicator-corner {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.status-indicator-corner:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.status-indicator-corner .status-dot {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #54a0ff;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(84, 160, 255, 0.5);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(84, 160, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(84, 160, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(84, 160, 255, 0);
    }
}

/* Mobile responsiveness for status indicator */
@media (max-width: 768px) {
    .status-indicator-corner {
        top: 15px;
        right: 15px;
        padding: 10px;
    }

    .status-indicator-corner .status-dot {
        width: 14px;
        height: 14px;
    }
}

/* Reconnection Screen Styles */
.reconnection-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Noto Sans', sans-serif;
    padding: 1rem;
}

.reconnection-container {
    background: rgb(26, 26, 26);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    /* box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3); */
    animation: slideInScale 0.5s ease-out;
    margin: auto;
}

.reconnection-container h2 {
    color: #D29111;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.disconnected-player {
    background: rgb(31, 31, 31);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid #D29111;
}

.disconnected-player h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.disconnected-player p {
    color: #666;
    font-size: 1rem;
    opacity: 0.8;
}

.countdown-display {
    margin-bottom: 2rem;
}

.countdown-circle {
    width: 120px;
    height: 120px;
    border: 8px solid #4caf50;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1rem;
    position: relative;
    animation: pulse 2s infinite;
}

.countdown-circle.warning {
    border-color: #ff9800;
}

.countdown-circle.urgent {
    border-color: #f44336;
    animation: urgentPulse 1s infinite;
}

.countdown-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4caf50;
}

.countdown-circle.warning .countdown-number {
    color: #ff9800;
}

.countdown-circle.urgent .countdown-number {
    color: #f44336;
}

.countdown-display p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

.reconnection-info {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.8;
}

.reconnection-info p {
    margin: 0.5rem 0;
}

/* Reconnection success overlay */
.reconnection-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    text-align: center;
    z-index: 2001;
    box-shadow: 0 20px 40px rgba(76, 175, 80, 0.4);
    animation: successPopIn 0.5s ease-out;
}

.success-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.success-content p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* Transition screen */
.transition-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Noto Sans', sans-serif;
}

.transition-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.transition-content h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Animations */
@keyframes slideInScale {
    0% {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes successPopIn {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }

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

@keyframes urgentPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    80% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile responsiveness for reconnection screens */
@media (max-width: 768px) {
    .reconnection-screen {
        padding: 1rem;
    }

    .reconnection-container {
        padding: 2rem 1.5rem;
        max-width: 95%;
        width: 95%;
        margin: auto;
    }

    .reconnection-container h2 {
        font-size: 1.8rem;
    }

    .disconnected-player h3 {
        font-size: 1.3rem;
    }

    .countdown-circle {
        width: 100px;
        height: 100px;
        border-width: 6px;
    }

    .countdown-number {
        font-size: 2rem;
    }

    .reconnection-success {
        padding: 1.5rem 2rem;
        max-width: 90%;
    }
}

/* Extra small mobile screens */
@media (max-width: 480px) {
    .reconnection-screen {
        padding: 0.5rem;
    }

    .reconnection-container {
        padding: 1.5rem 1rem;
        max-width: 98%;
        width: 98%;
    }

    .reconnection-container h2 {
        font-size: 1.5rem;
    }

    .disconnected-player {
        padding: 1rem;
    }

    .countdown-circle {
        width: 80px;
        height: 80px;
        border-width: 4px;
    }

    .countdown-number {
        font-size: 1.8rem;
    }
}

/* Additional mobile styles for other components */
@media (max-width: 480px) {
    .success-content h3 {
        font-size: 1.3rem;
    }

    .transition-content h3 {
        font-size: 1.5rem;
    }
}

/* Advertisement Overlay Styles */
.advertisement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    /* Black background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in;
}

.advertisement-overlay .ad-image {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    object-position: center;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hide broken images and show fallback */
.advertisement-overlay .ad-image[src=""] {
    display: none;
}

.advertisement-overlay .ad-image:not([src]) {
    display: none;
}

.advertisement-overlay .ad-countdown {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #4ecdc4;
    animation: pulse 1s ease-in-out infinite;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(78, 205, 196, 0);
    }
}




:root {
    --circle-size: 50px;
    --circle-border: 4px;
    --animation-time: 10s;
}

.circle {
    position: relative;
    width: var(--circle-size);
    height: var(--circle-size);
}

.circle-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: solid var(--circle-border) #494949;


    top: 0;
    left: 0;
    z-index: 0;

}

.circle-half {
    width: 50%;
    height: 100%;
    right: 0px;
    position: absolute;
    overflow: hidden;
    transform-origin: left center;
    /* animation: circle-clip-rotate var(--animation-time) steps(2) infinite; */
}

.circle-half-opposite {
    width: 50%;
    height: 100%;
    left: 0px;
    position: absolute;
    overflow: hidden;
    transform-origin: center;
    z-index: 1;
}

.circle-border {
    box-sizing: border-box;
    height: 100%;

    position: absolute;
    border: solid var(--circle-border) transparent;

    border-top-color: white;
    border-left-color: white;
    border-radius: 50%;
}

#clipped {
    width: 200%;
    right: 0px;

    /* animation: circle-rotate var(--animation-time) / 2 linear infinite; */
}

#fixed {
    width: 200%;
    left: 0px !important;

    /* transform: rotate(135deg); */
    /* animation: circle-show-fixed var(--animation-time) steps(2) infinite; */
}

@keyframes circle-clip-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes circle-rotate {
    0% {
        transform: rotate(-45deg);
    }

    100% {
        transform: rotate(135deg);
    }
}

@keyframes circle-show-fixed {
    0% {
        opacity: 0;
    }

    49.9% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}


:root {
    --leaderboard-bg: #ffffff10;
    --podium-border: #ffffff33;


    --podium-size: 250px;
    --podium-other-place-size: 250px;


    --podium-avatar-size: 85px;

    --podium-ring-increase-size: 20px;
    --podium-ring-offsetY: 28px;

    --competitor-avatar-size: 40px;
    --competitor-wrapper-padding: 5px;
    --competitor-height: 50px;
    --competitor-width: 600px;

    --podium-font-size: 1.2rem;
    --competitor-font-size: 1.2rem;
    --competitor-rank-font-size: 1.5rem;

    --first-place-scale: 1.2;

    --solo-podium-scale: 1.2;

    --first-place-background: url("../assets/1.gold.svg");
    --second-place-background: url("../assets/2.silver.svg");
    --third-place-background: url("../assets/3.bronze.svg");

}

.leaderboard-screen {

    height: 100%;
    width: 100%;
    border: inherit;
    background-color: var(--leaderboard-bg);
    border-radius: inherit;

}


.podium {
    width: 100%;
    height: var(--podium-size);
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 50px !important;
}

.podium-card {

    z-index: 9999 !important;
    display: flex;
    flex-direction: column;
    align-items: center;


}

.first-place {
    margin-top: 0;
    transform: scale(var(--first-place-scale));

}


.second-place {
    margin-top: auto;
}

.third-place {
    margin-top: auto;
}

.player-icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start !important;
    width: calc(var(--podium-avatar-size) + var(--podium-ring-increase-size));
    height: calc(var(--podium-avatar-size) + var(--podium-ring-increase-size) + var(--podium-ring-offsetY));
    z-index: 2;
}


.icon-overlay {
    position: absolute;
    /* top: var(--podium-ring-offsetY); */
    top: 0;
    transform: translateY(var(--podium-ring-offsetY));
    width: calc(var(--podium-avatar-size) + var(--podium-ring-increase-size));
    height: calc(var(--podium-avatar-size) + var(--podium-ring-increase-size));
    pointer-events: none;
    display: flex;
    flex-direction: column;
    z-index: 2;

}

.first-place .icon-overlay {
    background: var(--first-place-background) no-repeat center/contain;
}

.second-place .icon-overlay {
    background: var(--second-place-background) no-repeat center/contain;
}

.third-place .icon-overlay {
    background: var(--third-place-background) no-repeat center/contain;
}


.podium-wrapper .player-icon img,
.podium-wrapper .player-icon video,
.podium-wrapper .player-icon canvas {
    width: var(--podium-avatar-size);
    height: var(--podium-avatar-size);
    border-radius: 50%;
    cursor: pointer;

    transition: border 0.3s ease;
    object-fit: contain;
    box-shadow: 0 0 15px #fff;

    /* margin-bottom: var(--podium-ring-increase-size); */


}

.podium-wrapper .player-icon.no-player img {
    height: 90px;
}

.podium .player-name {
    color: #D29111;


}


.podium .player-icon.no-player {
    align-items: baseline !important;


}




.podium-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    gap: 0.20rem;

    font-size: var(--podium-font-size);
    font-weight: bold;
    width: var(--podium-other-place-size);


    border-radius: 50%;



}

.podium-wrapper * {
    display: inherit;
    justify-content: center;
    align-items: inherit;

    font-size: inherit;
    font-weight: inherit;
}



.other-competitors {
    display: grid;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.other-competitors .competitor {
    display: flex;
    align-items: center;
    gap: 1rem;

    width: var(--competitor-width);
    height: var(--competitor-height);

}

.other-competitors .competitor-avatar {
    width: var(--competitor-avatar-size);
    height: var(--competitor-avatar-size);
    border-radius: 50%;
    background: transparent;


}

.other-competitors .competitor-avatar img,
.other-competitors .competitor-avatar video {
    width: var(--competitor-avatar-size);
    height: var(--competitor-avatar-size);
    border-radius: 50%;
    object-fit: cover;
}


.competitor-wrapper {
    height: var(--competitor-height);
    width: 100%;
    border: 1px #D29111 solid;
    border-bottom-left-radius: calc(var(--competitor-height)/2);
    border-top-left-radius: calc(var(--competitor-height)/2);
    border-bottom-right-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    align-items: center;
    padding-left: var(--competitor-wrapper-padding);
    padding-right: var(--competitor-wrapper-padding);
    background-color: #1D1D1BD8;
}

.competitor-name {
    margin-left: 20px;
    font-size: var(--competitor-font-size);
    font-weight: bold;
}

.competitor-points {
    margin-left: auto;
    margin-right: 20px;
    color: #D29111;
    font-size: var(--competitor-font-size);
    font-weight: bold;
}

.competitor-points .point-label {
    font-size: inherit;
    font-weight: inherit;
}

.competitor-rank {
    font-size: var(--competitor-rank-font-size);
    font-weight: bold;

}

.solo-podium {
    display: grid;

    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.solo-podium .podium {
    transform: scale(var(--solo-podium-scale));
}

.leaderboard-intro {
    position: absolute;
    /* tüm ekranın üstünde */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    height: 100%;
    width: 100%;
    /* yarı saydam arka plan */
    z-index: 2000;
    /* her şeyin üstünde */
}

/* #third_place_canvas {
    transform: scale(2.3);
} */


/**
 * ==============================================
 * Dot Flashing
 * ==============================================
 */
.dot-flashing {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #fff;
    color: #fff;
    animation: dot-flashing 1s infinite linear alternate;
    animation-delay: 0.5s;
    margin-top: 10px;
}

.dot-flashing::before,
.dot-flashing::after {
    content: "";
    display: inline-block;
    position: absolute;
    top: 0;
}

.dot-flashing::before {
    left: -15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #fff;
    color: #fff;
    animation: dot-flashing 1s infinite alternate;
    animation-delay: 0s;
}

.dot-flashing::after {
    left: 15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #D29111;
    color: #D29111;
    animation: dot-flashing 1s infinite alternate;
    animation-delay: 1s;
}

.rain-wrapper {
    position: absolute;

    width: var(--podium-avatar-size);
    height: var(--podium-avatar-size);
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    /* overlay ve click’leri bozmasın */
    z-index: 1;
    /* avatar ve overlay’ın üstünde */
}

.code-rain {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            #FFFFFF00 0%,
            /* şeffaf üst */
            #FFFFFF00 30%,
            /* şeffaf üst orta */
            #FFFFFF80 50%,
            /* daha opak, görünür beyaz orta */
            #FFFFFF40 65%,
            /* hafif opak alt orta */
            #FFFFFF00 100%);
    animation: rain 2.4s linear infinite;
}

@keyframes dot-flashing {
    0% {
        background-color: #fff;
    }

    50%,
    100% {
        background-color: rgba(255, 255, 255, 0.2);
        /* beyazın saydam hali */
    }
}

@keyframes shine {
    0% {
        left: -150%;
    }

    100% {
        left: 150%;
    }
}

@keyframes rain {
    0% {
        transform: translateY(-50%);
    }

    100% {
        transform: translateY(50%);
    }
}