/* ══════════════════════════════════════
   How to Play — tutorial page
   ══════════════════════════════════════ */

.bd-howto {
  --ht-violet: #9d4edd;
  --ht-hot: #ff2d95;
  --ht-lime: #b8ff3c;
  --ht-gold: #ffd60a;
  --ht-panel: #120a1e;
  --ht-panel-2: #1a1028;
  --ht-muted: rgba(232, 220, 248, 0.72);
  --ht-max: 72rem;
  --ht-pad: clamp(1rem, 4vw, 2rem);
  padding-bottom: 4rem;
  background: linear-gradient(180deg, rgba(157, 78, 221, 0.08) 0%, transparent 28%);
}

.bd-howto-hero {
  position: relative;
  padding: 2.5rem var(--ht-pad) 2rem;
  text-align: center;
  overflow: hidden;
}

.bd-howto-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(255, 45, 149, 0.22), transparent 68%);
  pointer-events: none;
}

.bd-howto-hero-inner {
  position: relative;
  max-width: 42rem;
  margin: 0 auto;
}

.bd-howto-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 2px solid rgba(184, 255, 60, 0.35);
  background: rgba(184, 255, 60, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ht-lime);
}

.bd-howto-title {
  margin: 1rem 0 0;
  font-family: "Bebas Neue", impact, sans-serif;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: #fff8f0;
}

.bd-howto-lead {
  margin: 0.85rem auto 0;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ht-muted);
}

.bd-howto-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.1rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 2px solid rgba(157, 78, 221, 0.45);
  background: var(--ht-panel);
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff8f0;
}

.bd-howto-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: var(--ht-max);
  margin: 0 auto;
  padding: 0 var(--ht-pad) 1.5rem;
}

.bd-howto-jump a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 2px solid rgba(157, 78, 221, 0.35);
  background: var(--ht-panel);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff8f0;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.bd-howto-jump a:hover {
  border-color: var(--ht-lime);
  color: var(--ht-lime);
  transform: translateY(-1px);
}

.bd-howto-section {
  max-width: var(--ht-max);
  margin: 0 auto;
  padding: 0 var(--ht-pad) 2.5rem;
}

.bd-howto-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.bd-howto-section-head h2 {
  margin: 0;
  font-family: "Bebas Neue", impact, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: 0.03em;
  color: var(--ht-gold);
}

.bd-howto-section-head p {
  margin: 0;
  max-width: 28rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ht-muted);
}

.bd-howto-mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bd-howto-mode-tag--paper {
  background: rgba(255, 214, 10, 0.15);
  color: var(--ht-gold);
  border: 1px solid rgba(255, 214, 10, 0.35);
}

.bd-howto-mode-tag--phone {
  background: rgba(255, 45, 149, 0.15);
  color: var(--ht-hot);
  border: 1px solid rgba(255, 45, 149, 0.35);
}

.bd-howto-steps {
  display: grid;
  gap: 1rem;
}

.bd-howto-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.15rem;
  padding: 1.15rem 1.2rem;
  border-radius: 14px;
  border: 2px solid rgba(157, 78, 221, 0.28);
  background: var(--ht-panel);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
}

.bd-howto-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  border: 2px solid var(--ht-hot);
  background: rgba(255, 45, 149, 0.12);
  font-family: "Bebas Neue", impact, sans-serif;
  font-size: 1.35rem;
  color: var(--ht-hot);
  flex-shrink: 0;
}

.bd-howto-step-body h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff8f0;
}

.bd-howto-step-body p {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ht-muted);
}

.bd-howto-tip {
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border-left: 3px solid var(--ht-lime);
  background: rgba(184, 255, 60, 0.08);
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(232, 220, 248, 0.9);
}

.bd-howto-tip strong {
  color: var(--ht-lime);
}

.bd-howto-locked {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: 14px;
  border: 2px dashed rgba(157, 78, 221, 0.45);
  background: rgba(18, 10, 30, 0.6);
  text-align: center;
}

.bd-howto-locked p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ht-muted);
}

.bd-howto-locked button {
  margin-top: 0.85rem;
}

.bd-howto-patterns {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.bd-howto-pattern {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 14px;
  border: 2px solid rgba(157, 78, 221, 0.28);
  background: var(--ht-panel-2);
}

.bd-howto-pattern h3 {
  margin: 0;
  font-family: "Bebas Neue", impact, sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: #fff8f0;
}

.bd-howto-pattern p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ht-muted);
  flex: 1;
}

