*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #06060a;
  --text: #f2f2f2;
  --text-secondary: rgba(242, 242, 242, 0.6);
  --messi-primary: #6CACE4;
  --messi-glow: #8ec4ee;
  --messi-surface: rgba(108, 172, 228, 0.06);
  --messi-border: rgba(108, 172, 228, 0.12);
  --messi-border-active: rgba(142, 196, 238, 0.5);
  --messi-shadow: rgba(108, 172, 228, 0.35);
  --ronaldo-primary: #DA291C;
  --ronaldo-glow: #e85a50;
  --ronaldo-surface: rgba(218, 41, 28, 0.06);
  --ronaldo-border: rgba(218, 41, 28, 0.12);
  --ronaldo-border-active: rgba(232, 90, 80, 0.5);
  --ronaldo-shadow: rgba(218, 41, 28, 0.35);
  --surface: #0f0f14;
  --surface-raised: #16161e;
  --surface-border: rgba(255, 255, 255, 0.06);
  --success: #22c55e;
  --success-shadow: rgba(34, 197, 94, 0.3);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 1.2s ease;
}

.bg-glow::before,
.bg-glow::after {
  content: '';
  position: absolute;
  width: 50%;
  height: 60%;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  transition: opacity 1.2s ease;
}

.bg-glow::before {
  left: -10%;
  top: 10%;
  background: var(--messi-primary);
  opacity: var(--messi-glow-opacity, 0.15);
}

.bg-glow::after {
  right: -10%;
  top: 10%;
  background: var(--ronaldo-primary);
  opacity: var(--ronaldo-glow-opacity, 0.15);
}

.header,
.arena,
.footer {
  position: relative;
  z-index: 1;
}

/* ─── HEADER ─── */

.header {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 5rem) 1.5rem clamp(1.5rem, 3vw, 2rem);
}

.header__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 7.5rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 0.95;
  text-transform: uppercase;
}

