/* ============================================================
   World Cup 2026 bracket ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â NETC Travel & Tourism branding.
   Palette + type pulled from the NETC master stylesheet:
   teal accent on deep teal-dark surfaces, Cormorant Garamond
   headings + Montserrat body.
   ============================================================ */

@import url('../fonts/fonts.css');

:root {
  color-scheme: dark;

  /* NETC brand tokens */
  --teal:          #2BBCD4;
  --teal-light:    #5DD3E8;
  --teal-dark:     #1A8FA3;
  --teal-deeper:   #0D6B7A;

  --bg-deep:       #07222a;
  --bg-panel:      #0C2B33;
  --bg-card:       #0F3540;
  --bg-card-soft:  #103a46;
  --surface:       #1A4A55;

  --text:          #D8F0F5;
  --text-dim:      #7AAEBB;

  --line:          rgba(43, 188, 212, 0.5);
  --border-tbd:    rgba(122, 174, 187, 0.22);

  --win:           #2BBCD4;          /* confirmed/predicted accent */
  --win-glow:      rgba(43, 188, 212, 0.30);
  --live:          #FF6B5B;          /* warm contrast so LIVE pops on teal */

  --font-serif:    'Cormorant Garamond', Georgia, serif;
  --font-sans:     'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* animation timing */
  --stagger-step:  70ms;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at top, #103a46 0%, var(--bg-deep) 62%);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  min-height: 100vh;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px 32px 8px;
  flex-wrap: wrap;
  gap: 12px;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--teal);
  font-weight: 500;
  text-transform: uppercase;
}

h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 46px;
  margin: 4px 0 0;
  letter-spacing: 0.005em;
  color: #fff;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-light);
  background: transparent;
  border: 1px solid rgba(43, 188, 212, 0.5);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.action-btn:hover {
  background: rgba(43, 188, 212, 0.12);
  border-color: var(--teal);
  color: #fff;
}


.action-btn:disabled {
  cursor: wait;
  opacity: 0.62;
}
.updated-pill {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border-tbd);
  border-radius: 999px;
  padding: 6px 14px;
  letter-spacing: 0.04em;
}

.legend {
  display: flex;
  gap: 22px;
  padding: 4px 32px 22px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: 0 0 auto; }
.swatch.tbd { background: rgba(122, 174, 187, 0.55); }
.swatch.live { background: var(--live); }
.swatch.finished { background: var(--win); }
.swatch.predicted { background: transparent; border: 2px dashed var(--teal-light); }

.bracket-scroll {
  overflow-x: auto;
  padding: 10px 16px 60px;
}

.bracket-wrap {
  position: relative;
  min-width: 1500px;
}

#connector-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.connector-path {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

.connector-path.dashed {
  stroke-dasharray: 7 6;
  opacity: 0.72;
}

.bracket-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr) 230px repeat(4, 1fr);
  gap: 0 10px;
}

.col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  position: relative;
  min-height: 1040px;
  padding-top: 36px;
}

.col-label {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 500;
  text-align: center;
  padding-bottom: 12px;
}

