/* ============================================================
   OILFIELD MANAGER — Mobile-First Portrait CSS
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #1a1a2e;
  --bg2:         #16213e;
  --bg3:         #0f3460;
  --gold:        #e0a020;
  --gold-dark:   #b07010;
  --green:       #27ae60;
  --red:         #e74c3c;
  --orange:      #f39c12;
  --text:        #e8e8f0;
  --muted:       #7a7a9a;
  --border:      #2a2a4a;
  --sheet-bg:    #1e1e3a;
  --hud-h:       52px;
  --tab-h:       56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

/* ── App wrapper ─────────────────────────────────────────── */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}

/* ── Canvas ──────────────────────────────────────────────── */
#game-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  touch-action: none;
  image-rendering: pixelated;
}

/* ── HUD oben ─────────────────────────────────────────────── */
#hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hud-h);
  padding-top: var(--safe-top);
  background: rgba(15, 15, 30, 0.92);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  z-index: 10;
  pointer-events: none;
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.hud-row-2 {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.hud-label { font-size: 12px; }
.hud-sep   { color: var(--border); }
.hud-price { color: var(--gold); font-weight: 700; }

/* ── Tab-Bar ─────────────────────────────────────────────── */
#tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(15, 15, 30, 0.95);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 10;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.tab-btn:active  { background: rgba(255,255,255,0.05); }
.tab-btn.active  { color: var(--gold); border-top: 2px solid var(--gold); }

/* ── Side panels ─────────────────────────────────────────── */
.side-panel {
  position: absolute;
  top: var(--hud-h);
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-bottom));
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 8;
  padding: 16px 16px 24px;
}

.side-panel h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}

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

.big-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  margin: 8px 0 2px;
  letter-spacing: -1px;
}

#price-chart {
  display: block;
  width: 100%;
  height: 120px;
  border-radius: 8px;
  background: var(--bg2);
  margin: 12px 0;
}

/* ── Panel actions / form elements ──────────────────────── */
.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.input-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.input-label input[type=number],
.panel-actions input[type=number] {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  margin-top: 2px;
}

.market-msg {
  min-height: 18px;
  font-size: 13px;
  color: var(--green);
  text-align: center;
  padding: 4px 0;
}

/* ── Stats table ─────────────────────────────────────────── */
.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 4px;
}

.stat-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.stat-table td:first-child { color: var(--muted); }
.stat-table td:last-child  { text-align: right; font-weight: 600; }

/* ── Research active bar ─────────────────────────────────── */
.research-active {
  background: rgba(224,160,32,0.07);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 10px 12px 12px;
  margin-bottom: 14px;
}

.ra-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ra-icon { font-size: 18px; flex-shrink: 0; }
.ra-name { flex: 1; font-weight: 600; font-size: 14px; }
.ra-days { font-size: 12px; color: var(--gold); font-weight: 700; }

.tech-progress-bg {
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}

.tech-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, #ffd700 100%);
  border-radius: 4px;
  transition: width 0.4s;
}

/* ── Tech cards ──────────────────────────────────────────── */
.tech-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tech-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.tech-card:not(.tech-done):not(.tech-disabled):not(.tech-active):active {
  background: var(--bg3);
  border-color: var(--gold);
  transform: scale(0.98);
}

.tech-card.tech-done    { opacity: 0.55; cursor: default; border-color: var(--green); }
.tech-card.tech-active  { border-color: var(--gold); background: rgba(224,160,32,0.07); cursor: default; }
.tech-card.tech-disabled{ opacity: 0.42; cursor: default; }

.tc-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tc-icon {
  font-size: 22px;
  flex-shrink: 0;
  padding-top: 1px;
  line-height: 1;
}

.tc-info { flex: 1; min-width: 0; }

.tc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.tc-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.tc-badge {
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.badge-done   { background: rgba(39,174,96,0.18);  color: var(--green); }
.badge-active { background: rgba(224,160,32,0.22); color: var(--gold);  }
.badge-locked { background: rgba(60,60,100,0.35);  color: var(--muted); }
.badge-warn   { background: rgba(231,76,60,0.18);  color: var(--red);   }

.tc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.tc-cost { font-size: 14px; font-weight: 700; color: var(--gold); }
.tc-days { font-size: 12px; color: var(--muted); }

/* ── Owned fields list ───────────────────────────────────── */
.fields-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0;
  transition: background 0.12s;
}

.field-row:last-child { border-bottom: none; }
.field-row:active { background: rgba(255,255,255,0.04); border-radius: 6px; }

