/* Game Styles */
body {
    margin: 0;
    padding: 20px;
    background: #000;
    color: white;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    gap: 20px;
    user-select: none;
}

.main-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.game-area {
    text-align: center;
    position: relative;
}

.leaderboard-container {
    width: 280px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 15px;
    position: sticky;
    top: 20px;
}

.leaderboard-title {
    font-size: 18px;
    font-weight: bold;
    color: #00ff88;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.prize-pool {
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
}

.prize-amount {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 5px;
}

.prize-label {
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
}

.prize-increase-notification {
    background: #2d5a2d;
    border: 1px solid #00ff88;
    border-radius: 6px;
    padding: 8px;
    margin: 10px 0;
    font-size: 12px;
    color: #00ff88;
    animation: prize-glow 2s ease-out;
    display: none;
}

@keyframes prize-glow {
    0% { box-shadow: 0 0 5px rgba(0, 255, 136, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.8); }
    100% { box-shadow: 0 0 5px rgba(0, 255, 136, 0.3); }
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 3px 0;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.leaderboard-entry.current-player {
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.rank {
    font-weight: bold;
    color: #ffd700;
    width: 25px;
    text-align: right;
    margin-right: 10px;
}

.rank.first { color: #ffd700; }
.rank.second { color: #c0c0c0; }
.rank.third { color: #cd7f32; }

.player-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.player-name.current-player {
    color: #00ff88;
    font-weight: bold;
}

.score {
    font-weight: bold;
    color: #fff;
    min-width: 40px;
    text-align: right;
}

.competition-info {
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
    font-size: 12px;
    color: #aaa;
}

.time-remaining {
    color: #ff6b6b;
    font-weight: bold;
}

.competition-footer {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 8px;
}

/* Canvas and Game Area */
canvas {
    border: 2px solid #333;
    background: #111;
    cursor: crosshair;
    position: relative;
}

.canvas-container {
    position: relative;
    display: inline-block;
}

.hud {
    display: flex;
    justify-content: space-around;
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.game-instructions {
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.8;
}

.speed-boost-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 80px;
    height: 20px;
    background: #666;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    color: white;
    font-weight: bold;
}

.speed-boost-button:hover {
    background: #777;
    transform: translateY(-1px);
}

.speed-boost-button.active {
    background: #555;
}

.hidden {
    display: none;
}

.danger-zone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(255, 0, 0, 0);
    pointer-events: none;
    z-index: 500;
    transition: background 0.3s ease;
}

.danger-zone-overlay.pulsing {
    animation: danger-pulse 2s infinite ease-in-out;
}

@keyframes danger-pulse {
    0%, 100% { 
        background: rgba(255, 0, 0, 0);
    }
    50% { 
        background: rgba(255, 0, 0, 0.2);
    }
}

/* Game Over Screen */
.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.game-over-content {
    background: #222;
    border: 2px solid #444;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
}

.game-over-title {
    font-size: 2.5rem;
    color: #ff4757;
    margin-bottom: 20px;
    font-weight: bold;
}

.game-over-stats {
    margin: 20px 0;
    font-size: 1.2rem;
}

.game-over-stat {
    margin: 10px 0;
    color: #ccc;
}

.stat-value {
    color: #0ff;
    font-weight: bold;
}

.new-high-score {
    color: #2ecc71;
    font-weight: bold;
    margin: 10px 0;
    font-size: 1.1rem;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.game-over-button {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-over-button:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.game-over-button.secondary {
    background: #3498db;
}

.game-over-button.secondary:hover {
    background: #2980b9;
}

/* Purchase Modal */
.purchase-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.purchase-modal-content {
    background: #222;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    min-width: 350px;
}

.purchase-modal-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
    font-weight: bold;
}

.purchase-modal-text {
    color: #ccc;
    margin-bottom: 25px;
    line-height: 1.4;
}

.purchase-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.purchase-modal-button {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.purchase-modal-button.confirm {
    background: #2ecc71;
    color: white;
}

.purchase-modal-button.confirm:hover {
    background: #27ae60;
    transform: translateY(-1px);
}

.purchase-modal-button.cancel {
    background: #e74c3c;
    color: white;
}

.purchase-modal-button.cancel:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.prize-highlight {
    color: #ffd700;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    
    .leaderboard-container {
        width: 90%;
        max-width: 400px;
        position: static;
    }
}