:root {
  --bg: #000000;            /* transparent on additive display */
  --surface: #0a0a0a;       /* opaque cards on the waveguide */
  --surface-2: #14141a;
  --text: #FFFFFF;
  --muted: #777777;         /* neutral grey */
  --accent: #f01941;        /* red */
  --accent-soft: rgba(240, 25, 65, 0.30);
  --accent-strong: #c01030;
  --danger: #ff4466;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --safe: 16px;
}

/* Per-venue accent overrides — picked up via body[data-venue=…] set by app.js. */
body[data-venue="london"] {
  --accent: #770077;        /* BTS purple — "I purple you" */
  --accent-soft: rgba(119, 0, 119, 0.30);
  --accent-strong: #5a005a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'Avenir Next Condensed', 'Helvetica Neue Condensed', 'Arial Narrow', 'Bahnschrift Condensed', Pretendard, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-stretch: condensed;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 18px;
  margin: 0;
  padding: 0;
}
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  /* iOS Safari + Android dynamic toolbar correction */
  min-height: 100dvh;
}

/* The app is a fixed 600x600 canvas (glasses-first). On non-glasses
   viewports, JS (`fitApp()` in app.js) takes over to set width/height and
   the scale transform — on phones we stretch the canvas to viewport height
   and scale by width; on desktop we letterbox to the smaller dimension. */
#app {
  width: 600px;
  height: 600px;
  position: relative;
  overflow: hidden;
  transform-origin: top center;
}