.center-col {
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.trophy {
  text-align: center;
  filter: drop-shadow(0 0 18px var(--win-glow));
  margin-bottom: 6px;
}
.trophy img {
  display: inline-block;
  height: 132px;
  width: auto;
}

.match-card {
  background: linear-gradient(180deg, var(--bg-card-soft), var(--bg-card));
  border: 1px solid var(--border-tbd);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0;
  min-width: 210px;
  position: relative;
  transition: border-color .2s, opacity .2s, box-shadow .2s;
}

.match-card .round-tag {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-badge {
  background: var(--live);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  animation: badgeBlink 1.4s infinite;
}
.predicted-badge {
  border: 1px dashed var(--teal-light);
  color: var(--teal-light);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

@keyframes badgeBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 400;
  cursor: default;
}

.team-row .tname {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flag {
  flex: 0 0 auto;
  width: 22px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  vertical-align: middle;
}
.flag-emoji {
  width: auto;
  height: auto;
  font-size: 16px;
  line-height: 1;
  box-shadow: none;
}

.score { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--teal-light); }
.pens { font-size: 12px; color: var(--text-dim); margin-left: 4px; }

.team-row.tbd-placeholder {
  color: var(--text-dim);
  font-style: italic;
  font-size: 13px;
  font-family: var(--font-serif);
  justify-content: center;
  text-align: center;
}

.team-row.clickable {
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.team-row.clickable:hover {
  background: rgba(43, 188, 212, 0.12);
}

/* quick highlight/scale pulse the instant a row is clicked to predict */
.team-row.picked {
  animation: pickPulse .32s ease-out;
}
@keyframes pickPulse {
  0%   { transform: scale(1);    background: rgba(43, 188, 212, 0.12); }
  45%  { transform: scale(1.06); background: rgba(93, 211, 232, 0.40); }
  100% { transform: scale(1);    background: rgba(43, 188, 212, 0.12); }
}

.team-row.winner-confirmed {
  background: rgba(43, 188, 212, 0.16);
  font-weight: 600;
}
.team-row.winner-predicted {
  background: rgba(43, 188, 212, 0.10);
  font-weight: 600;
  border: 1px dashed var(--teal-light);
}

/* card status states */
.match-card.status-tbd,
.match-card.status-pending { opacity: 0.6; }
.match-card.status-live {
  border-color: var(--live);
  animation: liveGlow 1.8s ease-in-out infinite;
}
.match-card.status-finished { border-color: var(--win); }
.match-card.status-predicted-only { border: 1px dashed var(--teal-light); opacity: 0.85; }

/* subtle pulsing glow on any live card */
@keyframes liveGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 107, 91, 0.25), 0 0 0 rgba(255, 107, 91, 0); }
  50%      { box-shadow: 0 0 0 1px rgba(255, 107, 91, 0.45), 0 0 16px rgba(255, 107, 91, 0.45); }
}

.kickoff {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(43, 188, 212, 0.12);
  text-align: center;
  line-height: 1.4;
}
.kickoff-tz {
  font-size: 11px;
  color: var(--teal-dark);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.final-card, .third-card {
  min-width: 220px;
  padding: 14px 16px;
}
.final-card {
  border-color: var(--teal);
  box-shadow: 0 0 24px var(--win-glow);
}
.final-card .round-tag, .third-card .round-tag { font-size: 13px; }

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ ANIMATIONS ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */

/* Staggered fade-up of every card on first page load. The column's
   --col index (set in JS) offsets the delay so columns cascade in. */
.bracket-grid.first-load .match-card {
  opacity: 0;
  animation: fadeUp .5s ease-out forwards;
  animation-delay: calc(var(--col, 0) * var(--stagger-step));
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* A team newly advancing into a slot slides/fades into place. Direction
   follows the side so it reads as coming from the feeder cards. */
.match-card.promoted.side-left  { animation: promoteFromLeft  .52s ease-out; }
.match-card.promoted.side-right { animation: promoteFromRight .52s ease-out; }
.match-card.promoted.side-center { animation: promoteFromBelow .52s ease-out; }
@keyframes promoteFromLeft {
  0%   { opacity: .2; transform: translateX(-22px); }
  100% { opacity: 1;  transform: translateX(0); }
}
@keyframes promoteFromRight {
  0%   { opacity: .2; transform: translateX(22px); }
  100% { opacity: 1;  transform: translateX(0); }
}
@keyframes promoteFromBelow {
  0%   { opacity: .2; transform: translateY(16px); }
  100% { opacity: 1;  transform: translateY(0); }
}

/* Respect reduced-motion: no fade-up, no promotion slide, no pulses/glow ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â
   everything renders in its final state instantly. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .bracket-grid.first-load .match-card { opacity: 1; }
}

@media (max-width: 900px) {
  h1 { font-size: 32px; }
  .page-head { padding: 18px 16px 4px; }
  .legend { padding: 0 16px 14px; }
}

/* Export mode: make the downloaded PNG read clearly instead of inheriting
   the on-screen dim/pending/predicted opacity and animations. */
body.exporting-bracket .bracket-scroll {
  overflow: visible;
}
body.exporting-bracket .match-card,
body.exporting-bracket .match-card.status-tbd,
body.exporting-bracket .match-card.status-pending,
body.exporting-bracket .match-card.status-predicted-only,
body.exporting-bracket .team-row,
body.exporting-bracket .kickoff,
body.exporting-bracket .round-tag,
body.exporting-bracket .tbd-placeholder {
  opacity: 1 !important;
}
body.exporting-bracket .match-card,
body.exporting-bracket .team-row,
body.exporting-bracket .live-badge,
body.exporting-bracket .predicted-badge {
  animation: none !important;
  transition: none !important;
}