/* Jezzball - Classic Wall Building Game */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&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(135deg, #0d0d0d 0%, #1a1a1a 50%, #2d2d2d 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: 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: #00ff88;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 10px;
    transition: color 0.3s;
}

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

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

.game-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    letter-spacing: 4px;
}

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

.stat-item {
    background: rgba(0, 255, 136, 0.1);
    padding: 6px 15px;
    border-radius: 8px;
    border: 2px solid #00ff88;
}

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

.stat-item span:last-child {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

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

.screen.hidden {
    display: none;
}

/* Start Screen */
.jezzball-art {
    width: 120px;
    height: 80px;
    background: #1a1a1a;
    border: 3px solid #00ff88;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.ball-demo {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c0392b);
    border-radius: 50%;
    position: absolute;
    animation: bounce-demo 2s ease-in-out infinite;
}

.ball-demo.delay1 {
    background: radial-gradient(circle at 30% 30%, #74b9ff, #2980b9);
    animation-delay: 0.5s;
    left: 50px;
}

@keyframes bounce-demo {
    0%, 100% { top: 10px; left: 10px; }
    25% { top: 50px; left: 80px; }
    50% { top: 10px; left: 80px; }
    75% { top: 50px; left: 10px; }
}

#startScreen h2 {
    font-size: 1.2rem;
    color: #00ff88;
    margin-bottom: 10px;
}

.instructions {
    color: #aaa;
    margin-bottom: 15px;
    font-size: 0.9rem;
    max-width: 350px;
}

.control-hint {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    border-radius: 8px;
    padding: 10px 20px;
    margin-bottom: 15px;
}

.control-hint p {
    font-size: 0.85rem;
    margin: 3px 0;
}

/* High Scores Panel */
.high-scores-panel {
    background: rgba(0, 255, 136, 0.05);
    border: 2px solid #00ff88;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 20px;
    min-width: 250px;
}

.high-scores-panel h3 {
    font-family: 'Orbitron', sans-serif;
    color: #00ff88;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

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

.high-scores-panel li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    font-size: 0.8rem;
}

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

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

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

/* Buttons */
.play-btn {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #000;
    border: none;
    padding: 12px 35px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    font-family: 'Orbitron', sans-serif;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
}

.play-btn:active {
    transform: scale(0.98);
}

.menu-btn {
    display: inline-block;
    background: transparent;
    color: #00ff88;
    border: 2px solid #00ff88;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    margin-left: 15px;
}

.menu-btn:hover {
    background: #00ff88;
    color: #000;
}

/* Game Screen */
#gameScreen {
    padding: 10px;
}

.wall-mode-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

#wallModeText {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: #00ff88;
    padding: 5px 15px;
    background: rgba(0, 255, 136, 0.2);
    border-radius: 5px;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #888;
    border-radius: 5px;
    padding: 5px 12px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-btn:hover {
    border-color: #00ff88;
    color: #00ff88;
}

#gameCanvas {
    display: block;
    margin: 0 auto;
    border: 3px solid #00ff88;
    border-radius: 5px;
    background: #0a0a0a;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
    cursor: crosshair;
    touch-action: none;
    max-width: 100%;
    height: auto;
}

/* Level Complete Screen */
#levelCompleteScreen h2 {
    font-family: 'Orbitron', sans-serif;
    color: #00ff88;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.level-stats {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00ff88;
    border-radius: 10px;
    padding: 15px 30px;
    margin-bottom: 20px;
}

.level-stats p {
    font-size: 1.1rem;
    margin: 5px 0;
}

.level-stats span {
    color: #00ff88;
    font-weight: 700;
}

/* Game Over Screen */
#gameOverTitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

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

.final-stat {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00ff88;
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 110px;
}

.final-value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #00ff88;
}

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

/* New High Score */
.new-high-score {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 204, 106, 0.1) 100%);
    border: 2px solid #00ff88;
    border-radius: 10px;
    padding: 15px 25px;
    margin-bottom: 20px;
    animation: glow-green 1s ease-in-out infinite;
}

@keyframes glow-green {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.6); }
}

.new-high-score p {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #00ff88;
    margin-bottom: 12px;
}

.new-high-score input {
    background: #0a0a0a;
    border: 2px solid #00ff88;
    border-radius: 5px;
    padding: 10px 15px;
    color: #00ff88;
    font-size: 1rem;
    width: 150px;
    text-align: center;
    margin-right: 10px;
}

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

.save-btn {
    background: #00ff88;
    color: #000;
    border: none;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn:hover {
    background: #00cc6a;
    transform: translateY(-2px);
}

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

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

    .stats-bar {
        gap: 8px;
    }

    .stat-item {
        padding: 5px 10px;
    }

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

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