/* Scoped to Book Match and its activity card in the Learn More hub. */
.v5-learning-card .v5-learning-img.bm-hub-art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 12px;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 85%, #e6b766 0%, #224a52 66%, #06283b 100%);
}
.v5-learning-card .bm-hub-art img {
  width: 33%;
  max-width: 106px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border: 3px solid #fff8ee;
  background: #fff8ee;
  border-radius: 12px;
  box-shadow: 0 8px 16px #06283b7a;
}
.bm-hub-art img:first-child { transform: translateX(7px) rotate(-13deg); }
.bm-hub-art img:nth-child(2) { z-index: 1; transform: translateY(-8px); }
.bm-hub-art img:last-child { transform: translateX(-7px) rotate(13deg); }

.bm-page {
  --bm-ink: #06283b;
  --bm-gold: #e8a02a;
  --bm-teal: #176b69;
  --bm-cream: #fff8ee;
  color: var(--bm-ink);
  background: radial-gradient(ellipse at 50% 26%, #fffdf9 0%, #f3efe7 84%);
  padding: 24px 0 44px;
}
.bm-shell { width: min(100% - 28px, 730px); margin: 0 auto; }
.bm-breadcrumb { display: flex; flex-wrap: wrap; gap: 4px 9px; align-items: baseline; font-size: .82rem; }
.bm-breadcrumb a, .bm-books a { color: #245e5c; text-decoration: underline; text-underline-offset: 3px; }
.bm-intro { margin: 24px 0 16px; text-align: center; }
.bm-kicker { color: #245e5c; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.bm-intro h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); line-height: 1.02; color: var(--bm-ink); margin: 5px 0 8px; }
.bm-intro p { margin: 0; color: #3e5863; }
.bm-panel {
  max-width: 570px;
  margin: 0 auto;
  padding: clamp(10px, 3vw, 19px);
  border-radius: 22px;
  background: var(--bm-ink);
  color: var(--bm-cream);
  box-shadow: 0 12px 28px #06283b26;
}
.bm-toolbar { display: flex; gap: 12px; align-items: center; padding: 0 3px 13px; }
.bm-toolbar[hidden] { display: none; }
.bm-stat { display: grid; gap: 0; line-height: 1.2; min-width: 42px; }
.bm-stat span { color: #d4e4e5; font-size: .72rem; }
.bm-stat strong { color: #fff8ee; font-size: .95rem; font-variant-numeric: tabular-nums; }
.bm-reset {
  appearance: none;
  min-height: 44px;
  margin-inline-start: auto;
  border: 0;
  border-radius: 999px;
  background: var(--bm-gold);
  color: var(--bm-ink);
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  padding: 6px 13px;
  cursor: pointer;
}
.bm-reset:hover { background: #f7be63; }
.bm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 1.5vw, 10px); }
.bm-card {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid #548887;
  border-radius: clamp(7px, 2vw, 15px);
  background: radial-gradient(ellipse at 33% 22%, #277c77, #124c52 85%);
  color: #ffe8be;
  font: inherit;
  cursor: pointer;
}
.bm-card[data-state="down"]:hover { border-color: var(--bm-gold); }
.bm-card:focus-visible, .bm-reset:focus-visible { outline: 3px solid #fff2cd; outline-offset: 2px; z-index: 2; }
.bm-card img,.bm-card .bm-name {
  grid-area: 1/1;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: inherit;
}
.bm-card [hidden] { display: none; }
.bm-card[data-state="up"], .bm-card[data-state="matched"] { background: #fff8ee; color: var(--bm-ink); border-color: #fff8ee; }
.bm-card[data-state="matched"] { border-color: #76cbb3; cursor: default; }
.bm-card[data-state="matched"]::after {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #176b69;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
}
.bm-back { font-family: Georgia, serif; font-size: clamp(1.45rem, 5vw, 2.65rem); line-height: 1; }
.bm-card .bm-name { display: grid; place-items: center; padding: 4px; font-size: clamp(.58rem, 2.4vw, .88rem); line-height: 1.06; overflow-wrap: anywhere; }
.bm-card .bm-name[hidden] { display: none; }
.bm-feedback { min-height: 2.5em; margin: 10px 3px 0; color: #fff8ee; font-size: .85rem; line-height: 1.25; text-align: center; display: grid; place-items: center; }
.bm-feedback[data-kind="match"], .bm-feedback[data-kind="done"] { color: #c7f1e3; }
.bm-feedback[data-kind="miss"] { color: #ffe2ad; }
.bm-books { display: flex; justify-content: center; flex-wrap: wrap; column-gap: 15px; row-gap: 6px; margin-top: 18px; font-size: .8rem; }
.bm-books span { color: #3e5863; }
.bm-skip { position: absolute; inset: 8px auto auto 8px; z-index: 999; transform: translateY(-180%); background: #fff8ee; color: #06283b; padding: 8px 12px; }
.bm-skip:focus { transform: none; }
@media (max-width: 450px) {
  .bm-page { padding-top: 16px; }
  .bm-intro { margin-top: 18px; }
  .bm-breadcrumb { font-size: .72rem; }
}
