/* -------------------------------------------------------------------------
   "Two ways to learn" on /how-to-play: the videos, and the simulator running.

   Carries its own copies of the few scoreboard rules it needs (.pd-caption,
   .pd-score__*, .pd-card*, .ov-ball*) because play-demo.css belongs to the
   tutorial page and pulling the whole thing in here would drag the tutorial's
   layout along with it.
   ------------------------------------------------------------------------- */

.learn-demo {
  --ld-green: #22c55e;
  --ld-gold: #d99a32;
  --ld-line: rgba(255, 255, 255, 0.1);
  --ld-panel: #10141c;
  --ld-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --ov-pending: #f2c230;

  padding: 70px 20px 40px;
  background: #07090d;
  color: #fff;
}

.learn-demo__inner {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.learn-demo__header {
  max-width: 720px;
  margin-bottom: 30px;
}

.learn-demo__eyebrow {
  margin: 0 0 12px;
  font-family: var(--ld-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ld-gold);
}

.learn-demo__header h2 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
}

.learn-demo__lead {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

.learn-demo__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.learn-demo__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--ld-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
}

.learn-demo__copy {
  margin-top: auto;
  padding-top: 18px;
}

.learn-demo__tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--ld-line);
  font-family: var(--ld-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.learn-demo__copy h3 {
  margin: 0 0 10px;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.15;
}

.learn-demo__copy p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

.learn-demo__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  transition: 0.18s ease;
}

.learn-demo__btn--primary {
  background: var(--ld-green);
  color: #07130a;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.28);
}

.learn-demo__btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ld-line);
  color: rgba(255, 255, 255, 0.9);
}

.learn-demo__btn:hover { transform: translateY(-1px); }

/* ----- The video stills -------------------------------------------------- */

/* One big frame and three small. All of them are grabs from the videos rather
   than the branded thumbnails: the job here is to show that a person is
   standing at a table, and cover art cannot do that. */
.learn-demo__frames {
  display: grid;
  /* Six columns so the stills can sit three up (span 2) or two up (span 3)
     without a ragged last row. */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.learn-demo__frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--ld-line);
  background: #05070a;
  transition: 0.16s ease;
}

.learn-demo__frame { grid-column: span 2; }
.learn-demo__frame--lead { grid-column: 1 / -1; border-radius: 14px; }
.learn-demo__frame--wide { grid-column: span 3; }

.learn-demo__frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.learn-demo__frame:hover { border-color: rgba(34, 197, 94, 0.55); }
.learn-demo__frame:hover img { transform: scale(1.02); }

.learn-demo__frame img { transition: transform 0.25s ease; }

.learn-demo__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.learn-demo__play::before {
  content: "";
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(7, 9, 13, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.learn-demo__play::after {
  content: "";
  position: absolute;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
  transform: translateX(3px);
}

/* ----- The table ---/* ----- The table ------------------------------------------------------- */

.learn-demo__crt {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #05070a;
  padding: 12px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5), inset 0 0 80px rgba(0, 0, 0, 0.7);
}

.learn-demo__crt::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 9px;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 3px
  );
  mix-blend-mode: soft-light;
}

.learn-demo__crt canvas {
  display: block;
  width: 100%;
  aspect-ratio: 114 / 64;
  border-radius: 7px;
}

.learn-demo .pd-caption {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--ld-line);
  border-left: 3px solid var(--ld-green);
  background: #10141c;
  font-family: var(--ld-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  opacity: 0;
  transition: opacity 0.22s ease, border-color 0.22s ease;
}

.learn-demo .pd-caption.is-on { opacity: 1; }
.learn-demo .pd-caption--aim { border-left-color: var(--ld-gold); }
.learn-demo .pd-caption--bad { border-left-color: #ef4444; }
.learn-demo .pd-caption--end { border-left-color: rgba(255, 255, 255, 0.55); }

/* ----- The score under it ---------------------------------------------- */

.learn-demo__score {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--ld-line);
  background: #10141c;
}

