* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 800px;
    width: 90%;
}

h1 {
    color: #4a4a4a;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid #ccc;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcf7f);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
}

.timer-container {
    margin-top: 10px;
}

.timer-text {
    font-size: 1.4em;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

#timer-display {
    color: #e74c3c;
    font-family: 'Courier New', monospace;
}

.canvas-container {
    position: relative;
    display: inline-block;
    margin: 20px 0;
    border: 3px solid #333;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#gameCanvas {
    display: block;
    cursor: url('images/tongue_cursor.png'), crosshair;
    background: #f9f9f9;
}

.controls {
    margin: 20px 0;
}

.controls button {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 5px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.controls button:active {
    transform: translateY(0);
}

.color-selection {
    margin-top: 15px;
}

.color-selection h3 {
    margin-bottom: 10px;
    color: #555;
}

.color-btn {
    margin: 0 10px !important;
}

.color-btn[data-color="green"] {
    background: linear-gradient(145deg, #6bcf7f, #4caf50) !important;
}

.color-btn[data-color="red"] {
    background: linear-gradient(145deg, #ff6b6b, #f44336) !important;
}

.leaderboard {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border-left: 5px solid #f39c12;
}

.leaderboard h3 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 40px 80px 80px 1fr;
    gap: 10px;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    align-items: center;
    transition: all 0.3s ease;
}

.leaderboard-entry:hover {
    border-color: #f39c12;
    transform: translateX(5px);
}

.leaderboard-entry.best-score {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    font-weight: bold;
}

.leaderboard-entry .rank {
    font-weight: bold;
    color: #f39c12;
    text-align: center;
}

.leaderboard-entry .time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #e74c3c;
}

.leaderboard-entry .color {
    text-transform: capitalize;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.leaderboard-entry .color.green {
    background: linear-gradient(135deg, #6bcf7f, #4caf50);
}

.leaderboard-entry .color.red {
    background: linear-gradient(135deg, #ff6b6b, #f44336);
}

.leaderboard-entry .date {
    font-size: 0.9em;
    color: #666;
    text-align: right;
}

.no-scores {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 8px;
}

.clear-btn {
    background: linear-gradient(145deg, #e74c3c, #c0392b) !important;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.instructions {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border-left: 5px solid #667eea;
}

.instructions h3 {
    color: #333;
    margin-bottom: 15px;
}

.instructions p {
    margin: 8px 0;
    font-size: 1em;
    color: #666;
    text-align: left;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        width: 95%;
    }
    
    h1 {
        font-size: 2em;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 400px;
        cursor: url('images/tongue_cursor.png'), crosshair;
    }
    
    .controls button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .instructions p {
        font-size: 0.9em;
    }
}

/* Game completion animation */
@keyframes celebration {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.celebrate {
    animation: celebration 0.6s ease-in-out 3;
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
}