:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e7ecf1;
  --muted: #8b9aab;
  --accent: #3d9a6e;
  --accent-hover: #4db87e;
  --danger: #e07a7a;
  --font: 'Manrope', system-ui, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: radial-gradient(ellipse at 50% 0%, #1a2834 0%, var(--bg) 55%);
  color: var(--text);
}

body {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

body.tour-embed {
  padding: 0;
  place-items: stretch;
  background: #000;
}

.tour-landing {
  width: min(540px, 100%);
  padding: 2rem 1.75rem;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.tour-landing[hidden] {
  display: none !important;
}

.tour-landing__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.tour-landing__hint {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.tour-landing__hint code,
.tour-landing__footnote code {
  font-size: 0.95em;
  color: #a3b0be;
}

.tour-landing__field {
  display: grid;
  gap: 0.35rem;
  text-align: left;
  margin-bottom: 1rem;
}

.tour-landing__label {
  font-size: 0.75rem;
  color: var(--muted);
}

.tour-landing__input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #2c3948;
  border-radius: 10px;
  background: #12181f;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.tour-landing__input:focus {
  outline: 2px solid rgba(61, 154, 110, 0.45);
  outline-offset: 1px;
}

.tour-landing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.tour-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.tour-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.tour-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.tour-btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid #3a4a5c;
}

.tour-btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.tour-landing__error {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--danger);
  text-align: left;
}

.tour-landing__error[hidden] {
  display: none !important;
}

.tour-landing__footnote {
  margin: 1rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #5f6d7c;
  text-align: left;
}

