:root {
  --accent: #c8372b;
  --accent-2: #ff5a2e;
  --bg: #0b1017;
  --bg2: #070a0f;
  --edge: rgba(160, 182, 214, 0.2);
  --edge-hi: rgba(200, 218, 240, 0.35);
  --text: #c6d0dc;
  --bright: #eef3f8;
  --dim: #7d8a9c;
  --good: #5ef09a;
  --warn: #ffc94a;
  --bad: #ff5a4a;
  --font: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Segoe UI", sans-serif;
  --cut: 9px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--text); font: 14px/1.3 var(--font); user-select: none; }
canvas#gl, canvas#overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#overlay { pointer-events: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
kbd { font: 600 11px var(--font); padding: 1px 5px; border: 1px solid var(--edge-hi); border-bottom-width: 2px; background: #141b25; color: var(--bright); }
.dim { color: var(--dim); }
.k { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }

/* ------------------------------------------------------------ Rahmen */
.frame, .panel {
  position: relative;
  background: linear-gradient(180deg, rgba(16, 23, 32, 0.94), rgba(8, 11, 16, 0.94));
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: inset 0 0 0 1px var(--edge), inset 0 1px 0 0 var(--edge-hi);
}
.frame::before, .panel::before {
  content: ""; position: absolute; left: 0; top: 0; width: 34px; height: 2px; background: var(--accent);
}

/* ------------------------------------------------------------ Kopfleiste */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 46px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: linear-gradient(180deg, rgba(6, 9, 13, 0.96), rgba(6, 9, 13, 0.75));
  border-bottom: 1px solid var(--edge);
}
#topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.6; }
.tb-left, .tb-right, .tb-center { display: flex; align-items: center; gap: 22px; }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat b { font-size: 19px; color: var(--bright); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat small { color: var(--good); font-size: 12px; }
#pop.full { color: var(--warn); }
.level { display: flex; align-items: center; gap: 8px; }
#pips { display: flex; gap: 4px; }
#pips i { width: 10px; height: 10px; transform: rotate(45deg); border: 1px solid var(--edge-hi); background: #10161e; }
#pips i.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px var(--accent); }
#tech-progress { display: flex; align-items: center; gap: 16px; min-width: 300px; font-size: 12px; }
#tech-progress .tp { display: flex; align-items: center; gap: 6px; }
#tech-progress .tp em { font-style: normal; color: var(--dim); font-size: 11px; }
#tech-progress .tp.mine span { color: var(--bright); }
#tech-progress .bar { width: 70px; height: 4px; background: #1a222d; }
#tech-progress .bar i { display: block; height: 100%; background: var(--accent-2); }
#tech-progress small { color: var(--dim); }
#clock { font-size: 16px; color: var(--bright); font-variant-numeric: tabular-nums; letter-spacing: 0.05em; }
.seg { display: flex; box-shadow: inset 0 0 0 1px var(--edge); }
.seg button { padding: 5px 10px; min-width: 36px; color: var(--dim); }
.seg button.on { color: var(--bright); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 45%, transparent), transparent); }
.seg button:hover, button.sq:hover { color: var(--bright); }
button.sq { width: 30px; height: 30px; box-shadow: inset 0 0 0 1px var(--edge); color: var(--dim); font-size: 16px; }