/* ---- Display headings: system stack uppercase tracked ---- */
h1, .display {
  font-family: 'Avenir Next Condensed', 'Helvetica Neue Condensed', 'Arial Narrow', 'Bahnschrift Condensed', Pretendard, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- Screens ---- */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0; left: 0;
  padding: var(--safe);
}
.screen.hidden { display: none; }

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.header h1 {
  font-size: 26px;
  flex: 1;
}
.header-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
  min-width: 0;
  /* Reserve room on the right so the global clock pill never overlaps the date. */
  padding-right: 84px;
}
.header-title-group h1 {
  flex: 0 0 auto;
}
.header-meta {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.back-btn {
  background: transparent;
  color: var(--text);
  font-size: 20px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  min-height: 36px;
}

/* ---- Content area ---- */
.content {
  flex: 1;
  padding: 12px 4px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.content-center {
  justify-content: center;
  align-items: stretch;
  text-align: center;
}
.content-fixed {
  overflow: hidden;
  gap: 10px;
}

/* ---- Focus state (D-pad / EMG) ---- */
.focusable {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
}
.focusable:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

/* ---- Section title with ibighit-style left block ---- */
.section-title {
  font-family: 'Avenir Next Condensed', 'Helvetica Neue Condensed', 'Arial Narrow', 'Bahnschrift Condensed', Pretendard, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 15px;
  color: var(--text);
  position: relative;
  padding-left: 14px;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 4px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 14px;
  background: var(--accent);
}

/* ---- Hero card ---- */
.hero {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--accent-soft);
}
.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-headline {
  font-family: 'Avenir Next Condensed', 'Helvetica Neue Condensed', 'Arial Narrow', 'Bahnschrift Condensed', Pretendard, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 36px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.hero-sub {
  font-size: 16px;
  color: var(--muted);
  margin-top: 4px;
  white-space: pre-line;
  line-height: 1.4;
}
.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-flex { flex: 1; min-width: 0; }

.hint, .tip {
  font-size: 15px;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
}
.hint-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}
.hint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hint-list li {
  position: relative;
  padding-left: 16px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.4;
}
.hint-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.hint-rules { border-left-color: var(--danger); }
.hint-rules .hint-title { color: var(--danger); }
.hint-rules .hint-list li::before {
  content: '✕';
  background: transparent;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  top: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  line-height: 1;
}
.hint-rules .hint-list li { padding-left: 16px; }

.link-btn {
  background: transparent;
  color: var(--accent);
  border: 0;
  padding: 2px 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.link-btn:focus {
  outline: none;
  background: var(--accent-soft);
  border-radius: 4px;
}

/* ---- Nav bar ---- */
.nav-bar {
  display: flex;
  gap: 6px;
  padding: 6px 0;
  background: transparent;
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 8px;
  background: var(--surface);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: 'Avenir Next Condensed', 'Helvetica Neue Condensed', 'Arial Narrow', 'Bahnschrift Condensed', Pretendard, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}
.nav-item:focus { background: var(--surface-2); }

/* On portrait phones (viewport < 500px) collapse each 4-button nav row into
   a 2-column grid so buttons are large enough to tap. Glasses (≈600px wide)
   keep the original 4-across flex layout. */
@media (max-width: 500px) {
  /* Bump body base + every common text style on mobile. The canvas is scaled
     by width/600 on mobile (~0.65 on a 390px phone) so the on-screen pixel
     size of any 14px element is ~9px — we counteract by inflating the
     authored sizes inside the 600px canvas. `#home` / `#settings` etc.
     prefixes lift specificity past base rules defined later in this file. */
  body { font-size: 22px; }
  .header h1 { font-size: 30px; }
  .header-meta { font-size: 16px; }
  .section-title { font-size: 18px; }
  .hint-title { font-size: 15px; }
  .hint-list li, .checklist li, .muted-body, .muted-line { font-size: 16px; }

  /* Hero block */
  .hero-eyebrow  { font-size: 15px; }
  .hero-headline { font-size: 44px; }
  .hero-sub      { font-size: 17px; }
  .hero-compact .hero-eyebrow  { font-size: 14px; }
  .hero-compact .hero-headline { font-size: 36px; }
  .hero-compact .hero-sub      { font-size: 15px; }

  /* Choices, buttons, chips */
  .choice { font-size: 22px; padding: 18px 16px; }
  .primary-btn { font-size: 20px; min-height: 56px; }
  .chip { font-size: 14px; }

  /* List items everywhere */
  .list-item-title { font-size: 20px; }
  .list-item-sub   { font-size: 15px; }
  .list-item-meta  { font-size: 15px; }

  /* Compass / direction widget */
  .direction-distance { font-size: 17px; }
  .direction-bearing  { font-size: 13px; }

  /* Gates screen extras */
  .gate-card-id { font-size: 28px; }
  .gate-card-sub { font-size: 14px; }
  .gate-card-cd { font-size: 15px; }
  .gate-note, .gate-note-rule { font-size: 14px; }
  .hint, #gates-closer-hint { font-size: 15px; }

  /* Setlist */
  .setlist-row-title  { font-size: 24px; }
  .setlist-row-idx    { font-size: 18px; width: 38px; }
  .setlist-row        { padding: 16px 18px; gap: 16px; }
  .setlist-act-divider { font-size: 17px; padding: 14px 4px 8px; }

  /* Schedule */
  .timeline-event-title { font-size: 18px; }
  .timeline-event-sub   { font-size: 14px; }
  .timeline-event-time  { font-size: 14px; }

  /* Restrooms */
  .restroom-row .list-item-title { font-size: 19px; }
  .est-badge { font-size: 11px; }

  /* Settings */
  .row-toggle .row-label { font-size: 17px; }
  .row-toggle .row-state { font-size: 15px; }

  /* Footer chip */
  .footer-chip { font-size: 12px; }

  /* Existing nav rules */
  .nav-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .nav-item {
    flex: none;
    font-size: 24px;
    padding: 24px 10px;
    letter-spacing: 0.06em;
  }
  /* Push the menu (nav-bars) to the bottom of the home screen. */
  #home .nav-bar:first-of-type {
    margin-top: auto;
  }
  /* Stack the "Right Now" + "Your Gate" cards vertically and let them size
     to their content (instead of trying to share a flex: 1 budget that
     collapsed to 0 on a scrollable parent). */
  .home-row {
    grid-template-columns: 1fr;
    flex: none;
    min-height: 0;
  }
  .home-col {
    overflow: visible;
    min-height: 0;
  }
  .home-col-body {
    flex: none;
    overflow: visible;
    min-height: 0;
  }
  /* Let home content scroll if hero + cards still exceed the visible area. */
  .content-fixed {
    overflow-y: auto;
  }
  /* Hide the global clock on mobile — the phone status bar already shows time. */
  .clock-global { display: none !important; }

  /* Make the seat card the hero of the screen — big white numbers on a
     dark surface, red border + glow. Three columns: SEC / ROW / SEAT.
     `#home` prefix lifts specificity above the base .hero-seat rules
     defined later in this file. */
  #home .hero-seat {
    padding: 22px 14px 26px;
    background: var(--surface);
    color: var(--text);
    border: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 28px var(--accent-soft);
    grid-template-rows: auto auto;
    gap: 4px 8px;
  }
  #home .hero-seat-label { font-size: 14px; letter-spacing: 0.2em; }
  #home .hero-seat-value { font-size: 76px; }

  /* Compact the existing cards to free up vertical space for the seat block. */
  .home-col {
    padding: 6px 8px;
    gap: 4px;
  }
  .home-col-title { font-size: 13px; letter-spacing: 0.10em; }
  .home-col .now-item { font-size: 16px; gap: 8px; }
  .home-col .now-label { font-size: 16px; }
  .home-col .now-sub { font-size: 14px; }
  .home-col .now-countdown { font-size: 14px; }
  /* Home "Your Gate" card — large legible text + arrow. */
  .home-col .gate-card-id  { font-size: 36px; }
  .home-col .gate-card-sub { font-size: 16px; }
  .home-col .gate-card-cd  { font-size: 20px; }
  #home .gate-card .direction-arrow    { font-size: 84px; }
  #home .gate-card .direction-distance { font-size: 20px; font-weight: 700; }
  #home .gate-card .direction-bearing  { font-size: 14px; }

  /* Enable-compass button: hidden on glasses, only shown on mobile when the
     phone needs a user tap to grant DeviceOrientation permission (iOS). */
  .compass-btn {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--text);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .compass-btn:focus { background: var(--accent-soft); }
}
.compass-btn.hidden { display: none; }

