:root {
  --bg-0: #06070b;
  --bg-1: #0a0c11;
  --panel: #10131a;
  --panel-2: #141923;
  --head: #181d27;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.04);
  --text: #f2f4f8;
  --muted: #a8afbb;
  --yellow: #f5c73c;
  --green: #34d66c;
  --red: #ff595f;
  --slot-top: #1a1f2a;
  --slot-bottom: #0f131b;
  --slot-face: #f1f4f8;
  --slot-border: rgba(255, 255, 255, 0.05);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  --weather-blue: #56a8ff;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #151924 0%, #0b0d13 30%, #06070b 100%);
}

button {
  font: inherit;
}

.page-shell {
  max-width: 1760px;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  margin-bottom: 14px;
}

.topbar-main,
.board-column,
.legend-bar {
  background: linear-gradient(180deg, rgba(18, 21, 28, 0.96), rgba(10, 12, 17, 0.98));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.topbar-main {
  padding: 16px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.title-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.spring-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.title-copy {
  min-width: 0;
}

.title-copy h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right.header-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: max-content;
  white-space: nowrap;
}

.date-nav-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--yellow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.date-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.date-text-strip,
.clock-text {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1;
}

.date-text-strip {
  color: var(--yellow);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.clock-text {
  color: var(--yellow);
  font-weight: 700;
  min-width: 94px;
  justify-content: center;
}

.single-board-wrap {
  display: block;
}

.board-column {
  overflow: hidden;
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 31, 42, 0.95), rgba(15, 18, 26, 0.97));
}

.board-title-text {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.weather-text-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  min-width: 560px;
  max-width: 760px;
  min-height: 34px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  color: #d7e8ff;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.board-head-row,
.board-row {
  display: grid;
  grid-template-columns: 228px 152px 874px 266px 152px;
}

.board-head-row {
  background: var(--head);
  border-bottom: 1px solid var(--line);
}

.board-head-row > div {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  font-size: 17px;
  color: #edf1f7;
}

.board-head-row > div:last-child {
  border-right: none;
}

.board-body {
  min-height: 620px;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  overflow-x: hidden;
}

.board-row {
  min-height: 72px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}

.board-row:nth-child(even) {
  background: transparent;
}

.col-time,
.col-origin,
.col-destination,
.col-flight,
.col-gate {
  padding: 8px 0;
  border-right: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 0;
}

.col-gate {
  border-right: none;
}

.flip-line {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  overflow: visible;
}

.flip-slot {
  position: relative;
  width: 38px;
  height: 56px;
  flex: 0 0 38px;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--slot-border);
  border-right: none;
  background: linear-gradient(180deg, var(--slot-top), var(--slot-bottom));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

.flip-line .flip-slot:last-child {
  border-right: 1px solid var(--slot-border);
}

.flip-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.015) 46%,
      rgba(0, 0, 0, 0.10) 49%,
      rgba(0, 0, 0, 0.28) 50%,
      rgba(255, 255, 255, 0.015) 54%,
      rgba(0, 0, 0, 0.04) 100%
    );
  z-index: 1;
  pointer-events: none;
}

.flip-slot::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.14),
    rgba(0, 0, 0, 0.72)
  );
  transform: translateY(-1px);
  z-index: 3;
  pointer-events: none;
}

.col-time .flip-slot,
.col-origin .flip-slot,
.col-destination .flip-slot,
.col-flight .flip-slot,
.col-gate .flip-slot {
  background: linear-gradient(180deg, #1a1f2a, #0f131b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slot-face);
  font-family: Tahoma, Arial, sans-serif;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  padding: 0;
  z-index: 2;
}

.flip-slot.flipping .flip-face {
  animation: flipPulse 0.16s linear infinite;
  transform-origin: center center;
}

@keyframes flipPulse {
  0% {
    transform: rotateX(0deg);
    opacity: 1;
  }
  45% {
    transform: rotateX(88deg);
    opacity: 0.2;
  }
  55% {
    transform: rotateX(-88deg);
    opacity: 0.2;
  }
  100% {
    transform: rotateX(0deg);
    opacity: 1;
  }
}

.flip-slot.space {
  background: linear-gradient(180deg, #111826, #0b1018);
}

.flip-slot.space::before,
.flip-slot.space::after {
  display: none;
}

.col-time.time-yellow .flip-face {
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(245, 199, 60, 0.28);
}

.col-time.time-green .flip-face {
  color: var(--green);
  text-shadow: 0 0 10px rgba(52, 214, 108, 0.28);
}

.col-time.time-red .flip-face {
  color: var(--red);
  text-shadow: 0 0 10px rgba(255, 89, 95, 0.28);
}

.origin-flip .flip-face,
.destination-flip .flip-face,
.flight-flip .flip-face,
.gate-flip .flip-face {
  color: #f4f7fb;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.10);
}

.time-flip {
  width: 228px;
}

.origin-flip {
  width: 152px;
}

.destination-flip {
  width: 874px;
}

.flight-flip {
  width: 266px;
}

.gate-flip {
  width: 152px;
}

.empty-state {
  padding: 28px 18px;
  color: var(--muted);
  font-size: 18px;
}

.legend-bar {
  margin-top: 14px;
  padding: 14px 18px;
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #eef1f6;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.scheduled {
  background: var(--yellow);
}

.legend-dot.ontime {
  background: var(--green);
}

.legend-dot.delayed {
  background: var(--red);
}

@media (max-width: 1300px) {
  .topbar-main {
    gap: 12px;
  }

  .title-copy h1 {
    font-size: 24px;
  }

  .header-right.header-inline {
    gap: 8px;
  }

  .weather-text-strip {
    min-width: 420px;
    max-width: 560px;
  }
}

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

  .spring-logo {
    height: 28px;
  }

  .title-copy h1 {
    font-size: 20px;
  }

  .topbar-main {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .header-right.header-inline {
    justify-content: flex-end;
    width: 100%;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
  }

  .date-nav-btn {
    min-width: 30px;
    height: 30px;
  }

  .date-text-strip,
  .clock-text {
    min-height: 30px;
    padding: 0 8px;
    font-size: 13px;
  }

  .board-toolbar {
    padding: 12px 14px 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  .board-title-text {
    font-size: 24px;
  }

  .weather-text-strip {
    width: 100%;
    min-width: 0;
    max-width: none;
    font-size: 13px;
    justify-content: flex-end;
    text-align: right;
  }

  .board-head-row,
  .board-row {
    grid-template-columns: 144px 96px 552px 168px 96px;
  }

  .flip-slot {
    width: 24px;
    flex-basis: 24px;
    height: 42px;
  }

  .flip-face {
    font-size: 18px;
  }

  .time-flip {
    width: 144px;
  }

  .origin-flip {
    width: 96px;
  }

  .destination-flip {
    width: 552px;
  }

  .flight-flip {
    width: 168px;
  }

  .gate-flip {
    width: 96px;
  }
}