.field-row-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.field-coord { font-size: 13px; font-weight: 700; color: var(--text); flex-shrink: 0; }
.field-type  { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.field-lease {
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  background: rgba(243,156,18,0.15);
  border-radius: 4px;
  padding: 2px 5px;
  flex-shrink: 0;
}

.field-status {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: #1a1a1a;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:active  { background: var(--gold-dark); transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s;
}

.btn-secondary:active   { background: #1a3a6e; }
.btn-secondary:disabled { opacity: 0.4; pointer-events: none; }

.btn-close {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 16px;
  padding: 14px;
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  min-height: 48px;
}

.btn-close:active { background: #1a3a6e; }

/* ── Bottom Sheet ─────────────────────────────────────────── */
.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 20;
}

#bottom-sheet {
  position: absolute;
  bottom: calc(var(--tab-h) + var(--safe-bottom));
  left: 0;
  right: 0;
  background: var(--sheet-bg);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--border);
  z-index: 21;
  max-height: 72%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

#bottom-sheet.open { transform: translateY(0); }

#bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 8px;
  flex-shrink: 0;
}

#bottom-sheet-content {
  padding: 0 16px 8px;
}

/* ── Bottom Sheet content styles ─────────────────────────── */
#bottom-sheet-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
}

.tile-coord {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 8px;
}

.info-row span:first-child { color: var(--muted); flex-shrink: 0; }
.info-row span:last-child  { font-weight: 600; text-align: right; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 10px;
}

/* ── Depletion bar ───────────────────────────────────────── */
.depletion-bar-bg {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  margin: 6px 0 10px;
  overflow: hidden;
}

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

/* ── Warning text ────────────────────────────────────────── */
.warn-text {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
}

/* ── Sheet buttons ───────────────────────────────────────── */
.sheet-btn {
  display: block;
  width: 100%;
  padding: 13px;
  margin: 8px 0;
  background: var(--gold);
  color: #1a1a1a;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s, transform 0.1s;
}

.sheet-btn:active           { background: var(--gold-dark); transform: scale(0.98); }
.sheet-btn[disabled]        { opacity: 0.38; pointer-events: none; }
.sheet-btn.secondary        { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.sheet-btn.secondary:active { background: #1a3a6e; }

/* ── Option grid (drill/pump selection) ──────────────────── */
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 12px;
}

.option-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  min-height: 90px;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.option-card:active:not(.disabled) {
  background: var(--bg3);
  border-color: var(--gold);
  transform: scale(0.97);
}

.option-card.disabled {
  opacity: 0.42;
  cursor: default;
}

.oc-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.oc-stat {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.oc-cost {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 2px;
}

.badge-warn {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── News ticker ─────────────────────────────────────────── */
#ticker-bar {
  position: absolute;
  top: var(--hud-h);
  left: 0;
  right: 0;
  height: 20px;
  background: rgba(10,10,28,0.90);
  border-bottom: 1px solid rgba(80,80,150,0.35);
  z-index: 9;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
}

#ticker-text {
  display: inline-block;
  white-space: nowrap;
  font-size: 11px;
  color: var(--gold);
  line-height: 20px;
  padding-left: 100%;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ── Event overlay ───────────────────────────────────────── */
#event-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 24px;
}

#event-card {
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

/* ── Event choice buttons ─────────────────────────────────── */
.event-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

#event-icon  { font-size: 40px; margin-bottom: 10px; }

#event-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 10px;
}

#event-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ── Gameover screen ─────────────────────────────────────── */
#gameover-screen {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 24px;
}

.gameover-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

.gameover-card h2 { font-size: 28px; color: var(--gold); margin-bottom: 12px; }
#gameover-reason  { font-size: 15px; color: var(--muted); margin-bottom: 16px; }
#gameover-stats   { margin-bottom: 20px; font-size: 14px; line-height: 2.1; }

.btn-share {
  display: block;
  width: 100%;
  padding: 10px 0;
  margin-bottom: 10px;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-share:active { opacity: 0.7; }

/* ── Market indicators ───────────────────────────────────── */
.market-indicators {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 0;
  font-size: 13px;
}

.market-trend { font-weight: 700; }
.market-ma    { color: var(--muted); font-size: 12px; }

/* ── Section divider ──────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

/* ── Toggle switch ────────────────────────────────────────── */
.auto-sell-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 4px 0;
  gap: 12px;
}

.toggle-wrap {
  position: relative;
  flex-shrink: 0;
}

.toggle-wrap input[type=checkbox] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  display: block;
  width: 46px;
  height: 26px;
  background: var(--bg3);
  border-radius: 13px;
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle-wrap input:checked + .toggle-slider {
  background: var(--green);
  border-color: var(--green);
}

.toggle-wrap input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: #fff;
}

/* ── Select input ─────────────────────────────────────────── */
.select-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  margin-top: 2px;
  -webkit-appearance: none;
  appearance: none;
}

