/* ==========================================================================
   10. CONTAINED STEP-BY-STEP "HOW TO PLAY" SLIDE DECK (#rulesModal)
   ========================================================================== */
#rulesModal > .rules-card {
  gap: 8px;
  padding: 12px 18px;
  overflow: hidden;
}

.rules-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

#rulesModalTitle {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.2;
}

.rules-mode-banner {
  background: rgba(229, 169, 60, 0.12);
  border: 1px solid rgba(229, 169, 60, 0.55);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  text-align: center;
  flex-shrink: 0;
}

.rules-mode-banner.eternal {
  background: rgba(155, 81, 224, 0.15);
  border-color: #9b51e0;
}

.rules-slide-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rules-slide-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  background: var(--primary-950);
  border: 1px solid var(--primary-700);
  border-radius: 12px;
  padding: 14px 16px;
  box-sizing: border-box;
}

.rules-slide-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.rules-step-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.rules-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #181210;
  font-weight: 900;
  font-size: 0.74rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rules-slide-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
}

.rules-slide-desc {
  margin: 0;
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.48;
}

.rules-slide-desc b {
  color: var(--text);
}

/* Synced Phase-Highlighting Callout Chips */
.rules-hl-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.rules-hl-chip {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary-900);
  border: 1px solid var(--primary-700);
  color: rgba(247, 239, 230, 0.68);
  white-space: nowrap;
}

/* Step 1 (3.6s loop) synced chip highlights */
.rules-hl-chip.hl-step-a1 {
  animation: hlChipA1 3.6s infinite ease-in-out;
}

.rules-hl-chip.hl-step-a2 {
  animation: hlChipA2 3.6s infinite ease-in-out;
}

.rules-hl-chip.hl-step-a3 {
  animation: hlChipA3 3.6s infinite ease-in-out;
}

@keyframes hlChipA1 {

  0%,
  24% {
    border-color: var(--accent);
    background: rgba(229, 169, 60, 0.2);
    color: #fff;
    box-shadow: 0 0 8px rgba(229, 169, 60, 0.35);
  }

  30%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
    box-shadow: none;
  }
}

@keyframes hlChipA2 {

  0%,
  20%,
  56%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
    box-shadow: none;
  }

  25%,
  50% {
    border-color: var(--accent);
    background: rgba(229, 169, 60, 0.2);
    color: #fff;
    box-shadow: 0 0 8px rgba(229, 169, 60, 0.35);
  }
}

@keyframes hlChipA3 {

  0%,
  48%,
  92%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
    box-shadow: none;
  }

  54%,
  86% {
    border-color: #5ce68b;
    background: rgba(60, 168, 97, 0.22);
    color: #fff;
    box-shadow: 0 0 8px rgba(92, 230, 139, 0.35);
  }
}

/* Step 2 Daily (4.4s loop) & Eternal (4.8s loop) synced chip highlights */
.rules-hl-chip.hl-step-b1 {
  animation: hlChipB1 4.4s infinite ease-in-out;
}

.rules-hl-chip.hl-step-b2 {
  animation: hlChipB2 4.4s infinite ease-in-out;
}

.rules-hl-chip.hl-step-e1 {
  animation: hlChipE1 4.8s infinite ease-in-out;
}

.rules-hl-chip.hl-step-e2 {
  animation: hlChipE2 4.8s infinite ease-in-out;
}

.rules-hl-chip.hl-step-e3 {
  animation: hlChipE3 4.8s infinite ease-in-out;
}

@keyframes hlChipB1 {

  0%,
  38% {
    border-color: var(--accent);
    background: rgba(229, 169, 60, 0.2);
    color: #fff;
  }

  46%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }
}

@keyframes hlChipB2 {

  0%,
  44%,
  90%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }

  50%,
  84% {
    border-color: #5ce68b;
    background: rgba(60, 168, 97, 0.22);
    color: #fff;
  }
}

@keyframes hlChipE1 {

  0%,
  34% {
    border-color: var(--accent);
    background: rgba(229, 169, 60, 0.2);
    color: #fff;
  }

  40%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }
}

@keyframes hlChipE2 {

  0%,
  38%,
  64%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }

  42%,
  58% {
    border-color: #5ce68b;
    background: rgba(60, 168, 97, 0.22);
    color: #fff;
  }
}

@keyframes hlChipE3 {

  0%,
  58%,
  94%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }

  64%,
  89% {
    border-color: var(--accent);
    background: rgba(229, 169, 60, 0.2);
    color: #fff;
  }
}

