/* Road To Final Engine v1.0 */
.bracket-page-full .road-page {
  padding: 14px;
  overflow: hidden;
  background: rgba(6, 17, 30, .88);
}

.road-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 10px;
}

.road-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(255,255,255,.25));
}

.road-header h2 {
  margin: 0;
  font-size: 24px;
  color: #ffd36a;
}

.road-header p {
  margin: 4px 0 0;
  color: rgba(255,255,255,.75);
  font-size: 12px;
}

.road-hint {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.78);
  margin-bottom: 12px;
}

.road-board {
  position: relative;
  width: 100%;
  height: min(78vh, 790px);
  min-height: 520px;
  overflow: auto;
  border-radius: 26px;
  direction: ltr;
  background: #0a2b17;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 0 80px rgba(0,0,0,.35), 0 20px 40px rgba(0,0,0,.28);
  -webkit-overflow-scrolling: touch;
}

.road-tools {
  position: sticky;
  top: 10px;
  left: 10px;
  z-index: 30;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  margin: 10px;
  border-radius: 999px;
  background: rgba(0, 18, 32, .82);
  border: 1px solid rgba(255,211,106,.45);
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}

.road-tools button,
.road-tools span {
  height: 30px;
  min-width: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Cairo, sans-serif;
  font-size: 13px;
  font-weight: 900;
}

.road-tools button {
  cursor: pointer;
  color: #07101d;
  background: linear-gradient(135deg, #f5d37b, #d7a94b);
}

.road-tools .fit-btn {
  min-width: 74px;
}

.road-tools span {
  color: #fff;
  background: rgba(255,255,255,.10);
}

.road-zoom-stage {
  position: relative;
  margin: 0 auto 26px;
  transition: width .18s ease, height .18s ease;
}

.road-canvas {
  position: absolute;
  inset: 0 auto auto 50%;
  width: 1320px;
  min-height: 920px;
  padding: 92px 28px 34px;
  direction: ltr;
  transform: translateX(-50%) scale(var(--road-scale, .48));
  transform-origin: top center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px minmax(0, 1fr);
  gap: 18px;
  background:
    linear-gradient(rgba(4,23,15,.18), rgba(4,23,15,.26)),
    url("assets/bracket-bg.png") center/cover no-repeat;
  border-radius: 24px;
}

.road-canvas::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 18px;
  pointer-events: none;
  box-shadow: inset 0 0 35px rgba(255,255,255,.10);
}

.road-canvas::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 71px;
  bottom: 32px;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(transparent, rgba(255,211,106,.30), transparent);
  pointer-events: none;
}

.road-title-floating {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(0, 20, 34, .72);
  border: 1px solid rgba(255, 211, 106, .45);
  box-shadow: 0 0 28px rgba(255, 211, 106, .16);
}

.road-title-floating strong {
  display: block;
  font-size: 17px;
  letter-spacing: .4px;
  color: #fff;
}

.road-title-floating span {
  display: block;
  font-size: 20px;
  font-weight: 900;
  color: #ffd36a;
  line-height: 1.3;
}

.road-side {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(128px, 1fr));
  gap: 13px;
  align-items: stretch;
  direction: ltr;
}

.road-side-left {
  grid-column: 1;
}

.road-side-right {
  grid-column: 3;
}

.road-col {
  display: flex;
  flex-direction: column;
  min-width: 128px;
}

.road-col-title {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(0, 28, 48, .76);
  border: 1px solid rgba(255,211,106,.42);
  color: #ffd36a;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  direction: rtl;
}

.road-col-matches {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 8px;
}

.road-match,
.final-card {
  position: relative;
  min-height: 86px;
  padding: 7px;
  border-radius: 15px;
  background: rgba(0, 20, 34, .78);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
  direction: rtl;
}

.road-match::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 20px;
  height: 2px;
  background: rgba(255,211,106,.48);
  pointer-events: none;
}

.road-side-left .road-match::before {
  right: -18px;
}

.road-side-right .road-match::before {
  left: -18px;
}

.road-match-empty {
  opacity: .42;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
}

.road-match-empty::before {
  opacity: .35;
}