.header__goat {
  background: linear-gradient(135deg, var(--messi-glow) 0%, #a855f7 50%, var(--ronaldo-glow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header__subtitle {
  margin-top: 1.25rem;
  font-size: clamp(0.875rem, 1.8vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 480px;
  margin-inline: auto;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

/* ─── COUNTDOWN ─── */

.countdown {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.countdown__label {
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  letter-spacing: 0.2em;
  color: var(--text-secondary);
}

.countdown__timer {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(48px, 8vw, 72px);
  padding: 0.5rem 0.25rem;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
}

.countdown__value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.countdown__desc {
  font-family: var(--font-body);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.countdown__sep {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 2rem);
  color: rgba(255, 255, 255, 0.15);
  margin-bottom: 0.75rem;
}

/* ─── ARENA ─── */

.arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 2rem 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  align-items: center;
}

.vs-divider {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.12);
  text-align: center;
  padding: 0 clamp(2rem, 4vw, 4rem);
  user-select: none;
}

/* ─── PLAYER PHOTOS ─── */

.player-photo {
  position: relative;
  cursor: pointer;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.player-photo__img {
  width: 100%;
  max-height: clamp(380px, 60vw, 620px);
  object-fit: cover;
  object-position: center top;
  border-radius: 24px;
  transition:
    transform var(--duration-slow) var(--ease-out-expo),
    filter var(--duration-normal) ease,
    box-shadow var(--duration-normal) ease;
  filter: saturate(0.7) brightness(0.8);
}

.player-photo:hover .player-photo__img {
  transform: scale(1.06);
  filter: saturate(0.95) brightness(0.95);
}

.player-photo:active .player-photo__img {
  transform: scale(0.97);
  transition-duration: var(--duration-fast);
}

.player-photo.is-selected .player-photo__img {
  transform: scale(1.08);
  filter: saturate(1.15) brightness(1.05);
}

.player-photo--messi.is-selected .player-photo__img {
  filter: saturate(1.15) brightness(1.05);
  box-shadow: 0 0 40px rgba(108, 172, 228, 0.4), 0 0 0 2px rgba(142, 196, 238, 0.5);
}

.player-photo--ronaldo.is-selected .player-photo__img {
  filter: saturate(1.15) brightness(1.05);
  box-shadow: 0 0 40px rgba(218, 41, 28, 0.4), 0 0 0 2px rgba(232, 90, 80, 0.5);
}

.player-photo:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 8px;
  border-radius: 8px;
}

/* ─── CHARITY COUNTER ─── */

.charity {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem 0 0;
}

.charity__label {
  font-family: var(--font-display);
  font-size: clamp(0.65rem, 1.2vw, 0.8rem);
  letter-spacing: 0.2em;
  color: var(--text-secondary);
}

.charity__amount {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.04em;
  color: var(--success);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
  transition: color var(--duration-normal) ease;
}

.charity__leader {
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 1.3vw, 0.85rem);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  transition: color var(--duration-normal) ease;
}

/* ─── VOTE BUTTON ─── */

.vote-btn {
  border: none;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.12em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.vote-btn__loading {
  display: none;
}

.vote-btn.is-loading .vote-btn__text {
  display: none;
}

.vote-btn.is-loading .vote-btn__loading {
  display: inline;
}

.vote-btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.vote-btn--go {
  grid-column: 1 / -1;
  justify-self: center;
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: #fff;
  min-height: 56px;
  min-width: 200px;
  padding: 1rem 3.5rem;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  border-radius: 16px;
  box-shadow:
    0 4px 16px var(--success-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition:
    transform var(--duration-normal) var(--ease-spring),
    box-shadow var(--duration-normal) ease,
    opacity var(--duration-normal) ease;
}

.vote-btn--go:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 12px 40px var(--success-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.vote-btn--go:active:not(:disabled) {
  transform: translateY(0) scale(0.96);
  transition-duration: var(--duration-fast);
}

.vote-btn--go:focus-visible {
  outline: 2px solid var(--success);
  outline-offset: 4px;
}

.vote-btn--go:disabled {
  background: var(--surface-raised);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.38;
  border: 1px solid var(--surface-border);
}

/* ─── SCOREBOARD ─── */

.scoreboard {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  position: relative;
}

.scoreboard::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 80px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    rgba(108, 172, 228, 0.12) 0%,
    transparent 40%,
    transparent 60%,
    rgba(218, 41, 28, 0.12) 100%
  );
  filter: blur(30px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.scoreboard__bar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  background: var(--surface);
  border: none;
}

.scoreboard__fill {
  transition: width 0.8s var(--ease-out-expo);
  min-width: 4px;
  height: 100%;
}

.scoreboard__fill--messi {
  background: linear-gradient(90deg, var(--messi-primary), var(--messi-glow));
}

.scoreboard__fill--ronaldo {
  background: linear-gradient(90deg, var(--ronaldo-glow), var(--ronaldo-primary));
}

.scoreboard__labels {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.75rem;
}

.scoreboard__pct {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.scoreboard__pct:first-child {
  color: var(--messi-glow);
}

.scoreboard__pct:last-child {
  color: var(--ronaldo-glow);
}

/* ─── FOOTER ─── */

.footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
  border-top: 1px solid var(--surface-border);
}

.footer__links {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.footer__links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  transition: color var(--duration-fast) ease;
}

.footer__links a:hover {
  color: var(--text);
}

.footer__dot {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
}

.footer__instagram {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--duration-fast) ease;
}

.footer__instagram:hover {
  color: var(--text);
}

/* ─── RESULT PAGES ─── */

.result-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.result-page__icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.result-page__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.result-page__player-img {
  max-height: clamp(200px, 40vw, 350px);
  border-radius: 20px;
  margin-bottom: 1.5rem;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at center, black 40%, transparent 75%);
  mask-image: radial-gradient(ellipse 85% 85% at center, black 40%, transparent 75%);
}

.result-page__title--success {
  color: var(--success);
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
}

.result-page__text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 400px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.result-page__link {
  display: inline-block;
  min-height: 48px;
  padding: 0.875rem 2rem;
  border-radius: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    background var(--duration-normal) ease;
}

.result-page__link:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

.result-page__link:active {
  transform: scale(0.97);
}

/* ─── LEGAL PAGES ─── */

.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1.5rem 4rem;
}

.legal-page__back {
  display: inline-block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color var(--duration-fast) ease;
}

.legal-page__back:hover {
  color: var(--text);
}

.legal-page__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.legal-page__date {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 2.5rem;
}

.legal-page__section {
  margin-bottom: 2rem;
}

.legal-page__section h2 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.legal-page__section p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.legal-page__section ul {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.legal-page__section li {
  margin-bottom: 0.35rem;
}

.legal-page__section a {
  color: var(--messi-glow);
  text-decoration: none;
}

.legal-page__section a:hover {
  text-decoration: underline;
}

/* ─── ENTRANCE ANIMATIONS ─── */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  animation: fadeUp 0.6s var(--ease-out-expo) both;
}

.player-photo--messi {
  animation: fadeUp 0.6s var(--ease-out-expo) 0.1s both;
}

.vs-divider {
  animation: fadeUp 0.5s var(--ease-out-expo) 0.15s both;
}

.player-photo--ronaldo {
  animation: fadeUp 0.6s var(--ease-out-expo) 0.2s both;
}

.scoreboard {
  animation: fadeUp 0.5s var(--ease-out-expo) 0.3s both;
}

.vote-btn--go {
  animation: fadeUp 0.5s var(--ease-out-expo) 0.4s both;
}

/* ─── REDUCED MOTION ─── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
  .arena {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem 2rem;
  }

  .vs-divider {
    padding: 0;
  }

  .scoreboard {
    padding: 0.5rem 0;
  }

  .player-card {
    border-radius: 16px;
  }

  .player-card__inner {
    padding: 1.5rem 1.25rem;
  }

  .vote-btn--go {
    width: 100%;
    max-width: 320px;
  }
}
