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

body {
    background: #1a1a1a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    gap: 20px;
}

header {
    text-align: center;
    max-width: 640px;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

h1 {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
}

#langSelect {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #333;
    color: #e0e0e0;
    font-size: 0.85rem;
    cursor: pointer;
}

.description {
    margin-top: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #aaa;
}

canvas {
    border: 1px solid #333;
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    padding: 10px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #333;
    color: #e0e0e0;
    transition: background 0.2s;
}

button:hover {
    background: #444;
}

#playPauseBtn {
    background: #00aa55;
    color: #fff;
}

#playPauseBtn:hover {
    background: #00cc66;
}

#godModeBtn {
    background: #aa2200;
    color: #fff;
}

#godModeBtn:hover {
    background: #cc3300;
}

#godModeOffBtn {
    background: #aa2200;
    color: #fff;
}

#godModeOffBtn:hover {
    background: #cc3300;
}

#catastropheBtn {
    background: #6622aa;
    color: #fff;
}

#catastropheBtn:hover {
    background: #7733bb;
}

#catastropheOffBtn {
    background: #6622aa;
    color: #fff;
}

#catastropheOffBtn:hover {
    background: #7733bb;
}

#bombMessage {
    font-size: 1.3rem;
    font-weight: 700;
    color: #cc44ff;
    text-align: center;
    animation: bombPulse 0.6s ease-in-out infinite alternate;
}

@keyframes bombPulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 16px;
    text-align: center;
    min-width: 100px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #00ff88;
}

.legend {
    max-width: 480px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px 20px;
}

.legend h3 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.legend ul {
    list-style: none;
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.7;
}

.legend li::before {
    content: "· ";
    color: #00ff88;
}

@media (max-width: 640px) {
    body {
        padding: 16px 8px;
        gap: 14px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .description {
        font-size: 0.85rem;
    }

    button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .stat {
        min-width: 80px;
        padding: 8px 10px;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .legend {
        padding: 12px 14px;
    }
}
