/* ==========================================================================
   AlgoFi Landing Page Custom Styles
   ========================================================================== */

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { background: #050505 !important; }
#mobileMenu.is-open { display: block; }

/* ==========================================================================
   FAQ Collapse/Expand — Final Version
   + Expands to − (minus), answers show multiple paragraphs, card height auto-adapts
   ========================================================================== */

/* 1) Card container */
.faq-item.glass-card {
  height: auto !important;
  min-height: 72px !important;
  max-height: none !important;
  border-radius: 34px !important;
}
.faq-item .inner {
  height: auto !important;
  min-height: 0 !important;
  display: block !important;
  border-radius: 34px !important;
}

/* 2) Collapsed state */
.faq-item .faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 2rem;
  color: rgba(255,255,255,.75);
  font-size: .95rem;
  line-height: 1.65;
  transition: max-height .4s cubic-bezier(.4, 0, .2, 1), padding .35s ease;
  text-align: left;
  will-change: max-height;
}

/* 3) Expanded state */
.faq-item.is-open .faq-answer {
  padding: 0.25rem 2rem 1.75rem;
  /* max-height is set dynamically by JS */
}

/* 4) Multiple paragraph spacing */
.faq-item .faq-answer p {
  margin: 0 0 0.85rem 0 !important;
  line-height: 1.65 !important;
}
.faq-item .faq-answer p:last-child {
  margin-bottom: 0 !important;
}

/* 5) Icon + → − : hide vertical line when expanded */
.faq-item .faq-icon-v {
  opacity: 1 !important;
  transition: opacity .25s ease !important;
}
.faq-item.is-open .faq-icon-v {
  opacity: 0 !important;
}

/* 6) Title button */
.faq-item .faq-toggle {
  min-height: 72px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  width: 100% !important;
  text-align: left !important;
}
.faq-item .faq-toggle > div {
  padding-left: 2rem !important;
  padding-right: 1rem !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  color: #4ade80 !important;
  white-space: normal !important;
  text-align: left !important;
}
.faq-item .faq-icon {
  flex-shrink: 0 !important;
  margin-right: 2rem !important;
  color: #4ade80 !important;
  stroke: #4ade80 !important;
  transform: none !important;
}

/* 7) Outer grid layout */
.faqs-list .grid {
  align-items: start !important;
}
.faqs-list .grid > div,
.faqs-list .grid > div > div,
.faqs-list .grid > div > div > div {
  height: auto !important;
}
.faqs-list .grid > .flex.flex-col {
  align-self: flex-start !important;
  height: auto !important;
}

/* 8) Mobile */
@media (max-width: 767px) {
  .faq-item .faq-toggle {
    min-height: 64px !important;
  }
  .faq-item .faq-toggle > div {
    padding-left: 1.25rem !important;
    font-size: .95rem !important;
  }
  .faq-item .faq-icon {
    margin-right: 1.25rem !important;
  }
  .faq-item .faq-answer {
    padding: 0 1.25rem !important;
    font-size: .9rem !important;
  }
  .faq-item.is-open .faq-answer {
    padding: 0.25rem 1.25rem 1.5rem !important;
  }
}

/* ---------- FAQ Pagination ---------- */
.faq-page { display: none; }
.faq-page.is-active { display: block; }

.faq-page-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid #09FF8C;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}
.faq-page-btn:hover { background: rgba(9,255,140,0.1); }
.faq-page-btn.is-active {
  background: #09FF8C;
  color: #004631;
  font-weight: 700;
}

