/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  font-family: 'Courier New', Courier, monospace;
  color: #e0d8c0;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   App Container
   ============================================================ */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
}

/* ============================================================
   Splash Screen
   ============================================================ */
#splash {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: radial-gradient(ellipse at center, #1a2a50 0%, #0d0d1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
  padding: 32px 24px;
  max-width: 340px;
  width: 100%;
}

.splash-logo {
  font-size: 3.5rem;
  margin-bottom: 12px;
  animation: trainPulse 2s ease-in-out infinite;
}

@keyframes trainPulse {
  0%, 100% { transform: scale(1) translateX(0); }
  50%       { transform: scale(1.08) translateX(4px); }
}

.splash-title {
  font-size: 2.4rem;
  font-weight: bold;
  letter-spacing: 6px;
  color: #f5a623;
  text-shadow: 0 0 20px rgba(245, 166, 35, 0.5);
  margin-bottom: 8px;
}

.splash-sub {
  font-size: 0.85rem;
  color: #a8b0c8;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.splash-divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f5a623, transparent);
  margin: 0 auto 16px;
}

.splash-year {
  font-size: 1.8rem;
  color: #e0d8c0;
  letter-spacing: 4px;
  margin-bottom: 20px;
  opacity: 0.7;
}

/* Schwierigkeit */
.difficulty-select {
  margin-bottom: 20px;
}
.difficulty-label {
  font-size: 0.72rem;
  color: #718096;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.difficulty-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 6px;
}
.diff-btn {
  flex: 1;
  padding: 8px 4px;
  background: #0d1a2e;
  border: 1px solid #2a3a5a;
  border-radius: 6px;
  color: #a8b0c8;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.diff-btn.active {
  background: #0f3460;
  border-color: #f5a623;
  color: #f5a623;
  font-weight: bold;
}
.diff-desc {
  font-size: 0.68rem;
  color: #4a5568;
  text-align: center;
  min-height: 1rem;
}

.splash-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-bottom: 10px;
  background: #0f3460;
  border: 2px solid #f5a623;
  border-radius: 8px;
  color: #f5a623;
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, transform 0.1s;
}

.splash-btn:active {
  background: #1a5a9a;
  transform: scale(0.97);
}

.splash-btn-sec {
  background: transparent;
  border-color: #4a5568;
  color: #a8b0c8;
  font-size: 0.85rem;
}

/* ============================================================
   Landscape Warning
   ============================================================ */
#orientation-warning {
  display: none;
  position: fixed;
  inset: 0;
  background: #1a1a2e;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

@media (orientation: landscape) {
  #orientation-warning {
    display: flex;
  }
}

.warning-content {
  text-align: center;
  color: #e0d8c0;
}

.warning-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: rotate90 2s ease-in-out infinite;
}

@keyframes rotate90 {
  0%, 100% { transform: rotate(0deg); }
  40%, 60% { transform: rotate(90deg); }
}

.warning-content p {
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ============================================================
   HUD (obere Leiste)
   ============================================================ */
#hud {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #16213e;
  border-bottom: 2px solid #0f3460;
  height: 52px;
  flex-shrink: 0;
}

#hud-money {
  display: flex;
  align-items: baseline;
  gap: 2px;
  min-width: 110px;
}

.hud-label {
  font-size: 0.75rem;
  color: #f5a623;
  font-weight: bold;
}

#hud-money-value {
  font-size: 1.1rem;
  font-weight: bold;
  color: #f5a623;
  letter-spacing: 0.5px;
}

#hud-date {
  font-size: 0.85rem;
  color: #a8b0c8;
  text-align: center;
}

#hud-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hud-btn {
  background: #0f3460;
  border: 1px solid #1a5a9a;
  color: #e0d8c0;
  font-size: 0.9rem;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  touch-action: manipulation;
}

.hud-btn:active {
  background: #1a5a9a;
}

.hud-btn.active {
  background: #e63946;
  border-color: #ff6b6b;
}

/* ============================================================
   Canvas-Bereich
   ============================================================ */
#canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #2d5016;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ============================================================
   Action Panel (Bottom Sheet)
   ============================================================ */
#action-panel {
  position: relative;
  z-index: 10;
  background: #16213e;
  border-top: 2px solid #0f3460;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#panel-handle {
  width: 40px;
  height: 4px;
  background: #4a5568;
  border-radius: 2px;
  margin: 8px auto 4px;
  cursor: pointer;
}

#panel-content {
  padding: 8px 12px 12px;
}

#panel-default-actions {
  display: flex;
  gap: 8px;
  justify-content: space-around;
}

.action-btn {
  flex: 1;
  background: #0f3460;
  border: 2px solid #1a5a9a;
  color: #e0d8c0;
  border-radius: 10px;
  padding: 10px 4px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 64px;
  touch-action: manipulation;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.action-btn:active {
  background: #1a5a9a;
  transform: scale(0.95);
}

.action-btn.active {
  background: #1a472a;
  border-color: #48bb78;
}

.action-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.action-label {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #a8b0c8;
}

.action-btn.active .action-label {
  color: #48bb78;
}

/* ============================================================
   Context Panel (Tile-Info im Panel)
   ============================================================ */
#panel-context {
  padding: 4px 0;
}

.context-title {
  font-size: 0.9rem;
  font-weight: bold;
  color: #f5a623;
  margin-bottom: 6px;
}

.context-info {
  font-size: 0.8rem;
  color: #a8b0c8;
  line-height: 1.6;
}

.context-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.context-btn {
  flex: 1;
  background: #0f3460;
  border: 1px solid #1a5a9a;
  color: #e0d8c0;
  border-radius: 6px;
  padding: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
}

.context-btn:active {
  background: #1a5a9a;
}

/* ============================================================
   Modal Overlay (Bottom Sheet)
   ============================================================ */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#modal-sheet {
  background: #16213e;
  border-radius: 16px 16px 0 0;
  border-top: 2px solid #0f3460;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#modal-sheet * {
  touch-action: pan-y;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

#modal-handle {
  width: 40px;
  height: 4px;
  background: #4a5568;
  border-radius: 2px;
  margin: 12px auto 8px;
}

#modal-body {
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 16px));
  touch-action: pan-y;
}

/* ============================================================
   Notification Toast
   ============================================================ */
#toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast {
  background: #1a472a;
  border: 1px solid #48bb78;
  color: #e0d8c0;
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 20px;
  text-align: center;
  animation: toastIn 0.2s ease, toastOut 0.3s ease 2.5s forwards;
}

.toast.error {
  background: #742a2a;
  border-color: #fc8181;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ============================================================
   Money Pop-Up (über Canvas)
   ============================================================ */
.money-popup {
  position: absolute;
  font-size: 0.85rem;
  font-weight: bold;
  color: #f5a623;
  pointer-events: none;
  animation: moneyFloat 1.5s ease forwards;
  z-index: 5;
  white-space: nowrap;
}

.money-popup.negative {
  color: #fc8181;
}

@keyframes moneyFloat {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* ============================================================
   Utility
   ============================================================ */
.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ============================================================
   City Info Modal
   ============================================================ */
.modal-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #f5a623;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: #a8b0c8;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.city-stars {
  color: #f5a623;
  letter-spacing: 2px;
  font-size: 0.9rem;
}

.city-section {
  margin-bottom: 14px;
}

.city-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #4a5568;
  margin-bottom: 6px;
  border-bottom: 1px solid #1a2a4a;
  padding-bottom: 3px;
}

.goods-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.goods-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
}

.goods-name {
  flex: 1;
  font-size: 0.78rem;
  color: #c8c0a8;
}

.goods-price {
  font-size: 0.78rem;
  color: #f5a623;
  white-space: nowrap;
}

