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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
}

.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    width: 400px;
}

.screen.hidden {
    display: none;
}

.title h1 {
    font-size: 2.5rem;
    color: #22c55e;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

.title p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

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

.high-score {
    font-size: 1.2rem;
    color: #f59e0b;
    margin-bottom: 20px;
    font-weight: bold;
}

.level-select h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.level-btn {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.level-btn:hover:not(.locked) {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.level-btn.locked {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.level-btn.completed {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.instructions {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 10px;
}

.instructions p:first-child {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.instructions p {
    font-size: 0.9rem;
    color: #555;
    margin: 5px 0;
}

.hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    font-size: 1.1rem;
}

.hud.hidden {
    display: none;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

.loading.hidden {
    display: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #4ade80;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    font-size: 1.2rem;
    color: #333;
    font-weight: bold;
}

.hud-left {
    color: #3b82f6;
}

.hud-jumps {
    color: #a855f7;
    font-size: 0.9rem;
}

.hud-center {
    color: #f59e0b;
}

.hud-right {
    font-size: 1.3rem;
}

.result-content h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.result-content h2.win {
    color: #22c55e;
}

.result-content h2.lose {
    color: #ef4444;
}

.result-score {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.result-score p {
    margin: 8px 0;
    color: #333;
}

.result-score span {
    font-weight: bold;
    color: #f59e0b;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-buttons button {
    padding: 12px 24px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

#restart-btn {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
}

#restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
}

#next-level-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
}

#next-level-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(34, 197, 94, 0.4);
}

#home-btn {
    background: #e5e7eb;
    color: #333;
}

#home-btn:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .screen {
        padding: 25px;
        width: 95%;
    }
    
    .title h1 {
        font-size: 2rem;
    }
    
    .levels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .level-btn {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .hud {
        padding: 10px 15px;
        font-size: 1rem;
    }
    
    .hud-right {
        font-size: 1.1rem;
    }
}