/* ---------- FAQ / Footer Pure Black Background ---------- */
.faqs-section { background: #050505; }
.faqs-section .faqs-right-light,
.faqs-section .faqs-left-light { display: none !important; }
footer,
footer.footer-gradient {
  background: #0a0a0a !important;
  background-image: none !important;
}
footer::before,
footer::after { display: none !important; }
footer .bg-shape { display: none !important; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- A-Score ---------- */
.a-score-section { position: relative; min-height: 100vh; }
.a-score-title-sticky {
  position: sticky;
  top: var(--header-height, 70px);
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.a-score-title-sticky .section-title { margin-bottom: 0; padding-top: 0; }
.a-score-content {
  position: relative;
  z-index: 2;
  margin-top: -100vh;
  padding-top: 100vh;
}
.mini-cards-section { margin-top: 0; }
.mini-card-row {
  display: flex;
  width: 100%;
  height: calc(100dvh / 1.5);
  align-items: center;
}
.mini-card-row[data-pos="start"]  { justify-content: flex-start; }
.mini-card-row[data-pos="center"] { justify-content: center; }
.mini-card-row[data-pos="end"]    { justify-content: flex-end; }
.score-mini-card {
  height: 100%;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
}
@media (max-width: 767px) { .score-mini-card { width: 100%; } }

.big-cards-section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.big-card {
  position: relative;
  width: 100%;
  max-width: 1034px;
  margin: 0 auto;
}

/* A-Score big card mobile scroll collapse */
@media (max-width: 767px) {
  .a-score-title-sticky {
    position: static;
    height: auto;
    padding: 1rem 0 0.5rem;
    pointer-events: auto;
  }
  .a-score-content {
    margin-top: 0;
    padding-top: 0;
  }
  .big-cards-section { gap: 1rem; }
  .big-card .big-card-body { transition: padding .35s ease; }
  .big-card .big-card-img { transition: height .35s ease; }
  .big-card h4 { transition: margin-bottom .3s ease; }
  .big-card p {
    max-height: 400px;
    opacity: 1;
    overflow: hidden;
    transition: max-height .4s ease, opacity .3s ease, margin .3s ease;
  }
  .big-card.is-open .big-card-body { padding: 1.5rem 1.1rem; }
  .big-card.is-open .big-card-img { height: 120px; }
  .big-card.is-open h4 { margin-bottom: 1rem; }
  .big-card.is-open p { max-height: 400px; opacity: 1; }
  .big-card.is-collapsed .big-card-body { padding: 1rem 1.1rem; }
  .big-card.is-collapsed .big-card-img { height: 60px; }
  .big-card.is-collapsed h4 { margin-bottom: 0; }
  .big-card.is-collapsed p { max-height: 0; opacity: 0; margin: 0; }
}

/* ---------- Get started CTA ---------- */
.confident-trading-cta { margin-top: 4rem; }
@media (min-width: 768px)  { .confident-trading-cta { margin-top: 6rem; } }
@media (min-width: 1024px) { .confident-trading-cta { margin-top: 8rem; } }

/* ---------- Video container ---------- */
.trading-video {
  width: 100%;
  height: 300px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
}

/* ============================================================
   3D Card Carousel
   ============================================================ */
.card-3d-stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  margin: 0 auto;
  overflow: visible;
}
[data-carousel="tutorials"] {
  max-width: 720px;
  height: 320px;
}
.card-3d {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 320px;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  will-change: transform;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1),
              opacity .6s ease,
              filter .6s ease;
  transform-style: preserve-3d;
}
[data-carousel="tutorials"] .card-3d {
  width: 400px;
  height: 250px;
}
.card-3d.is-center {
  z-index: 30;
  filter: brightness(1);
  opacity: 1;
  transform: translate(-50%, -50%) translateX(0) translateY(0) scale(1) rotateY(0deg);
}
.card-3d.is-left {
  z-index: 10;
  filter: brightness(0.5);
  opacity: 1;
  transform: translate(-50%, -50%) translateX(-95%) translateY(8%) scale(0.82) rotateY(28deg);
}
.card-3d.is-right {
  z-index: 10;
  filter: brightness(0.5);
  opacity: 1;
  transform: translate(-50%, -50%) translateX(95%) translateY(8%) scale(0.82) rotateY(-28deg);
}
.card-3d-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.card-3d-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 55%, transparent 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
[data-carousel="tutorials"] .card-3d-caption {
  font-size: 13px;
  padding: 22px 20px 12px;
}
.card-3d-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.card-3d.is-center .card-3d-play-btn {
  opacity: 1;
  pointer-events: auto;
}
.card-3d-play-btn svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  margin-left: 3px;
}
.card-3d.is-center:hover .card-3d-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
}
.card-3d-dots {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 40;
}
.card-3d-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  transition: all .3s ease;
  cursor: pointer;
}
.card-3d-dot.is-active {
  background: #09FF8C;
  width: 24px;
  border-radius: 4px;
}
.card-3d-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20,20,20,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  transition: background .2s ease, transform .2s ease;
  color: #fff;
}
.card-3d-arrow:hover {
  background: rgba(50,50,50,0.95);
  transform: translateY(-50%) scale(1.08);
}
.card-3d-arrow.left { left: 0; }
.card-3d-arrow.right { right: 0; }

/* Parent container clipping */
.trading-card .glass-card,
.trading-card .glass-card .inner,
.trading-card .glass-card .inner > div,
.trading-card .glass-card .inner > div > div {
  overflow: hidden !important;
}
.trading-card .card-3d-stage {
  overflow: visible !important;
}