.supply-bar-wrap {
  width: 50px;
  height: 6px;
  background: #0f1a2e;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.supply-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.supply-low    { background: #e63946; }
.supply-medium { background: #f5a623; }
.supply-high   { background: #48bb78; }

.growth-progress {
  margin-top: 8px;
  padding: 8px;
  background: #0d1a30;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #a8b0c8;
  line-height: 1.7;
}

.growth-ok   { color: #48bb78; }
.growth-need { color: #e63946; }

/* Loan panel */
.loan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.8rem;
}

.loan-row span:first-child { color: #a8b0c8; }
.loan-row span:last-child  { color: #e0d8c0; font-weight: bold; }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.stat-cell {
  background: #0d1a30;
  border-radius: 6px;
  padding: 8px 10px;
}

/* ================================================================
   Train Manager & Route Editor
   ================================================================ */

/* Train card */
.train-card {
  border: 1px solid #1a5a9a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.train-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.train-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.train-name {
  flex: 1;
  font-weight: bold;
  color: #e0d8c0;
  font-size: 0.85rem;
}
.train-earnings {
  color: #f5a623;
  font-size: 0.72rem;
}
.train-card-info {
  font-size: 0.71rem;
  color: #a8b0c8;
  line-height: 1.5;
  margin-bottom: 8px;
}
.train-card-actions {
  display: flex;
  gap: 8px;
}
.train-card-actions .context-btn { flex: 1; font-size: 0.74rem; }

/* Route editor entries */
.route-entry {
  border: 1px solid #1a5a9a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.route-station-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.route-station-num {
  background: #1a5a9a;
  color: #e0f0ff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
  flex-shrink: 0;
}
.route-station-name {
  flex: 1;
  font-weight: bold;
  color: #e0d8c0;
  font-size: 0.82rem;
}
.route-entry-controls {
  display: flex;
  gap: 4px;
}
.route-entry-controls button {
  background: #0d1a2e;
  border: 1px solid #2a3a5a;
  color: #a8b0c8;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  min-width: 24px;
}
.route-entry-controls button:disabled { opacity: 0.3; cursor: default; }
.route-entry-controls button.remove-btn { color: #fc8181; border-color: #742a2a; }

/* Goods pills */
.route-goods-section {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.route-goods-label {
  font-size: 0.7rem;
  color: #718096;
  min-width: 50px;
  padding-top: 4px;
  flex-shrink: 0;
}
.route-goods-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.goods-pill {
  background: #0d1a2e;
  border: 1px solid #2a3a5a;
  color: #a8b0c8;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.68rem;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.goods-pill.active {
  background: #1a5a9a;
  border-color: #3a8ae0;
  color: #e8f0ff;
  font-weight: bold;
}
.goods-pill.needs-good { border-color: #c8a840; }
.goods-pill.needs-good.active { background: #8a6010; border-color: #e0b820; }

/* Station picker */
.add-station-btn { width: 100%; margin: 4px 0 6px; }
.add-station-list {
  background: #080f1c;
  border: 1px solid #1a5a9a;
  border-radius: 8px;
  margin-bottom: 10px;
  max-height: 130px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.add-station-item {
  padding: 9px 12px;
  cursor: pointer;
  color: #c0c8e0;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  -webkit-tap-highlight-color: transparent;
}
.add-station-item:last-child { border-bottom: none; }
.add-station-item:active { background: #1a2a4a; }
.add-station-empty {
  padding: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: #4a5568;
}

/* Route action bar */
.route-action-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  bottom: 0;
  background: #111a28;
  padding-bottom: 4px;
}
.route-action-bar .context-btn { flex: 1; }

/* ================================================================
   Ereignisse, Ziele & Konkurrenz (Finanzen-Modal)
   ================================================================ */

/* Markt-Ereignis-Zeile */
.event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #0d1a2e;
  border-radius: 6px;
  margin-bottom: 5px;
  font-size: 0.75rem;
}
.event-name {
  flex: 1;
  color: #e0d8c0;
  font-weight: bold;
}
.event-good {
  font-size: 0.72rem;
}
.event-days {
  color: #718096;
  font-size: 0.68rem;
  min-width: 24px;
  text-align: right;
}

/* Konkurrenz */
.competitor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: #0d1a2e;
  border-radius: 6px;
  margin-bottom: 10px;
}
.competitor-badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: bold;
}
.competitor-badge.ahead  { background: rgba(72,187,120,0.15); color: #48bb78; }
.competitor-badge.behind { background: rgba(252,129,129,0.15); color: #fc8181; }

/* Spielziel-Zeile */
.objective-row {
  padding: 8px 10px;
  background: #0d1a2e;
  border-radius: 6px;
  margin-bottom: 6px;
  border-left: 3px solid #1a5a9a;
}
.objective-row.done { border-left-color: #48bb78; opacity: 0.6; }
.objective-desc {
  font-size: 0.78rem;
  color: #c0c8e0;
  margin-bottom: 6px;
}
.objective-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.objective-progress-bar {
  flex: 1;
  height: 5px;
  background: #1a2a3a;
  border-radius: 3px;
  overflow: hidden;
}
.objective-progress-fill {
  height: 100%;
  background: #1a8ae0;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.objective-reward {
  font-size: 0.7rem;
  color: #f5a623;
  white-space: nowrap;
}

.stat-cell-label {
  font-size: 0.65rem;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stat-cell-value {
  font-size: 0.95rem;
  font-weight: bold;
  color: #e0d8c0;
}

.stat-cell-value.positive { color: #48bb78; }
.stat-cell-value.negative { color: #e63946; }
.stat-cell-value.gold     { color: #f5a623; }

/* ============================================================
   Build Hint & Confirm Bar
   ============================================================ */
#build-hint,
#build-confirm {
  padding: 6px 12px 4px;
  border-top: 1px solid #0f3460;
}

.build-hint-text {
  font-size: 0.72rem;
  color: #a8b0c8;
  letter-spacing: 0.3px;
}
.build-hint-text.build    { color: #48bb78; }
.build-hint-text.demolish { color: #fc8181; }

.build-hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}
.build-hint-tiles { color: #a8b0c8; }
.build-hint-cost  { color: #48bb78; font-weight: bold; }
.build-hint-cost.red { color: #fc8181; }

.build-confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.build-confirm-info {
  font-size: 0.78rem;
  color: #a8b0c8;
}
.build-confirm-cost-ok  { color: #f5a623; font-weight: bold; }
.build-confirm-cost-err { color: #fc8181; font-weight: bold; }

.build-confirm-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.build-confirm-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  touch-action: manipulation;
}
.build-confirm-btn.ok {
  background: #1a472a;
  border-color: #48bb78;
  color: #48bb78;
}
.build-confirm-btn.ok:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.build-confirm-btn.cancel {
  background: #3d1a1a;
  border-color: #742a2a;
  color: #fc8181;
}
.build-confirm-btn:active { opacity: 0.7; }

/* 5-Button Action Panel scrollt horizontal auf kleinen Screens */
#panel-default-actions {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#panel-default-actions::-webkit-scrollbar { display: none; }

/* ============================================================
   Event Ticker (unter HUD)
   ============================================================ */
#event-ticker {
  display: none;
  align-items: center;
  padding: 0 12px;
  height: 24px;
  background: rgba(245, 166, 35, 0.1);
  border-bottom: 1px solid rgba(245, 166, 35, 0.25);
  overflow: hidden;
  flex-shrink: 0;
  z-index: 9;
}

#event-ticker.visible { display: flex; }

#event-ticker-inner {
  font-size: 0.63rem;
  color: #f5a623;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ============================================================
   Tap-Ripple Animation
   ============================================================ */
.tap-ripple {
  position: absolute;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 2px solid rgba(245, 166, 35, 0.8);
  border-radius: 50%;
  pointer-events: none;
  animation: tapRipple 0.55s ease-out forwards;
  z-index: 6;
}

@keyframes tapRipple {
  0%   { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ============================================================
   Financial Bar Chart (Finanzen-Modal)
   ============================================================ */
.fin-chart {
  background: #0d1a2e;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.fin-chart-title {
  font-size: 0.65rem;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.fin-chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.fin-chart-row:last-child { margin-bottom: 0; }

.fin-chart-label {
  font-size: 0.63rem;
  color: #718096;
  width: 56px;
  flex-shrink: 0;
}

.fin-chart-bar-wrap {
  flex: 1;
  height: 16px;
  background: #1a2a3a;
  border-radius: 4px;
  overflow: hidden;
}

.fin-chart-bar {
  height: 100%;
  border-radius: 4px;
  min-width: 3px;
  transition: width 0.4s ease;
}

.fin-chart-bar.revenue { background: linear-gradient(90deg, #1a6ae0, #48bb78); }
.fin-chart-bar.cost    { background: linear-gradient(90deg, #8a3010, #e63946); }

.fin-chart-val {
  font-size: 0.68rem;
  color: #e0d8c0;
  width: 72px;
  text-align: right;
  flex-shrink: 0;
  font-weight: bold;
}

/* ============================================================
   Connected Trains (Stadt-Info-Modal)
   ============================================================ */
.connected-train-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  color: #c0c8e0;
}

.connected-train-row:last-child { border-bottom: none; }
.connected-train-name { flex: 1; }
.connected-train-status { font-size: 0.68rem; color: #718096; }

/* ============================================================
   Touch-Targets: Mindestgröße 44×44px (Apple HIG)
   ============================================================ */
.hud-btn {
  width: 44px;
  height: 44px;
}

.context-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Responsive: Kleine Phones (< 375px)
   ============================================================ */
@media (max-width: 374px) {
  .splash-title  { font-size: 1.9rem; letter-spacing: 4px; }
  #hud           { height: 48px; padding: 4px 8px; }
  .hud-btn       { width: 38px; height: 38px; font-size: 0.78rem; }
  #hud-money-value { font-size: 0.95rem; }
  .action-icon   { font-size: 1.15rem; }
  .action-label  { font-size: 0.58rem; }
  .action-btn    { min-height: 58px; padding: 8px 2px 6px; }
  #modal-body    { padding: 8px 12px calc(20px + env(safe-area-inset-bottom, 16px)); }
  .modal-title   { font-size: 0.95rem; }
  .stat-cell-value { font-size: 0.82rem; }
}

/* ============================================================
   Responsive: Große Phones / Tablet Portrait (≥ 428px)
   ============================================================ */
@media (min-width: 428px) {
  #hud           { height: 56px; }
  .hud-btn       { width: 48px; height: 48px; font-size: 1rem; }
  .action-icon   { font-size: 1.6rem; }
  .action-btn    { min-height: 72px; }
  #modal-body    { padding: 12px 20px calc(28px + env(safe-area-inset-bottom, 16px)); }
  .modal-title   { font-size: 1.2rem; }
  .context-btn   { min-height: 48px; font-size: 0.82rem; }
}

/* ============================================================
   Phase 9 — Splash Multi-View
   ============================================================ */
.splash-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 360px;
  padding: 0 24px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  max-height: 100%;
}

.splash-view * {
  touch-action: pan-y;
}

.splash-view.hidden { display: none; }

.splash-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: #8090b8;
  font-size: 0.9rem;
  padding: 8px 0 4px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
}
.splash-back:active { color: #c8d0e8; }

.splash-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: #e2e8f0;
  margin: 8px 0 18px;
  text-align: center;
}

/* Kartengröße-Selector (identisch zu diff-btns) */
.map-size-select  { width: 100%; margin-bottom: 16px; }
.splash-select-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: #8090b8;
  text-align: center;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.size-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.size-btn {
  flex: 1;
  padding: 8px 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #a0aec0;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  min-height: 44px;
}
.size-btn.active,
.size-btn:active {
  background: rgba(100,130,220,0.25);
  border-color: #7090d8;
  color: #e2e8f0;
}

/* ============================================================
   Szenario-Karten in der Szenarien-Liste
   ============================================================ */
#scenario-list { width: 100%; display: flex; flex-direction: column; gap: 10px; }

.scenario-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 64px;
}
.scenario-card:active { background: rgba(100,130,220,0.2); }

.sc-icon  { font-size: 1.6rem; flex-shrink: 0; width: 36px; text-align: center; }
.sc-body  { flex: 1; min-width: 0; }
.sc-name  { font-size: 0.85rem; font-weight: 700; color: #e2e8f0; margin-bottom: 2px; }
.sc-desc  { font-size: 0.72rem; color: #8090b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-meta  { font-size: 0.68rem; color: #6070a0; margin-top: 3px; }
.sc-hs    { color: #f6d860; margin-left: 6px; }
.sc-hs-none { color: #5060a0; }
.sc-arrow { color: #5060a0; font-size: 1.3rem; flex-shrink: 0; }

/* ============================================================
   Szenario-Fortschrittsleiste (unter Event-Ticker)
   ============================================================ */
#scenario-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px;
  background: rgba(10,12,30,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.7rem;
  color: #8090b8;
  min-height: 22px;
  flex-shrink: 0;
}
#scenario-bar.hidden { display: none; }
#scenario-bar-text   { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#scenario-bar-track  { width: 80px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; flex-shrink: 0; }
#scenario-bar-fill   { height: 100%; background: #48bb78; border-radius: 3px; transition: width 0.4s; }

/* ============================================================
   Szenario Win/Lose Modals
   ============================================================ */
.win-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 8px;
  font-size: 2rem;
}
.star         { color: rgba(255,255,255,0.2); }
.star.filled  { color: #f6d860; text-shadow: 0 0 8px rgba(246,216,96,0.7); }

.win-time   { text-align: center; color: #a8b0c8; font-size: 0.82rem; margin-bottom: 4px; }
.win-record { text-align: center; color: #f6d860; font-size: 0.8rem; margin: 6px 0; letter-spacing: 1px; }

.lose-bar-bg   { width: 100%; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; margin: 8px 0 16px; overflow: hidden; }
.lose-bar-fill { height: 100%; background: #e53e3e; border-radius: 4px; }

/* ============================================================
   Menü-Extras
   ============================================================ */
.menu-hs       { font-size: 0.72rem; color: #f6d860; text-align: center; margin-bottom: 10px; letter-spacing: 1px; }
.menu-mode-tag { font-size: 0.62rem; letter-spacing: 1px; color: #8090b8; vertical-align: middle; margin-left: 6px; font-weight: normal; }

/* ============================================================
   Speicher-Slots (Splash-Load + Modal)
   ============================================================ */
#save-slot-list { padding: 8px 0; }

.save-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.save-slot:active { background: rgba(255,255,255,0.09); }

.save-slot.slot-empty { opacity: 0.45; cursor: default; }

.slot-icon  { font-size: 1.5rem; flex-shrink: 0; }
.slot-info  { flex: 1; min-width: 0; }
.slot-name  { font-size: 0.78rem; font-weight: 700; letter-spacing: 1px; color: #c8d0e8; margin-bottom: 2px; }
.slot-date  { font-size: 0.72rem; color: #8090b8; }
.slot-meta  { font-size: 0.7rem; color: #a0aec0; margin-top: 2px; }
.slot-mode  { font-size: 0.65rem; color: #7ec8a0; letter-spacing: 0.5px; font-weight: normal; margin-left: 4px; }
.slot-arrow { font-size: 1.4rem; color: #4a5568; flex-shrink: 0; }

/* In-Game Save-Picker (Modal) */
.save-slot-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  margin-bottom: 8px;
  color: #c8d0e8;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  gap: 10px;
  text-align: left;
  transition: background 0.15s;
}
.save-slot-btn:active { background: rgba(255,255,255,0.1); }
.save-slot-btn-used   { border-color: rgba(74,219,147,0.25); }

.ssb-label  { font-weight: 700; letter-spacing: 1px; min-width: 70px; }
.ssb-meta   { flex: 1; color: #8090b8; font-size: 0.72rem; }
.ssb-money  { color: #7ec8a0; font-size: 0.72rem; }