/* ── Futures list ─────────────────────────────────────────── */
.futures-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.futures-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  gap: 8px;
}

.futures-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.futures-value {
  font-weight: 700;
  color: var(--gold);
  font-size: 14px;
}

.futures-days {
  font-size: 11px;
  color: var(--muted);
}

/* ── P&L chart ────────────────────────────────────────────── */
#pnl-chart {
  display: block;
  width: 100%;
  height: 80px;
  border-radius: 8px;
  background: var(--bg2);
  margin: 8px 0 4px;
}

.pnl-summary {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 4px;
}

.pnl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.pnl-row:last-child { border-bottom: none; }
.pnl-row span:first-child { color: var(--muted); }
.pnl-row span:last-child  { font-weight: 600; text-align: right; }

/* ── Loans list ───────────────────────────────────────────── */
.loans-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.loan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  gap: 12px;
}

.loan-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loan-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.loan-interest {
  font-size: 12px;
  color: var(--red);
}

.btn-repay {
  padding: 10px 16px;
  background: var(--bg3);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-repay:active  { background: #1a3a6e; }
.btn-repay.disabled,
.btn-repay:disabled { opacity: 0.4; pointer-events: none; }

/* ── Auction overlay ──────────────────────────────────────── */
#auction-overlay {
  position: absolute;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 8px);
  left: 8px;
  right: 8px;
  z-index: 25;
  pointer-events: all;
}

#auction-card {
  background: var(--bg2);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 14px 16px 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}

.auction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.auction-badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.auction-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.auction-tile-info {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
}

.auction-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 8px;
}

.auction-timer {
  font-size: 12px;
  color: var(--orange);
  font-weight: 600;
}

.auction-base {
  font-size: 12px;
  color: var(--muted);
}

.auction-msg {
  min-height: 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 6px 0 0;
  color: var(--green);
}

/* ── Leaderboard ──────────────────────────────────────────── */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.lb-row:last-child { border-bottom: none; }

.lb-row.lb-player {
  background: rgba(30,100,220,0.08);
  border-radius: 6px;
  border-bottom: none;
  margin: 2px 0;
}

.lb-rank {
  font-size: 16px;
  width: 28px;
  flex-shrink: 0;
  text-align: center;
}

.lb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lb-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-value {
  font-weight: 700;
  color: var(--gold);
  text-align: right;
  font-size: 13px;
}

/* ── Market manipulation ──────────────────────────────────── */
.manipulation-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.btn-manipulation {
  padding: 12px 8px;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-manipulation:active {
  background: var(--bg3);
  border-color: var(--gold);
}

/* ── Victory variant of gameover card ───────────────────── */
.gameover-card.victory {
  border-color: var(--gold);
  border-width: 2px;
  box-shadow: 0 0 32px rgba(224,160,32,0.25);
}

/* ── Highscore list (gameover/victory screen) ────────────── */
.hs-list {
  margin: 12px 0 16px;
  font-size: 13px;
}

.hs-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.hs-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.hs-row:last-child { border-bottom: none; }

.hs-rank  { font-size: 14px; text-align: center; }
.hs-score { font-weight: 700; color: var(--gold); text-align: left; }
.hs-diff  { font-size: 11px; color: var(--muted); }
.hs-date  { font-size: 11px; color: var(--muted); }

/* ── Save slots (company panel) ──────────────────────────── */
.save-slots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 16px;
}

.save-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  gap: 10px;
}

.save-slot-auto {
  border-color: rgba(100,180,255,0.35);
}

.save-slot-empty {
  opacity: 0.65;
}

.ss-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ss-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ss-day {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ss-date {
  font-size: 11px;
  color: var(--muted);
}

.ss-diff {
  font-size: 11px;
  color: var(--muted);
}

.ss-empty {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

.ss-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.btn-ss-save,
.btn-ss-load {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-ss-save {
  background: var(--bg3);
  color: var(--gold);
  border-color: rgba(224,160,32,0.45);
}

.btn-ss-save:active { background: #1a3a6e; }

.btn-ss-load {
  background: rgba(39,174,96,0.15);
  color: var(--green);
  border-color: rgba(39,174,96,0.45);
}

.btn-ss-load:active { background: rgba(39,174,96,0.3); }

.btn-ss-del {
  padding: 8px 10px;
  background: none;
  border: 1px solid rgba(231,76,60,0.35);
  border-radius: 7px;
  color: var(--red);
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-ss-del:active { background: rgba(231,76,60,0.2); }

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

/* ── Landscape warning ───────────────────────────────────── */
@media screen and (orientation: landscape) and (max-height: 500px) {
  body::after {
    content: 'Bitte Gerät hochkant halten';
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--muted);
    z-index: 999;
    text-align: center;
    padding: 32px;
  }
}