#perf { position: fixed; top: 52px; right: 12px; font-size: 11px; color: var(--dim); letter-spacing: 0.04em; pointer-events: none; opacity: 0.75; }
#notify { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.note { padding: 5px 18px; background: rgba(8, 12, 18, 0.88); border-left: 2px solid var(--accent-2); color: var(--bright); font-size: 14px; letter-spacing: 0.02em; transition: opacity 0.8s; }
.note.warn { border-color: var(--bad); color: #ffd6cf; }
.note.good { border-color: var(--good); }
.note.fade { opacity: 0; }
#toast { position: fixed; bottom: 262px; left: 50%; transform: translateX(-50%); padding: 6px 18px; background: rgba(8, 12, 18, 0.9); box-shadow: inset 0 0 0 1px var(--edge); color: var(--bright); pointer-events: none; }
#superbar { position: fixed; top: 56px; left: 14px; width: 300px; padding: 6px 10px 9px; background: rgba(8, 12, 18, 0.88); box-shadow: inset 0 0 0 1px var(--edge); font-size: 12px; color: var(--dim); }
#superbar i { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--accent-2); }
#superbar.ready { color: var(--bright); box-shadow: inset 0 0 0 1px var(--accent-2), 0 0 18px color-mix(in srgb, var(--accent-2) 40%, transparent); }

/* ------------------------------------------------------------ Untere Leiste */
#bottom { position: fixed; left: 0; right: 0; bottom: 0; height: 244px; display: flex; gap: 6px; padding: 6px; align-items: flex-end; pointer-events: none; }
#bottom > section { pointer-events: auto; height: 100%; }
#p-map { width: 236px; flex: 0 0 236px; padding: 8px; }
#minimap { width: 220px; height: 220px; display: block; cursor: crosshair; }
#p-sel { flex: 1 1 340px; min-width: 260px; max-width: 520px; padding: 10px 12px; }
#sel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; min-height: 20px; }
#sel-head b { color: var(--bright); font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.st { font-size: 11px; padding: 1px 6px; box-shadow: inset 0 0 0 1px var(--edge); }
.st.ion { color: #8fd0ff; } .st.tr { color: #7ff0c8; }
.single { display: flex; gap: 12px; }
.single img { width: 168px; height: 112px; object-fit: contain; background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.05), transparent 70%); }
.single .info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.single .cls { color: var(--dim); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.bar { position: relative; height: 14px; background: #121921; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.bar i { display: block; height: 100%; }
.bar em { position: absolute; left: 6px; top: 0; font-style: normal; font-size: 11px; line-height: 14px; color: var(--bright); text-shadow: 0 1px 2px #000; }
.bar.hull i { background: linear-gradient(90deg, #2e9e60, #4ee08a); }
.bar.shield i { background: linear-gradient(90deg, #2a6fb8, #59b8ff); }
.desc { margin: 2px 0 0; color: var(--dim); font-size: 12px; }
.hps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.hpd { width: 13px; height: 13px; transform: rotate(45deg); background: linear-gradient(0deg, var(--c) calc(var(--f) * 100%), #1a222c calc(var(--f) * 100%)); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.hpd.dead { background: #2a1414; box-shadow: 0 0 0 1px #5a2020; }
button.hpd { border: 0; padding: 0; cursor: pointer; font: inherit; }
button.hpd.fix { box-shadow: 0 0 0 1px #ffd24a, 0 0 6px rgba(255, 210, 74, 0.55); animation: fixpulse 1.6s ease-in-out infinite; }
button.hpd.fix.poor { box-shadow: 0 0 0 1px #7a6a3a; animation: none; cursor: not-allowed; }
button.hpd.fix:hover { box-shadow: 0 0 0 2px #fff; }
@keyframes fixpulse { 50% { box-shadow: 0 0 0 1px #ffd24a, 0 0 1px rgba(255, 210, 74, 0); } }
.tiles { display: flex; flex-wrap: wrap; gap: 5px; }
.tile { position: relative; width: 74px; height: 58px; box-shadow: inset 0 0 0 1px var(--edge); background: rgba(255, 255, 255, 0.02); }
.tile:hover { box-shadow: inset 0 0 0 1px var(--accent-2); }
.tile img { width: 74px; height: 50px; object-fit: contain; }
.tile .n { position: absolute; right: 4px; top: 2px; color: var(--bright); font-weight: 600; text-shadow: 0 1px 2px #000; }
.tile .hb, .tile .sb { position: absolute; left: 3px; right: 3px; height: 3px; background: #1a222c; }
.tile .hb { bottom: 3px; } .tile .sb { bottom: 7px; }
.tile .hb i { display: block; height: 100%; background: var(--good); } .tile .sb i { display: block; height: 100%; background: #59b8ff; }

#p-cmd { flex: 0 0 214px; padding: 9px 10px; }
#cmd-grid { display: grid; grid-template-columns: repeat(3, 62px); grid-auto-rows: 62px; gap: 5px; }
.cmd { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: linear-gradient(180deg, #18212c, #0e141b); box-shadow: inset 0 0 0 1px var(--edge); color: var(--text); overflow: hidden; }
.cmd svg { width: 26px; height: 26px; }
.cmd span { font-size: 10px; letter-spacing: 0.04em; max-width: 58px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd kbd { position: absolute; right: 2px; top: 2px; font-size: 9px; padding: 0 3px; border-width: 1px; }
.cmd:hover:not(:disabled) { color: var(--bright); box-shadow: inset 0 0 0 1px var(--accent-2); }
.cmd:disabled { color: #3c4756; }
.cmd.empty { background: rgba(255, 255, 255, 0.015); }
.cmd::after { content: ""; position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, 0.65) calc(var(--cd) * 360deg), transparent 0); pointer-events: none; }
.cmd.active { color: var(--bright); box-shadow: inset 0 0 0 1px var(--good), 0 0 12px rgba(94, 240, 154, 0.35); }

#p-build { flex: 0 0 466px; padding: 0 10px 8px; display: flex; flex-direction: column; }
#tabs { display: flex; gap: 2px; margin: 0 -10px 8px; border-bottom: 1px solid var(--edge); }
#tabs button { padding: 7px 16px 6px; color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; font-size: 11px; }
#tabs button.on { color: var(--bright); box-shadow: inset 0 -2px 0 var(--accent); }
#build-body { flex: 1; display: grid; grid-template-columns: repeat(5, 84px); grid-auto-rows: 76px; gap: 5px; overflow: hidden; align-content: start; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; background: linear-gradient(180deg, #151d27, #0c1117); box-shadow: inset 0 0 0 1px var(--edge); overflow: hidden; text-align: center; }
.card img { width: 84px; height: 44px; object-fit: contain; margin-top: 2px; }
.card .glyph { height: 44px; display: flex; align-items: center; justify-content: center; color: var(--accent-2); }
.card .glyph svg { width: 28px; height: 28px; }
.card .nm { font-size: 10.5px; line-height: 1.1; color: var(--bright); padding: 0 3px; height: 24px; overflow: hidden; display: flex; align-items: center; }
.card .sub { display: none; }
.card .cost { position: absolute; left: 4px; top: 2px; font-size: 10px; color: #ffd36a; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.card .hot { position: absolute; right: 3px; top: 2px; font-size: 9px; color: var(--dim); }
.card:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--accent-2); background: linear-gradient(180deg, #1b2532, #0e141b); }
.card:disabled { opacity: 0.45; }
.card.done { opacity: 0.55; }
.card.done .cost { color: var(--good); }
.card.locked { opacity: 1; }
.card.locked > *:not(.lock) { opacity: 0.25; }
.card .lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--dim); }
.card .lock svg { width: 20px; height: 20px; }
.card .lock em { font-style: normal; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.hint { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; color: var(--dim); font-size: 12.5px; }
.hint svg { width: 34px; height: 34px; flex: none; color: var(--accent-2); }
.hint p { margin: 0; }
.hint b { color: var(--bright); font-weight: 500; }
#queues { display: flex; gap: 4px; align-items: center; height: 34px; margin-top: 6px; border-top: 1px solid var(--edge); padding-top: 6px; font-size: 12px; }
.qi { position: relative; width: 40px; height: 28px; box-shadow: inset 0 0 0 1px var(--edge); background: #10161e; overflow: hidden; }
.qi img { width: 40px; height: 26px; object-fit: contain; }
.qi .glyph svg { width: 18px; height: 18px; margin-top: 4px; color: var(--accent-2); }
.qi i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent-2); }
.qi:hover { box-shadow: inset 0 0 0 1px var(--bad); }

#reserve-bar { position: fixed; right: 6px; bottom: 256px; width: 466px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; pointer-events: auto; }
#reserve { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.ri { width: 46px; height: 32px; box-shadow: inset 0 0 0 1px var(--edge); background: #10161e; }
.ri img { width: 46px; height: 30px; object-fit: contain; }
.ri:hover { box-shadow: inset 0 0 0 1px var(--good); }
#btn-deploy-all { padding: 7px 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 60%, #000), color-mix(in srgb, var(--accent) 30%, #000)); color: var(--bright); letter-spacing: 0.06em; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, #fff); }

#tooltip { position: fixed; z-index: 30; max-width: 300px; padding: 8px 11px; pointer-events: none; background: rgba(7, 10, 15, 0.96); box-shadow: inset 0 0 0 1px var(--edge-hi); font-size: 12.5px; color: var(--text); }
#tooltip b { display: block; color: var(--bright); font-size: 14px; font-weight: 600; margin-bottom: 1px; }
#tooltip em { display: block; font-style: normal; color: var(--dim); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
#tooltip .warn { color: var(--warn); }

/* ------------------------------------------------------------ Menüs */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 60%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.75)); z-index: 20; }
.panel { padding: 26px 30px; width: 980px; overflow: hidden; }
.panel.small { width: min(480px, 94vw); text-align: center; }
.panel h1 { margin: 0 0 6px; font-weight: 300; font-size: 40px; letter-spacing: 0.3em; color: var(--bright); }
.panel h2 { margin: 6px 0 12px; font-weight: 400; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
button.primary { padding: 10px 28px; color: var(--bright); letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, #000), color-mix(in srgb, var(--accent) 35%, #000));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 80%, #fff); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
button.primary:hover { filter: brightness(1.2); }
button.ghost { padding: 9px 22px; color: var(--text); letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; box-shadow: inset 0 0 0 1px var(--edge-hi); }
button.ghost:hover { color: var(--bright); box-shadow: inset 0 0 0 1px var(--accent-2); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; font-size: 13px; margin-bottom: 14px; }
.help-text { font-size: 13px; line-height: 1.5; color: var(--text); }
.help-text b { color: var(--bright); font-weight: 500; }
#help .panel { text-align: left; }
#help .primary { margin-top: 8px; }

.title-screen { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: absolute; left: 9vw; top: 0; bottom: 0; }
.title-screen h1 { margin: 0; font-weight: 200; font-size: clamp(46px, 7vw, 92px); letter-spacing: 0.32em; color: var(--bright); text-shadow: 0 0 40px rgba(120, 170, 255, 0.25); }
.title-screen .tag { margin: 6px 0 46px 6px; letter-spacing: 0.4em; text-transform: uppercase; font-size: 12px; color: var(--dim); }
.title-screen nav { display: flex; flex-direction: column; gap: 4px; }
.title-screen nav button { text-align: left; font-size: 20px; letter-spacing: 0.18em; text-transform: uppercase; padding: 8px 0 8px 16px; color: var(--text); border-left: 2px solid transparent; }
.title-screen nav button:hover:not(:disabled) { color: var(--bright); border-left-color: var(--accent); background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent); }
.title-screen nav button:disabled { color: #3c4656; }
.title-screen nav button small { font-size: 11px; letter-spacing: 0.1em; margin-left: 10px; color: var(--dim); }
.title-screen .foot { position: absolute; bottom: 26px; font-size: 11px; color: var(--dim); letter-spacing: 0.08em; }

.setup { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.maps { display: flex; flex-direction: column; gap: 4px; }
.maps button { text-align: left; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--edge); display: flex; justify-content: space-between; }
.maps button.on { box-shadow: inset 0 0 0 1px var(--accent-2); background: rgba(255, 255, 255, 0.04); color: var(--bright); }
.maps button small { color: var(--dim); }
.preview { margin-top: 10px; }
.preview canvas { width: 300px; height: 300px; display: block; box-shadow: inset 0 0 0 1px var(--edge); }
.preview p { font-size: 12.5px; color: var(--dim); margin: 8px 0 0; }
.slots { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.slots td { padding: 5px 6px; border-bottom: 1px solid rgba(160, 182, 214, 0.08); }
.slots th { text-align: left; font-weight: 400; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); padding: 4px 6px; }
select { font: inherit; color: var(--bright); background: #0f151d; border: 0; box-shadow: inset 0 0 0 1px var(--edge-hi); padding: 5px 8px; }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; transform: rotate(45deg); }
.opts { display: flex; gap: 20px; flex-wrap: wrap; margin: 8px 0 18px; }
.opts label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.factions-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.factions-info div { padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--edge); font-size: 12.5px; color: var(--dim); }
.factions-info b { display: block; color: var(--bright); font-size: 15px; font-weight: 500; margin-bottom: 3px; }
.row-end { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mode-info { font-size: 11px; color: var(--dim); }

#error { position: fixed; left: 10px; bottom: 10px; right: 10px; background: #3a0d0d; border: 1px solid #a33; padding: 10px; font: 12px ui-monospace, monospace; white-space: pre-wrap; z-index: 99; }
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); z-index: 25; background: rgba(0, 0, 0, 0.6); }


.teams { display: flex; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.teams label { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); padding: 6px 10px; box-shadow: inset 0 0 0 1px var(--edge); }
.slots tr.closed td { color: #4a5464; }
.slots tr.closed select { color: #6a7484; }

.warn-small { color: var(--warn); font-size: 11px; margin-left: 6px; }

.card.pressed { box-shadow: inset 0 0 0 2px var(--good) !important; }

.st.hero { color: #ffd24a; box-shadow: inset 0 0 0 1px rgba(255,210,74,0.5); }

.stat, .stat b, #tech-progress .tp { white-space: nowrap; }

#tech-progress { overflow: hidden; max-width: 46vw; }
#tech-progress .more { font-weight: 500; font-size: 11px; color: var(--accent-2); margin-left: 4px; }
#tech-progress span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

/* UI-Skalierung: --ui wird per Skript aus Fenstergröße bzw. Einstellung gesetzt */
:root { --ui: 1; }
#hud > * { zoom: var(--ui); }
#bottom.collapsed > section { display: none; }
.hidden-part { display: none !important; }
.panel.left { text-align: left; }
#settings .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid rgba(160, 182, 214, 0.08); font-size: 13px; }
#settings .row input { width: 16px; height: 16px; accent-color: var(--accent); }
#settings .row:has(input) { justify-content: flex-start; }

/* Ein Spiel hat keine Scrollbalken */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
#selection, #sel-body, .tiles, #queues, #reserve, #notify, #bottom, #bottom > section, #hud { overflow: hidden; }
/* Menüs werden wie das HUD gleichmäßig skaliert */
.screen > .panel, .screen > .title-screen { zoom: var(--ui-menu, 1); }
.pager { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.pager button { width: 26px; height: 24px; color: var(--dim); box-shadow: inset 0 0 0 1px var(--edge); }
.pager button:hover:not(:disabled) { color: var(--bright); box-shadow: inset 0 0 0 1px var(--accent-2); }
.pager button:disabled { opacity: 0.3; }
.pager span { font-size: 10px; color: var(--dim); min-width: 28px; text-align: center; }
.tile.more { display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--dim); }

/* Einstellungen: zwei Spalten (Grafik | Anzeige), keine Bildlaufleiste */
#settings .settings-panel { width: 760px; max-width: 94vw; }
#settings .settings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
#settings .row select { background: rgba(10, 16, 26, 0.9); color: inherit; border: 1px solid rgba(160, 182, 214, 0.25); padding: 3px 6px; font: inherit; }
#settings .row-btn { margin-top: 10px; width: 100%; padding: 7px; background: rgba(40, 60, 90, 0.5); color: inherit; border: 1px solid rgba(160, 182, 214, 0.3); font: inherit; cursor: pointer; }
#settings .row-btn:hover { background: rgba(60, 90, 130, 0.6); }

ul.help-text { margin: 6px 0 14px 18px; padding: 0; line-height: 1.5; }

/* Spielmenü und Speicherhinweis */
.gamemenu-panel { width: 340px; display: flex; flex-direction: column; gap: 10px; }
.gamemenu-panel h2 { margin: 0 0 6px; }
.gamemenu-panel button { padding: 10px; background: rgba(40, 60, 90, 0.5); color: inherit; border: 1px solid rgba(160, 182, 214, 0.3); font: inherit; cursor: pointer; }
.gamemenu-panel button:hover { background: rgba(60, 90, 130, 0.6); }
.gamemenu-panel button.primary { background: rgba(70, 120, 180, 0.55); }
.gamemenu-panel button.danger { margin-top: 10px; border-color: rgba(220, 90, 70, 0.5); color: #f0b0a0; }
#flash { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 30; padding: 8px 18px; background: rgba(8, 14, 22, 0.9); border: 1px solid rgba(160, 182, 214, 0.35); font-size: calc(14px * var(--ui, 1)); pointer-events: none; }
/* Spielstände im Hauptmenü */
.saves-panel { width: 820px; max-width: 94vw; }
.saves-list { max-height: 58vh; overflow: auto; margin: 10px 0 14px; border-top: 1px solid rgba(160, 182, 214, 0.15); }
.saves-list .save { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid rgba(160, 182, 214, 0.1); }
.saves-list .save b { display: block; }
.saves-list .save small { opacity: 0.7; }
.saves-list .save .acts { display: flex; gap: 6px; }
.saves-list .save button, .saves-foot button, .saves-foot label { padding: 6px 12px; background: rgba(40, 60, 90, 0.5); color: inherit; border: 1px solid rgba(160, 182, 214, 0.3); font: inherit; cursor: pointer; }
.saves-list .save button.primary { background: rgba(70, 120, 180, 0.6); }
.saves-list .empty { padding: 20px 4px; opacity: 0.7; }
.saves-foot { display: flex; gap: 8px; justify-content: space-between; }
.saves-foot input[type=file] { display: none; }

/* Karteneditor */
.editor-panel { width: min(1240px, calc(94vw / var(--ui-menu, 1))); max-width: none; box-sizing: border-box; }
.ed-grid { display: grid; grid-template-columns: 210px 1fr 270px; gap: 18px; align-items: start; }
.ed-list { display: flex; flex-direction: column; gap: 6px; max-height: 72vh; overflow: auto; }
.ed-list button, .ed-file, .ed-actions button, .ed-tools button { padding: 7px 10px; background: rgba(40, 60, 90, 0.45); color: inherit; border: 1px solid rgba(160, 182, 214, 0.28); font: inherit; cursor: pointer; text-align: left; }
.ed-list button small { display: block; opacity: 0.6; font-size: 11px; }
.ed-list button.on, .ed-tools button.on { background: rgba(80, 130, 190, 0.6); border-color: rgba(190, 215, 245, 0.6); }
.ed-list button.primary, .ed-actions button.primary { background: rgba(70, 120, 180, 0.6); }
.ed-file input { display: none; }
.ed-main { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.ed-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.ed-tools button { width: 40px; height: 36px; text-align: center; font-size: 17px; padding: 0; }
#ed-cv { display: block; border: 1px solid rgba(160, 182, 214, 0.25); cursor: crosshair; }
.ed-hint { font-size: 11px; opacity: 0.6; text-align: center; }
.ed-props { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ed-props label { display: flex; flex-direction: column; gap: 3px; }
.ed-props input, .ed-props textarea, .ed-props select { background: rgba(10, 16, 26, 0.9); color: inherit; border: 1px solid rgba(160, 182, 214, 0.25); padding: 5px 7px; font: inherit; resize: vertical; }
.ed-stats { opacity: 0.75; font-size: 12px; }
.ed-probs .warn { color: #f0c070; font-size: 12px; margin: 2px 0; }
.ed-probs .ok { color: #8fd08f; font-size: 12px; }
.ed-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ed-actions button { text-align: center; }
.ed-actions button.danger { border-color: rgba(220, 90, 70, 0.5); color: #f0b0a0; }
.ed-actions button.ghost { background: transparent; }
.maps button.custom { border-style: dashed; }

/* Werkstatt (eigene Fraktionen) */
.workshop-panel { width: min(1240px, calc(94vw / var(--ui-menu, 1))); max-width: none; box-sizing: border-box; }
.ws-grid { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
.ws-list { display: flex; flex-direction: column; gap: 6px; max-height: 74vh; overflow: auto; }
.ws-new { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid rgba(160, 182, 214, 0.15); }
.ws-list button, .ws-file, .ws-actions button, .ws-tabs button, .ws-ulist button, .ws-form button, .ws-add button { padding: 7px 10px; background: rgba(40, 60, 90, 0.45); color: inherit; border: 1px solid rgba(160, 182, 214, 0.28); font: inherit; cursor: pointer; text-align: left; }
.ws-list button small, .ws-ulist button small { display: block; opacity: 0.6; font-size: 11px; }
.ws-list button.on, .ws-tabs button.on, .ws-ulist button.on { background: rgba(80, 130, 190, 0.6); border-color: rgba(190, 215, 245, 0.6); }
.ws-list .sw { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 1px solid rgba(255, 255, 255, 0.4); }
.ws-file input { display: none; }
.ws-list select, .ws-form input, .ws-form textarea, .ws-form select, .ws-add select { background: rgba(10, 16, 26, 0.9); color: inherit; border: 1px solid rgba(160, 182, 214, 0.25); padding: 5px 7px; font: inherit; }
.ws-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ws-tabs { display: flex; gap: 4px; }
.ws-body { max-height: 62vh; overflow: auto; padding-right: 6px; }
.ws-form { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ws-form > label { display: flex; flex-direction: column; gap: 3px; }
.ws-form h3 { margin: 10px 0 0; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.75; font-weight: 500; }
.ws-form h3 small { text-transform: none; letter-spacing: 0; opacity: 0.7; }
.ws-colors { display: flex; gap: 14px; }
.ws-colors label { display: flex; flex-direction: column; gap: 3px; }
.ws-colors input { width: 60px; height: 30px; padding: 0; }
.ws-start { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-start span { display: flex; gap: 2px; }
.ws-start button { padding: 4px 8px; }
.ws-check, .ws-vis { flex-direction: row !important; align-items: center; gap: 8px !important; }
.ws-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ws-num { display: flex; flex-direction: column; gap: 2px; }
.ws-num small { opacity: 0.55; font-size: 10px; }
.ws-units { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.ws-ulist { display: flex; flex-direction: column; gap: 5px; }
.ws-add { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ws-add select { max-width: 220px; }
.ws-hp { border-collapse: collapse; }
.ws-hp td { padding: 2px 4px; }
.ws-abil { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-form button.danger, .ws-actions button.danger { border-color: rgba(220, 90, 70, 0.5); color: #f0b0a0; align-self: flex-start; }
.ws-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ws-actions button.primary { background: rgba(70, 120, 180, 0.6); }
.ws-actions button.ghost { background: transparent; }
#ws-code { font-family: Consolas, monospace; font-size: 12px; min-height: 380px; white-space: pre; }
.ws-empty { padding: 30px 10px; opacity: 0.85; }

/* Konto (Online-Version) */
.acct-corner { position: fixed; top: 22px; right: 28px; }
.acct-corner button { font-size: 14px; letter-spacing: 0.1em; padding: 8px 16px; border: 1px solid rgba(160, 182, 214, 0.3); background: rgba(10, 16, 26, 0.6); color: var(--text); cursor: pointer; }
.legal-foot { position: absolute; bottom: 8px; display: flex; gap: 14px; font-size: 11px; }
.legal-foot a { color: var(--dim); text-decoration: none; }
.legal-foot a:hover { color: var(--bright); }
#acct { z-index: 40; }
.acct-panel { width: 440px; max-width: 94vw; display: flex; flex-direction: column; gap: 10px; }
.acct-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
.acct-panel label.acct-check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--text); }
.acct-panel input:not([type=checkbox]) { background: rgba(10, 16, 26, 0.9); color: var(--text); border: 1px solid rgba(160, 182, 214, 0.25); padding: 7px 9px; font: inherit; }
.acct-panel h3 { margin: 8px 0 0; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.acct-panel a { color: var(--accent); }
.acct-links { font-size: 13px; }
.acct-row { display: flex; justify-content: flex-end; gap: 8px; }
.acct-row button { padding: 8px 16px; border: 1px solid rgba(160, 182, 214, 0.3); background: rgba(40, 60, 90, 0.5); color: inherit; font: inherit; cursor: pointer; }
.acct-row button.primary { background: rgba(70, 120, 180, 0.6); }
.acct-row button.ghost { background: transparent; }
.acct-out { font-size: 13px; }
.acct-out.err { color: #f0a090; }
.acct-out.ok { color: #8fd08f; }
.saves-list.cloud h3 { margin: 6px 0; font-size: 13px; letter-spacing: 0.1em; }

/* Mehrspieler */
.mp-only, .mp-host { display: none !important; }
body.multiplayer .mp-only { display: revert !important; }
body.multiplayer.is-host .mp-host { display: revert !important; }
body.multiplayer .sp-only { display: none !important; }
body.spectating #bottom, body.spectating #reserve-bar, body.spectating .tb-left, body.spectating #btn-comms { display: none !important; }
#feed { position: fixed; left: 18px; top: calc(70px * var(--ui, 1)); z-index: 6; display: flex; flex-direction: column; gap: 4px; pointer-events: none; font-size: calc(14px * var(--ui, 1)); text-shadow: 0 1px 3px #000, 0 0 8px #000; }
#feed div { transition: opacity 1.5s; }
#feed div.fade { opacity: 0; }
#mp-players { position: fixed; right: 14px; top: calc(64px * var(--ui, 1)); z-index: 6; background: rgba(6, 10, 16, 0.6); border: 1px solid rgba(160, 182, 214, 0.15); padding: 6px 10px; font-size: calc(12px * var(--ui, 1)); min-width: 150px; }
#mp-players div { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
#mp-players i { width: 9px; height: 9px; display: inline-block; }
#mp-players small { color: #e0b070; }
#comms { position: fixed; right: 14px; top: calc(200px * var(--ui, 1)); z-index: 12; background: rgba(8, 12, 20, 0.94); border: 1px solid rgba(160, 182, 214, 0.3); padding: 10px; width: calc(260px * var(--ui, 1)); font-size: calc(13px * var(--ui, 1)); }
.comms-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
#comms-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#comms-list button { padding: 6px; background: rgba(40, 60, 90, 0.5); border: 1px solid rgba(160, 182, 214, 0.25); color: inherit; font: inherit; cursor: pointer; text-align: left; }
#comms .hint { margin: 8px 0 0; font-size: 0.85em; opacity: 0.7; }
.mp-panel { width: 860px; max-width: 94vw; }
.mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 14px; }
.mp-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid rgba(160, 182, 214, 0.15); background: rgba(10, 16, 26, 0.5); }
.mp-box h3 { margin: 4px 0; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.mp-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
.mp-box input { background: rgba(10, 16, 26, 0.9); color: var(--text); border: 1px solid rgba(160, 182, 214, 0.25); padding: 7px 9px; font: inherit; }
#mp-code { font-size: 22px; letter-spacing: 0.3em; text-transform: uppercase; }
.mp-box .row { display: flex; gap: 8px; }
.mp-box button, .lobby button { padding: 7px 14px; background: rgba(40, 60, 90, 0.5); border: 1px solid rgba(160, 182, 214, 0.3); color: inherit; font: inherit; cursor: pointer; }
.mp-box button.primary, .lobby button.primary { background: rgba(70, 120, 180, 0.6); }
.lobby button.danger { border-color: rgba(220, 90, 70, 0.5); color: #f0b0a0; background: transparent; }
.lobby button.ghost { background: transparent; }
.small { font-size: 12px; }
.mp-saved .save { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(160, 182, 214, 0.1); }
.mp-saved .save small { display: block; opacity: 0.7; }
.mp-saved .acts { display: flex; gap: 4px; }
#mp-msg { color: #f0b070; }
.lobby { width: min(1240px, calc(94vw / var(--ui-menu, 1))); max-width: none; box-sizing: border-box; }
.lobby h2 small { color: var(--dim); margin-left: 8px; }
.lobby-grid { display: grid; grid-template-columns: 240px 1fr 240px; gap: 18px; align-items: start; }
.lobby .slots tr.me td { background: rgba(80, 130, 190, 0.15); }
.lobby .slots b.on { color: #8fd08f; }
.lobby .slots b.off { color: #b08a6a; }
.lobby-side { display: flex; flex-direction: column; gap: 10px; }
.lobby-side .code { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid rgba(160, 182, 214, 0.25); background: rgba(10, 16, 26, 0.6); }
.lobby-side .code b { font-size: 34px; letter-spacing: 0.25em; color: var(--bright); }
.lobby-side .specs { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.lobby-side .specs li.off { opacity: 0.5; }
.lobby-side button.big { padding: 12px; font-size: 15px; }
.lobby .opts label.check { flex-direction: row; align-items: center; gap: 6px; }
/* Werft (3D-Editor in der Werkstatt) */
.ws-yard { display: grid; grid-template-columns: 1fr 230px; gap: 10px; }
#ws-yard { width: 100%; height: 340px; display: block; background: radial-gradient(ellipse at 50% 40%, #16243a, #070b12 75%); border: 1px solid rgba(160, 182, 214, 0.2); cursor: crosshair; touch-action: none; }
.ws-yard-side { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.ws-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ws-tools button { padding: 5px 6px !important; font-size: 11px; text-align: left; }
.ws-tools button.on { background: rgba(80, 130, 190, 0.7) !important; border-color: rgba(190, 215, 245, 0.7) !important; }
#ws-selbox { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid rgba(160, 182, 214, 0.15); }
#ws-selbox label { display: flex; flex-direction: column; gap: 2px; }
.ws-rot { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ws-rot button { padding: 4px 8px !important; }
.mp-ctl { margin-left: auto; display: inline-flex; gap: 2px; }
.mp-ctl button { padding: 0 5px; font-size: 10px; background: rgba(40, 60, 90, 0.6); border: 1px solid rgba(160, 182, 214, 0.3); color: inherit; cursor: pointer; }
#mp-wait { position: fixed; top: 30%; left: 50%; transform: translateX(-50%); z-index: 15; background: rgba(6, 10, 16, 0.92); border: 1px solid rgba(160, 182, 214, 0.35); padding: 16px 26px; font-size: calc(18px * var(--ui, 1)); text-align: center; }
#mp-wait small { display: block; font-size: 0.65em; opacity: 0.7; margin-top: 6px; }
.mp-mine { margin-bottom: 14px; border-color: rgba(90, 160, 230, 0.5); }
.mp-mine .save { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; }
.mp-mine small { display: block; opacity: 0.75; }

/* Online-Werkstatt (Hub) */
.hub-panel { width: min(1240px, calc(94vw / var(--ui-menu, 1))); max-width: none; box-sizing: border-box; max-height: 88vh; overflow: auto; }
.hub-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.hub-bar .grow, .row-end .grow { flex: 1; }
.hub-bar input, .hub-bar select { background: rgba(10, 16, 26, 0.9); color: var(--text); border: 1px solid rgba(160, 182, 214, 0.25); padding: 7px 9px; font: inherit; }
.hub-bar button, .hub-panel button, .ws-pub button, .ws-hubbtn { padding: 7px 12px; background: rgba(40, 60, 90, 0.5); border: 1px solid rgba(160, 182, 214, 0.3); color: inherit; font: inherit; cursor: pointer; }
.hub-panel button.primary, .ws-pub button.primary { background: rgba(70, 120, 180, 0.6); }
.hub-panel button.ghost, .ws-pub button.ghost { background: transparent; }
.hub-panel button.danger { border-color: rgba(220, 90, 70, 0.5); color: #f0b0a0; background: transparent; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.hub-card { display: flex !important; flex-direction: column; gap: 4px; text-align: left; padding: 0 0 10px !important; overflow: hidden; }
.hub-card b, .hub-card small, .hub-card span { padding: 0 10px; }
.hub-card small { opacity: 0.65; font-size: 11px; }
.hub-card span { font-size: 12px; opacity: 0.85; }
.cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1a2a44, #0a1018) center / cover no-repeat; }
.cover.big { width: 420px; flex: none; border: 1px solid rgba(160, 182, 214, 0.2); }
.hub-head { display: flex; gap: 18px; margin-bottom: 14px; }
.hub-head h2 { margin: 0 0 6px; color: var(--bright); font-size: 22px; letter-spacing: 0.05em; text-transform: none; }
.hub-desc { margin-bottom: 14px; line-height: 1.55; }
.hub-units { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.hub-units th { text-align: left; font-weight: 500; color: var(--dim); padding: 4px 6px; }
.hub-units td { padding: 4px 6px; border-top: 1px solid rgba(160, 182, 214, 0.1); }
.hub-units img { width: 96px; height: 60px; object-fit: cover; display: block; }
.hub-3d { width: min(900px, 92vw); }
#hd-cv { width: 100%; height: 520px; display: block; background: radial-gradient(ellipse at 50% 40%, #16243a, #070b12 75%); }
.row-end { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.ws-ro { color: #e0b070; font-size: 13px; margin-right: auto; }
.ws-hubbtn { margin-top: 10px; }
.ws-pub { width: 620px; max-width: 94vw; display: flex; flex-direction: column; gap: 10px; }
.ws-pub label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
.ws-pub input:not([type=checkbox]):not([type=file]), .ws-pub textarea { background: rgba(10, 16, 26, 0.9); color: var(--text); border: 1px solid rgba(160, 182, 214, 0.25); padding: 7px 9px; font: inherit; }
.ws-pub .ws-cover img { width: 100%; }
.ws-pub .ws-out { margin-right: auto; font-size: 13px; color: #e0b070; }