.bd-howto-pat-wrap {
  max-width: 11rem;
  margin: 0 auto;
}

/* Pattern diagram (tutorial scope) */
.bd-howto-pat-wrap .bd-pat-letters {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.2rem;
  margin-bottom: 0.2rem;
}

.bd-howto-pat-wrap .bd-pat-letter {
  font-family: "Bebas Neue", impact, sans-serif;
  font-size: 0.75rem;
  text-align: center;
  color: rgba(255, 248, 240, 0.85);
}

.bd-howto-pat-wrap .bd-pat-letter--n {
  color: #5eead4;
}

.bd-howto-pat-wrap .bd-pat-grid-wrap {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
}

.bd-howto-pat-wrap .bd-pat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 0.2rem;
  height: 100%;
}

.bd-howto-pat-wrap .bd-pat-cell {
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.bd-howto-pat-wrap .bd-pat-cell--free {
  border-color: rgba(255, 45, 149, 0.55);
  background: rgba(255, 45, 149, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bd-howto-pat-wrap .bd-pat-cell--free span {
  font-family: "Bebas Neue", impact, sans-serif;
  font-size: 0.45rem;
  color: #fff;
}

.bd-howto-pat-wrap .bd-pat-cell--win {
  border-color: rgba(184, 255, 60, 0.6);
  background: rgba(184, 255, 60, 0.22);
}

.bd-howto-pat-wrap .bd-pat-lines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 0.2rem;
  pointer-events: none;
}

.bd-howto-pat-wrap .bd-pat-line {
  opacity: 0;
  border-radius: 6px;
  border: 2px solid var(--ht-lime);
  background: rgba(184, 255, 60, 0.12);
  animation: bd-howto-line-blink 10s linear infinite;
}

.bd-howto-pat-wrap .bd-pat-line--row {
  grid-column: 1 / -1;
  grid-row: calc(var(--line-i) + 1);
}

.bd-howto-pat-wrap .bd-pat-line--col {
  grid-row: 1 / -1;
  grid-column: calc(var(--line-i) + 1);
}

.bd-howto-pat-wrap .bd-pat-line--diag {
  grid-area: 1 / 1 / 6 / 6;
  border: none;
  background: transparent;
}

.bd-howto-pat-wrap .bd-pat-line--diag-a {
  background: linear-gradient(135deg, transparent 46%, rgba(184, 255, 60, 0.5) 48%, rgba(184, 255, 60, 0.5) 52%, transparent 54%);
}

.bd-howto-pat-wrap .bd-pat-line--diag-b {
  background: linear-gradient(45deg, transparent 46%, rgba(184, 255, 60, 0.5) 48%, rgba(184, 255, 60, 0.5) 52%, transparent 54%);
}

.bd-howto-pat-wrap .bd-pat-line:nth-child(1) { animation-delay: 0s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(2) { animation-delay: -1s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(3) { animation-delay: -2s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(4) { animation-delay: -3s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(5) { animation-delay: -4s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(6) { animation-delay: -5s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(7) { animation-delay: -6s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(8) { animation-delay: -7s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(9) { animation-delay: -8s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(10) { animation-delay: -9s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(11) { animation-delay: -10s; }
.bd-howto-pat-wrap .bd-pat-line:nth-child(12) { animation-delay: -11s; }

@keyframes bd-howto-line-blink {
  0%, 7% { opacity: 1; }
  8%, 100% { opacity: 0; }
}

.bd-howto-verify {
  display: grid;
  gap: 0.65rem;
}

.bd-howto-verify li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--ht-panel);
  border: 1px solid rgba(157, 78, 221, 0.22);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ht-muted);
  list-style: none;
}

.bd-howto-verify-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(94, 234, 212, 0.2);
  color: #5eead4;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bd-howto-cta {
  max-width: var(--ht-max);
  margin: 0 auto;
  padding: 0 var(--ht-pad) 2rem;
  text-align: center;
}

.bd-howto-cta .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.bd-howto-cards {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 1.25rem;
}

.bd-howto-card {
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid rgba(157, 78, 221, 0.25);
  background: var(--ht-panel);
}

.bd-howto-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.bd-howto-card h4 {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff8f0;
}

.bd-howto-card p {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ht-muted);
}

body.bd-howto-active #root main > *:not(#bd-howto-mount) {
  display: none !important;
}

@media (min-width: 768px) {
  .bd-howto-steps--cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .bd-howto-step--wide {
    grid-column: 1 / -1;
  }
}