.tour-landing__demo {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.tour-landing__demo a {
  color: var(--accent-hover);
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
}

.tour-overlay:fullscreen,
.tour-overlay:-webkit-full-screen {
  width: 100%;
  height: 100%;
  background: #000;
}

.tour-overlay[hidden] {
  display: none !important;
}

.tour-overlay__stage {
  position: absolute;
  inset: 0;
}

.tour-overlay__stage[hidden] {
  display: none !important;
}

.tour-overlay__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* Same markup/classes as PEFL 2.5 fixture-round tour summary */
.fixture-round-tour-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem 1rem calc(3.6rem + env(safe-area-inset-bottom, 0px));
  overflow: auto;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(48, 88, 132, 0.28), transparent 62%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(20, 36, 58, 0.35), transparent 58%),
    linear-gradient(180deg, rgba(6, 10, 16, 0.98), rgba(8, 12, 18, 1));
  color: #e7ecf1;
  font-family: var(--font);
}
.fixture-round-tour-summary__card {
  width: min(52rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.35rem 1.25rem 1.15rem;
  border: 1px solid rgba(120, 156, 196, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%),
    linear-gradient(165deg, rgba(14, 22, 32, 0.96), rgba(8, 12, 18, 0.98));
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.fixture-round-tour-summary__report {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.fixture-round-tour-summary__scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.fixture-round-tour-summary__band {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 7.5rem;
}
.fixture-round-tour-summary__band--home {
  background: linear-gradient(180deg, rgba(92, 156, 214, 0.92), rgba(58, 112, 168, 0.96));
  color: #0a1420;
}
.fixture-round-tour-summary__band--away {
  background: linear-gradient(180deg, rgba(214, 92, 92, 0.92), rgba(168, 52, 52, 0.96));
  color: #1a0808;
}
.fixture-round-tour-summary__band-name {
  padding: 0.7rem 0.85rem 0.45rem;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.1vw, 1.12rem);
  line-height: 1.2;
  text-align: center;
}
.fixture-round-tour-summary__band-goals {
  flex: 1;
  margin-top: auto;
  padding: 0.55rem 0.75rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.fixture-round-tour-summary__goals-title { margin-bottom: 0.25rem; font-weight: 600; }
.fixture-round-tour-summary__goals-list {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.fixture-round-tour-summary__band--home .fixture-round-tour-summary__band-goals { text-align: left; }
.fixture-round-tour-summary__band--away .fixture-round-tour-summary__band-goals { text-align: right; }
.fixture-round-tour-summary__score-center {
  display: flex; align-items: center; justify-content: center; gap: 0.2rem;
  min-width: 5.5rem; padding: 0 0.65rem;
  background: linear-gradient(180deg, #f4f7fb, #d8e2ee);
  color: #b01818;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}
.fixture-round-tour-summary__score-home,
.fixture-round-tour-summary__score-away {
  font-size: clamp(2rem, 4.8vw, 2.65rem);
  font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fixture-round-tour-summary__score-sep {
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  font-weight: 700; opacity: 0.75;
}
.fixture-round-tour-summary__stat-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  background: #d4efc4;
  border: 1px solid #b8dfa8;
}
.fixture-round-tour-summary__stat-row + .fixture-round-tour-summary__stat-row {
  border-top: 1px solid rgba(120, 168, 96, 0.28);
}
.fixture-round-tour-summary__stat-val,
.fixture-round-tour-summary__stat-label {
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  line-height: 1.3;
  vertical-align: middle;
  background: #d4efc4;
  color: #2a4a22;
}
.fixture-round-tour-summary__stat-val {
  width: 28%;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.fixture-round-tour-summary__stat-label {
  width: 44%;
  text-align: center;
  font-weight: 600;
  color: #315a28;
}
.fixture-round-tour-summary__actions {
  display: flex;
  justify-content: center;
  margin-top: 0.15rem;
  padding-top: 0.35rem;
}
@media (max-width: 640px) {
  .fixture-round-tour-summary__scoreboard { grid-template-columns: 1fr; }
  .fixture-round-tour-summary__score-center {
    order: -1; min-height: 3.5rem;
    border-left: none; border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }
  .fixture-round-tour-summary__band-goals { text-align: left !important; }
}

.tour-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  background: rgba(8, 12, 18, 0.52);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tour-rail[hidden] {
  display: none !important;
}

.tour-rail__scroller {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0.4rem 0.45rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
}

.tour-rail__scroller::-webkit-scrollbar {
  display: none;
}

.tour-rail--fade-left .tour-rail__scroller {
  mask-image: linear-gradient(90deg, transparent, #000 1.15rem);
}

.tour-rail--fade-right .tour-rail__scroller {
  mask-image: linear-gradient(90deg, #000 calc(100% - 1.15rem), transparent);
}

.tour-rail--fade-left.tour-rail--fade-right .tour-rail__scroller {
  mask-image: linear-gradient(90deg, transparent, #000 1.15rem, #000 calc(100% - 1.15rem), transparent);
}

.tour-rail__match {
  flex: 1 1 11.25rem;
  min-width: 11.25rem;
  scroll-snap-align: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.45rem minmax(0, 1fr);
  align-items: stretch;
  gap: 0.12rem;
  margin: 0;
  padding: 0.18rem 0.22rem;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(231, 236, 241, 0.88);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.tour-rail__match:hover .tour-rail__plate,
.tour-rail__match:hover .tour-rail__score {
  opacity: 0.55;
}

.tour-rail__match:focus-visible {
  outline: 2px solid rgba(61, 154, 110, 0.7);
  outline-offset: 1px;
}

.tour-rail__name,
.tour-rail__away,
.tour-rail__plate {
  display: block;
  width: 100%;
  min-width: 0;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.45rem;
  text-align: center;
  font-weight: 700;
}

.tour-rail__score {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(231, 236, 241, 0.34);
  opacity: 0.34;
}

.tour-rail__plate {
  border: 1px solid rgba(0, 0, 0, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(231, 236, 241, 0.9);
  opacity: 0.34;
}

.tour-rail__plate:not(.tour-rail__plate--plain) {
  color: var(--kit-ink, #f7fafc);
  background: var(--kit, transparent);
  border-color: rgba(0, 0, 0, 0.35);
}

.tour-rail__pip {
  display: block;
  width: 0.38rem;
  height: 0.38rem;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 154, 110, 0.28);
}

.tour-rail__match--done .tour-rail__score {
  color: #f3d48a;
}

.tour-rail__match--pending {
  color: rgba(231, 236, 241, 0.46);
}

.tour-rail__match--current .tour-rail__plate,
.tour-rail__match--current .tour-rail__score,
.tour-rail__match--current:hover .tour-rail__plate,
.tour-rail__match--current:hover .tour-rail__score {
  opacity: 0.78;
}

.tour-rail__match--current {
  color: #fff;
}

@media (max-width: 720px) {
  .tour-rail__scroller {
    padding: 0.28rem 0.3rem calc(0.28rem + env(safe-area-inset-bottom, 0px));
    gap: 4px;
  }

  .tour-rail__match {
    flex-basis: 7.35rem;
    min-width: 7.35rem;
    gap: 0.1rem;
    padding: 0.16rem 0.18rem;
    font-size: 0.64rem;
    border-radius: 7px;
  }
}