/* Christmas Game Style - Western Game Aesthetic */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Montserrat:wght@400;600;700;800&display=swap');

:root {
    --christmas-red: #C41E3A;
    --christmas-green: #228B22;
    --christmas-gold: #FFD700;
    --christmas-snow: #FFFFFF;
    --christmas-dark: #1a1a2e;
    --christmas-light: #f8f9fa;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: var(--christmas-snow);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Snow Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: snow 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes snow {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(100vh) translateX(50px); }
}

/* Christmas decorations */
.christmas-decoration {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

.christmas-decoration::before {
    content: '🎄';
    font-size: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    position: relative;
}

.menu-btn {
    background: var(--christmas-red);
    border: none;
    color: white;
    font-size: 24px;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
    transition: all 0.3s ease;
    font-weight: bold;
}

.menu-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.6);
}

.logo {
    font-family: 'Fredoka One', cursive;
    font-size: 32px;
    background: linear-gradient(135deg, var(--christmas-red), var(--christmas-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    letter-spacing: 2px;
}

.game-title-header {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.header-icons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: var(--christmas-green);
    border: none;
    color: white;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(34, 139, 34, 0.4);
    transition: all 0.3s ease;
}

.icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(34, 139, 34, 0.6);
}

/* Homepage Styles */
.homepage main {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.join-section {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.2), rgba(34, 139, 34, 0.2));
    border: 3px solid var(--christmas-gold);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
}

.join-section h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.room-input,
.name-input {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid var(--christmas-gold);
    border-radius: 15px;
    color: white;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.room-input:focus,
.name-input:focus {
    outline: none;
    border-color: var(--christmas-red);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.room-input::placeholder,
.name-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.char-limit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--christmas-gold);
    font-weight: 600;
    font-size: 14px;
}

.games-section h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.game-card {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.3), rgba(34, 139, 34, 0.3));
    border: 3px solid var(--christmas-gold);
    border-radius: 20px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.game-card:hover::before {
    animation: shine 1s ease;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.game-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
    border-color: var(--christmas-red);
}

.game-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-cover img {
    transform: scale(1.1);
}

.game-card h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    color: var(--christmas-gold);
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 18px;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--christmas-red), #e63946);
    border: none;
    border-radius: 15px;
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(196, 30, 58, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

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

/* Game Detail Page */
.game-detail-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.game-detail {
    max-width: 600px;
    margin: 0 auto;
}

.game-detail .game-title {
    font-family: 'Fredoka One', cursive;
    font-size: 32px;
    color: var(--christmas-gold);
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.game-image {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--christmas-gold);
}

.game-image img {
    width: 100%;
    height: auto;
    display: block;
}

.game-intro {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-green);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.game-intro h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: var(--christmas-gold);
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.game-intro p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.game-intro ul {
    list-style: none;
    padding-left: 0;
}

.game-intro li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
}

.game-intro li::before {
    content: '🎄';
    position: absolute;
    left: 0;
}

.game-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-tag {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(196, 30, 58, 0.2));
    border: 2px solid var(--christmas-gold);
    border-radius: 15px;
}