/* Step 3 Token (3.4s loop) synced chip highlights */
.rules-hl-chip.hl-step-c1 {
  animation: hlChipC1 3.4s infinite ease-in-out;
}

.rules-hl-chip.hl-step-c2 {
  animation: hlChipC2 3.4s infinite ease-in-out;
}

@keyframes hlChipC1 {

  0%,
  32% {
    border-color: var(--accent);
    background: rgba(229, 169, 60, 0.2);
    color: #fff;
  }

  38%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }
}

@keyframes hlChipC2 {

  0%,
  34%,
  80%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }

  40%,
  75% {
    border-color: #5ce68b;
    background: rgba(60, 168, 97, 0.22);
    color: #fff;
  }
}

/* Step 4 Cascade (4.6s loop) synced chip highlights */
.rules-hl-chip.hl-step-d1 {
  animation: hlChipD1 4.6s infinite ease-in-out;
}

.rules-hl-chip.hl-step-d2 {
  animation: hlChipD2 4.6s infinite ease-in-out;
}

.rules-hl-chip.hl-step-d3 {
  animation: hlChipD3 4.6s infinite ease-in-out;
}

@keyframes hlChipD1 {

  0%,
  24% {
    border-color: var(--accent);
    background: rgba(229, 169, 60, 0.2);
    color: #fff;
  }

  30%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }
}

@keyframes hlChipD2 {

  0%,
  24%,
  62%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }

  28%,
  56% {
    border-color: var(--danger);
    background: rgba(255, 107, 107, 0.2);
    color: #fff;
  }
}

@keyframes hlChipD3 {

  0%,
  60%,
  94%,
  100% {
    border-color: var(--primary-700);
    background: var(--primary-900);
    color: rgba(247, 239, 230, 0.6);
  }

  65%,
  89% {
    border-color: #5ce68b;
    background: rgba(60, 168, 97, 0.22);
    color: #fff;
  }
}

/* Right-Column Visual Example Stage */
.rules-visual-box {
  background: var(--primary-900);
  border: 1px solid var(--primary-800);
  border-radius: 10px;
  padding: 14px 12px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
  min-height: 178px;
}

.vis-stage-scaler {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  transform: scale(1.18);
  transform-origin: center center;
}

.vis-stage-scaler.vis-token-stage-scale {
  transform: scale(1.32);
}

.vis-stage-scaler.vis-cascade-scaler {
  transform: scale(1.25);
}

.vis-caption {
  width: 100%;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--muted);
  background: rgba(20, 14, 29, 0.55);
  border-radius: 6px;
  padding: 5px 8px;
  box-sizing: border-box;
}

/* Prev / Step Dots / Next Footer Bar (3-column 1fr auto 1fr locks 1-5 dots dead-center!) */
.rules-nav-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--primary-700);
  flex-shrink: 0;
}

#rulesPrevBtn {
  justify-self: start;
}

#rulesNextBtn {
  justify-self: end;
}

.rules-nav-btn {
  min-width: 112px;
  padding: 8px 14px;
  font-size: 0.78rem;
  gap: 5px;
}

.rules-nav-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.rules-step-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rules-dot-btn {
  touch-action: manipulation;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--primary-700);
  background: var(--primary-950);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.rules-dot-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.rules-dot-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-950);
  box-shadow: 0 0 10px rgba(229, 169, 60, 0.45);
}

/* Visual Diagram Sub-Elements & Synced Component Spotlights */
.vis-mini-tile {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.vis-mini-empty {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary-950);
  border: 1px solid var(--primary-800);
  box-sizing: border-box;
}

.vis-track-demo {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 16px 10px 4px 10px;
}

.vis-draw-tray {
  position: relative;
  display: flex;
  gap: 5px;
  align-items: center;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--primary-700);
  border-radius: 8px;
  padding: 0 4px;
  height: 28px;
  box-sizing: content-box;
  z-index: 5;
}

.anim-tray-focus {
  animation: ruleTrayFocusGlow 3.6s infinite ease-in-out;
}

@keyframes ruleTrayFocusGlow {

  0%,
  24% {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(229, 169, 60, 0.45);
  }

  32%,
  100% {
    border-color: var(--primary-700);
    box-shadow: none;
  }
}

.anim-entry-focus {
  animation: ruleEntryFocusGlow 3.6s infinite ease-in-out;
}