/* ============================================================
   Meet Algofi Team / Tutorials title strict alignment
   ============================================================ */
.trading-card-grid .grid.md\:grid-cols-2 {
  align-items: stretch !important;
}
.trading-card,
.trading-card > .glass-card,
.trading-card > .glass-card > .inner,
.trading-card > .glass-card > .inner > div,
.trading-card > .glass-card > .inner > div > div {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
.trading-card .trading-card-title {
  flex-shrink: 0 !important;
  height: 160px !important;
  min-height: 160px !important;
  max-height: 160px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 60px 16px 20px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  text-align: center !important;
}
.trading-card .trading-card-title h4 {
  font-size: 32px !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  margin: 0 !important;
  text-align: center !important;
  color: #ffffff !important;
}
.trading-card .trading-card-title h4 .title-dark-gray {
  color: #929292 !important;
  font-weight: 700 !important;
}
.trading-card .flex-1 {
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 0 !important;
  padding-bottom: 40px !important;
}
.trading-card .card-3d-stage {
  position: relative !important;
  margin: 0 auto !important;
  flex: 0 0 auto !important;
  align-self: center !important;
}
.trading-card .card-3d-dots {
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  bottom: -32px !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .card-3d-stage { max-width: 560px; height: 320px; }
  [data-carousel="tutorials"] { max-width: 640px; height: 300px; }
  .card-3d { width: 200px; height: 270px; }
  [data-carousel="tutorials"] .card-3d { width: 340px; height: 213px; }
  .card-3d.is-left  { transform: translate(-50%, -50%) translateX(-95%) translateY(8%) scale(0.8) rotateY(28deg); }
  .card-3d.is-right { transform: translate(-50%, -50%) translateX(95%) translateY(8%) scale(0.8) rotateY(-28deg); }
  .trading-card .trading-card-title {
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    padding: 50px 12px 16px !important;
  }
  .trading-card .trading-card-title h4 { font-size: 28px !important; }
}

@media (max-width: 767px) {
  .card-3d-stage { max-width: 100%; height: 280px; }
  [data-carousel="tutorials"] { max-width: 100%; height: 240px; }
  .card-3d { width: 160px; height: 220px; }
  [data-carousel="tutorials"] .card-3d { width: 260px; height: 163px; }
  .card-3d.is-left  { transform: translate(-50%, -50%) translateX(-90%) translateY(6%) scale(0.78) rotateY(28deg); }
  .card-3d.is-right { transform: translate(-50%, -50%) translateX(90%) translateY(6%) scale(0.78) rotateY(-28deg); }
  .card-3d-caption { font-size: 10px; padding: 20px 10px 8px; }
  [data-carousel="tutorials"] .card-3d-caption { font-size: 11px; padding: 16px 12px 8px; }
  .card-3d-arrow { width: 32px; height: 32px; }
  .card-3d-arrow.left { left: -4px; }
  .card-3d-arrow.right { right: -4px; }
  .card-3d-play-btn { width: 44px; height: 44px; }
  .card-3d-play-btn svg { width: 18px; height: 18px; }
  .trading-card .trading-card-title {
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    padding: 36px 12px 12px !important;
  }
  .trading-card .trading-card-title h4 { font-size: 22px !important; }
  .trading-card .flex-1 { padding-bottom: 30px !important; }
}

@media (max-width: 480px) {
  .card-3d { width: 140px; height: 190px; }
  [data-carousel="tutorials"] .card-3d { width: 220px; height: 138px; }
  .card-3d-stage { height: 240px; }
  [data-carousel="tutorials"] { height: 200px; }
  .card-3d.is-left  { transform: translate(-50%, -50%) translateX(-88%) translateY(6%) scale(0.75) rotateY(28deg); }
  .card-3d.is-right { transform: translate(-50%, -50%) translateX(88%) translateY(6%) scale(0.75) rotateY(-28deg); }
}

/* ==========================================================================
   Connect Wallet Modal
   ========================================================================== */
.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
}
.wallet-modal.is-open { display: flex; opacity: 1; }
.wallet-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}
.wallet-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: #121212;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px;
  padding: 20px 24px 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(10px);
  transition: transform .25s ease;
}
.wallet-modal.is-open .wallet-modal__panel { transform: translateY(0); }
.wallet-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.wallet-modal__help,
.wallet-modal__back {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  opacity: 0.75;
  transition: opacity .2s;
  flex-shrink: 0;
}
.wallet-modal__help:hover,
.wallet-modal__back:hover { opacity: 1; }
.wallet-modal__title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  text-align: center;
}
.wallet-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity .2s;
  padding: 4px;
  display: flex;
  flex-shrink: 0;
}
.wallet-modal__close:hover { opacity: 1; }
.wallet-modal__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wallet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  text-align: left;
  color: #fff;
  text-decoration: none;
}
.wallet-item:hover {
  background: #222;
  border-color: rgba(9,255,140,0.3);
  transform: translateY(-1px);
}
.wallet-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.wallet-item__icon--wc { background: #fff; }
.wallet-item__icon--mw { background: #fff; }
.wallet-item__icon--tw { background: transparent; }
.wallet-item__icon--aw { background: #0f1f18; }
.wallet-item__name { flex: 1; font-size: 15px; font-weight: 600; }
.wallet-item__badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 6px;
  background: #00C26F;
  color: #002B14;
  text-transform: uppercase;
}
.wallet-item__badge--gray {
  background: #2a2a2a;
  color: #9CA3AF;
}
.wallet-modal__footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #9CA3AF;
}
.wallet-modal__footer a {
  color: #4285F4;
  margin-left: 4px;
  text-decoration: none;
}
.wallet-modal__footer a:hover { text-decoration: underline; }

.wallet-view { display: none; }
.wallet-view.is-active { display: block; }

.wallet-help {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 8px 4px 4px;
}
.wallet-help__feature { text-align: center; }
.wallet-help__icons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}
.wallet-help__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wallet-help__title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.wallet-help__desc {
  font-size: 14px;
  line-height: 1.55;
  color: #9CA3AF;
  max-width: 320px;
  margin: 0 auto;
}
.wallet-help__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  padding: 14px 32px;
  border-radius: 9999px;
  background: linear-gradient(to right, #09FF4B, #40F39F);
  color: #000;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 2px 20px #40F39Faa;
  transition: box-shadow .25s, transform .15s;
  margin-top: 4px;
}
.wallet-help__cta:hover {
  box-shadow: 0 2px 40px #40F39Faa;
  transform: translateY(-1px);
}
.wallet-help__cta svg { stroke: currentColor; }

