/* Font Face */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

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

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: black;
    color: #ffffff;
    overflow-x: hidden;
}

/* Starry Night Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

.star.small {
    width: 1px;
    height: 1px;
}

.star.medium {
    width: 2px;
    height: 2px;
}

.star.large {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.3);
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: var(--max-opacity);
        transform: scale(1);
    }
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Logo Section */
.logo-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.main-logo {
    max-width: 200px;
    height: auto;
}

.logo-subinfo {
    margin-top: 14px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}

/* Leaderboard Section */
.leaderboard-section {
    width: 100%;
    max-width: 1200px;
    padding: 20px 0;
}

/* Podium Styles */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 60px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100px;
    flex-shrink: 0;
    overflow: hidden;
}

/* Height offsets for podium effect */
.podium-place.first {
    margin-bottom: 30px;
    width: 120px;
    overflow: hidden;
}

.podium-place.second {
    margin-bottom: 10px;
}

.podium-place.third {
    margin-bottom: 0;
}

.crown {
    font-size: 1.8rem;
    animation: bounce 1.5s ease infinite;
    margin-bottom: -26px;
}

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

.rank-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.podium-place.first .rank-circle {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.gold-circle {
    background: transparent;
    border: 3px solid #FFD700;
    color: #FFD700;
    box-shadow: 
        0 0 12px rgba(255, 215, 0, 0.4),
        0 0 24px rgba(255, 215, 0, 0.2),
        inset 0 0 10px rgba(255, 215, 0, 0.1);
    animation: goldGlow 2s ease-in-out infinite alternate;
}

@keyframes goldGlow {
    0% {
        box-shadow: 
            0 0 12px rgba(255, 215, 0, 0.4),
            0 0 24px rgba(255, 215, 0, 0.2),
            inset 0 0 10px rgba(255, 215, 0, 0.1);
    }
    100% {
        box-shadow: 
            0 0 18px rgba(255, 215, 0, 0.5),
            0 0 30px rgba(255, 215, 0, 0.25),
            inset 0 0 12px rgba(255, 215, 0, 0.15);
    }
}

.silver-circle {
    background: transparent;
    border: 3px solid #C0C0C0;
    color: #C0C0C0;
    box-shadow: 
        0 0 15px rgba(192, 192, 192, 0.25),
        inset 0 0 10px rgba(192, 192, 192, 0.08);
}

.bronze-circle {
    background: transparent;
    border: 3px solid #CD7F32;
    color: #CD7F32;
    box-shadow: 
        0 0 15px rgba(205, 127, 50, 0.25),
        inset 0 0 10px rgba(205, 127, 50, 0.08);
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.player-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    display: block;
}

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

.player-score {
    font-size: 0.64rem;
    color: #a0aec0;
}

.podium-place.first .player-score {
    color: #FFD700;
    font-weight: 500;
}

/* Sponsors Section */
.sponsors-section {
    width: 100%;
    max-width: 1200px;
    padding: 30px 0;
    margin-top: 10px;
}

.sponsor-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.sponsor-logo {
    max-width: 70px;
    max-height: 35px;
    object-fit: contain;
    filter: grayscale(100%) brightness(2);
    opacity: 0.7;
    transition: all 0.3s;
}

.sponsor-logo:hover {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
}

/* Separator */
.separator {
    width: 80%;
    max-width: 1200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: 20px 0;
}

/* QR Code Section */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px;
    position: relative;
    overflow: visible;
    width: 100%;
    min-height: 350px;
}

.stickers-bg {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.sticker {
    position: absolute;
    opacity: 0.85;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
    transition: opacity 0.3s;
    animation: float var(--float-duration, 4s) ease-in-out infinite;
    animation-delay: var(--float-delay, 0s);
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0) rotate(var(--rotation, 0deg));
    }
    50% {
        transform: translate(-50%, -50%) translateY(-8px) rotate(var(--rotation, 0deg));
    }
}

#qrcode {
    background: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

#qrcode img {
    display: block;
}

.qr-text {
    margin-bottom: 30px;
    font-size: 1rem;
    color: #ffffff;
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 90%;
    -webkit-text-stroke: 8px black;
    paint-order: stroke fill;
}

/* Footer */
.footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    color: #a0aec0;
    font-size: 0.9rem;
    position: sticky;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.footer-logo {
    max-width: 40px;
    height: auto;
    margin-top: 10px;
    opacity: 0.6;
}

