:root {
  --bg: #080808;
  --bg-soft: #10100f;
  --gold: #e7c66a;
  --gold-soft: rgba(231, 198, 106, 0.54);
  --white: #f8f5ec;
  --muted: rgba(248, 245, 236, 0.68);
  --line: rgba(248, 245, 236, 0.16);
  --panel: rgba(255,255,255,0.06);
  --panel-strong: rgba(255,255,255,0.10);
  --shadow: rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 76% 8%, rgba(231,198,106,0.14), transparent 28%),
    radial-gradient(circle at 8% 18%, rgba(255,255,255,0.08), transparent 22%),
    var(--bg);
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-logo {
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-transform: none;
}

.nav-link {
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 0.78fr);
  gap: 70px;
  align-items: center;
  padding: 48px 0 92px;
}

.eyebrow {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0;
  max-width: 680px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(62px, 8.4vw, 112px);
  line-height: 0.86;
  letter-spacing: -0.065em;
  font-weight: 500;
}

.hero-copy {
  margin: 32px 0 0;
  max-width: 540px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.hero-actions {
  margin-top: 42px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  border-radius: 999px;
  padding: 15px 20px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }

.button-primary {
  background: var(--gold);
  color: #111;
  font-weight: 760;
}

.button-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--white);
}

.note {
  margin-top: 18px;
  color: rgba(248,245,236,0.48);
  font-size: 13px;
}

.poster-stage {
  display: grid;
  place-items: center;
  perspective: 1400px;
}

.poster-shell {
  width: min(100%, 470px);
  aspect-ratio: 4 / 5;
  background: #070707;
  display: grid;
  place-items: center;
  box-shadow: 0 34px 80px rgba(0,0,0,0.58);
  transform: rotate(1.3deg);
}

.poster {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  padding: 34px 36px 30px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.18) 32%, rgba(0,0,0,0.78) 100%),
    radial-gradient(circle at 50% 32%, rgba(231,198,106,0.22), transparent 28%),
    url('/assets/stadium.avif') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
}

.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0) 40%, rgba(0,0,0,0.42) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.42));
  pointer-events: none;
  z-index: 0;
}

.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(231,198,106,0.26) 0 1px, transparent 1.5px);
  background-size: 38px 38px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.poster-topline,
.poster-title,
.bracket,
.poster-footer {
  position: relative;
  z-index: 1;
}

.poster-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
}

.poster-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 500;
  text-shadow: 0 2px 24px rgba(0,0,0,0.42);
}

.poster-meta {
  min-width: 128px;
  text-align: right;
  font-size: 8px;
  line-height: 1.42;
  letter-spacing: 0.03em;
  color: var(--white);
  text-shadow: 0 2px 18px rgba(0,0,0,0.5);
}

.poster-meta .rule {
  display: block;
  height: 1px;
  width: 86px;
  margin: 7px 0 7px auto;
  background: rgba(248,245,236,0.42);
}

.poster-meta strong { color: var(--gold); }

.poster-title {
  margin-top: 18px;
  width: 70%;
}

.poster-kicker {
  margin-bottom: 9px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 650;
}

.poster-user-title {
  min-height: 34px;
  margin: 0;
  padding: 9px 34px 9px 12px;
  border: 1px solid rgba(248,245,236,0.52);
  border-radius: 6px;
  background: rgba(0,0,0,0.28);
  color: rgba(248,245,236,0.86);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 420;
  position: relative;
}

.poster-user-title::after {
  content: "✎";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(248,245,236,0.62);
  font-size: 12px;
}

.bracket {
  flex: 1;
  min-height: 0;
  margin-top: 18px;
  display: grid;
  grid-template-rows: 108px 98px 92px;
  align-content: end;
  gap: 14px;
}

.round { display: grid; justify-items: center; position: relative; z-index: 2; }
.round.final-four { grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.round.finalists { grid-template-columns: repeat(2, minmax(80px, 112px)); justify-content: center; gap: 72px; align-items: end; }
.round.winner { align-items: end; }

.team-card {
  width: 100%;
  max-width: 88px;
  min-height: 74px;
  padding: 8px;
  border: 1px solid rgba(248,245,236,0.5);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(22,22,22,0.86), rgba(3,3,3,0.82));
  box-shadow: 0 10px 20px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.14);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.team-card.big { max-width: 110px; min-height: 88px; border-color: var(--gold-soft); }
.team-card.champion { max-width: 130px; min-height: 104px; border-color: var(--gold); box-shadow: 0 0 0 1px rgba(231,198,106,0.25), 0 0 24px rgba(231,198,106,0.28), 0 16px 34px rgba(0,0,0,0.45); }
.winner-label { color: var(--gold); font-size: 8px; line-height: 1; letter-spacing: 0.32em; text-transform: uppercase; font-weight: 700; }
.crown { color: var(--gold); font-size: 15px; line-height: 1; margin-bottom: -4px; }

.flag-box {
  width: 58px;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  font-size: 32px;
  line-height: 1;
  border-radius: 4px;
  background: rgba(255,255,255,0.92);
  overflow: hidden;
}

.team-card.big .flag-box { width: 68px; font-size: 36px; }
.team-card.champion .flag-box { width: 82px; font-size: 44px; }
.country { font-size: 10px; line-height: 1; letter-spacing: -0.02em; font-weight: 780; text-transform: uppercase; }
.team-card.big .country { font-size: 12px; }
.team-card.champion .country { font-size: 13px; }