/* Touch devices bottom sheet */
@media (max-width: 1024px), (pointer: coarse) {
  .wallet-modal { align-items: flex-end; justify-content: center; }
  .wallet-modal__backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); }
  .wallet-modal__panel {
    width: 100vw;
    max-width: 100vw;
    height: auto;
    max-height: 42vh;
    border-radius: 24px 24px 0 0;
    padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1);
    box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .wallet-modal.is-open .wallet-modal__panel { transform: translateY(0); }
  .wallet-modal__panel::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.25);
    margin: 6px auto 8px;
  }
  .wallet-modal__header {
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    background: #121212;
    z-index: 2;
  }
  .wallet-modal__title { font-size: 15px; }
  .wallet-modal__list { gap: 8px; }
  .wallet-item { padding: 10px 12px; gap: 10px; border-radius: 14px; }
  .wallet-item__icon { width: 34px; height: 34px; border-radius: 9px; }
  .wallet-item__icon svg { width: 22px; height: 22px; }
  .wallet-item__name { font-size: 14px; }
  .wallet-item__badge { font-size: 9px; padding: 3px 6px; }
  .wallet-modal__footer { font-size: 13px; padding: 12px 0 2px; text-align: center; }
  .wallet-modal__footer a { padding: 4px 2px; display: inline-block; }
  .wallet-help { gap: 18px; padding: 4px 2px; }
  .wallet-help__icon { width: 44px; height: 44px; border-radius: 12px; }
  .wallet-help__icon svg { width: 20px; height: 20px; }
  .wallet-help__title { font-size: 15px; margin-bottom: 6px; }
  .wallet-help__desc { font-size: 12px; line-height: 1.5; }
  .wallet-help__cta { padding: 11px 22px; font-size: 13px; }
}

/* Desktop centered */
@media (min-width: 1025px) and (pointer: fine) {
  .wallet-modal { align-items: center; justify-content: center; }
  .wallet-modal__panel {
    width: 100%;
    max-width: 420px;
    height: auto;
    max-height: 90vh;
    border-radius: 24px;
    padding: 20px 24px 24px;
    transform: translateY(10px);
  }
  .wallet-modal.is-open .wallet-modal__panel { transform: translateY(0); }
}

/* ==========================================================================
   Story Video Modal
   ========================================================================== */
