/* =========================================================
   Ruleta de nombres — estilos
   ========================================================= */

:root {
  --bg: #070b16;
  --bg-soft: #0c1222;
  --panel: rgba(17, 25, 45, 0.78);
  --panel-solid: #111a2c;
  --panel-inset: rgba(7, 12, 24, 0.72);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2ff;
  --muted: #95a1bd;
  --muted-soft: #6f7c99;
  --accent: #ffd166;
  --accent-2: #ff8a5c;
  --accent-soft: rgba(255, 209, 102, 0.13);
  --violet: #7c8cff;
  --violet-soft: rgba(124, 140, 255, 0.14);
  --mint: #2ee6a8;
  --danger: #ff6b81;
  --danger-soft: rgba(255, 107, 129, 0.13);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-panel: 0 30px 70px -40px rgba(0, 0, 0, 0.95), 0 2px 0 rgba(255, 255, 255, 0.03) inset;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  color-scheme: dark;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(255, 209, 102, 0.28);
  color: #fff;
}

h1, h2, h3, p {
  margin: 0;
}

button,
textarea {
  font: inherit;
  color: inherit;
}

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

button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Fondo ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #111b33 0%, #0a1020 48%, #060a13 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  will-change: transform;
}

.orb-a {
  width: 46vw;
  height: 46vw;
  min-width: 380px;
  min-height: 380px;
  top: -14vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(255, 138, 92, 0.28), transparent 68%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.orb-b {
  width: 42vw;
  height: 42vw;
  min-width: 340px;
  min-height: 340px;
  bottom: -16vw;
  right: -8vw;
  background: radial-gradient(circle, rgba(124, 140, 255, 0.24), transparent 68%);
  animation: drift-b 30s ease-in-out infinite alternate;
}

.orb-c {
  width: 34vw;
  height: 34vw;
  min-width: 280px;
  min-height: 280px;
  top: 34%;
  left: 44%;
  background: radial-gradient(circle, rgba(46, 230, 168, 0.12), transparent 70%);
  animation: drift-c 22s ease-in-out infinite alternate;
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 30%, #000 0%, transparent 100%);
}

@keyframes drift-a {
  to { transform: translate(6vw, 4vh) scale(1.08); }
}
@keyframes drift-b {
  to { transform: translate(-5vw, -4vh) scale(1.1); }
}
@keyframes drift-c {
  to { transform: translate(-4vw, 5vh) scale(0.94); }
}

/* ---------- Cabecera ---------- */

.topbar {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 32px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

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

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    #ffd166 0 55deg,
    #ff8a5c 0 110deg,
    #ef476f 0 165deg,
    #9b6bff 0 220deg,
    #4cc9f0 0 275deg,
    #2ec4b6 0 330deg,
    #ffd166 0
  );
  box-shadow:
    0 14px 34px -10px rgba(255, 150, 80, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  animation: mark-spin 38s linear infinite;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #0a0f1d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff4d2;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.9);
}

@keyframes mark-spin {
  to { transform: rotate(360deg); }
}

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

.brand h1 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand p {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(46, 230, 168, 0.45);
  animation: pulse 2.4s ease-out infinite;
}

.session-pill.is-complete .pulse-dot {
  background: var(--accent);
  animation: none;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.7);
}

.session-pill.is-empty .pulse-dot {
  background: var(--muted-soft);
  animation: none;
  box-shadow: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 230, 168, 0.4); }
  70% { box-shadow: 0 0 0 7px rgba(46, 230, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 230, 168, 0); }
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--stroke);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--stroke-strong);
}