.bracket-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.bracket-svg path { fill: none; stroke: rgba(248,245,236,0.72); stroke-width: 0.38; stroke-linecap: square; stroke-linejoin: miter; filter: drop-shadow(0 0 1.2px rgba(231,198,106,0.24)); }

.poster-footer {
  width: 100%;
  margin-top: 13px;
  display: flex;
  justify-content: flex-start;
  text-align: left;
  color: var(--white);
  text-shadow: 0 2px 16px rgba(0,0,0,0.55);
}

.poster-url { color: var(--gold); font-size: 13px; line-height: 1; letter-spacing: 0.02em; font-weight: 760; text-transform: lowercase; }
.poster-tagline { white-space: nowrap; margin-top: 6px; color: var(--white); font-size: 7px; line-height: 1.25; }

.section {
  padding: 110px 0;
  border-top: 1px solid rgba(248,245,236,0.08);
}

.section-header {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 64px;
  align-items: end;
  margin-bottom: 48px;
}

.section h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5.5vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  font-weight: 500;
}

.section-lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  margin: 0;
}

.picker-layout {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 34px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.helper-text {
  color: rgba(248,245,236,0.46);
  font-size: 13px;
  line-height: 1.4;
  margin-top: -4px;
}

.input {
  width: 100%;
  border: 1px solid rgba(248,245,236,0.18);
  background: rgba(0,0,0,0.28);
  color: var(--white);
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 16px;
  outline: none;
}

.input::placeholder { color: rgba(248,245,236,0.42); }

.selected-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.selected-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(248,245,236,0.14);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  cursor: grab;
}

.selected-card:active { cursor: grabbing; }

.selected-rank {
  color: var(--gold);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.selected-name { font-weight: 680; }
.drag { color: rgba(248,245,236,0.38); }

.country-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.country-button {
  border: 1px solid rgba(248,245,236,0.13);
  background: rgba(255,255,255,0.04);
  color: var(--white);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.country-button:hover {
  border-color: rgba(231,198,106,0.42);
}

.country-button span:first-child { font-size: 22px; }
.country-button small { display: block; color: rgba(248,245,236,0.44); margin-top: 2px; }

.preview-panel {
  display: grid;
  place-items: center;
  padding: 30px;
  min-height: 680px;
}

.preview-panel .poster-shell {
  width: min(100%, 430px);
  transform: none;
}

.export-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 22px;
  padding: 24px;
}

.step-number { color: var(--gold); font-size: 13px; font-weight: 760; letter-spacing: 0.18em; text-transform: uppercase; }
.step h3 { margin: 18px 0 10px; font-size: 24px; letter-spacing: -0.035em; }
.step p { margin: 0; color: var(--muted); line-height: 1.55; }

.live-mode {
  margin: 0 auto;
  max-width: 780px;
  text-align: center;
  border: 1px solid rgba(231,198,106,0.22);
  background:
    radial-gradient(circle at center top, rgba(231,198,106,0.12), transparent 42%),
    var(--panel);
  border-radius: 32px;
  padding: 58px 34px;
}

.live-mode h2 { margin-bottom: 22px; }
.live-mode p { max-width: 520px; margin: 0 auto 28px; color: var(--muted); font-size: 18px; line-height: 1.55; }

.site-footer {
  padding: 54px 0 72px;
  color: rgba(248,245,236,0.42);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(248,245,236,0.08);
}

@media (max-width: 900px) {
  .hero,
  .section-header,
  .picker-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 48px;
    padding-top: 28px;
  }

  .poster-stage { order: -1; }
  .poster-shell { width: min(92vw, 420px); }
  .section { padding: 78px 0; }
  .steps { grid-template-columns: 1fr; }
  .preview-panel { min-height: auto; }
}

@media (max-width: 560px) {
  .page { width: min(100% - 24px, 1180px); }
  .nav { height: 68px; }
  .nav-logo { font-size: 20px; }
  .nav-link { display: none; }
  .hero h1 { font-size: 58px; }
  .hero-copy { font-size: 17px; }
  .poster { padding: 28px 24px 24px; }
  .poster-brand { font-size: 27px; }
  .poster-meta { min-width: 110px; font-size: 7px; }
  .poster-title { width: 100%; margin-top: 16px; }
  .poster-kicker { font-size: 7px; letter-spacing: 0.22em; }
  .poster-user-title { font-size: 11px; min-height: 32px; }
  .bracket { grid-template-rows: 88px 82px 78px; gap: 10px; margin-top: 13px; }
  .round.final-four { gap: 5px; }
  .round.finalists { grid-template-columns: repeat(2, minmax(72px, 90px)); gap: 46px; }
  .team-card { max-width: 72px; min-height: 61px; padding: 6px; gap: 4px; }
  .team-card.big { max-width: 88px; min-height: 72px; }
  .team-card.champion { max-width: 110px; min-height: 82px; }
  .flag-box { width: 45px; font-size: 25px; }
  .team-card.big .flag-box { width: 52px; font-size: 29px; }
  .team-card.champion .flag-box { width: 62px; font-size: 34px; }
  .country { font-size: 7px; }
  .team-card.big .country { font-size: 8px; }
  .team-card.champion .country { font-size: 9px; }
  .winner-label { font-size: 7px; }
  .crown { font-size: 13px; }
  .poster-url { font-size: 10px; }
  .poster-tagline { font-size: 6px; }
  .country-grid { grid-template-columns: 1fr; }
  .section h2 { font-size: 46px; }
  .site-footer { flex-direction: column; }
}
