/* ── Tower Defense (Neubau) — Oberfläche ─────────────────────────────────────────────────────────────────────────────────
   Startbildschirm-Norm sb-* wie games/muehle und games/artillerie (Baustein _spiel/anleitung.js setzt darauf auf).
   Farbwelt aus dem Zielbild: Waldgrün-Glas, Pergament, Gold. Schriften nur vom Archiv https://fonts.hirsing.eu/ (Wiki [schriften]).
   Die Bühne #feld hat das feste Format des gemalten Bodens (1920:1088) und wird mittig eingepasst; alle Anzeigen liegen darin. */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('https://fonts.hirsing.eu/playfair-dispplay-v40-latin/playfair-display-v40-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 900; font-display: swap;
  src: url('https://fonts.hirsing.eu/playfair-dispplay-v40-latin/playfair-display-v40-latin-900italic.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('https://fonts.hirsing.eu/lato-v25-latin/lato-v25-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('https://fonts.hirsing.eu/lato-v25-latin/lato-v25-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 900; font-display: swap;
  src: url('https://fonts.hirsing.eu/lato-v25-latin/lato-v25-latin-900.woff2') format('woff2'); }
:root {
  --serif: 'Playfair Display', Georgia, serif; --sans: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --glas: rgba(12, 24, 10, 0.78); --glas-hell: rgba(255, 255, 255, 0.07); --glas-dicht: rgba(10, 20, 8, 0.92);
  --linie: rgba(226, 196, 128, 0.28); --linie-hell: rgba(246, 222, 160, 0.55);
  --text: #f6efe0; --leise: #c2b48f; --gold: #e3b45f; --gold-hell: #ffe3a3; --rot: #e8553a; --gruen: #8fd36b; --eis: #8ed9ff;
  --messing: linear-gradient(180deg, #ffe6b0 0%, #e2b56b 40%, #b07a39 72%, #8a5a26 100%);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b150a; color: var(--text); font-family: var(--sans); }
body { touch-action: none; user-select: none; -webkit-user-select: none; background: radial-gradient(ellipse at center, #16290f 0%, #0b150a 70%); }
button { font: inherit; color: inherit; cursor: pointer; }
.versteckt { display: none !important; }
.tafel, .sb-karte { touch-action: pan-y; }
.ebene { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }

/* ── Bühne ─────────────────────────────────────────────────────────────── */
#feld { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(100vw, calc(100dvh * 1920 / 1088)); aspect-ratio: 1920 / 1088; overflow: hidden; }
#buehne { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#etiketten { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hp { position: absolute; width: 34px; height: 5px; margin-left: -17px; background: rgba(0, 0, 0, 0.55); border-radius: 3px; overflow: hidden; }
.hp i { display: block; height: 100%; background: linear-gradient(90deg, #ff6a4a, #ffd25a 70%, #8fd36b); transform-origin: left; }
.hp.boss { width: 70px; height: 8px; margin-left: -35px; }
/* Countdown-Ring über einem drehenden Sniper (main.js drehPflegen): --p = Restanteil, Zahl = Restsekunden */
.dreh { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold-hell) var(--p, 100%), rgba(0, 0, 0, 0.45) 0); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.dreh::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: rgba(20, 14, 6, 0.85); }
.dreh b { position: relative; font-size: 13px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000; }
.zahl { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 16px; color: var(--gold-hell); text-shadow: 0 1px 3px #000, 0 0 10px rgba(255, 200, 80, 0.5); animation: zahl 1.3s ease-out forwards; white-space: nowrap; }
.zahl.rot { color: #ff8b70; }
.zahl.gross { font-size: 24px; }
@keyframes zahl { 0% { opacity: 0; translate: 0 10px; } 15% { opacity: 1; } 100% { opacity: 0; translate: 0 -46px; } }

/* ── Anzeigen im Spiel ────────────────────────────────────────────────── */
#hud { position: absolute; inset: 0; pointer-events: none; font-size: 15px; }
#hud > * { pointer-events: auto; }
#hud .meldung, #hud .kommt, #etiketten { pointer-events: none; }
.hud-links { position: absolute; left: 14px; top: 58px;   /* unter der GameZone-Pille (oben links, ~44 px) */ display: flex; flex-direction: column; gap: 4px; }
.hud-level { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--gold-hell); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7); }
.hud-welle { font-weight: 700; color: var(--text); text-shadow: 0 1px 4px #000; }
.kommt { display: flex; flex-wrap: wrap; gap: 5px; max-width: 380px; margin-top: 4px; }
.kommt .chip { background: var(--glas); border: 1px solid var(--linie); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--leise); }
.kommt .chip b { color: var(--text); }
.kommt .chip.boss { border-color: var(--rot); color: #ffb3a6; }
.hud-mitte { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; gap: 10px; }
.wert { display: flex; align-items: center; gap: 7px; background: var(--glas); border: 1px solid var(--linie); border-radius: 999px; padding: 6px 16px 6px 12px; font-size: 18px; font-weight: 900; backdrop-filter: blur(8px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
.wert.leben .symbol { color: #ff6a5a; } .wert.gold .symbol { color: var(--gold); }
.wert .symbol { font-size: 16px; }
.wert.schlag { animation: schlag .4s; }
@keyframes schlag { 0% { transform: scale(1); } 30% { transform: scale(1.18); background: rgba(160, 30, 20, 0.8); } 100% { transform: scale(1); } }
.hud-rechts { position: absolute; right: 14px; top: 10px; display: flex; gap: 8px; }
.rund { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--linie); background: var(--glas); color: var(--text); font-weight: 900; font-size: 15px; backdrop-filter: blur(8px); position: relative; display: grid; place-items: center; }
.rund.an { background: linear-gradient(180deg, #ffe6b0, #c58a3c); color: #2a1a06; }
.rund.frost span { font-size: 20px; color: var(--eis); }
.rund.frost i { position: absolute; right: 3px; bottom: 1px; font-style: normal; font-size: 10px; color: var(--gold-hell); pointer-events: none; }
.rund.frost.leer { opacity: 0.4; }
.rund.frost.bereit { box-shadow: 0 0 14px rgba(140, 220, 255, 0.5); border-color: var(--eis); }
.meldung { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-family: var(--serif); font-weight: 600; font-size: 34px; color: var(--gold-hell); text-shadow: 0 2px 8px #000, 0 0 24px rgba(255, 200, 100, 0.4); opacity: 0; transition: opacity .25s; white-space: nowrap; }
.meldung.an { opacity: 1; }
.meldung.klein { font-size: 22px; }
/* Turmleiste unten Mitte: Karten mit Namen, Preis, Größe; gewählt = an; zu teuer = matt */
.turmleiste { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 8px; }
.turmkarte { width: 176px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--linie); background: var(--glas); backdrop-filter: blur(8px); text-align: left; display: grid; gap: 2px; transition: transform .12s, border-color .12s; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.turmkarte b { font-size: 14px; }
.turmkarte .preis { color: var(--gold-hell); font-weight: 900; font-size: 15px; }
.turmkarte .klein { color: var(--leise); font-size: 11px; }
.turmkarte .taste { position: absolute; right: 8px; top: 6px; font-size: 10px; color: var(--leise); border: 1px solid var(--linie); border-radius: 4px; padding: 0 4px; }
.turmkarte { position: relative; padding-left: 64px; min-height: 64px; }
.turmkarte img { position: absolute; left: 10px; top: 50%; width: 50px; height: 50px; transform: translateY(-50%); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.ziel-marke { position: absolute; transform: translate(-50%, -100%); background: var(--glas-dicht); border: 1px solid var(--linie-hell); border-radius: 10px; padding: 4px 7px; display: grid; gap: 3px; justify-items: center; pointer-events: none; }
.ziel-marke .symbol { width: 64px; height: 24px; display: block; } .ziel-marke .stufen { width: 60px; height: 12px; }
.panel-ziel button .symbol { width: 44px; height: 16px; display: block; margin: 0 auto 2px; } .panel-kopf .stufen { width: 60px; height: 12px; vertical-align: middle; margin-right: 6px; }
.an-zeichen { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
.an-ziele { display: flex; gap: 8px; margin: 6px 0; } .an-zielkarte { flex: 1; background: rgba(0, 0, 0, 0.25); border-radius: 8px; padding: 6px; text-align: center; font-size: 12px; color: var(--text); } .an-zielkarte .symbol { width: 40px; height: 30px; display: block; margin: 0 auto 2px; }
.turmkarte.an { border-color: var(--gold-hell); transform: translateY(-4px); box-shadow: 0 0 0 2px rgba(255, 227, 163, 0.35), 0 10px 24px rgba(0, 0, 0, 0.45); }
.turmkarte.teuer { opacity: 0.55; }
.turmkarte .farbe { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; }
.turmkarte[data-typ="pfeil"] .farbe { background: #8fd36b; } .turmkarte[data-typ="eis"] .farbe { background: #7fd8ff; } .turmkarte[data-typ="sniper"] .farbe { background: #f2c660; } .turmkarte[data-typ="kanone"] .farbe { background: #ff9a5c; }
.welle-knopf { position: absolute; right: 14px; bottom: 14px; min-width: 210px; padding: 10px 18px; border: 0; border-radius: 16px; background: var(--messing); color: #2a1a06; text-align: left; display: grid; gap: 1px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5); overflow: hidden; }
.welle-knopf b, .welle-knopf span { position: relative; }
.bonus-balken { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.35); transition: width .25s linear; pointer-events: none; }
.welle-knopf b { font-size: 16px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.welle-knopf span { font-size: 12px; font-weight: 700; opacity: 0.85; }
.welle-knopf:disabled { opacity: 0.45; cursor: default; }
.welle-knopf.vorziehen { background: linear-gradient(180deg, #ffd9a0, #e07a3a 55%, #a84a1e); }
.ziel-marke .zeichen { width: 40px; height: 30px; } .panel-ziel button .zeichen { width: 32px; height: 24px; display: block; margin: 0 auto 2px; }
.welle-knopf.puls { animation: puls 1.4s infinite; }
@keyframes puls { 0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(255, 220, 140, 0.6); } 50% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 10px rgba(255, 220, 140, 0); } }
/* Turmkarte (gewählter Turm) links unten */
.panel { position: absolute; left: 14px; bottom: 14px; width: 310px; background: var(--glas-dicht); border: 1px solid var(--linie); border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); display: grid; gap: 8px; }
.panel-kopf { display: flex; align-items: baseline; gap: 8px; }
.panel-kopf b { font-family: var(--serif); font-size: 19px; color: var(--gold-hell); }
.panel-kopf span { color: var(--leise); font-size: 13px; flex: 1; }
.panel-zu { background: none; border: 0; color: var(--leise); font-size: 20px; line-height: 1; padding: 0 4px; }
.panel-info { margin: 0; font-size: 12px; color: var(--leise); line-height: 1.35; }
.panel-werte { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13px; }
.panel-werte span { color: var(--leise); } .panel-werte b { text-align: right; }
.panel-werte b em { font-style: normal; color: var(--gruen); font-size: 11px; margin-left: 4px; }
.panel-ziel, .panel-dreh { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--leise); }
.panel-ziel button, .panel-dreh button { flex: 1; padding: 5px 2px; min-width: 0; border: 1px solid var(--linie); border-radius: 8px; background: var(--glas-hell); font-size: 11px; font-weight: 700; overflow: hidden; }
.panel-ziel button.an { background: var(--messing); color: #2a1a06; border-color: transparent; }
.panel-dreh button { flex: 0 0 44px; font-size: 18px; }
.panel-knoepfe { display: grid; gap: 6px; }
.panel .knopf-gross { margin: 0; padding: 10px; font-size: 15px; }
.panel .knopf-leise { margin: 0; padding: 8px; font-size: 13px; }
.panel .knopf-gross:disabled { opacity: 0.5; cursor: default; }
#feld.bauen #buehne { cursor: crosshair; }
.laden { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--glas); border: 1px solid var(--linie); border-radius: 999px; padding: 8px 18px; font-size: 14px; color: var(--leise); z-index: 30; }

/* ── Startbildschirm (Norm sb-*) ───────────────────────────────────────── */
.sb { justify-content: flex-start; padding-top: 60px; padding-left: clamp(16px, 6vw, 90px);
  background: linear-gradient(90deg, rgba(6, 14, 6, 0.82) 0%, rgba(6, 14, 6, 0.45) 45%, rgba(6, 14, 6, 0) 72%); }
.sb-karte { width: min(520px, 100%); max-height: 100%; overflow-y: auto; padding: 8px 4px; scrollbar-width: none; }
.sb-titel { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 900; font-size: clamp(40px, 4.4vw, 68px); line-height: 1; white-space: nowrap; letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff6e0 0%, #ffd98a 45%, #c98a36 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(255, 200, 90, 0.35)); }
.sb-unterzeile { margin: 12px 0 24px; color: var(--gold-hell); font-size: clamp(14px, 1.6vw, 18px); line-height: 1.4; }
.sb-start { width: 100%; margin: 10px 0 14px; padding: 16px; border: 0; border-radius: 16px; font-size: 22px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--messing); color: #2a1a06; box-shadow: 0 8px 30px rgba(226, 181, 107, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.sb-start:active { transform: translateY(1px); }
.sb-hilfe { background: var(--glas); border: 1px solid var(--linie); border-radius: 14px; padding: 10px 14px; font-size: 14px; color: var(--leise); backdrop-filter: blur(8px); margin-bottom: 8px; }
.sb-hilfe summary { color: var(--text); font-weight: 700; cursor: pointer; }
/* Levelliste Angemeldeter (main.js levelListeBauen): eine scrollbare Zeile Nummernknöpfe, das gewählte Level golden */
.sb-gruppe { margin: 0 0 12px; }
.sb-label { display: block; margin: 0 0 6px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--leise); }
.level-liste { display: flex; gap: 6px; overflow-x: auto; padding: 4px; border-radius: 999px; border: 1px solid var(--linie); background: var(--glas); scrollbar-width: none; }
.level-liste button { flex: 0 0 auto; min-width: 40px; min-height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 999px; background: rgba(255, 240, 210, 0.06); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.level-liste button.an { background: var(--messing); color: #2a1a06; }
.sb-hilfe p { margin: 8px 0 0; line-height: 1.45; }
.sb-sprache { margin-top: 12px; background: none; border: 1px solid var(--linie); border-radius: 999px; padding: 6px 14px; color: var(--leise); font-size: 13px; }
.gz-info-text { margin-top: 8px; } .gz-info-text h2 { font-size: 16px; margin: 10px 0 4px; color: var(--text); } .gz-info-text h3, .gz-info-text h4 { font-size: 14px; margin: 10px 0 2px; color: var(--text); }
.gz-info-text ul { margin: 4px 0 0; padding-left: 18px; }
html[lang="de"] .gz-info [lang="en"], html[lang="en"] .gz-info [lang="de"] { display: none; }
.drehen-an #start .sb-karte { visibility: hidden; }

/* ── Tafeln (Ende, Pause, Drehen) ──────────────────────────────────────── */
.tafel { width: min(460px, 100%); max-height: 100%; overflow-y: auto; background: var(--glas-dicht); border: 1px solid var(--linie); border-radius: 20px; padding: 24px; backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); text-align: center; }
.tafel h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--gold-hell); }
.tafel p { color: var(--leise); line-height: 1.45; }
.bilanz { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 4px 12px; margin: 10px auto 4px; font-size: 13px; text-align: left; max-width: 360px; }
.bilanz span { color: var(--leise); } .bilanz b { text-align: right; color: var(--gold-hell); }
.sterne { font-size: 34px; letter-spacing: 6px; color: var(--gold); margin: 6px 0 2px; text-shadow: 0 0 14px rgba(255, 200, 80, 0.5); }
.sterne .aus { color: rgba(255, 255, 255, 0.18); text-shadow: none; }
.knopf-gross { display: block; width: 100%; margin-top: 14px; padding: 14px; border: 0; border-radius: 14px; font-size: 18px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; background: var(--messing); color: #2a1a06; }
.knopf-leise { display: block; width: 100%; margin-top: 10px; padding: 11px; background: var(--glas-hell); border: 1px solid var(--linie); border-radius: 12px; }
.drehen-bild { font-size: 54px; color: var(--gold); }

/* ── Handy ─────────────────────────────────────────────────────────────── */
/* Enge Spielfläche (Handy): Turmkarte oben links statt unten, Turmleiste linksbündig, Leveltext unter der größeren Pille */
#feld.eng .hud-links { top: 96px; }
#feld.eng .turmleiste { left: 8px; transform: none; }
#feld.eng .panel { top: 150px; bottom: auto; left: 8px; width: 300px; }   /* vier Zielknöpfe und Werte mit Vorschau brauchen die Breite */
#feld.eng .welle-knopf { min-width: 170px; }
/* Handy: die Anzeigen im #hud skaliert main.js per zoom mit der Breite der Spielfläche; hier nur, was zusätzlich weg kann */
@media (max-width: 760px), (max-height: 520px) {
  .turmkarte .taste { display: none; } .panel-info { display: none; }
  .sb-titel { font-size: 44px; } .sb-unterzeile { margin: 6px 0 12px; } .sb-start { padding: 11px; margin: 6px 0 8px; font-size: 18px; }
}

/* ── Anleitung (bebildert, js/anleitung-inhalt.js) ─────────────────────── */
.sb-hilfe .an-abschnitt { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--linie); }
.sb-hilfe .an-abschnitt h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 16px; color: var(--gold-hell); }
.an-karte { display: flex; gap: 10px; margin: 8px 0; align-items: flex-start; }
.an-bild { width: 72px; height: 72px; flex: 0 0 72px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
.an-text { min-width: 0; flex: 1; } .an-text b { color: var(--text); } .an-text p { margin: 3px 0 0; }
.an-klein { font-size: 12px; color: var(--leise); }
.an-werte { border-collapse: collapse; margin-top: 5px; font-size: 11px; width: 100%; }
.an-werte th, .an-werte td { padding: 1px 5px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.an-werte th { color: var(--leise); font-weight: 400; } .an-werte td:first-child, .an-werte th:first-child { text-align: left; }
.an-skizze { width: 100%; max-width: 300px; height: auto; display: block; margin: 4px 0 6px; background: rgba(0, 0, 0, 0.25); border-radius: 8px; }