/* ---- Buttons ---- */
.primary-btn {
  background: var(--accent);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: 'Avenir Next Condensed', 'Helvetica Neue Condensed', 'Arial Narrow', 'Bahnschrift Condensed', Pretendard, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 52px;
  border: 2px solid transparent;
}
.primary-btn:focus {
  background: var(--accent-strong);
  border-color: var(--text);
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.chip {
  background: var(--surface-2);
  color: var(--text);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--accent-soft);
  min-height: 32px;
  white-space: nowrap;
}
.chip:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---- Choice rows ---- */
.choice-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.choice-stack {
  flex-direction: column;
}
.choice-stack .choice { width: 100%; }

/* Push onboarding NEXT button to the bottom of the screen */
.onboarding-cta { margin-top: auto; }
.choice {
  flex: 1;
  min-width: 96px;
  padding: 14px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  min-height: 52px;
}
.choice.selected {
  background: var(--accent);
  color: var(--text);
}
.choice.selected:focus {
  background: var(--accent-strong);
}
.choice[disabled],
.choice.is-past {
  opacity: 0.35;
  text-decoration: line-through;
  pointer-events: none;
  cursor: default;
}

/* ---- Seat-input form (onboarding step 4) ---- */
.seat-input-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.seat-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.seat-input-label {
  flex: 0 0 80px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}
.seat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 0;
  min-width: 0;
}
.seat-input::placeholder { color: rgba(119,119,119,0.5); font-weight: 400; }
.seat-input-row:focus-within {
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--accent), 0 0 16px var(--accent-soft);
}

/* ---- NumberWheel (digit scroll picker for D-pad / glasses) ---- */
/* Default: wheel mounts hidden. Made visible inside @media (min-width: 600px). */
.seat-wheel-mount { display: none; }

.number-wheel {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}
.number-wheel-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  min-width: 38px;
  width: 38px;
  height: 78px;
  cursor: ns-resize;
  font-family: inherit;
  line-height: 1;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.number-wheel-digit {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  transition: color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.number-wheel-digit.prev,
.number-wheel-digit.next {
  font-size: 14px;
  color: var(--muted);
  opacity: 0.55;
}
.number-wheel-digit.current {
  font-size: 30px;
  color: var(--accent);
  margin: 2px 0;
}
.number-wheel-col:focus {
  outline: none;
  background: var(--surface-2);
}
.number-wheel-col:focus .number-wheel-digit.current {
  color: var(--text);
}

/* Glasses + desktop (≥ 600 px viewport): show wheel pickers, hide the text
   input. Mobile (< 500 px) keeps the existing keyboard input — that path is
   faster on a phone. */
@media (min-width: 600px) {
  .seat-input-row .seat-input { display: none; }
  .seat-input-row .seat-wheel-mount { display: block; flex: 1; }
}
.text-btn {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(119,119,119,0.4);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}
.text-btn:focus { color: var(--text); border-color: var(--accent); }

/* ---- Hero seat block (Home, under hero) ---- */
.hero-seat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.hero-seat.hidden { display: none; }
.hero-seat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
}
.hero-seat-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--accent);
}
.hero-seat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ---- Settings rows ---- */
.row-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
  color: var(--text);
  text-align: left;
}
.row-label { font-size: 15px; }
.row-state {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* ---- Disclaimer ---- */
.disclaimer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}
.disclaimer-title {
  font-family: 'Avenir Next Condensed', 'Helvetica Neue Condensed', 'Arial Narrow', 'Bahnschrift Condensed', Pretendard, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 36px;
  color: var(--text);
  line-height: 1;
}
.disclaimer-date {
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 700;
}
.disclaimer-badge {
  display: inline-block;
  align-self: center;
  background: var(--danger);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}
