/* ============================================================
   FUTPICK — GAMER REDESIGN
   Mantiene TODOS los selectores originales que usa script.js
   ============================================================ */

:root {
  --c-bg:       #03040d;
  --c-surface:  #080c1e;
  --c-surface2: #0c1028;
  --c-border:   rgba(0, 240, 255, 0.16);
  --c-border-h: rgba(0, 240, 255, 0.55);
  --c-cyan:     #00f0ff;
  --c-green:    #39ff6a;
  --c-yellow:   #ffd700;
  --c-red:      #ff3060;
  --c-purple:   #a855f7;
  --c-text:     #e8ecff;
  --c-muted:    #4e5480;
  --c-label:    #8892cc;
  --font-d: 'Bebas Neue', sans-serif;
  --font-b: 'Rajdhani', sans-serif;
  --font-m: 'JetBrains Mono', monospace;
}

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

/* ── BODY ── */
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-b);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 20px 48px;
  overflow-x: hidden;
}

/* ── CANVAS BACKGROUND ── */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* ── SCANLINES ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px
  );
  z-index: 1; pointer-events: none;
}

/* ── VIGNETTE ── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.72) 100%);
  z-index: 1; pointer-events: none;
}

/* ── APP WRAPPER ── */
.app {
  position: relative; z-index: 2;
  width: 100%; max-width: 1040px;
}

/* ══════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-border);
  position: relative;
}

/* Animated scan line under header */
.header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: -5%;
  height: 1px; width: 0;
  background: linear-gradient(90deg, transparent, var(--c-cyan) 40%, var(--c-green), transparent);
  animation: hline 4s ease-in-out infinite;
}
@keyframes hline {
  0%    { width: 0;    left: -5%;  opacity: 0; }
  10%   { opacity: 1; }
  60%   { width: 110%; }
  90%   { opacity: 1; }
  100%  { width: 110%; left: -5%; opacity: 0; }
}

.brand-lockup {
  display: flex; align-items: center; gap: 18px;
}

/* Logo image — original .main-logo */
.main-logo {
  height: 62px; width: auto; object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(0,240,255,0.35));
  animation: logo-breathe 3.5s ease-in-out infinite;
}
@keyframes logo-breathe {
  0%,100% { filter: drop-shadow(0 0 14px rgba(0,240,255,0.35)); }
  50%      { filter: drop-shadow(0 0 28px rgba(0,240,255,0.7)) drop-shadow(0 0 50px rgba(0,240,255,0.2)); }
}

/* Brand divider */
.brand-divider {
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, transparent, rgba(0,240,255,0.45), transparent);
}

.brand-text {
  display: flex; flex-direction: column; gap: 3px;
}

/* Title */
.app-title {
  font-family: var(--font-d);
  font-size: 2.1rem; letter-spacing: 0.1em; line-height: 1;
  background: linear-gradient(90deg, #fff 0%, var(--c-cyan) 55%, var(--c-green) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: white;
  margin: 0;
}

/* Tagline */
.tagline {
  font-family: var(--font-m);
  font-size: 0.7rem; color: var(--c-muted);
  letter-spacing: 0.1em; margin: 0;
}

.cursor {
  color: var(--c-cyan);
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* FIFA logo wrapper */
.header-bottom { display: flex; align-items: center; }

.fifa-logo-wrapper {
  padding: 7px 13px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.fifa-logo-wrapper:hover {
  border-color: var(--c-border-h);
  box-shadow: 0 0 20px rgba(0,240,255,0.12);
}
.fifa-logo-wrapper img {
  height: 30px; display: block; opacity: 0.9;
}

/* ══════════════════════════════════════════
   PANELS
   ══════════════════════════════════════════ */
.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 22px 22px 22px;
  margin-bottom: 18px;
  position: relative; overflow: hidden;
  transition: border-color 0.3s;
}

/* Top glow line on hover */
.panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-cyan) 40%, var(--c-green), transparent);
  opacity: 0; transition: opacity 0.35s;
}
.panel:hover::before { opacity: 1; }

/* Corner decoration */
.panel::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at top right, rgba(0,240,255,0.07), transparent 70%);
  pointer-events: none;
}