.story-video-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}
.story-video-modal.is-open { display: flex; opacity: 1; }
.story-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}
.story-video-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 24px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  transform: translateY(20px);
  transition: transform .3s ease;
}
.story-video-modal.is-open .story-video-modal__panel { transform: translateY(0); }
.story-video-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.story-video-modal__info { flex: 1; }
.story-video-modal__title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}
.story-video-modal__channel { font-size: 13px; color: #9CA3AF; }
.story-video-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  opacity: 0.75;
  transition: opacity .2s, transform .2s;
  padding: 4px;
  display: flex;
  flex-shrink: 0;
}
.story-video-modal__close:hover { opacity: 1; transform: scale(1.1); }
.story-video-modal__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.story-video-modal__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 767px) {
  .story-video-modal__panel { margin: 0 12px; border-radius: 16px; }
  .story-video-modal__header { padding: 14px 16px; }
  .story-video-modal__title { font-size: 14px; }
  .story-video-modal__channel { font-size: 11px; }
}

/* ==========================================================================
   Tutorial Video Modal
   ========================================================================== */
.tutorial-video-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}
.tutorial-video-modal.is-open { display: flex; opacity: 1; }
.tutorial-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
}
.tutorial-video-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 24px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  transform: translateY(20px);
  transition: transform .3s ease;
}
.tutorial-video-modal.is-open .tutorial-video-modal__panel { transform: translateY(0); }
.tutorial-video-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tutorial-video-modal__info { flex: 1; }
.tutorial-video-modal__title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}
.tutorial-video-modal__channel { font-size: 13px; color: #9CA3AF; }
.tutorial-video-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  opacity: 0.75;
  transition: opacity .2s, transform .2s;
  padding: 4px;
  display: flex;
  flex-shrink: 0;
}
.tutorial-video-modal__close:hover { opacity: 1; transform: scale(1.1); }
.tutorial-video-modal__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.tutorial-video-modal__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 767px) {
  .tutorial-video-modal__panel { margin: 0 12px; border-radius: 16px; }
  .tutorial-video-modal__header { padding: 14px 16px; }
  .tutorial-video-modal__title { font-size: 14px; }
  .tutorial-video-modal__channel { font-size: 11px; }
}

/* ==========================================================================
   prefers-reduced-motion fallback
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero-line-in,
  .attention-ripple,
  .attention-ripple-2,
  .animate-shake {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Connect Wallet Modal — Matching AI (15s lock close)
   ========================================================================== */

/* ---------- Matching content ---------- */
.wallet-matching {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 24px 24px;
  text-align: center;
}

.wallet-matching__spinner {
  width: 72px;
  height: 72px;
}
.wallet-matching__spinner svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wallet-matching__title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin: 0;
}

.wallet-matching__desc {
  font-size: 15px;
  color: #CFFFDC;
  line-height: 1.55;
  margin: 0;
}

/* ---------- Close button (locked + ready) ---------- */
.wallet-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  transition: opacity .25s ease, background .25s ease;
  z-index: 10;
}
.wallet-modal__close--locked {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.wallet-modal__close--ready {
  opacity: 1;
  cursor: pointer;
}
.wallet-modal__close--ready:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Mobile: force centered (override bottom sheet) ---------- */
@media (max-width: 1024px), (pointer: coarse) {
  .wallet-modal {
    align-items: center !important;
    justify-content: center !important;
  }

  .wallet-modal__backdrop {
    background: rgba(0, 0, 0, 0.72) !important;
    backdrop-filter: blur(6px) !important;
  }

  .wallet-modal__panel {
    width: auto !important;
    max-width: 340px !important;
    min-width: 280px !important;
    height: auto !important;
    max-height: 70vh !important;
    border-radius: 24px !important;
    padding: 24px 20px 20px !important;
    transform: translateY(20px) !important;
    transition: transform .3s cubic-bezier(.22, 1, .36, 1) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7) !important;
    margin: 0 16px !important;
  }
  .wallet-modal.is-open .wallet-modal__panel {
    transform: translateY(0) !important;
  }

  /* Hide bottom sheet drag handle */
  .wallet-modal__panel::before {
    display: none !important;
  }

  .wallet-matching {
    padding: 20px 12px 12px !important;
    gap: 16px !important;
  }
  .wallet-matching__spinner {
    width: 60px;
    height: 60px;
  }
  .wallet-matching__title {
    font-size: 18px;
  }
  .wallet-matching__desc {
    font-size: 13px;
  }
}