/* === Reich der Welten - Styles === */

:root {
  --bg-deep:    #07101a;
  --bg-dark:    #0e1620;
  --bg-mid:     #18222f;
  --bg-light:   #233140;
  --bg-panel:   #1b2735;
  --bg-panel-2: #213044;
  --border:     #2d4055;
  --border-soft:rgba(255, 255, 255, 0.06);
  --text:       #e6ecf2;
  --text-dim:   #97a8b9;
  --accent:     #f0b95c;
  --accent-strong: #ffcb6b;
  --accent-deep:   #8c5d18;
  --player:  #4aa3ff;
  --enemy:   #e8534d;
  --neutral: #c5c5c5;
  --success: #6dd47e;
  --danger:  #e8534d;
  --radius:    12px;
  --radius-sm: 10px;
  --shadow-1:  0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-2:  0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-3:  0 14px 50px rgba(0, 0, 0, 0.6);
  --ring-accent: 0 0 0 1px rgba(240, 185, 92, 0.5), 0 10px 30px rgba(240, 185, 92, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(74, 163, 255, 0.10), transparent 60%),
    radial-gradient(900px 700px at 90% 110%, rgba(240, 185, 92, 0.10), transparent 60%),
    radial-gradient(circle at top, #1a2839, #050a12);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, .btn {
  font-family: inherit;
}

#app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  height: 100dvh;
}

/* === Topbar === */
#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background:
    linear-gradient(180deg, rgba(34, 48, 66, 0.92), rgba(15, 22, 32, 0.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  z-index: 10;
  user-select: none;
  -webkit-user-select: none;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: linear-gradient(180deg, #ffd791 0%, #f0b95c 70%, #c89346 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand .subtitle {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  background: linear-gradient(180deg, rgba(50, 68, 90, 0.65), rgba(30, 42, 58, 0.65));
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 3px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.badge.phase {
  color: var(--accent);
}

/* === Buttons === */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background:
    linear-gradient(180deg, rgba(60, 80, 105, 0.95), rgba(36, 50, 68, 0.95));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 16px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.08s ease,
    box-shadow 0.18s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.28);
}

.btn:hover {
  background:
    linear-gradient(180deg, rgba(76, 100, 130, 0.98), rgba(46, 64, 87, 0.98));
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 16px rgba(0, 0, 0, 0.38);
}

.btn:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(240, 185, 92, 0.55),
    0 6px 14px rgba(0, 0, 0, 0.3);
}

.btn.primary {
  background:
    linear-gradient(180deg, #ffd084, #f0b95c 55%, #c98a2e);
  border-color: rgba(255, 220, 140, 0.45);
  color: #1a1208;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 4px 14px rgba(240, 185, 92, 0.32);
}

.btn.primary:hover {
  background:
    linear-gradient(180deg, #ffdc94, #ffcb6b 55%, #d99a3a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 8px 22px rgba(240, 185, 92, 0.45);
}

.btn.primary:active {
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.18);
}

.btn.small {
  padding: 6px 10px;
  min-height: 30px;
  font-size: 12px;
  border-radius: 8px;
}

/* === Parameter-Editor === */
.params-card {
  width: min(1000px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.params-body {
  overflow-y: auto;
  margin: 10px 0 14px;
  padding-right: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.param-unit {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 12px 14px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.param-unit-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.param-name { font-weight: 700; font-size: 15px; }
.param-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  font-weight: 700;
  font-family: Consolas, monospace;
  color: #0a1018;
  background: var(--accent);
}
.param-badge.dom-sea  { background: #5ab0e0; }
.param-badge.dom-air  { background: #c9a0f0; }
.param-badge.dom-land { background: #9ad06a; }
.param-badge.dom-other{ background: #d8b24a; }
.param-dom {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #b9c8d6;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 9px;
  border-radius: 999px;
}
.param-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
}
.param-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: #d2dde8;
}
.param-lbl { white-space: nowrap; }
.param-inp {
  width: 58px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
  text-align: right;
}
.param-inp:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(240, 185, 92, 0.25);
}
.param-inp.small { width: 46px; padding: 3px 5px; }
.param-vs-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.param-vs-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #8fa6bb;
  margin-bottom: 7px;
}
.param-vs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
}
.param-vs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  color: #b9c6d3;
}
.param-vs-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.param-vs.vs-pos .param-vs-lbl { color: #7fd089; }
.param-vs.vs-neg .param-vs-lbl { color: #e88b84; }
.params-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Aktiver Auto-Zug (KI übernimmt fortlaufend) — auffälliger „Stopp"-Zustand. */
.btn.running {
  background:
    linear-gradient(180deg, #f07a72, #e8534d 55%, #b23a35);
  border-color: rgba(255, 170, 160, 0.45);
  color: #2a0c0a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 0 0 rgba(232, 83, 77, 0.55);
  animation: autoPulse 1.4s ease-in-out infinite;
}

.btn.running:hover {
  background:
    linear-gradient(180deg, #f78d85, #ef6259 55%, #c4423c);
}

@keyframes autoPulse {
  0%,
  100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 0 rgba(232, 83, 77, 0.5); }
  50%  { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 6px rgba(232, 83, 77, 0); }
}

/* === Main Layout === */
#layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
  min-height: 0;
}

#map-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
}

/* WICHTIG: Der Map-Wrapper bleibt scrollbar (overflow: auto), das Canvas
   selbst wird in seiner nativen Pixelgröße (MAP_W*TILE × MAP_H*TILE) angezeigt.
   NICHT auf "max-width/max-height: 100%" umstellen — siehe README §10. */
#map-wrapper {
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, rgba(74, 163, 255, 0.07), transparent 65%),
    #060c14;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    var(--shadow-2);
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch; /* iOS-Momentum für das Wrapper-Scrolling */
}

#next-turn-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 200, 110, 0.96), rgba(180, 120, 40, 0.96));
  color: #1a1208;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 220, 140, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 10px 30px rgba(0, 0, 0, 0.45);
  text-align: center;
  pointer-events: none;
  animation: bannerPulse 1.6s ease-in-out infinite;
  z-index: 20;
}

