@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;600;700;800&display=swap");

:root {
  --cream: #f4efd9;
  --ink: #07150e;
  --grass: #0c5a36;
  --arg: #75c7ed;
  --spa: #efb810;
  --red: #c80d2e;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% -20%, #20432d 0, transparent 38%),
    var(--ink);
  font-family: Inter, system-ui, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(244, 239, 217, 0.15);
}

.brand {
  color: var(--cream);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-ball {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-right: 7px;
  color: var(--ink);
  background: var(--cream);
  border-radius: 50%;
}

.live {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.top-stats {
  display: flex;
  align-items: center;
  gap: 18px;
}

.visitors {
  color: rgba(244, 239, 217, .62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
}

.live span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: #ff3b3b;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 59, 59, 0.12);
  animation: pulse 1.6s infinite;
}

.intro {
  position: relative;
  z-index: 2;
  padding: 48px 20px 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: #d7dd70;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

h1 {
  margin: 0;
  font: 400 clamp(43px, 7.2vw, 92px)/0.86 "Archivo Black", sans-serif;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

h1 em {
  color: transparent;
  -webkit-text-stroke: 2px var(--cream);
  font-style: normal;
}

.subtitle {
  margin: 22px auto 0;
  color: rgba(244, 239, 217, 0.68);
  font-size: 14px;
}

.stadium {
  position: relative;
  width: min(1160px, calc(100% - 30px));
  height: clamp(390px, 50vw, 555px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 217, 0.15);
  border-radius: 28px;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(255,255,255,.15) 50%, transparent 50.2%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 90px, transparent 90px 180px),
    radial-gradient(ellipse at 50% 110%, #16804d 0, #0e603a 48%, #0b452c 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  user-select: none;
  touch-action: none;
}

.crowd {
  position: absolute;
  inset: 0 0 auto;
  height: 22%;
  opacity: 0.5;
  background:
    radial-gradient(circle, #f0d04c 0 1px, transparent 2px) 0 0 / 13px 13px,
    linear-gradient(#07150e, transparent);
  mask-image: linear-gradient(#000, transparent);
}

.pitch-lines {
  position: absolute;
  inset: 21% 0 0;
  opacity: 0.24;
  pointer-events: none;
}

.center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: white;
}

.center-circle {
  position: absolute;
  left: 50%;
  top: 41%;
  width: 180px;
  height: 180px;
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%) scaleY(.35);
}

.goal {
  position: absolute;
  top: 13%;
  width: 33%;
  height: 43%;
  padding: 0;
  color: white;
  border: 0;
  background: none;
  cursor: pointer;
}

.goal-arg { left: 8%; }
.goal-spa { right: 8%; }

.goal-frame {
  position: absolute;
  inset: 48px 0 0;
  display: block;
  border: clamp(5px, .7vw, 9px) solid #eceadd;
  border-bottom-width: 4px;
  border-radius: 7px 7px 0 0;
  box-shadow: 0 7px 0 rgba(0,0,0,.2);
  transform: perspective(300px) rotateX(-3deg);
}

.goal-net {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background:
    repeating-linear-gradient(0deg, transparent 0 15px, white 16px 17px),
    repeating-linear-gradient(90deg, transparent 0 18px, white 19px 20px);
}

.goal-label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 8px;
  color: var(--ink);
  background: var(--cream);
  border-radius: 99px;
  font-size: clamp(11px, 1.2vw, 15px);
  font-weight: 800;
  transition: transform .2s;
}

.goal:hover .goal-label {
  transform: translateY(-3px);
}

.goal-label small {
  display: none;
}

.flag {
  position: relative;
  display: inline-block;
  width: 29px;
  height: 29px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

.flag-arg {
  background: linear-gradient(#75c7ed 0 33%, white 33% 66%, #75c7ed 66%);
}

.flag-arg i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #dda815;
  font-size: 10px;
  font-style: normal;
}

.flag-spa {
  background: linear-gradient(#b6092c 0 25%, #f2c218 25% 75%, #b6092c 75%);
}

.versus {
  position: absolute;
  top: 31%;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: var(--cream);
  background: var(--ink);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  font: 13px "Archivo Black";
  transform: translate(-50%, -50%) rotate(-6deg);
}

.ball-wrap {
  position: absolute;
  left: 50%;
  bottom: 15%;
  z-index: 10;
  width: 84px;
  height: 95px;
  transform: translateX(-50%);
}

.ball {
  position: absolute;
  z-index: 2;
  width: 84px;
  height: 84px;
  padding: 0;
  color: #101713;
  background:
    radial-gradient(circle at 32% 25%, white 0 7%, transparent 8%),
    radial-gradient(circle at 35% 30%, #fff 0, #e4e1d8 68%, #aaa 100%);
  border: 0;
  border-radius: 50%;
  box-shadow: inset -10px -12px 18px rgba(0,0,0,.2), 0 10px 20px rgba(0,0,0,.3);
  cursor: grab;
}

.ball:active { cursor: grabbing; }

.ball-pattern {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 29px;
  text-shadow: -25px 13px 0 #202820, 24px 18px 0 #202820, 1px -31px 0 #202820;
}

.ball-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 16px;
  background: rgba(0,0,0,.28);
  border-radius: 50%;
  filter: blur(3px);
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 4%;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.75);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity .2s;
}

.swipe-icon { animation: swipe 1.8s ease-in-out infinite; }

.results {
  position: relative;
  width: min(720px, calc(100% - 40px));
  margin: 10px auto 35px;
}

.vote-feedback {
  height: 0;
  margin-top: 0;
  overflow: visible;
  text-align: center;
  font: 26px "Archivo Black", sans-serif;
  letter-spacing: -.04em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-8px) scale(.85);
  pointer-events: none;
}

.vote-feedback.show {
  animation: vote-feedback 2.4s cubic-bezier(.2,.8,.2,1) forwards;
}

.vote-feedback.argentina { color: var(--arg); }
.vote-feedback.spain { color: var(--spa); }

.result-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: rgba(244,239,217,.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.scorebar {
  display: flex;
  height: 42px;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,.08);
  border-radius: 99px;
  background: rgba(255,255,255,.08);
}

.score {
  display: flex;
  align-items: center;
  min-width: 76px;
  color: var(--ink);
  transition: width .8s cubic-bezier(.2,.8,.2,1);
}

.score span { white-space: nowrap; }
.score-arg { justify-content: flex-start; padding-left: 14px; background: var(--arg); }
.score-spa { justify-content: flex-end; padding-right: 14px; background: var(--spa); }
.result-note { margin: 8px 0 0; text-align: center; color: rgba(244,239,217,.42); font-size: 10px; }

.celebration {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  background: rgba(2,10,6,.84);
  backdrop-filter: blur(10px);
  transition: .3s;
}

.celebration.show {
  visibility: visible;
  opacity: 1;
}

.celebration-card {
  position: relative;
  z-index: 3;
  width: min(480px, 100%);
  padding: 45px 30px 30px;
  color: var(--ink);
  text-align: center;
  background: var(--cream);
  border-radius: 28px;
  box-shadow: 0 30px 100px #000;
  transform: translateY(20px) scale(.96);
  transition: .4s cubic-bezier(.2,.9,.3,1.2);
}

.show .celebration-card { transform: none; }
.celebration-card .eyebrow { color: #667114; }
.celebration-card h2 { margin: 5px 0 12px; font: 42px "Archivo Black"; text-transform: uppercase; }
.celebration-card p:not(.eyebrow) { margin: 0 0 28px; color: #566057; }
.vote-confirmation {
  width: fit-content;
  margin: -13px auto 25px;
  padding: 9px 15px;
  color: var(--ink);
  background: #d7dd70;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
}
.vote-confirmation.local {
  background: #dedbd0;
}
.trophy { font-size: 55px; animation: trophy .7s .2s both; }
.close { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 28px; cursor: pointer; }
.share-row { display: grid; gap: 10px; }
.primary, .secondary { min-height: 48px; border-radius: 99px; font-weight: 800; cursor: pointer; }
.primary { color: white; border: 0; background: var(--ink); }
.secondary { color: var(--ink); border: 1px solid #b6b4a8; background: transparent; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -10%; width: 10px; height: 18px; animation: fall 2.4s linear forwards; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 80; padding: 12px 18px; color: var(--ink); background: white; border-radius: 99px; font-size: 13px; font-weight: 700; opacity: 0; transform: translate(-50%, 20px); transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 50% { opacity: .45; } }
@keyframes swipe { 50% { transform: translateY(-7px); } }
@keyframes trophy { from { transform: scale(0) rotate(-15deg); } to { transform: none; } }
@keyframes fall { to { transform: translateY(115vh) rotate(680deg); } }
@keyframes vote-feedback {
  0% { height: 0; margin-top: 0; opacity: 0; transform: translateY(-8px) scale(.85); }
  14%, 72% { height: 34px; margin-top: 11px; opacity: 1; transform: translateY(0) scale(1); }
  100% { height: 0; margin-top: 0; opacity: 0; transform: translateY(7px) scale(.95); }
}

@media (max-width: 650px) {
  .topbar { width: calc(100% - 28px); padding: 17px 0; }
  .top-stats { gap: 9px; }
  .visitors { font-size: 9px; }
  .live { font-size: 9px; }
  .intro { padding: 34px 16px 23px; }
  .results { margin-top: 5px; margin-bottom: 25px; }
  .subtitle { max-width: 300px; line-height: 1.5; }
  .stadium { width: calc(100% - 16px); height: 455px; border-radius: 20px; }
  .goal { top: 16%; width: 43%; height: 35%; }
  .goal-arg { left: 3%; }
  .goal-spa { right: 3%; }
  .goal-label { font-size: 10px; gap: 5px; padding: 5px 8px 5px 5px; }
  .flag { width: 23px; height: 23px; }
  .goal-frame { inset: 39px 0 0; }
  .versus { top: 30%; width: 34px; height: 34px; font-size: 10px; }
  .ball-wrap { bottom: 16%; transform: translateX(-50%) scale(.82); }
  .hint { bottom: 5%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
