/* Spooky Jump - Halloween Endless Runner */
@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Nunito:wght@400;600;700&display=swap');

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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(180deg, #1a0a2e 0%, #2d1b4e 50%, #4a2c6a 100%);
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.back-btn {
    display: inline-block;
    color: #ff9f43;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.back-btn:hover {
    color: #ffc107;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 15px;
}

.game-header h1 {
    font-family: 'Creepster', cursive;
    font-size: 2.5rem;
    color: #ff6b35;
    text-shadow: 3px 3px 0 #000, 0 0 20px rgba(255, 107, 53, 0.5);
    letter-spacing: 4px;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid #ff6b35;
}

.stat-label {
    color: #aaa;
    font-size: 0.75rem;
    margin-right: 5px;
}

.stat-item span:last-child {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.candy-count span:last-child {
    color: #ffd700;
}

/* Screens */
.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

/* Start Screen */
.title-art {
    margin-bottom: 20px;
}

.spooky-cat {
    font-size: 5rem;
    animation: float 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.5));
}

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

.spooky-decorations {
    font-size: 2.5rem;
    margin-top: 10px;
}

.spooky-decorations span {
    margin: 0 15px;
    display: inline-block;
    animation: wobble 3s ease-in-out infinite;
}

.spooky-decorations span:nth-child(2) {
    animation-delay: 0.5s;
}

.spooky-decorations span:nth-child(3) {
    animation-delay: 1s;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

#startScreen h2 {
    font-size: 1.4rem;
    color: #e0e0e0;
    margin-bottom: 15px;
    max-width: 400px;
}

.instructions {
    color: #aaa;
    margin-bottom: 25px;
    font-size: 1rem;
}

/* High Scores Panel */
.high-scores-panel {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #8b5cf6;
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 25px;
    min-width: 280px;
}

.high-scores-panel h3 {
    font-family: 'Creepster', cursive;
    color: #8b5cf6;
    font-size: 1.3rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.high-scores-panel ol {
    list-style: none;
    text-align: left;
}

.high-scores-panel li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 0.95rem;
}

.high-scores-panel li:last-child {
    border-bottom: none;
}

.high-scores-panel .score-name {
    color: #e0e0e0;
}

.high-scores-panel .score-value {
    color: #ffd700;
    font-weight: 700;
}

/* Buttons */
.play-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    border: none;
    padding: 15px 50px;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
}

.play-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
}

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

.menu-btn {
    display: inline-block;
    background: transparent;
    color: #8b5cf6;
    border: 2px solid #8b5cf6;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    margin-left: 15px;
}

.menu-btn:hover {
    background: #8b5cf6;
    color: #fff;
}

/* Game Canvas */
#gameScreen {
    padding: 0;
    position: relative;
    flex: 1;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

#touchZone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Game Over Screen */
#gameOverTitle {
    font-family: 'Creepster', cursive;
    font-size: 3rem;
    color: #ff6b35;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 25px;
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.final-stat {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #8b5cf6;
    border-radius: 15px;
    padding: 15px 25px;
    min-width: 120px;
}

.final-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #ffd700;
}

.final-label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 5px;
}

/* New High Score */
.new-high-score {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 107, 53, 0.2) 100%);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 25px;
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.6); }
}

.new-high-score p {
    font-family: 'Creepster', cursive;
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 15px;
    letter-spacing: 3px;
}

.new-high-score input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #8b5cf6;
    border-radius: 10px;
    padding: 12px 20px;
    color: #fff;
    font-size: 1.1rem;
    width: 200px;
    text-align: center;
    margin-right: 10px;
}

.new-high-score input::placeholder {
    color: #888;
}

.save-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.game-over-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Responsive */
@media (max-width: 600px) {
    .game-header h1 {
        font-size: 1.8rem;
    }

    .stats-bar {
        gap: 10px;
    }

    .stat-item {
        padding: 6px 12px;
    }

    .spooky-cat {
        font-size: 4rem;
    }

    #startScreen h2 {
        font-size: 1.1rem;
    }

    .play-btn {
        padding: 12px 35px;
        font-size: 1.1rem;
    }

    .final-stats {
        gap: 15px;
    }

    .final-stat {
        padding: 12px 18px;
        min-width: 100px;
    }

    .final-value {
        font-size: 1.5rem;
    }

    .new-high-score input {
        width: 150px;
        margin-bottom: 10px;
    }

    .game-over-buttons {
        flex-direction: column;
    }

    .menu-btn {
        margin-left: 0;
    }
}