@keyframes ruleEntryFocusGlow {

  0%,
  18%,
  58%,
  100% {
    border-style: dotted;
    border-color: var(--primary-700);
    background: var(--primary-950);
    color: var(--muted);
    box-shadow: none;
  }

  24%,
  50% {
    border-style: solid;
    border-color: var(--accent);
    background: var(--accent);
    color: var(--primary-950);
    box-shadow: 0 0 10px rgba(229, 169, 60, 0.65);
  }
}

.vis-draw-title {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}

.vis-draw-slot-wrap {
  position: relative;
  width: 28px;
  height: 28px;
}

.vis-draw-slot-wrap .vis-mini-empty,
.vis-draw-slot-wrap .vis-mini-tile {
  position: absolute;
  left: 0;
  top: 0;
}

.vis-track-slots {
  position: relative;
  display: flex;
  gap: 5px;
}

.vis-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 28px);
  gap: 3px;
}

/* Step 2: Spin & Drag Pattern Card Stage (Exact 116px center-to-center alignment) */
.vis-match-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.vis-match-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 90px;
  position: relative;
}

.vis-match-col.card-col {
  z-index: 12;
}

.vis-match-col.loom-col {
  z-index: 2;
}

.vis-col-top {
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.anim-spin-tag-focus {
  animation: ruleSpinTagPulse 4.4s infinite ease-in-out;
}

@keyframes ruleSpinTagPulse {

  0%,
  36% {
    background: var(--accent);
    color: var(--primary-950);
    box-shadow: 0 0 8px rgba(229, 169, 60, 0.6);
  }

  44%,
  100% {
    background: rgba(229, 169, 60, 0.14);
    color: var(--accent);
    box-shadow: none;
  }
}

.vis-col-lbl {
  font-size: 0.64rem;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.vis-col-lbl.match {
  color: #5ce68b;
}

.vis-match-arrow {
  width: 26px;
  height: 90px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.vis-card-swap-wrap {
  position: relative;
  width: 90px;
  height: 90px;
}

.vis-card-swap-wrap .vis-mini-empty-slot {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  border: 1.5px dashed var(--primary-700);
  background: rgba(255, 255, 255, 0.02);
  box-sizing: border-box;
}

.vis-card-swap-wrap .vis-mini-grid {
  position: absolute;
  inset: 0;
}

.vis-mini-cell {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: var(--primary-950);
  border: 1px solid var(--primary-800);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.vis-mini-cell.req {
  background: var(--primary-950);
  border: 1.5px solid var(--accent);
}

.anim-daily-spin-drag .vis-mini-cell.req {
  animation: ruleDailyReqCutout 4.4s infinite ease-in-out;
}

.anim-daily-spin-drag .vis-mini-cell.excl {
  animation: ruleDailyExclMask 4.4s infinite ease-in-out;
}

.anim-eternal-spin-drag .vis-mini-cell.req {
  animation: ruleEternalReqCutout 4.8s infinite ease-in-out;
}

.anim-eternal-spin-drag .vis-mini-cell.excl {
  animation: ruleEternalExclMask 4.8s infinite ease-in-out;
}

.anim-loom-match-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #5ce68b;
  border-radius: 5px;
  pointer-events: none;
}

.anim-daily-loom-match::after {
  animation: ruleDailyMatchBorder 4.4s infinite ease-in-out;
}

.anim-loom-match-cell:has(.anim-eternal-clear)::after {
  animation: ruleEternalMatchBorder 4.8s infinite ease-in-out;
}

.anim-slide-in {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  animation: ruleSlideIn 3.6s infinite ease-in-out;
}

.anim-push-right {
  position: absolute;
  z-index: 2;
  animation: rulePushRight 3.6s infinite ease-in-out;
}

.anim-tray-refill {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  animation: ruleTrayRefill 3.6s infinite ease-in-out;
}

.anim-daily-spin-drag {
  z-index: 15;
  transform-origin: 45px 45px;
  animation: ruleDailySpinAndDrag 4.4s infinite cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-eternal-spin-drag {
  z-index: 15;
  transform-origin: 45px 45px;
  animation: ruleEternalSpinAndDrag 4.8s infinite cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-eternal-card-in {
  z-index: 5;
  animation: ruleEternalCardIn 4.8s infinite cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-eternal-clear {
  animation: ruleEternalClear 4.8s infinite ease-in-out;
}

.anim-eternal-surge {
  animation: ruleEternalSurge 4.8s infinite cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-token-float {
  animation: ruleTokenFloat 3.4s infinite ease-in-out;
}

.anim-token-badge-life {
  animation: ruleTokenBadge 3.4s infinite ease-in-out;
}

.anim-token-target-cell {
  animation: ruleTokenTargetGlow 3.4s infinite ease-in-out;
}

@keyframes ruleTokenTargetGlow {

  0%,
  20%,
  84%,
  100% {
    outline: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  }

  30%,
  78% {
    outline: 2px solid var(--accent);
    box-shadow: 0 0 12px rgba(229, 169, 60, 0.65);
  }
}

@keyframes ruleDailySpinAndDrag {

  0%,
  12% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }

  26%,
  34% {
    transform: translateX(0) rotate(90deg);
    opacity: 1;
  }

  50%,
  78% {
    transform: translateX(116px) rotate(90deg);
    opacity: 1;
  }

  88% {
    transform: translateX(116px) rotate(90deg);
    opacity: 0;
  }

  93% {
    transform: translateX(0) rotate(0deg);
    opacity: 0;
  }

  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
}

@keyframes ruleDailyReqCutout {

  0%,
  34% {
    background: var(--primary-950);
    border-color: var(--accent);
  }

  48%,
  84% {
    background: rgba(13, 10, 9, 0.12);
    border-color: #5ce68b;
  }

  93%,
  100% {
    background: var(--primary-950);
    border-color: var(--accent);
  }
}

@keyframes ruleDailyExclMask {

  0%,
  34% {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
  }

  48%,
  84% {
    background: rgba(20, 14, 29, 0.72);
    border: 1px dashed rgba(255, 255, 255, 0.28);
  }

  93%,
  100% {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
  }
}

@keyframes ruleDailyMatchBorder {

  0%,
  46% {
    opacity: 0;
    box-shadow: none;
  }

  54%,
  82% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(92, 230, 139, 0.55);
  }

  90%,
  100% {
    opacity: 0;
    box-shadow: none;
  }
}

@keyframes ruleEternalSpinAndDrag {

  0%,
  10% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }

  22%,
  28% {
    transform: translateX(0) rotate(90deg);
    opacity: 1;
  }

  42%,
  52% {
    transform: translateX(116px) rotate(90deg);
    opacity: 1;
  }

  60%,
  90% {
    transform: translateX(116px) rotate(90deg);
    opacity: 0;
  }

  94% {
    transform: translateX(0) rotate(0deg);
    opacity: 0;
  }

  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
}

@keyframes ruleEternalReqCutout {

  0%,
  28% {
    background: var(--primary-950);
    border-color: var(--accent);
  }

  40%,
  58% {
    background: rgba(13, 10, 9, 0.12);
    border-color: #5ce68b;
  }

  94%,
  100% {
    background: var(--primary-950);
    border-color: var(--accent);
  }
}

@keyframes ruleEternalExclMask {

  0%,
  28% {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
  }

  40%,
  58% {
    background: rgba(20, 14, 29, 0.72);
    border: 1px dashed rgba(255, 255, 255, 0.28);
  }

  94%,
  100% {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
  }
}

@keyframes ruleEternalCardIn {

  0%,
  54% {
    opacity: 0;
    transform: translateY(-8px);
  }

  64%,
  88% {
    opacity: 1;
    transform: translateY(0);
  }

  95%,
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes ruleEternalClear {

  0%,
  50% {
    transform: scale(1);
    opacity: 1;
  }

  60%,
  88% {
    transform: scale(0.15);
    opacity: 0;
  }

  96%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes ruleEternalMatchBorder {

  0%,
  38% {
    opacity: 0;
    box-shadow: none;
  }

  43%,
  53% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(92, 230, 139, 0.6);
  }

  60%,
  100% {
    opacity: 0;
    box-shadow: none;
  }
}

@keyframes ruleEternalSurge {

  0%,
  62% {
    transform: scale(0.15);
    opacity: 0;
    outline: none;
  }

  72% {
    transform: scale(1.14);
    opacity: 1;
    outline: 2px solid var(--accent);
    box-shadow: 0 0 12px rgba(229, 169, 60, 0.75);
  }

  80%,
  89% {
    transform: scale(1);
    opacity: 1;
    outline: none;
    box-shadow: none;
  }

  95%,
  100% {
    transform: scale(0.15);
    opacity: 0;
    outline: none;
  }
}

@keyframes ruleSlideIn {

  0%,
  12% {
    transform: translateX(0);
  }

  26% {
    transform: translateX(32px);
  }

  54%,
  82% {
    transform: translateX(98px);
  }

  94%,
  100% {
    transform: translateX(0);
  }
}

@keyframes rulePushRight {

  0%,
  26% {
    transform: translateX(0);
  }

  54%,
  82% {
    transform: translateX(66px);
  }

  94%,
  100% {
    transform: translateX(0);
  }
}

@keyframes ruleTrayRefill {

  0%,
  54% {
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
  }

  62%,
  82% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px rgba(92, 230, 139, 0.75);
  }

  90%,
  100% {
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
  }
}

@keyframes ruleTokenFloat {

  0%,
  15% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }

  40%,
  80% {
    transform: translateX(62px) scale(0.85);
    opacity: 0;
  }

  95%,
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes ruleTokenBadge {

  0%,
  32% {
    transform: scale(0);
    opacity: 0;
  }

  45%,
  78% {
    transform: scale(1);
    opacity: 1;
  }

  88%,
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

/* Step 4: Two-Row 6-Slot Cascade Animation */
.vis-cascade-stage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 4px;
}

.vis-cascade-row {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  height: 20px;
}

.vis-cascade-row:first-child {
  z-index: 5;
}

.vis-cascade-row:last-child {
  z-index: 2;
}

.vis-cascade-row .track-entry {
  box-sizing: border-box;
  width: 16px;
  height: 20px;
  line-height: 16px;
}

.vis-row-tag {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  width: 52px;
  text-align: right;
  color: var(--danger);
  margin-right: 2px;
  height: 20px;
  line-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
}

.vis-row-tag.open {
  color: #5ce68b;
}

.vis-cas-tag-dyn {
  position: relative;
  width: 52px;
  height: 20px;
}

.vis-cas-tag-4,
.vis-cas-tag-5 {
  position: absolute;
  right: 0;
  top: 0;
  height: 20px;
  line-height: 20px;
  white-space: nowrap;
}

.vis-cas-tag-4 {
  animation: ruleCasTag4 4.6s infinite ease-in-out;
}

.vis-cas-tag-5 {
  animation: ruleCasTag5 4.6s infinite ease-in-out;
}

.vis-6-grid {
  display: inline-grid;
  grid-template-columns: repeat(6, 20px);
  gap: 3px;
  position: relative;
  height: 20px;
}

.vis-6-grid .el-icon,
.vis-cascade-row .el-icon {
  width: 12px !important;
  height: 12px !important;
}

.vis-cascade-stage .vis-mini-tile,
.vis-cascade-stage .vis-mini-empty {
  border-radius: 5px;
  box-sizing: border-box;
}

.anim-cas-full-dim {
  animation: ruleCasFullRowDim 4.6s infinite ease-in-out;
}

.anim-cas-r1-entry {
  animation: ruleCasR1EntryState 4.6s infinite ease-in-out;
}

.vis-cas-shift-r1 {
  grid-column: 1 / span 5;
  display: flex;
  gap: 3px;
  animation: ruleCasShiftR1 4.6s infinite cubic-bezier(0.22, 1, 0.36, 1);
}

.vis-cas-shift-r2 {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  gap: 3px;
  animation: ruleCasShiftR2 4.6s infinite cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-cas-pusher {
  position: relative;
  z-index: 4;
  animation: ruleCasPusherIn 4.6s infinite cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-cas-popped {
  grid-column: 6;
  position: relative;
  z-index: 6;
  animation: ruleCasPopAndReroute 4.6s infinite cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-cas-r2-entry {
  animation: ruleCasR2EntryGlow 4.6s infinite ease-in-out;
}

@keyframes ruleCasFullRowDim {

  0%,
  24%,
  88%,
  100% {
    opacity: 1;
  }

  30%,
  82% {
    opacity: 0.45;
  }
}

@keyframes ruleCasR1EntryState {

  0%,
  24% {
    border-style: solid;
    border-color: var(--accent);
    background: var(--accent);
    color: var(--primary-900);
    box-shadow: 0 0 8px rgba(229, 169, 60, 0.6);
    opacity: 1;
  }

  30%,
  82% {
    border-style: dotted;
    border-color: var(--primary-800);
    background: var(--primary-950);
    color: rgba(208, 189, 148, 0.45);
    box-shadow: none;
    opacity: 0.35;
  }

  88%,
  94% {
    border-style: dotted;
    border-color: var(--primary-700);
    background: var(--primary-950);
    color: var(--muted);
    box-shadow: none;
    opacity: 1;
  }

  97%,
  100% {
    border-style: solid;
    border-color: var(--accent);
    background: var(--accent);
    color: var(--primary-900);
    box-shadow: 0 0 8px rgba(229, 169, 60, 0.6);
    opacity: 1;
  }
}

@keyframes ruleCasPusherIn {

  0%,
  10% {
    transform: translateX(0);
    outline: 1.5px dashed var(--accent);
    opacity: 1;
  }

  24% {
    transform: translateX(44px);
    outline: none;
    opacity: 1;
  }

  30%,
  82% {
    transform: translateX(44px);
    outline: none;
    opacity: 0.46;
  }

  88% {
    transform: translateX(44px);
    outline: none;
    opacity: 1;
  }

  95%,
  100% {
    transform: translateX(0);
    outline: 1.5px dashed var(--accent);
    opacity: 1;
  }
}

@keyframes ruleCasShiftR1 {

  0%,
  12% {
    transform: translateX(0);
    opacity: 1;
  }

  24% {
    transform: translateX(23px);
    opacity: 1;
  }

  30%,
  82% {
    transform: translateX(23px);
    opacity: 0.46;
  }

  88% {
    transform: translateX(23px);
    opacity: 1;
  }

  95%,
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes ruleCasPopAndReroute {

  0%,
  18% {
    transform: translate(0, 0) scale(1);
    outline: none;
    box-shadow: none;
  }

  28%,
  36% {
    transform: translate(14px, -3px) scale(1.12);
    outline: 2px solid var(--accent);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.7);
  }

  48%,
  55% {
    transform: translate(-159px, 0px) scale(1.05);
    outline: 2px solid var(--danger);
    box-shadow: 0 0 12px var(--danger);
  }

  64%,
  70% {
    transform: translate(-159px, 26px) scale(1.06);
    outline: 2px solid var(--accent);
    box-shadow: none;
  }

  74% {
    transform: translate(-138px, 26px) scale(1.02);
    outline: 2px solid var(--accent);
    box-shadow: none;
  }

  82%,
  88% {
    transform: translate(-115px, 26px) scale(1);
    outline: 1.5px solid #5ce68b;
    box-shadow: 0 0 8px rgba(92, 230, 139, 0.5);
  }

  95%,
  100% {
    transform: translate(0, 0) scale(1);
    outline: none;
    box-shadow: none;
  }
}

@keyframes ruleCasShiftR2 {

  0%,
  74% {
    transform: translateX(0);
  }

  82%,
  88% {
    transform: translateX(23px);
  }

  95%,
  100% {
    transform: translateX(0);
  }
}

@keyframes ruleCasTag4 {

  0%,
  76% {
    opacity: 1;
    transform: translateY(0);
  }

  80%,
  90% {
    opacity: 0;
    transform: translateY(-3px);
  }

  94%,
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ruleCasTag5 {

  0%,
  76% {
    opacity: 0;
    transform: translateY(3px);
  }

  80%,
  90% {
    opacity: 1;
    transform: translateY(0);
    text-shadow: 0 0 6px rgba(92, 230, 139, 0.7);
  }

  94%,
  100% {
    opacity: 0;
    transform: translateY(3px);
  }
}

@keyframes ruleCasR2EntryGlow {

  0%,
  62%,
  90%,
  100% {
    border-color: var(--border);
    background: rgba(36, 27, 24, 0.65);
    color: var(--muted);
    box-sizing: border-box;
    box-shadow: none;
  }

  66%,
  82% {
    border-style: solid;
    border-color: var(--accent);
    background: var(--accent);
    color: #181210;
    box-shadow: 0 0 8px rgba(229, 169, 60, 0.6);
  }
}

/* Step 5: Pro Tips & Trophies Cards */
.vis-tips-cards {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: auto 0;
}

.vis-tip-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--primary-950);
  border: 1px solid var(--primary-800);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.32;
}

.vis-tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--primary-800);
  border: 1px solid var(--primary-700);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.vis-tool-pill svg {
  width: 13px;
  height: 13px;
  stroke: var(--accent);
  stroke-width: 2.2;
  fill: none;
}

.vis-tool-pill.accent-border {
  border-color: rgba(229, 169, 60, 0.55);
  color: var(--accent);
}

