:root {
    --bg: #0c141d;
    --panel: #142130;
    --panel-2: #1a2a3b;
    --line: #29405a;
    --text: #dfe6ee;
    --muted: #8ea0b3;
    --brass: #d0ab5c;
    --brass-dim: #8c7543;
    --good: #6fbf73;
    --bad: #e06c5f;
    --warn: #e0b54f;
    --accent: #5b9bd5;
    --sea: #10314d;
    --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: normal; color: var(--brass); margin: 0 0 10px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
small, .muted { color: var(--muted); }
a { color: var(--accent); }

/* ---------- Kopfzeile ---------- */
#topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    padding: 8px 16px;
    background: linear-gradient(#18293a, #122030);
    border-bottom: 2px solid var(--brass-dim);
}
.brand { font-family: Georgia, serif; font-size: 22px; color: var(--brass); letter-spacing: 1px; }
#tabs { display: flex; gap: 4px; flex-wrap: wrap; }
#tabs button {
    background: transparent; color: var(--muted); border: 1px solid transparent;
    padding: 6px 14px; border-radius: var(--radius); cursor: pointer; font-size: 14px;
}
#tabs button:hover { color: var(--text); border-color: var(--line); }
#tabs button.active { color: var(--bg); background: var(--brass); }
#resources { margin-left: auto; display: flex; gap: 22px; }
.res { white-space: nowrap; }
.res-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-right: 6px; }
.res b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.res small { margin-left: 4px; color: var(--good); }

main { max-width: 1400px; margin: 0 auto; padding: 16px; }
.tab { display: none; }
.tab.active { display: block; }

/* ---------- Bausteine ---------- */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; min-width: 0;
}
.card + .card { margin-top: 16px; }
.grid > .card + .card, .missions > .card + .card { margin-top: 0; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: rgba(255,255,255,.02); }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }

button, .btn {
    background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
    padding: 5px 12px; border-radius: var(--radius); cursor: pointer; font: inherit;
}
button:hover:not(:disabled) { border-color: var(--brass); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--brass); color: #1a1408; border-color: var(--brass); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.1); }
button.danger { color: var(--bad); }
button.small { padding: 2px 8px; font-size: 12px; }

input, select {
    background: #0e1a26; color: var(--text); border: 1px solid var(--line);
    border-radius: 4px; padding: 4px 6px; font: inherit;
}
input[type=range] { padding: 0; accent-color: var(--brass); }