.btn-primary {
  background: linear-gradient(135deg, #ffe6a6 0%, #ffd166 45%, #ff9a5f 100%);
  color: #241605;
  box-shadow: 0 14px 30px -12px rgba(255, 160, 80, 0.65);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-soft {
  background: var(--violet-soft);
  border-color: rgba(124, 140, 255, 0.22);
  color: #cdd5ff;
}

.btn-soft:hover:not(:disabled) {
  background: rgba(124, 140, 255, 0.22);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 11.5px;
  gap: 6px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--stroke-strong);
}

.sound-btn[aria-pressed="false"] {
  color: var(--muted-soft);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.link-btn:hover {
  color: #ffe3a1;
}

.link-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Layout ---------- */

.layout {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 10px 32px 36px;
  display: grid;
  grid-template-columns: minmax(300px, 348px) minmax(0, 1fr) minmax(300px, 348px);
  grid-template-areas:
    "participants wheel results"
    "saved wheel results";
  align-items: start;
  gap: 24px;
  flex: 1;
}

.panel-participants { grid-area: participants; }
.panel-saved { grid-area: saved; scroll-margin-top: 20px; }
.wheel-area { grid-area: wheel; align-self: start; }
.panel-results { grid-area: results; align-self: stretch; }

/* ---------- Paneles ---------- */

.panel {
  position: relative;
  padding: 22px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(22, 31, 53, 0.86) 0%, rgba(11, 17, 31, 0.93) 100%);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(18px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 32%);
  mask-image: linear-gradient(#000, transparent 45%);
  -webkit-mask-image: linear-gradient(#000, transparent 45%);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.panel-sub {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.count-badge {
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Participantes ---------- */

.textarea-wrap {
  position: relative;
}

#namesInput {
  display: block;
  width: 100%;
  min-height: 238px;
  max-height: 420px;
  padding: 14px 16px;
  resize: vertical;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(5, 9, 18, 0.72), rgba(9, 14, 26, 0.55));
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: 13.5px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#namesInput::placeholder {
  color: rgba(149, 161, 189, 0.45);
}

#namesInput:hover {
  border-color: var(--stroke-strong);
}

#namesInput:focus {
  border-color: rgba(255, 209, 102, 0.5);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 209, 102, 0.09);
}

#namesInput[readonly] {
  opacity: 0.6;
  cursor: progress;
}

.input-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.input-help {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-soft);
}

.input-help.is-warn {
  color: #ffc48a;
}

.saved-jump {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease;
}

.saved-jump:hover {
  color: var(--accent);
}

.saved-jump svg {
  width: 15px;
  height: 15px;
}

.panel-saved .panel-head {
  margin-bottom: 14px;
}

.panel-saved .panel-head h2 {
  font-size: 16px;
}

.saved-note {
  margin-top: 12px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--muted-soft);
}

.slot-counter {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.slot.is-filled {
  background:
    linear-gradient(135deg, rgba(124, 140, 255, 0.08), rgba(46, 230, 168, 0.035));
  border-color: rgba(255, 255, 255, 0.1);
}

.slot.is-empty {
  border-style: dashed;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.slot.is-empty:hover:not(:disabled) {
  border-color: rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.05);
  color: var(--text);
}

.slot.is-empty:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slot-num {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
}

.slot.is-filled .slot-num {
  border-color: rgba(255, 209, 102, 0.2);
  background: var(--accent-soft);
  color: var(--accent);
}

.slot-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slot-info strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-info span {
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--muted-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-plus {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
}

.slot-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.slot-actions .icon-btn {
  width: 28px;
  height: 28px;
  border-color: transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.slot-actions .icon-btn svg {
  width: 15px;
  height: 15px;
}

.slot-actions .icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.slot-actions .icon-btn.is-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}

.slot-actions .icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Ruleta ---------- */

.wheel-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding-top: 6px;
}

.wheel-stage {
  position: relative;
  width: min(100%, 610px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin: 10px auto 0;
  isolation: isolate;
}

.wheel-glow {
  position: absolute;
  inset: 6%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 170, 90, 0.17) 0%, rgba(255, 138, 92, 0.06) 42%, transparent 68%);
  filter: blur(34px);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#wheelCanvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 34px 48px rgba(0, 0, 0, 0.48));
}

.pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  z-index: 4;
  width: 38px;
  height: 58px;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.pointer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(145deg, #fff0bd 0%, #ffd166 42%, #ff8a5c 100%);
  box-shadow:
    inset 0 0 0 3px rgba(12, 18, 32, 0.28),
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    0 0 22px rgba(255, 170, 90, 0.45);
}

.pointer::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 26px solid #ff9a5f;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.3));
}

