/* Learn: deck menu, deck intro + card carousel (Fidget Basics, Board Basics, ...)
   Shared face renderers (.grid2d, .face-img) live in base.css. */

/* ---------- Learn menu ---------- */
.learn-stack { top: 238px; }            /* JS recentres it for the deck count */
.learn-stack .pill { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 24px; }
.learn-empty { margin: 0; font-size: 30px; color: #8a7a58; text-align: center; width: 482px; }

/* ---------- Deck intro (matches Fidget_Cube_Basics) ---------- */
.deck-intro .intro-title { margin-top: 78px; font-size: 34px; }
.deck-intro .intro-text {
  margin: 30px auto 0; max-width: 820px; padding: 0 20px;
  font-size: 32px; line-height: 1.4; text-transform: uppercase; letter-spacing: 3px;
}
.deck-intro .intro-img {
  top: 282px; width: 480px; height: 310px; object-fit: contain;
}
.deck-intro .intro-img[hidden] { display: none; }

/* ---------- Card carousel ---------- */
.learn-title {
  position: absolute; top: 58px; left: 0; right: 0; margin: 0; padding: 0 170px;
  text-align: center; font-size: 30px; font-weight: 400; line-height: 1.3; color: #555;
  white-space: pre-line;
}
.card-wrap {
  position: absolute; left: 50%; top: 190px; width: 370px; height: 370px;
  transform: translateX(-50%); perspective: 1400px;
  touch-action: pan-y;
}
.card-wrap.flippable { cursor: pointer; }
/* Info cards hold a picture plus a line of text, so they are bigger. */
.card-wrap.info { top: 164px; width: 620px; height: 486px; }

.card {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4,.2,.2,1);
}
.card.flipped { transform: rotateY(180deg); }
.card.slide-left { animation: slideL .28s ease; }
.card.slide-right { animation: slideR .28s ease; }
@keyframes slideL { from { transform: translateX(60px); opacity: 0; } }
@keyframes slideR { from { transform: translateX(-60px); opacity: 0; } }

.face {
  position: absolute; inset: 0;
  background: var(--white); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.15), 8px 10px 0 rgba(0,0,0,.12);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; place-items: center; padding: 34px;
  pointer-events: none;                 /* the wrap handles taps and swipes */
}
.face.back { transform: rotateY(180deg); }
.face .face-img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-drag: none; }

/* Info face: picture on top, short text under it. */
.face.info-face {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 26px 34px;
}
.info-pic { width: 100%; height: 320px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.info-face .info-pic .face-img { width: 100%; height: 320px; max-height: none; object-fit: contain; }
.info-face.no-text .info-pic,
.info-face.no-text .info-pic .face-img { height: 420px; }
.info-text {
  margin: 0; font-size: 27px; line-height: 1.35; text-align: center; color: var(--ink);
}
.info-face.text-only .info-text { font-size: 36px; line-height: 1.4; }

.arrow {
  position: absolute; top: 340px; width: 72px; height: 72px; border-radius: 50%;
  background: var(--yellow); box-shadow: inset 0 0 6px rgba(255,255,255,.5), 3px 4px 0 rgba(0,0,0,.4);
  transition: transform .08s, opacity .2s;
}
.arrow::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  border: 11px solid transparent; transform: translate(-50%, -50%);
}
.arrow.prev { left: 226px; }
.arrow.prev::after { border-right: 15px solid #fff; border-left: 0; margin-left: -2px; }
.arrow.next { right: 226px; }
.arrow.next::after { border-left: 15px solid #fff; border-right: 0; margin-left: 2px; }
.arrow:active:not(:disabled) { transform: translate(2px, 3px); box-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.arrow:disabled { opacity: .3; cursor: default; }
.card-wrap.info ~ .arrow.prev { left: 150px; }
.card-wrap.info ~ .arrow.next { right: 150px; }

.flip-btn {
  position: absolute; left: 50%; top: 612px; transform: translateX(-50%);
  height: 56px; padding: 0 30px; border-radius: 28px;
  background: var(--maroon); border: 2px solid #c9c9c9;
  font-size: 24px; font-weight: 700; letter-spacing: 1px; color: #eee;
  text-shadow: 0 0 1px #000, 1px 1px 0 #555;
  box-shadow: inset 0 0 8px rgba(255,255,255,.35), 2px 3px 0 rgba(0,0,0,.45);
  transition: background .3s;
}
.flip-btn[hidden] { display: none; }
.flip-btn.to2d { background: var(--navy); }
.flip-btn:active { transform: translate(calc(-50% + 2px), 2px); box-shadow: 0 1px 0 rgba(0,0,0,.45); }

.dots {
  position: absolute; left: 50%; top: 706px; transform: translateX(-50%);
  display: flex; gap: 12px;
}
.dots button {
  width: 18px; height: 18px; border-radius: 50%;
  background: #EDEDED; border: 1.5px solid #cfcfcf;
  position: relative;
}
.dots button::before { content: ""; position: absolute; inset: -8px -5px; }   /* bigger tap target */
.dots button.on { background: var(--yellow); border-color: var(--yellow-dark); }
.dots.many { gap: 8px; }
.dots.many button { width: 14px; height: 14px; }
