/* Tournament Journey - World Cup 2026 Interactive Storybook */
/* BKL-721 */

.tj-page {
  padding-bottom: 20px;
}

/* ---- Hero ---- */
.tj-hero {
  margin: 32px 0 24px;
  padding: 34px;
  border: 1px solid rgba(0, 229, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(7, 19, 35, 0.94), rgba(5, 8, 16, 0.98)),
    rgba(7, 12, 24, 0.96);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.38),
    0 0 28px rgba(0, 229, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tj-back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: #35f283;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}
.tj-back-link:hover {
  color: #7fffb1;
  text-decoration: underline;
}

.tj-eyebrow {
  margin: 0 0 10px;
  color: #ffd166;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tj-hero h1 {
  margin: 0;
  color: #f7fbff;
  font-size: clamp(2.1rem, 7vw, 4.8rem);
  line-height: 0.98;
  text-shadow:
    0 0 22px rgba(0, 229, 255, 0.34),
    0 0 34px rgba(255, 45, 214, 0.16);
}

.tj-hero-lede {
  max-width: 840px;
  margin: 18px 0 0;
  color: #c4d7e4;
  font-size: 1.08rem;
  line-height: 1.65;
}

.tj-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 0;
}
.tj-stats div {
  min-height: 92px;
  padding: 18px;
  border: 1px solid rgba(53, 242, 131, 0.22);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.66);
}
.tj-stats dt {
  color: #35f283;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.tj-stats dd {
  margin: 8px 0 0;
  color: #b9cfdd;
  font-weight: 700;
}

/* ---- Navigation bar ---- */
.tj-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 24px 0;
  padding: 16px 20px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.66);
}

.tj-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid rgba(0, 229, 255, 0.36);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(255, 45, 214, 0.06));
  color: #eaf7ff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tj-nav-btn:hover:not(:disabled),
.tj-nav-btn:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 45, 214, 0.62);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 229, 255, 0.2);
}
.tj-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.tj-nav-btn--start {
  border-left: 4px solid #ffd166;
}
.tj-nav-arrow {
  font-size: 1.3em;
  line-height: 1;
}

.tj-match-counter {
  text-align: center;
  min-width: 200px;
}
.tj-counter-text {
  display: block;
  color: #f7fbff;
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}
.tj-counter-stage {
  display: block;
  margin-top: 4px;
  color: #ffd166;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---- Split-screen layout ---- */
.tj-split {
  display: flex;
  gap: 20px;
  margin: 0 0 24px;
  /* flex-start (not stretch) so the SCC panel keeps its NATURAL height.
     The JS measures that height to cap the bracket panel; with `stretch`
     the SCC panel would be stretched to the tall bracket, making the cap
     a no-op and letting the bracket overflow the page. */
  align-items: flex-start;
}

.tj-panel {
  flex: 1 1 50%;
  min-width: 0;
}

.tj-panel--scc {
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.66);
  overflow: hidden;
}

.tj-panel--data {
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.66);
  /* max-height is set in JS to match the SCC panel height. */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tj-scc-content,
.tj-data-content {
  padding: 20px;
}

.tj-data-content {
  /* Single dual-axis scroll container for the bracket: capped to the SCC
     panel height in JS, it scrolls BOTH vertically and horizontally. Both
     scrollbars therefore pin to this box's visible edges (right + bottom)
     and stay visible together, instead of the horizontal bar living on an
     inner wrapper below the vertical fold. */
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  /* Keep both scrollbars as clear, on-brand affordances. */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.5) rgba(4, 8, 16, 0.4);
}
.tj-data-content::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.tj-data-content::-webkit-scrollbar-track {
  background: rgba(4, 8, 16, 0.4);
  border-radius: 6px;
}
.tj-data-content::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.45);
  border-radius: 6px;
}
.tj-data-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.7);
}
.tj-data-content::-webkit-scrollbar-corner {
  background: rgba(4, 8, 16, 0.4);
}

