@font-face {
  font-family: 'Bebas Neue';
  src: url('assets/fonts/Bebas_Neue/BebasNeue-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Lato';
  src: url('assets/fonts/Lato/Lato-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Lato';
  src: url('assets/fonts/Lato/Lato-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Lato';
  src: url('assets/fonts/Lato/Lato-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
}

:root {
  --bg: #050505;
  --gold-1: #f5d77b;
  --gold-2: #d4af55;
  --gold-3: #a37f2b;
  --gold-4: #6b4f15;
  --text: #f5efe1;
  --text-dim: #b9ad8a;
  --border: rgba(212, 175, 85, 0.45);
  --border-strong: rgba(245, 215, 123, 0.85);
  --field-bg: rgba(0, 0, 0, 0.65);
  --error: #ff6b6b;
  --success: #7ed957;
  --shadow-gold: 0 0 24px rgba(212, 175, 85, 0.18);
  --gold-gradient: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 50%, var(--gold-3) 100%);
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fondo con el trofeo: en desktop cubre toda la pantalla (trofeo a la derecha) */
.bg-image {
  position: fixed;
  inset: 0;
  background: url('assets/fondo.webp') no-repeat center right / cover;
  z-index: -1;
}

.page {
  position: relative;
  margin: 0 auto;
  padding: 24px 48px 48px;
  max-width: 1440px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.logo {
  height: 56px;
  width: auto;
}

/* Hero */
.hero {
  display: flex;
  flex: 1;
  align-items: center;
}

.hero-text {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
}

/* Headline */
.headline {
  margin: 0 0 6px;
  text-align: center;
  line-height: 0.92;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: normal;
  font-style: italic;
}

.headline-main {
  display: block;
  font-size: clamp(72px, 11vw, 132px);
  letter-spacing: 0.01em;
  background: linear-gradient(to bottom, #f5d77b 0%, #d4af55 40%, #a37f2b 55%, #d4af55 70%, #f5d77b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.headline-sub {
  display: block;
  font-size: clamp(34px, 5vw, 56px);
  color: #fff;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.tagline {
  margin: 0 0 18px;
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  font-style: italic;
  font-size: clamp(17px, 2.2vw, 22px);
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Countdown */
.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.countdown-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--gold-1);
}

.countdown-grid {
  display: flex;
  gap: 8px;
}

.cd-cell {
  background: linear-gradient(180deg, rgba(212, 175, 85, 0.12), rgba(0, 0, 0, 0.6));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 52px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cd-cell span {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.cd-cell small {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  font-weight: 600;
}

/* Cierre */
.closed-banner {
  margin: 0 0 20px;
  padding: 16px 20px;
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--gold-1);
  background: rgba(212, 175, 85, 0.10);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}

.predict-form.closed {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.4);
}

/* Form */
.predict-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match {
  border: none;
  margin: 0;
  padding: 0;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

/* Pastilla dorada de equipo */
.team-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 4px 4px 4px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0d179 0%, #d4af55 55%, #8f6d24 100%);
  box-shadow:
    0 0 0 1px rgba(245, 215, 123, 0.55),
    0 8px 20px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.team-flag {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  background: #000;
}

.team-name {
  flex: 1;
  font-family: 'Bebas Neue', sans-serif;
  font-style: italic;
  font-size: 24px;
  letter-spacing: 0.05em;
  color: #14100a;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Caja negra de goles dentro de la pastilla */
.score-input {
  width: 62px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: #0a0a0a;
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  text-align: center;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(245, 215, 123, 0.25), inset 0 2px 8px rgba(0, 0, 0, 0.8);
  transition: box-shadow 0.18s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input::placeholder { color: rgba(245, 239, 225, 0.35); }

.score-input:focus {
  box-shadow: inset 0 0 0 2px var(--border-strong), inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.score-input.has-error {
  box-shadow: inset 0 0 0 2px rgba(255, 107, 107, 0.8);
}

.vs-badge {
  width: 44px;
  height: auto;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
}

/* Errores */
.field-error {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--error);
  padding-left: 22px;
  min-height: 16px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.field-error.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Contacto */
.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field {
  display: block;
  position: relative;
}

.field input {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 14px 22px;
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input::placeholder {
  color: var(--text-dim);
  opacity: 0.85;
}

.field input:focus {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-gold);
  background: rgba(0, 0, 0, 0.75);
}

.field input.has-error {
  border-color: rgba(255, 107, 107, 0.75);
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.15);
}

/* Teléfono con selector de prefijo */
.phone-field {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.phone-prefix-select {
  flex-shrink: 0;
  width: 96px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 999px 0 0 999px;
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  padding: 0 8px 0 16px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s ease;
}

.phone-prefix-select:focus { border-color: var(--border-strong); }

.phone-prefix-select option {
  background: #111;
  color: var(--text);
}

.phone-field input {
  border-radius: 0 999px 999px 0;
}

/* Checkbox de términos */
.legal-check { margin: 6px 0 0; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  line-height: 1.5;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--field-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  position: relative;
}

.checkbox-label:hover .checkmark {
  border-color: var(--gold-1);
  box-shadow: 0 0 0 3px rgba(212, 175, 85, 0.12);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold-3) 100%);
  border-color: var(--gold-1);
  box-shadow: 0 0 8px rgba(212, 175, 85, 0.35);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #1a1208;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.checkbox-label a {
  color: var(--gold-1);
  text-decoration: none;
  white-space: nowrap;
}

.checkbox-label a:hover { text-decoration: underline; }

/* CTA */
.cta {
  margin-top: 6px;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 15px 28px;
  font-family: 'Bebas Neue', sans-serif;
  font-style: italic;
  font-size: 26px;
  letter-spacing: 0.14em;
  color: #1a1208;
  background: var(--gold-gradient);
  box-shadow:
    0 0 0 1px rgba(245, 215, 123, 0.7),
    0 12px 28px rgba(212, 175, 85, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cta:active { transform: translateY(0); }
.cta:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.legal {
  text-align: center;
  font-size: 12px;
  margin: 6px 0 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal a {
  color: var(--text-dim);
  text-decoration: none;
}

.legal a:hover { color: var(--gold-1); text-decoration: underline; }

/* Trofeo en móvil (el fondo fijo se oculta) */
.trophy-mobile { display: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(180deg, #1a1409 0%, #0d0a04 100%);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--success); }

/* -------- Panel de Términos y Condiciones -------- */
.terms-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 0 40px 48px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.32s ease, transform 0.32s ease;
  background:
    radial-gradient(ellipse at 70% 40%, rgba(212, 175, 85, 0.10), transparent 60%),
    radial-gradient(ellipse at 20% 90%, rgba(212, 175, 85, 0.06), transparent 50%),
    var(--bg);
  overflow-y: auto;
}

.terms-panel.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.terms-content {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 48px;
}

.terms-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 18px;
  color: var(--gold-1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.terms-back:hover {
  background: rgba(212, 175, 85, 0.10);
  border-color: var(--border-strong);
}

.terms-title {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.01em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.terms-updated {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin: 0;
}

.terms-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(212, 175, 85, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
}

.terms-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-1);
  margin: 12px 0 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.terms-body p,
.terms-body li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

.terms-body ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terms-body li::marker { color: var(--gold-2); }
.terms-body strong { color: var(--gold-1); }

.terms-cta-back {
  align-self: flex-start;
  margin-top: 8px;
  font-size: 15px;
  padding: 14px 28px;
}

/* -------- Responsive -------- */
@media (max-width: 960px) {
  .page { padding: 20px 20px 0; }

  /* En móvil el fondo fijo se quita y el trofeo pasa abajo del form */
  .bg-image { display: none; }

  .topbar { justify-content: center; margin-bottom: 4px; }
  .logo { height: 48px; }

  .hero { flex-direction: column; }
  .hero-text { max-width: 520px; margin: 0 auto; }

  .trophy-mobile {
    display: block;
    width: 100vw;
    margin: 24px calc(50% - 50vw) 0;
    height: min(120vw, 560px);
    background: url('assets/fondo.webp') no-repeat 62% center / cover;
  }

  .match-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: center;
  }

  .team-pill { width: 100%; }
  .vs-badge { width: 36px; margin: -2px 0; }

  .contact-row { grid-template-columns: 1fr; }

  .terms-panel { padding: 0 20px 40px; }
}

@media (max-width: 480px) {
  .page { padding: 16px 14px 0; }
  .headline-main { font-size: clamp(64px, 19vw, 88px); }
  .headline-sub { font-size: clamp(30px, 9vw, 40px); }
  .team-name { font-size: 21px; }
  .team-pill { height: 48px; }
  .team-flag { width: 40px; height: 40px; }
  .score-input { width: 56px; height: 40px; font-size: 23px; }
  .cd-cell { min-width: 46px; padding: 5px 6px; }
  .cd-cell span { font-size: 19px; }
  .cta { font-size: 22px; padding: 14px 22px; }
  .terms-panel { padding: 0 14px 32px; }
  .terms-body { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
