:root {
  --bg: #0c0b0a;
  --bg-2: #131110;
  --edge: #4a453d;
  --flag-ring: #16140f;
  --text-dim: #8a8377;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: #e9e2d2;
  font-family: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* subtle vignette + warm core behind everything */
body {
  background:
    radial-gradient(circle at 50% 50%, rgba(244, 165, 60, 0.10) 0%, rgba(244, 165, 60, 0.03) 22%, rgba(0, 0, 0, 0) 46%),
    radial-gradient(circle at 50% 50%, var(--bg-2) 0%, var(--bg) 70%);
}

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.masthead {
  text-align: center;
  margin: 4px 0 18px;
  letter-spacing: 0.42em;
  text-transform: none;
}
.masthead #bracket-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0;
}

/* the bracket fills a centered square */
.bracket-wrap {
  width: min(94vmin, 960px);
  aspect-ratio: 1 / 1;
}
#bracket, .bracket-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- connectors ---- */
.edge {
  stroke: var(--edge);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.85;
}
.edge--lit {
  stroke-width: 3;
  opacity: 1;
  filter: drop-shadow(0 0 4px currentColor);
}

/* ---- nodes ---- */
.node {
  fill: #857e70;
  opacity: 0.95;
}
.node--lit {
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 0.5;
}

/* ---- teams ---- */
.flag-ring {
  fill: none;
  stroke: var(--flag-ring);
  stroke-width: 3;
}
.team {
  cursor: pointer;
}
.advance .flag-ring {
  display: none;
}
.flag-img { }
.badge-img { }

/* eliminated teams: desaturated + dimmed (both flag & crest) */
.team--out .flag-img,
.team--out .badge-img {
  filter: grayscale(1) brightness(0.72);
  opacity: 0.45;
}
.team--out .flag-ring {
  stroke: #0e0d0b;
  opacity: 0.5;
}

/* ---- centre trophy ---- */
.trophy {
  filter: drop-shadow(0 0 22px rgba(255, 190, 90, 0.55));
}

.credits {
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  opacity: 0.7;
  text-align: left;
}
.credits p {
  margin: 0 0 4px;
  color: #a69d8d;
  font-weight: 600;
}
.credits ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.credits li {
  display: grid;
  grid-template-columns: 92px auto;
  column-gap: 8px;
}
.credits span {
  color: #756e62;
}
.credits a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.credits a:hover {
  color: #c8bca7;
}

.team-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  padding: 6px 9px;
  border: 1px solid rgba(235, 222, 196, 0.18);
  border-radius: 4px;
  background: rgba(12, 11, 10, 0.9);
  color: #efe6d5;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.03em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}
.team-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}
