#baccarat-guide {
  --paper: #f5e9db;
  --copy: #e4dfe1;
  --muted: #c0aeb8;
  --label: #eccb9c;
  --line: #614550;
  scroll-margin-top: 100px;
}
.beginner-guide {
  background: #18141c;
  color: var(--copy);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(20px, 3.2vw, 46px);
}
.beginner-intro { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.beginner-intro img { width: clamp(65px, 7vw, 92px); height: auto; flex-shrink: 0; }
.beginner-intro h2 { color: var(--paper); font-size: clamp(27px, 3.4vw, 44px); line-height: 1.25; margin: 4px 0 10px; }
.beginner-intro p { font-size: 16px; line-height: 1.75; margin: 0; max-width: 60ch; }
.beginner-intro p:first-child { color: var(--label); font-size: 14px; font-weight: 700; }
.beginner-layout { display: grid; grid-template-columns: minmax(160px, 0.29fr) minmax(0, 1fr); gap: clamp(20px, 3.2vw, 46px); padding-top: 28px; align-items: start; }
#lesson-index, .lesson-chapter, .chapter-title h3 { scroll-margin-top: 100px; }
#lesson-index { margin: 0; }
#lesson-index h3 { font-size: 17px; margin: 0 0 12px; color: var(--paper); }
#lesson-index ol { list-style: none; padding: 0; margin: 0; }
#lesson-index a { display: flex; align-items: baseline; gap: 10px; border-left: 2px solid #503840; padding: 9px 10px; color: var(--copy); font-size: 15px; line-height: 1.55; text-decoration: none; }
#lesson-index a span, .chapter-title > span { color: var(--label); font: 600 13px/1.4 ui-monospace, monospace; }
#lesson-index a:hover, #lesson-index a[aria-current] { border-color: #dfb57c; background: #35232d; color: #fff0d8; }
@media (min-width: 751px) and (min-height: 620px) { #lesson-index { position: sticky; top: 98px; } }
.lesson-stream { min-width: 0; }
.lesson-chapter { padding: 0 0 28px; margin-bottom: 29px; border-bottom: 1px solid var(--line); }
.lesson-chapter:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.chapter-title { display: flex; align-items: baseline; gap: 12px; }
.chapter-title h3 { font-size: clamp(21px, 2.1vw, 29px); line-height: 1.4; margin: 0; color: var(--paper); }
.lesson-chapter p, .lesson-chapter li, .lesson-table { font-size: 16px; line-height: 1.8; }
.lesson-chapter p { margin: 12px 0; }
.lesson-chapter p:last-child { margin-bottom: 0; }
.lesson-chapter ol:not(.lesson-beads) { padding-left: 1.6em; }
.lesson-chapter ol:not(.lesson-beads) li { margin: 7px 0; padding-left: 3px; }
.lesson-chapter li::marker { color: var(--label); font-weight: bold; }
.lesson-chapter b { color: var(--paper); }
.lesson-chapter a, .beginner-guide a:focus-visible { color: #ffe1ad; text-underline-offset: 3px; }
.beginner-guide :is(a,button):focus-visible { outline: 2px solid #f1c587; outline-offset: 2px; }
.lesson-example, .lesson-check { background: #2b202b; border: 1px solid #755360; border-radius: 8px; margin: 18px 0; padding: 16px 19px; min-width: 0; }
.lesson-chapter h4, .lesson-check legend { color: var(--label); font-size: 16px; font-weight: 700; margin: 0 0 5px; }
.lesson-example p, .lesson-example ol { margin-block: 6px; }
.outcome-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 16px 0; }
.outcome-strip > div { display: grid; gap: 4px; background: #2d2635; padding: 12px; border-radius: 6px; font-size: 14px; }
.outcome-strip > div:nth-child(1) b, .lesson-beads .play b { color: #a8d0ff; }
.outcome-strip > div:nth-child(2) b, .lesson-beads .bank b { color: #ffadad; }
.outcome-strip > div:nth-child(3) b, .lesson-beads .tie b { color: #ade8bf; }
.lesson-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.lesson-table caption { color: var(--paper); text-align: left; font-weight: 700; margin-bottom: 7px; }
.lesson-table th, .lesson-table td { text-align: left; vertical-align: top; border-bottom: 1px solid #503c47; padding: 8px 10px; }
.lesson-table thead { background: #302530; color: var(--label); }
.lesson-table tbody th { width: 27%; color: var(--paper); font-weight: 600; }
.bead-reading { display: flex; gap: 18px; align-items: flex-start; margin: 16px 0; }
.lesson-beads { display: grid; grid-template-rows: repeat(6, 28px); grid-template-columns: repeat(2, 42px); grid-auto-flow: column; flex: none; padding: 0; margin: 0; list-style: none; background: repeating-linear-gradient(to bottom, transparent 0 27px, #594652 27px 28px), #2b232d; border: 1px solid #705965; }
.lesson-beads li { display: flex; gap: 3px; align-items: center; justify-content: center; border-right: 1px solid #594652; font-size: 15px; }
.lesson-beads small { font-size: 10px; color: var(--muted); }
.chapter-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.chapter-links a { padding: 8px 0; font-size: 13px; }
.chapter-links a:first-child { margin-right: auto; }
.lesson-source a { font-size: 13px; }
.check-answers { display: flex; flex-wrap: wrap; gap: 8px; }
.check-answers button { border: 1px solid #996e7d; border-radius: 5px; padding: 9px 12px; background: #201820; color: var(--paper); font: inherit; cursor: pointer; }
.check-answers button[aria-pressed=true] { color: #241922; background: #edcda4; }
.check-result:empty { display: none; }
@media (max-width: 750px) {
  .beginner-layout { display: block; padding-top: 18px; }
  #lesson-index { margin-bottom: 26px; }
  #lesson-index ol { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; }
  #lesson-index a { gap: 5px; align-items: center; font-size: 14px; padding: 8px 5px; min-height: 44px; }
  #lesson-index a span { font-size: 11px; }
  .beginner-guide { padding: 17px 14px; }
  .lesson-table td, .lesson-table th { padding: 7px 5px; }
  .lesson-example, .lesson-check { padding: 13px; }
}
@media (max-width: 420px) {
  #lesson-index ol { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .beginner-intro { align-items: flex-start; gap: 10px; }
  .beginner-intro img { width: 48px; }
  .outcome-strip { gap: 4px; }
  .outcome-strip > div { padding: 8px; }
}
.lesson-hand { margin: 18px 0; border: 1px solid #664d59; border-radius: 8px; background: #241c27; padding: 16px; }
.lesson-hand figcaption { color: var(--label); font-weight: 700; margin-bottom: 12px; }
.hand-line { display: flex; gap: clamp(8px, 2vw, 18px); align-items: center; margin: 8px 0; }
.hand-cards { display: flex; align-items: center; gap: 5px; }
.hand-cards span { display: grid; place-content: center; width: clamp(32px, 6vw, 42px); height: 48px; border-radius: 4px; color: #221c24; background: #fff3de; font: 700 17px/1 Georgia, serif; }
.hand-cards .red-suit { color: #9d233d; }
.hand-cards .third-card { margin-left: 8px; }
.lesson-hand p { font-size: 14px; color: var(--muted); }