.bar { height: 8px; background: #0b1520; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.hp > i { background: var(--good); }
.bar.hp.mid > i { background: var(--warn); }
.bar.hp.low > i { background: var(--bad); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; border: 1px solid var(--line); }
.badge.bereit { color: var(--good); border-color: var(--good); }
.badge.bau { color: var(--accent); border-color: var(--accent); }
.badge.reparatur { color: var(--warn); border-color: var(--warn); }
.badge.gefecht { color: var(--bad); border-color: var(--bad); }

.events { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.events li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.events time { color: var(--muted); font-size: 12px; margin-right: 8px; font-variant-numeric: tabular-nums; }

.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat { min-width: 110px; }
.stat b { display: block; font-size: 20px; font-family: Georgia, serif; color: var(--text); }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }

.empty { color: var(--muted); padding: 16px 0; text-align: center; }
.notice { border-left: 3px solid var(--warn); background: rgba(224,181,79,.08); padding: 10px 14px; margin-bottom: 16px; }

/* ---------- Konstruktion ---------- */
.designer { display: grid; grid-template-columns: 320px 1fr 330px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .designer { grid-template-columns: 1fr 1fr; } .designer .preview { grid-column: 1 / -1; order: -1; } }
@media (max-width: 760px) { .designer { grid-template-columns: 1fr; } .grid.two { grid-template-columns: 1fr; } }
.field { margin-bottom: 12px; }
.field label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.field label b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.field input[type=range], .field select, .field input[type=text] { width: 100%; }
.field-group { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.field-group > h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--brass); font-weight: 600; }
.preview canvas { width: 100%; height: 260px; display: block; border-radius: var(--radius); background: var(--sea); }
.toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.weight-bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; margin: 8px 0 4px; background: #0b1520; }
.weight-bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; background: var(--c); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-variant-numeric: tabular-nums; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.free-ok { color: var(--good); }
.strength.good { color: var(--good); }
.strength.info { color: var(--accent); }
.strength.warn { color: var(--warn); }
.strength.bad { color: var(--bad); font-weight: 600; }
.free-bad { color: var(--bad); font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Gefecht-Auswahl ---------- */
.missions { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.mission h3 { margin-bottom: 4px; }
.mission .diff { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.diff.easy { color: var(--good); } .diff.medium { color: var(--warn); } .diff.hard { color: var(--bad); }
.ship-pick label { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ship-pick label:hover { color: var(--brass); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
    background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--accent);
    padding: 10px 14px; border-radius: var(--radius); max-width: 380px; box-shadow: 0 6px 20px rgba(0,0,0,.4);
    animation: slidein .2s ease-out;
}
.toast.error { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* ---------- Gefechtsbildschirm ---------- */
#battle-screen {
    position: fixed; inset: 0; z-index: 50; background: #07111b;
    display: grid; grid-template-columns: 1fr 320px; grid-template-rows: auto 1fr;
}
#battle-screen[hidden] { display: none; }
.b-top {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 6px 12px; background: #0f1d2b; border-bottom: 1px solid var(--line);
}
.b-top .title { font-family: Georgia, serif; color: var(--brass); font-size: 17px; }
.b-top .clock { font-variant-numeric: tabular-nums; color: var(--muted); }
.b-speed { display: flex; gap: 2px; }
.b-speed button.active { background: var(--brass); color: #1a1408; }
.b-top .spacer { flex: 1; }
.b-canvas-wrap { position: relative; overflow: hidden; }
.b-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.b-help { position: absolute; left: 10px; bottom: 8px; font-size: 12px; color: var(--muted); pointer-events: none; text-shadow: 0 1px 2px #000; }
.b-side { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.b-side section { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.b-side h3 { font-size: 14px; margin-bottom: 6px; }
.b-orders { display: flex; gap: 3px; flex-wrap: wrap; margin: 6px 0; }
.b-orders button { padding: 2px 7px; font-size: 12px; }
.b-orders button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.b-fleet .row { display: grid; grid-template-columns: 1fr 70px; gap: 8px; align-items: center; padding: 2px 4px; cursor: pointer; border-radius: 3px; font-size: 12px; }
.b-fleet .row:hover { background: var(--panel-2); }
.b-fleet .row.sel { background: rgba(91,155,213,.2); }
.b-fleet .row.dead { opacity: .4; text-decoration: line-through; }
.b-fleet .enemy { color: #f0a59a; }
.b-log { flex: 1; min-height: 160px; }
.b-log ul { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.b-log li { padding: 2px 0; border-bottom: 1px dotted var(--line); }
.b-log li.good { color: var(--good); } .b-log li.bad { color: var(--bad); } .b-log li.warn { color: var(--warn); }
.b-log time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.turret-list { font-size: 12px; margin: 4px 0 0; padding-left: 16px; }
.b-result {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(5,10,16,.72); z-index: 5;
}
.b-result .card { max-width: 640px; width: calc(100% - 32px); max-height: 90%; overflow-y: auto; }
.b-result h2 { font-size: 28px; text-align: center; }

/* ---------- Sitzung 4: Seekarte, Forschung, Besatzung, Archiv, Ton ---------- */
#resources { align-items: center; }
.icon-btn { background: transparent; border: 1px solid var(--line); padding: 2px 8px; font-size: 16px; }
.icon-btn.lang-btn { font-size: 12px; font-weight: 700; letter-spacing: .05em; min-width: 34px; }

.campaign-map { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.campaign-map .edges line { stroke: rgba(208,171,92,.35); stroke-width: 2; stroke-dasharray: 6 6; }
.campaign-map .region .ring { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 2; }
.campaign-map .region.owned .ring { stroke: var(--brass); stroke-width: 3; }
.campaign-map text { fill: var(--text); text-anchor: middle; font-family: "Segoe UI", sans-serif; }
.campaign-map .pct { font-size: 17px; font-weight: 600; }
.campaign-map .icon { font-size: 24px; }
.campaign-map .name { font-size: 15px; paint-order: stroke; stroke: rgba(5,15,25,.85); stroke-width: 4px; }
.campaign-map .mission-badge { cursor: pointer; }
.campaign-map .mission-badge circle { fill: var(--bad); stroke: #fff; stroke-width: 2; }
.campaign-map .mission-badge text { font-size: 14px; fill: #fff; }
.campaign-map .mission-badge:hover circle { fill: #ff8b7c; }

.pips { display: inline-flex; gap: 3px; }
.pips i { width: 12px; height: 12px; border-radius: 2px; background: #0b1520; border: 1px solid var(--line); }
.pips i.on { background: var(--brass); border-color: var(--brass); }

.rank { font-size: 12px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); white-space: nowrap; }
.rank.r1 { color: #9fc3e6; } .rank.r2 { color: var(--good); border-color: var(--good); }
.rank.r3 { color: var(--warn); border-color: var(--warn); } .rank.r4 { color: var(--brass); border-color: var(--brass); font-weight: 600; }
.bar.xp { height: 4px; margin-top: 3px; min-width: 60px; }
.bar.xp > i { background: var(--brass); }

.mission.highlight { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass); }
.mission-meta { font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.outcome.victory { color: var(--good); } .outcome.defeat { color: var(--bad); } .outcome.retreat { color: var(--warn); }

.modal { position: fixed; inset: 0; z-index: 80; background: rgba(5,10,16,.75); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal .card { position: relative; max-width: 820px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal .close { position: absolute; right: 12px; top: 12px; }
.report-log { list-style: none; margin: 0; padding: 0; font-size: 12px; max-height: 320px; overflow-y: auto; }
.report-log li { padding: 2px 0; border-bottom: 1px dotted var(--line); }
.report-log li.good { color: var(--good); } .report-log li.bad { color: var(--bad); } .report-log li.warn { color: var(--warn); }
.report-log time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }

.b-top .weather { color: #b9c6d2; font-size: 13px; }
.b-sound { display: inline-flex; align-items: center; gap: 6px; }
.b-sound input { width: 80px; }
.b-fleet .row.hidden-ship { opacity: .7; }

/* ---------- Sitzung 7: Gegenoffensiven, Kampagnenziel ---------- */
.notice.alarm { border-left-color: var(--bad); background: rgba(224,108,95,.12); }
.notice.victory-banner { border-left-color: var(--brass); background: rgba(208,171,92,.14); }
.mission.defense { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; }
.campaign-map .mission-badge.defense circle { fill: #ff3b2f; animation: pulse 1.2s ease-in-out infinite; }
.campaign-map .mission-badge.defense text { font-weight: 700; font-size: 18px; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Sitzung 9: Kamera folgt ---------- */
.b-follow {
    position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
    background: rgba(8,24,40,.85); border: 1px solid var(--brass-dim); border-radius: 12px;
    padding: 3px 12px; font-size: 12px; color: var(--text); pointer-events: none;
}
.b-follow[hidden] { display: none; }

/* ---------- Sitzung 10: Unterhalt, Umbau, Reserve ---------- */
.badge.umbau, .badge.aktivierung { color: var(--accent); border-color: var(--accent); }
.badge.reserve { color: var(--muted); }
table.budget td { padding: 3px 0; border: 0; }
table.budget tr.total td { border-top: 1px solid var(--line); font-weight: 600; padding-top: 6px; }

/* ---------- Sitzung 11: Auswahl, Gruppen ---------- */
.b-pick { display: inline-flex; gap: 2px; }
.b-groups { padding: 6px 12px !important; }
.b-group-bar { display: flex; flex-wrap: wrap; gap: 4px; }
.b-group-bar button { padding: 2px 8px; font-size: 12px; }
.b-group-bar button b { color: var(--brass); }

/* ---------- Sitzung 12: Übungsgefecht ---------- */
.exercise { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.exercise h3 { margin-bottom: 4px; }
.exercise .field select { width: 100%; }

/* ---------- Sitzung 14: Aufstellungsphase ---------- */
.b-briefing {
    position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 4;
    width: min(520px, calc(100% - 300px)); min-width: 300px;
    background: rgba(16,30,45,.94); border: 1px solid var(--brass-dim); border-radius: var(--radius);
    padding: 12px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.b-briefing h2 { margin-bottom: 2px; }
.b-briefing p { margin: 6px 0; }
.b-briefing table td { border: 0; padding: 2px 0; }
.b-briefing.mini > :not(.actions) { display: none; }
.b-briefing.mini { width: auto; min-width: 0; padding: 8px 12px; }
.b-briefing.mini .actions { margin: 0; }

@media (max-width: 860px) {
    #battle-screen { grid-template-columns: 1fr; grid-template-rows: auto 1fr 40%; }
    .b-side { border-left: 0; border-top: 1px solid var(--line); }
    #resources { margin-left: 0; }
}

/* ---------- Sitzung 28: Wiederholung ---------- */
#battle-screen.replay .b-touch, #battle-screen.replay .b-groups { display: none; }
.b-top .r-slider { flex: 1; min-width: 160px; max-width: 420px; }
@media (max-width: 860px) { .b-top .r-slider { min-width: 140px; flex: 0 0 160px; } }

/* ---------- Sitzung 27: Zeitalter, Lebenslauf, Testspielstand ---------- */
.notice.test-save { border-left-color: #b07de0; background: rgba(176,125,224,.10); }
button.link { background: none; border: 0; padding: 0; color: var(--brass); font-weight: 600; cursor: pointer; min-height: 0; text-align: left; }
button.link:hover { text-decoration: underline; }
.admiral-bio { max-width: 860px; }
.admiral-bio .events { max-height: 340px; }
.era .events { max-height: 220px; }

/* ---------- Sitzung 26: Nationen ---------- */
.brand-nation { font-size: 18px; margin-left: 4px; }
svg.flag { display: inline-block; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.brand-nation svg.flag { vertical-align: 0; }
.nation-line { margin: 4px 0 8px; }
.nation-choice { max-width: 760px; max-height: calc(100vh - 32px); overflow-y: auto; }
.nation-choice .theatre-head { margin: 14px 0 8px; }
.nation-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.nation-card {
    display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 16px; height: 100%;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.nation-card:hover { border-color: var(--brass); }
.nation-card .nation-flag { font-size: 34px; line-height: 1; }
.nation-card .nation-flag svg.flag { vertical-align: middle; }
.nation-card b { font-family: Georgia, serif; font-size: 17px; color: var(--brass); }
.nation-card small { color: var(--muted); }

/* ---------- Sitzung 25: Admirale ---------- */
.b-top .b-admiral { color: var(--brass); font-size: 13px; white-space: nowrap; }
.admiral-pick { margin: 10px 0 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.admiral-pick select { width: 100%; margin-bottom: 4px; }

/* ---------- Sitzung 22: Küste, Minen, Küstenbatterien ---------- */
.mission-meta.terrain { color: #d9b9a0; margin-top: -4px; }
.b-briefing .terrain-note { font-size: 13px; color: #e8cdb8; border-left: 3px solid #a8604f; padding-left: 8px; }

/* ---------- Sitzung 20: Freischaltungen ---------- */
.next-unlocks { margin: 10px 0 4px; padding: 8px 12px; border-left: 3px solid var(--brass-dim); background: rgba(208,171,92,.06); }
.next-unlocks ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Sitzung 19: Handy und Touch ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.grid > * { min-width: 0; }   /* sonst drücken breite Tabellen die Spalte über den Bildschirmrand */
.sortie-grid { grid-template-columns: minmax(260px, 340px) 1fr; }
.seekarte-grid { grid-template-columns: 1fr minmax(280px, 360px); }
@media (max-width: 760px) { .sortie-grid, .seekarte-grid { grid-template-columns: 1fr; } }
.b-canvas-wrap canvas { touch-action: none; }   /* Wischen und Zoomen übernimmt das Spiel, nicht der Browser */

/* Touch-Leiste über der Karte, nur bei Fingerbedienung */
.b-touch { display: none; }
.touch-ui .b-touch {
    position: absolute; left: 8px; bottom: 8px; z-index: 3;
    display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 16px);
}
.b-touch button {
    min-width: 44px; height: 44px; padding: 0 10px; font-size: 15px;
    background: rgba(16,30,45,.88); border-color: var(--brass-dim); touch-action: manipulation;
}
.b-touch button.active { background: var(--brass); color: #1a1408; border-color: var(--brass); }

/* Hilfetext: Maus-Variante am PC, Finger-Variante über die ?-Taste */
.b-help .touch-help { display: none; }
.touch-ui .b-help { display: none; }
.touch-ui.help-open .b-help {
    display: block; left: 8px; right: 8px; bottom: 60px; padding: 8px 10px; font-size: 13px; color: var(--text);
    background: rgba(16,30,45,.94); border: 1px solid var(--brass-dim); border-radius: var(--radius); text-shadow: none;
}
.touch-ui .b-help .mouse-help { display: none; }
.touch-ui .b-help .touch-help { display: inline; }

/* größere Bedienelemente für Finger */
.touch-ui .b-top button { min-height: 36px; }
.touch-ui .b-sound input { display: none; }   /* Lautstärke regeln die Tasten am Gerät */
.touch-ui .b-orders { gap: 5px; }
.touch-ui .b-orders button { padding: 7px 10px; font-size: 13px; }
.touch-ui .b-group-bar button { padding: 7px 10px; }
.touch-ui .b-fleet .row { padding: 7px 6px; font-size: 13px; }
.touch-ui .b-side { touch-action: pan-y; }

@media (pointer: coarse) {
    button, .btn { min-height: 36px; }
    #tabs button { padding: 8px 12px; }
    input[type=range] { height: 28px; }
    select, input[type=text], input[type=number] { min-height: 36px; }
}

/* schmaler Bildschirm (Handy hochkant) */
@media (max-width: 860px) {
    .b-top { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 4px 8px; scrollbar-width: none; }
    .b-top > * { flex-shrink: 0; white-space: nowrap; }
    .b-top .title { font-size: 15px; }
    .b-top .spacer { flex: 0 0 4px; }
    .b-briefing { width: calc(100% - 16px); min-width: 0; top: 8px; max-height: calc(100% - 70px); overflow-y: auto; padding: 10px 12px; font-size: 13px; }
    .b-briefing h2 { font-size: 17px; }
    .b-follow { left: 8px; transform: none; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Handy hochkant: Touch-Leiste in einer Zeile, Zoomen geht mit zwei Fingern */
@media (max-width: 480px) {
    .b-touch [data-t="zoomin"], .b-touch [data-t="zoomout"] { display: none; }
    .b-touch { gap: 5px; }
    .b-touch button { padding: 0 8px; font-size: 14px; }
}
@media (max-width: 600px) {
    #topbar { gap: 6px 12px; padding: 6px 10px; }
    .brand { font-size: 18px; }
    #resources { margin-left: auto; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; }
    .res-label, .res small { display: none; }   /* auf dem Handy nur die Bestände, die Raten stehen im Hafen */
    #tabs { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    #tabs button { flex-shrink: 0; }
    main { padding: 10px; }
    .card { padding: 12px; }
    .stat-row { gap: 14px; }
    #toasts { left: 12px; right: 12px; bottom: 12px; }
    .toast { max-width: none; }
    .b-result h2 { font-size: 22px; }
}

/* Handy quer: Karte links, schmale Leiste rechts */
@media (max-height: 520px) and (orientation: landscape) {
    #battle-screen { grid-template-columns: 1fr 250px; grid-template-rows: auto 1fr; }
    .b-side { border-top: 0; border-left: 1px solid var(--line); }
    .b-side section { padding: 8px 10px; }
    .b-log { min-height: 120px; }
    .b-briefing { max-height: calc(100% - 64px); }
    .touch-ui .b-touch button { height: 40px; min-width: 40px; }
}

/* Konto mit Zugangscode (Sitzung 38) */
.konto-box { max-width: 520px; }
.konto-gate { background: var(--bg, #0b1622); }
.konto-code { font: 700 22px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .08em; text-align: center;
    padding: 12px; border: 1px dashed var(--accent); border-radius: 8px; user-select: all; word-break: break-all; }
.konto-input { width: 100%; font: 600 18px ui-monospace, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.konto-msg:empty { display: none; }
.konto-wahl { display: grid; gap: 10px; margin: 14px 0; }
.konto-wahl button { text-align: left; padding: 12px 14px; }
.konto-wahl button small { display: block; font-weight: 400; opacity: .8; margin-top: 3px; color: inherit; }
