html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0f12;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  color: #d8e0e6;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  padding: 10px 14px;
}

#hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 15px;
  font-weight: 600;
  text-shadow: 0 1px 2px black;
}

#hud-top > * {
  flex: 0 0 auto;
}

#score,
#clock {
  margin-left: 18px;
}

#hud-status-stack {
  margin-left: auto;
  margin-right: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

#pause-btn {
  pointer-events: auto;
  cursor: pointer;
  background: #1a2127;
  border: 1px solid #3a4650;
  color: #e8ecef;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 4px;
}

#pause-btn:hover {
  background: #23292f;
}

#pause-btn.paused {
  background: #ffd166;
  color: #1a1200;
  border-color: #ffd166;
}

#wind {
  pointer-events: auto;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  color: #95a3ad;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  padding: 0;
  border-radius: 4px;
}

#wind:hover {
  color: #d8e0e6;
}

#runway-summary {
  color: #95a3ad;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

#config-menu-toggle {
  pointer-events: auto;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a2127;
  border: 1px solid #3a4650;
  color: #e8ecef;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 4px;
}

#config-menu-toggle:hover,
#config-menu-toggle[aria-expanded='true'] {
  background: #23292f;
}

#config-menu-toggle .menu-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

#config-menu-toggle .menu-icon span {
  display: block;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

#wind-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 10, 0.55);
}

#wind-modal.hidden {
  display: none;
}

#wind-modal-box {
  background: #12181d;
  border: 1px solid #3a4650;
  border-radius: 8px;
  padding: 18px 20px;
  min-width: 220px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

#wind-modal-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #e8ecef;
}

#wind-modal-box label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #b7c2ca;
  margin-bottom: 10px;
}

#wind-modal-box input[type='number'] {
  width: 70px;
  background: #1a2127;
  border: 1px solid #3a4650;
  border-radius: 3px;
  color: #e8ecef;
  font-size: 13px;
  padding: 4px 6px;
}

#wind-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

#wind-modal-actions button {
  padding: 5px 14px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #3a4650;
  background: #1a2127;
  color: #e8ecef;
  cursor: pointer;
}

#wind-set-btn {
  background: #4fd1c5;
  color: #06201d;
  border-color: #4fd1c5;
  font-weight: 600;
}

#requests {
  position: fixed;
  bottom: 70px;
  right: 16px;
  z-index: 24;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  font-size: 13px;
  max-width: 340px;
  pointer-events: none;
}

#requests .req {
  background: rgba(15, 22, 27, 0.75);
  border-left: 3px solid #4fd1c5;
  padding: 4px 8px;
  border-radius: 2px;
}

#requests .req.departure {
  border-left-color: #f6ad55;
}

#runway-panel {
  position: fixed;
  top: 52px;
  left: 14px;
  width: min(320px, calc(100vw - 28px));
  max-height: calc(100vh - 68px);
  display: none;
  background: rgba(12, 18, 22, 0.95);
  border: 1px solid #3a4650;
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  z-index: 18;
  user-select: none;
  pointer-events: auto;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#runway-panel.show {
  display: block;
}

#runway-panel-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: #e8ecef;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.panel-section + .panel-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #3a4650;
}

.panel-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #8fa0ab;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

#tutorial-panel {
  border: 1px solid #3a4650;
  border-radius: 8px;
  background: rgba(26, 33, 39, 0.55);
}

#tutorial-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #d8e0e6;
}

#tutorial-panel summary::-webkit-details-marker {
  display: none;
}

#tutorial-panel summary::after {
  content: '+';
  float: right;
  color: #8fa0ab;
}

#tutorial-panel[open] summary::after {
  content: '-';
}

.tutorial-body {
  padding: 0 12px 10px;
  border-top: 1px solid #3a4650;
}

.tutorial-body p {
  margin: 10px 0 0;
  color: #b7c2ca;
  line-height: 1.4;
}

#runway-panel-summary {
  color: #d8e0e6;
  font-size: 13px;
}