.learn-demo__scorehead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.learn-demo .pd-score__label {
  font-family: var(--ld-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.learn-demo .pd-score__total {
  font-family: var(--ld-mono);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
}

.learn-demo .pd-score__total.is-good { color: var(--ld-green); }
.learn-demo .pd-score__total.is-bad { color: #ef4444; }

.learn-demo .pd-score__rail {
  min-height: 30px;
  margin-top: 10px;
  font-size: 18px;
}

.learn-demo .pd-score__notes {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.learn-demo .pd-note {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ld-line);
  font-family: var(--ld-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
}

.learn-demo .pd-note--good,
.learn-demo .pd-note--great { border-color: rgba(34, 197, 94, 0.5); color: #86efac; }
.learn-demo .pd-note--pending { border-color: rgba(242, 194, 48, 0.6); color: var(--ov-pending); border-style: dashed; }
.learn-demo .pd-note--bad { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
.learn-demo .pd-note--end { border-color: rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.7); }

.learn-demo .pd-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ld-line);
}

.learn-demo .pd-card__rounds { display: flex; gap: 6px; }

.learn-demo .pd-card__round {
  min-width: 68px;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid var(--ld-line);
  font-family: var(--ld-mono);
  text-align: center;
}

.learn-demo .pd-card__round span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.learn-demo .pd-card__round b {
  display: block;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.55);
}

.learn-demo .pd-card__round.is-done { border-color: rgba(34, 197, 94, 0.45); }
.learn-demo .pd-card__round.is-done b { color: var(--ld-green); }
.learn-demo .pd-card__round.is-live { border-color: var(--ld-gold); }
.learn-demo .pd-card__round.is-live b { color: var(--ld-gold); }

.learn-demo .pd-card__total {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--ld-mono);
}

.learn-demo .pd-card__total span {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.learn-demo .pd-card__total b { font-size: 24px; color: #fff; }
.learn-demo .pd-card__total i { font-style: normal; font-size: 11px; color: rgba(255, 255, 255, 0.45); }

/* ----- The copy beside it ---------------------------------------------- */

.learn-demo__eyebrow {
  margin: 0 0 10px;
  font-family: var(--ld-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ld-gold);
}

.learn-demo__copy h2 {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.02;
}

.learn-demo__lead {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.74);
}

.learn-demo__facts {
  display: flex;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.learn-demo__facts li {
  flex: 1;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--ld-line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
}

.learn-demo__facts b {
  display: block;
  margin-bottom: 4px;
  font-family: var(--ld-mono);
  font-size: 24px;
  color: var(--ld-green);
}

.learn-demo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.learn-demo__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  transition: 0.18s ease;
}

.learn-demo__btn--primary {
  background: var(--ld-green);
  color: #07130a;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.28);
}

.learn-demo__btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ld-line);
  color: rgba(255, 255, 255, 0.88);
}

.learn-demo__btn:hover { transform: translateY(-1px); }

.learn-demo__shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.learn-demo__shot {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ld-line);
  background: #10141c;
  text-decoration: none;
  transition: 0.16s ease;
}

.learn-demo__shot:hover { border-color: rgba(34, 197, 94, 0.5); transform: translateY(-2px); }

.learn-demo__shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  object-position: top center;
}

.learn-demo__shot span {
  display: block;
  padding: 7px 9px;
  font-family: var(--ld-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

/* ----- Ball rail (shared with the tutorial and the stream overlay) ------- */

.learn-demo .ov-balls { display: flex; align-items: center; gap: 0.15em; flex-wrap: wrap; }
.learn-demo .ov-ball { display: block; width: 1.55em; height: 1.55em; flex: none; }
.learn-demo .ov-ball svg { display: block; width: 100%; height: 100%; }

.learn-demo .ov-ball.is-pending {
  opacity: 0.55;
  border-radius: 50%;
  outline: 0.12em dashed var(--ov-pending);
  outline-offset: -0.06em;
}

.learn-demo .ov-ball.is-lost {
  opacity: 0.38;
  border-radius: 50%;
  outline: 0.12em dashed rgba(245, 247, 250, 0.45);
  outline-offset: -0.06em;
}

.learn-demo .ov-ball--slop,
.learn-demo .ov-ball--scratch,
.learn-demo .ov-ball--badbreak { opacity: 0.75; }

/* ----- Narrow ----------------------------------------------------------- */

@media (max-width: 900px) {
  .learn-demo__cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .learn-demo { padding: 46px 16px 30px; }
  .learn-demo__panel { padding: 13px; border-radius: 16px; }
  .learn-demo__crt { padding: 8px; }
  .learn-demo__crt::after { inset: 8px; }
  .learn-demo .pd-caption { font-size: 11.5px; min-height: 36px; }
  .learn-demo .pd-card { justify-content: flex-start; }
  .learn-demo__play::before { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .learn-demo .pd-caption { transition: none; }
}