.empty-slot,
.final-wait {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.road-date {
  color: #fff;
  font-size: 9px;
  line-height: 1.2;
  margin-bottom: 4px;
  opacity: .85;
  text-align: center;
  direction: rtl;
}

.road-status {
  width: fit-content;
  margin: 0 auto 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.road-status.upcoming { background: rgba(255,183,3,.16); color: #ffca4b; }
.road-status.live { background: rgba(255,77,109,.18); color: #ff6b84; animation: roadPulse 1s infinite; }
.road-status.finished { background: rgba(56,211,159,.18); color: #38d39f; }

.road-team {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  opacity: .74;
  direction: ltr;
}

.road-team img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}

.road-team span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: right;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
}

.road-team b {
  text-align: center;
  color: #ffd36a;
  font-size: 12px;
}

.road-team.winner {
  opacity: 1;
  background: linear-gradient(135deg, rgba(56,211,159,.23), rgba(255,211,106,.10));
  border-color: rgba(56,211,159,.75);
  box-shadow: 0 0 14px rgba(56,211,159,.22);
}

.road-score,
.final-vs {
  text-align: center;
  margin: 4px 0;
  color: rgba(255,255,255,.75);
}

.road-score strong,
.final-vs strong {
  display: block;
  color: #ffd36a;
  font-size: 13px;
  line-height: 1.1;
}

.road-score small,
.final-vs small {
  display: block;
  font-size: 8px;
  line-height: 1.2;
}

.road-match.qualified {
  border-color: rgba(255,211,106,.48);
  box-shadow: 0 0 20px rgba(255,211,106,.18), 0 8px 18px rgba(0,0,0,.28);
}

.road-moving-line {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #38d39f, #ffd36a, transparent);
  box-shadow: 0 0 18px rgba(255,211,106,.9);
  animation: roadToCup 1.15s linear infinite;
  z-index: 8;
}

.road-flow-left .road-moving-line {
  right: -50px;
}

.road-flow-right .road-moving-line {
  left: -50px;
  animation-name: roadToCupReverse;
}

.road-flow-center .road-moving-line {
  left: 50%;
  transform: translateX(-50%);
  bottom: -12px;
  top: auto;
}

.road-center {
  grid-column: 2;
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 35px;
  direction: rtl;
}

.cup-zone {
  position: relative;
  width: 210px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.cup-img {
  position: relative;
  z-index: 2;
  max-width: 185px;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(255,211,106,.75));
}

.cup-fallback {
  display: none;
  position: relative;
  z-index: 2;
  font-size: 130px;
  filter: drop-shadow(0 0 28px rgba(255,211,106,.75));
}

.cup-glow {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,211,106,.32), transparent 68%);
  animation: cupGlow 2s ease-in-out infinite;
}

.cup-zone.champion-ready .cup-glow {
  background: radial-gradient(circle, rgba(56,211,159,.34), rgba(255,211,106,.22), transparent 70%);
}

.final-label {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 900;
  color: #ffd36a;
  text-shadow: 0 0 18px rgba(255,211,106,.35);
}

.final-card {
  width: 250px;
  min-height: 150px;
  border-color: rgba(255,211,106,.55);
  background: rgba(0, 20, 34, .84);
}

.final-card .road-team {
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  padding: 7px;
}

.final-card .road-team img {
  width: 30px;
  height: 30px;
}

.final-card .road-team span {
  font-size: 12px;
}

.final-vs {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
}

.champion-banner {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56,211,159,.22), rgba(255,211,106,.18));
  border: 1px solid rgba(56,211,159,.7);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.champion-banner img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.third-place-title {
  margin: 14px 0 7px;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 900;
}

.road-center .road-match {
  width: 230px;
}

.road-center .road-match::before {
  display: none;
}

.road-empty {
  padding: 18px;
  text-align: center;
  direction: rtl;
}

@keyframes roadToCup {
  from { transform: translateX(-18px); opacity: .25; }
  50% { opacity: 1; }
  to { transform: translateX(18px); opacity: .25; }
}

@keyframes roadToCupReverse {
  from { transform: translateX(18px); opacity: .25; }
  50% { opacity: 1; }
  to { transform: translateX(-18px); opacity: .25; }
}

@keyframes roadPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255,77,109,0); }
  50% { box-shadow: 0 0 16px rgba(255,77,109,.55); }
}

@keyframes cupGlow {
  0%, 100% { transform: scale(.92); opacity: .68; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 600px) {
  .bracket-page-full .road-page {
    padding: 10px;
  }

  .road-header h2 {
    font-size: 21px;
  }

  .road-board {
    height: 76vh;
    min-height: 500px;
  }
}



/* Road Engine v1.1 - Tree logic visual helpers */
.road-team.pending-team {
  opacity: .86;
  border-color: rgba(255, 211, 106, .28);
  background: rgba(255, 211, 106, .07);
}

.pending-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 211, 106, .14);
  border: 1px solid rgba(255, 211, 106, .35);
  color: #ffd36a;
  font-weight: 900;
}

.final-card .pending-logo {
  width: 30px;
  height: 30px;
}

/* Keep original app background visible */
.bracket-page-full .road-page {
  background: transparent !important;
  box-shadow: none !important;
}

.road-board {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

.road-canvas {
  background:
    linear-gradient(rgba(5,10,20,.10), rgba(5,10,20,.15)),
    url("assets/bg.png") center/cover no-repeat !important;
}