.runway-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.runway-row .dir-group {
  display: flex;
  gap: 2px;
}

.runway-row button.dir-btn {
  min-width: 34px;
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid #3a4650;
  background: #1a2127;
  color: #9aa7b0;
  border-radius: 3px;
  cursor: pointer;
}

.runway-row button.dir-btn.active {
  background: #ffd166;
  color: #1a1200;
  border-color: #ffd166;
}

.runway-row label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #b7c2ca;
  cursor: pointer;
}

.runway-row label.disabled {
  opacity: 0.35;
  cursor: default;
}

#rate-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: #b7c2ca;
}

#rate-row label {
  display: flex;
  align-items: center;
  gap: 4px;
}

#rate-row input[type='number'] {
  width: 48px;
  background: #1a2127;
  border: 1px solid #3a4650;
  border-radius: 3px;
  color: #e8ecef;
  font-size: 11px;
  padding: 2px 4px;
}

#rate-row .rate-unit {
  color: #6b7680;
}

#spawn-row {
  display: flex;
  gap: 6px;
}

#spawn-row button {
  flex: 1;
  padding: 5px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #3a4650;
  background: #1a2127;
  color: #e8ecef;
  cursor: pointer;
}

#spawn-row button:hover {
  background: #23292f;
}

#spawn-dep-btn {
  border-color: #63b3ed;
  color: #63b3ed;
}

#spawn-arr-btn {
  border-color: #68d391;
  color: #68d391;
}

#pushback-menu,
#contact-tower-menu {
  position: fixed;
  z-index: 20;
  display: none;
  background: rgba(12, 18, 22, 0.96);
  border: 1px solid #3a4650;
  border-radius: 4px;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

#pushback-menu.show,
#contact-tower-menu.show {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#pushback-menu .menu-title,
#contact-tower-menu .menu-title {
  font-size: 11px;
  color: #b7c2ca;
  padding: 2px 6px 4px;
  font-weight: 600;
}

#pushback-menu button,
#contact-tower-menu button {
  text-align: left;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: #e8ecef;
  cursor: pointer;
}

#pushback-menu button:hover,
#contact-tower-menu button:hover {
  background: #23292f;
}

#toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 25;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 22, 27, 0.95);
  border-left: 3px solid #4fd1c5;
  border-radius: 3px;
  padding: 7px 12px;
  font-size: 12px;
  color: #d8e0e6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

#gameover {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 5, 5, 0.85);
  text-align: center;
}

@media (max-width: 720px) {
  #hud {
    padding: 10px;
  }

  #hud-top {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px 14px;
    font-size: 13px;
  }

  #score,
  #clock {
    margin-left: 0;
  }

  #hud-status-stack {
    order: 10;
    flex-basis: 100%;
    margin-left: 0;
    margin-right: 0;
    align-items: flex-start;
  }

  #runway-panel {
    top: 84px;
    left: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 94px);
  }

  .runway-row {
    flex-wrap: wrap;
  }
}

#gameover.hidden {
  display: none;
}

#gameover h1 {
  color: #ff6b6b;
  margin-bottom: 8px;
}

#gameover button {
  margin-top: 16px;
  padding: 8px 20px;
  font-size: 14px;
  cursor: pointer;
  background: #4fd1c5;
  border: none;
  border-radius: 4px;
  color: #06201d;
  font-weight: 600;
}

#start-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 10, 0.55);
  pointer-events: none;
}

#start-screen.hidden {
  display: none;
}

#start-screen-box {
  pointer-events: auto;
  background: #12181d;
  border: 1px solid #3a4650;
  border-radius: 10px;
  padding: 24px 28px;
  min-width: 300px;
  max-width: 360px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  text-align: left;
}

#start-screen-box h1 {
  margin: 0 0 2px;
  font-size: 22px;
  color: #e8ecef;
}

.start-sub {
  margin: 0 0 18px;
  font-size: 12px;
  color: #7a8590;
}