/* Panel header row */
.panel-header-row {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 18px;
}

.panel-eyebrow {
  font-family: var(--font-m);
  font-size: 0.62rem; color: var(--c-cyan); opacity: 0.55;
  letter-spacing: 0.1em;
}

/* .panel-title — mantiene nombre original */
.panel-title {
  font-family: var(--font-d);
  font-size: 1.35rem; letter-spacing: 0.14em;
  color: var(--c-cyan); margin: 0;
  text-shadow: 0 0 20px rgba(0,240,255,0.25);
}

/* ══════════════════════════════════════════
   CONTROLS GRID
   ══════════════════════════════════════════ */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

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

.field label {
  font-family: var(--font-m);
  font-size: 0.68rem; color: var(--c-label);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.field label::before { content: '// '; color: var(--c-cyan); opacity: 0.45; }

.field select,
.field input {
  background: var(--c-surface2);
  border: 1px solid rgba(90,96,144,0.35);
  border-radius: 9px;
  color: var(--c-text);
  padding: 9px 36px 9px 13px;
  font-family: var(--font-b);
  font-size: 0.95rem; font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%2300f0ff' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.field input {
  padding: 9px 13px;
  background-image: none;
  text-align: center;
}

.field select optgroup {
  background: var(--c-surface2);
  color: var(--c-cyan);
  font-style: normal; font-weight: bold;
}

.field select:focus,
.field input:focus {
  border-color: var(--c-cyan);
  box-shadow: 0 0 0 3px rgba(0,240,255,0.1);
  background-color: rgba(0,240,255,0.03);
}

/* Range inputs */
.range-inputs {
  display: flex; align-items: center; gap: 7px;
}
.range-inputs span {
  color: var(--c-muted); font-size: 0.85rem;
}
.range-inputs input { width: 68px; }

/* ══════════════════════════════════════════
   DRAW BUTTON — btn-primary (nombre original)
   ══════════════════════════════════════════ */
.btn-primary {
  position: relative; overflow: hidden;
  margin-top: 16px; width: 100%;
  padding: 14px 18px;
  border-radius: 10px; border: none; cursor: pointer;
  font-family: var(--font-d);
  font-size: 1.45rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: #000;
  background: linear-gradient(135deg, var(--c-cyan) 0%, var(--c-green) 100%);
  box-shadow: 0 0 35px rgba(0,240,255,0.3), 0 6px 18px rgba(0,0,0,0.55);
  transition: transform 0.13s, box-shadow 0.13s, filter 0.13s, opacity 0.2s;
}

/* Shimmer sweep */
.btn-primary .btn-shimmer,
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.38) 50%, transparent 100%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}
.btn-primary:hover:enabled::before { transform: translateX(120%); }

/* Outer glow ring */
.btn-primary::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--c-cyan), var(--c-green));
  z-index: -1; opacity: 0;
  animation: btn-ring 2.5s ease-in-out infinite;
}
@keyframes btn-ring {
  0%,100% { opacity: 0; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(1.015); }
}

.btn-primary:hover:enabled {
  transform: translateY(-2px);
  box-shadow: 0 0 55px rgba(0,240,255,0.5), 0 10px 26px rgba(0,0,0,0.6);
  filter: brightness(1.06);
}
.btn-primary:active:enabled {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 0 20px rgba(0,240,255,0.3), 0 3px 10px rgba(0,0,0,0.6);
}
.btn-primary:disabled {
  opacity: 0.5; cursor: default; filter: grayscale(0.4);
}

/* ══════════════════════════════════════════
   RESULT CONTAINER
   ══════════════════════════════════════════ */
.result-container {
  min-height: 210px; position: relative;
}

/* ── VERSUS LAYOUT ── */
.versus-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  gap: 14px;
  align-items: stretch;
}