.disclaimer-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 12px;
  padding: 0 8px;
}
.disclaimer-source {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 18px;
  padding: 0 8px;
}
.disclaimer-url {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.source-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.04em;
  margin-top: 10px;
  padding: 0 4px;
}

/* ---- Lists ---- */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 100%;
}
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 16px;
  gap: 12px;
  text-align: left;
}
.list-item:focus { background: var(--surface-2); }
.list-item-title { flex: 1; font-weight: 600; }
.list-item-meta {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.list-item-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-soft);
  padding: 3px 7px;
  border-radius: 10px;
}

/* ---- Timeline (Schedule) ---- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.timeline-item {
  display: flex;
  gap: 20px;
  padding: 12px 8px 12px 24px;
  border-left: 2px solid var(--accent-soft);
  margin-left: 10px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -8px; top: 16px;
  width: 14px; height: 14px;
  background: var(--surface);
  border: 2px solid var(--accent-soft);
  border-radius: 50%;
}
.timeline-item.is-next::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-item.is-past { opacity: 0.5; }
.timeline-time {
  flex: 0 0 84px;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
}
.timeline-content { flex: 1; }
.timeline-title { font-size: 16px; font-weight: 600; }
.timeline-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.timeline-item.is-next .timeline-title { color: var(--text); }
.timeline-item.is-next .timeline-time { color: var(--accent); }

/* ---- Setlist screen ---- */
.setlist-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.setlist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.setlist-act-divider {
  font-family: 'Avenir Next Condensed', 'Helvetica Neue Condensed', 'Arial Narrow', 'Bahnschrift Condensed', Pretendard, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--accent);
  padding: 8px 4px 4px;
  border-bottom: 1px solid var(--accent-soft);
}
.setlist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: left;
}
.setlist-row-idx {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  width: 26px;
  flex-shrink: 0;
}
.setlist-row-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.setlist-lyric-strip {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  flex-shrink: 0;
}
.strip-eyebrow {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.strip-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 16px;
  margin: 2px 0 4px;
}
.strip-line { font-size: 13px; color: var(--text); line-height: 1.35; }
.strip-en   { font-size: 11px; color: var(--muted); line-height: 1.35; margin-top: 2px; }

.song-hint {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-align: center;
  padding: 2px;
}

