/* ============================================================
   casos.css — «Casos Cerrados»: lista, preparación, resolución
   y tutorial animado. Mobile-first, respeta prefers-reduced-motion.
   ============================================================ */

.cases-page { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* ── Cabecera ── */
.cs-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.cs-head-title { font-family: var(--font-d, serif); font-size: 1.1rem; color: var(--text); font-weight: 700; }
.cs-head-sub { font-size: 0.76rem; color: var(--muted); margin-top: 0.2rem; }
.cs-help-btn {
  padding: 0.45rem 0.85rem; border-radius: 999px; cursor: pointer;
  background: rgba(34,211,238,0.1); border: 1px solid rgba(34,211,238,0.35);
  color: #22d3ee; font-size: 0.78rem; font-weight: 700;
  transition: background var(--transition, .2s);
}
.cs-help-btn:hover { background: rgba(34,211,238,0.2); }

/* ── Botones ── */
.cs-btn {
  padding: 0.6rem 1rem; border-radius: 10px; cursor: pointer;
  font-family: var(--font-u, sans-serif); font-size: 0.82rem; font-weight: 800;
  letter-spacing: 0.03em; min-height: 42px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14);
  color: var(--text); text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center;
  transition: background var(--transition, .2s), transform var(--transition, .2s);
}
.cs-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.cs-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.cs-btn.primary {
  background: linear-gradient(90deg, #22d3ee, #1a4fff);
  border-color: transparent; color: #04121a;
  box-shadow: 0 0 18px rgba(34,211,238,0.3);
}
.cs-btn.big { width: 100%; min-height: 52px; font-size: 0.95rem; }
.cs-back {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 0.8rem; padding: 0.3rem 0; margin-bottom: 0.8rem;
}
.cs-back:hover { color: var(--text); }

/* ── Lista de casos ── */
.cs-list { display: grid; gap: 0.9rem; }
.cs-case {
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 4px solid var(--cs-color, #34d399);
  border-radius: var(--radius, 14px);
  background: rgba(255,255,255,0.03);
  padding: 1rem 1.1rem;
  animation: cs-in 0.45s cubic-bezier(0.34,1.2,0.64,1) both;
}
.cs-case:nth-child(2) { animation-delay: 0.08s; }
.cs-case:nth-child(3) { animation-delay: 0.16s; }
@keyframes cs-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cs-case.done { opacity: 0.6; }
.cs-case-top { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.cs-dif {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--cs-color, #34d399);
}
.cs-done-tag { font-size: 0.7rem; font-weight: 700; color: #34d399; }
.cs-case-title {
  font-family: var(--font-d, serif); font-size: 1.05rem; font-weight: 700;
  color: var(--text); margin: 0.3rem 0 0.15rem; overflow-wrap: anywhere;
}
.cs-case-rival { font-size: 0.76rem; color: var(--muted); margin-bottom: 0.75rem; }
.cs-case-rival strong { color: var(--text); }

.cs-phases { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; }
.cs-phase-mini {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.6rem; border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--t, #22d3ee);
  font-size: 0.78rem; min-width: 0;
}
.cs-phase-mini-n {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.6rem; font-weight: 800;
  background: rgba(255,255,255,0.08); color: var(--muted);
}
.cs-phase-mini-ico { flex-shrink: 0; }
.cs-phase-mini-name {
  flex: 1; min-width: 0; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-phase-mini-val {
  flex-shrink: 0; font-weight: 800; color: var(--t, #22d3ee);
  font-variant-numeric: tabular-nums;
}
.cs-case-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.7rem; flex-wrap: wrap;
}
.cs-reward { font-size: 0.78rem; color: var(--gold); font-weight: 700; }

/* ── Briefing ── */
.cs-brief {
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 4px solid var(--cs-color, #34d399);
  border-radius: var(--radius, 14px);
  background: linear-gradient(140deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  padding: 1.1rem; margin-bottom: 1.2rem;
}
.cs-brief-dif {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--cs-color, #34d399);
}
.cs-brief-title {
  font-family: var(--font-d, serif); font-size: 1.3rem; font-weight: 800;
  color: var(--text); margin: 0.25rem 0 0.2rem; overflow-wrap: anywhere;
}
.cs-brief-rival { font-size: 0.82rem; color: var(--muted); }
.cs-brief-rival strong { color: var(--text); }
.cs-brief-help {
  font-size: 0.78rem; color: var(--muted); line-height: 1.6;
  margin: 0.7rem 0 0; padding-top: 0.7rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.cs-brief-help strong { color: var(--gold); }

/* ── Ranuras de fase ── */
.cs-slots { display: grid; gap: 0.8rem; margin-bottom: 1.3rem; }
.cs-slot {
  border: 1px solid rgba(255,255,255,0.1);
  border-top: 3px solid var(--t, #22d3ee);
  border-radius: var(--radius, 14px);
  background: rgba(255,255,255,0.03);
  padding: 0.85rem 0.9rem;
}
.cs-slot.filled { background: rgba(255,255,255,0.05); }
.cs-slot-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; margin-bottom: 0.15rem;
}
.cs-slot-n { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.cs-slot-type { font-size: 0.76rem; font-weight: 800; color: var(--t, #22d3ee); }
.cs-slot-name { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 0.7rem; overflow-wrap: anywhere; }

.cs-slot-card {
  width: 100%; min-height: 92px; cursor: pointer;
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.2);
  color: var(--text); text-align: left;
  transition: border-color var(--transition, .2s), background var(--transition, .2s);
}
.cs-slot-card:hover { border-color: var(--t, #22d3ee); background: rgba(255,255,255,0.07); }
.cs-slot.filled .cs-slot-card { border-style: solid; border-color: var(--t, #22d3ee); }
.cs-slot-img { width: 58px; height: auto; border-radius: 6px; flex-shrink: 0; }
.cs-slot-cardname { font-size: 0.85rem; font-weight: 700; overflow-wrap: anywhere; }
.cs-slot-plus {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 300;
  background: rgba(255,255,255,0.06); color: var(--muted);
}
.cs-slot-hint { font-size: 0.82rem; color: var(--muted); }

/* ── Comparativa ── */
.cs-versus {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-top: 0.7rem;
}
.cs-val { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.cs-val.rival { text-align: right; }
.cs-val-l {
  font-size: 0.64rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-val-n {
  font-family: var(--font-u, sans-serif); font-size: 1.5rem; font-weight: 800;
  color: var(--text); line-height: 1; font-variant-numeric: tabular-nums;
}
.cs-val.mine.win  .cs-val-n { color: #34d399; }
.cs-val.mine.even .cs-val-n { color: var(--gold); }
.cs-val.mine.lose .cs-val-n { color: #cc1122; }
.cs-val-bonus { font-size: 0.62rem; color: #34d399; font-weight: 700; }
.cs-vs { font-size: 0.7rem; font-weight: 800; color: var(--muted); flex-shrink: 0; }

.cs-pron {
  margin-top: 0.55rem; text-align: center; font-size: 0.72rem; font-weight: 800;
  padding: 0.3rem; border-radius: 8px; letter-spacing: 0.04em;
}
.cs-pron.win  { color: #34d399; background: rgba(52,211,153,0.12); }
.cs-pron.even { color: var(--gold); background: rgba(245,200,66,0.12); }
.cs-pron.lose { color: #ff5f6d; background: rgba(204,17,34,0.14); }

.cs-launch { text-align: center; }
.cs-launch-note { font-size: 0.74rem; color: var(--muted); margin-top: 0.55rem; }

/* ── Presupuesto de estrellas ── */
.cs-case-stars {
  display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.45rem;
  border-radius: 999px; font-size: 0.68rem; font-weight: 800;
  background: rgba(245,200,66,0.14); border: 1px solid rgba(245,200,66,0.35);
  color: var(--gold);
}
.cs-budget {
  margin: 0.9rem 0 0; padding: 0.75rem 0.8rem;
  border-radius: 12px; background: rgba(245,200,66,0.07);
  border: 1px solid rgba(245,200,66,0.3);
}
.cs-budget.over { background: rgba(204,17,34,0.1); border-color: rgba(204,17,34,0.5); }
.cs-budget-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.6rem; margin-bottom: 0.4rem;
}
.cs-budget-l { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.cs-budget-n {
  font-family: var(--font-u, sans-serif); font-size: 1.05rem; font-weight: 800;
  color: var(--gold); font-variant-numeric: tabular-nums;
}
.cs-budget.over .cs-budget-n { color: #ff5f6d; }
.cs-budget-bar {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden;
}
.cs-budget-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #34d399, var(--gold, #f5c842));
  transition: width 0.4s cubic-bezier(0.34,1.2,0.64,1);
}
.cs-budget.over .cs-budget-fill { background: #cc1122; }
.cs-budget-hint {
  font-size: 0.7rem; color: var(--muted); line-height: 1.55; margin-top: 0.5rem;
}
.cs-budget-hint strong { color: var(--text); }

.cs-slot-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.cs-slot-cost { font-size: 0.68rem; color: var(--gold); font-weight: 700; }

.cs-pick-cost {
  position: absolute; top: 0.55rem; left: 0.55rem;
  background: rgba(3,3,12,0.9); border: 1px solid rgba(245,200,66,0.5);
  border-radius: 6px; padding: 0.05rem 0.28rem;
  font-size: 0.66rem; font-weight: 800; color: var(--gold);
}
.cs-pick-val.ok { border-color: #34d399; color: #34d399; }
.cs-pick.wins { border-width: 2px; }

/* ── Selector de cartas ── */
.cs-picker-box {
  width: min(680px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--bg-glass, rgba(13,13,36,0.96));
  border: 1px solid rgba(34,211,238,0.3);
  border-radius: var(--radius, 14px);
  padding: 1.1rem 1rem; position: relative;
  -webkit-overflow-scrolling: touch;
}
.cs-picker-title {
  font-family: var(--font-d, serif); font-size: 1rem; font-weight: 700;
  color: var(--gold); padding-right: 2rem;
}
.cs-picker-sub { font-size: 0.74rem; color: var(--muted); margin: 0.2rem 0 0.9rem; }

/* ── Filtro por rareza del selector ── */
/* Se queda pegado arriba: en una colección grande sigues teniendo los
   filtros a mano sin volver al principio de la lista. */
.cs-picker-filtros {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.75rem;
  position: sticky; top: -1.1rem; z-index: 2;
  padding: 0.45rem 0 0.5rem;
  background: var(--bg-glass, rgba(13,13,36,0.96));
}
.cs-chip {
  cursor: pointer; font-family: inherit; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.04em; padding: 0.32rem 0.55rem; border-radius: 999px;
  background: rgba(255,255,255,0.05); color: var(--muted);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap; flex-shrink: 0;
}
.cs-chip b { font-weight: 800; opacity: 0.7; margin-left: 0.15rem; }
.cs-chip:hover { background: rgba(255,255,255,0.09); color: var(--text); }
.cs-chip.on {
  color: var(--r, var(--gold)); border-color: var(--r, var(--gold));
  background: rgba(255,255,255,0.09);
}
.cs-picker-more {
  font-size: 0.7rem; color: var(--muted); text-align: center;
  margin-top: 0.7rem; line-height: 1.4;
}
.cs-picker-more:empty { display: none; }

@media (prefers-reduced-motion: reduce) { .cs-chip { transition: none; } }

.cs-picker-grid {
  display: grid; gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.cs-pick {
  position: relative; cursor: pointer; padding: 0.4rem;
  border-radius: 10px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--r, #9ca3af); color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  transition: transform var(--transition, .2s), box-shadow var(--transition, .2s);
}
.cs-pick:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 0 16px var(--r, #9ca3af); }
.cs-pick img { width: 100%; height: auto; border-radius: 5px; display: block; }
.cs-pick-val {
  position: absolute; top: 0.55rem; right: 0.55rem;
  background: rgba(3,3,12,0.9); border: 1px solid var(--r);
  border-radius: 6px; padding: 0.05rem 0.3rem;
  font-size: 0.75rem; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cs-pick-name {
  font-size: 0.62rem; line-height: 1.2; text-align: center;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.cs-pick-rar { font-size: 0.58rem; color: var(--muted); font-weight: 700; }
.cs-pick.used { opacity: 0.35; cursor: not-allowed; }
.cs-pick-used {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 0.6rem; font-weight: 800; color: var(--gold);
  background: rgba(3,3,12,0.72); border-radius: 10px;
}

/* ── Resolución ── */
.cs-resolve { text-align: center; }
.cs-resolve-title {
  font-family: var(--font-d, serif); font-size: 1.1rem; color: var(--gold);
  margin-bottom: 1.2rem; overflow-wrap: anywhere;
}
.cs-rounds { display: grid; gap: 0.7rem; }
.cs-round {
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 3px solid var(--t, #22d3ee);
  border-radius: var(--radius, 14px);
  background: rgba(255,255,255,0.03);
  padding: 0.85rem 0.9rem;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34,1.2,0.64,1),
              border-color 0.35s ease, box-shadow 0.35s ease;
}
.cs-round.show { opacity: 1; transform: none; }
.cs-round.won  { border-color: #34d399; box-shadow: 0 0 20px rgba(52,211,153,0.22); }
.cs-round.lost { border-color: rgba(204,17,34,0.6); }
.cs-round-head {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.8rem; font-weight: 700; color: var(--text); margin-bottom: 0.6rem;
}
.cs-round-body { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.cs-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.cs-side.rival { text-align: right; }
.cs-side-name {
  font-size: 0.68rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-side-roll {
  font-family: var(--font-u, sans-serif); font-size: 1.7rem; font-weight: 800;
  color: var(--text); line-height: 1; font-variant-numeric: tabular-nums;
}
.cs-round.won  .cs-side.mine  .cs-side-roll { color: #34d399; }
.cs-round.lost .cs-side.rival .cs-side-roll { color: #ff5f6d; }
.cs-round-vs { font-size: 0.68rem; font-weight: 800; color: var(--muted); flex-shrink: 0; }
.cs-round-verdict {
  margin-top: 0.5rem; font-size: 0.74rem; font-weight: 800;
  opacity: 0; transform: scale(0.9); transition: opacity .3s ease, transform .3s ease;
}
.cs-round-verdict.show { opacity: 1; transform: none; }
.cs-round.won  .cs-round-verdict { color: #34d399; }
.cs-round.lost .cs-round-verdict { color: #ff5f6d; }

.cs-final {
  margin-top: 1.4rem; padding: 1.4rem 1rem; border-radius: var(--radius, 14px);
  opacity: 0; transform: scale(0.94);
  transition: opacity .5s ease, transform .5s cubic-bezier(0.34,1.4,0.64,1);
}
.cs-final.show { opacity: 1; transform: none; }
.cs-final.win  { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.4); }
.cs-final.lose { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.12); }
.cs-final-icon { font-size: 2.8rem; margin-bottom: 0.3rem; }
.cs-final.win .cs-final-icon { animation: cs-pop 0.6s cubic-bezier(0.34,1.6,0.64,1) both; }
@keyframes cs-pop { from { transform: scale(0); } 60% { transform: scale(1.25); } to { transform: scale(1); } }
.cs-final-title {
  font-family: var(--font-d, serif); font-size: 1.3rem; font-weight: 800;
  color: var(--text); letter-spacing: 0.04em;
}
.cs-final.win .cs-final-title { color: #34d399; }
.cs-final-score { font-size: 0.82rem; color: var(--muted); margin: 0.3rem 0 0.7rem; }
.cs-final-reward { font-size: 0.92rem; font-weight: 800; color: var(--gold); margin-bottom: 1rem; }
.cs-final-event {
  display: block; font-size: 0.72rem; color: #22d3ee; margin-top: 0.25rem;
}

/* ── Confeti ── */
.cs-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.cs-confetti i {
  position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px;
  animation: cs-fall 2.6s linear forwards;
}
@keyframes cs-fall {
  to { transform: translateY(105vh) rotate(680deg); opacity: 0; }
}

/* ── Vacío ── */
.cs-empty { text-align: center; padding: 3rem 1rem; }
.cs-empty-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.cs-empty-title { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.cs-empty-text { font-size: 0.84rem; color: var(--muted); margin: 0.4rem 0 1.2rem; }

/* ════════════════════════════════════════════════════════════
   TUTORIAL ANIMADO
   ════════════════════════════════════════════════════════════ */
.tut-box {
  position: relative; width: min(460px, 93vw);
  max-height: 92vh; overflow-y: auto;
  background: var(--bg-glass, rgba(13,13,36,0.97));
  border: 1px solid rgba(245,200,66,0.3);
  border-radius: var(--radius, 14px);
  padding: 1.3rem 1.1rem 1.1rem; text-align: center;
  box-shadow: 0 0 44px rgba(245,200,66,0.14);
  -webkit-overflow-scrolling: touch;
}
.tut-dots { display: flex; justify-content: center; gap: 0.35rem; margin-bottom: 1rem; }
.tut-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.18); transition: all .3s ease;
}
.tut-dot.on { width: 22px; border-radius: 999px; background: var(--gold); }

.tut-demo {
  min-height: 178px; display: grid; place-items: center;
  padding: 0.6rem 0 1rem; overflow: hidden;
}
.tut-title {
  font-family: var(--font-d, serif); font-size: 1.1rem; font-weight: 800;
  color: var(--gold); margin: 0 0 0.5rem;
}
.tut-text { font-size: 0.84rem; color: var(--muted); line-height: 1.6; margin: 0 0 1.2rem; }
.tut-nav { display: flex; gap: 0.6rem; }
.tut-nav .cs-btn { flex: 1; }

/* Paso 1 — carta y atributos */
.tut-card-demo { display: flex; align-items: center; gap: 0.9rem; width: 100%; }
.tut-card {
  width: 74px; flex-shrink: 0; border-radius: 8px; padding: 0.5rem 0.3rem;
  background: linear-gradient(160deg, rgba(26,79,255,0.3), rgba(13,13,36,0.9));
  border: 1px solid rgba(255,255,255,0.2); text-align: center;
}
.anim .tut-card { animation: tut-flip 0.7s cubic-bezier(0.34,1.3,0.64,1) both; }
@keyframes tut-flip { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tut-card-face { font-size: 1.9rem; }
.tut-card-name { font-size: 0.55rem; color: var(--muted); margin-top: 0.25rem; }
.tut-stats { flex: 1; min-width: 0; display: grid; gap: 0.4rem; }
.tut-stat {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.66rem; color: var(--text); opacity: 0;
}
.anim .tut-stat { animation: tut-slide 0.45s ease both; }
.anim .tut-stat.s1 { animation-delay: 0.25s; }
.anim .tut-stat.s2 { animation-delay: 0.45s; }
.anim .tut-stat.s3 { animation-delay: 0.65s; }
@keyframes tut-slide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.tut-stat-l { flex-shrink: 0; width: 62px; text-align: left; color: var(--muted); }
.tut-stat-bar {
  flex: 1; height: 7px; border-radius: 999px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.tut-stat-bar i { display: block; height: 100%; width: 0; border-radius: 999px; }
.tut-stat.s1 .tut-stat-bar i { background: #c084fc; }
.tut-stat.s2 .tut-stat-bar i { background: #22d3ee; }
.tut-stat.s3 .tut-stat-bar i { background: #f5c842; }
.anim .tut-stat-bar i { animation: tut-fill 0.8s cubic-bezier(0.34,1.1,0.64,1) both; }
.anim .tut-stat.s1 .tut-stat-bar i { animation-delay: 0.35s; }
.anim .tut-stat.s2 .tut-stat-bar i { animation-delay: 0.55s; }
.anim .tut-stat.s3 .tut-stat-bar i { animation-delay: 0.75s; }
@keyframes tut-fill { to { width: var(--w, 60%); } }
.tut-stat b { font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }

/* Paso 2 — fases */
.tut-phases { display: grid; gap: 0.45rem; width: 100%; }
.tut-phase {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem; border-radius: 9px;
  background: rgba(255,255,255,0.04); border-left: 3px solid;
  font-size: 0.74rem; opacity: 0;
}
.tut-phase.p1 { border-color: #c084fc; }
.tut-phase.p2 { border-color: #22d3ee; }
.tut-phase.p3 { border-color: #f5c842; }
.anim .tut-phase { animation: tut-slide 0.45s ease both; }
.anim .tut-phase.p1 { animation-delay: 0.1s; }
.anim .tut-phase.p2 { animation-delay: 0.3s; }
.anim .tut-phase.p3 { animation-delay: 0.5s; }
.tut-phase-name { flex: 1; text-align: left; color: var(--text); }
.tut-phase-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.tut-phase.p1 .tut-phase-val { color: #c084fc; }
.tut-phase.p2 .tut-phase-val { color: #22d3ee; }
.tut-phase.p3 .tut-phase-val { color: #f5c842; }

/* Paso 1 — objetivo */
.tut-goal { width: 100%; text-align: center; }
.tut-goal-row { display: flex; gap: 0.45rem; justify-content: center; }
.tut-goal-slot {
  flex: 1; padding: 0.7rem 0.3rem; border-radius: 9px; font-size: 0.7rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.18);
  color: var(--text); opacity: 0;
}
.anim .tut-goal-slot { animation: tut-slide 0.4s ease both; }
.anim .tut-goal-slot.g1 { animation-delay: 0.1s; }
.anim .tut-goal-slot.g2 { animation-delay: 0.25s; }
.anim .tut-goal-slot.g3 { animation-delay: 0.4s; }
.tut-goal-arrow { color: var(--muted); margin: 0.5rem 0 0.3rem; opacity: 0; }
.anim .tut-goal-arrow { animation: tut-slide 0.4s ease 0.6s both; }
.tut-goal-win {
  font-weight: 800; font-size: 0.86rem; color: #34d399;
  padding: 0.5rem; border-radius: 9px;
  background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.4); opacity: 0;
}
.anim .tut-goal-win { animation: tut-pop 0.5s cubic-bezier(0.34,1.5,0.64,1) 0.8s both; }

/* Paso 3 — presupuesto */
.tut-budget { width: 100%; display: grid; gap: 0.5rem; }
.tut-budget-bar {
  padding: 0.45rem; border-radius: 9px; text-align: center;
  font-size: 0.78rem; font-weight: 800; color: var(--gold);
  background: rgba(245,200,66,0.12); border: 1px solid rgba(245,200,66,0.4);
  opacity: 0;
}
.anim .tut-budget-bar { animation: tut-slide 0.4s ease both; }
.tut-budget-opt {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.5rem 0.6rem; border-radius: 9px; font-size: 0.72rem;
  background: rgba(255,255,255,0.04); border: 1px solid transparent; opacity: 0;
}
.anim .tut-budget-opt { animation: tut-slide 0.45s ease both; }
.anim .tut-budget-opt.bad  { animation-delay: 0.3s; }
.anim .tut-budget-opt.good { animation-delay: 0.6s; }
.tut-budget-opt.bad  { border-color: rgba(204,17,34,0.45); }
.tut-budget-opt.good { border-color: rgba(52,211,153,0.5); }
.tut-budget-cards { color: var(--text); font-weight: 700; }
.tut-budget-res { font-size: 0.68rem; }
.tut-budget-opt.bad  .tut-budget-res { color: #ff5f6d; }
.tut-budget-opt.good .tut-budget-res { color: #34d399; }

/* Paso 4 — asignación */
.tut-assign { display: grid; gap: 0.5rem; width: 100%; }
.tut-assign-row { display: flex; align-items: center; gap: 0.5rem; opacity: 0; }
.anim .tut-assign-row { animation: tut-slide 0.5s ease both; }
.anim .tut-assign-row.d2 { animation-delay: 0.25s; }
.anim .tut-assign-row.d3 { animation-delay: 0.5s; }
.tut-mini {
  width: 52px; flex-shrink: 0; padding: 0.35rem; border-radius: 8px;
  background: rgba(26,79,255,0.22); border: 1px solid rgba(255,255,255,0.18);
  font-size: 0.72rem; display: flex; flex-direction: column; align-items: center;
}
.tut-mini b { font-size: 0.8rem; }
.tut-arrow { color: var(--gold); font-weight: 800; flex-shrink: 0; }
.anim .tut-arrow { animation: tut-nudge 1.1s ease-in-out infinite; }
@keyframes tut-nudge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
.tut-slot {
  flex: 1; min-width: 0; padding: 0.55rem 0.6rem; border-radius: 9px;
  font-size: 0.72rem; text-align: left; color: var(--text);
  background: rgba(255,255,255,0.05); border: 1px solid rgba(52,211,153,0.45);
}

/* Paso 4 — combate */
.tut-fight { display: grid; gap: 0.4rem; width: 100%; }
.tut-fight-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.45rem 0.65rem; border-radius: 9px; font-size: 0.76rem;
  background: rgba(255,255,255,0.04); border: 1px solid transparent; opacity: 0;
  font-variant-numeric: tabular-nums;
}
.anim .tut-fight-row { animation: tut-slide 0.4s ease both; }
.anim .tut-fight-row:nth-child(1) { animation-delay: 0.1s; }
.anim .tut-fight-row:nth-child(2) { animation-delay: 0.45s; }
.anim .tut-fight-row:nth-child(3) { animation-delay: 0.8s; }
.tut-fight-row i { font-style: normal; font-size: 0.62rem; color: var(--muted); }
.tut-fight-row.won  { border-color: rgba(52,211,153,0.5); color: #34d399; }
.tut-fight-row.lost { border-color: rgba(204,17,34,0.45); color: #ff5f6d; }
.tut-fight-row b { font-size: 0.9rem; }
.tut-fight-result {
  margin-top: 0.35rem; font-weight: 800; font-size: 0.88rem; color: #34d399; opacity: 0;
}
.anim .tut-fight-result { animation: tut-pop 0.5s cubic-bezier(0.34,1.5,0.64,1) 1.2s both; }
@keyframes tut-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }

/* Paso 5 — duplicados */
.tut-dupes { display: flex; align-items: center; justify-content: center; gap: 0.8rem; width: 100%; }
.tut-dupe-stack { position: relative; width: 62px; height: 86px; flex-shrink: 0; }
.tut-dupe {
  position: absolute; inset: 0; border-radius: 7px;
  background: linear-gradient(160deg, rgba(26,79,255,0.35), rgba(13,13,36,0.95));
  border: 1px solid rgba(255,255,255,0.2);
}
.anim .tut-dupe.d1 { animation: tut-stack 0.5s ease 0.1s both; --x: -8px; --r: -8deg; }
.anim .tut-dupe.d2 { animation: tut-stack 0.5s ease 0.25s both; --x: 0px;  --r: 0deg; }
.anim .tut-dupe.d3 { animation: tut-stack 0.5s ease 0.4s both;  --x: 8px;  --r: 8deg; }
@keyframes tut-stack {
  from { opacity: 0; transform: translateX(0) rotate(0); }
  to   { opacity: 1; transform: translateX(var(--x)) rotate(var(--r)); }
}
.tut-dupe-count {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 800; color: #fff; z-index: 2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}
.tut-dupe-arrow { color: var(--gold); font-size: 1.2rem; font-weight: 800; }
.tut-dupe-bonus {
  font-size: 1.6rem; font-weight: 800; color: #34d399; line-height: 1; opacity: 0;
}
.tut-dupe-bonus span { display: block; font-size: 0.6rem; color: var(--muted); font-weight: 600; margin-top: 0.2rem; }
.anim .tut-dupe-bonus { animation: tut-pop 0.5s cubic-bezier(0.34,1.5,0.64,1) 0.7s both; }

/* ── Responsive ── */
@media (min-width: 720px) {
  .cs-slots { grid-template-columns: repeat(3, 1fr); }
  .cs-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cases-page { padding: 1rem 0.8rem 3rem; }
  .cs-brief-title { font-size: 1.1rem; }
  .cs-val-n { font-size: 1.3rem; }
  .cs-side-roll { font-size: 1.4rem; }
  .cs-picker-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .cs-case-foot .cs-btn { width: 100%; }
}
@media (max-width: 380px) {
  .cases-page { padding: 0.9rem 0.6rem 2.5rem; }
  .cs-case, .cs-brief, .cs-slot { padding: 0.8rem 0.7rem; }
  .cs-case-title { font-size: 0.95rem; }
  .cs-val-n { font-size: 1.15rem; }
  .cs-side-roll { font-size: 1.25rem; }
  .cs-picker-grid { grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
  .tut-box { padding: 1rem 0.8rem; }
  .tut-demo { min-height: 158px; }
  .tut-stat-l { width: 52px; font-size: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-case, .cs-round, .cs-final, .cs-final-icon, .cs-budget-fill,
  .anim .tut-card, .anim .tut-stat, .anim .tut-stat-bar i, .anim .tut-phase,
  .anim .tut-assign-row, .anim .tut-arrow, .anim .tut-fight-row,
  .anim .tut-fight-result, .anim .tut-dupe, .anim .tut-dupe-bonus,
  .anim .tut-goal-slot, .anim .tut-goal-arrow, .anim .tut-goal-win,
  .anim .tut-budget-bar, .anim .tut-budget-opt,
  .anim .tut-duel-you, .anim .tut-duel-hidden, .anim .tut-duel-rank {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .anim .tut-stat-bar i { width: var(--w, 60%); }
  .cs-round { opacity: 1; transform: none; transition: none; }
  .cs-final { opacity: 1; transform: none; }
  .cs-confetti { display: none; }
}

/* ════════════════════════════════════════════════════════════
   PESTAÑAS Y DUELOS
   ════════════════════════════════════════════════════════════ */
.cs-tabs {
  display: flex; gap: 0.4rem; margin-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.6rem;
}
.cs-tab {
  flex: 1; padding: 0.6rem 0.7rem; border-radius: 10px; cursor: pointer;
  font-family: var(--font-u, sans-serif); font-size: 0.84rem; font-weight: 800;
  letter-spacing: 0.02em; min-height: 44px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  transition: background var(--transition, .2s), color var(--transition, .2s);
}
.cs-tab:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.cs-tab.active {
  background: linear-gradient(90deg, rgba(34,211,238,0.18), rgba(26,79,255,0.18));
  border-color: rgba(34,211,238,0.5); color: var(--text);
  box-shadow: 0 0 16px rgba(34,211,238,0.15);
}

/* ── Cabecera de rango ── */
.dl-hero {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
  padding: 1rem 1.1rem; border-radius: var(--radius, 14px);
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 4px solid var(--dl-color, #34d399);
  background: linear-gradient(140deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}
.dl-rank-label {
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
}
.dl-rank-name {
  font-family: var(--font-d, serif); font-size: 1.35rem; font-weight: 800;
  color: var(--dl-color, #34d399); line-height: 1.15;
}
.dl-rank-pts { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-hero-right { text-align: right; }
.dl-daily { display: flex; align-items: baseline; gap: 0.35rem; justify-content: flex-end; }
.dl-daily-n {
  font-family: var(--font-u, sans-serif); font-size: 1.6rem; font-weight: 800;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.dl-daily-l { font-size: 0.68rem; color: var(--muted); }
.dl-daily-extra { font-size: 0.68rem; color: var(--gold); margin-top: 0.2rem; }

.dl-explain {
  font-size: 0.78rem; color: var(--muted); line-height: 1.6;
  padding: 0.75rem 0.85rem; margin-bottom: 1rem;
  border-radius: 12px; background: rgba(34,211,238,0.06);
  border: 1px solid rgba(34,211,238,0.22);
}
.dl-explain strong { color: #22d3ee; }

/* ── Puestos del equipo ── */
.dl-slots { display: grid; gap: 0.7rem; margin: 1rem 0 1.3rem; }
.dl-slot {
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius, 14px);
  background: rgba(255,255,255,0.03); padding: 0.8rem 0.85rem;
}
.dl-slot.filled { background: rgba(255,255,255,0.05); border-color: rgba(34,211,238,0.35); }
.dl-slot-n {
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem;
}
.dl-attrs {
  display: flex; justify-content: space-around; gap: 0.4rem; margin-top: 0.6rem;
  font-size: 0.76rem; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dl-attrs.empty { color: var(--muted); opacity: 0.5; }

/* ── Cabecera del duelo ── */
.dl-vs-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; margin-bottom: 1.2rem; padding: 0.8rem 1rem;
  border-radius: var(--radius, 14px);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
}
.dl-vs-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.dl-vs-side:last-child { text-align: right; }
.dl-vs-name {
  font-weight: 800; font-size: 0.92rem; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-vs-rank { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-vs-x { font-family: var(--font-d, serif); font-weight: 800; color: var(--gold); flex-shrink: 0; }

.dl-rank-change {
  font-size: 0.9rem; font-weight: 800; margin-bottom: 0.6rem;
  font-variant-numeric: tabular-nums;
}
.dl-rank-change.up   { color: #34d399; }
.dl-rank-change.down { color: #ff5f6d; }
.dl-rank-new { display: block; font-size: 0.74rem; margin-top: 0.15rem; }

/* ── Clasificación ── */
.dl-board { margin-top: 1.8rem; }
.dl-board-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.6rem; margin-bottom: 0.6rem;
}
.dl-board-title { font-family: var(--font-d, serif); font-size: 0.98rem; color: var(--text); font-weight: 700; }
.dl-board-sub { font-size: 0.76rem; font-weight: 800; }
.dl-board-list { display: grid; gap: 0.35rem; }
.dl-board-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.7rem; border-radius: 9px;
  background: rgba(255,255,255,0.03); font-size: 0.8rem;
}
.dl-board-row.me {
  background: rgba(245,200,66,0.1); border: 1px solid rgba(245,200,66,0.35);
}
.dl-board-pos { width: 26px; flex-shrink: 0; font-weight: 800; color: var(--muted); }
.dl-board-name {
  flex: 1; min-width: 0; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-board-name b { color: var(--gold); font-size: 0.66rem; margin-left: 0.3rem; }
.dl-board-pts {
  flex-shrink: 0; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums;
}
.dl-board-empty {
  font-size: 0.8rem; color: var(--muted); text-align: center;
  padding: 1.4rem 1rem; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.15);
}

@media (min-width: 720px) {
  .dl-slots { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .dl-hero { padding: 0.85rem 0.9rem; }
  .dl-rank-name { font-size: 1.15rem; }
  .dl-daily-n { font-size: 1.35rem; }
  .cs-tab { font-size: 0.76rem; padding: 0.55rem 0.4rem; }
}
@media (max-width: 380px) {
  .dl-hero { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .dl-hero-right { text-align: left; }
  .dl-daily { justify-content: flex-start; }
  .dl-attrs { font-size: 0.7rem; }
  .cs-tab { font-size: 0.7rem; letter-spacing: 0; }
}

/* Paso 7 del tutorial — duelos */
.tut-duel { width: 100%; text-align: center; }
.tut-duel-row {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.tut-duel-you, .tut-duel-hidden {
  flex: 1; padding: 0.75rem 0.4rem; border-radius: 10px;
  font-size: 0.74rem; font-weight: 800; opacity: 0;
}
.tut-duel-you {
  background: rgba(34,211,238,0.14); border: 1px solid rgba(34,211,238,0.45); color: #22d3ee;
}
.tut-duel-hidden {
  background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.3);
  color: var(--muted); letter-spacing: 0.3em;
}
.anim .tut-duel-you    { animation: tut-slide 0.45s ease 0.1s both; }
.anim .tut-duel-hidden { animation: tut-slide 0.45s ease 0.3s both; }
.tut-duel-vs { font-weight: 800; color: var(--gold); flex-shrink: 0; }
.tut-duel-note { font-size: 0.68rem; color: var(--muted); margin-bottom: 0.5rem; }
.tut-duel-rank {
  font-weight: 800; font-size: 0.88rem; color: #34d399; opacity: 0;
}
.anim .tut-duel-rank { animation: tut-pop 0.5s cubic-bezier(0.34,1.5,0.64,1) 0.7s both; }