.price {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.purchased-badge {
    display: block;
    margin-top: 10px;
    color: var(--christmas-green);
    font-weight: 600;
    font-size: 16px;
}

.start-btn {
    margin-top: 10px;
}

/* Waiting Room Page */
.waiting-room-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.waiting-room {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.join-info {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    width: 100%;
}

.join-text {
    font-size: 16px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.join-text strong {
    color: var(--christmas-gold);
    font-weight: 700;
}

.room-code-display {
    font-family: 'Fredoka One', cursive;
    font-size: 48px;
    color: var(--christmas-gold);
    letter-spacing: 8px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    margin: 15px 0;
}

.qr-section {
    margin-top: 20px;
}

.qr-section p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.qr-code {
    width: 150px;
    height: 150px;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border: 3px solid var(--christmas-gold);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    box-sizing: border-box;
}

.qr-placeholder {
    color: var(--christmas-dark);
    font-weight: 600;
    font-size: 14px;
}

.players-circle {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 500px;
    margin: 20px 0;
}

.player-slot {
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.3), rgba(34, 139, 34, 0.3));
    border: 3px solid var(--christmas-gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.player-slot.joined {
    border-color: var(--christmas-green);
    background: linear-gradient(135deg, rgba(34, 139, 34, 0.8), rgba(255, 215, 0, 0.6));
    box-shadow: 0 6px 20px rgba(34, 139, 34, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

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

.avatar-placeholder {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: var(--christmas-gold);
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    padding: 5px;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
}

.player-slot.joined .avatar-placeholder {
    font-size: 14px;
    color: var(--christmas-gold);
    font-weight: 700;
    margin-bottom: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.player-name {
    position: absolute;
    bottom: -25px;
    font-size: 12px;
    font-weight: 600;
    color: var(--christmas-gold);
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.joined-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.start-game-btn {
    max-width: 300px;
    margin-top: 20px;
}

/* Game Page */
.game-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
}

.countdown-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

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

.countdown-number {
    font-family: 'Fredoka One', cursive;
    font-size: 120px;
    color: var(--christmas-gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: countdownPulse 1s ease-in-out;
    line-height: 1;
}

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

.countdown-label {
    font-family: 'Fredoka One', cursive;
    font-size: 32px;
    color: var(--christmas-red);
    margin-top: 20px;
    text-shadow: 0 0 15px rgba(196, 30, 58, 0.5);
}

.round-info {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 15px;
    padding: 15px 25px;
    backdrop-filter: blur(10px);
}

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

.round-number {
    font-family: 'Fredoka One', cursive;
    font-size: 36px;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.leaderboard-phase {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.game-title-leaderboard {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.game-duration-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.game-duration-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.game-duration-time {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    min-width: 60px;
    text-align: center;
}

.round-info-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-label-header {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.round-number-header {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.track-container {
    flex: 1;
    position: relative;
    margin: 10px 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.race-track {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(to bottom, 
        rgba(34, 139, 34, 0.2) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(34, 139, 34, 0.2) 100%);
    border: 3px solid var(--christmas-gold);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.track-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(90deg, 
            transparent 0px, 
            transparent 48px, 
            rgba(255, 255, 255, 0.1) 48px, 
            rgba(255, 255, 255, 0.1) 50px),
        repeating-linear-gradient(0deg,
            transparent 0px,
            transparent 98px,
            rgba(255, 255, 255, 0.05) 98px,
            rgba(255, 255, 255, 0.05) 100px);
    animation: trackMove 2s linear infinite;
}

@keyframes trackMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(50px); }
}

.players-on-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px 20px;
    gap: 0;
    flex: 1;
}

.track-player {
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.5s ease;
    animation: slideIn 0.5s ease;
    width: 100%;
    padding: 8px 0;
    flex: 1;
    min-height: 0;
}

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

.track-player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--christmas-red), var(--christmas-gold));
    border: 3px solid var(--christmas-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.track-player.top3 {
    border-color: var(--christmas-gold);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
    animation: top3Glow 2s ease-in-out infinite;
}

.track-player.empty-track {
    opacity: 0.3;
    animation: none !important;
}

.track-player.empty-track .track-player-avatar {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

.track-player.empty-track .track-player-name {
    color: rgba(255, 255, 255, 0.5);
}

@keyframes top3Glow {
    0%, 100% { box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6); }
    50% { box-shadow: 0 8px 35px rgba(255, 215, 0, 0.9); }
}

.track-player-avatar-name-container {
    display: flex;
    align-items: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    will-change: transform;
}

.track-player-avatar-name-container.moving {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.track-player-name {
    margin-left: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
    position: relative;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-player-score {
    margin-left: 10px;
    font-size: 18px;
    color: var(--christmas-gold);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.track-player-rank {
    position: relative;
    left: 0;
    margin-right: 30px;
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    z-index: 2;
    min-width: 50px;
    text-align: right;
}

.leaderboard-list {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    max-height: 200px;
    overflow-y: auto;
    flex-shrink: 0;
    margin-top: 20px;
}

/* Game Results Phase */
.results-phase {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    overflow-y: auto;
    padding-top: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.results-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.game-title-results {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.round-info-results {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-label-results {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.round-number-results {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.top-three-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 40px 0;
    width: 100%;
    max-width: 1200px;
    position: relative;
}

.top-three-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 215, 0, 0.1));
    border: 3px solid var(--christmas-gold);
    border-radius: 20px;
    padding: 30px 25px;
    position: relative;
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease;
}

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

.first-place {
    order: 2;
    min-width: 200px;
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(196, 30, 58, 0.2));
    border-color: var(--christmas-gold);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4);
    transform: scale(1.15);
    z-index: 3;
    animation: winnerPulse 2s ease-in-out infinite;
}

@keyframes winnerPulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 15px 50px rgba(255, 215, 0, 0.7);
    }
}

.second-place {
    order: 1;
    min-width: 160px;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(255, 255, 255, 0.1));
    border-color: #C0C0C0;
    box-shadow: 0 8px 30px rgba(192, 192, 192, 0.3);
}

.third-place {
    order: 3;
    min-width: 160px;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(255, 255, 255, 0.1));
    border-color: #CD7F32;
    box-shadow: 0 8px 30px rgba(205, 127, 50, 0.3);
}

.rank-badge {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--christmas-red), var(--christmas-gold));
    border: 3px solid var(--christmas-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.rank-badge.winner {
    background: linear-gradient(135deg, var(--christmas-gold), #ffed4e);
    width: 60px;
    height: 60px;
    font-size: 32px;
    border-width: 4px;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
}

.crown-icon {
    font-size: 40px;
    margin-bottom: 10px;
    animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.player-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--christmas-red), var(--christmas-gold));
    border: 4px solid var(--christmas-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 48px;
    color: white;
    font-weight: bold;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    margin: 20px 0 15px 0;
}

.first-place .player-avatar-large {
    width: 120px;
    height: 120px;
    font-size: 56px;
    border-width: 5px;
    box-shadow: 0 8px 35px rgba(255, 215, 0, 0.6);
}

.player-name-large {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: white;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    word-break: break-word;
    max-width: 180px;
}

.first-place .player-name-large {
    font-size: 28px;
    max-width: 200px;
}

.full-leaderboard-results {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    max-height: 300px;
    overflow-y: auto;
    margin: 30px 0;
}

.leaderboard-item-results {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.leaderboard-item-results:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--christmas-gold);
}

.leaderboard-rank-results {
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: var(--christmas-gold);
    min-width: 35px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.leaderboard-avatar-results {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--christmas-red), var(--christmas-gold));
    border: 2px solid var(--christmas-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    color: white;
    font-weight: bold;
    margin: 0 15px;
}

.leaderboard-name-results {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: white;
    flex: 1;
}

.play-again-btn {
    font-size: 18px;
    padding: 12px 24px;
    white-space: nowrap;
    width: auto;
    min-width: 140px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--christmas-gold);
}

.leaderboard-rank {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: var(--christmas-gold);
    min-width: 40px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--christmas-red), var(--christmas-gold));
    border: 2px solid var(--christmas-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: white;
    font-weight: bold;
    margin: 0 15px;
}

.leaderboard-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: white;
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 24px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .players-circle {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .countdown-number {
        font-size: 80px;
    }
    
    .room-code-display {
        font-size: 36px;
    }
    
    .track-player-rank {
        font-size: 22px;
        margin-right: 20px;
        min-width: 40px;
    }
    
    .track-player-avatar {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .track-player-name {
        font-size: 18px;
        margin-left: 15px;
    }
    
    .leaderboard-phase {
        padding: 15px;
    }
    
    .round-header {
        padding: 12px 15px;
        margin-bottom: 10px;
    }
    
    .game-title-leaderboard {
        font-size: 22px;
    }
    
    .track-container {
        margin: 10px 0;
    }
    
    .players-on-track {
        padding: 10px 15px;
    }
    
    .top-three-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .first-place {
        order: 1;
        transform: scale(1);
        min-width: 180px;
    }
    
    .second-place {
        order: 2;
        min-width: 150px;
    }
    
    .third-place {
        order: 3;
        min-width: 150px;
    }
    
    .player-avatar-large {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
    
    .first-place .player-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 48px;
    }
    
    .player-name-large {
        font-size: 20px;
    }
    
    .first-place .player-name-large {
        font-size: 24px;
    }
    
    .results-header {
        padding: 12px 15px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }
    
    .game-title-results {
        font-size: 22px;
    }
    
    .results-header-right {
        flex-direction: column;
        gap: 10px;
        align-items: flex-end;
    }
    
    .play-again-btn {
        font-size: 16px;
        padding: 10px 20px;
        min-width: 120px;
    }
    
    .round-info-results {
        margin-bottom: 0;
    }
}

@media (orientation: portrait) {
    .waiting-room-page::after {
        content: 'Please rotate to landscape mode';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: var(--christmas-gold);
        z-index: 9999;
        font-family: 'Fredoka One', cursive;
    }
}

/* Payment Modal */
.payment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.payment-modal.active {
    display: flex;
}

.payment-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid var(--christmas-gold);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.payment-content h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--christmas-gold);
    margin-bottom: 20px;
}

.payment-content p {
    font-size: 18px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.payment-btn {
    background: linear-gradient(135deg, var(--christmas-green), #32cd32);
    margin-top: 20px;
}

/* Auth Modal Styles */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.auth-modal.active {
    display: flex;
}

.auth-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid var(--christmas-gold);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
}

.auth-content h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 32px;
    color: var(--christmas-gold);
    margin-bottom: 30px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.auth-form .input-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-form .input-group.verification-group {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: stretch;
}

.auth-form .input-group.verification-group .auth-input {
    flex: 3;
    margin-right: 0;
}

.auth-form .input-group.verification-group button {
    flex: 2;
    flex-shrink: 0;
    font-size: 16px!important;
    white-space: nowrap;
}

.auth-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 12px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--christmas-red);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.auth-submit-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 700;
    margin-top: 10px;
}

.auth-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
}

.auth-link-btn {
    background: transparent;
    border: none;
    color: var(--christmas-gold);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.auth-link-btn:hover {
    color: var(--christmas-red);
    text-shadow: 0 0 10px rgba(196, 30, 58, 0.5);
}

.auth-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#payment-element-container {
    margin: 20px 0;
    min-height: 200px;
}

#payment-element {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* Stripe Payment Element styling */
#payment-element .InputElement {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 10px;
    color: white;
    padding: 12px;
}

#payment-element .InputElement:focus {
    border-color: var(--christmas-red);
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.5);
}

#payment-element .Label {
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Montserrat', sans-serif;
}

