/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0d1b2a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #fff;
    user-select: none;
}

/* ═══════════════════════════════════════════
   TITEL
═══════════════════════════════════════════ */
h1 {
    font-size: 1.9em;
    color: #ff4500;
    text-shadow: 0 0 15px rgba(255, 69, 0, 0.6);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

/* ═══════════════════════════════════════════
   HUD
═══════════════════════════════════════════ */
#hud {
    width: 800px;
    background: #16253a;
    border: 1px solid #1e3a5a;
    border-radius: 8px;
    padding: 8px 16px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.hud-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.hud-label {
    font-size: 11px;
    color: #7a9ab5;
    white-space: nowrap;
    min-width: 80px;
}

/* ── Balken ── */
.bar-bg {
    flex: 1;
    height: 14px;
    background: #0a1520;
    border-radius: 7px;
    border: 1px solid #1e3a5a;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 7px;
    transition: width 0.15s;
}

#waterBar  { background: linear-gradient(90deg, #22ccff, #0088cc); }
#healthBar { background: linear-gradient(90deg, #44ff88, #00bb44); }
#fireBar   { background: linear-gradient(90deg, #ff6600, #ff0000); }

/* ── Textanzeigen ── */
#timerDisplay {
    font-weight: bold;
    color: #ffd700;
    font-size: 1.05em;
    white-space: nowrap;
}

#fireCount {
    font-size: 0.9em;
    color: #ff8844;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════
   CANVAS-WRAPPER
═══════════════════════════════════════════ */
#canvasWrap {
    position: relative;
    border: 3px solid #cc3300;
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(255, 69, 0, 0.25),
        0 0 80px rgba(255, 69, 0, 0.1);
}

canvas {
    display: block;
}

/* ═══════════════════════════════════════════
   OVERLAY (Start / Sieg / Niederlage)
═══════════════════════════════════════════ */
#overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 20, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
}

#overlay h2 {
    font-size: 2.2em;
    text-align: center;
}

#overlay p {
    color: #8aabcb;
    text-align: center;
    max-width: 460px;
    line-height: 1.7;
    font-size: 0.95em;
}

/* ── Ergebnis-Box ── */
#overlay .stat-box {
    background: #16253a;
    border: 1px solid #1e3a5a;
    border-radius: 8px;
    padding: 10px 20px;
    text-align: center;
}

#overlay .stat-box .big {
    font-size: 2em;
    color: #ffd700;
    font-weight: bold;
}

#overlay .stat-box .label {
    font-size: 0.85em;
    color: #7a9ab5;
}

/* ── Overlay-Button ── */
#overlay button {
    background: linear-gradient(135deg, #ff4500, #cc2200);
    color: #fff;
    border: none;
    padding: 13px 36px;
    font-size: 1.05em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.4);
    letter-spacing: 0.5px;
    transition: transform 0.1s, box-shadow 0.1s;
}

#overlay button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.5);
}

/* ═══════════════════════════════════════════
   STEUERUNGSLEISTE
═══════════════════════════════════════════ */
#ctrlBar {
    width: 800px;
    background: #16253a;
    border: 1px solid #1e3a5a;
    border-radius: 8px;
    padding: 8px 16px;
    margin-top: 6px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #7a9ab5;
}

.ctrl {
    display: flex;
    align-items: center;
    gap: 5px;
}

kbd {
    background: #0a1520;
    border: 1px solid #1e3a5a;
    border-radius: 4px;
    padding: 1px 6px;
    color: #cce;
    font-size: 11px;
    font-family: monospace;
}

.player {
  width: 22px;
  height: 22px;
  background: url(firefighter.svg) no-repeat;
  background-size: 88px 22px;
  animation: walk 0.5s steps(4) infinite;
}

@keyframes walk {
  from { background-position: 0 0; }
  to   { background-position: -88px 0; }
}

.overlay-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#overlayFirefighter {
    image-rendering: pixelated;
}

#overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-card {
    background: rgba(0,0,0,0.7);
    border: 2px solid #333;
    border-radius: 16px;
    padding: 24px 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255,80,0,0.3);
}

.overlay-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 28px;
}

.subtitle {
    opacity: 0.8;
    margin-bottom: 20px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: #333;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: scale(1.05);
    background: #444;
}

.btn.primary {
    background: #ff3300;
    box-shadow: 0 0 10px rgba(255,60,0,0.6);
}

.btn.primary:hover {
    background: #ff5500;
    box-shadow: 0 0 20px rgba(255,80,0,0.9);
}

#menuBg {
    margin-top: 20px;
    border-radius: 10px;
}