/* ════════ Hauptbildschirm = Karte, alles andere schwebt darüber ════════ */
#game { position: fixed; inset: 0; display: block; overflow: hidden; }
#game .map-wrap { position: absolute; inset: 0; }
.hud-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; border-radius: 14px;
  background: rgba(17, 23, 32, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.08); z-index: 5; }
.hud-stats { display: flex; align-items: center; gap: 6px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill:hover { background: rgba(255,255,255,.09); }
.pill.gold { color: #f3cf6d; }
.mini { display: inline-block; width: 34px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.mini i { display: block; height: 100%; background: linear-gradient(90deg, #3bb36f, #8ad84c); }
.who { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.who i { width: 9px; height: 9px; border-radius: 50%; }

.dock { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; border-radius: 18px; z-index: 5;
  background: rgba(17, 23, 32, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.dock button { display: grid; justify-items: center; gap: 2px; min-width: 64px; border: 0; background: none; border-radius: 12px; padding: 7px 10px; color: var(--muted); }
.dock button .ic { font-size: 18px; line-height: 1; }
.dock button b { font-size: 12px; font-weight: 600; }
.dock button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.dock button.on { background: var(--accent); color: #1b1404; }
#game .zoom { position: absolute; right: 14px; bottom: 14px; z-index: 5; }

.region-card { position: absolute; left: 14px; bottom: 14px; width: 300px; z-index: 6; padding: 16px; border-radius: 16px;
  background: rgba(17, 23, 32, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.region-card[hidden] { display: none; }
.region-card h3 { margin: 0 24px 2px 0; font-size: 20px; }
.region-card .sub-line { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.region-card .hint { margin-top: 8px; }
.region-card .btns button { flex: 1; }
.region-card button:not(.primary):not(.card-close) { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px; }
.card-close { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--muted); font-size: 16px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv span { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0; }
.warn { color: var(--danger); font-weight: 600; }

/* Fenster */
.win-layer { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 76px 16px 90px; background: rgba(4, 7, 11, .35); }
.win-layer[hidden] { display: none; }
.win { width: min(640px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: #131a24; border: 1px solid rgba(255,255,255,.09); box-shadow: 0 30px 80px rgba(0,0,0,.55); animation: win-in .16s ease-out; }
.win.wide { width: min(1080px, 100%); }
@keyframes win-in { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.win-head { display: flex; align-items: center; gap: 16px; padding: 14px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.win-head h2 { margin: 0; font-size: 20px; text-transform: none; letter-spacing: -.01em; color: var(--text); }
.win-tabs { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 10px; }
.win-tabs:empty { display: none; }
.win-tabs button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.win-tabs button.on { background: var(--line); color: var(--text); }
.win-close { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 18px; width: 34px; height: 34px; border-radius: 10px; }
.win-close:hover { background: var(--line); color: var(--text); }
.win-body { padding: 18px 22px 22px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.win-body h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.win-body .box h3:not(:first-child) { margin-top: 16px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.win-body label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.win-body label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.win-body select, .win-body input:not([type=checkbox]) { font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-width: 0; }
.win-body button:not(.primary):not(.mk):not([data-side]) { border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--text); border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 500; transition: background .15s, border-color .15s, color .15s; }
.win-body button:not(.primary):not(.mk):not([data-side]):hover:not(:disabled) { background: rgba(255,255,255,.08); border-color: #33415a; }
.win-body button:disabled { opacity: .4; cursor: not-allowed; }
.win-body .primary { padding: 10px 14px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bar { position: relative; height: 22px; border-radius: 11px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--good, #4cc38a); transition: width .4s; }
.bar span { position: relative; display: block; text-align: center; font-size: 13px; line-height: 20px; font-weight: 600; }
.bar.big { height: 26px; border-radius: 13px; }
.bar.big span { line-height: 24px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 6px; }
.tbl td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl td:last-child, .tbl th:last-child { text-align: right; }
.tbl small { color: var(--muted); }
.tbl tr.mine td { background: rgba(224,180,76,.07); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.co-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.company .kv { margin: 8px 0; }
.row-in { display: flex; gap: 6px; margin-top: 8px; }
.row-in input { flex: 1; }
.row-in button { flex: none; }
.up { color: #4cd38a; } .down { color: #ef6a5b; }
#online-list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0; }
.row .n { margin-left: auto; color: var(--muted); }

/* Markt */
.market { display: grid; grid-template-columns: 240px 1fr; gap: 16px; min-height: 0; }
.mk-list { display: grid; gap: 4px; align-content: start; }
.mk-list .hint { margin: 2px 2px 8px; }
.mk-country { margin-bottom: 4px; }
.mk { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: 8px 10px; }
.mk b { font-size: 14px; } .mk small { grid-row: 2; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mk span { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 12px; font-weight: 600; }
.mk:hover { background: rgba(255,255,255,.04); }
.mk.on { background: var(--panel); border-color: var(--line); }
.mk-detail { display: grid; gap: 14px; min-width: 0; align-content: start; }
.mk-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mk-head h3 { font-size: 20px; text-transform: none; letter-spacing: -.01em; color: var(--text); margin: 0; }
.big-price { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.big-price small { font-size: 15px; color: var(--muted); margin-left: 4px; }
.chart { width: 100%; height: 120px; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.chart.empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.chart text { fill: var(--muted); font-size: 10px; }
.up-line { fill: none; stroke: #4cd38a; stroke-width: 2; vector-effect: non-scaling-stroke; } .up-fill { fill: rgba(76,211,138,.12); }
.down-line { fill: none; stroke: #ef6a5b; stroke-width: 2; vector-effect: non-scaling-stroke; } .down-fill { fill: rgba(239,106,91,.12); }
.mk-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.book { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.book th { font-size: 11px; color: var(--muted); font-weight: 500; padding: 4px 6px; }
.book td { padding: 4px 6px; }
.book tr[data-price] { cursor: pointer; }
.book tr[data-price]:hover td { background: rgba(255,255,255,.04); }
.book tr.ask td:first-child { color: #ef6a5b; font-weight: 600; } .book tr.bid td:first-child { color: #4cd38a; font-weight: 600; }
.book td.depth { width: 28%; } .book td.depth i { display: block; height: 10px; border-radius: 3px; }
.book tr.ask .depth i { background: rgba(239,106,91,.35); } .book tr.bid .depth i { background: rgba(76,211,138,.35); }
.book tr.mid td { text-align: center; color: var(--muted); font-size: 12px; padding: 7px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.book small { color: var(--muted); margin-left: 4px; }
.bot { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(224,180,76,.15); color: #f3cf6d; }
.book-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px; min-width: 0; }
.order { display: grid; gap: 10px; align-content: start; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); padding: 3px; border-radius: 10px; }
.seg button { border: 0; background: none; padding: 8px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.seg button.on.buy { background: #2c8f5a; color: #fff; } .seg button.on.sell { background: #b8483c; color: #fff; }
.order .primary.buy { background: #3bb36f; color: #062012; } .order .primary.sell { background: #e2685a; color: #2a0804; }
.trades { display: grid; gap: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.trades div { display: grid; grid-template-columns: 60px 1fr 60px; color: var(--muted); }
.trades b { color: var(--text); }

#toast { bottom: 96px; }

@media (max-width: 760px) {
  .hud-top { top: 8px; left: 8px; right: 8px; padding: 6px 8px; gap: 8px; }
  .hud-top .logo, .hud-top .ticker, .who { display: none; }
  .hud-stats { width: 100%; justify-content: space-between; }
  .dock { bottom: 8px; left: 8px; right: 8px; transform: none; justify-content: space-between; }
  .dock button { min-width: 0; flex: 1; padding: 6px 2px; }
  #game .zoom { bottom: 84px; right: 8px; }
  .region-card { left: 8px; right: 8px; width: auto; bottom: 84px; }
  .win-layer { padding: 0; }
  .win, .win.wide { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .grid2, .grid3, .market, .mk-grid { grid-template-columns: 1fr; }
  .win-head { flex-wrap: wrap; padding: 12px 12px 10px 16px; }
  .win-tabs { order: 3; width: 100%; } .win-tabs button { flex: 1; }
  .win-body { padding: 14px; }
}

.hud-top .ticker { cursor: pointer; }

@media (max-width: 760px) { .dock { gap: 0; padding: 4px; } .dock button { padding: 5px 0; } .dock button b { font-size: 9.5px; } .dock button .ic { font-size: 16px; } }

/* Dock: Klappmenü „Mehr“ */
.dock-more { position: absolute; right: 0; bottom: calc(100% + 8px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.dock-more[hidden] { display: none; }
/* nie breiter als der Bildschirm (8 px Rand je Seite); das Dock selbst ist der Bezugsrahmen (position: absolute) */
.dock-more { box-sizing: border-box; max-width: calc(100vw - 16px); }
.dock-more button { min-width: 76px; }