/* ── TEAM CARD ── */
.team-card {
  border-radius: 16px; padding: 10px;
  background: radial-gradient(circle at top, #121836 0%, #060b1c 65%);
  border: 1px solid rgba(0,240,255,0.2);
  position: relative; overflow: hidden;
  transition: border-color 0.35s, box-shadow 0.35s;
}

/* Glow corners */
.team-card::before {
  content: '';
  position: absolute; inset: -50%;
  background:
    radial-gradient(circle at top,    rgba(0,240,255,0.18), transparent 55%),
    radial-gradient(circle at bottom, rgba(57,255,106,0.13), transparent 55%);
  opacity: 0; transition: opacity 0.35s; pointer-events: none;
}
.team-card.animate::before { opacity: 1; }

/* ── TEAM LABEL — original selector ── */
.team-label {
  font-family: var(--font-m);
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--c-cyan);
  margin-bottom: 6px; opacity: 0.7;
}

/* ── TEAM CONTENT — script.js escribe dentro de esto ── */
.team-content {
  position: relative; z-index: 1;
  background: rgba(2,5,21,0.9);
  border-radius: 12px; padding: 18px 14px;
  min-height: 160px;
  display: flex; flex-direction: column;
  gap: 10px; align-items: center; justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(0,240,255,0.12);
  transition: box-shadow 0.3s;
}
.team-card:hover .team-content {
  box-shadow: inset 0 0 0 1px rgba(0,240,255,0.3);
}

/* Placeholder state */
.team-content.placeholder {
  opacity: 0.45;
  font-family: var(--font-m);
  font-size: 0.75rem; letter-spacing: 0.1em;
  color: var(--c-muted);
}

/* Team logo injected by script.js */
.team-logo {
  width: 72px; height: 72px; object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.85));
  transition: transform 0.3s;
}
.team-card:hover .team-logo { transform: scale(1.07); }

/* Team name injected by script.js */
.team-name {
  font-family: var(--font-d);
  font-size: 1.45rem; letter-spacing: 0.06em;
  line-height: 1.1;
}

/* Team meta (liga, país) injected by script.js */
.team-meta {
  font-family: var(--font-m);
  font-size: 0.72rem; color: var(--c-label);
  letter-spacing: 0.06em;
}

/* ── STARS — .stars, .stars-container, .star-icon ── */
.stars { margin-top: 2px; }

.stars-container {
  display: inline-flex; gap: 2px;
  font-size: 1.3rem; line-height: 1;
}

.star-icon {
  font-family: system-ui, sans-serif;
  font-weight: bold;
  color: rgba(53,58,98,0.9);
}
.star-icon.full {
  color: var(--c-yellow);
  text-shadow: 0 0 6px rgba(255,215,0,0.5);
}
.star-icon.half {
  background: linear-gradient(90deg, var(--c-yellow) 50%, rgba(53,58,98,0.9) 50%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ── VERSUS DIVIDER ── */
.versus {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
}

.vs-text {
  font-family: var(--font-d);
  font-size: 1.55rem; letter-spacing: 0.22em;
  color: var(--c-cyan);
  padding: 10px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,240,255,0.45);
  background: rgba(0,8,28,0.9);
  box-shadow: 0 0 22px rgba(0,240,255,0.2), 0 8px 24px rgba(0,0,0,0.75);
  animation: vs-pulse 2.2s ease-in-out infinite;
  text-indent: 0.22em;
}
@keyframes vs-pulse {
  0%,100% { box-shadow: 0 0 22px rgba(0,240,255,0.2), 0 8px 24px rgba(0,0,0,0.75); color: var(--c-cyan); }
  50%      { box-shadow: 0 0 44px rgba(0,240,255,0.55), 0 8px 24px rgba(0,0,0,0.75); color: #fff; }
}

/* League logo mini */
.league-logo-mini {
  width: 50px; height: 50px; object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.65));
}

/* ══════════════════════════════════════════
   LOADING STATE
   ══════════════════════════════════════════ */
.loading-fade .team-content {
  opacity: 0.25;
  transform: scale(0.97);
  transition: all 0.3s ease;
  filter: grayscale(1);
}

/* ══════════════════════════════════════════
   CONSTRUCTION WRAPPER
   ══════════════════════════════════════════ */
#construction-wrapper {
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 2.5rem 1rem;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,215,0,0.025) 0px, rgba(255,215,0,0.025) 10px,
    transparent 10px, transparent 20px
  );
  border-radius: 14px;
  animation: fadeIn 0.55s ease-out;
}

