/* ===========================================================
   One Last Round — Cork pub crawl
   Irish pub palette: stout black, shamrock green, brass gold,
   creamy head, a stripe of the tricolour.
   =========================================================== */

:root {
  --stout: #0b120d;
  --stout-2: #111b13;
  --panel: #16231a;
  --panel-2: #1d2f22;
  --green: #2fbf71;
  --green-deep: #169b62;
  --gold: #e8b53c;
  --gold-soft: #f5d78a;
  --orange: #ff883e;
  --cream: #f6f1e0;
  --cream-dim: #cdc7b4;
  --muted: #8f9b8c;
  --line: rgba(232, 181, 60, 0.22);
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --font-display: "Uncial Antiqua", "Papyrus", serif;
  --font-body: "Karla", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--cream);
  background-color: var(--stout);
  /* Celtic interlace wallpaper + warm pub glow */
  background-image:
    radial-gradient(900px 480px at 50% -8%, rgba(47, 191, 113, 0.16), transparent 70%),
    radial-gradient(700px 420px at 100% 100%, rgba(232, 181, 60, 0.09), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%232fbf71' stroke-opacity='0.13' stroke-width='1.4'%3E%3Cpath d='M0 40a40 40 0 0 1 40-40 40 40 0 0 1 40 40 40 40 0 0 1-40 40A40 40 0 0 1 0 40z'/%3E%3Ccircle cx='40' cy='40' r='18'/%3E%3Cpath d='M40 0v22M40 58v22M0 40h22M58 40h22'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed, fixed, fixed;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.ico {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  color: var(--green);
}

a {
  color: var(--gold-soft);
}

/* ---------- tricolour ---------- */
.tricolour {
  position: sticky;
  top: 0;
  z-index: 500;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--green-deep) 0 33.33%,
    #f7f4ea 33.33% 66.66%,
    var(--orange) 66.66% 100%
  );
}

/* ---------- hero ---------- */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.6rem 1.25rem 1.2rem;
  text-align: center;
}

.hero__knot {
  color: var(--gold);
  opacity: 0.85;
}

.hero__knot svg {
  width: 190px;
  height: 110px;
}

.kicker {
  margin: 0.2rem 0 0.6rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.kicker .ico {
  color: var(--gold);
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 11vw, 4.6rem);
  line-height: 1.02;
  color: var(--cream);
  text-shadow:
    0 0 22px rgba(47, 191, 113, 0.35),
    0 3px 0 rgba(0, 0, 0, 0.5);
}

.hero__subtitle {
  margin: 0.5rem 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 4.2vw, 1.45rem);
  color: var(--green);
}

.hero__meta {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero__intro {
  margin: 0 auto 1.1rem;
  max-width: 62ch;
  color: var(--cream-dim);
}

.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.rules li {
  padding: 0.4rem 0.85rem;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: rgba(22, 35, 26, 0.65);
  font-size: 0.92rem;
  color: var(--cream);
}

/* ---------- layout ---------- */
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  margin-top: 1.4rem;
}

@media (max-width: 860px) {
  .live {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- live card ---------- */
.card {
  position: relative;
  padding: 1.4rem 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(47, 191, 113, 0.1), transparent 45%),
    linear-gradient(180deg, var(--panel), var(--stout-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card--live::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--orange));
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 191, 113, 0.45);
  background: rgba(47, 191, 113, 0.14);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(47, 191, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 191, 113, 0);
  }
}

.card__stopcount {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.card__eyebrow {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.card__title {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 6.4vw, 2.7rem);
  line-height: 1.1;
  color: var(--cream);
}

.card__emoji {
  font-family: var(--font-body);
  font-size: 0.62em;
  white-space: nowrap;
}

.card__window {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--green);
}

.card__note {
  margin: 0.35rem 0 0;
  font-size: 0.94rem;
  color: var(--cream-dim);
  font-style: italic;
}

.card__note:empty {
  display: none;
}

/* ---------- venues ---------- */
.venues {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0.2rem;
}

.venue {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
}

.venue__name {
  font-weight: 800;
}

.venue__addr {
  font-size: 0.88rem;
  color: var(--cream-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green), var(--green-deep));
  color: #07140c;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* ---------- countdown ---------- */
.countdown {
  margin-top: 1.15rem;
  padding: 0.9rem 1rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(120% 130% at 50% 0%, rgba(232, 181, 60, 0.12), transparent 60%),
    rgba(0, 0, 0, 0.35);
  text-align: center;
}

.countdown__label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.countdown__clock {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.25rem;
  margin: 0.3rem 0 0.15rem;
}

.countdown__clock .unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.2ch;
}

.countdown__clock b {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.1rem, 9vw, 3.1rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}