/* Responsive Styles */

/* Mobile (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .main-logo {
        max-width: 200px;
    }

    .logo-subinfo {
        font-size: 0.7rem;
    }

    .crown {
        font-size: 2.2rem;
    }

    .avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .first .avatar {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }

    .player-name {
        font-size: 0.7rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .podium-place {
        width: 70px;
    }

    .podium-place.first {
        width: 85px;
    }

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

    .podium-block {
        width: 60px;
        font-size: 1.2rem;
    }

    .first .podium-block {
        width: 75px;
    }

    .gold { height: 80px; }
    .silver { height: 55px; }
    .bronze { height: 40px; }

    #qrcode {
        padding: 10px;
    }

    #qrcode img {
        width: 120px !important;
        height: 120px !important;
    }

    .footer {
        font-size: 0.65rem;
        padding: 15px;
    }

    .footer-logo {
        max-width: 30px;
    }
}

/* Tablet (481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .main-logo {
        max-width: 220px;
    }

    .logo-subinfo {
        font-size: 0.8rem;
    }

    .crown {
        font-size: 2.5rem;
    }

    .footer {
        font-size: 0.75rem;
    }

    .footer-logo {
        max-width: 35px;
    }
}

/* Desktop (769px to 1200px) */
@media (min-width: 769px) and (max-width: 1200px) {
    .container {
        padding: 30px;
    }

    .main-logo {
        max-width: 220px;
    }

    .avatar {
        width: 70px;
        height: 70px;
    }

    .first .avatar {
        width: 90px;
        height: 90px;
    }
}

/* Large Desktop / TV (1201px and above) */
@media (min-width: 1201px) {
    .container {
        padding: 40px;
    }

    .main-logo {
        max-width: 300px;
    }

    .leaderboard-section {
        max-width: 1400px;
    }

    .avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .first .avatar {
        width: 110px;
        height: 110px;
        font-size: 2.5rem;
    }

    .player-name {
        font-size: 0.9rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

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

    .podium-place {
        width: 120px;
    }

    .podium-place.first {
        width: 140px;
    }

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

    .podium-block {
        width: 100px;
        font-size: 2rem;
    }

    .first .podium-block {
        width: 130px;
    }

    .gold { height: 130px; }
    .silver { height: 95px; }
    .bronze { height: 70px; }

    .crown {
        font-size: 3rem;
    }

    .leaderboard-item {
        padding: 18px 30px;
    }

    .rank {
        font-size: 1.4rem;
        width: 50px;
    }

    .item-avatar {
        width: 50px;
        height: 50px;
        margin-right: 20px;
    }

    .item-name, .item-score {
        font-size: 1.2rem;
    }

    .sponsor-logos {
        gap: 50px;
    }

    #qrcode {
        padding: 20px;
    }

    #qrcode img {
        width: 180px !important;
        height: 180px !important;
    }

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

/* Extra Large TV (1600px and above) */
@media (min-width: 1600px) {
    .main-logo {
        max-width: 400px;
    }

    .leaderboard-section {
        max-width: 1600px;
    }

    .avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .first .avatar {
        width: 140px;
        height: 140px;
        font-size: 3rem;
    }

    .player-name {
        font-size: 1rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

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

    .podium-place {
        width: 140px;
    }

    .podium-place.first {
        width: 160px;
    }

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

    .podium-block {
        width: 130px;
        font-size: 2.5rem;
    }

    .first .podium-block {
        width: 170px;
    }

    .gold { height: 160px; }
    .silver { height: 120px; }
    .bronze { height: 90px; }

    .crown {
        font-size: 4rem;
    }

    .leaderboard-item {
        padding: 22px 40px;
        border-radius: 16px;
    }

    .rank {
        font-size: 1.6rem;
        width: 60px;
    }

    .item-avatar {
        width: 60px;
        height: 60px;
        margin-right: 25px;
    }

    .item-name, .item-score {
        font-size: 1.4rem;
    }

    #qrcode img {
        width: 220px !important;
        height: 220px !important;
    }

    .qr-text {
        font-size: 1.4rem;
    }
}

/* Ultra Wide / Beyond 1920px */
@media (min-width: 1921px) {
    .container {
        max-width: 1920px;
        margin: 0 auto;
    }
}