.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: clamp(88px, 19%, 116px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 32% 24%, #fff6d6 0%, #ffe49a 26%, #ffd166 54%, #ffa15f 100%);
  color: #2a1905;
  font-family: var(--font-display);
  font-size: clamp(12px, 1.35vw, 15px);
  font-weight: 700;
  letter-spacing: 0.09em;
  cursor: pointer;
  box-shadow:
    0 0 0 5px rgba(8, 13, 26, 0.96),
    0 0 0 7px rgba(255, 255, 255, 0.07),
    0 20px 40px -12px rgba(255, 150, 80, 0.6),
    0 0 36px rgba(255, 180, 90, 0.22),
    inset 0 -7px 14px rgba(170, 76, 0, 0.26),
    inset 0 3px 6px rgba(255, 255, 255, 0.55);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease, opacity 0.2s ease;
}

.spin-btn::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px dashed rgba(75, 38, 0, 0.28);
  pointer-events: none;
}

.spin-btn:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.045);
  filter: brightness(1.03);
}

.spin-btn:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.965);
}

.spin-btn:disabled {
  cursor: not-allowed;
  filter: saturate(0.45) brightness(0.72);
  opacity: 0.8;
}

.wheel-stage.is-spinning .spin-btn {
  filter: saturate(0.7) brightness(0.85);
}

.wheel-stage.is-spinning .pointer {
  animation: pointer-buzz 0.16s linear infinite;
}

@keyframes pointer-buzz {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-2.5deg); }
  75% { transform: translateX(-50%) rotate(2.5deg); }
}

.wheel-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 15px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(17, 25, 45, 0.68);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  text-align: center;
  backdrop-filter: blur(12px);
}

.hint-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.8);
}

.wheel-hint.is-empty .hint-dot {
  background: var(--muted-soft);
  box-shadow: none;
}

.wheel-hint.is-spinning .hint-dot {
  background: var(--accent-2);
  animation: hint-blink 0.7s ease-in-out infinite alternate;
}

.wheel-hint.is-done .hint-dot {
  background: var(--mint);
  box-shadow: 0 0 8px rgba(46, 230, 168, 0.7);
}

@keyframes hint-blink {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

/* ---------- Resultados ---------- */

.panel-results {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.winners-scroll {
  flex: 1;
  min-height: 230px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}

.winners-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.winner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.028);
}

.winner-item.is-new {
  animation: winner-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes winner-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.winner-item:first-child {
  border-color: rgba(255, 209, 102, 0.16);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.115), rgba(255, 138, 92, 0.04));
}

.winner-rank {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe6a8, #ffd166);
  color: #241605;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
}

.winner-item:nth-child(2) .winner-rank {
  background: linear-gradient(145deg, #eef3ff, #b9c6dd);
  color: #1a2233;
}

.winner-item:nth-child(3) .winner-rank {
  background: linear-gradient(145deg, #ffc7a4, #e79a6d);
  color: #2a1608;
}

.winner-item:nth-child(n + 4) .winner-rank {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.winner-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.winner-item:first-child .winner-name {
  font-weight: 600;
}

.winner-check {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(46, 230, 168, 0.12);
  color: var(--mint);
}

.winner-check svg {
  width: 11px;
  height: 11px;
}

.empty-winners {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 34px 12px 28px;
}

.empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  color: var(--accent);
  margin-bottom: 2px;
}

.empty-icon svg {
  width: 22px;
  height: 22px;
}

.empty-winners p {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
}

.empty-winners span {
  max-width: 210px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-soft);
}

.progress-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.028);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 11.5px;
  color: var(--muted);
}

.progress-row strong {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd166, #ff8a5c 60%, #ff6b81);
  box-shadow: 0 0 12px rgba(255, 160, 90, 0.5);
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.remaining-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--muted-soft);
}

/* ---------- Pie ---------- */

.footer {
  padding: 4px 24px 26px;
  text-align: center;
}

.footer p {
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: rgba(149, 161, 189, 0.55);
}

