/* styles.css */
:root {
  --bg-top: #13212b;
  --bg-bottom: #0a1116;
  --panel: #0b1218d1;
  --panel-border: #84a9c42e;
  --track: #203847;
  --track-line: #bbd7e72e;
  --text-main: #eef5f8;
  --text-soft: #9eb5c2;
  --accent: #f4b860;
  --accent-strong: #ff8c42;
  --green: #58d4b8;
  --red: #ff6f61;
  --shadow: 0 24px 60px #00000047;
  --floor-count: 10;
  --floor-height: 78px;
  --floor-gap: 8px;
  --shaft-width: minmax(74px, 1fr);
  --cab-padding: 10px;
  --cab-height: calc(var(--floor-height)  - 18px);
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text-main);
  background: radial-gradient(circle at top left, #f4b86029, transparent 30%), linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  font-family: Avenir Next, Segoe UI, sans-serif;
}

button {
  font: inherit;
}

.page-shell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 28px;
}

.hero, .tower-card, .panel-card {
  backdrop-filter: blur(14px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 24px 28px;
}

.hero:after {
  content: "";
  position: absolute;
  background: radial-gradient(circle, #58d4b847, #0000 70%);
  border-radius: 50%;
  width: 220px;
  height: 220px;
  inset: auto -60px -80px auto;
}

.meta-line, .subtitle, .section-kicker, .metric-label, .queue-list, .event-log, .floor-caption, .status-pill {
  color: var(--text-soft);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 18px;
  font-size: .94rem;
}

.hero-row, .section-heading, .panel-top, .panel-summary, .floor-row, .hero-actions, .layout {
  display: flex;
}

.hero-row, .section-heading, .panel-summary, .floor-row {
  align-items:  center;
}

.hero-row, .section-heading {
  justify-content: space-between;
  gap: 18px;
}

.hero-row h1, .section-heading h2 {
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0;
  font-family: DIN Condensed, Arial Narrow, sans-serif;
}

.hero-row h1 {
  font-size: clamp(2.3rem, 4vw, 4rem);
}

.subtitle {
  max-width: 55ch;
  margin: 10px 0 0;
  line-height: 1.55;
}

.eyebrow, .section-kicker {
  text-transform: uppercase;
  letter-spacing: .18em;
  margin: 0 0 8px;
  font-size: .76rem;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button, .ghost-button, .hall-button, .cabin-button {
  cursor: pointer;
  border: 0;
  transition: transform .18s, background .18s, box-shadow .18s, opacity .18s;
}

.primary-button, .ghost-button {
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #091117;
  box-shadow: 0 12px 24px #ff8c4242;
}

.ghost-button {
  color: var(--text-main);
  background: #ffffff0f;
  border: 1px solid #ffffff1f;
}

.primary-button:hover, .ghost-button:hover, .hall-button:hover, .cabin-button:hover {
  transform: translateY(-1px);
}

.layout {
  align-items:  flex-start;
  gap: 24px;
  margin-top: 24px;
}

.tower-card {
  flex: 1.45;
  padding: 22px;
}

.sidebar {
  display: grid;
  flex: 1;
  gap: 18px;
}

.panel-card {
  padding: 20px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.status-pill {
  background: #58d4b81f;
  border: 1px solid #58d4b838;
  border-radius: 999px;
  margin: 0;
  padding: 10px 14px;
}

.board {
  display: grid;
  grid-template-columns: minmax(170px, 210px) 1fr;
  align-items: stretch;
  gap: 20px;
  margin-top: 18px;
}

.floors-column {
  display: grid;
  grid-template-rows: repeat(var(--floor-count), var(--floor-height));
  gap: var(--floor-gap);
}

.floor-row {
  background: #ffffff09;
  border: 1px solid #ffffff0f;
  border-radius: 18px;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
}

.floor-caption strong {
  display: block;
  color: var(--text-main);
  font-size: 1.2rem;
}

.floor-caption span {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
}

.hall-controls {
  display: flex;
  gap: 8px;
}

.hall-button {
  color: var(--text-main);
  background: #ffffff0f;
  border-radius: 14px;
  width: 42px;
  height: 42px;
}

.hall-button:disabled {
  opacity: .25;
  cursor: not-allowed;
}

.hall-button.active {
  color: #071015;
  background: linear-gradient(#f4b860f5, #ff8c42d1);
  box-shadow: 0 0 0 1px #ffc78b3d, 0 8px 20px #ff8c4238;
}

.shafts-panel {
  display: grid;
  grid-template-columns: repeat(4, var(--shaft-width));
  min-height: calc((var(--floor-height) * var(--floor-count))  + (var(--floor-gap) * (var(--floor-count)  - 1)));
  gap: 14px;
}

.shaft-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shaft-label {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-soft);
  font-size: .78rem;
}

.shaft-track {
  position: relative;
  min-height: calc((var(--floor-height) * var(--floor-count))  + (var(--floor-gap) * (var(--floor-count)  - 1)));
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff0f, transparent 18%), repeating-linear-gradient(to top, #ffffff05 0, #ffffff05 calc(var(--floor-height)  - 1px), var(--track-line) calc(var(--floor-height)  - 1px), var(--track-line) var(--floor-height), #fff0 var(--floor-height), #fff0 calc(var(--floor-height)  + var(--floor-gap))), linear-gradient(180deg, #274252, #14232d);
  border: 1px solid #ffffff14;
  border-radius: 24px;
  flex: 1;
}

.cabin {
  position: absolute;
  left: var(--cab-padding);
  right: var(--cab-padding);
  height: var(--cab-height);
  color: #081015;
  background: linear-gradient(#f8d391, #ee9747);
  border-radius: 18px;
  padding: 10px 9px;
  transition: bottom .72s cubic-bezier(.26,.78,.26,1), transform .22s, background .22s;
  box-shadow: inset 0 1px #ffffff80, 0 14px 28px #0003;
}

.cabin:before, .cabin:after {
  content: "";
  position: absolute;
  background: #0f1e26b8;
  border-radius: 10px;
  width: 22px;
  transition: transform .22s;
  top: 12px;
  bottom: 12px;
}

.cabin:before {
  left: 10px;
}

.cabin:after {
  right: 10px;
}

.cabin.open:before {
  transform: translateX(-5px);
}

.cabin.open:after {
  transform: translateX(5px);
}

.cabin.moving-up {
  transform: scale(1.01);
}

.cabin.moving-down {
  background: linear-gradient(#f6c17d, #ec7e49);
}

.cabin-header, .elevator-card header, .metrics-grid, .metric, .queue-pill, .panel-actions {
  display: flex;
}

.cabin-header, .metric {
  flex-direction: column;
}

.cabin-header {
  position: relative;
  z-index: 1;
  align-items:  center;
  gap: 4px;
}

.cabin-id {
  letter-spacing: .08em;
  font-weight: 800;
}

.cabin-floor {
  color: #081015c2;
  font-size: .8rem;
}

.elevator-panels {
  display: grid;
  gap: 14px;
}

.elevator-card {
  background: #ffffff0b;
  border: 1px solid #ffffff0f;
  border-radius: 18px;
  padding: 16px;
}

.elevator-card header {
  justify-content: space-between;
  align-items:  flex-start;
  gap: 12px;
}

.elevator-card h3, .queue-state {
  margin: 0;
}

.panel-summary {
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 12px;
}

.summary-block {
  display: grid;
  gap: 4px;
}

.summary-block strong {
  font-size: 1.2rem;
}

.queue-state {
  font-size: .85rem;
}

.direction-tag {
  text-transform: uppercase;
  letter-spacing: .12em;
  background: #ffffff14;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .78rem;
}

.direction-up {
  color: var(--green);
}

.direction-down {
  color: #ffb08d;
}

.direction-idle {
  color: var(--text-soft);
}

.cabin-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.cabin-button {
  color: var(--text-main);
  background: #ffffff0f;
  border-radius: 12px;
  min-height: 42px;
}

.cabin-button.active {
  background: #58d4b82e;
  box-shadow: inset 0 0 0 1px #58d4b859;
}

.metrics-grid {
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  background: #ffffff0d;
  border-radius: 16px;
  flex: 1;
  gap: 8px;
  padding: 14px;
}

.metric strong {
  font-size: 1.8rem;
}

.queue-list {
  display: grid;
  gap: 10px;
  min-height: 44px;
}

.queue-pill {
  background: #ffffff0d;
  border-radius: 14px;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  padding: 10px 12px;
}

.queue-pill strong {
  color: var(--text-main);
}

.event-log {
  list-style: none;
  display: grid;
  overflow: auto;
  gap: 10px;
  max-height: 280px;
  margin: 0;
  padding: 0;
}

.event-log li {
  background: #ffffff0b;
  border: 1px solid #ffffff0f;
  border-radius: 14px;
  padding: 11px 12px;
  line-height: 1.4;
}

.empty-state {
  background: #ffffff09;
  border-radius: 14px;
  padding: 10px 12px;
}

@media (max-width: 1180px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .page-shell {
    padding: 18px;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .floors-column {
    order: 2;
  }

  .shafts-panel {
    order: 1;
  }

  .hero-row {
    flex-direction: column;
    align-items:  flex-start;
  }
}

@media (max-width: 640px) {
  .shafts-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cabin-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero-actions {
    width: 100%;
  }

  .primary-button, .ghost-button {
    flex: 1;
  }
}
