:root {
  --bg: #08152e;
  --bg2: #0b1d3f;
  --card: #0f2755;
  --card-hi: #14336e;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eaf1ff;
  --muted: #9db2d8;
  --accent: #4fa3ff;
  --accent2: #7fd3ff;
  --good: #46d19e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #14346e 0%, rgba(20, 52, 110, 0) 60%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.hero { text-align: center; margin-bottom: 40px; }

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 0 auto 22px;
  flex-wrap: wrap;
}
.logo {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
}
.logo-actualidad {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.collab-x {
  font-size: 22px;
  font-weight: 300;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(24px, 4.2vw, 40px);
  line-height: 1.18;
  font-weight: 800;
  margin: 0 auto 16px;
  max-width: 820px;
  letter-spacing: -0.02em;
}

.sub {
  color: var(--muted);
  font-size: 16px;
  margin: 0 auto;
  max-width: 560px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.card {
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}
.card.rated {
  border-color: rgba(79,163,255,0.7);
  box-shadow: 0 0 0 1px rgba(79,163,255,0.5), 0 0 18px rgba(79,163,255,0.35);
}
.card.skipped { opacity: 0.6; }

.card-top { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: #1b3a72;
  border: 2px solid rgba(127,211,255,0.35);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent2);
  font-size: 20px;
}

.who { min-width: 0; flex: 1; }
.name { font-weight: 700; font-size: 17px; margin: 0; line-height: 1.2; }
.role { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.party {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent2);
  background: rgba(79,163,255,0.12);
  border: 1px solid rgba(79,163,255,0.25);
  padding: 2px 8px;
  border-radius: 999px;
}

.score-badge {
  flex: 0 0 auto;
  width: 74px;
  text-align: center;
  background: rgba(0,0,0,0.28);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card.rated .score-badge { background: rgba(79,163,255,0.18); }
.score-num {
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  color: var(--accent2);
}
.score-word {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.slider-wrap { display: flex; flex-direction: column; gap: 4px; }
.scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  padding: 0 2px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--fill, 50%), rgba(255,255,255,0.14) var(--fill, 50%));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  cursor: pointer;
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent2); outline-offset: 4px; }

.unknown {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.unknown:hover { border-color: var(--accent); color: var(--accent2); }
.unknown.active { background: rgba(255,255,255,0.12); color: var(--text); border-color: var(--muted); }

.sticky-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 -20px -80px;
  padding: 12px 20px 16px;
  background: rgba(8, 21, 46, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f7fe0, #7fd3ff);
  transition: width 0.3s ease;
}
.sticky-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1040px;
  margin: 0 auto;
}
.progress-text { color: var(--muted); font-size: 14px; font-weight: 500; }
.sticky-actions { display: flex; gap: 10px; }

.rank {
  flex: 0 0 auto;
  width: 26px;
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}

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

.btn-primary, .btn-ghost {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn-primary {
  background: linear-gradient(180deg, #4fa3ff, #2f7fe0);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent2); }

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  background: #25d366;
  color: #06331a;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn-whatsapp:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-whatsapp svg { flex: 0 0 auto; }

.share-invite {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.msg { text-align: center; margin-top: 18px; min-height: 22px; font-size: 15px; }
.msg.err { color: #ff8a8a; }
.msg.ok { color: var(--good); }

.results-head { text-align: center; margin-bottom: 26px; }
.results-head h2 { font-size: 26px; margin: 0 0 6px; font-weight: 800; }
.voters { color: var(--muted); margin: 0; font-size: 14px; }

.results { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }

.res-row {
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.res-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.res-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: #1b3a72; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; color: var(--accent2); font-size: 15px;
  border: 2px solid rgba(127,211,255,0.3);
}
.res-name { font-weight: 700; font-size: 16px; }
.res-meta { color: var(--muted); font-size: 12px; }
.res-score {
  margin-left: auto;
  text-align: right;
}
.res-avg { font-size: 22px; font-weight: 800; color: var(--accent2); }
.res-count { font-size: 12px; color: var(--muted); }

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f7fe0, #7fd3ff);
  transition: width 0.6s ease;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 50px;
  opacity: 0.8;
}
.foot .credit {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  opacity: 0.9;
}

.instructions {
  background: rgba(79,163,255,0.08);
  border: 1px solid rgba(79,163,255,0.22);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.instr-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.instr-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
.instr-list li { margin-bottom: 4px; }
.instr-note {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 10px 12px;
}

.my-vote {
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 1px solid rgba(79,163,255,0.4);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 26px;
}
.myvote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.myvote-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.myvote-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 18px;
}
.myvote-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.myvote-item b { color: var(--accent2); font-size: 16px; }

@media (max-width: 640px) {
  .wrap { padding: 32px 14px 60px; }
  .grid { grid-template-columns: 1fr; }
  .sticky-actions .btn-ghost, .sticky-actions .btn-primary { padding: 12px 16px; font-size: 15px; }
  .hero h1 { font-size: 22px; }
  .myvote-list { grid-template-columns: 1fr; }
  .brand { gap: 16px; }
  .logo { max-width: 150px; }
  .name { font-size: 16px; }
  .score-num { font-size: 24px; }
}