.tj-loading {
  text-align: center;
  padding: 60px 20px;
  color: #b9cfdd;
  font-size: 1.1rem;
}

/* ---- SCC image panel ---- */
.tj-scc-image-wrap {
  text-align: center;
}
.tj-scc-image-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.tj-scc-meta {
  margin-top: 16px;
}
.tj-scc-teams {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f7fbff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}
.tj-scc-score {
  display: inline-block;
  margin: 4px 0 0 4px;
  padding: 2px 10px;
  border-radius: 4px;
  background: rgba(53, 242, 131, 0.15);
  color: #35f283;
  font-size: 1.1rem;
}
.tj-scc-caption {
  margin: 12px 0 0;
  color: #c4d7e4;
  font-size: 0.95rem;
  line-height: 1.55;
}
.tj-scc-date-loc {
  margin: 8px 0 0;
  color: #8aa4b4;
  font-size: 0.85rem;
}

/* ---- Upcoming match card ---- */
.tj-upcoming-card {
  text-align: center;
  padding: 48px 20px;
}
.tj-upcoming-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.tj-upcoming-label {
  color: #ffd166;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.tj-upcoming-teams {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f7fbff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}
.tj-upcoming-note {
  margin: 12px 0 0;
  color: #b9cfdd;
  font-size: 0.95rem;
}

/* ---- Match 0 (pre-tournament) card ---- */
.tj-match0-card {
  text-align: center;
  padding: 48px 20px;
}
.tj-match0-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.tj-match0-label {
  color: #00e5ff;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.tj-match0-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f7fbff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}
.tj-match0-desc {
  margin: 12px 0 0;
  color: #c4d7e4;
  font-size: 1rem;
  line-height: 1.55;
}
.tj-start-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 32px;
  border: 2px solid #ffd166;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(255, 209, 102, 0.08));
  color: #ffd166;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tj-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 209, 102, 0.3);
}

/* ---- Group standings table ---- */
.tj-data-heading {
  margin: 0 0 16px;
  color: #f7fbff;
  font-size: 1.3rem;
  font-weight: 800;
}

.tj-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.tj-group-tab {
  padding: 6px 14px;
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.6);
  color: #b9cfdd;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.tj-group-tab:hover {
  border-color: rgba(0, 229, 255, 0.5);
  color: #eaf7ff;
}
.tj-group-tab--active {
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  color: #ffd166;
}

.tj-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.tj-standings-table th {
  padding: 10px 6px;
  border-bottom: 2px solid rgba(0, 229, 255, 0.22);
  color: #8aa4b4;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}
.tj-standings-table th:nth-child(2) {
  text-align: left;
}
.tj-standings-table td {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.08);
  text-align: center;
  color: #eaf7ff;
}
.tj-standings-table td:nth-child(2) {
  text-align: left;
  font-weight: 700;
}
.tj-standings-table tr.tj-standings-row--highlight td {
  background: rgba(255, 209, 102, 0.08);
}
.tj-standings-table td.tj-pts {
  font-weight: 900;
  color: #35f283;
}
.tj-standings-table td.tj-gd {
  color: #c4d7e4;
}

