:root {
  --ink: #f7fbff;
  --muted: #a9b7c6;
  --panel: rgba(8, 16, 24, 0.78);
  --panel-strong: rgba(12, 28, 42, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --grass: #2bd071;
  --grass-deep: #0b6d43;
  --gold: #f5c84b;
  --red: #ff4e64;
  --blue: #3da9ff;
  --surface: #071019;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(5, 10, 17, 0.78), rgba(5, 10, 17, 0.96)),
    url("cup%20vang.jpg") center top / cover fixed,
    #071019;
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(3, 9, 15, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #081018;
  background: var(--gold);
  border-radius: 50%;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 1.35rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

nav a {
  padding: 9px 12px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
}

nav a:hover,
nav a:focus-visible {
  color: var(--ink);
  border-color: var(--line);
  outline: none;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(42px, 7vw, 88px) clamp(18px, 5vw, 72px) 36px;
}

.hero-copy {
  min-width: 0;
  max-width: 800px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--grass);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.98;
}

h1,
h2 {
  font-family: "Barlow Condensed", "Be Vietnam Pro", sans-serif;
  text-transform: uppercase;
}

h1 {
  max-width: none;
  font-size: 5.4rem;
  white-space: nowrap;
}

h2 {
  font-size: 5rem;
}

h3 {
  font-size: 1.05rem;
}

.hero-lede {
  max-width: 700px;
  margin: 22px 0 0;
  color: #dbe6f0;
  font-size: 1.15rem;
  overflow-wrap: break-word;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin-top: 30px;
}

.hero-stats div,
.fact-block,
.group-card,
.match-card,
.venue-card,
.knockout-timeline,
.sources {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.hero-stats div {
  padding: 18px;
}

.hero-stats strong {
  display: block;
  color: var(--gold);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 2.6rem;
  line-height: 0.9;
}

.hero-stats span,
.fact-block span,
.match-meta,
.venue-meta {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.trophy-panel {
  position: relative;
  min-height: 600px;
  padding: 12px;
}

.trophy-scene {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 25%, rgba(245, 200, 75, 0.22), transparent 28%),
    linear-gradient(160deg, rgba(13, 112, 73, 0.66), rgba(5, 12, 20, 0.92) 52%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 84px);
  cursor: grab;
  touch-action: none;
}

.trophy-scene:active {
  cursor: grabbing;
}

.trophy-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.trophy-status {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 8px 14px;
  color: var(--muted);
  background: rgba(5, 12, 20, 0.68);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  pointer-events: none;
}

.css-trophy {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 190px;
  height: 340px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 28px 45px rgba(0, 0, 0, 0.45));
  animation: fallbackSpin 8s linear infinite;
}

.cup-globe,
.cup-body,
.cup-stem,
.cup-base {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #8c5c10, #ffe28a 38%, #d89c22 62%, #70450b);
}

.cup-globe {
  top: 0;
  width: 132px;
  height: 132px;
  border-radius: 50%;
}

.cup-body {
  top: 92px;
  width: 118px;
  height: 150px;
  clip-path: polygon(10% 0, 90% 0, 72% 100%, 28% 100%);
}

.cup-stem {
  top: 220px;
  width: 54px;
  height: 70px;
  border-radius: 20px 20px 6px 6px;
}

.cup-base {
  bottom: 0;
  width: 150px;
  height: 56px;
  border-radius: 50% 50% 12px 12px;
}

@keyframes fallbackSpin {
  from {
    transform: translate(-50%, -50%) rotateY(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotateY(360deg);
  }
}

.trophy-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr 1.3fr;
  gap: 10px;
  margin-top: 10px;
}

.trophy-controls button,
.chip-row button {
  min-height: 42px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.trophy-controls button:hover,
.chip-row button:hover {
  border-color: rgba(245, 200, 75, 0.65);
}

.trophy-controls button[aria-pressed="true"],
.chip-row button.active {
  color: #071019;
  background: var(--gold);
  border-color: var(--gold);
}

.trophy-controls label {
  display: grid;
  align-items: center;
  gap: 3px;
  min-height: 42px;
  padding: 6px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.quick-facts,
.section-shell,
.sources {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 80px;
}

.fact-block {
  padding: 18px;
}

.fact-block strong {
  display: block;
  margin-top: 7px;
  font-size: 1rem;
}

.section-shell {
  padding: 84px 0 0;
}

.section-heading {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip-row button {
  padding: 0 14px;
  font-weight: 800;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.group-card {
  overflow: hidden;
}

.group-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(90deg, rgba(43, 208, 113, 0.2), rgba(61, 169, 255, 0.1));
  border-bottom: 1px solid var(--line);
}

.group-card header strong {
  font-family: "Barlow Condensed", "Be Vietnam Pro", sans-serif;
  font-size: 1.6rem;
  text-transform: uppercase;
}

.team-list {
  display: grid;
  gap: 1px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.team-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.035);
}

.team-code {
  color: var(--gold);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 1.15rem;
}

.schedule-tools {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(260px, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.schedule-tools label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.85rem;
}

.schedule-tools select,
.schedule-tools input {
  min-height: 46px;
  width: 100%;
  color: var(--ink);
  background: rgba(4, 12, 19, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.schedule-list {
  display: grid;
  gap: 10px;
}

.match-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.match-date {
  color: var(--grass);
  font-weight: 900;
}

.match-title {
  display: block;
  font-weight: 900;
}

.match-group {
  display: inline-grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  color: #071019;
  background: var(--gold);
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 900;
}

.match-group.knockout {
  width: auto;
  min-width: 72px;
  padding: 0 12px;
  border-radius: 999px;
}

.knockout-timeline {
  position: sticky;
  top: 88px;
  padding: 18px;
}

.knockout-timeline h3 {
  margin-bottom: 16px;
  text-transform: uppercase;
}

.knockout-timeline ol {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.knockout-timeline li {
  display: grid;
  gap: 3px;
  padding-left: 14px;
  border-left: 3px solid var(--grass);
}

.knockout-timeline span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stadiums-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.venue-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.venue-visual {
  min-height: 82px;
  background:
    radial-gradient(circle at 20% 25%, rgba(245, 200, 75, 0.8), transparent 18%),
    linear-gradient(135deg, rgba(43, 208, 113, 0.82), rgba(61, 169, 255, 0.5));
}

.venue-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.venue-country {
  width: fit-content;
  padding: 5px 9px;
  color: #071019;
  background: var(--grass);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.venue-card h3 {
  font-size: 1.02rem;
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 86px;
  margin-bottom: 42px;
  padding: 22px;
}

.sources h2 {
  flex: 1 0 100%;
  font-size: 2.2rem;
}

.sources p {
  flex: 1 0 100%;
  margin: 0 0 6px;
  color: var(--muted);
}

.sources a {
  color: var(--gold);
  font-weight: 800;
}

@media (max-width: 1020px) {
  h1 {
    font-size: 4.8rem;
  }

  h2 {
    font-size: 4rem;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .trophy-panel {
    min-height: 520px;
  }

  .quick-facts,
  .groups-grid,
  .stadiums-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .knockout-timeline {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 34px;
  }

  h1 {
    font-size: 2.9rem;
  }

  h2 {
    font-size: 3rem;
  }

  .hero-lede {
    font-size: 1rem;
  }

  .hero-stats,
  .quick-facts,
  .groups-grid,
  .stadiums-grid,
  .schedule-tools {
    grid-template-columns: 1fr;
  }

  .trophy-panel {
    min-height: 450px;
    padding: 0;
  }

  .trophy-scene {
    min-height: 390px;
  }

  .trophy-controls {
    grid-template-columns: 1fr;
  }

  .match-card {
    grid-template-columns: 1fr auto;
  }

  .match-card .match-date {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .hero-copy,
  .hero-lede {
    max-width: 342px;
  }

  h1 {
    font-size: 2.55rem;
  }
}

img.emoji {
  height: 1.2em;
  width: 1.2em;
  margin: 0 .15em 0 .1em;
  vertical-align: -0.2em;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(8, 16, 24, 0.92); /* Matches premium dark panel */
  border: 1px solid rgba(245, 200, 75, 0.4); /* Premium gold border */
  color: var(--gold); /* Gold arrow */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 0;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--gold); /* Gold background on hover */
  color: #071019; /* Dark text/icon */
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(245, 200, 75, 0.35);
}

.back-to-top svg {
  transition: transform 0.3s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}