.result-container.construction-active #result-wrapper { display: none !important; }
.result-container.construction-active #construction-wrapper { display: flex; }

.construction-main-img {
  max-width: 460px; width: 100%; height: auto;
  margin-bottom: 1.4rem;
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(255,215,0,0.12);
  transition: transform 0.3s ease;
}
.construction-main-img:hover { transform: scale(1.02) rotate(-0.5deg); }

.construction-content h3 {
  font-family: var(--font-d);
  font-size: 1.7rem; letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--c-yellow), #ffb900);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--c-yellow);
  margin-bottom: 6px;
}
.construction-content p {
  color: var(--c-label); font-size: 0.95rem; opacity: 0.85;
  margin-bottom: 1.2rem;
}

/* .loading-dots — original selector */
.loading-dots {
  display: inline-block; padding: 5px 16px;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.28);
  border-radius: 50px;
  color: var(--c-yellow);
  font-family: var(--font-m);
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.loading-dots::after { content: ' .'; animation: dots 1.5s steps(5,end) infinite; }
@keyframes dots {
  0%,20% { content: ' .'; }
  40%     { content: ' ..'; }
  60%     { content: ' ...'; }
  80%,100%{ content: ''; }
}

/* ══════════════════════════════════════════
   INFO SECTION — .info
   ══════════════════════════════════════════ */
.how-to-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px,1fr));
  gap: 12px;
}

.how-step {
  background: var(--c-surface2);
  border: 1px solid rgba(90,96,144,0.18);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  transition: border-color 0.22s, transform 0.22s;
  font-size: 0.92rem; color: var(--c-label); line-height: 1.45;
}
.how-step:hover { border-color: rgba(0,240,255,0.3); transform: translateY(-2px); }
.how-step strong { color: var(--c-text); }

.step-n {
  font-family: var(--font-d);
  font-size: 2rem; line-height: 1;
  color: var(--c-cyan); opacity: 0.28;
  flex-shrink: 0;
}

/* Legacy .info ul — keep in case script.js or other code uses it */
.info ul { margin-left: 18px; font-size: 0.9rem; color: var(--c-label); }
.info li + li { margin-top: 5px; }

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.footer {
  text-align: center;
  font-size: 0.8rem; color: var(--c-muted);
  margin-top: 10px; padding-bottom: 20px;
}
.footer p + p { margin-top: 4px; }

.contact-info {
  font-size: 0.72rem; color: #4e5480;
  margin-top: 5px;
}
.contact-info a {
  color: var(--c-label); text-decoration: none; font-weight: 600;
  transition: color 0.2s;
  border-bottom: 1px dotted rgba(136,146,204,0.35);
}
.contact-info a:hover { color: var(--c-yellow); border-bottom-color: var(--c-yellow); }

/* ══════════════════════════════════════════
   HELPERS
   ══════════════════════════════════════════ */
.hidden { display: none !important; }

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .header {
    flex-direction: column; align-items: center;
    gap: 18px; text-align: center; border-bottom: none;
  }
  .header::after { display: none; }

  .brand-lockup { flex-direction: column; gap: 10px; }
  .brand-divider { display: none; }
  .brand-text { align-items: center; }
  .app-title { font-size: 1.5rem; }

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

  .versus {
    flex-direction: row; gap: 14px;
    margin: 12px 0;
  }
  .vs-text { padding: 6px 16px; }

  .how-to-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .how-to-grid { grid-template-columns: 1fr; }
}

/* Mejora la legibilidad de las opciones en los selects */
.field select option,
.field select optgroup option {
  background-color: #0c1028;   /* mismo fondo que tus inputs */
  color: #e8ecff;              /* mismo color de texto principal */
  padding: 8px 12px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
}

/* Para los grupos de opciones (optgroup) */
.field select optgroup {
  background-color: #0c1028;
  color: #00f0ff;              /* color cyan para los encabezados de grupo */
  font-weight: bold;
}

/* Efecto hover para las opciones (solo funciona en algunos navegadores) */
.field select option:hover {
  background-color: #00f0ff20; /* resaltado sutil */
  color: #fff;
}
