/* ==========================================================================
   G-FEST 2026 Pocket Schedule — "Godzilla Minus One" theme
   Dark only. Ash-and-bone monochrome, cold atomic-blue for navigation,
   ember heat for whatever is live right now. Mobile-first, single column.
   ========================================================================== */

/* Oswald — display & labels. Single variable woff2 (latin), self-hosted for
   offline. Covers the full 200–700 weight range used across the UI. */
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("../fonts/oswald-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  /* Core — void, graphite, bone */
  --bg: #07090C;          /* Void — background            */
  --bg-2: #0B0E12;
  --surface: #13171C;     /* Graphite — cards, chrome      */
  --surface-2: #191E25;   /* Raised — inputs, chips        */
  --text: #E8E4DB;        /* Bone — primary text           */
  --muted: #9AA6B2;       /* Ash — secondary text          */
  --faint: #5A6470;
  --border: rgba(164, 184, 204, 0.12);  /* Hairline dividers  */
  --border-2: rgba(164, 184, 204, 0.22);

  /* Accents */
  --accent: #56C7EC;      /* Atomic — nav, buttons, links, focus */
  --accent-ink: #08171C;  /* Text on atomic fills                */
  --ember: #EA8A3C;       /* Ember — live, NOW, starred          */
  --ember-glow: rgba(234, 138, 60, 0.18);
  --ember-glow-2: rgba(234, 138, 60, 0.10);
  --atomic-glow: rgba(86, 199, 236, 0.18);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 22px rgba(0, 0, 0, 0.30);

  /* Track colors — muted steel; the pill carries the name, not loud color */
  --track-Panels: #6E93B8;
  --track-Model: #9182B0;
  --track-Gaming: #6F9576;
  --track-Cosplay: #B67E92;
  --track-Screening: #BE9A61;
  --track-Exhibit: #5E9AA1;
  --track-Event: #CA6B49;
  --track-Registration: #7E8894;
  --track-default: #6D7885;

  --maxw: 680px;
  --radius: 12px;
  --tap: 44px;
  --dur: 0.18s;

  --font-display: "Oswald", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Cold ambience wash at the top of the void; grain over the empty spaces.
   Both sit behind flow content (z-index:-*) so list surfaces stay crisp. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(72% 42% at 50% -8%, rgba(86, 199, 236, 0.08), transparent 60%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../assets/grain.png");
  background-size: 160px;
  opacity: 0.05;
  mix-blend-mode: soft-light;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7FD6F2; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 0 0 8px 0;
  z-index: 100;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(25, 33, 42, 0.55), var(--surface));
  border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top) + 9px) 16px 10px;
}
.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(86, 199, 236, 0.18), transparent);
}
.app-header__row {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.app-header__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-shadow: 0 0 18px rgba(86, 199, 236, 0.25);
}
.app-header__meta {
  max-width: var(--maxw);
  margin: 5px auto 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.app-header__clock {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-header__asof {
  font-size: 0.66rem;
  color: var(--faint);
}

.icon-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur), color var(--dur), transform var(--dur);
}
.icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn:hover { color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.is-spinning svg { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Install (Add to Home) — accent pill, revealed only when installable */
.app-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--atomic-glow);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur), color var(--dur), transform var(--dur);
}
.install-btn svg { width: 18px; height: 18px; display: block; }
.install-btn:hover { background: var(--accent); color: var(--accent-ink); }
.install-btn:active { transform: scale(0.96); }
.install-btn[hidden] { display: none; }

/* ----------------------------------------------------------------- View */
.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 16px calc(88px + env(safe-area-inset-bottom));
  outline: none;
}

.section { margin: 0 0 24px; }
.section__title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 12px 2px;
}

/* Happening-now section — ember label with a live pulse */
.section--live .section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ember);
}
.section--live .section__title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember);
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.28; } }

/* Time group */
.timegroup { margin: 0 0 18px; }
.timegroup__label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 0 0 10px 2px;
}

/* --------------------------------------------------------- Now hero banner */
.now-banner {
  position: relative;
  height: 116px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
  margin: 0 0 22px;
}
.now-banner__img {
  position: absolute;
  inset: 0;
  background-image: url("../assets/banner.jpg");
  background-size: cover;
  background-position: center 46%;
}
.now-banner__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 9, 12, 0.05), rgba(7, 9, 12, 0.78));
}
.now-banner__label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.live-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember);
  animation: livePulse 1.5s ease-in-out infinite;
}
/* Calm status dot for the banner when the con isn't live (no pulse) */
.status-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--atomic-glow);
}

/* ----------------------------------------------------------------- Cards */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 12px 14px 12px 16px;
  margin: 0 0 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
