@font-face {
  font-family: "VT323";
  src: url("/assets/fonts/vt323-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("/assets/fonts/vt323-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F;
  font-display: swap;
}
@font-face {
  font-family: "Press Start 2P";
  src: url("/assets/fonts/press-start-2p-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
  font-display: swap;
}
@font-face {
  font-family: "Press Start 2P";
  src: url("/assets/fonts/press-start-2p-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F;
  font-display: swap;
}

:root {
  --bg: #030a03;
  --bg-panel: #06140a;
  --green: #3dff5c;
  --green-dim: #1c8a34;
  --amber: #ffb000;
  --red: #ff3b3b;
  --border: #1c8a34;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* #boot-screen, #app and .view all set `display` via ID/class rules, which tie or beat the
   UA stylesheet's [hidden]{display:none} on specificity — without this, toggling the `hidden`
   attribute in app.js has no visual effect and elements stay stacked/clickable underneath. */
[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background: var(--bg);
  color: var(--green);
  font-family: "VT323", ui-monospace, monospace;
  font-size: 32px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(61, 255, 92, 0.55);
}

/* ---------- CRT overlay ---------- */
#crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.18) 0px,
      rgba(0, 0, 0, 0.18) 1px,
      transparent 2px,
      transparent 3px
    ),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: multiply;
  animation: flicker 6s infinite;
}
@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.88; }
  98% { opacity: 1; }
  99% { opacity: 0.93; }
}

/* ---------- Boot screen ---------- */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  padding: 6vh 6vw;
}
#boot-log {
  margin: 0;
  font-size: 28px;
  line-height: 1.4;
  white-space: pre-wrap;
}
#boot-log .cursor::after {
  content: "\2588";
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- App shell ---------- */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2vh 2vw 0.4vh;
  border-bottom: 2px solid var(--border);
}
#wordmark {
  margin: 0;
  font-size: 11px;
  line-height: 1.1;
  color: var(--green);
  text-shadow: 0 0 6px rgba(61, 255, 92, 0.7);
}
#clock {
  font-size: 30px;
  color: var(--amber);
  white-space: nowrap;
}

main#views {
  flex: 1;
  min-height: 0;
  position: relative;
}
.view {
  position: absolute;
  inset: 0;
  padding: 1.5vh 3vw 1vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.view-title {
  margin: 0 0 1.2vh;
  font-size: 30px;
  font-weight: normal;
  color: var(--green);
}
.view-title::after {
  content: "\2588";
  margin-left: 4px;
  animation: blink 1.1s steps(1) infinite;
}

.scroll-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Departure rows ---------- */
.dep-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2vw;
  align-items: baseline;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
}
.dep-line {
  font-size: 30px;
  padding: 2px 10px;
  border: 2px solid var(--green);
  color: var(--bg);
  background: var(--green);
  font-weight: bold;
  white-space: nowrap;
}
.dep-direction {
  font-size: 32px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dep-eta {
  font-size: 32px;
  text-align: right;
  white-space: nowrap;
}
.dep-row.cancelled .dep-direction,
.dep-row.cancelled .dep-eta {
  color: var(--red);
  text-decoration: line-through;
}
.dep-row .delay {
  color: var(--amber);
}

/* ---------- Event rows ---------- */
.event-day {
  color: var(--amber);
  font-size: 26px;
  margin-top: 6px;
  border-bottom: 1px dashed var(--green-dim);
}
.event-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2vw;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
}
.event-time {
  white-space: nowrap;
  color: var(--amber);
}
.event-title .repeat-glyph {
  color: var(--green-dim);
  margin-right: 6px;
}
.event-location {
  display: block;
  font-size: 22px;
  color: var(--green-dim);
}

.empty-state,
.error-state {
  margin-top: 2vh;
  padding: 16px;
  border: 1px dashed var(--green-dim);
  color: var(--green-dim);
}
.error-state {
  border-color: var(--red);
  color: var(--red);
}

/* ---------- Tabs (touch nav) ---------- */
#tabs {
  display: flex;
  border-top: 2px solid var(--border);
}
.tab {
  flex: 1;
  appearance: none;
  border: none;
  border-right: 2px solid var(--border);
  background: var(--bg);
  color: var(--green-dim);
  font-family: inherit;
  font-size: 34px;
  padding: 22px 8px;
  min-height: 96px;
  cursor: pointer;
}
.tab:last-child {
  border-right: none;
}
.tab[aria-current="true"] {
  background: var(--green-dim);
  color: var(--bg);
}
.tab:active {
  background: var(--green);
  color: var(--bg);
}