/* ---- Translate screen ---- */
.translate-pane {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 120px;
  font-size: 14px;
  border: 1px solid var(--accent-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.translate-line {
  padding: 4px 0;
  border-bottom: 1px solid rgba(240, 25, 65, 0.15);
}
.translate-line:last-child { border-bottom: 0; }
.translate-line.fresh { color: var(--text); }
.translate-line.stale { color: var(--muted); }
.translate-line .ko {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.translate-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 24px 8px;
}
.banter-line {
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.banter-ko { color: var(--text); font-weight: 600; }
.banter-ro { color: var(--accent); font-size: 11px; letter-spacing: 0.04em; }
.banter-en { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---- Direction arrow widget ---- */
.direction {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.direction-arrow {
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
  display: inline-block;
  transform-origin: 50% 50%;
  /* Smooth rotation so compass jitter doesn't look glitchy. */
  transition: transform 0.18s ease-out;
  will-change: transform;
}
.direction.direction-sm .direction-arrow { font-size: 36px; }
.direction-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.direction-distance {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.direction.direction-sm .direction-distance { font-size: 13px; }
.direction-bearing {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.direction.direction-sm .direction-bearing { font-size: 9px; }

/* ---- Transportation section tabs ---- */
.transport-section-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.transport-section-tabs .chip.selected {
  background: var(--accent);
  color: var(--text);
  border-color: var(--accent);
}

/* ---- Transportation cards ---- */
.transport-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#transit-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.transport-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.transport-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 15px;
  color: var(--text);
}
.transport-meta {
  font-size: 14px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.transport-sub  { font-size: 15px; color: var(--muted); }
.transport-note { font-size: 14px; color: var(--muted); line-height: 1.45; margin-top: 4px; }
.transport-note .link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
}
.transport-note .link:hover, .transport-note .link:focus { text-decoration: underline; }

.parking-lot-list, .parking-rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.parking-lot {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.parking-lot-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: 0.03em;
}
.parking-lot-sub { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.parking-lot-days {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: 6px;
}
.parking-rule-list li {
  position: relative;
  padding-left: 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.parking-rule-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.section-title .chip {
  font-size: 9px;
  padding: 4px 8px;
  min-height: 22px;
  margin-left: 8px;
}

/* ---- Home: compact hero + side-by-side cards ---- */
.hero-compact { padding: 10px 14px; }
.hero-compact .hero-eyebrow { font-size: 11px; }
.hero-compact .hero-headline { font-size: 26px; line-height: 1.0; }
.hero-compact .hero-sub { font-size: 13px; margin-top: 2px; }

.home-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.home-row.home-row-solo { grid-template-columns: 1fr; }
.home-col {
  background: var(--surface);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}
.home-col-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.home-col-body { flex: 1; min-height: 0; overflow: hidden; }

.muted-line { font-size: 12px; color: var(--muted); }
.now-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 100%;
  overflow: hidden;
}
.now-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 8px;
  row-gap: 2px;
  padding: 6px 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.now-icon {
  font-size: 14px;
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: 2px;
}
.now-body { min-width: 0; display: flex; flex-direction: column; }
.now-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-sub {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-countdown {
  /* Now sits on its own row below the label/sub, aligned to the left edge. */
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  grid-column: 2;
}

/* ---- Home: Your-gate card (compact) ---- */
.gate-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  height: 100%;
}
.gate-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.gate-card .direction {
  align-self: flex-start;
  align-items: flex-start;
  margin-top: auto;
}
.gate-card .direction .direction-info {
  align-items: flex-start;
}
/* Bigger arrow specifically in the Home "Your Gate" card so direction is
   readable at a glance from across the room. */
#home .gate-card .direction-arrow { font-size: 48px; }
#home .gate-card .direction-distance { font-size: 13px; font-weight: 700; }
#home .gate-card .direction-bearing { font-size: 9px; }
.gate-card-id {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 22px;
  color: var(--text);
  line-height: 1;
}
.gate-card-sub { font-size: 10px; color: var(--muted); line-height: 1.2; }
.gate-card-cd {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.gate-card-cd.is-open {
  color: var(--text);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 8px;
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.06em;
  align-self: flex-start;
}
.gate-card-dist {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-top: auto;
}

/* ---- Gate countdown inside hero ---- */
.hero-countdown {
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.hero-countdown.is-open {
  color: var(--text);
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
  font-size: 14px;
  letter-spacing: 0.06em;
}

/* Selected gate row */
.list-item.is-selected {
  border: 2px solid var(--accent);
  background: var(--surface-2);
}

/* ---- Gate note inside hero ---- */
.gate-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--accent-soft);
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}
.gate-note .gate-note-rule {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* ---- Merch cards ---- */
#merch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.merch-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border-left: 3px solid var(--accent-soft);
}
.merch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.merch-label {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 15px;
  color: var(--text);
}
.merch-status {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.status-open    { background: var(--accent); color: var(--text); }
.status-upcoming{ background: var(--accent-soft); color: var(--accent); }
.status-closed  { background: rgba(119,119,119,0.25); color: var(--muted); }
.merch-location { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.merch-hours    { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.merch-countdown{ font-size: 16px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 6px; }
.merch-note     { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; margin-top: 3px; }
.merch-dist     { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 4px; }
.merch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.merch-card-body { flex: 1; min-width: 0; }
.merch-card:has(.status-open) { border-left-color: var(--accent); }

/* ---- Clock (global, top-right corner) ---- */
.clock-global {
  position: fixed;
  top: 6px;
  right: 6px;
  z-index: 999;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.75);
  padding: 6px 14px;
  border-radius: 12px;
  border: 1px solid var(--accent-soft);
  pointer-events: none;
}

/* ---- Debug coords badge (Settings → Show current location) ---- */
.debug-coords {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 2px 6px;
  border: 1px solid var(--accent-soft);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* Keep the home title to its content width so the debug badge sits flush
   beside "STANFORD" instead of being shoved under the global clock pill. */
#home .header h1 { flex: 0 0 auto; }
#home .header .gps-dot { margin-left: auto; margin-right: 84px; }

/* ---- GPS indicator dot ---- */
.gps-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: gps-pulse 1.6s ease-in-out infinite;
}
@keyframes gps-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50%      { opacity: 1.0; transform: scale(1.1); }
}

/* ---- Footer chip ---- */
.footer-chip {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

/* ---- Misc ---- */
.muted-body { font-size: 15px; color: var(--muted); line-height: 1.5; padding: 0 4px; }
.text-input {
  width: 100%;
  font-size: 18px;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font-family: inherit;
}
.text-input::placeholder { color: var(--muted); }
.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.input-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
  display: block;
}
.url-box {
  font-family: ui-monospace, 'SF Mono', 'Monaco', monospace;
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-soft);
  word-break: break-all;
  text-align: center;
  margin-top: 8px;
}
.hidden { display: none !important; }