/* ---------- Aviso flotante ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(21, 30, 50, 0.96);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Modal ganador ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 7, 15, 0.76);
  backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.overlay.is-open {
  opacity: 1;
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.winner-card {
  position: relative;
  z-index: 2;
  width: min(490px, 100%);
  padding: 48px 34px 34px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 209, 102, 0.18), transparent 46%),
    linear-gradient(180deg, #1a2339 0%, #0d1424 100%);
  box-shadow:
    0 50px 120px -30px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 209, 102, 0.05) inset;
  text-align: center;
  overflow: hidden;
  transform: translateY(18px) scale(0.96);
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay.is-open .winner-card {
  transform: translateY(0) scale(1);
}

.winner-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.85), transparent);
}

.winner-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  width: 280px;
  height: 220px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 100, 0.22), transparent 68%);
  filter: blur(22px);
  pointer-events: none;
}

.winner-eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  background: rgba(255, 209, 102, 0.09);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.winner-eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.9);
}

#winnerName {
  position: relative;
  margin: 20px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 62px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, #ffffff 20%, #ffe3a3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 12px 40px rgba(255, 209, 102, 0.18);
}

.winner-msg {
  position: relative;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.winner-actions {
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.winner-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Scroll ---------- */

.winners-scroll::-webkit-scrollbar {
  width: 5px;
}

.winners-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.winners-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.winners-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- Adaptación ---------- */

@media (max-width: 1260px) {
  .layout {
    max-width: 1060px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 1.05fr);
    grid-template-areas:
      "participants wheel"
      "results saved";
  }

  .panel-results {
    min-height: 0;
  }

  .winners-scroll {
    max-height: 300px;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 20px 20px 10px;
  }

  .layout {
    padding: 8px 20px 28px;
  }
}

@media (max-width: 760px) {
  .layout {
    max-width: 680px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "participants"
      "wheel"
      "results"
      "saved";
    gap: 18px;
  }

  .saved-jump {
    display: inline-flex;
  }

  .wheel-stage {
    width: min(100%, 540px);
  }

  .panel-results {
    min-height: 0;
  }

  .winners-scroll {
    max-height: 320px;
  }

  .footer {
    padding-bottom: 22px;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 14px;
    padding: 18px 16px 8px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .brand-mark::before {
    inset: 7px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    font-size: 11px;
  }

  .session-pill {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .topbar-actions .btn-ghost {
    padding: 9px 12px;
  }

  .layout {
    padding: 8px 14px 24px;
    gap: 16px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  #namesInput {
    min-height: 190px;
    font-size: 16px;
    line-height: 1.75;
  }

  .wheel-stage {
    width: calc(100% - 8px);
  }

  .spin-btn {
    width: clamp(82px, 22%, 100px);
    box-shadow:
      0 0 0 4px rgba(8, 13, 26, 0.96),
      0 0 0 6px rgba(255, 255, 255, 0.07),
      0 16px 32px -10px rgba(255, 150, 80, 0.55),
      inset 0 -6px 12px rgba(170, 76, 0, 0.26),
      inset 0 2px 5px rgba(255, 255, 255, 0.5);
  }

  .pointer {
    width: 32px;
    height: 50px;
  }

  .pointer::before {
    width: 28px;
    height: 28px;
  }

  .pointer::after {
    top: 23px;
    border-left-width: 9px;
    border-right-width: 9px;
    border-top-width: 22px;
  }

  .wheel-hint {
    margin-top: 16px;
    font-size: 10.5px;
    padding: 7px 12px;
  }

  .panel-head h2 {
    font-size: 17px;
  }

  .winner-card {
    padding: 44px 22px 28px;
    border-radius: 26px;
  }

  #winnerName {
    font-size: clamp(34px, 10vw, 48px);
  }
}

@media (max-width: 380px) {
  .brand-text p {
    display: none;
  }

  .topbar-actions .btn-ghost span {
    display: none;
  }

  .topbar-actions .btn-ghost {
    width: 38px;
    height: 38px;
    padding: 0;
  }

  #namesInput {
    min-height: 170px;
  }
}

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .brand-mark {
    animation: none;
  }

  .overlay,
  .winner-card {
    transition: none;
  }
}