.countdown__clock small {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.countdown__clock .sep {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1.05;
  color: var(--green);
}

.countdown__target {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: var(--cream-dim);
}

/* open-end / finished states hide the clock */
.card--live[data-phase="openend"] .countdown__clock .sep,
.card--live[data-phase="openend"] .countdown__clock,
.card--live[data-phase="done"] .countdown__clock {
  display: none;
}

.card--live[data-phase="done"] .badge,
.card--live[data-phase="openend"] .badge {
  border-color: var(--line);
  background: rgba(232, 181, 60, 0.14);
  color: var(--gold);
}

.card--live[data-phase="done"] .pulse,
.card--live[data-phase="pre"] .pulse {
  animation: none;
  background: var(--gold);
}

.card--live[data-phase="done"] .pulse {
  background: var(--muted);
}

/* ---------- progress ---------- */
.progress {
  margin-top: 1.1rem;
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--green));
  transition: width 0.8s ease;
}

.progress__text {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ---------- map ---------- */
.map-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#map {
  flex: 1 1 auto;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 0;
}

.map-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.leaflet-container {
  border-radius: var(--radius);
  font-family: var(--font-body);
  background: #0d1410;
}

/* Dark "stout" basemap: invert the keyless OSM raster tiles and cool them
   down. Filter is scoped to the tile pane so pins/popups stay true colour. */
.leaflet-tile-pane {
  filter: invert(1) hue-rotate(185deg) brightness(0.92) contrast(0.92) saturate(0.55)
    sepia(0.12);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--panel-2);
  color: var(--cream);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 0.7rem 0.85rem;
  font-size: 0.9rem;
}

.leaflet-popup-content strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold-soft);
}

.leaflet-popup-content a {
  color: var(--green);
  font-weight: 700;
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--muted);
}

.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.6) !important;
  color: var(--muted) !important;
}

.leaflet-control-attribution a {
  color: var(--cream-dim) !important;
}

.leaflet-bar a {
  background: var(--panel-2);
  color: var(--cream);
  border-bottom-color: var(--line);
}

.leaflet-bar a:hover {
  background: var(--panel);
  color: var(--gold);
}

/* map pins */
.pin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
  border: 2px solid rgba(0, 0, 0, 0.55);
  background: var(--panel-2);
  color: var(--cream-dim);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  font-weight: 800;
  font-size: 0.85rem;
}

.pin span {
  transform: rotate(45deg);
}

.pin--past {
  background: #2a3a2e;
  color: var(--muted);
  opacity: 0.85;
}

.pin--next {
  background: linear-gradient(180deg, var(--gold), #b8841f);
  color: #1a1206;
}

.pin--current {
  background: linear-gradient(180deg, var(--green), var(--green-deep));
  color: #07140c;
  animation: pinPulse 1.9s ease-in-out infinite;
}

@keyframes pinPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.55);
  }
  60% {
    box-shadow: 0 0 0 14px rgba(47, 191, 113, 0);
  }
}

/* ---------- divider ---------- */
.divider {
  display: flex;
  justify-content: center;
  color: var(--gold);
  opacity: 0.6;
  margin: 2.4rem 0 1.4rem;
}

.divider svg {
  width: 220px;
  height: 66px;
}

/* ---------- itinerary ---------- */
.itinerary h2 {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  color: var(--cream);
}

.itinerary__sub {
  margin: 0.3rem 0 1.4rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.stop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(29, 47, 34, 0.7), rgba(11, 18, 13, 0.75));
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stop:hover {
  transform: translateY(-1px);
  border-color: var(--line);
}

.stop__n {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
}

.stop__body {
  min-width: 0;
}

.stop__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  color: var(--cream);
}

.stop__meta {
  margin: 0.1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cream-dim);
}

.stop__addr {
  margin: 0.15rem 0 0;
  font-size: 0.83rem;
  color: var(--muted);
}

.stop__note {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--gold-soft);
  opacity: 0.8;
}

.stop__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  text-align: right;
}

.stop__state {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--gold);
  white-space: nowrap;
}

.stop__eta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.stop__dirs {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
}

.stop__dirs:hover {
  text-decoration: underline;
}

.stop--current {
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(47, 191, 113, 0.18), rgba(11, 18, 13, 0.85));
  box-shadow: 0 0 0 1px rgba(47, 191, 113, 0.25), var(--shadow);
}

.stop--current .stop__n {
  background: linear-gradient(180deg, var(--green), var(--green-deep));
  color: #07140c;
  border-color: transparent;
}

.stop--current .stop__state {
  border-color: var(--green);
  background: rgba(47, 191, 113, 0.18);
  color: var(--green);
}

.stop--next .stop__state {
  border-color: var(--gold);
  background: rgba(232, 181, 60, 0.14);
}

.stop--past {
  opacity: 0.58;
}

.stop--past .stop__state {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 560px) {
  .stop {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .stop__side {
    grid-column: 1 / -1;
    flex-flow: row wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem 0.8rem;
    width: 100%;
    text-align: left;
  }

  .stop__eta {
    margin-right: auto;
  }
}

/* ---------- footer ---------- */
.footer {
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer__claddagh {
  width: 46px;
  height: 46px;
  color: var(--gold);
  opacity: 0.85;
}

.footer__toast {
  margin: 0.4rem 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cream);
}

.footer__small {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.footer__clock {
  margin-top: 0.6rem;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
