/* Font Awesome font-display optimization */
@font-face {
  font-family: 'Font Awesome 6 Free';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: local('Font Awesome 6 Free Solid'), local('FontAwesome6Free-Solid');
}

@font-face {
  font-family: 'Font Awesome 6 Brands';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Font Awesome 6 Brands Regular'), local('FontAwesome6Brands-Regular');
}

* {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0e27;
    color: #e0e0e0;
}

.game-tile {
    width: 50px;
    height: 50px;
    background: #1e2139;
    border: 2px solid #2a2f4a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    position: relative;
}

.game-tile:hover:not(.revealed) {
    background: #2a2f4a;
    transform: scale(1.05);
    border-color: #3a3f5a;
}

.game-tile.safe {
    background: #00d084;
    border-color: #00f593;
    animation: safePulse 0.3s ease;
}

.game-tile.burned {
    background: #ff4444;
    border-color: #ff6666;
    animation: burnPulse 0.5s ease;
}

.game-tile.revealed {
    cursor: not-allowed;
    opacity: 0.6;
}

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

@keyframes burnPulse {
    0%, 100% { transform: scale(1); }
    25% { transform: rotate(-5deg) scale(1.1); }
    75% { transform: rotate(5deg) scale(1.1); }
}

.difficulty-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: 2px solid #2a2f4a;
    background: #1a1f3a;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.difficulty-btn:hover {
    border-color: #ff6b35;
    background: #2a2f4a;
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border-color: #ff6b35;
    color: #fff;
}

.bet-btn {
    padding: 8px 16px;
    background: #2a2f4a;
    border: 1px solid #3a3f5a;
    border-radius: 6px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.bet-btn:hover {
    background: #3a3f5a;
    border-color: #ff6b35;
}

.play-btn {
    background: linear-gradient(135deg, #00d084 0%, #00a86b 100%);
    color: white;
    padding: 16px 48px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 208, 132, 0.3);
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 208, 132, 0.4);
}

.play-btn:disabled {
    background: #2a2f4a;
    cursor: not-allowed;
    box-shadow: none;
}

.cashout-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1f3a;
    padding: 16px 48px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.cashout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.cashout-btn:disabled {
    background: #2a2f4a;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

.stat-card {
    background: #1a1f3a;
    border: 1px solid #2a2f4a;
    border-radius: 12px;
    padding: 20px;
}

.feature-card {
    background: #1a1f3a;
    border: 1px solid #2a2f4a;
    border-radius: 12px;
    padding: 32px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: #ff6b35;
    transform: translateY(-5px);
}

.gradient-orange {
    background: linear-gradient(180deg, #ffa85c 0%, #ff9944 100%);
    border-radius: 8px;
    box-shadow: 
        0 4px 0 0 #d67a2e,
        0 6px 12px rgba(0, 0, 0, 0.25);
    border: none;
    position: relative;
    transform: translateY(0);
    transition: all 0.2s ease;
    cursor: pointer;
}

.gradient-orange:hover {
    background: linear-gradient(180deg, #ffb66d 0%, #ffa855 100%);
    box-shadow: 
        0 4px 0 0 #d67a2e,
        0 8px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.gradient-orange:active {
    background: linear-gradient(180deg, #ff9944 0%, #ff8833 100%);
    box-shadow: 
        0 2px 0 0 #d67a2e,
        0 3px 6px rgba(0, 0, 0, 0.2);
    transform: translateY(2px);
    transition: all 0.1s ease;
}

.text-orange {
    color: #ff6b35;
}

.text-green {
    color: #00d084;
}

#demoModeContainer {
    display: none;
    border-radius: 16px;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

#demoModeContainer.active {
    display: block;
}

#demoModeContainer iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 16px;
}

.close-demo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 107, 53, 0.95);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.close-demo-btn:hover {
    background: rgba(255, 107, 53, 1);
    transform: scale(1.05);
}

.game-background-container {
    background-image: url('images/chicken-road-blured.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 16px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 60px 40px 30px 40px;
}

@media (max-width: 768px) {
    .game-background-container {
        background-image: url('images/chicken-road-blured-phone.webp');
        background-size: contain;
        background-position: center top;
        min-height: 600px;
        padding: 40px 20px 20px 20px;
    }
}

/* Leaderboard styles */
.leaderboard-container {
    background: linear-gradient(135deg, #1a1f3a 0%, #252a4a 100%);
    border: 1px solid #2a2f4a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.leaderboard-header {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    padding: 16px;
    font-weight: 700;
    font-size: 18px;
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leaderboard-content {
    padding: 12px;
    max-height: 500px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-content::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-content::-webkit-scrollbar-track {
    background: #1a1f3a;
}

.leaderboard-content::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 3px;
}

.leaderboard-item {
    background: #1e2139;
    border: 1px solid #2a2f4a;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #00d084 0%, #00a86b 100%);
}

.leaderboard-item:hover {
    transform: translateX(5px);
    border-color: #ff6b35;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.leaderboard-rank {
    font-size: 20px;
    font-weight: 700;
    color: #ff6b35;
    min-width: 30px;
    text-align: center;
}

.leaderboard-rank.top-1 {
    color: #ffd700;
    font-size: 24px;
}

.leaderboard-rank.top-2 {
    color: #c0c0c0;
    font-size: 22px;
}

.leaderboard-rank.top-3 {
    color: #cd7f32;
    font-size: 22px;
}

.leaderboard-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff6b35;
    flex-shrink: 0;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: #e0e0e0;
    font-size: 14px;
    margin-bottom: 2px;
}

.leaderboard-time {
    font-size: 11px;
    color: #aaa;
}

.leaderboard-win {
    font-weight: 700;
    font-size: 16px;
    color: #00d084;
    white-space: nowrap;
}

.leaderboard-win.big-win {
    color: #ffd700;
    font-size: 18px;
    animation: pulse 2s infinite;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
    .stat-card {
        padding: 12px;
    }
    
    .stat-card .text-4xl {
        font-size: 1.75rem !important;
    }
    
    .stat-card .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .stat-card .text-2xl {
        font-size: 1.25rem !important;
    }
    
    .stat-card .text-xl {
        font-size: 1.125rem !important;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .feature-card .text-5xl {
        font-size: 2.5rem !important;
    }
    
    .feature-card .text-xl {
        font-size: 1.125rem !important;
    }
}