#next-turn-banner.hidden {
  display: none;
}

#next-turn-banner .banner-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

#next-turn-banner .banner-sub {
  font-size: 11px;
  opacity: 0.78;
  margin-top: 2px;
}

#next-turn-banner kbd {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 11px;
}

@keyframes bannerPulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(255, 203, 107, 0.55); }
  50%      { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 12px rgba(255, 203, 107, 0); }
}

/* Canvas in nativer Pixelgröße (1:1). Skalierung verboten — siehe README §10. */
#map {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
  /* pan-x pan-y: Single-Finger-Drag scrollt den Wrapper auf iPad,
     Doppel-Tap-Zoom und Pinch-Zoom sind blockiert. Tap/Long-Press werden
     von unseren Pointer-Handlern in input.js verarbeitet. */
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;   /* iOS-Long-Press-Callout aus */
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

#legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 8px;
}

.leg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.sw.plain    { background: #8fc26b; }
.sw.forest   { background: #3e7a3e; }
.sw.mountain { background: #8b8b7b; }
.sw.water    { background: #2b5b8a; }
.sw.city     { background: var(--accent); }
.sw.fog      { background: #0c1218; }

/* === Sidebar === */
#sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  min-width: 0;
}

.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(33, 48, 68, 0.95), rgba(22, 32, 46, 0.95));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    var(--shadow-1);
}

.panel h2 {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel h2::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(240, 185, 92, 0.7);
}

.info {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.info .name {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.info .stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 12px;
}

.info .stat-label {
  color: var(--text-dim);
}

.fort-tag {
  background: rgba(74, 163, 255, 0.18);
  color: #8cc4ff;
  border: 1px solid rgba(74, 163, 255, 0.45);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-left: 4px;
  vertical-align: middle;
}

.fort-tag.skipped {
  background: rgba(151, 168, 185, 0.18);
  color: #c5d2df;
  border-color: rgba(151, 168, 185, 0.45);
}

.fort-tag.goto {
  background: rgba(240, 185, 92, 0.18);
  color: #ffd178;
  border-color: rgba(240, 185, 92, 0.45);
}

.fort-tag.resting {
  background: rgba(120, 200, 200, 0.18);
  color: #9dd;
  border-color: rgba(120, 200, 200, 0.45);
}

.actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.actions .btn {
  padding: 7px 12px;
  min-height: 32px;
  font-size: 12px;
}

/* === Production Panel === */
.prod-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prod-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(45, 60, 80, 0.6), rgba(30, 42, 58, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.prod-item:hover {
  background:
    linear-gradient(180deg, rgba(58, 78, 102, 0.7), rgba(40, 56, 76, 0.7));
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.prod-item.active {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(240, 185, 92, 0.15), rgba(60, 80, 105, 0.4));
  box-shadow: 0 0 0 1px rgba(240, 185, 92, 0.35), 0 4px 16px rgba(240, 185, 92, 0.15);
}

.prod-item .cost {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.prod-item .desc {
  font-size: 11px;
  color: var(--text-dim);
  grid-column: 1 / -1;
  margin-top: 4px;
  line-height: 1.45;
}

/* === City Lists === */
.city-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.city-list li {
  background: rgba(30, 42, 58, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.city-list li:hover {
  background: rgba(58, 78, 102, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.city-list li .prod-status {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

/* === Log === */
#logbar {
  background:
    linear-gradient(180deg, rgba(22, 32, 46, 0.95), rgba(14, 22, 32, 0.95));
  border-top: 1px solid var(--border-soft);
  padding: 10px 18px;
  max-height: 150px;
  display: flex;
  flex-direction: column;
}

#logbar h2 {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--accent);
  margin-bottom: 6px;
}

#log {
  font-size: 12px;
  line-height: 1.55;
  overflow-y: auto;
  flex: 1;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  color: var(--text-dim);
}

#log .entry {
  padding: 1px 0;
}

#log .entry.player { color: var(--player); }
#log .entry.enemy  { color: var(--enemy); }
#log .entry.system { color: var(--accent); }
#log .entry.combat { color: #f5cf6b; }
#log .entry.danger { color: var(--danger); }
#log .entry.success{ color: var(--success); }

/* === Overlay === */
#overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(20, 30, 45, 0.86), rgba(5, 9, 16, 0.94));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
}

#overlay.hidden {
  display: none;
}

#overlay-card {
  background:
    linear-gradient(180deg, rgba(40, 56, 78, 0.96), rgba(20, 30, 44, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 36px 44px;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    var(--shadow-3);
  max-width: 480px;
}

#overlay-card h2 {
  font-size: 28px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ffd791, #f0b95c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#overlay-card p {
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* === Versorgungs-Badge === */
.badge.supply {
  cursor: help;
  user-select: none;
}
.badge.supply.tier-versorgt {
  background: linear-gradient(180deg, rgba(109, 212, 126, 0.25), rgba(60, 130, 75, 0.15));
  border-color: rgba(109, 212, 126, 0.4);
  color: #c1f1ce;
}
.badge.supply.tier-unversorgt {
  background: linear-gradient(180deg, rgba(232, 83, 77, 0.22), rgba(120, 40, 38, 0.15));
  border-color: rgba(232, 83, 77, 0.4);
  color: #f5b1ad;
}

/* === Modale Dialoge === */
.modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(20, 30, 45, 0.78), rgba(5, 9, 16, 0.92));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal.hidden {
  display: none;
}
.modal-card {
  background:
    linear-gradient(180deg, rgba(40, 56, 78, 0.97), rgba(20, 30, 44, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    var(--shadow-3);
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}
.modal-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  background: linear-gradient(180deg, #ffd791, #f0b95c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.55;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Map-Type-Auswahl */
.map-type-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
.map-type-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(50, 68, 92, 0.7), rgba(30, 42, 58, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  touch-action: manipulation;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.08s ease, box-shadow 0.18s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    var(--shadow-1);
}
.map-type-card:hover,
.map-type-card:focus-visible {
  outline: none;
  background:
    linear-gradient(180deg, rgba(70, 92, 122, 0.85), rgba(42, 60, 82, 0.85));
  border-color: rgba(240, 185, 92, 0.5);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 28px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(240, 185, 92, 0.18);
}
.map-type-card:active {
  transform: translateY(0);
}
.map-type-card .mt-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.2px;
}
.map-type-card .mt-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Capture-Dialog */
.capture-card {
  max-width: 600px;
}
.capture-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}
.capture-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(50, 68, 92, 0.7), rgba(30, 42, 58, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  touch-action: manipulation;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    var(--shadow-1);
}
.capture-option:hover {
  background:
    linear-gradient(180deg, rgba(70, 92, 122, 0.85), rgba(42, 60, 82, 0.85));
  border-color: rgba(240, 185, 92, 0.45);
  transform: translateY(-1px);
}
.capture-option.active {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(240, 185, 92, 0.18), rgba(60, 80, 105, 0.55));
  box-shadow: var(--ring-accent);
}
.capture-option .cap-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.capture-option .cap-name {
  font-weight: 700;
  font-size: 14px;
}
.capture-option .cap-sym {
  color: var(--accent);
  font-weight: normal;
}
.capture-option .cap-cost {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.capture-option .cap-stat {
  font-size: 11px;
  color: var(--text-dim);
}
.capture-option .cap-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
}

/* === Startmenü === */
#main-menu {
  background:
    radial-gradient(1100px 700px at 30% 20%, rgba(240, 185, 92, 0.18), transparent 55%),
    radial-gradient(900px 700px at 80% 90%, rgba(74, 163, 255, 0.14), transparent 60%),
    radial-gradient(circle at center, rgba(20, 30, 45, 0.92), rgba(5, 9, 16, 0.98));
}

.menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  background:
    linear-gradient(180deg, rgba(40, 56, 78, 0.85), rgba(15, 23, 34, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 52px 64px 40px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 30px 80px rgba(0, 0, 0, 0.6);
  max-width: 520px;
  width: 100%;
}

.menu-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.menu-title-main {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
  background: linear-gradient(180deg, #ffe5b1 0%, #f0b95c 55%, #b07626 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 16px rgba(240, 185, 92, 0.35));
}

.menu-title-sub {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.menu-btn {
  width: 100%;
  padding: 14px 18px;
  min-height: 50px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 14px;
}

.menu-footer {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.7;
}

/* === Slot-Picker === */
.slot-card {
  max-width: 620px;
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.slot-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(50, 68, 92, 0.7), rgba(30, 42, 58, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    var(--shadow-1);
}

.slot-row:hover {
  background:
    linear-gradient(180deg, rgba(70, 92, 122, 0.85), rgba(42, 60, 82, 0.85));
  border-color: rgba(240, 185, 92, 0.45);
  transform: translateY(-1px);
}

.slot-row.slot-auto {
  border-color: rgba(109, 212, 126, 0.35);
  background:
    linear-gradient(180deg, rgba(54, 92, 70, 0.55), rgba(30, 50, 38, 0.7));
}
.slot-row.slot-auto:hover {
  border-color: rgba(109, 212, 126, 0.7);
}

.slot-row.slot-empty {
  opacity: 0.85;
}
.slot-row.slot-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.slot-row.slot-disabled:hover {
  transform: none;
}

.slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd791, #f0b95c 55%, #c98a2e);
  color: #1a1208;
  font-weight: 800;
  font-size: 18px;
  flex: 0 0 44px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
}
.slot-row.slot-auto .slot-badge {
  background: linear-gradient(180deg, #b6f0c2, #6dd47e 60%, #3c8f4f);
  font-size: 13px;
  letter-spacing: 0.3px;
}

.slot-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.slot-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-meta {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.slot-empty-text {
  color: var(--text-dim);
  font-style: italic;
}

.slot-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.slot-action {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.slot-action:hover {
  background: rgba(232, 83, 77, 0.15);
  border-color: rgba(232, 83, 77, 0.5);
  color: #f5b1ad;
}

.slot-name-input {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slot-name-input label {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.slot-name-input input {
  background: rgba(15, 22, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.slot-name-input input:focus {
  outline: none;
  border-color: rgba(240, 185, 92, 0.5);
  background: rgba(20, 30, 44, 0.85);
  box-shadow: 0 0 0 2px rgba(240, 185, 92, 0.18);
}

/* === Credits === */
.credits-card {
  max-width: 520px;
}
.credits-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}
.credits-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: rgba(30, 42, 58, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
}
.credits-line .credits-role {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
}
.credits-thanks {
  margin-top: 8px;
  text-align: center;
  font-size: 14px;
  color: var(--accent-strong);
  font-style: italic;
  letter-spacing: 0.4px;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* === Responsiv für Tablets/Telefone === */
@media (max-width: 960px) {
  #topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .brand h1 { font-size: 17px; }
  .brand .subtitle { display: none; }

  #layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  #sidebar {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }
  #sidebar .panel {
    flex: 0 0 280px;
    max-height: 100%;
    overflow-y: auto;
  }

  #logbar {
    max-height: 110px;
    padding: 8px 14px;
  }
}

@media (max-width: 640px) {
  .controls {
    gap: 6px;
  }
  .btn {
    padding: 9px 12px;
    font-size: 12px;
  }
  .badge {
    padding: 6px 10px;
    font-size: 12px;
  }
}
