/* Premios y recompensas: ruleta, códigos, catálogo, historial y resultado. Usa variables de styles.css. */

[hidden] { display: none !important; } /* hidden debe ganar a display de .field, .btn, etc. */

.sim-notice { border-color: rgba(251, 191, 36, 0.55); }
.kpi-accent strong { color: var(--cyan); }

/* Disposición: ruleta + panel lateral */
.play { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .play { grid-template-columns: 1.1fr 1fr; } }
.side { display: grid; gap: 16px; }
.side .card:hover, .code-card:hover { transform: none; }
.side h2 { font-size: 1.1rem; margin-bottom: 8px; }

/* Ruleta */
.wheel-area { display: grid; justify-items: center; gap: 16px; }
.wheel-wrap { position: relative; width: min(420px, 100%); aspect-ratio: 1; }
.wheel-wrap::before {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(47, 107, 255, 0.5), rgba(34, 211, 238, 0.5), rgba(47, 107, 255, 0.5));
  filter: blur(18px); opacity: 0.45;
}
.wheel {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 0 0 6px #0b1630, 0 0 0 8px rgba(120, 170, 255, 0.4), 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  /* Giro: desaceleración larga y suave. La duración la fija JS (y es casi 0 con reduce-motion). */
  transition: transform var(--spin-ms, 4800ms) cubic-bezier(0.12, 0.75, 0.08, 1);
  will-change: transform;
}
.wheel svg { width: 100%; height: 100%; display: block; }
.wheel-pointer {
  position: absolute; z-index: 2; left: 50%; top: -6px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #fff;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}
.wheel-wrap.landed .wheel-pointer { animation: pointer-tick 0.5s var(--ease); }
@keyframes pointer-tick { 30% { transform: translateX(-50%) translateY(-6px) rotate(-8deg); } }
.wheel-hub {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 22%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #1e3a8a, #050b1a); border: 3px solid rgba(255, 255, 255, 0.85);
  color: #fff; font-weight: 900; letter-spacing: 0.06em; font-size: clamp(0.9rem, 3.5vw, 1.3rem);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
.wheel-wrap.spinning .wheel-hub { animation: hub-glow 1s ease-in-out infinite alternate; }
@keyframes hub-glow { to { box-shadow: 0 0 26px rgba(34, 211, 238, 0.8); } }
.btn-spin { min-height: 54px; min-width: min(320px, 100%); font-size: 1.05rem; }
.btn-spin:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.spin-hint { min-height: 1.4em; color: var(--muted); font-size: 0.9rem; text-align: center; }

/* Código */
.code-card { display: grid; gap: 10px; }
.code-card input { font-family: Consolas, 'Cascadia Mono', monospace; letter-spacing: 0.08em; text-transform: uppercase; font-size: 1.05rem; }
.code-msg { min-height: 1.3em; font-weight: 600; font-size: 0.92rem; }
.code-msg:empty { min-height: 0; }
.code-msg.ok { color: var(--ok); }
.code-msg.err { color: var(--danger); }
.code-card.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.test-codes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.test-codes li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(5, 11, 26, 0.5);
}
.test-codes code { font-family: Consolas, 'Cascadia Mono', monospace; color: var(--cyan); font-size: 0.95rem; }
.test-codes small { display: block; color: var(--muted); font-size: 0.78rem; }
.code-state { font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.code-state.free { color: var(--ok); }
.code-state.used { color: var(--muted); }
.code-state.expired { color: var(--danger); }
.test-codes li.is-used code, .test-codes li.is-expired code { color: var(--muted); text-decoration: line-through; }

/* Catálogo de premios */
.lead { font-size: 0.95rem; margin-bottom: 14px; }
.prize-grid { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.prize {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(16, 32, 74, 0.55), rgba(11, 22, 48, 0.8));
}
.prize .swatch { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.prize h3 { font-size: 1rem; }
.prize p { font-size: 0.82rem; color: var(--muted); }
.prize .prob { grid-column: 1 / -1; margin-top: 6px; display: grid; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.prize .track { height: 6px; border-radius: 99px; background: rgba(120, 160, 255, 0.12); overflow: hidden; }
.prize .fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; }

/* Historial */
.history li { grid-template-columns: auto 1fr auto; }
.mv-code .mv-type { color: var(--cyan); background: rgba(34, 211, 238, 0.12); }
.mv-win .mv-type { color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.mv-lose .mv-type { color: var(--muted); background: rgba(120, 160, 255, 0.1); }
.mv-badge { font-weight: 700; font-size: 0.85rem; text-align: right; white-space: nowrap; grid-row: span 2; }
.mv-win .mv-badge { color: var(--ok); }
.mv-code .mv-badge { color: var(--cyan); }
.mv-lose .mv-badge { color: var(--muted); }

/* Resultado */
dialog.result-dlg { width: min(440px, calc(100% - 24px)); padding: 22px; }
.result { display: grid; justify-items: center; gap: 10px; text-align: center; padding-bottom: 6px; }
.result .r-icon { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; animation: pop 0.5s var(--ease); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.12); } }
.result h2 { font-size: 1.35rem; }
.result .r-prize { font-size: 1.15rem; font-weight: 800; color: var(--cyan); }
.voucher {
  width: 100%; margin-top: 4px; padding: 12px; border-radius: 12px; border: 2px dashed var(--line-strong);
  font-family: Consolas, 'Cascadia Mono', monospace; background: var(--bg-2);
}
.voucher b { display: block; font-size: 1.25rem; letter-spacing: 0.12em; color: var(--text); }
.voucher small { color: var(--muted); }
.sim-stamp {
  display: inline-block; padding: 4px 10px; border: 2px solid var(--warn); border-radius: 6px; color: var(--warn);
  font-weight: 900; font-size: 0.78rem; letter-spacing: 0.12em; transform: rotate(-3deg);
}
.result .r-note { font-size: 0.85rem; color: var(--muted); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx, 0), 105vh, 0) rotate(var(--rot, 540deg)); opacity: 0.9; } }
