/* ===== BRAURAUSCH — Bier-Optik, Mobile First ===== */
:root {
  --bg: #1a120a;
  --bg2: #241a0f;
  --card: #2e2213;
  --card2: #3a2c19;
  --border: #52401f;
  --amber: #f5a623;
  --amber2: #ffc857;
  --foam: #fdf6e3;
  --text: #f0e6d2;
  --muted: #b09a72;
  --green: #7cb342;
  --red: #e05a4e;
  --nav-h: 60px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
.loading { text-align: center; padding: 40vh 0; font-size: 22px; }

/* ---- Auth ---- */
.auth-wrap {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; gap: 8px;
  background: radial-gradient(circle at 50% 20%, #33240f 0%, var(--bg) 70%);
}
.auth-logo { font-size: 64px; }
.auth-title { font-size: 34px; font-weight: 800; color: var(--amber2); letter-spacing: 1px; }
.auth-sub { color: var(--muted); margin-bottom: 18px; text-align: center; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.auth-card input, .auth-card textarea {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 14px; color: var(--text); font-size: 16px; width: 100%;
}
.auth-card textarea { font-family: inherit; line-height: 1.4; resize: vertical; min-height: 66px; }
.auth-card input:focus, .auth-card textarea:focus { outline: none; border-color: var(--amber); }
/* ✋ „Wer bist du?" einer Zugangsanfrage auf der Landeseite des Spielleiters */
.auth-quote {
  font-size: 14.5px; line-height: 1.45; color: var(--foam); font-style: italic; text-align: center;
  background: var(--bg2); border-radius: 10px; padding: 10px 12px; white-space: pre-line; overflow-wrap: anywhere;
}
.auth-switch { color: var(--muted); text-align: center; margin-top: 6px; font-size: 14px; }
.auth-switch a { color: var(--amber2); cursor: pointer; text-decoration: underline; }
/* ✉️ Konto-Abläufe: Vergessen, Bestätigen, neues Passwort */
.auth-head { font-size: 18px; font-weight: 800; color: var(--amber2); text-align: center; line-height: 1.3; }
.auth-note { font-size: 14px; color: var(--text); line-height: 1.45; text-align: center; }
.auth-note.small { font-size: 12.5px; color: var(--muted); }
.auth-big { font-size: 46px; text-align: center; line-height: 1; }
.auth-forgot { text-align: center; font-size: 13.5px; margin-top: -2px; }
.auth-forgot a, .link { color: var(--amber2); cursor: pointer; text-decoration: underline; }
.auth-card .btn:disabled { opacity: .6; }
.auth-card .pw-toggle input { padding: 0; flex: none; width: 18px; height: 18px; }
.auth-legal { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-decoration: underline; }
.auth-namebox {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 2px dashed var(--amber); border-radius: 12px; padding: 10px; background: var(--bg2);
}
.auth-namebox span { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.auth-namebox b { font-size: 22px; color: var(--foam); word-break: break-all; }
/* Hinweiszeile „E-Mail hinterlegen/bestätigen" unter der Kopfzeile — bewusst ruhig, nicht pulsierend */
.acct-hint {
  display: block; width: calc(100% - 24px); margin: 10px 12px 0; text-align: left; cursor: pointer;
  background: #3a2a0c; border: 1px solid var(--amber); color: var(--foam);
  border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13.5px; line-height: 1.4;
}
.acct-hint u { color: var(--amber2); white-space: nowrap; }
.acct-deadline {
  margin-top: 10px; font-size: 12.5px; line-height: 1.4; color: var(--amber2);
  background: var(--bg2); border-radius: 8px; padding: 7px 10px;
}

/* ---- Buttons ---- */
.btn {
  background: linear-gradient(180deg, var(--amber2), var(--amber));
  color: #241500; border: none; border-radius: 10px; padding: 12px 16px;
  font-size: 16px; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { background: var(--card2); color: var(--muted); cursor: default; }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 8px; }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--red); color: #fff; }

/* ---- Header ---- */
.top {
  position: sticky; top: 0; z-index: 20; background: rgba(26,18,10,.96);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--border);
  padding: 8px 12px calc(8px);
  padding-top: calc(8px + env(safe-area-inset-top));
}
.top-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vname { font-weight: 800; color: var(--amber2); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vswitch {
  background: var(--card); color: var(--amber2); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 6px; font-size: 14px; font-weight: 700; max-width: 100%;
}
.vcoords { color: var(--muted); font-size: 12px; }
.res-bar { display: flex; gap: 6px; margin-top: 7px; }
.res {
  flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 9px;
  padding: 5px 8px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums;
}
.res b { display: block; font-size: 14px; }
.res.full b { color: var(--red); }
.res small { color: var(--muted); font-size: 10px; }
.seats { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }

/* ---- Warnbanner ---- */
.alert {
  background: #4a1610; border: 1px solid var(--red); color: #ffd9d4;
  border-radius: 10px; padding: 10px 12px; margin: 10px 12px 0; font-size: 14px;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { border-color: #ff8a7a; } }

/* ---- Inhalt ---- */
.content { padding: 12px 12px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.h2 { font-size: 18px; font-weight: 800; color: var(--amber2); margin: 14px 0 8px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin-bottom: 10px;
}
.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; min-width: 0; }
.b-icon { font-size: 28px; width: 38px; text-align: center; }
.b-name { font-weight: 700; }
.b-level { color: var(--amber2); font-weight: 700; }
.b-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.b-cost { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.b-cost .no { color: var(--red); font-weight: 700; }
.queue-item { display: flex; justify-content: space-between; padding: 8px 10px; background: var(--bg2); border-radius: 8px; margin-top: 6px; font-size: 14px; }
.countdown { color: var(--amber2); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- Rekrutierung ---- */
.rec-input { display: flex; gap: 8px; margin-top: 8px; }
.rec-input input {
  width: 90px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 10px; color: var(--text); font-size: 16px; text-align: center;
}
.unit-stats { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }

/* ---- Karte ---- */
.map-nav { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 10px; }
.map-grid { display: grid; gap: 3px; touch-action: manipulation; }
.tile {
  aspect-ratio: 1; border-radius: 6px; background: #223012;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(12px, 4.5vw, 22px); cursor: pointer; border: 1px solid transparent;
  position: relative;
}
.tile.grass { background: #26350f; }
.tile.grass2 { background: #2c3a14; }
.tile.mine { border-color: var(--amber); background: #4a3410; }
.tile.enemy { background: #47231b; }
.tile.barb { background: #3a3325; }
.tile-coord { position: absolute; bottom: 1px; right: 3px; font-size: 8px; color: rgba(255,255,255,.25); }

/* ---- Modal ---- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px 16px 0 0;
  width: 100%; max-width: 640px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 85dvh; overflow-y: auto;
}
.modal h3 { color: var(--amber2); margin-bottom: 4px; }
.attack-units { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.attack-row { display: flex; align-items: center; gap: 10px; }
.attack-row input {
  width: 80px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; color: var(--text); font-size: 16px; text-align: center;
}
.attack-row .have { color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }

/* ---- Berichte ---- */
.report { cursor: pointer; }
.report.unread { border-color: var(--amber); }
.report-title { font-weight: 700; font-size: 14px; }
.report-date { color: var(--muted); font-size: 12px; margin-top: 2px; }
.report-detail table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.report-detail th, .report-detail td { padding: 4px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.report-detail th:first-child, .report-detail td:first-child { text-align: left; }
.win { color: var(--green); font-weight: 800; }
.lose { color: var(--red); font-weight: 800; }

/* ---- Rangliste ---- */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.rank-pos { font-size: 18px; font-weight: 800; color: var(--amber2); width: 34px; }
.rank-pts { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Bottom-Nav ---- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: rgba(26,18,10,.97); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(6px);
}
.nav button {
  flex: 1; background: none; border: none; color: var(--muted);
  padding: 9px 0 7px; font-size: 9.5px; cursor: pointer; touch-action: manipulation;
  display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative;
  min-width: 0; white-space: nowrap;
}
.nav button .ni { font-size: 20px; }
.nav button.active { color: var(--amber2); }
.nav .badge {
  position: absolute; top: 4px; right: calc(50% - 22px); background: var(--red); color: #fff;
  border-radius: 9px; font-size: 10px; min-width: 17px; padding: 1px 4px; font-weight: 700;
}
.nav .badge.dot {
  min-width: 0; width: 10px; height: 10px; padding: 0; border: 1.5px solid var(--bg);
  box-shadow: 0 0 4px rgba(224, 90, 78, .9);
}

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--foam); color: #241500; padding: 11px 18px; border-radius: 12px;
  font-weight: 700; font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.5);
  max-width: 90vw; text-align: center;
}
.toast.err { background: var(--red); color: #fff; }

.muted { color: var(--muted); }
.mt { margin-top: 10px; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* ===== V2: Optik-Politur ===== */
body {
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, #33240f 0%, transparent 60%),
    var(--bg);
}
.card {
  background: linear-gradient(180deg, #332614, #2b1e10);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.btn { box-shadow: 0 2px 0 #9c6a12, 0 4px 10px rgba(0, 0, 0, .35); }
.btn:disabled { box-shadow: none; }
.btn.ghost { box-shadow: none; }
.h2 { text-shadow: 0 2px 6px rgba(0, 0, 0, .4); }

/* Füllstands-Balken in der Ressourcenanzeige */
.res .bar { height: 3px; background: rgba(0, 0, 0, .45); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.res .bar i { display: block; height: 100%; background: var(--amber); border-radius: 2px; transition: width .5s linear; }
.res.full .bar i { background: var(--red); }

/* ---- Braukeller-Szene ---- */
.scene-card {
  padding: 0 !important; overflow: hidden;
  height: clamp(340px, 62vh, 560px); /* gleiche Bildhöhe wie die Karte */
}
.scene { display: block; width: 100%; height: 100%; }
.bld { cursor: pointer; }
.bld:active .art { filter: brightness(1.25); }
.bld.locked .art { opacity: .42; filter: saturate(.35); }
/* Namens-Plaketten: rendern auf iOS und Android identisch (kein Text-Stroke-Trick) */
.bld-plate {
  fill: rgba(16, 10, 4, .66);
  stroke: rgba(255, 200, 87, .28); stroke-width: 1;
}
.bld-label {
  font-family: -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 16.5px; font-weight: 700; letter-spacing: .2px;
  fill: #f7eed9;
}
.bld.locked .bld-plate { fill: rgba(16, 10, 4, .45); stroke: rgba(140, 120, 80, .3); }
.bld.locked .bld-label { fill: #a99878; }
.badge circle { fill: #1a120a; stroke: var(--amber); stroke-width: 2.5; }
.bld.locked .badge circle { stroke: #6e5c3a; }
.badge text {
  fill: var(--amber2); text-anchor: middle;
  font-family: -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 15px; font-weight: 800;
}
.steam { opacity: .55; animation: steam 3.2s linear infinite; }
.steam.s2 { animation-delay: 1.1s; }
.steam.s3 { animation-delay: 2.2s; }
@keyframes steam {
  0% { transform: translateY(0); opacity: .55; }
  100% { transform: translateY(-30px); opacity: 0; }
}
.hammer { font-size: 26px; animation: hammer .9s ease-in-out infinite; }
@keyframes hammer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.constructing .art { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { filter: brightness(1.3); } }

/* ---- Zoombare Weltkarte ---- */
.map-wrap { position: relative; padding: 0 !important; overflow: hidden; }
#wmap { display: block; width: 100%; touch-action: none; cursor: grab; }
#wmap:active { cursor: grabbing; }
.map-hud {
  position: absolute; right: 10px; top: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.hud-btn {
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(26, 18, 10, .88);
  color: var(--foam); font-size: 20px; font-weight: 700; cursor: pointer;
  touch-action: manipulation;
}
.hud-btn:active { background: var(--card2); }
.map-coords {
  position: absolute; left: 10px; top: 10px;
  background: rgba(26, 18, 10, .82); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 10px; font-size: 12.5px;
  color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none;
}

/* Klickbare Rangliste */
.rank-row { cursor: pointer; border-bottom: 1px solid rgba(82, 64, 31, .4); }
.rank-row:last-child { border-bottom: none; }
.rank-row:active { background: rgba(255, 255, 255, .05); }
.rank-row.me { background: rgba(245, 166, 35, .09); }

/* Kampfsimulator */
.sim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sim-cell {
  display: flex; align-items: center; gap: 5px; font-size: 15px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 7px;
}
.sim-cell input {
  width: 100%; min-width: 0; background: none; border: none; color: var(--text);
  font-size: 14px; text-align: right;
}
.sim-cell input:focus { outline: none; }

/* Stamm-Markierung: Farb-Auswahl */
.mark-swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .25); box-sizing: border-box;
}
.mark-swatch.sel { border-color: var(--foam); box-shadow: 0 0 0 2px var(--amber); }
.mark-custom-wrap {
  display: inline-flex; align-items: center; gap: 2px; cursor: pointer;
  font-size: 18px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 8px;
}
.mark-custom-wrap input[type="color"] {
  width: 26px; height: 26px; border: none; background: none; padding: 0; cursor: pointer;
}

/* Nachrichten & ☰-Menü */
.msg-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--red); color: #fff; border-radius: 9px;
  font-size: 10px; min-width: 17px; padding: 1px 4px; font-weight: 700;
  display: inline-block; text-align: center;
  border: 1.5px solid var(--bg); box-shadow: 0 0 5px rgba(224, 90, 78, .9);
}
/* ---- Umschalter der Rangliste ---- */
.seg-row {
  display: flex; gap: 6px; margin-bottom: 8px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 11px; padding: 4px;
}
.seg-row.sub { background: none; border: none; padding: 0 2px; }
.seg {
  flex: 1; min-width: 0; background: none; border: none; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 700; padding: 8px 6px;
  cursor: pointer; touch-action: manipulation; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.seg.on { background: linear-gradient(180deg, var(--amber2), var(--amber)); color: #241500; }
.seg-row.sub .seg {
  border: 1px solid var(--border); background: var(--card); font-size: 12.5px; padding: 6px 4px;
}
.seg-row.sub .seg.on { background: var(--card2); color: var(--amber2); border-color: var(--amber); }

/* ---- Statistik-Kacheln in den Profilen ---- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 6px; text-align: center; min-width: 0;
}
.stat-box b { display: block; font-size: 16px; color: var(--amber2); font-variant-numeric: tabular-nums; }
.stat-box span { display: block; font-size: 11px; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.stat-box .rk { color: var(--muted); font-size: 10.5px; }

/* ---- Anleitung (durchblätterbar) ---- */
/* Die Einblend-Animation schiebt die Seite kurz seitwärts — ohne das hier
   entstünde währenddessen ein waagrechter Scrollbalken. */
.tut-modal { overflow-x: hidden; }
.tut-top { display: flex; align-items: baseline; gap: 8px; }
.tut-top h3 { flex: 1; min-width: 0; font-size: 17px; }
.tut-num { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tut-stage { touch-action: pan-y; }
.tut-art {
  background: linear-gradient(180deg, #2b3a16, #1c280d);
  border: 1px solid var(--border); border-radius: 12px;
  height: clamp(140px, 26vh, 200px); margin: 10px 0 12px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tut-art svg { width: 100%; height: 100%; display: block; }
.tut-text { font-size: 14px; line-height: 1.5; }
.tut-text p { margin-bottom: 8px; }
.tut-text b { color: var(--amber2); }
.tut-text ul { margin: 4px 0 8px 18px; }
.tut-text li { margin-bottom: 5px; }
.tut-tip {
  background: var(--bg2); border-left: 3px solid var(--amber); border-radius: 8px;
  padding: 9px 11px; margin-top: 10px; font-size: 13.5px; line-height: 1.45;
}
.tut-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin: 14px 0 10px; }
.tut-dot {
  width: 9px; height: 9px; border-radius: 50%; cursor: pointer;
  background: var(--card2); border: 1px solid var(--border); transition: transform .15s, background .15s;
}
.tut-dot.on { background: var(--amber); border-color: var(--amber); transform: scale(1.3); }
@keyframes tutInL { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes tutInR { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.tut-stage.slide-l { animation: tutInL .22s ease-out; }
.tut-stage.slide-r { animation: tutInR .22s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .tut-stage.slide-l, .tut-stage.slide-r { animation: none; }
}

/* Push-Kategorien in den Einstellungen */
.push-cat {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 8px 4px; border-bottom: 1px solid rgba(82, 64, 31, .35);
  user-select: none;
}
.push-cat:last-of-type { border-bottom: none; }
.push-cat input { width: 20px; height: 20px; accent-color: var(--amber); flex-shrink: 0; margin-top: 1px; }
.push-cat .grow { flex: 1; min-width: 0; font-size: 13.5px; }

/* Rückkehr-Zeichen in Bernstein-Gold statt des bunten ↩️-Emojis */
.ret-ico { color: var(--amber2); font-weight: 700; font-style: normal; }

/* Nachfragen/Eingaben im Spiel-Design (ersetzt window.confirm/prompt) */
.ask-text {
  font-size: 14px; color: var(--text); margin-top: 8px;
  white-space: pre-line; line-height: 1.45;
}

/* Punkt statt Zahl (Weltchat: „da ist was Neues", ohne Zähler) */
.msg-badge.dot {
  min-width: 0; width: 11px; height: 11px; padding: 0; top: -4px; right: -4px;
}
.menu-item { width: 100%; text-align: left; margin-top: 8px; }

/* Weltchat: Absender über der Sprechblase, eigener Zettel abhängbar */
.wc-from { font-size: 11.5px; font-weight: 700; color: var(--amber2); margin-bottom: 2px; }
.wc-del { cursor: pointer; text-decoration: none; padding: 0 3px; }
.chat-box {
  display: flex; flex-direction: column; gap: 7px;
  max-height: 46dvh; overflow-y: auto; padding: 6px 2px; margin-top: 8px;
}
.bubble {
  max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: 14px;
  word-wrap: break-word; overflow-wrap: break-word;
}
.bubble-text { white-space: pre-wrap; }        /* Zeilenumbrüche in Nachrichten anzeigen */
.post-text { white-space: pre-wrap; }           /* Zeilenumbrüche in Pinnwand-Zetteln anzeigen */
/* mehrzeilige Eingabefelder (Nachrichten, Pinnwand) */
textarea.chat-input {
  font-family: inherit; line-height: 1.35; resize: none; overflow-y: auto;
  min-height: 40px; max-height: 132px;
}
.bubble.me {
  align-self: flex-end; background: linear-gradient(180deg, var(--amber2), var(--amber));
  color: #241500; border-bottom-right-radius: 4px;
}
.bubble.them {
  align-self: flex-start; background: var(--card2);
  border: 1px solid var(--border); border-bottom-left-radius: 4px;
}
.bubble .bt { font-size: 10px; opacity: .6; margin-top: 3px; text-align: right; }

/* 🍻 Prost — die Reaktion. Der Chip ist die Trefferfläche (mind. 30 px hoch, damit man ihn
   auf dem Handy sicher trifft), die Namenszeile daneben führt zur vollständigen Liste. */
.prost-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.prost {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--card2); border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 9px; min-height: 30px; font-size: 14px; line-height: 1;
  cursor: pointer; color: inherit; transition: transform .12s ease, background .12s ease;
}
.prost:active { transform: scale(.9); }          /* spürbare Rückmeldung beim Antippen */
.prost .pn { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.prost.on { background: rgba(255,200,87,.22); border-color: var(--amber2); color: var(--amber2); }
.prost-who {
  font-size: 11px; opacity: .75; cursor: pointer; text-decoration: underline dotted;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prost-who.stale { opacity: .45; }                /* eigener Prost gerade geändert — Namen noch alt */
/* In der eigenen (goldenen) Blase braucht der Chip dunklere Farben, sonst verschwindet er */
.bubble.me .prost { background: rgba(0,0,0,.14); border-color: rgba(0,0,0,.22); }
.bubble.me .prost.on { background: rgba(0,0,0,.30); border-color: #241500; color: #241500; }
.bubble.me .prost-who { color: #241500; opacity: .8; }

/* Welten-Chips (Login) */
.world-chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; justify-content: center; }
.world-chip {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
}
.world-chip.active { border-color: var(--amber); color: var(--amber2); font-weight: 700; }
.world-chip.locked { opacity: .55; cursor: pointer; }

/* Eingaben im Einstellungsmenü */
.st-in {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font-size: 15px; width: 100%;
}
.st-in:focus { outline: none; border-color: var(--amber); }
.pw-toggle {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px;
  color: var(--muted); cursor: pointer; user-select: none; padding: 2px 0;
}
.pw-toggle input { width: 18px; height: 18px; accent-color: var(--amber); }

/* Installations-Hinweis (PWA) */
.install-hint {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 55;
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--amber); border-radius: 12px;
  padding: 10px 12px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}
.install-hint .grow { flex: 1; }

/* Abbrechen-Knopf in der Baustelle */
.q-cancel { padding: 4px 9px; font-size: 13px; line-height: 1; }
.queue-item .row { align-items: center; }

/* Hinweis „ab wann leistbar" */
.afford-hint {
  font-size: 12.5px; color: var(--amber2); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.afford-hint .countdown { color: var(--amber2); }
.afford-hint.warn { color: var(--red); }
.afford-hint.warn::before { content: ''; }
.b-cost.mt + .afford-hint { text-align: center; }

/* ---- ⚔️ Angriffsarten & 📕 Kampf-Fibel (14.11.2026) ---- */
:root { --fuss: #f5a623; --rad: #5aa9e6; }
.kind { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.kind.fuss { background: rgba(245, 166, 35, .16); color: var(--amber2); border: 1px solid rgba(245, 166, 35, .5); }
.kind.rad { background: rgba(90, 169, 230, .16); color: #9fd0f5; border: 1px solid rgba(90, 169, 230, .5); }
.role-chip {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--foam); background: var(--card2);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-right: 2px; white-space: nowrap;
}
.fibel-teaser {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; margin-top: 12px;
  background: linear-gradient(90deg, rgba(245, 166, 35, .14), rgba(90, 169, 230, .14)); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 20px;
}
.fibel-teaser b { display: block; font-size: 14.5px; color: var(--amber2); }
.fibel-teaser small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.fibel-teaser:active { transform: scale(.99); }
.fib-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fib-kind { border-radius: 12px; padding: 10px 8px; text-align: center; border: 1px solid; }
.fib-kind.fuss { background: rgba(245, 166, 35, .1); border-color: rgba(245, 166, 35, .5); }
.fib-kind.rad { background: rgba(90, 169, 230, .1); border-color: rgba(90, 169, 230, .5); }
.fib-kind .fk-ico { font-size: 28px; line-height: 1.1; }
.fib-kind b { display: block; font-size: 14.5px; }
.fib-kind.fuss b { color: var(--amber2); }
.fib-kind.rad b { color: #9fd0f5; }
.fib-kind .fk-units { font-size: 19px; margin-top: 4px; letter-spacing: 1px; }
.fib-duel { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.fd-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; background: var(--bg2); border-radius: 10px; padding: 8px; font-size: 13.5px; font-weight: 700; }
.fd-row small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.fd-vs { font-size: 11px; font-weight: 400; color: var(--red); text-align: center; line-height: 1.2; max-width: 62px; }
.fd-d { text-align: right; color: var(--green); }
.fib-table td, .fib-table th { font-variant-numeric: tabular-nums; }
.fib-table small { font-size: 10px; }
.fib-table .ft-ico { font-size: 17px; }
.v-hi { color: var(--green); font-weight: 800; }
.v-lo { color: var(--red); }
.v-no { color: var(--muted); }
.fib-unit { background: var(--bg2); border-radius: 12px; padding: 10px 11px; margin-bottom: 7px; }
.fu-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.fu-head b { margin-right: 4px; }
.fu-ico { font-size: 24px; flex: none; }
.fu-line { font-size: 13px; line-height: 1.4; margin-top: 5px; }
.fu-line.no { color: var(--muted); }
.fu-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.fib-steps { margin: 0 0 0 20px; font-size: 13.5px; line-height: 1.5; }
.fib-steps li { margin-bottom: 9px; }
.fib-steps li::marker { color: var(--amber2); font-weight: 800; }
.fib-steps b { color: var(--amber2); }
.fib-ex { display: block; background: var(--bg2); border-radius: 8px; padding: 6px 9px; margin: 5px 0; font-size: 12.5px; }
/* Simulator: Angreifer-Felder nach Art eingefärbt + „Warum?"-Aufschlüsselung */
.sim-cell.k-fuss { border-color: rgba(245, 166, 35, .55); }
.sim-cell.k-rad { border-color: rgba(90, 169, 230, .6); }
.why { background: var(--bg2); font-size: 13px; }
.why > b { color: var(--amber2); font-size: 14px; }
.why-lbl { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 12.5px; }
.why-lbl b { font-variant-numeric: tabular-nums; }
.mixbar, .pbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--card2); margin-top: 4px; }
.mixbar i.fuss { background: var(--fuss); }
.mixbar i.rad { background: var(--rad); }
.pbar i { border-radius: 999px; }
.pbar i.a { background: var(--red); }
.pbar i.d { background: var(--green); }
.why-sum { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.4; }
.why-sum b { color: var(--text); }
.why-flank { margin-top: 8px; background: rgba(224, 90, 78, .12); border: 1px solid rgba(224, 90, 78, .45); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; line-height: 1.4; }
.unit-fight { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.uf { font-size: 12px; line-height: 1; padding: 4px 7px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.uf b { color: var(--text); font-size: 13px; }
.uf.fuss { border-color: rgba(245, 166, 35, .55); color: var(--amber2); }
.uf.rad { border-color: rgba(90, 169, 230, .6); color: #9fd0f5; }

/* ===================================================================================
   ===== V3: „Wirtshaus bei Nacht" — großes Optik- und Bedien-Update (design-neu) =====
   Alles hier ÜBERSCHREIBT die Regeln weiter oben; die alten bleiben als Grundlage stehen.
   Leitidee: warmes Holz, Kupfer und Schaum; Flächen mit Tiefe statt flacher Kästen;
   jede Rohstoffart hat ihre Farbe; Bewegung nur dort, wo sie etwas bedeutet.
   =================================================================================== */
:root {
  --bg: #120b06;
  --bg2: #1d140b;
  --card: #2a1e11;
  --card2: #3a2b18;
  --border: #5a4522;
  --line: rgba(255, 214, 140, .13);       /* feine, warme Kante */
  --line2: rgba(255, 214, 140, .26);
  --amber: #f5a623;
  --amber2: #ffcf6b;
  --amber3: #d9860f;
  --foam: #fff6df;
  --text: #f4ead6;
  --muted: #b8a37c;
  --green: #8fce4a;
  --red: #ee6a5c;
  --hop: #8fce4a;
  --malt: #f5b942;
  --water: #62b4f0;
  --shadow: 0 10px 28px rgba(0, 0, 0, .42);
  --r: 18px;
  --nav-h: 76px;
}
html { background: var(--bg); }
body {
  font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif;
  font-size: 15px; line-height: 1.35; letter-spacing: .1px;
  background:
    radial-gradient(ellipse 90% 42% at 50% -6%, rgba(245, 166, 35, .22) 0%, transparent 62%),
    radial-gradient(ellipse 70% 40% at 100% 100%, rgba(98, 180, 240, .06) 0%, transparent 60%),
    repeating-linear-gradient(92deg, rgba(255, 220, 160, .014) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #1a1109 0%, #120b06 55%, #0e0804 100%);
  background-attachment: fixed;
}
#app { position: relative; z-index: 1; }
::selection { background: rgba(245, 166, 35, .4); }

/* ---- 🫧 Bierbläschen ---- */
.bubbles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bubbles i {
  position: absolute; bottom: -20px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 244, 214, .55), rgba(245, 166, 35, .16) 60%, transparent 72%);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 150, .16);
  opacity: 0; animation: rise linear infinite; will-change: transform, opacity;
}
@keyframes rise {
  0% { transform: translate3d(0, 0, 0) scale(.7); opacity: 0; }
  12% { opacity: .5; }
  50% { transform: translate3d(9px, -52vh, 0) scale(1); }
  88% { opacity: .32; }
  100% { transform: translate3d(-7px, -106vh, 0) scale(1.15); opacity: 0; }
}

/* ---- Überschriften ---- */
.h2 {
  display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; letter-spacing: .3px;
  color: var(--amber2); margin: 18px 2px 10px; text-shadow: 0 2px 10px rgba(245, 166, 35, .22);
}
.h2::after { content: ''; flex: 1; height: 1px; min-width: 12px; background: linear-gradient(90deg, var(--line2), transparent); }
.modal .h2 { margin-top: 16px; }

/* ---- Flächen ---- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(64, 47, 25, .94) 0%, rgba(38, 27, 14, .96) 100%);
  border: 1px solid var(--line); border-radius: var(--r); padding: 13px; margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .09), 0 6px 18px rgba(0, 0, 0, .34);
}
.card .card { box-shadow: none; }
.row { gap: 11px; }
.b-name { font-weight: 800; font-size: 15.5px; letter-spacing: .15px; }
.b-level {
  display: inline-block; font-size: 11.5px; font-weight: 800; color: var(--amber2);
  background: rgba(245, 166, 35, .13); border: 1px solid rgba(245, 166, 35, .32);
  border-radius: 999px; padding: 1px 8px; vertical-align: 1px; white-space: nowrap;
}
.b-desc { font-size: 12.5px; line-height: 1.4; margin-top: 3px; }
.b-cost { margin-top: 6px; line-height: 1.55; }
.b-cost .no { color: var(--red); }

/* Bierdeckel: Symbole sitzen auf einer runden, leicht gewölbten Scheibe */
.b-icon { font-size: 27px; width: 40px; flex: none; }
.b-icon.coaster {
  position: relative; width: 52px; height: 52px; border-radius: 50%; font-size: 26px;
  display: flex; align-items: center; justify-content: center; align-self: flex-start;
  background: radial-gradient(circle at 35% 28%, #6b4f27 0%, #3b2a14 58%, #2a1d0d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 232, 180, .22), inset 0 -3px 6px rgba(0, 0, 0, .4), 0 3px 8px rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 214, 140, .2);
}
.b-icon.coaster[data-lv]::after {
  content: attr(data-lv); position: absolute; right: -4px; bottom: -4px; min-width: 21px; height: 21px;
  padding: 0 5px; border-radius: 999px; font-size: 11.5px; font-weight: 800; line-height: 19px; text-align: center;
  color: #2a1700; background: linear-gradient(180deg, #ffe08a, #f5a623); border: 1px solid #7a4b06;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .45);
}
/* Bauzeilen: Zustand auf einen Blick */
.bld-row.is-ready { border-color: rgba(143, 206, 74, .38); }
.bld-row.is-ready .coaster { box-shadow: inset 0 1px 0 rgba(255, 232, 180, .22), inset 0 -3px 6px rgba(0, 0, 0, .4), 0 0 0 2px rgba(143, 206, 74, .35), 0 3px 10px rgba(143, 206, 74, .2); }
.bld-row.is-locked { opacity: .72; }
.bld-row.is-locked .coaster { filter: grayscale(.8); }
.bld-row.is-max .coaster[data-lv]::after { background: linear-gradient(180deg, #fff3c4, #ffd24a); content: '★'; }

/* ---- Knöpfe: gezapftes Bernstein mit Schaumkante ---- */
.btn {
  position: relative; border-radius: 13px; padding: 12px 16px; font-weight: 800; letter-spacing: .2px;
  color: #2a1700; background: linear-gradient(180deg, #ffe08a 0%, #ffc04a 45%, #f09a1a 100%);
  text-shadow: 0 1px 0 rgba(255, 240, 200, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -2px 0 rgba(140, 80, 0, .32), 0 3px 0 #8c5a0a, 0 8px 18px rgba(245, 166, 35, .2);
  transition: transform .09s ease, box-shadow .09s ease, filter .15s ease;
}
.btn:active { transform: translateY(3px) scale(.99); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 #8c5a0a, 0 2px 6px rgba(0, 0, 0, .3); }
.btn:disabled {
  background: linear-gradient(180deg, #3b2d1a, #2f2314); color: #8b7a5a; text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); border: 1px solid var(--line); transform: none;
}
.btn.small { padding: 9px 13px; border-radius: 11px; font-size: 14px; }
.btn.ghost {
  color: var(--text); text-shadow: none;
  background: linear-gradient(180deg, rgba(86, 66, 38, .75), rgba(56, 42, 23, .8));
  border: 1px solid var(--line2);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .1), 0 2px 6px rgba(0, 0, 0, .25);
}
.btn.ghost:active { box-shadow: inset 0 2px 6px rgba(0, 0, 0, .4); transform: translateY(1px) scale(.985); }
.btn.danger {
  color: #fff; text-shadow: 0 1px 0 rgba(90, 10, 0, .5);
  background: linear-gradient(180deg, #ff8d7e, #e2513f 55%, #c23a2a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 0 #7d2015, 0 8px 16px rgba(226, 81, 63, .2);
}
.btn.danger:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 #7d2015; }
.link, .auth-switch a, .auth-forgot a { color: var(--amber2); text-underline-offset: 3px; }

/* ---- Eingabefelder ---- */
.st-in, .rec-input input, .attack-row input, .auth-card input, .auth-card textarea, textarea.chat-input, .vswitch {
  background: rgba(10, 6, 3, .55); border: 1px solid var(--line2); border-radius: 12px; color: var(--text);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .4); transition: border-color .15s, box-shadow .15s;
}
.st-in:focus, .rec-input input:focus, .attack-row input:focus, .auth-card input:focus, .auth-card textarea:focus, textarea.chat-input:focus {
  outline: none; border-color: var(--amber); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .4), 0 0 0 3px rgba(245, 166, 35, .2);
}
input[type="checkbox"], input[type="range"] { accent-color: var(--amber); }

/* ---- Kopfzeile ---- */
.top {
  background: linear-gradient(180deg, rgba(34, 23, 12, .97), rgba(22, 14, 7, .9));
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: none; padding: 9px 12px 9px; padding-top: calc(9px + env(safe-area-inset-top));
  box-shadow: 0 10px 24px rgba(0, 0, 0, .38);
}
.top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 207, 107, .75) 22%, #fff3cf 50%, rgba(255, 207, 107, .75) 78%, transparent);
  opacity: .55;
}
.top-row1 { gap: 7px; }
.vname { font-size: 16.5px; font-weight: 800; letter-spacing: .2px; color: var(--foam); text-shadow: 0 2px 10px rgba(245, 166, 35, .35); }
.vswitch { font-size: 14.5px; padding: 6px 8px; color: var(--foam); }
.vcoords { font-size: 11.5px; margin-top: 1px; }
.hbtn {
  width: 42px; height: 40px; padding: 0 !important; flex: none; font-size: 18px !important;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 13px !important;
}
.msg-badge { border-color: #160e07; box-shadow: 0 0 8px rgba(238, 106, 92, .9); animation: badgePop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* Rohstoffe: jede Art in ihrer Farbe, der Balken ist der Füllstand im Lager */
.res-bar { gap: 7px; margin-top: 9px; }
.res {
  --c: var(--amber); position: relative; overflow: hidden; display: flex; align-items: center; gap: 7px;
  text-align: left; padding: 7px 9px 9px; border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 15%, #2a1e11), #1e150b);
  border: 1px solid color-mix(in srgb, var(--c) 34%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.res.r-hopfen { --c: var(--hop); }
.res.r-malz { --c: var(--malt); }
.res.r-wasser { --c: var(--water); }
.res-ico { font-size: 19px; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.res-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.12; }
.res b { font-size: 15px; font-weight: 800; color: var(--foam); letter-spacing: .2px; }
.res small { font-size: 10px; color: color-mix(in srgb, var(--c) 70%, #fff); opacity: .9; }
.res .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; margin: 0; border-radius: 0; background: rgba(0, 0, 0, .5); }
.res .bar i { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, #000), var(--c)); border-radius: 0 3px 3px 0; box-shadow: 0 0 8px var(--c); }
.res.full { border-color: var(--red); animation: fullGlow 1.8s ease-in-out infinite; }
.res.full b { color: #ffb4aa; }
.res.full .bar i { background: var(--red); box-shadow: 0 0 8px var(--red); }
@keyframes fullGlow { 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 12px rgba(238, 106, 92, .45); } }
.seats { display: flex; justify-content: flex-end; gap: 6px; margin-top: 7px; text-align: left; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
}
.meta-chip b { color: var(--text); font-weight: 700; }
.seat-bar { display: inline-block; width: 38px; height: 5px; border-radius: 999px; background: rgba(0, 0, 0, .5); overflow: hidden; }
.seat-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #c9a227, #ffd95a); }
.meta-chip.full { border-color: rgba(238, 106, 92, .6); }
.meta-chip.full b { color: #ffb4aa; }
.meta-chip.full .seat-bar i { background: var(--red); }

/* ---- Hinweise unter der Kopfzeile ---- */
.alert {
  margin: 10px 12px 0; border-radius: 14px; padding: 11px 13px; line-height: 1.4;
  background: linear-gradient(180deg, #5c1a12, #3c100b); border: 1px solid rgba(238, 106, 92, .8);
  box-shadow: 0 6px 18px rgba(238, 106, 92, .18); animation: alertPulse 1.6s ease-in-out infinite;
}
@keyframes alertPulse { 50% { box-shadow: 0 6px 22px rgba(238, 106, 92, .42); border-color: #ff9a8c; } }
.acct-hint { border-radius: 14px; background: linear-gradient(180deg, #4a3510, #33240a); border-color: rgba(245, 166, 35, .6); }

/* ---- Inhalt + Tabwechsel ---- */
.content { padding: 12px 12px calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); }
#content.tab-in > * { animation: tabIn .34s cubic-bezier(.2, .8, .25, 1) both; }
#content.tab-in > *:nth-child(2) { animation-delay: .04s; }
#content.tab-in > *:nth-child(3) { animation-delay: .08s; }
#content.tab-in > *:nth-child(4) { animation-delay: .12s; }
#content.tab-in > *:nth-child(5) { animation-delay: .15s; }
#content.tab-in > *:nth-child(n+6) { animation-delay: .18s; }
@keyframes tabIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.empty { padding: 44px 16px; font-size: 15px; line-height: 1.6; }
.muted { color: var(--muted); }

/* ---- Brauerei: Begrüßung + Szene ---- */
.hero { margin: 2px 2px 10px; }
.hero-hi { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--foam); letter-spacing: .2px; }
.hero-hi b { color: var(--amber2); font-weight: 800; }
.hero-ico { font-size: 22px; filter: drop-shadow(0 0 10px rgba(255, 207, 107, .5)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-4deg); } }
.hero-chips { display: flex; gap: 7px; margin-top: 9px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hero-chips::-webkit-scrollbar { display: none; }
.hero-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--muted); background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; cursor: pointer; touch-action: manipulation; white-space: nowrap; transition: transform .1s;
}
.hero-chip:active { transform: scale(.95); }
.hero-chip.on { color: var(--amber2); border-color: rgba(245, 166, 35, .5); background: rgba(245, 166, 35, .12); }
.hero-chip.on span { animation: work 1s ease-in-out infinite; display: inline-block; }
@keyframes work { 50% { transform: translateY(-2px) rotate(-12deg); } }
.hero-chip.new { color: #dff5c2; border-color: rgba(143, 206, 74, .55); background: rgba(143, 206, 74, .14); }
.hero-chip.warn { color: #ffd9d4; border-color: rgba(238, 106, 92, .8); background: rgba(238, 106, 92, .2); animation: alertPulse 1.6s ease-in-out infinite; }
.scene-card {
  border-radius: 24px; border: 1px solid rgba(255, 214, 140, .3);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .25), 0 18px 40px rgba(0, 0, 0, .5), 0 0 60px rgba(245, 166, 35, .1);
}
.scene-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, .1), inset 0 -60px 60px -40px rgba(10, 6, 2, .55), inset 0 30px 40px -30px rgba(10, 6, 2, .35);
}
.scene-hint { font-size: 12px; color: var(--muted); text-align: center; margin: -2px 0 6px; }
.bld { transition: transform .15s; transform-box: fill-box; transform-origin: center bottom; }
.bld:active { transform: scale(1.06); }

/* ---- Baustelle / Warteschlangen ---- */
.queue-item {
  position: relative; overflow: hidden; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line);
}
.queue-item.running { border-color: rgba(245, 166, 35, .45); background: rgba(245, 166, 35, .08); }
.queue-item.running::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: repeating-linear-gradient(-45deg, var(--amber) 0 8px, #8c5a0a 8px 16px); background-size: 200% 100%;
  animation: stripes 1.1s linear infinite; opacity: .85;
}
@keyframes stripes { to { background-position: -22.6px 0; } }
.countdown { color: var(--amber2); font-weight: 800; letter-spacing: .3px; }

/* ---- Truppen ---- */
.rec-input { margin-top: 10px; }
.rec-input input { padding: 10px; }
.unit-stats { gap: 9px; margin-top: 6px; }
.fibel-teaser { border-radius: 16px; margin-top: 4px; box-shadow: inset 0 1px 0 rgba(255, 236, 190, .08), 0 6px 16px rgba(0, 0, 0, .3); }

/* ---- Karte ---- */
.map-wrap { border-radius: 24px; border: 1px solid rgba(255, 214, 140, .3); box-shadow: 0 0 0 4px rgba(0, 0, 0, .25), 0 18px 40px rgba(0, 0, 0, .5); }
.hud-btn { width: 44px; height: 44px; border-radius: 14px; background: rgba(24, 16, 8, .82); border: 1px solid var(--line2); backdrop-filter: blur(8px); box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.hud-btn:active { transform: scale(.94); }
.map-coords { border-radius: 999px; background: rgba(24, 16, 8, .8); border-color: var(--line2); backdrop-filter: blur(8px); padding: 5px 12px; }

/* ---- Berichte ---- */
.report { padding-left: 16px; transition: transform .1s; }
.report:active { transform: scale(.985); }
.report::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--border); }
.report.r-win::before { background: var(--green); box-shadow: 0 0 10px rgba(143, 206, 74, .6); }
.report.r-lose::before { background: var(--red); box-shadow: 0 0 10px rgba(238, 106, 92, .6); }
.report.r-info::before { background: var(--water); }
.report.unread { border-color: rgba(245, 166, 35, .6); background: linear-gradient(180deg, rgba(86, 60, 22, .96), rgba(48, 33, 14, .96)); }
.report.unread .report-title::after { content: 'NEU'; margin-left: 8px; font-size: 9.5px; font-weight: 800; letter-spacing: .8px; color: #2a1700; background: var(--amber2); border-radius: 999px; padding: 2px 6px; vertical-align: 2px; }
.report-title { font-size: 14.5px; font-weight: 800; line-height: 1.35; }
.report-detail table { border-radius: 10px; overflow: hidden; }
.report-detail th { color: var(--muted); font-weight: 700; background: rgba(0, 0, 0, .25); }
.report-detail th, .report-detail td { border-bottom: 1px solid var(--line); padding: 6px; }
.report-detail tr:last-child td { border-bottom: none; }

/* ---- Rangliste ---- */
.rank-row { padding: 12px 13px; gap: 12px; border-bottom: 1px solid var(--line); }
.rank-row.me { background: linear-gradient(90deg, rgba(245, 166, 35, .2), rgba(245, 166, 35, .04)); box-shadow: inset 3px 0 0 var(--amber); }
.rank-pos { font-size: 19px; text-shadow: 0 2px 8px rgba(245, 166, 35, .35); }
.rank-pts { font-weight: 800; color: var(--foam); }
.seg-row { border-radius: 14px; background: rgba(0, 0, 0, .32); border-color: var(--line); padding: 4px; }
.seg { border-radius: 10px; padding: 9px 6px; transition: color .15s, background .15s; }
.seg.on { background: linear-gradient(180deg, #ffe08a, #f5a623); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 8px rgba(245, 166, 35, .3); }
.seg-row.sub .seg { border-color: var(--line); background: rgba(0, 0, 0, .25); border-radius: 999px; }
.seg-row.sub .seg.on { background: rgba(245, 166, 35, .16); box-shadow: none; }
.stat-box { border-radius: 14px; background: rgba(0, 0, 0, .28); border-color: var(--line); padding: 11px 6px; }
.stat-box b { font-size: 17px; font-weight: 800; }

/* ---- Untere Navigation: schwebende Leiste ---- */
.nav {
  left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 4px 3px; padding-bottom: 4px;
  max-width: 624px; margin: 0 auto; border-radius: 24px; border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(52, 38, 20, .9), rgba(26, 17, 9, .94));
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .14), 0 12px 30px rgba(0, 0, 0, .6);
}
.nav button { padding: 7px 0 6px; font-size: 9.5px; font-weight: 600; gap: 1px; color: #a8946d; border-radius: 18px; transition: color .2s; }
.nav button .ni {
  font-size: 21px; width: 44px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 14px;
  transition: transform .25s cubic-bezier(.3, 1.5, .5, 1), background .2s, box-shadow .2s; filter: saturate(.75) brightness(.9);
}
.nav button.active { color: var(--amber2); font-weight: 800; }
.nav button.active .ni {
  transform: translateY(-3px) scale(1.14); filter: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 207, 107, .38), rgba(245, 166, 35, .12) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .3), 0 4px 14px rgba(245, 166, 35, .3);
}
.nav button:active .ni { transform: scale(.9); }
.nav .badge { top: 2px; right: calc(50% - 24px); border: 1.5px solid #1a1109; box-shadow: 0 0 8px rgba(238, 106, 92, .9); animation: badgePop .35s cubic-bezier(.3, 1.6, .5, 1); }

/* ---- Fenster: von unten hereingleitende Blätter ---- */
.modal-bg { background: rgba(8, 5, 2, .62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fadeIn .2s ease-out; }
.modal {
  position: relative; border-radius: 26px 26px 0 0; border: 1px solid var(--line2); border-bottom: none;
  background: linear-gradient(180deg, #3a2a15 0%, #261a0d 38%, #1e140a 100%);
  padding: 24px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 88dvh;
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .16), 0 -18px 50px rgba(0, 0, 0, .6);
  animation: sheetUp .3s cubic-bezier(.2, .85, .25, 1); overscroll-behavior: contain;
}
.modal::before { content: ''; position: absolute; top: 9px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 999px; background: rgba(255, 214, 140, .32); }
.modal h3 { font-size: 19px; font-weight: 800; letter-spacing: .2px; color: var(--amber2); margin-bottom: 6px; text-shadow: 0 2px 10px rgba(245, 166, 35, .25); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.menu-item { padding: 14px 16px; font-size: 15.5px; border-radius: 14px; }
.ask-text { line-height: 1.5; }
.tut-tip { border-radius: 12px; background: rgba(245, 166, 35, .08); border-left: 3px solid var(--amber); }
.tut-art { border-radius: 18px; border-color: var(--line2); box-shadow: inset 0 -30px 40px -30px rgba(0, 0, 0, .5); }
.attack-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.attack-row:last-child { border-bottom: none; }
.sim-cell { border-radius: 12px; padding: 7px 9px; background: rgba(0, 0, 0, .3); }
.push-cat { border-bottom-color: var(--line); }

/* ---- Chat ---- */
.bubble { border-radius: 18px; padding: 9px 13px; line-height: 1.4; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
.bubble.me { background: linear-gradient(180deg, #ffe08a, #f5a623); border-bottom-right-radius: 5px; }
.bubble.them { background: linear-gradient(180deg, #4a3820, #382a17); border-color: var(--line2); border-bottom-left-radius: 5px; }
.prost { transition: transform .15s cubic-bezier(.3, 1.8, .5, 1), background .12s; }
.prost.on { animation: prostPop .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes prostPop { 0% { transform: scale(.8); } 60% { transform: scale(1.18) rotate(-6deg); } 100% { transform: none; } }

/* ---- Toast ---- */
.toast {
  bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); border-radius: 16px; padding: 12px 18px; font-weight: 800;
  background: linear-gradient(180deg, #fffaf0, #ffe9b8); border: 1px solid #fff; color: #2a1700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 0 4px rgba(245, 166, 35, .18);
  animation: toastIn .32s cubic-bezier(.3, 1.4, .5, 1);
}
.toast.err { background: linear-gradient(180deg, #ff8d7e, #d8452f); border-color: #ffb4aa; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 0 4px rgba(238, 106, 92, .2); }
@keyframes toastIn { from { transform: translateX(-50%) translateY(18px) scale(.92); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.install-hint { border-radius: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #3a2a15, #261a0d); }

/* ---- Login ---- */
.auth-wrap { background: none; position: relative; z-index: 1; }
.auth-logo { font-size: 78px; line-height: 1; filter: drop-shadow(0 10px 26px rgba(245, 166, 35, .5)); animation: logoFloat 4.5s ease-in-out infinite; }
@keyframes logoFloat { 50% { transform: translateY(-7px) rotate(-3deg); } }
.auth-title {
  font-size: 38px; font-weight: 900; letter-spacing: 5px; margin-top: 4px;
  background: linear-gradient(180deg, #fff3cf 0%, #ffcf6b 45%, #e08a12 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 14px rgba(245, 166, 35, .35));
}
.auth-sub { letter-spacing: .4px; }
.auth-card {
  border-radius: 24px; padding: 22px 20px; gap: 11px; border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(66, 48, 25, .94), rgba(34, 24, 12, .96));
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .14), 0 20px 50px rgba(0, 0, 0, .55);
  animation: sheetUp .4s cubic-bezier(.2, .85, .25, 1);
}
.auth-card input, .auth-card textarea { padding: 14px 15px; border-radius: 14px; }
.auth-card .btn { padding: 14px 16px; font-size: 16.5px; }
.world-chip { background: rgba(0, 0, 0, .3); border-color: var(--line2); padding: 6px 13px; }
.world-chip.active { background: rgba(245, 166, 35, .14); box-shadow: 0 0 14px rgba(245, 166, 35, .2); }
.loading { animation: logoFloat 1.6s ease-in-out infinite; color: var(--amber2); font-weight: 800; }

/* ---- Kampf-Fibel & Simulator an die neuen Flächen angleichen ---- */
.fib-unit, .fd-row, .fib-ex, .why { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.fib-unit { border-radius: 16px; }
.uf { background: rgba(0, 0, 0, .32); border-color: var(--line2); }
.role-chip { background: rgba(255, 214, 140, .1); border-color: var(--line2); }

/* ---- Rollbalken dezent ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 214, 140, .25) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 214, 140, .25); border-radius: 999px; }

/* ---- Wer Bewegung reduziert haben möchte, bekommt ein ruhiges Bild ---- */
@media (prefers-reduced-motion: reduce) {
  .bubbles { display: none; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* ---- V3 Nachschliff 1 ---- */
.b-icon.coaster[data-lv]::after { min-width: 20px; height: 20px; padding: 0 4px; line-height: 18px; font-size: 11px; right: -3px; bottom: -3px; }
.b-cost span { white-space: nowrap; }
.btn { font-weight: 700; }
/* Unter der schwebenden Leiste blendet der Inhalt sanft aus, statt hart durchzuscheinen */
#app::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; pointer-events: none;
  height: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(14, 8, 4, .9) 58%, #0e0804);
}
.auth-wrap ~ *::after, #app:has(.auth-wrap)::after { display: none; }

/* ---- V3 Nachschliff 2: Truppenauswahl (Angriff/Unterstützung) ---- */
.attack-units { gap: 0; margin: 12px 0 10px; background: rgba(0, 0, 0, .26); border: 1px solid var(--line); border-radius: 16px; padding: 2px 10px; }
.attack-row { gap: 9px; padding: 7px 0; }
.attack-row.none { opacity: .45; }
.au-ico {
  flex: none; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 28%, #6b4f27, #2f2110); border: 1px solid var(--line2);
}
.au-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.2; }
.au-name small { display: block; font-size: 10.5px; font-weight: 600; margin-top: 2px; }
.au-name small.k-fuss { color: var(--amber2); }
.au-name small.k-rad { color: #9fd0f5; }
.attack-row input { width: 72px; padding: 9px 6px; font-weight: 700; }
.attack-row .have {
  flex: none; min-width: 62px; text-align: center; font-size: 11.5px; font-weight: 700; text-decoration: none; color: var(--amber2);
  background: rgba(245, 166, 35, .1); border: 1px solid rgba(245, 166, 35, .35); border-radius: 999px; padding: 6px 8px;
}
.attack-row .have:active { transform: scale(.94); }
.atk-sum { font-size: 13px; line-height: 1.45; background: rgba(0, 0, 0, .26); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.atk-sum b { color: var(--foam); }
.atk-night { margin-top: 8px; color: #ffd9d4; background: rgba(238, 106, 92, .14); border: 1px solid rgba(238, 106, 92, .45); border-radius: 10px; padding: 6px 9px; font-size: 12.5px; }