/* Thin (3px), muted, inset track rail */
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--rail, var(--track-default));
}
.card__body {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: none;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  display: block;
}
.card__time {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 5px;
}
.card__title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 8px;
}
.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}
.card__room { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Live / first-up cards — ember rail + a whisper of glow */
.card--live {
  border-color: var(--ember-glow);
  box-shadow: 0 0 0 1px var(--ember-glow), 0 14px 30px var(--ember-glow-2);
}
.card--live::before,
.card--first::before { background: var(--ember); }
.card--first .card__time { color: var(--ember); }

/* Live card time row: ember "LIVE" pill + bright time (matches design) */
.card__timerow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.card__timerow .card__time { margin-bottom: 0; color: var(--text); }
.live-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 7px;
  border-radius: 999px;
  background: var(--ember-glow);
  border: 1px solid rgba(234, 138, 60, 0.45);
  color: var(--ember);
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}
.live-pill .live-dot { width: 6px; height: 6px; }

/* Star toggle */
.star {
  flex: 0 0 auto;
  min-width: var(--tap);
  min-height: var(--tap);
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur), color var(--dur);
}
.star[aria-pressed="true"] { color: var(--ember); }
.star:active { transform: scale(0.85); }

/* ----------------------------------------------------------------- Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.chip--open { cursor: default; }
.chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--track-default);
  flex: 0 0 auto;
}

/* --------------------------------------------------------------- Empty state */
.empty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  text-align: center;
}
.empty__lead {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.empty__sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 14px; }
.empty__sub:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.btn--ghost {
  background: transparent;
  color: var(--accent);
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--tap);
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* --------------------------------------------------------------- Back up & share */
.backup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.backup__help {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.backup__actions {
  display: flex;
  gap: 10px;
}
.backup__actions .btn { flex: 1 1 0; }

/* --------------------------------------------------------------- Day tabs */
.daytabs {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}
.daytab {
  flex: 1 1 0;
  min-height: var(--tap);
  border: none;
  background: none;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9px;
  transition: background var(--dur), color var(--dur);
}
.daytab[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 16px rgba(86, 199, 236, 0.30);
}

/* --------------------------------------------------------------- Filters */
.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.filters__summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
}
.filters__summary::-webkit-details-marker { display: none; }
.filters__body { padding: 0 14px 14px; }
.filters__group { margin-bottom: 12px; }
.filters__group:last-child { margin-bottom: 0; }
.filters__legend {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 6px 0 8px;
}
.filters__actions { margin-top: 8px; }
.filters__count {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
}

/* --------------------------------------------------------------- NOW divider */
.now-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 18px;
}
.now-divider::before,
.now-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 2px;
}
.now-divider::before { background: linear-gradient(90deg, transparent, var(--ember)); }
.now-divider::after { background: linear-gradient(90deg, var(--ember), transparent); }
.now-divider__label {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ember);
  text-transform: uppercase;
}

/* --------------------------------------------------------------- Detail */
.detail__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}
.detail__row {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.detail__row:first-of-type { border-top: none; }
.detail__label {
  flex: 0 0 88px;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
}
.detail__value { flex: 1 1 auto; min-width: 0; line-height: 1.45; }
.detail__desc { margin-top: 14px; line-height: 1.62; color: #C4CCD4; }
.detail__star-wrap { margin: 16px 0 4px; }
.detail__star {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.detail__star[aria-pressed="true"] {
  border-color: var(--ember);
  background: var(--ember-glow);
  color: var(--ember);
}

/* --------------------------------------------------------------- Tab bar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: linear-gradient(180deg, var(--surface), #0D1218);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
}
.tabbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(86, 199, 236, 0.22), transparent);
}
.tabbar__tab {
  position: relative;
  flex: 1 1 0;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--faint);
  padding: 8px 4px;
}
.tabbar__icon { display: inline-flex; }
.tabbar__icon svg { width: 21px; height: 21px; display: block; }
.tabbar__label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tabbar__tab[aria-current="page"] { color: var(--accent); }
.tabbar__tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* --------------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 40;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-2);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast[hidden] { display: none; }

/* --------------------------------------------------------------- Footer */
.app-footer {
  max-width: var(--maxw);
  margin: 4px auto 0;
  padding: 20px 0 4px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.app-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  min-height: var(--tap);
}
.app-footer__link:hover { color: var(--text); }
.app-footer__link svg { display: block; }

/* --------------------------------------------- Install help sheet (iOS) */
.install-help {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.install-help__card {
  width: 100%;
  max-width: var(--maxw);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.install-help__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.install-help__lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.install-help__steps {
  margin: 0 0 20px;
  padding-left: 1.25em;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}
.install-help__steps b { color: var(--accent); font-weight: 600; }
.install-help__icon {
  width: 17px;
  height: 17px;
  vertical-align: -3px;
  color: var(--accent);
}
.install-help__done { width: 100%; }

@media (min-width: 480px) {
  .install-help { align-items: center; }
}

/* --------------------------------------------------------------- Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