/* ---- Knockout bracket ---- */
.tj-bracket-wrap {
  /* No longer its own scroll context — the parent .tj-data-content owns
     both scroll axes so the horizontal bar stays pinned to the visible
     bottom edge rather than below the vertical fold. The bracket's
     min-width: max-content pushes .tj-data-content to overflow-x. */
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}
.tj-bracket {
  display: flex;
  gap: 30px;
  min-width: max-content;
  padding-bottom: 10px;
  align-items: flex-start;
}
.tj-bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  min-width: 180px;
  align-self: flex-start;
}
.tj-bracket-round-title {
  margin: 0 0 8px;
  color: #ffd166;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
}
.tj-bracket-match {
  padding: 10px 12px;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.5);
  font-size: 0.82rem;
}
.tj-bracket-match--highlight {
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.08);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.12);
}
.tj-bracket-match--next {
  border-color: rgba(0, 229, 255, 0.5);
  background: rgba(0, 229, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
}
.tj-bracket-match--complete {
  opacity: 0.85;
}
.tj-bracket-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}
.tj-bracket-team--winner {
  color: #35f283;
  font-weight: 700;
}
.tj-bracket-team--loser {
  color: #8aa4b4;
}
.tj-bracket-team-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tj-bracket-team-score {
  margin-left: 8px;
  font-weight: 700;
}
.tj-bracket-match--tbd .tj-bracket-team {
  color: #5a7080;
  font-style: italic;
}
.tj-bracket-mn {
  margin-top: 6px;
  color: #5a7080;
  font-size: 0.72rem;
  text-align: center;
}

/* ---- Group selector ---- */
.tj-group-selector {
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.5);
}
.tj-group-selector-label {
  margin: 0 0 10px;
  color: #8aa4b4;
  font-size: 0.85rem;
  font-weight: 700;
}
.tj-group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tj-group-btn {
  padding: 6px 16px;
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.6);
  color: #eaf7ff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tj-group-btn:hover {
  border-color: rgba(255, 45, 214, 0.5);
  background: rgba(255, 45, 214, 0.08);
}

/* ---- Timeline scrubber ---- */
.tj-timeline-scrubber {
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.5);
}
.tj-scrubber-track {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.tj-scrubber-dot {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 4px;
  background: rgba(4, 8, 16, 0.6);
  cursor: pointer;
  font-size: 0.6rem;
  font-weight: 700;
  color: #5a7080;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.tj-scrubber-dot:hover {
  border-color: rgba(0, 229, 255, 0.5);
  color: #eaf7ff;
}
.tj-scrubber-dot--active {
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.2);
  color: #ffd166;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.3);
}
.tj-scrubber-dot--group {
  border-bottom: 2px solid rgba(53, 242, 131, 0.3);
}
.tj-scrubber-dot--r32 {
  border-bottom: 2px solid rgba(0, 229, 255, 0.3);
}
.tj-scrubber-dot--r16 {
  border-bottom: 2px solid rgba(255, 45, 214, 0.3);
}

/* ---- About section ---- */
.tj-about {
  margin: 24px 0 0;
  padding: 24px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.5);
}
.tj-about h2 {
  margin: 0 0 16px;
  color: #f7fbff;
  font-size: 1.3rem;
}
.tj-about p {
  margin: 0 0 10px;
  color: #c4d7e4;
  font-size: 0.95rem;
  line-height: 1.65;
}
/* ---- Responsive: stacked on mobile ---- */
@media (max-width: 768px) {
  .tj-split {
    flex-direction: column;
    /* In a COLUMN flex container align-items controls the horizontal axis.
       The base rule's `flex-start` would shrink-wrap each panel to its
       content width, letting the wide bracket (min-width: max-content) blow
       past the screen edge with no internal scroll. `stretch` makes the
       stacked panels fill the phone width so `.tj-data-content`'s
       overflow:auto engages and the bracket scrolls within the panel. */
    align-items: stretch;
  }
  .tj-panel {
    flex: 1 1 100%;
  }
  .tj-nav-bar {
    gap: 10px;
  }
  .tj-nav-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  .tj-match-counter {
    min-width: 140px;
  }
  .tj-counter-text {
    font-size: 1rem;
  }
  .tj-stats {
    grid-template-columns: 1fr;
  }
  .tj-hero {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .tj-nav-btn-label {
    display: none;
  }
  .tj-nav-arrow {
    font-size: 1.6em;
  }
  .tj-scc-teams {
    font-size: 1.1rem;
  }
  .tj-bracket-round {
    min-width: 140px;
  }
}