:root {
  --yellow: #FFE600;
  --black: #0D0D0D;
  --surface: #1A1A1A;
  --surface-2: #262626;
  --blue: #2F80FF;
  --white: #FFFFFF;
  --grey: #9A9A9A;
  --free: #34C759;
  --paid: #E53935;
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--black);
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

main#app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--yellow); text-decoration: none; }
button { font: inherit; cursor: pointer; }

.boot {
  margin: auto;
  color: var(--grey);
  font-size: 14px;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--black);
  border-bottom: 1px solid var(--surface-2);
}
.topbar__back {
  background: none;
  border: none;
  color: var(--yellow);
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  margin-left: -6px;
}
.topbar__title {
  margin: 0;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--yellow);
  font-weight: 800;
}
.topbar__spacer { flex: 1; }

/* ---------- Generic screen ---------- */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.screen__pad { padding: 20px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- NextPlan ---------- */

.brand {
  font-size: 56px;
  letter-spacing: 4px;
  color: var(--yellow);
  font-weight: 900;
  margin: 0;
}
.brand-sub {
  font-style: italic;
  color: var(--yellow);
  font-size: 20px;
  margin: 0 0 8px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h2 {
  margin: 0;
  font-size: 20px;
  color: var(--yellow);
}
.card p {
  margin: 0;
  color: var(--grey);
  font-size: 14px;
  line-height: 1.4;
}
.card[data-disabled="true"] h2,
.card[data-disabled="true"] .cta { color: var(--grey); }
.card[data-disabled="true"] .cta { border-color: transparent; }

.cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  border: 2px solid var(--yellow);
  border-radius: var(--radius-sm);
  background: var(--black);
  color: var(--yellow);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.cta:disabled, .cta[disabled] {
  border-color: var(--surface-2);
  color: var(--grey);
  background: var(--surface);
  cursor: not-allowed;
}

.mode-row {
  display: flex;
  gap: 12px;
}
.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--yellow);
  border-radius: var(--radius-sm);
  background: var(--black);
  color: var(--yellow);
  font-weight: 600;
}

.link-row {
  display: flex;
  gap: 16px;
}
.link-row button {
  flex: 1;
  background: none;
  border: none;
  color: var(--yellow);
  padding: 8px;
  font-weight: 600;
}

/* ---------- ShowList ---------- */

.list { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.show-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--white);
}
.show-card:active { background: var(--surface-2); }
.show-card__when {
  font-size: 12px;
  color: var(--yellow);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}
.show-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}
.show-card__venue {
  font-size: 13px;
  color: var(--grey);
  margin-bottom: 6px;
}
.show-card__row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--grey);
}
.pill--free { background: rgba(52,199,89,0.15); color: var(--free); }
.pill--paid { background: rgba(229,57,53,0.15); color: var(--paid); }
.pill--jam { background: rgba(47,128,255,0.15); color: var(--blue); }

/* Day header in list */
.day-header {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--yellow);
  font-weight: 800;
  text-transform: uppercase;
  margin: 18px 4px 4px;
}

/* Empty state */
.empty {
  margin: auto;
  text-align: center;
  color: var(--grey);
  padding: 40px 20px;
}
.empty strong { color: var(--yellow); }

/* ---------- Map ---------- */

#map {
  flex: 1;
  width: 100%;
  min-height: 60dvh;
}
.maplibregl-popup-content {
  background: var(--surface);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
.maplibregl-popup-tip { border-top-color: var(--surface) !important; }
.popup__title { color: var(--yellow); font-weight: 700; margin-bottom: 4px; }
.popup__cta { color: var(--yellow); font-size: 12px; font-weight: 700; cursor: pointer; }

/* Map marker */
.marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--black);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.4);
  cursor: pointer;
}
.marker--free { background: var(--free); }
.marker--paid { background: var(--paid); }

/* ---------- Detail ---------- */

.detail { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.detail h1 {
  font-size: 22px;
  margin: 0;
  color: var(--yellow);
  line-height: 1.25;
}
.detail .when {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--yellow);
  font-weight: 700;
}
.detail .venue {
  font-size: 15px;
  color: var(--white);
}
.detail .desc {
  font-size: 14px;
  color: var(--grey);
  line-height: 1.5;
  white-space: pre-wrap;
}
.detail .links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail .links a {
  display: block;
  text-align: center;
  padding: 14px;
  border: 2px solid var(--yellow);
  border-radius: var(--radius-sm);
  background: var(--black);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.detail .badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- iOS install hint ---------- */

.ios-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--yellow);
  border-radius: var(--radius);
  padding: 10px 12px;
  z-index: 50;
  font-size: 13px;
  line-height: 1.35;
}
.ios-hint__inner { display: flex; align-items: center; gap: 8px; }
.ios-hint button {
  background: none;
  border: none;
  color: var(--yellow);
  font-size: 22px;
  line-height: 1;
}
.ios-hint strong { color: var(--yellow); font-weight: 700; }
