* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1a1a20; }
body { font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; }

#app { position: relative; width: 100%; height: 100%; }
#game { display: block; width: 100%; height: 100%; cursor: default; }

#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }

/* ---- top bar ---- */
#topbar {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }

#clock-panel {
  display: flex; align-items: center; gap: 10px;
  background: rgba(20, 22, 28, 0.88);
  border: 1px solid #3a3f4a;
  border-radius: 4px; padding: 6px 12px;
  color: #d8dce4;
}
#sim-day { font-size: 12px; color: #8a93a5; }
#sim-clock { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
#speed-controls { display: flex; gap: 2px; }
#speed-controls button {
  background: #262b35; color: #9aa3b5; border: 1px solid #3a3f4a;
  width: 32px; height: 26px; cursor: pointer; font-size: 11px;
  border-radius: 3px;
}
#speed-controls button:hover { background: #333a48; color: #dce1ea; }
#speed-controls button.active { background: #4a6fa5; color: #fff; border-color: #5d84bd; }

#stats-panel {
  display: flex; gap: 14px;
  background: rgba(20, 22, 28, 0.88);
  border: 1px solid #3a3f4a; border-radius: 4px;
  padding: 6px 14px; color: #b8bfcc; font-size: 12px;
}
#stats-panel .stat { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
#stats-panel .stat .val { font-size: 15px; font-weight: 600; color: #e8ecf2; font-variant-numeric: tabular-nums; }
#stats-panel .stat .lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: #7d8698; }

/* ---- flight board ---- */
#flightboard {
  position: absolute; top: 56px; right: 8px; width: 430px;
  background: rgba(12, 14, 18, 0.94);
  border: 1px solid #3a3f4a; border-radius: 4px;
  color: #e8ecf2; overflow: hidden;
}
#flightboard-header {
  padding: 7px 12px; font-size: 11px; letter-spacing: 2px; font-weight: 600;
  color: #f2c94c; background: rgba(30, 33, 42, 0.9);
  cursor: pointer; display: flex; justify-content: space-between;
  user-select: none;
}
#flightboard-body { max-height: 46vh; overflow-y: auto; }
#flightboard.collapsed #flightboard-body { display: none; }
.fb-section { padding: 4px 10px 2px; font-size: 9px; letter-spacing: 1.5px; color: #8a93a5; }
.fb-row {
  display: grid; grid-template-columns: 44px 62px 1fr 34px 90px;
  gap: 6px; padding: 3px 10px; font-size: 12px;
  font-variant-numeric: tabular-nums; align-items: baseline;
  cursor: pointer;
}
.fb-row:hover { background: rgba(60, 70, 90, 0.3); }
.fb-row .fb-time { color: #f2f4f8; font-weight: 600; }
.fb-row .fb-flight { color: #9fc2ee; }
.fb-row .fb-city { color: #c8cedb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-row .fb-gate { color: #d5b95e; text-align: center; }
.fb-row .fb-status { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.st-scheduled { color: #8a93a5; }
.st-checkin { color: #7cc4e8; }
.st-boarding { color: #7ede9a; animation: blink 1.2s infinite; }
.st-final { color: #f2a05e; animation: blink 0.7s infinite; }
.st-departed { color: #566072; }
.st-delayed { color: #e86e6e; }
.st-landed { color: #7ede9a; }
.st-arriving { color: #7cc4e8; }
.st-baggage { color: #d5b95e; }
@keyframes blink { 50% { opacity: 0.45; } }

/* ---- inspector ---- */
#inspector {
  position: absolute; bottom: 12px; left: 8px; width: 320px;
  background: rgba(16, 18, 24, 0.94);
  border: 1px solid #3a3f4a; border-radius: 4px;
  color: #d8dce4; font-size: 12px;
  max-height: 55vh; overflow-y: auto;
}
#inspector.hidden { display: none; }
#inspector .insp-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: rgba(35, 39, 50, 0.9);
  font-weight: 600; font-size: 13px;
}
#inspector .insp-close { cursor: pointer; color: #8a93a5; padding: 0 4px; }
#inspector .insp-close:hover { color: #fff; }
#inspector .insp-body { padding: 8px 12px 10px; }
#inspector .insp-sub { color: #8a93a5; font-size: 11px; margin-bottom: 6px; }
#inspector .insp-row { display: flex; justify-content: space-between; padding: 2px 0; }
#inspector .insp-row .k { color: #8a93a5; }
#inspector .insp-activity { margin-top: 6px; padding: 6px 8px; background: rgba(60, 70, 90, 0.25); border-radius: 3px; color: #cfe3f5; font-style: italic; }
#inspector .insp-thought { margin-top: 4px; color: #a5adbf; font-size: 11.5px; font-style: italic; }
#inspector .needbar { height: 5px; background: #2a2e38; border-radius: 2px; overflow: hidden; flex: 1; margin-left: 10px; align-self: center; }
#inspector .needbar > div { height: 100%; border-radius: 2px; }
#inspector .insp-need { display: flex; align-items: center; padding: 2px 0; }
#inspector .insp-need .k { color: #8a93a5; width: 70px; }

/* ---- toasts ---- */
#toasts {
  position: absolute; bottom: 12px; right: 8px; display: flex;
  flex-direction: column; gap: 6px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  background: rgba(20, 24, 32, 0.92); border-left: 3px solid #4a6fa5;
  color: #d8dce4; font-size: 12px; padding: 7px 12px; border-radius: 3px;
  max-width: 360px; animation: toast-in 0.25s ease-out;
}
.toast.announce { border-left-color: #f2c94c; }
.toast.warn { border-left-color: #e86e6e; }
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } }

/* ---- help ---- */
#speed-controls #help-btn { width: 26px; }
#help-panel {
  position: absolute; top: 56px; left: 8px; width: 420px;
  background: rgba(14, 16, 22, 0.95); border: 1px solid #3a3f4a; border-radius: 4px;
  color: #d8dce4; font-size: 12.5px; padding: 12px 14px; line-height: 1.55;
}
#help-panel.hidden { display: none; }
#help-panel .help-title { color: #f2c94c; letter-spacing: 1.5px; font-size: 11px; font-weight: 600; margin-bottom: 6px; }
#help-panel .help-row b { color: #9fc2ee; font-weight: 600; }
#help-panel .help-row.dim { color: #8a93a5; margin-top: 6px; font-style: italic; }