.start-section {
  margin-bottom: 18px;
}

.start-section-title {
  font-weight: 600;
  font-size: 13px;
  color: #b7c2ca;
  margin-bottom: 8px;
}

.start-hint {
  margin: 0 0 8px;
  font-size: 11px;
  color: #6b7680;
}

#start-screen-box label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #b7c2ca;
  margin-right: 14px;
}

#start-screen-box input[type='number'] {
  width: 64px;
  background: #1a2127;
  border: 1px solid #3a4650;
  border-radius: 3px;
  color: #e8ecef;
  font-size: 13px;
  padding: 4px 6px;
}

#start-runway-rows {
  font-size: 12px;
}

#start-btn {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #4fd1c5;
  border: none;
  border-radius: 5px;
  color: #06201d;
}

#airlines-list {
  overflow-y: auto;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.airline-row {
  background: #171e24;
  border: 1px solid #2b333b;
  border-radius: 6px;
  padding: 8px 10px;
}

.airline-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.airline-row-top label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #e8ecef;
  flex: 1;
}

.airline-row-top .icao-badge {
  font-family: monospace;
  color: #4fd1c5;
}

.airline-remove-btn {
  background: transparent;
  border: 1px solid #3a4650;
  color: #9aa7b0;
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
}

.airline-remove-btn:hover {
  color: #ff6b6b;
  border-color: #ff6b6b;
}

.airline-edit-grid {
  display: grid;
  gap: 8px;
}

.airline-edit-field {
  display: grid;
  gap: 4px;
  color: #9aa7b0;
  font-size: 11px;
}

.airline-edit-field span {
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.fleet-input,
.gate-input,
#airlines-add-row input[type='text'] {
  width: 100%;
  box-sizing: border-box;
  background: #1a2127;
  border: 1px solid #3a4650;
  border-radius: 4px;
  color: #e8ecef;
  font-size: 12px;
  padding: 6px 8px;
}

.zone-picker {
  position: relative;
}

.zone-picker summary {
  list-style: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  background: #1a2127;
  border: 1px solid #3a4650;
  border-radius: 4px;
  color: #e8ecef;
  font-size: 12px;
  padding: 6px 28px 6px 8px;
}

.zone-picker summary::-webkit-details-marker {
  display: none;
}

.zone-picker summary::after {
  content: '+';
  position: absolute;
  right: 10px;
  top: 7px;
  color: #8fa0ab;
}

.zone-picker[open] summary::after {
  content: '-';
}

.zone-picker-menu {
  margin-top: 6px;
  border: 1px solid #2b333b;
  border-radius: 6px;
  background: #141a20;
  padding: 6px;
  display: grid;
  gap: 4px;
}

.zone-option {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d8e0e6;
  font-size: 12px;
  padding: 3px 4px;
  border-radius: 4px;
  cursor: pointer;
}

.zone-option:hover {
  background: #1a2127;
}

.zone-picker-helper {
  margin-top: 2px;
  color: #7f8b95;
  font-size: 11px;
  line-height: 1.35;
}

#airlines-add-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #3a4650;
}

#new-airline-fleet,
#new-airline-gates {
  grid-column: 1 / -1;
}

#airlines-add-row button {
  grid-column: 1 / -1;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #3a4650;
  background: #1a2127;
  color: #e8ecef;
  cursor: pointer;
}

#airlines-add-row button:hover {
  background: #23292f;
}

#airlines-add-row input {
  background: #1a2127;
  border: 1px solid #3a4650;
  border-radius: 3px;
  color: #e8ecef;
  font-size: 12px;
  padding: 5px 7px;
}

#new-airline-icao {
  width: 56px;
  text-transform: uppercase;
}

#new-airline-name {
  flex: 1;
}

#new-airline-add-btn {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #4fd1c5;
  background: transparent;
  color: #4fd1c5;
  cursor: pointer;
  white-space: nowrap;
}

#new-airline-add-btn:hover {
  background: #4fd1c5;
  color: #06201d;
}


