:root {
  --bg-dark: #0f172a;
  --panel-bg: rgba(15, 23, 42, 0.92);
  --panel-border: rgba(245, 158, 11, 0.45);
  --amber: #f59e0b;
  --amber-bright: #fbbf24;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --green: #10b981;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
}

.hazard-tape {
  height: 6px;
  flex-shrink: 0;
  background: repeating-linear-gradient(
    -45deg,
    #f59e0b 0px,
    #f59e0b 12px,
    #111827 12px,
    #111827 24px
  );
  z-index: 30;
}

/* ÜST HUD */
.top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  background: #0b1120;
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
  flex-wrap: wrap;
  z-index: 25;
}

.hud-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.beacon-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber), 0 0 22px rgba(245, 158, 11, 0.7);
  animation: beaconPulse 1.1s infinite alternate ease-in-out;
  flex-shrink: 0;
}

@keyframes beaconPulse {
  from { opacity: 0.45; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.12); }
}

.brand-titles h1 {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.brand-titles .slash {
  color: var(--amber);
}

.badge-wip {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 1px 7px;
  border-radius: 4px;
  margin-top: 2px;
}

.hud-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  padding: 4px 9px;
  display: flex;
  flex-direction: column;
  min-width: 96px;
}

.stat-pill-mine {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(6, 78, 59, 0.35);
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #f8fafc;
}

.stat-val strong {
  color: var(--amber-bright);
}

.stat-pill-mine .stat-val strong {
  color: #34d399;
}

.stat-pill-progress {
  min-width: 155px;
}

.stat-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.building-progress-track {
  width: 100%;
  height: 5px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 3px;
}

.building-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  transition: width 0.35s ease;
}

.hud-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.operator-box {
  display: flex;
  align-items: center;
  gap: 4px;
}

.operator-box input {
  width: 132px;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
}

.operator-box input:focus {
  border-color: var(--amber-bright);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.hud-btn-pair {
  display: flex;
  gap: 5px;
}

.btn-hud {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}

.btn-hud:hover {
  background: #334155;
  border-color: var(--amber);
}

.btn-hud:active {
  transform: scale(0.96);
}

.btn-amber {
  background: var(--amber);
  color: #111827;
  border-color: var(--amber-bright);
}

.btn-amber:hover {
  background: var(--amber-bright);
}

/* SAHNE ALANI */
.stage-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #0f172a;
  overflow: hidden;
}

#santiye-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* ARAÇ SEÇİCİ BAR */
.vehicle-bar {
  position: absolute;
  top: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 5px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 15;
  max-width: calc(100% - 24px);
}

.veh-btn {
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}

.veh-btn:hover {
  border-color: var(--amber);
  color: #ffffff;
}

.veh-btn.active {
  background: var(--amber);
  color: #111827;
  border-color: #fde68a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

.veh-divider {
  width: 1px;
  height: 20px;
  background: rgba(148, 163, 184, 0.3);
  margin: 0 2px;
}

.veh-action {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

/* SAĞ KONTROL İPUCU KARTI */
.control-hud {
  position: absolute;
  top: 10px;
  right: 12px;
  max-width: 310px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 7px 11px;
  backdrop-filter: blur(8px);
  z-index: 14;
  pointer-events: none;
}

.control-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.active-veh-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--amber-bright);
  letter-spacing: 0.03em;
}

.load-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  padding: 1px 7px;
  border-radius: 999px;
}

.control-hint-text {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #cbd5e1;
}

/* TOAST BİLDİRİMİ */
.toast-banner {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid var(--amber);
  color: #fef3c7;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 25;
  white-space: nowrap;
}

.toast-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* DOKUNMATİK / EKRAN KONTROLLERİ */
.touch-controls {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 16;
}

.touch-cluster {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.touch-btn {
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 0.8rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  touch-action: manipulation;
}

.touch-btn.pressed,
.touch-btn:active {
  background: var(--amber);
  color: #111827;
  transform: scale(0.95);
}

.touch-primary {
  background: rgba(245, 158, 11, 0.92);
  color: #111827;
  border-color: #fde68a;
}

.touch-enter {
  border-color: rgba(56, 189, 248, 0.65);
  color: #bae6fd;
}

.touch-small {
  padding: 9px 11px;
}

/* ALT İLETİŞİM ŞERİDİ */
.santiye-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 14px;
  background: #090e1a;
  border-top: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  z-index: 25;
}

.footer-note {
  font-weight: 700;
  color: #fde68a;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-link {
  color: #e2e8f0;
  text-decoration: none;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 5px;
  padding: 3px 8px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}

.footer-link:hover {
  border-color: var(--amber);
  color: var(--amber-bright);
}

/* MODALLAR */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  background: #0f172a;
  border: 2px solid var(--amber);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.modal-wide {
  max-width: 720px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1e293b;
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
}

.modal-head h2 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--amber-bright);
}

.modal-close {
  background: rgba(15, 23, 42, 0.7);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--amber);
  color: var(--amber-bright);
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  margin-bottom: 16px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.lb-table th,
.lb-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.lb-table th {
  background: #1e293b;
  color: #fde68a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
}

.lb-table tbody tr:hover {
  background: rgba(245, 158, 11, 0.08);
}

.empty-cell {
  text-align: center !important;
  color: var(--text-muted);
  padding: 16px !important;
}

.logs-heading {
  font-size: 0.86rem;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.recent-logs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.recent-logs-list li {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  padding: 6px 10px;
  color: #cbd5e1;
}

/* İLETİŞİM KARTLARI */
.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  color: #f8fafc;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.12s;
}

.contact-item:hover {
  border-color: var(--amber);
  transform: translateX(3px);
}

.ci-icon {
  font-size: 1.4rem;
}

.ci-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ci-info strong {
  font-size: 0.9rem;
}

.ci-info span {
  font-size: 0.8rem;
  color: #fde68a;
  font-family: 'JetBrains Mono', monospace;
}

.ci-arrow {
  color: var(--amber);
  font-weight: 800;
}

/* MOBİL UYUM */
@media (max-width: 960px) {
  .control-hud {
    display: none;
  }
  .top-hud {
    padding: 6px 10px;
    gap: 6px;
  }
  .stat-pill {
    min-width: 72px;
    padding: 3px 6px;
  }
  .stat-pill-progress {
    min-width: 125px;
  }
  .operator-box input {
    width: 108px;
  }
  .veh-btn {
    padding: 4px 7px;
    font-size: 0.7rem;
  }
  .touch-btn {
    padding: 8px 10px;
    font-size: 0.74rem;
  }
  .santiye-footer {
    padding: 4px 10px;
    font-size: 0.7rem;
  }
}

@media (max-width: 560px) {
  .stat-pill-mine,
  .badge-wip {
    display: none;
  }
  .vehicle-bar {
    top: 6px;
    left: 6px;
    right: 6px;
    max-width: none;
  }
  .touch-controls {
    bottom: 6px;
    left: 6px;
    right: 6px;
    flex-wrap: wrap;
  }
  .footer-note {
    display: none;
  }
}
