/* ============================================================
   Block Planet Card Camp — 2026 classroom design system
   Bright, touch-first, projection-safe, static-site friendly.
   ============================================================ */

:root {
  --bp-bg: #f4f8fb;
  --bp-paper: #ffffff;
  --bp-soft: #edf5ff;
  --bp-soft-yellow: #fff8da;
  --bp-ink: #10264a;
  --bp-text: #243b60;
  --bp-muted: #647795;
  --bp-line: #d4e1f2;
  --bp-blue: #1769e8;
  --bp-blue-2: #2ba9f4;
  --bp-primary: #1769e8;
  --bp-gold: #ffc400;
  --bp-gold-2: #9a6a00;
  --bp-red: #ed3154;
  --bp-green: #1c9c63;
  --bp-purple: #7857e8;
  --bp-orange: #ef8d24;
  --bp-shadow: 0 12px 30px rgba(26, 57, 102, .11);
  --bp-shadow-sm: 0 6px 16px rgba(26, 57, 102, .09);
  --header-h: 76px;
  --radius: 8px;
  --touch: 48px;

  --t-grass: #4baf65;
  --t-fire: #e75b36;
  --t-water: #398edb;
  --t-lightning: #e8b000;
  --t-psychic: #8a59c7;
  --t-fighting: #b97943;
  --t-darkness: #4c5364;
  --t-metal: #748a9d;
  --t-dragon: #6a62bf;
  --t-colorless: #8b929c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--bp-text);
  background: var(--bp-bg);
  font-family: "Noto Sans TC", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: -2;
  background: url("../img/generated/blockplanet-bright-card-bg.png") center top / cover no-repeat;
  opacity: .12;
}
body::after {
  content: "";
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: -1;
  background: rgba(247, 250, 252, .80);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4, .brand, .lesson-title, .rank, .timer-display {
  margin-top: 0;
  color: var(--bp-ink);
  font-family: "M PLUS Rounded 1c", "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}
h1 { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.15; }
h2 { line-height: 1.25; }
p { margin-top: 0; }
[hidden] { display: none !important; }
.wrap { width: min(1560px, calc(100% - 48px)); margin-inline: auto; }
.page-main { padding-top: 28px; padding-bottom: 48px; }
.spacer { flex: 1; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid #e7c13c;
  border-radius: 999px;
  color: #6f5200;
  background: #fff4b8;
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
}
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: clamp(1.5rem, 2.5vw, 2.1rem); }
.section-sub { margin: 0 0 20px; color: var(--bp-muted); }
.card {
  border: 1px solid var(--bp-line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.96);
  box-shadow: var(--bp-shadow-sm);
  padding: 24px;
}

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-h);
  border-bottom: 1px solid var(--bp-line);
  background: rgba(255,255,255,.95);
  box-shadow: 0 4px 18px rgba(31, 67, 111, .06);
  backdrop-filter: blur(16px);
}
.site-header .wrap { min-height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap; font-weight: 900; }
.brand-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; box-shadow: 0 5px 14px rgba(255,196,0,.28); }
.site-header .nav { margin-left: auto; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.site-header .nav > a, .mode-toggle button {
  min-height: var(--touch);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--bp-text);
  background: transparent;
  text-decoration: none;
  font-weight: 800;
}
.site-header .nav > a:hover, .site-header .nav > a.active { color: #fff; background: var(--bp-blue); box-shadow: 0 8px 18px rgba(23,105,232,.22); }
.mode-toggle { display: flex; padding: 3px; margin-left: 6px; border: 1px solid #bdd6f5; border-radius: 8px; background: #f1f7ff; }
.mode-toggle button { min-height: 40px; padding: 6px 13px; color: var(--bp-muted); }
.mode-toggle button.on { color: #372b00; border-color: #f1c124; background: #ffd731; box-shadow: 0 4px 10px rgba(255,196,0,.2); }
.only-advanced { display: none !important; }
.mode-advanced .only-advanced { display: initial !important; }
.mode-advanced .only-beginner { display: none !important; }
.site-footer { padding: 24px 0 36px; border-top: 1px solid var(--bp-line); color: var(--bp-muted); background: rgba(255,255,255,.8); text-align: center; font-size: .88rem; }

/* CSS line icons: clear symbols, no emoji font */
.bp-icon {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-block;
  color: currentColor;
  vertical-align: -4px;
}
.bp-icon::before, .bp-icon::after { content: ""; position: absolute; }
.bp-icon::before { inset: 3px; border: 2px solid currentColor; border-radius: 4px; }
.bp-icon::after { left: 7px; right: 7px; top: 7px; bottom: 7px; border: 2px solid currentColor; border-radius: 50%; }
.i-home::before { left: 4px; right: 4px; top: 9px; bottom: 2px; border-radius: 2px; }
.i-home::after { left: 5px; top: 3px; width: 10px; height: 10px; border-right: 0; border-bottom: 0; border-radius: 2px 0 0; transform: rotate(45deg); }
.i-learn::before { inset: 2px 3px; border-radius: 2px; border-left-width: 4px; }
.i-learn::after { left: 9px; top: 4px; bottom: 4px; border: 0; border-left: 2px solid currentColor; border-radius: 0; }
.i-battle::before, .i-badge::before, .i-win::before { inset: 2px 4px 8px; border-radius: 2px 2px 8px 8px; }
.i-battle::after, .i-badge::after, .i-win::after { left: 9px; top: 12px; width: 4px; height: 8px; border: 0; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; border-radius: 0; transform: skew(-14deg); }
.i-judge::before { inset: 3px; border-radius: 50%; box-shadow: inset 0 0 0 3px currentColor; }
.i-judge::after { left: 2px; right: 2px; top: 10px; bottom: auto; border: 0; border-top: 2px solid currentColor; }
.i-type::before { inset: 1px 4px 5px; border-radius: 2px 10px 10px; transform: rotate(45deg); }
.i-type::after { left: 9px; top: 3px; width: 3px; height: 3px; border-width: 1px; }
.i-timer::before { inset: 4px 2px 2px; border-radius: 50%; }
.i-timer::after { left: 10px; top: 7px; width: 5px; height: 5px; border: 0; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; border-radius: 0; }
.i-refresh::before { inset: 3px; border-radius: 50%; border-left-color: transparent; }
.i-refresh::after { left: 2px; top: 3px; width: 6px; height: 6px; border: 0; border-top: 2px solid currentColor; transform: rotate(-20deg); }
.i-close::before, .i-close::after { left: 9px; top: 2px; width: 2px; height: 16px; border: 0; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.i-close::after { transform: rotate(-45deg); }
.i-plus::after { left: 5px; right: 5px; top: 10px; bottom: auto; height: 2px; border: 0; background: currentColor; border-radius: 0; box-shadow: 5px -5px 0 -0 currentColor; transform: none; }
.i-lock::before { inset: 8px 3px 2px; }
.i-lock::after { left: 6px; top: 1px; width: 8px; height: 9px; border: 2px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; }
.i-card::before, .i-rules::before, .i-quiz::before { inset: 2px 4px; border-radius: 2px; }
.i-card::after, .i-rules::after, .i-quiz::after { left: 7px; right: 7px; top: 7px; bottom: auto; height: 2px; border: 0; border-radius: 0; background: currentColor; box-shadow: 0 5px currentColor, 0 10px currentColor; }
.i-screen::before { inset: 3px 1px 6px; }
.i-screen::after { left: 8px; right: 8px; top: 17px; bottom: auto; border: 0; border-top: 2px solid currentColor; border-radius: 0; }
.i-print::before { inset: 8px 2px 2px; border-radius: 2px; }
.i-print::after { left: 5px; top: 1px; width: 10px; height: 12px; border-radius: 1px; background: currentColor; box-shadow: inset 0 0 0 2px #fff; }

/* Buttons and forms */
.btn, .icon-btn {
  min-height: var(--touch);
  border: 1px solid var(--bp-blue);
  border-radius: 8px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--bp-blue);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(23,105,232,.16);
}
.btn:hover { transform: translateY(-1px); filter: brightness(.98); }
.btn.ghost { color: var(--bp-ink); border-color: #b9d0ec; background: #fff; box-shadow: none; }
.btn.gold { color: #312500; border-color: #e2ac00; background: var(--bp-gold); box-shadow: 0 6px 14px rgba(255,196,0,.2); }
.btn.danger { color: #fff; border-color: var(--bp-red); background: var(--bp-red); }
.btn.sm { min-height: 42px; padding: 8px 13px; font-size: .88rem; }
.btn:disabled, .btn.disabled { opacity: .42; pointer-events: none; }
.icon-btn { width: 48px; padding: 0; color: var(--bp-ink); border-color: var(--bp-line); background: #fff; box-shadow: none; font-size: 1.35rem; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.toolbar > * { flex: 0 0 auto; }
.toolbar > .spacer { flex: 1 1 auto; }
.toolbar > .section-title { white-space: nowrap; }
#ctabs { display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; }
#ctabs > a { flex: 0 0 auto; white-space: nowrap; }
.field { margin: 0 0 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--bp-ink); font-weight: 800; }
.field input, .field select, input, select {
  width: 100%; min-height: 50px; border: 1px solid #b9cde6; border-radius: 8px; padding: 10px 13px; color: var(--bp-ink); background: #fff; outline: none;
}
.field input:focus, .field select:focus, input:focus, select:focus { border-color: var(--bp-blue); box-shadow: 0 0 0 3px rgba(23,105,232,.12); }

/* Home */
.hero { min-height: min(660px, calc(100svh - var(--header-h) - 70px)); padding: 24px 0 32px; display: grid; place-items: center; align-content: center; text-align: center; }
.hero h1 { margin: 12px 0 12px; font-size: clamp(2.7rem, 5vw, 4.8rem); line-height: 1.04; }
.hero .hl { display: inline-block; margin-top: .12em; color: var(--bp-blue); text-shadow: 0 3px 0 #ffe47d; }
.hero .lead { max-width: 880px; margin: 0 auto; color: var(--bp-muted); font-size: clamp(.98rem, 1.45vw, 1.16rem); line-height: 1.75; }
.hero-actions { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.hero-actions .btn { min-width: 156px; }
.mascot-team {
  width: max-content;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(5, 82px);
  grid-template-rows: 66px 98px;
  column-gap: 10px;
  place-items: center;
  isolation: isolate;
}
.mascot-team img {
  width: 78px;
  height: 78px;
  max-width: none;
  aspect-ratio: 1;
  box-sizing: border-box;
  border: 4px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 8px 20px rgba(43, 78, 120, .14);
}
.mascot-team .mascot-left-outer { grid-column: 1; grid-row: 2; transform: translateY(9px); }
.mascot-team .mascot-left-inner { grid-column: 2; grid-row: 2; transform: translateY(2px); }
.mascot-team .mascot-top { grid-column: 3; grid-row: 1; z-index: 2; transform: translateY(-10px); }
.mascot-team .team-logo { grid-column: 3; grid-row: 2; z-index: 1; width: 98px; height: 98px; padding: 5px; border-color: #ffc928; object-fit: contain; background: #fff7ce; }
.mascot-team .mascot-right-inner { grid-column: 4; grid-row: 2; transform: translateY(2px); }
.mascot-team .mascot-right-outer { grid-column: 5; grid-row: 2; transform: translateY(9px); }
.guide .bubble { width: fit-content; max-width: min(720px, 100%); margin: 14px auto 0; padding: 9px 15px; border: 1px solid #efd164; border-radius: 8px; background: #fff8d8; color: #624b00; font-size: .92rem; font-weight: 700; }
.pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.pillar { position: relative; min-height: 330px; padding: 32px; overflow: hidden; text-decoration: none; }
.pillar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--bp-blue); }
.pillar.battle::before { background: var(--bp-gold); }
.pillar h2 { font-size: 2rem; margin: 18px 0 6px; }
.pill-emoji { width: 58px; height: 58px; display: grid; place-items: center; color: var(--bp-blue); border: 1px solid #c5daf4; border-radius: 8px; background: var(--bp-soft); }
.pill-list { padding: 0; list-style: none; color: var(--bp-muted); }
.pill-list li { position: relative; padding-left: 22px; margin: 7px 0; }
.pill-list li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--bp-gold); }

/* Learning heading and navigation */
.page-heading { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-heading h1 { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; font-size: clamp(2rem, 4vw, 3.2rem); }
.page-heading p { margin: 0; color: var(--bp-muted); }
.mascot-tabs { display: flex; }
.mascot-tabs img { width: 62px; height: 62px; margin-left: -9px; border: 3px solid #fff; border-radius: 50%; object-fit: cover; box-shadow: var(--bp-shadow-sm); }
.subnav {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 30;
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  padding: 6px;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--bp-shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a { min-height: 44px; padding: 9px 15px; display: inline-flex; align-items: center; gap: 8px; border-radius: 6px; color: var(--bp-text); text-decoration: none; font-weight: 800; }
.subnav a.active { color: #fff; background: var(--bp-blue); }

/* Lesson hub */
.lesson-hub-head { min-height: 124px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.lesson-hub-head h2 { margin: 8px 0 4px; font-size: 2rem; }
.lesson-hub-head p { margin: 0; color: var(--bp-muted); }
.lesson-progress { min-width: 118px; padding: 16px; border: 1px solid #f1cf5d; border-radius: 8px; background: var(--bp-soft-yellow); text-align: center; }
.lesson-progress b { display: block; color: var(--bp-ink); font: 900 2.4rem/1 "M PLUS Rounded 1c"; }
.lesson-progress b small { font-size: 1rem; color: var(--bp-muted); }
.lesson-progress span { color: var(--bp-muted); font-size: .8rem; }
.lesson-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lesson-card {
  position: relative;
  min-height: 204px;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(108px, 42%);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px 12px;
  color: var(--bp-text);
  background: #fff;
  box-shadow: var(--bp-shadow-sm);
  text-align: left;
  overflow: hidden;
}
.lesson-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--bp-blue); }
.lesson-card:hover { transform: translateY(-3px); border-color: #87b5ef; box-shadow: var(--bp-shadow); }
.lesson-card:hover .lesson-illustration img { transform: scale(1.035); }
.lesson-card.done::after { background: var(--bp-green); }
.lesson-card-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.lesson-index { color: var(--bp-blue); font-weight: 900; font-size: .8rem; }
.lesson-state { color: var(--bp-muted); font-size: .72rem; font-weight: 800; }
.lesson-card.done .lesson-state { color: var(--bp-green); }
.lesson-card-copy { min-width: 0; display: flex; flex-direction: column; align-self: stretch; justify-content: center; gap: 9px; padding-bottom: 4px; }
.lesson-card-title-row { display: flex; align-items: center; gap: 10px; }
.lesson-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; color: var(--bp-blue); border-radius: 8px; background: var(--bp-soft); }
.lesson-title { min-width: 0; font-size: 1.12rem; line-height: 1.25; font-weight: 900; }
.lesson-story { color: #50698b; font-size: .76rem; line-height: 1.55; font-weight: 650; }
.lesson-meta { width: max-content; max-width: 100%; padding: 5px 8px; color: #2e5d96; border: 1px solid #cfe0f5; border-radius: 999px; background: #f3f8ff; font-size: .68rem; font-weight: 800; }
.lesson-illustration { width: 100%; aspect-ratio: 1; align-self: center; justify-self: end; display: grid; place-items: center; border: 1px solid #e1eaf5; border-radius: 8px; background: #fffdf8; overflow: hidden; }
.lesson-illustration img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }

/* Lesson deck: designed to fit a tablet view without page scrolling */
body.lesson-open .page-heading, body.lesson-open .subnav { display: none; }
body.lesson-open .page-main { padding-top: 16px; }
body.lesson-open { overflow: hidden; }
body.lesson-open .site-footer { display: none; }
.lesson-deck { min-height: calc(100svh - var(--header-h) - 32px); display: grid; grid-template-rows: 70px 1fr 68px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; box-shadow: var(--bp-shadow); overflow: hidden; }
.lesson-deck-head { padding: 8px 18px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--bp-line); }
.lesson-deck-head > div:nth-child(2) { min-width: 0; display: grid; align-content: center; gap: 2px; }
.lesson-deck-head h2 { margin: 0; font-size: 1.45rem; line-height: 1.2; }
.lesson-deck-head span { color: var(--bp-muted); font-size: .75rem; font-weight: 800; }
.slide-count { min-width: 64px; padding: 8px 10px; border-radius: 8px; color: var(--bp-blue); background: var(--bp-soft); text-align: center; font-weight: 900; }
.lesson-slide { min-height: 0; padding: 18px 24px; display: grid; grid-template-rows: auto minmax(300px, 1fr) auto; gap: 14px; overflow: hidden; }
.lesson-slide-copy { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 16px; }
.lesson-slide-copy .eyebrow { grid-row: 1 / 3; }
.lesson-slide-copy h3 { margin: 0; font-size: clamp(1.35rem, 2.4vw, 2rem); }
.lesson-slide-copy p { margin: 0; color: var(--bp-muted); }
.lesson-visual { min-height: 0; display: grid; place-items: center; border: 1px solid #dbe7f5; border-radius: 8px; padding: 14px; background: #f8fbff; overflow: hidden; }
.lesson-visual.is-fitted { position: relative; }
.lesson-visual.is-fitted > * { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(var(--fit-scale)); transform-origin: center; }
.lesson-takeaways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lesson-takeaways div { min-height: 58px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; font-weight: 700; }
.lesson-takeaways b { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; color: #352800; background: var(--bp-gold); }
.lesson-deck-nav { padding: 10px clamp(96px, 7vw, 118px) 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--bp-line); background: #f8fbff; }
.lesson-deck-nav .btn { flex: 0 0 auto; white-space: nowrap; }
.slide-dots { display: flex; gap: 8px; }
.slide-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: #b7c5d7; }
.slide-dots button.on { width: 30px; border-radius: 8px; background: var(--bp-blue); }

/* TCG media components */
.tcg-card { margin: 0; display: grid; justify-items: center; align-content: start; min-width: 0; cursor: zoom-in; }
.tcg-card:focus-visible { outline: 4px solid rgba(23,105,232,.32); outline-offset: 5px; border-radius: 8px; }
.pokemon-card-figure img { width: 188px; height: auto; aspect-ratio: 527 / 734; object-fit: contain; border-radius: 7px; filter: drop-shadow(0 10px 10px rgba(25,50,82,.18)); }
.tcg-card figcaption { width: 100%; max-width: 210px; min-height: 44px; margin-top: 6px; display: grid; place-items: center; align-content: center; color: var(--bp-ink); text-align: center; }
.tcg-card figcaption b { font-weight: 900; }
.tcg-card figcaption span { color: var(--bp-muted); font-size: .72rem; line-height: 1.35; }
.energy-card-figure { width: 154px; }
.energy-card-face { position: relative; isolation: isolate; width: 154px; aspect-ratio: 2.5 / 3.5; padding: 8px; display: grid; grid-template-rows: 26px 1fr 22px; gap: 6px; border: 5px solid #abb6c1; border-radius: 8px; color: #10213a; background: linear-gradient(135deg,#fdfefe 0 17%,#cbd4dc 35%,#fff 53%,#bcc7d1 75%,#f8fafb 100%); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #778390, 0 12px 20px rgba(32,49,72,.2); overflow: hidden; }
.energy-card-face::after { content: ""; position: absolute; z-index: 5; inset: 0; pointer-events: none; background: linear-gradient(115deg,transparent 22%,rgba(255,255,255,.64) 39%,transparent 55%); transform: translateX(-92%); transition: transform .7s ease; }
.energy-card-figure:hover .energy-card-face::after { transform: translateX(92%); }
.energy-card-face header, .energy-card-face footer { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 2px 5px; border: 1px solid rgba(74,90,108,.4); border-radius: 4px; background: rgba(255,255,255,.86); font-size: .58rem; line-height: 1; }
.energy-card-face header b { white-space: nowrap; font-size: .68rem; }
.energy-card-face header span { color: var(--energy-dark,#805d00); font-weight: 900; }
.energy-card-face footer { justify-content: center; color: #516077; font-size: .55rem; letter-spacing: .08em; }
.energy-card-face footer small { display: none; }
.energy-card-art { position: relative; display: grid; place-items: center; overflow: hidden; border: 2px solid rgba(255,255,255,.82); border-radius: 5px; background: radial-gradient(circle at 50% 48%,#fff 0 7%,var(--energy-light,#ffef8e) 8% 24%,var(--energy,#f2bc13) 25% 43%,var(--energy-dark,#9d7200) 44% 45%,transparent 46%), repeating-radial-gradient(circle at center,rgba(255,255,255,.66) 0 3px,transparent 4px 21px), linear-gradient(145deg,var(--energy-light,#ffef8e),var(--energy,#f2bc13) 52%,var(--energy-dark,#9d7200)); box-shadow: inset 0 0 24px rgba(255,255,255,.5), inset 0 -22px 38px rgba(22,36,57,.17); }
.energy-card-art::before, .energy-card-art::after { content: ""; position: absolute; width: 125%; height: 22px; border: 7px solid rgba(255,255,255,.7); border-left-color: transparent; border-right-color: transparent; border-radius: 50%; transform: rotate(-18deg); }
.energy-card-art::after { width: 70%; height: 70%; border-width: 2px; transform: rotate(32deg); opacity: .7; }
.energy-core { position: relative; z-index: 2; width: 62px; height: 62px; display: grid; place-items: center; border: 5px solid rgba(255,255,255,.9); border-radius: 50%; background: var(--energy,#f2bc13); box-shadow: 0 0 0 8px rgba(255,255,255,.24), 0 8px 20px rgba(21,38,65,.22); }
.energy-core::after { content: ""; width: 22px; height: 42px; background: #14233a; clip-path: polygon(52% 0,100% 0,68% 42%,100% 42%,25% 100%,43% 55%,8% 55%); }
.energy-card-figure[data-type="fire"] { --energy:#ef5c3f; --energy-light:#ffb493; --energy-dark:#9e2f20; }
.energy-card-figure[data-type="water"] { --energy:#3c9fe5; --energy-light:#bce8ff; --energy-dark:#1863a5; }
.energy-card-figure[data-type="grass"] { --energy:#54b96b; --energy-light:#c6f1bb; --energy-dark:#247640; }
.energy-card-figure[data-type="psychic"] { --energy:#9364d1; --energy-light:#dfc8ff; --energy-dark:#5b358c; }
.energy-card-figure[data-type="fighting"] { --energy:#bb7744; --energy-light:#f3c597; --energy-dark:#743e21; }
.energy-card-figure[data-type="darkness"] { --energy:#45546c; --energy-light:#afc1d7; --energy-dark:#1d2838; }
.energy-card-figure[data-type="metal"] { --energy:#8396a7; --energy-light:#dce6ed; --energy-dark:#4d5d6a; }
.energy-card-figure[data-type="colorless"] { --energy:#bbc2cb; --energy-light:#f2f4f7; --energy-dark:#69717c; }
.energy-card-figure:not([data-type="lightning"]) .energy-core::after { width: 23px; height: 23px; border: 5px solid #14233a; border-radius: 50%; background: transparent; clip-path: none; }
.energy-card-face.special { grid-template-rows: 26px 1fr auto 22px; background: linear-gradient(135deg,#f8f5ff,#bcb3df 35%,#fff 53%,#8fcbd3 76%,#fafafa); }
.energy-card-face.special .energy-card-art { background: radial-gradient(circle at 50% 48%,#fff 0 8%,#d9d4ff 9% 24%,#7f69d7 25% 42%,transparent 43%),repeating-conic-gradient(from 20deg,#55c6d7 0 14deg,#8b6ddd 15deg 29deg,#f0cf54 30deg 44deg); }
.energy-card-face.special .energy-card-art strong { position: absolute; z-index: 3; bottom: 8px; padding: 3px 7px; border-radius: 10px; color: #fff; background: #5d4aa2; font-size: .55rem; }
.energy-card-face.special > p { margin: -2px 0 0; padding: 4px 5px; border: 1px solid #b9b1d9; border-radius: 4px; background: rgba(255,255,255,.9); font-size: .42rem; line-height: 1.3; }
.card-back-face { width: 122px; aspect-ratio: 2.5 / 3.5; display: grid; place-items: center; align-content: center; gap: 8px; border: 4px solid #f2c13d; border-radius: 8px; color: #fff; background: #1546a6; box-shadow: inset 0 0 0 5px #2468de, var(--bp-shadow-sm); }
.card-back-face img { width: 62px; height: 62px; object-fit: contain; border-radius: 50%; background: #ffcf2e; }
.card-back-face span { font-weight: 900; }

/* Rebuilt Trainer card frames */
.trainer-card-figure { width: 202px; }
.trainer-card-face { position: relative; isolation: isolate; width: 202px; aspect-ratio: 2.5 / 3.5; padding: 8px; display: grid; grid-template-rows: 25px 29px 116px 1fr auto 11px; gap: 4px; border: 5px solid #aeb7c2; border-radius: 8px; color: #17263c; background: linear-gradient(135deg, #fff 0 18%, #d7dde2 38%, #fff 57%, #c9d0d8 76%, #f7f9fa 100%); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #7d8792, 0 12px 20px rgba(32,49,72,.2); overflow: hidden; }
.trainer-card-face::before { content: ""; position: absolute; z-index: -1; inset: 5px; border: 1px solid rgba(77,88,101,.35); border-radius: 4px; background: repeating-linear-gradient(0deg, rgba(255,255,255,.18) 0 1px, rgba(103,115,127,.05) 1px 3px); pointer-events: none; }
.trainer-card-face::after { content: ""; position: absolute; z-index: 4; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 24%, rgba(255,255,255,.56) 39%, transparent 53%); transform: translateX(-80%); }
.trainer-card-figure:hover .trainer-card-face::after { animation: cardShine 1s ease; }
@keyframes cardShine { to { transform: translateX(90%); } }
.trainer-card-band { position: relative; padding: 2px 7px; display: flex; justify-content: space-between; align-items: center; border: 1px solid rgba(255,255,255,.65); border-radius: 4px 4px 2px 2px; color: #fff; background: linear-gradient(90deg, #1d67a6, #42a3d5); box-shadow: 0 1px 2px rgba(27,45,67,.2); font-size: .67rem; font-weight: 900; }
.trainer-card-band::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 1px; background: rgba(255,255,255,.48); }
.trainer-card-figure.violet .trainer-card-band { background: linear-gradient(90deg, #684098, #a274c7); }
.trainer-card-figure.orange .trainer-card-band { background: linear-gradient(90deg, #c95518, #ef9146); }
.trainer-card-figure.green .trainer-card-band { background: linear-gradient(90deg, #247749, #55b477); }
.trainer-card-face h4 { margin: 0; padding: 0 3px; font-size: 1rem; line-height: 1.2; }
.trainer-card-face > p { margin: 0; padding: 6px 7px; border: 1px solid rgba(91,105,119,.2); border-radius: 3px; color: #263750; background: rgba(255,255,255,.86); font-size: .54rem; line-height: 1.42; overflow: hidden; }
.trainer-rule-strip { padding: 4px 6px; border: 1px solid rgba(255,255,255,.55); border-radius: 10px 2px 10px 2px; color: #fff; background: linear-gradient(90deg, #1d67a6, #42a3d5); font-size: .47rem; line-height: 1.3; }
.violet .trainer-rule-strip { background: linear-gradient(90deg, #684098, #a274c7); }
.orange .trainer-rule-strip { background: linear-gradient(90deg, #c95518, #ef9146); }
.green .trainer-rule-strip { background: linear-gradient(90deg, #247749, #55b477); }
.trainer-card-face > small {
  overflow: hidden;
  color: #667486;
  font-size: .37rem;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.trainer-art { position: relative; border: 2px solid #fff; border-radius: 3px; background-color: #cfe6ff; background-position: center; background-size: cover; box-shadow: inset 0 0 0 1px rgba(28,54,87,.3), 0 1px 3px rgba(28,54,87,.18); overflow: hidden; }
.trainer-art-teacher { background-position: center 44%; }
.trainer-art-stadium { background-position: center 56%; }
.trainer-art-ball, .trainer-art-balloon { background-position: center; }
.trainer-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg,rgba(255,255,255,.35),transparent 36%,transparent 72%,rgba(11,31,57,.14)); pointer-events: none; }
.trainer-art i { display: none; }

.pokemon-ex-face { position: relative; width: max-content; max-width: 100%; }
.pokemon-ex-face > img { display: block; }
.ex-mark { position: absolute; right: 7%; top: 3%; z-index: 3; padding: 0 7px 2px; border: 2px solid #fff; border-radius: 5px; color: #fff; background: linear-gradient(135deg,#2b255d,#7f69d7 54%,#1fa6bd); box-shadow: 0 4px 10px rgba(32,35,90,.3); font: italic 900 1.15rem/1.25 "M PLUS Rounded 1c"; }
.ex-rule { position: absolute; z-index: 3; left: 5%; right: 5%; bottom: 5%; padding: 5px 7px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px; border: 2px solid #fff; border-radius: 6px; color: #fff; background: linear-gradient(90deg,rgba(25,28,54,.94),rgba(96,77,159,.94)); box-shadow: 0 5px 12px rgba(20,26,47,.32); font-size: .48rem; line-height: 1.25; }
.ex-rule b { white-space: nowrap; color: #ffe679; font-size: .6rem; }
.trainer-card-figure.compact { width: 142px; }
.trainer-card-figure.compact .trainer-card-face { width: 142px; grid-template-rows: 19px 23px 80px 1fr auto 10px; padding: 6px; border-width: 4px; }
.trainer-card-figure.compact .trainer-card-face > p { font-size: .4rem; }
.trainer-card-figure.compact .trainer-rule-strip { font-size: .36rem; }
.trainer-card-figure.compact .trainer-card-face > small { display: none; }
.trainer-card-figure.compact figcaption { display: none; }

.card-zoom { position: fixed; inset: 0; z-index: 1500; padding: 18px; display: grid; place-items: center; background: rgba(11,28,53,.7); backdrop-filter: blur(8px); }
.card-zoom-panel { position: relative; max-width: min(92vw, 620px); max-height: calc(100svh - 36px); padding: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.72); border-radius: 8px; background: #f8fbff; box-shadow: 0 30px 70px rgba(7,23,48,.38); }
.card-zoom-close { position: absolute; z-index: 4; right: 10px; top: 10px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 1px solid var(--bp-line); border-radius: 50%; color: var(--bp-ink); background: #fff; box-shadow: var(--bp-shadow-sm); }
.card-zoom .pokemon-card-figure img { width: min(360px, 72vw); max-height: 72svh; }
.card-zoom .energy-card-figure img { width: min(300px, 68vw); max-height: 68svh; }
.card-zoom .tcg-card figcaption { max-width: 380px; font-size: 1rem; }
.card-zoom .trainer-card-figure { width: min(320px, 72vw); }
.card-zoom .trainer-card-face { width: min(320px, 72vw); grid-template-rows: 38px 43px 178px 1fr auto 18px; gap: 7px; padding: 13px; border-width: 7px; }
.card-zoom .trainer-card-band { padding-inline: 10px; font-size: .85rem; }
.card-zoom .trainer-card-face h4 { font-size: 1.35rem; }
.card-zoom .trainer-card-face > p { padding: 9px; font-size: .76rem; line-height: 1.5; }
.card-zoom .trainer-rule-strip { padding: 7px 9px; font-size: .64rem; }
.card-zoom .trainer-card-face > small { font-size: .48rem; }

/* Shared lesson visual primitives */
.scene-three, .battle-scene, .evolution-scene, .trainer-showcase, .strategy-scene, .mistake-scene { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 3vw, 34px); width: 100%; }
.scene-three > * { min-width: 0; }
.scene-card-kinds > * { flex: 0 1 230px; }
.scene-arrow { min-width: 74px; display: grid; justify-items: center; gap: 7px; color: var(--bp-blue); font-size: .72rem; font-weight: 900; text-align: center; }
.scene-arrow i { position: relative; width: 58px; height: 4px; border-radius: 4px; background: var(--bp-blue); }
.scene-arrow i::after { content: ""; position: absolute; right: -2px; top: -6px; border-left: 12px solid var(--bp-blue); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.damage-burst { position: absolute; right: 16px; top: 36%; width: 66px; height: 66px; display: grid; place-items: center; border: 5px solid #fff; border-radius: 50%; color: #fff; background: var(--bp-red); box-shadow: 0 8px 18px rgba(237,49,84,.3); font: 900 1.5rem "M PLUS Rounded 1c"; }
.target-hit { position: relative; }
.energy-cost { display: inline-flex; gap: 3px; }
.energy-symbol { width: 22px; height: 22px; display: inline-grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #c8cbd0; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.energy-symbol.lightning { background: var(--t-lightning); }
.energy-symbol.fire { background: var(--t-fire); }
.energy-symbol.water { background: var(--t-water); }
.energy-symbol.grass { background: var(--t-grass); }
.energy-symbol.psychic { background: var(--t-psychic); }
.energy-symbol::after { content: ""; width: 7px; height: 7px; border: 2px solid #1b2d48; border-radius: 50%; }
.energy-symbol.lightning::after { width: 5px; height: 12px; border: 0; background: #1b2d48; clip-path: polygon(55% 0,100% 0,66% 42%,100% 42%,28% 100%,44% 54%,10% 54%); }

.card-map, .attack-read-scene, .bottom-read-scene, .attach-scene, .energy-lesson-scene, .attack-ready-scene, .damage-scene { width: min(100%, 1080px); display: grid; grid-template-columns: minmax(220px, .75fr) minmax(360px, 1.25fr); align-items: center; gap: 32px; }
.map-callouts { display: grid; gap: 10px; }
.map-callouts span { min-height: 72px; padding: 12px 16px; display: grid; align-content: center; border: 1px solid var(--bp-line); border-left: 5px solid var(--bp-blue); border-radius: 8px; background: #fff; }
.map-callouts b { display: block; color: var(--bp-blue); }
.anatomy-scene { width: min(100%, 1060px); display: grid; grid-template-columns: 360px 1fr; align-items: center; gap: 30px; }
.anatomy-card-wrap { position: relative; display: grid; place-items: center; }
.anatomy-card-wrap .pokemon-card-figure img { width: 230px; }
.anatomy-pin { position: absolute; width: 36px; height: 36px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--bp-red); box-shadow: 0 5px 12px rgba(237,49,84,.28); font-weight: 900; }
.pin-1 { left: 29%; top: 4%; }.pin-2 { right: 21%; top: 4%; }.pin-3 { left: 17%; top: 4%; }.pin-4 { left: 22%; top: 16%; }.pin-5 { left: 26%; top: 58%; }.pin-6 { right: 21%; bottom: 14%; }
.anatomy-scene ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; list-style: none; }
.anatomy-scene li { min-height: 62px; padding: 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.anatomy-scene li b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--bp-red); }
.attack-zoom, .bottom-zoom { padding: 18px; border: 2px solid var(--bp-gold); border-radius: 8px; background: #fffbe9; box-shadow: var(--bp-shadow-sm); }
.attack-zoom > div { min-height: 76px; padding: 15px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; border: 2px solid var(--bp-red); border-radius: 8px; background: #fff; }
.attack-zoom strong { font-size: 1.8rem; }
.attack-zoom p { margin: 10px 0 0; color: var(--bp-muted); }
.zoom-label { display: inline-block; margin-bottom: 10px; color: var(--bp-red); font-weight: 900; }
.bottom-zoom { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bottom-zoom > div { padding: 12px; border: 1px solid #e5cf7b; border-radius: 8px; background: #fff; text-align: center; }
.bottom-zoom span, .bottom-zoom b { display: block; }
.bottom-zoom span { color: var(--bp-muted); font-size: .75rem; }
.bottom-zoom em { grid-column: 1 / -1; color: var(--bp-red); text-align: center; font-style: normal; font-weight: 800; }

/* Playmat and setup diagrams */
.teach-playmat { width: min(100%, 1050px); aspect-ratio: 2.65 / 1; padding: 14px; display: grid; grid-template-columns: 145px 1fr 145px; grid-template-rows: 1fr .72fr; gap: 10px; border: 6px solid #4f9d4e; border-radius: 8px; color: #174816; background: #83c96b; box-shadow: inset 0 0 0 4px rgba(255,255,255,.42); }
.teach-playmat > div { position: relative; min-width: 0; border: 2px dashed rgba(255,255,255,.8); border-radius: 8px; display: grid; place-items: center; }
.teach-playmat > div > span { position: absolute; left: 8px; top: 6px; font-weight: 900; }
.playmat-prize { grid-row: 1 / 3; }
.playmat-active { grid-column: 2; }
.playmat-active .pokemon-card-figure img, .playmat-bench .pokemon-card-figure img { width: 118px; }
.playmat-active figcaption, .playmat-bench figcaption { min-height: 30px; margin: 0; }
.playmat-deck { grid-column: 3; }
.playmat-bench { grid-column: 2; }
.playmat-bench > div { display: flex; align-items: center; justify-content: center; gap: 12px; }
.playmat-discard { grid-column: 3; }
.prize-stack { position: relative; width: 96px; height: 150px; display: grid; place-items: end center; }
.prize-stack i { position: absolute; top: calc(8px + var(--i) * 2px); left: calc(18px + var(--i) * 2px); width: 68px; height: 96px; border: 2px solid #f0bd38; border-radius: 5px; background: #174aa9 url("../img/brand/blockplanet-logo.png") center/42px no-repeat; box-shadow: 0 3px 7px rgba(15,42,86,.2); }
.prize-stack b { position: relative; z-index: 8; padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,.85); white-space: nowrap; }
.zone-scene { width: min(100%, 920px); display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; justify-items: center; gap: 26px; }
.discard-figure { display: grid; justify-items: center; }
.zone-key { grid-column: 1 / -1; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zone-key span { padding: 8px; border-radius: 8px; background: #fff; text-align: center; font-weight: 800; }
.attached-pokemon { display: grid; grid-template-columns: 220px 1fr; align-items: center; }
.under-cards { margin-left: -45px; display: flex; align-items: center; gap: 4px; }
.under-cards .tcg-card { width: 100px; overflow: hidden; }
.under-cards img { width: 100px; }
.attach-copy { padding: 20px; display: grid; gap: 8px; border-left: 5px solid var(--bp-gold); background: #fff; }
.opening-scene, .mulligan-scene, .setup-scene, .draw-scene, .wait-scene, .empty-field-scene, .deckout-scene, .win-scene { width: min(100%, 1100px); display: flex; align-items: center; justify-content: center; gap: 28px; }
.hand-fan { min-width: 520px; display: flex; align-items: end; justify-content: center; }
.hand-fan > * { width: 90px; margin-left: -28px; transform: rotate(calc((var(--i, 0) - 3) * 3deg)); }
.hand-fan .pokemon-card-figure img, .hand-fan .energy-card-figure img { width: 110px; }
.hand-fan .trainer-card-figure { width: 90px; }
.chosen-basic, .new-hand, .hand-slot, .bad-hand { padding: 14px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; display: grid; justify-items: center; }
.bad-hand { grid-template-columns: repeat(3, 120px); }
.bad-hand > span { grid-column: 1 / -1; color: var(--bp-red); font-weight: 900; }
.bad-hand .tcg-card { width: 110px; }
.bad-hand .trainer-card-face { width: 110px; }
.setup-scene > div:first-child { flex: 1; }
.setup-checks { min-width: 230px; display: grid; gap: 8px; }
.setup-checks span, .setup-checks b { padding: 12px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.setup-checks b { color: #fff; background: var(--bp-blue); text-align: center; }
.must-do { padding: 8px 14px; color: #fff; border-radius: 8px; background: var(--bp-red); font-weight: 900; }

/* Turn, energy, evolution, status, strategy */
.action-grid { width: min(100%, 1040px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.action-tile { min-height: 104px; padding: 14px; display: grid; grid-template-columns: 34px 1fr; align-content: center; gap: 2px 10px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.action-tile .bp-icon { grid-row: 1 / 3; align-self: center; color: var(--bp-blue); }
.action-tile b { color: var(--bp-ink); }
.action-tile small { color: var(--bp-muted); }
.judge-scene { width: min(100%, 1080px); display: grid; grid-template-columns: minmax(270px, .84fr) minmax(0, 1.6fr); gap: 18px; align-items: stretch; }
.judge-mascot { position: relative; min-height: 300px; margin: 0; overflow: hidden; border: 1px solid var(--bp-line); border-radius: 8px; background: #132b58; }
.judge-mascot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 46%, rgba(7, 27, 62, .92) 100%); pointer-events: none; }
.judge-mascot img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
.judge-mascot figcaption { position: absolute; z-index: 1; right: 16px; bottom: 14px; left: 16px; display: grid; gap: 2px; color: #fff; }
.judge-mascot figcaption b { font-size: 24px; }
.judge-mascot figcaption span { color: rgba(255,255,255,.84); font-size: 15px; }
.judge-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: center; }
.judge-steps .action-tile { min-height: 132px; border-left: 5px solid var(--bp-blue); box-shadow: 0 8px 20px rgba(29, 68, 124, .07); }
.action-showcase { width: min(100%, 1080px); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.action-card { min-width: 0; min-height: 250px; padding: 10px; display: grid; grid-template-rows: 178px auto; align-items: start; justify-items: center; border: 1px solid var(--bp-line); border-top: 5px solid var(--bp-blue); border-radius: 8px; background: #fff; overflow: hidden; }
.action-card-visual { width: 100%; min-width: 0; display: grid; place-items: center; overflow: hidden; }
.action-card-visual .tcg-card figcaption { display: none; }
.action-card-visual .pokemon-card-figure img { width: 108px; }
.action-card-visual .energy-card-figure,
.action-card-visual .energy-card-face { width: 108px; }
.action-card-visual .trainer-card-figure.compact,
.action-card-visual .trainer-card-figure.compact .trainer-card-face { width: 108px; }
.action-card > div:last-child { width: 100%; padding-top: 9px; border-top: 1px solid var(--bp-line); text-align: center; }
.action-card b, .action-card small { display: block; }
.action-card b { color: var(--bp-ink); font-size: .88rem; }
.action-card small { margin-top: 3px; color: var(--bp-muted); font-size: .7rem; line-height: 1.35; }
.turn-timeline { position: relative; width: min(100%, 1040px); display: flex; align-items: center; justify-content: center; gap: 22px; }
.turn-timeline > div:not(.scene-arrow) { position: relative; min-width: 200px; min-height: 250px; padding: 15px; display: grid; place-items: center; align-content: center; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.turn-timeline > div > b { position: absolute; left: 10px; top: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--bp-gold); }
.turn-timeline > div > span { font-weight: 900; }
.turn-timeline .final-step { border: 2px solid var(--bp-red) !important; }
.turn-timeline em { position: absolute; right: 2%; bottom: 8px; padding: 7px 12px; color: #fff; border-radius: 7px; background: var(--bp-red); font-style: normal; font-weight: 900; }
.energy-lesson-scene, .attack-ready-scene { width: min(100%, 1040px); grid-template-columns: minmax(400px, 1.08fr) minmax(310px, .92fr); gap: clamp(28px, 3.5vw, 48px); }
.ready-pokemon { min-width: 0; display: grid; grid-template-columns: minmax(160px, 188px) minmax(206px, 1fr); align-items: center; justify-content: center; gap: 16px; }
.ready-pokemon > .tcg-card { justify-self: end; }
.attached-energy-pair { min-width: 0; display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.attached-energy-pair .energy-card-figure,
.attached-energy-pair .energy-card-face { width: 98px; }
.attached-energy-pair img { width: 98px; }
.energy-legend { min-width: 0; display: grid; gap: 10px; }
.energy-legend > * { padding: 12px 15px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.energy-legend b { display: flex; align-items: center; gap: 10px; border: 2px solid var(--bp-red); }
.red-frame { min-width: 0; padding: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 4px solid var(--bp-red); border-radius: 8px; background: #fff7f8; }
.red-frame > div:first-child { flex: 0 0 auto; }
.red-frame .pokemon-card-figure img { width: 170px; }
.red-rule { display: grid; gap: 10px; }
.red-rule span { color: var(--bp-red); font-weight: 900; }
.red-rule b, .red-rule strong { padding: 13px; border-radius: 8px; }
.red-rule b { border: 2px solid var(--bp-red); background: #fff; }
.red-rule strong { color: #fff; background: var(--bp-red); text-align: center; }
.weakness-target { display: grid; grid-template-columns: 220px 1fr; align-items: center; }
.math-box { display: grid; justify-items: center; gap: 4px; }
.math-box span, .math-box b { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; font: 900 1.7rem "M PLUS Rounded 1c"; }
.math-box span { background: #fff; border: 2px solid var(--bp-line); }
.math-box b { color: #fff; background: var(--bp-red); }
.math-box i { color: var(--bp-red); font-style: normal; font-weight: 900; }
.evolution-scene .pokemon-card-figure img { width: 180px; }
.wait-scene .just-played { position: relative; }
.wait-scene > div { display: grid; justify-items: center; }
.just-played > span, .status-chip, .status-cleared { padding: 6px 10px; border-radius: 8px; color: #fff; background: var(--bp-red); font-weight: 900; }
.stop-sign { min-width: 150px; min-height: 80px; display: grid; place-items: center; color: #fff; background: var(--bp-red); clip-path: polygon(29% 0,71% 0,100% 29%,100% 71%,71% 100%,29% 100%,0 71%,0 29%); font-weight: 900; text-align: center; }
.evolution-result-scene { width: min(100%, 920px); min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.evolution-result-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); align-items: center; gap: 18px; }
.evolution-result-card { min-width: 0; display: grid; justify-items: center; align-content: center; gap: 3px; }
.evolution-result-art { position: relative; min-width: 0; }
.evolution-result-card .pokemon-card-figure img { width: 188px; }
.evolution-result-card .pokemon-card-figure figcaption { min-height: 36px; margin-top: 4px; }
.result-stage { padding: 4px 10px; border: 1px solid #cbdcf2; border-radius: 999px; color: #38577e; background: #fff; font-size: .7rem; font-weight: 900; }
.evolution-result-summary { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.evolution-result-summary > * { min-height: 42px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cbdcf2; border-radius: 8px; color: #294c78; background: #fff; font-size: .78rem; font-weight: 900; text-align: center; }
.evolution-result-summary b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #3f3000; background: var(--bp-gold); }
.evolution-result-summary strong { color: #087c4f; border-color: #80d7b4; background: #effcf6; }
.damage-chip { position: absolute; right: 2px; bottom: 48px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #ffd83e; font-weight: 900; }
.status-chip, .status-cleared { position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%); white-space: nowrap; }
.status-cleared { background: var(--bp-green); }
.status-grid { width: min(100%, 900px); display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.status-figure { min-height: 330px; padding: 18px; display: grid; justify-items: center; align-content: center; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.status-card { position: relative; }
.status-figure.sleep .status-card, .status-figure.paralyze .status-card { transform: rotate(90deg) scale(.76); }
.status-figure b { margin-top: 10px; font-size: 1.25rem; }
.status-figure small { color: var(--bp-muted); }
.status-mark { width: 42px; height: 42px; margin-top: -28px; z-index: 3; border: 5px solid #fff; border-radius: 50%; background: var(--bp-red); box-shadow: var(--bp-shadow-sm); }
.status-figure.burn .status-mark { background: var(--bp-orange); }
.status-figure.sleep .status-mark, .status-figure.paralyze .status-mark { display: none; }
.confused-scene { display: flex; align-items: center; gap: 30px; }
.upside-down { transform: rotate(180deg); }
.coin { width: 150px; height: 150px; display: grid; place-items: center; align-content: center; border: 8px solid #efbd1d; border-radius: 50%; background: #fff6bf; text-align: center; }
.coin.bad { border-color: var(--bp-red); background: #fff1f4; }
.coin span, .coin b { display: block; }
.coin span { color: var(--bp-muted); font-size: .75rem; }
.strategy-scene { width: min(100%, 1120px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 18px; }
.strategy-case { min-width: 0; padding: 12px; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; border: 2px solid var(--bp-green); border-radius: 8px; background: #f1fff8; }
.strategy-case.bad-plan { border-color: var(--bp-red); background: #fff5f7; }
.strategy-case-visual { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 12px; }
.strategy-case-visual .tcg-card figcaption { display: none; }
.strategy-unit,
.strategy-energy-group { min-width: 0; display: grid; justify-items: center; align-content: center; gap: 6px; }
.strategy-unit-main { grid-template-columns: auto; }
.strategy-unit > b,
.strategy-energy-group > b { width: 100%; color: #294c78; font-size: .7rem; line-height: 1.3; text-align: center; }
.strategy-energy-group { grid-template-columns: repeat(2, 82px); }
.strategy-energy-group > b { grid-column: 1 / -1; }
.strategy-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.strategy-split .strategy-unit { grid-template-columns: 118px 76px; }
.strategy-split .strategy-unit > b { grid-column: 1 / -1; }
.strategy-scene .pokemon-card-figure img,
.mistake-scene .pokemon-card-figure img { width: 118px; }
.strategy-scene .energy-card-figure,
.strategy-scene .energy-card-face { width: 82px; }
.strategy-split .energy-card-figure,
.strategy-split .energy-card-face { width: 76px; }
.strategy-case-copy { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; color: #fff; background: var(--bp-green); }
.bad-plan .strategy-case-copy { background: var(--bp-red); }
.strategy-case-copy span { padding-right: 10px; border-right: 1px solid rgba(255,255,255,.55); font-size: .72rem; font-weight: 900; white-space: nowrap; }
.strategy-case-copy strong { min-width: 0; font-size: .86rem; line-height: 1.3; text-align: center; }
.mistake-scene > div { padding: 12px; display: flex; align-items: center; gap: 5px; border: 2px solid var(--bp-green); border-radius: 8px; background: #f1fff8; }
.mistake-scene > div.wrong-case { border-color: var(--bp-red); background: #fff5f7; }
.mistake-scene .energy-card-figure,
.mistake-scene .energy-card-face { width: 82px; }
.mistake-scene b { max-width: 140px; }
.trainer-showcase { width: min(100%, 980px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 16px; }
.trainer-showcase .trainer-card-figure { width: 178px; justify-self: center; grid-template-rows: auto 68px; }
.trainer-showcase .trainer-card-face { width: 178px; }
.trainer-showcase .tcg-card figcaption { width: 100%; min-height: 68px; margin-top: 7px; display: grid; grid-template-rows: 24px 1fr; align-content: start; }
.trainer-showcase .tcg-card figcaption b { font-size: .9rem; line-height: 1.25; }
.trainer-showcase .tcg-card figcaption span { font-size: .68rem; line-height: 1.45; }
.fix-arrow { color: var(--bp-blue); font-weight: 900; }

/* Win diagrams */
.prize-taken { display: grid; justify-items: center; gap: 8px; }
.ko-card { position: relative; filter: grayscale(.4); }
.ko-card > span { position: absolute; inset: 40% 10%; display: grid; place-items: center; color: #fff; border-radius: 8px; background: var(--bp-red); font-weight: 900; }
.empty-bench, .cannot-draw { min-width: 350px; min-height: 210px; padding: 24px; display: grid; align-content: center; gap: 10px; border: 3px dashed #9eafc4; border-radius: 8px; background: #fff; text-align: center; }
.empty-bench strong, .cannot-draw strong { color: var(--bp-red); font-size: 1.5rem; }
.empty-deck { position: relative; }
.empty-deck > span { position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%); width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--bp-red); font-size: 1.5rem; font-weight: 900; }

/* Learning tools */
.tool-panel > h2:not(:first-child) { margin-top: 24px; }
.types-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.type-chip { min-height: 82px; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.type-dot { width: 42px; height: 42px; flex: 0 0 42px; border: 4px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--bp-line); }
.type-chip b, .type-chip small { display: block; }
.type-chip small { color: var(--bp-muted); font-size: .72rem; }
.type-reading-demo { display: grid; grid-template-columns: 300px 1fr; align-items: center; gap: 28px; padding: 18px; border: 1px solid var(--bp-line); border-radius: 8px; background: #f8fbff; }
.type-rule-copy h3 { margin: 8px 0 16px; font-size: 1.7rem; }
.type-rule-row { min-height: 58px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--bp-line); }
.type-rule-row b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--bp-gold); }
.quick-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-rule-grid article { position: relative; min-height: 130px; padding: 16px 16px 16px 62px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.quick-rule-grid article > b { position: absolute; left: 15px; top: 16px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--bp-gold); }
.quick-rule-grid h3 { margin: 0 0 5px; font-size: 1rem; }
.quick-rule-grid p { margin: 0; color: var(--bp-muted); }
.status-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.status-rule-card { min-height: 240px; padding: 14px; display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 16px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.status-rule-visual { display: grid; place-items: center; }
.status-rule-visual .pokemon-card-figure img { width: 135px; }
.status-rule-visual.sleep, .status-rule-visual.paralyze { transform: none; }
.status-rule-visual.sleep figure, .status-rule-visual.paralyze figure { transform: rotate(90deg) scale(.8); }
.status-rule-card h3 { margin: 8px 0 5px; }
.status-rule-card p { margin: 0 0 7px; color: var(--bp-muted); }
.status-rule-card small { color: var(--bp-green); font-weight: 800; }
.quiz-progress { height: 8px; border-radius: 8px; background: #e5edf7; overflow: hidden; }
.quiz-progress i { display: block; height: 100%; background: var(--bp-blue); }
.quiz-q { margin: 22px 0; color: var(--bp-ink); font-size: 1.35rem; font-weight: 900; }
.quiz-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quiz-opt { min-height: 58px; border: 1px solid var(--bp-line); border-radius: 8px; color: var(--bp-text); background: #fff; font-weight: 800; }
.quiz-opt.correct { color: #fff; border-color: var(--bp-green); background: var(--bp-green); }
.quiz-opt.wrong { color: #fff; border-color: var(--bp-red); background: var(--bp-red); }
.quiz-why { min-height: 28px; margin-top: 12px; color: var(--bp-muted); }
.quiz-next { margin-top: 8px; }
.quiz-finish { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; }
.quiz-finish > .bp-icon { width: 58px; height: 58px; color: var(--bp-gold-2); }
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge { min-height: 130px; display: grid; place-items: center; align-content: center; opacity: .35; }
.badge.earned { opacity: 1; }
.badge .ring { width: 64px; height: 64px; display: grid; place-items: center; border: 4px solid var(--bp-gold); border-radius: 50%; background: var(--bp-soft-yellow); }
.calc-result { min-height: 130px; display: grid; place-items: center; margin-top: 10px; border-radius: 8px; color: #fff; background: var(--bp-blue); font: 900 4rem "M PLUS Rounded 1c"; }
.timer-display { padding: 30px; color: var(--bp-blue); font-size: clamp(4rem, 12vw, 8rem); line-height: 1; text-align: center; }
.timer-display.warn { color: var(--bp-red); }

/* Tournament shared */
.flow-steps { display: grid; grid-template-columns: repeat(4, minmax(170px,1fr)); gap: 8px; margin: 20px 0; overflow-x: auto; }
.flow-steps .step { min-height: 54px; padding: 10px 14px; display: grid; place-items: center; border: 1px solid var(--bp-line); border-radius: 8px; color: var(--bp-muted); background: #fff; font-weight: 900; white-space: nowrap; }
.flow-steps .step.active { color: #fff; border-color: var(--bp-blue); background: var(--bp-blue); }
.flow-steps .step.done { color: #fff; border-color: var(--bp-green); background: var(--bp-green); }
#content, #manageBox { min-width: 0; display: grid; gap: 18px; }
#content > *, #manageBox > * { min-width: 0; max-width: 100%; }
.trainer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
.trainer { position: relative; min-height: 190px; padding: 14px; display: grid; justify-items: center; align-content: center; gap: 8px; border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; overflow: hidden; }
.trainer::after { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--bp-blue); }
.trainer .tnum { position: absolute; left: 9px; top: 9px; padding: 3px 7px; border-radius: 6px; color: #4c3a00; background: #ffe16e; font-weight: 900; }
.trainer .photo { width: 86px; height: 86px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #fff; background: var(--bp-blue); box-shadow: 0 0 0 2px #bcd3ef; font-size: 1.6rem; font-weight: 900; }
.trainer .tname { max-width: 100%; color: var(--bp-ink); font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trainer.elim { opacity: .45; filter: grayscale(1); }
.mini-photo, .ph { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: var(--bp-blue); vertical-align: middle; font-weight: 900; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--bp-line); text-align: left; white-space: nowrap; }
.table th { color: var(--bp-muted); font-size: .75rem; }
.table tr.qualify { background: #fffaf0; }
.rank { width: 48px; color: var(--bp-blue); font-weight: 900; }
.rank.top { color: var(--bp-gold-2); }
.wins-pill, .loss-pill { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: var(--bp-green); font-weight: 900; }
.loss-pill { background: var(--bp-red); }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 9px; border-radius: 999px; color: var(--bp-blue); background: var(--bp-soft); font-size: .75rem; font-weight: 900; }
.tag.gold { color: #5d4600; background: #fff0a8; }
.tag.red { color: #fff; background: var(--bp-red); }
.empty { min-height: 220px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty .big .bp-icon { width: 54px; height: 54px; color: var(--bp-blue); }

/* Matches never wrap into confusing rows */
.match-list { display: grid; gap: 10px; }
.match { min-height: 78px; display: grid; grid-template-columns: minmax(170px,1fr) 54px minmax(170px,1fr) auto auto; align-items: center; gap: 10px; border: 1px solid var(--bp-line); border-radius: 8px; padding: 9px 12px; background: #fff; overflow: hidden; }
.match .side { min-width: 0; display: flex; align-items: center; gap: 9px; }
.match .side.right { justify-content: flex-end; text-align: right; }
.match .side .name, .match .side b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .side.win { color: var(--bp-green); }
.match .vs { color: var(--bp-muted); font-weight: 900; text-align: center; }
.table-no { color: var(--bp-muted); white-space: nowrap; font-size: .8rem; font-weight: 800; }
.win-btns { display: flex; gap: 5px; white-space: nowrap; }
.match.qualifier-match { grid-template-columns: minmax(170px,1fr) 54px minmax(170px,1fr) auto auto; }
.match-location { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.classroom-badge { min-height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid currentColor; border-radius: 999px; font-size: .78rem; font-weight: 900; line-height: 1; }
.classroom-badge::before { width: 8px; height: 8px; border-radius: 50%; background: currentColor; content: ''; }
.classroom-badge.room-1 { color: #1769dc; background: #edf5ff; }
.classroom-badge.room-2 { color: #087a4d; background: #e8fff3; }
.classroom-badge.room-3 { color: #b65400; background: #fff3e5; }
.qual-room-groups { display: grid; gap: 16px; }
.qual-room-group { padding: 12px; border: 1px solid var(--bp-line); border-left-width: 6px; border-radius: 8px; }
.qual-room-group.room-1 { border-color: #a9caf8; border-left-color: #1769dc; background: #f6faff; }
.qual-room-group.room-2 { border-color: #a9dfc5; border-left-color: #087a4d; background: #f4fff9; }
.qual-room-group.room-3 { border-color: #f3c798; border-left-color: #d46b00; background: #fffaf4; }
.qual-room-head { min-height: 42px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.qual-room-count { color: var(--bp-ink); font-size: .84rem; font-weight: 900; }
.qual-room-progress { margin-left: auto; color: var(--bp-muted); font-size: .8rem; font-weight: 800; }
.qual-room-group .match { box-shadow: 0 2px 8px rgba(30, 67, 112, .05); }
.qual-room-group .match-location { justify-content: flex-end; }
.qual-room-group .is-bye { opacity: .82; }

/* Tournament bracket, fixed lanes and connectors */
.bracket { position: relative; min-width: 1160px; padding: 18px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 92px; overflow: hidden; }
.round { position: relative; display: grid; align-content: stretch; gap: 12px; }
.round-title { min-height: 36px; display: grid; place-items: center; color: var(--bp-ink); border-bottom: 3px solid var(--bp-gold); font-weight: 900; }
.round-qf { grid-template-rows: 36px repeat(4, 1fr); }
.round-sf { grid-template-rows: 36px repeat(2, 1fr); padding-block: 72px; }
.round-final { grid-template-rows: 36px auto 36px auto; align-content: center; gap: 14px; }
.bk-match { position: relative; align-self: center; border: 1px solid #b9cee8; border-radius: 8px; background: #fff; box-shadow: var(--bp-shadow-sm); }
.bk-match::after { content: ""; position: absolute; left: 100%; top: 50%; width: 47px; border-top: 3px solid #8da7c5; }
.round-final .bk-match::after { display: none; }
.round-qf .bk-match:nth-of-type(2)::before, .round-qf .bk-match:nth-of-type(4)::before { content: ""; position: absolute; left: calc(100% + 46px); top: 50%; height: calc(100% + 12px); border-right: 3px solid #8da7c5; }
.round-sf .bk-match:nth-of-type(2)::before { content: ""; position: absolute; left: calc(100% + 46px); top: 50%; height: calc(100% + 84px); border-right: 3px solid #8da7c5; }
.bk-slot { min-height: 54px; padding: 7px 9px; display: grid; grid-template-columns: 28px 40px 1fr; align-items: center; gap: 8px; }
.bk-slot + .bk-slot { border-top: 1px solid var(--bp-line); }
.bk-slot .seed { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #473500; background: var(--bp-gold); font-weight: 900; }
.bk-slot .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.bk-slot.win { color: var(--bp-green); background: #eefbf5; animation: promote .55s ease both; }
.bk-slot.lose { opacity: .42; }
@keyframes promote { from { transform: translateX(-8px); opacity: .5; } to { transform: none; opacity: 1; } }

/* Podium */
.ceremony-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr); gap: 18px; align-items: stretch; }
.champ-banner { position: relative; min-height: 380px; padding: 40px; display: grid; place-items: center; align-content: center; overflow: hidden; border: 1px solid #e7c23d; border-radius: 8px; color: var(--bp-ink); background: #fff8d6 url("../img/generated/blockplanet-podium-cards.png") center/cover no-repeat; box-shadow: var(--bp-shadow); text-align: center; }
.champ-banner::before { content: ""; position: absolute; inset: 0; background: rgba(255,250,226,.76); }
.champ-banner > * { position: relative; }
.champ-banner .cphoto { width: 130px; height: 130px; display: grid; place-items: center; border: 8px solid #fff; border-radius: 50%; background: var(--bp-blue); box-shadow: 0 0 0 6px var(--bp-gold), var(--bp-shadow); color: #fff; font-size: 2.4rem; font-weight: 900; }
.champ-banner h2 { margin: 14px 0 0; font-size: 2.6rem; }
.crown { width: 74px; height: 52px; background: var(--bp-gold); clip-path: polygon(0 26%,25% 58%,48% 0,72% 58%,100% 26%,88% 100%,12% 100%); filter: drop-shadow(0 5px 5px rgba(155,111,0,.22)); }
.podium { min-height: 360px; display: flex; align-items: end; justify-content: center; gap: 10px; }
.spot { width: 220px; display: grid; justify-items: center; gap: 8px; }
.spot .ph { width: 90px; height: 90px; border: 5px solid #fff; box-shadow: 0 0 0 3px #b8c8db; background-position: center; }
.spot.p1 .ph { width: 112px; height: 112px; box-shadow: 0 0 0 5px var(--bp-gold); }
.pblock { width: 100%; min-height: 170px; display: grid; place-items: center; color: #fff; border-radius: 8px 8px 0 0; background: #d39e00; font: 900 4rem "M PLUS Rounded 1c"; }
.pblock.p2 { min-height: 120px; background: #7c8ea3; }
.pblock.p3 { min-height: 90px; background: #c27b45; }
.ceremony-podium { min-width: 0; padding: 22px; overflow: hidden; }
.ceremony-podium .section-title { margin-bottom: 0; justify-content: center; white-space: nowrap; }
.ceremony-podium .podium { min-height: 330px; padding-top: 18px; gap: 6px; }
.ceremony-podium .spot { width: min(31%, 150px); }
.ceremony-podium .spot .ph { width: 72px; height: 72px; }
.ceremony-podium .spot.p1 .ph { width: 88px; height: 88px; }
.ceremony-podium .spot b { font-size: .82rem; }
.ceremony-podium .pblock { min-height: 145px; font-size: 3rem; }
.ceremony-podium .pblock.p2 { min-height: 105px; }
.ceremony-podium .pblock.p3 { min-height: 78px; }
.confetti { position: fixed; inset: 0; z-index: 1100; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 18px; animation: confettiFall 3s linear forwards; }
@keyframes confettiFall { to { transform: translateY(105vh) rotate(720deg); } }

/* Console */
.lock-mark { width: 66px; height: 66px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 8px; color: var(--bp-blue); background: var(--bp-soft); }
.modal-backdrop { position: fixed; inset: 0; z-index: 1200; padding: 20px; display: none; place-items: center; background: rgba(13,32,60,.55); }
.modal-backdrop.open { display: grid; }
.modal { width: min(480px, 100%); }
.photo-pick { width: 118px; height: 118px; margin: 10px auto; display: grid; place-items: center; border: 2px dashed #9db8d8; border-radius: 50%; color: var(--bp-muted); background: #f3f8ff; text-align: center; overflow: hidden; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.penalty-tier { margin: 10px 0; padding: 14px 16px; border: 1px solid var(--bp-line); border-left: 6px solid var(--bp-blue); border-radius: 8px; background: #fff; }
.penalty-tier.t2 { border-left-color: var(--bp-gold); }
.penalty-tier.t3 { border-left-color: var(--bp-red); }
.penalty-tier h4 { margin: 0 0 6px; }

/* Responsive */
@media (max-width: 1180px) {
  .site-header .wrap { width: calc(100% - 24px); gap: 12px; }
  .site-header .nav > a { padding-inline: 10px; }
  .brand .full { font-size: .92rem; }
  .lesson-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .types-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .lesson-slide { grid-template-rows: auto minmax(280px,1fr) auto; }
  .pokemon-card-figure img { width: 160px; }
  .trainer-card-figure { width: 175px; }
  .trainer-card-face { width: 175px; }
}

@media (min-width: 901px) and (max-height: 700px) {
  body.lesson-open .page-main { padding-top: 10px; }
  .lesson-deck { height: calc(100svh - var(--header-h) - 20px); min-height: 0; grid-template-rows: 58px minmax(0, 1fr) 52px; }
  .lesson-deck-head { padding-block: 6px; }
  .lesson-deck-head h2 { font-size: 1.18rem; }
  .lesson-slide { padding: 9px 16px; grid-template-rows: auto minmax(190px, 1fr) auto; gap: 8px; }
  .lesson-slide-copy { gap: 3px 12px; }
  .lesson-slide-copy h3 { font-size: 1.35rem; }
  .lesson-slide-copy p { font-size: .88rem; }
  .lesson-visual { padding: 7px 10px; }
  .lesson-takeaways { gap: 7px; }
  .lesson-takeaways div { min-height: 44px; padding: 6px 9px; font-size: .78rem; }
  .lesson-takeaways b { width: 26px; height: 26px; flex-basis: 26px; }
  .lesson-deck-nav { padding-block: 6px; }
  .pokemon-card-figure img { width: 136px; }
  .energy-card-figure img { width: 104px; }
  .tcg-card figcaption { min-height: 31px; margin-top: 3px; font-size: .78rem; }
  .tcg-card figcaption span { font-size: .62rem; }
  .trainer-card-figure { width: 146px; }
  .trainer-card-face { width: 146px; grid-template-rows: 19px 22px 78px 1fr auto 8px; padding: 6px; border-width: 4px; }
  .trainer-card-face > p { padding: 3px 4px; font-size: .4rem; }
  .trainer-rule-strip { padding: 2px 4px; font-size: .34rem; }
  .trainer-card-face > small { font-size: .28rem; }
  .trainer-card-figure.compact { width: 112px; }
  .trainer-card-figure.compact .trainer-card-face { width: 112px; grid-template-rows: 15px 17px 57px 1fr auto 6px; padding: 4px; border-width: 3px; }
  .trainer-card-figure.compact .trainer-card-band { padding-inline: 4px; font-size: .45rem; }
  .trainer-card-figure.compact .trainer-card-face h4 { font-size: .72rem; }
  .anatomy-card-wrap .pokemon-card-figure img { width: 188px; }
  .anatomy-scene li { min-height: 48px; padding: 6px 8px; font-size: .78rem; }
  .status-figure { min-height: 245px; padding: 10px; }
  .turn-timeline > div:not(.scene-arrow) { min-height: 205px; }
}

@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .wrap { width: min(100% - 24px, 1560px); }
  .site-header .wrap { overflow-x: auto; }
  .brand .full { display: none; }
  .brand-logo { width: 42px; height: 42px; }
  .site-header .nav { margin-left: 0; }
  .page-heading { min-height: 120px; }
  .mascot-tabs { display: none; }
  .pillars { grid-template-columns: 1fr; }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  body.lesson-open { overflow: auto; }
  .lesson-deck { min-height: auto; }
  .lesson-slide { overflow: visible; }
  .lesson-visual { min-height: 430px; overflow-x: auto; justify-content: start; }
  .lesson-takeaways { grid-template-columns: 1fr; }
  .card-map, .attack-read-scene, .bottom-read-scene, .attach-scene, .energy-lesson-scene, .attack-ready-scene, .damage-scene { min-width: 760px; }
  .anatomy-scene { min-width: 760px; }
  .scene-three, .battle-scene, .evolution-scene, .trainer-showcase, .strategy-scene, .mistake-scene { min-width: 720px; }
  .teach-playmat { min-width: 760px; }
  .action-grid { grid-template-columns: repeat(2,1fr); }
  .status-rule-grid { grid-template-columns: 1fr; }
  .types-grid { grid-template-columns: repeat(2,1fr); }
  .type-reading-demo { grid-template-columns: 220px 1fr; }
  .match { min-width: 920px; }
  .match-list { overflow-x: auto; }
  .toolbar { overflow-x: auto; }
  .ceremony-grid { grid-template-columns: 1fr; }
  .ceremony-podium { overflow-x: auto; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .site-header .wrap { width: calc(100% - 16px); }
  .site-header .nav > a { min-width: 48px; padding: 8px; font-size: 0; }
  .site-header .nav > a .bp-icon { margin: 0; }
  .mode-toggle { margin-left: 0; }
  .mode-toggle button { font-size: .78rem; padding-inline: 9px; }
  .wrap { width: calc(100% - 16px); }
  .page-main { padding-top: 14px; }
  .page-heading { min-height: 110px; }
  .page-heading h1 { font-size: 2rem; }
  .hero { min-height: auto; padding: 20px 0 28px; }
  .hero h1 { font-size: clamp(2.35rem, 12vw, 3.35rem); }
  .hero .lead { font-size: .92rem; line-height: 1.65; }
  .mascot-team { grid-template-columns: repeat(5, 49px); grid-template-rows: 41px 61px; column-gap: 3px; }
  .mascot-team img { width: 45px; height: 45px; border-width: 2px; }
  .mascot-team .mascot-left-outer, .mascot-team .mascot-right-outer { transform: translateY(5px); }
  .mascot-team .mascot-left-inner, .mascot-team .mascot-right-inner { transform: none; }
  .mascot-team .mascot-top { transform: translateY(-1px); }
  .mascot-team .team-logo { width: 60px; height: 60px; padding: 3px; }
  .guide .bubble { margin-top: 10px; font-size: .78rem; }
  .lesson-hub-head { align-items: end; }
  .lesson-hub-head h2 { font-size: 1.55rem; }
  .lesson-progress { min-width: 90px; }
  .lesson-progress b { font-size: 1.8rem; }
  .lesson-grid { grid-template-columns: 1fr; }
  .lesson-card { min-height: 172px; grid-template-columns: minmax(0, 1fr) 126px; }
  .lesson-story { font-size: .72rem; }
  .lesson-deck-head { padding-inline: 10px; }
  .lesson-slide { padding: 12px; }
  .lesson-slide-copy { grid-template-columns: 1fr; }
  .lesson-slide-copy .eyebrow { grid-row: auto; }
  .lesson-deck-nav { padding-left: 10px; padding-right: 82px; }
  .lesson-deck-nav .btn { padding-inline: 10px; }
  .lesson-visual { min-height: 390px; }
  .types-grid, .quick-rule-grid, .quiz-options, .badge-grid { grid-template-columns: 1fr; }
  .type-reading-demo { min-width: 680px; }
  .status-rule-card { grid-template-columns: 130px 1fr; }
  .toolbar > .section-title { white-space: nowrap; }
  .ceremony-podium { overflow: hidden; }
  .ceremony-podium .podium { min-width: 0; width: 100%; justify-content: center; gap: 3px; overflow: visible; }
  .ceremony-podium .spot { width: 33%; }
  .ceremony-podium .spot .ph { width: 52px; height: 52px; }
  .ceremony-podium .spot.p1 .ph { width: 64px; height: 64px; }
  .ceremony-podium .spot b { font-size: .62rem; }
  .ceremony-podium .pblock { min-height: 100px; font-size: 2.2rem; }
  .ceremony-podium .pblock.p2 { min-height: 74px; }
  .ceremony-podium .pblock.p3 { min-height: 58px; }
}

/* ============================================================
   World-class classroom pass: consistent cards, diagrams and boards
   ============================================================ */

/* Every lesson point keeps the same visual weight, including four-point slides. */
.lesson-takeaways { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.lesson-takeaways div { min-width: 0; }
.lesson-takeaways span { min-width: 0; line-height: 1.35; }

/* Accurate, immediately distinguishable energy symbols. */
.energy-core::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 28%,rgba(255,255,255,.86),transparent 35%); }
.energy-card-figure[data-type="fire"] .energy-core::after { width: 28px; height: 38px; border: 0; border-radius: 60% 40% 58% 42% / 72% 48% 52% 28%; background: #17243a; clip-path: polygon(52% 0,75% 28%,69% 48%,91% 34%,100% 63%,86% 89%,59% 100%,26% 92%,5% 67%,15% 40%,36% 59%,31% 31%); }
.energy-card-figure[data-type="water"] .energy-core::after { width: 29px; height: 38px; border: 0; border-radius: 55% 45% 58% 42% / 68% 48% 52% 32%; background: #17243a; transform: rotate(45deg); clip-path: none; }
.energy-card-figure[data-type="grass"] .energy-core::after { width: 36px; height: 28px; border: 0; border-radius: 85% 8% 85% 8%; background: #17243a; transform: rotate(-35deg); clip-path: none; }
.energy-card-figure[data-type="grass"] .energy-core::before { z-index: 2; width: 3px; height: 35px; inset: 14px auto auto 31px; border-radius: 3px; background: #fff; transform: rotate(43deg); }
.energy-card-figure[data-type="psychic"] .energy-core::after { width: 33px; height: 33px; border: 5px solid #17243a; border-left-color: transparent; border-radius: 50%; background: transparent; clip-path: none; box-shadow: inset 0 0 0 4px var(--energy); }
.energy-card-figure[data-type="fighting"] .energy-core::after { width: 36px; height: 31px; border: 0; border-radius: 7px 7px 12px 12px; background: #17243a; clip-path: polygon(0 20%,18% 8%,32% 14%,45% 0,59% 13%,74% 4%,90% 19%,100% 72%,77% 100%,21% 96%); }
.energy-card-figure[data-type="darkness"] .energy-core::after { width: 33px; height: 33px; border: 0; border-radius: 50%; background: #17243a; box-shadow: 11px -5px 0 var(--energy); clip-path: none; }
.energy-card-figure[data-type="metal"] .energy-core::after { width: 36px; height: 36px; border: 0; background: #17243a; clip-path: polygon(50% 0,63% 17%,84% 12%,88% 34%,100% 50%,84% 64%,88% 87%,64% 84%,50% 100%,36% 84%,12% 88%,16% 64%,0 50%,16% 36%,12% 12%,36% 17%); }
.energy-card-figure[data-type="metal"] .energy-core::before { z-index: 3; inset: 23px; border: 4px solid var(--energy); background: transparent; }
.energy-card-figure[data-type="colorless"] .energy-core::after { width: 36px; height: 36px; border: 0; background: #17243a; clip-path: polygon(50% 0,61% 35%,98% 35%,68% 56%,79% 94%,50% 71%,21% 94%,32% 56%,2% 35%,39% 35%); }

/* Energy cards scale as cards, never as stale image placeholders. */
.card-zoom .energy-card-figure { width: min(310px, 68vw); }
.card-zoom .energy-card-face { width: min(310px, 68vw); padding: 14px; grid-template-rows: 42px 1fr 34px; gap: 10px; border-width: 7px; }
.card-zoom .energy-card-face.special { grid-template-rows: 42px 1fr auto 34px; }
.card-zoom .energy-card-face header, .card-zoom .energy-card-face footer { padding: 7px 10px; font-size: .86rem; }
.card-zoom .energy-card-face header b { font-size: 1rem; }
.card-zoom .energy-core { width: 112px; height: 112px; }
.hand-fan .energy-card-figure, .hand-fan .energy-card-face { width: 110px; }
.under-cards .energy-card-face { width: 100px; }
.attached-energy-pair .energy-card-face { width: 98px; }
.strategy-scene .energy-card-figure, .strategy-scene .energy-card-face,
.mistake-scene .energy-card-figure, .mistake-scene .energy-card-face { width: 82px; }

/* Four card categories: one disciplined horizontal teaching row. */
.scene-card-kinds { max-width: 940px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: clamp(12px, 2vw, 24px); }
.scene-card-kinds .tcg-card { width: 100%; min-height: 270px; align-content: start; }
.scene-card-kinds .pokemon-card-figure img,
.scene-card-kinds .pokemon-ex-figure img { width: 154px; }
.scene-card-kinds .energy-card-figure,
.scene-card-kinds .energy-card-face { width: 154px; }
.scene-card-kinds .trainer-card-figure.compact,
.scene-card-kinds .trainer-card-figure.compact .trainer-card-face { width: 154px; }
.scene-card-kinds .trainer-card-figure.compact .trainer-card-face { grid-template-rows: 19px 22px 82px minmax(30px,1fr) auto 10px; }
.scene-card-kinds .trainer-card-figure.compact figcaption { display: grid; }

/* Prize rule comparison gives ordinary and ex equal, readable columns. */
.prize-rule-scene { width: min(100%, 900px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.prize-case { min-width: 0; padding: 16px; display: grid; grid-template-columns: minmax(150px, .7fr) minmax(170px, 1fr); align-items: center; justify-items: center; gap: 12px; border: 1px solid var(--bp-line); border-top: 6px solid var(--bp-blue); border-radius: 8px; background: #fff; }
.prize-case.special { border-top-color: #7560c8; background: #fbfaff; }
.prize-case .pokemon-card-figure img { width: 142px; }
.prize-count { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
.prize-count .card-back-face { width: 82px; }
.prize-count b { flex-basis: 100%; margin-top: 8px; text-align: center; font-size: 1.05rem; }
.prize-count.two .tcg-card + .tcg-card { margin-left: -36px; transform: rotate(6deg); }

/* Quick rule cards are visual first, concise copy second. */
.quick-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.quick-rule-grid article { min-height: 190px; padding: 14px; display: grid; grid-template-columns: 40px 126px 1fr; align-items: center; gap: 12px; }
.quick-rule-grid article > b { position: static; align-self: start; width: 38px; height: 38px; }
.quick-rule-visual { width: 126px; height: 158px; display: flex; align-items: center; justify-content: center; gap: 3px; overflow: hidden; }
.quick-rule-visual .tcg-card figcaption { display: none; }
.quick-rule-visual .pokemon-card-figure img,
.quick-rule-visual .pokemon-ex-figure img { width: 92px; }
.quick-rule-visual .energy-card-figure,
.quick-rule-visual .energy-card-face { width: 92px; }
.quick-rule-visual .energy-card-face { padding: 4px; grid-template-rows: 17px 1fr 14px; gap: 3px; border-width: 3px; }
.quick-rule-visual .energy-card-face header,
.quick-rule-visual .energy-card-face footer { padding: 1px 2px; font-size: .36rem; }
.quick-rule-visual .energy-card-face header b { font-size: .42rem; }
.quick-rule-visual .energy-core { width: 38px; height: 38px; border-width: 3px; }
.quick-rule-visual .trainer-card-figure,
.quick-rule-visual .trainer-card-face { width: 100px; }
.quick-rule-visual .trainer-card-face { grid-template-rows: 14px 17px 54px minmax(22px,1fr) auto 5px; padding: 4px; gap: 2px; border-width: 3px; }
.quick-rule-visual .trainer-card-band { padding-inline: 3px; font-size: .38rem; }
.quick-rule-visual .trainer-card-face h4 { font-size: .6rem; }
.quick-rule-visual .trainer-card-face > p { padding: 2px; font-size: .27rem; }
.quick-rule-visual .trainer-rule-strip { padding: 2px; font-size: .23rem; }
.quick-rule-visual .card-back-face { width: 82px; }
.quick-rule-visual .prize-stack { transform: scale(.78); }

/* Complete card guide: equal cards in a horizontal row, explanation below. */
.official-card-guide { margin-top: 24px; padding: clamp(18px, 2.4vw, 30px); border: 1px solid var(--bp-line); border-radius: 8px; background: #f8fbff; }
.official-card-head { max-width: 820px; margin-bottom: 22px; }
.official-card-head h3 { margin: 8px 0 6px; font-size: 1.7rem; }
.official-card-head p { margin: 0; color: var(--bp-muted); }
.official-card-row, .official-trainer-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.official-card-row article, .official-trainer-row article { min-width: 0; padding: 14px; display: grid; grid-template-rows: 270px auto; align-items: start; justify-items: center; border: 1px solid var(--bp-line); border-top: 5px solid var(--bp-blue); border-radius: 8px; background: #fff; overflow: hidden; }
.official-trainer-row article { grid-template-rows: 292px auto; border-top-color: #e0a100; }
.official-card-row article > div, .official-trainer-row article > div { width: 100%; min-height: 88px; padding-top: 12px; border-top: 1px solid var(--bp-line); text-align: left; }
.official-card-row article > div b, .official-card-row article > div span,
.official-trainer-row article > div b, .official-trainer-row article > div span { display: block; }
.official-card-row article > div b, .official-trainer-row article > div b { margin-bottom: 4px; color: var(--bp-ink); font-size: 1rem; }
.official-card-row article > div span, .official-trainer-row article > div span { color: var(--bp-muted); font-size: .78rem; line-height: 1.45; }
.official-card-row .pokemon-card-figure img,
.official-card-row .pokemon-ex-figure img { width: 166px; }
.official-card-row .energy-card-figure,
.official-card-row .energy-card-face { width: 166px; }
.official-card-row .tcg-card figcaption { max-width: 180px; }
.official-trainer-row .trainer-card-figure,
.official-trainer-row .trainer-card-face { width: 184px; }
.official-trainer-row .trainer-card-face { grid-template-rows: 22px 25px 101px minmax(38px,1fr) auto 9px; gap: 3px; padding: 7px; }
.official-trainer-row .trainer-card-face > p { padding: 4px 5px; font-size: .43rem; }
.official-trainer-row .trainer-rule-strip { font-size: .38rem; }
.trainer-guide-title { margin: 30px 0 14px; font-size: 1.35rem; }
.official-special-rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.official-special-rules article { min-width: 0; padding: 14px; display: grid; grid-template-rows: 245px auto; border: 1px solid var(--bp-line); border-top: 5px solid #7560c8; border-radius: 8px; background: #fff; overflow: hidden; }
.official-special-rules article > div:last-child { padding-top: 12px; border-top: 1px solid var(--bp-line); }
.official-special-rules article > div:last-child b,
.official-special-rules article > div:last-child span { display: block; }
.official-special-rules article > div:last-child span { margin-top: 5px; color: var(--bp-muted); font-size: .78rem; line-height: 1.45; }
.special-rule-visual { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; overflow: hidden; }
.special-rule-visual .tcg-card figcaption { display: none; }
.special-rule-visual .pokemon-card-figure img { width: 150px; }
.special-rule-visual .rule-prize { position: absolute; right: 4px; bottom: 9px; z-index: 6; min-width: 62px; padding: 7px 8px; border: 3px solid #fff; border-radius: 7px; color: #fff; background: var(--bp-red); box-shadow: var(--bp-shadow-sm); text-align: center; }
.special-rule-visual.mega > em { position: absolute; left: 5px; top: 8px; z-index: 5; padding: 4px 7px; border-radius: 5px; color: #fff; background: #20224f; font-size: .65rem; font-style: normal; font-weight: 900; }
.special-rule-visual.labels .pokemon-card-figure img { width: 132px; }
.special-rule-visual.labels > i { position: absolute; top: 10px; padding: 5px 9px; border-radius: 5px; color: #fff; font-style: normal; font-weight: 900; }
.special-rule-visual.labels > i:first-of-type { left: 4px; background: #b65b30; }
.special-rule-visual.labels > i:last-of-type { right: 4px; background: #5574bd; }
.special-rule-visual.lineage .pokemon-card-figure img { width: 92px; }
.mini-arrow { position: relative; width: 30px; height: 4px; flex: 0 0 30px; border-radius: 4px; background: var(--bp-blue); }
.mini-arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border-left: 9px solid var(--bp-blue); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

/* Tournament: single-line names, touch-safe horizontal bracket and clean state marks. */
.flow-steps .step { grid-template-columns: 32px auto; justify-content: center; gap: 9px; }
.step-no { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-size: .78rem; }
.trainer .elim-x { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(255,255,255,.74); }
.trainer .elim-x::before, .trainer .elim-x::after { content: ""; position: absolute; width: 86px; height: 6px; border-radius: 5px; background: var(--bp-red); transform: rotate(45deg); }
.trainer .elim-x::after { transform: rotate(-45deg); }
.trainer .elim-x span { margin-top: 106px; padding: 3px 8px; border-radius: 5px; color: #fff; background: var(--bp-red); font-size: .72rem; font-weight: 900; }
.bracket-scroll { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: #9fb7d3 transparent; }
.bracket { min-width: 1080px; }
.bk-slot .nm, .trainer .tname, .match .name, .match .name b { letter-spacing: 0; white-space: nowrap; }
.bk-slot.win::after { content: "晉級"; justify-self: end; padding: 2px 5px; border-radius: 4px; color: #fff; background: var(--bp-green); font-size: .62rem; font-weight: 900; }
.bk-slot.win { grid-template-columns: 28px 40px minmax(0,1fr) auto; }
.champ-banner { min-height: 420px; }
.champ-banner::after { content: "CHAMPION"; position: absolute; left: 0; right: 0; bottom: 14px; color: rgba(157,111,0,.18); font: 900 clamp(3rem, 8vw, 7rem)/1 "M PLUS Rounded 1c"; letter-spacing: .08em; }
.podium { padding-top: 30px; background: linear-gradient(180deg,transparent 62%,#f8fbff 62%); }
.spot b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 901px) and (max-height: 700px) {
  .energy-card-figure, .energy-card-face { width: 104px; }
  .energy-card-face { padding: 4px; grid-template-rows: 18px 1fr 15px; gap: 3px; border-width: 3px; }
  .energy-card-face.special { grid-template-rows: 18px 1fr auto 15px; }
  .energy-card-face header, .energy-card-face footer { font-size: .36rem; padding: 1px 3px; }
  .energy-card-face header b { font-size: .45rem; }
  .energy-core { width: 42px; height: 42px; border-width: 3px; }
  .scene-card-kinds .tcg-card { min-height: 205px; }
  .scene-card-kinds .pokemon-card-figure img,
  .scene-card-kinds .pokemon-ex-figure img,
  .scene-card-kinds .energy-card-figure,
  .scene-card-kinds .energy-card-face,
  .scene-card-kinds .trainer-card-figure.compact,
  .scene-card-kinds .trainer-card-figure.compact .trainer-card-face { width: 112px; }
  .scene-card-kinds .trainer-card-figure.compact .trainer-card-face { grid-template-rows: 15px 17px 57px minmax(22px,1fr) auto 6px; padding: 4px; border-width: 3px; }
  .prize-case { padding: 8px; grid-template-columns: 130px 150px; }
  .prize-case .pokemon-card-figure img { width: 108px; }
  .prize-count .card-back-face { width: 62px; }
}

@media (max-width: 900px) {
  .official-card-row, .official-trainer-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .official-special-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-rule-grid article { grid-template-columns: 38px 112px 1fr; }
  .quick-rule-visual { width: 112px; }
  .flow-steps { width: 100%; min-width: 0; grid-template-columns: repeat(4, minmax(170px, 1fr)); }
}

@media (max-width: 700px) {
  .lesson-visual[data-visual="free-actions"] { display: block; padding: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .action-showcase { width: max-content; grid-template-columns: repeat(6, 142px); }
  .action-card { scroll-snap-align: start; }
  .lesson-visual[data-visual="card-kinds"],
  .lesson-visual[data-visual="evolution-line"],
  .lesson-visual[data-visual="strategy-trainers"],
  .lesson-visual[data-visual="win-prizes"],
  .lesson-visual[data-visual="mistake-energy"],
  .lesson-visual[data-visual="mistake-supporter"] { display: block; padding: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .lesson-visual[data-visual="card-kinds"] > *,
  .lesson-visual[data-visual="evolution-line"] > *,
  .lesson-visual[data-visual="strategy-trainers"] > *,
  .lesson-visual[data-visual="win-prizes"] > *,
  .lesson-visual[data-visual="mistake-energy"] > *,
  .lesson-visual[data-visual="mistake-supporter"] > * { min-width: max-content; justify-content: start; }
  .scene-card-kinds { display: flex; gap: 14px; }
  .scene-card-kinds > *, .trainer-showcase > *, .prize-case { scroll-snap-align: start; }
  .prize-rule-scene { display: flex; width: max-content; }
  .prize-case { width: 330px; }
  .official-card-row, .official-trainer-row { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 310px); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
  .official-card-row article, .official-trainer-row article { scroll-snap-align: start; }
  .official-special-rules { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 310px); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
  .official-special-rules article { scroll-snap-align: start; }
  .quick-rule-grid { grid-template-columns: 1fr; }
  .quick-rule-grid article { grid-template-columns: 36px 100px minmax(0,1fr); min-height: 170px; padding: 10px; gap: 8px; }
  .quick-rule-visual { width: 100px; }
  .quick-rule-grid h3 { font-size: .92rem; }
  .quick-rule-grid p { font-size: .78rem; line-height: 1.4; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Laptop classroom QA — stable single-screen lesson geometry
   ============================================================ */

/* Card captions must never be clipped by a narrow teaching scene. */
.lesson-visual .tcg-card figcaption {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 38px;
  overflow: visible;
}
.lesson-visual .tcg-card figcaption b,
.lesson-visual .tcg-card figcaption span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.lesson-visual img {
  flex: 0 0 auto;
  object-fit: contain;
}
.lesson-visual > * {
  max-width: 100%;
}

/* Keep the active lesson inside a laptop viewport, including browser chrome. */
@media (min-width: 701px) {
  body.lesson-open {
    overflow: hidden;
  }
  body.lesson-open .page-main {
    height: calc(100dvh - var(--header-h));
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .lesson-deck {
    height: calc(100dvh - var(--header-h) - 20px);
    max-height: calc(100dvh - var(--header-h) - 20px);
    min-height: 0;
    grid-template-rows: 64px minmax(0, 1fr) 58px;
  }
  .lesson-deck-head {
    padding-block: 6px;
  }
  .lesson-deck-head h2 {
    font-size: 1.25rem;
    line-height: 1.2;
  }
  .lesson-slide {
    min-height: 0;
    padding: 10px 18px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 9px;
    overflow: hidden;
  }
  .lesson-slide-copy {
    gap: 3px 14px;
  }
  .lesson-slide-copy h3 {
    font-size: clamp(1.25rem, 2vw, 1.8rem);
  }
  .lesson-slide-copy p {
    font-size: .88rem;
    line-height: 1.45;
  }
  .lesson-visual {
    min-height: 0;
    padding: 10px;
    justify-content: center;
    overflow: hidden;
  }
  .lesson-takeaways {
    gap: 7px;
  }
  .lesson-takeaways div {
    min-height: 46px;
    padding: 7px 10px;
    font-size: .8rem;
  }
  .lesson-takeaways b {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }
  .lesson-deck-nav {
    position: relative;
    z-index: 20;
    min-height: 58px;
    padding: 5px clamp(104px, 8vw, 128px) 5px 14px;
    background: rgba(248, 251, 255, .98);
    box-shadow: 0 -5px 16px rgba(24, 63, 111, .07);
  }
  .lesson-deck-nav .btn {
    min-height: 46px;
  }
}

/* Short laptop screens receive a little more room for the teaching diagram. */
@media (min-width: 701px) and (max-height: 760px) {
  body.lesson-open .page-main {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .lesson-deck {
    height: calc(100dvh - var(--header-h) - 12px);
    max-height: calc(100dvh - var(--header-h) - 12px);
    grid-template-rows: 58px minmax(0, 1fr) 54px;
  }
  .lesson-deck-head {
    grid-template-columns: 44px 1fr auto;
  }
  .lesson-deck-head h2 {
    font-size: 1.12rem;
    line-height: 1.2;
  }
  .lesson-slide {
    padding: 7px 14px;
    gap: 6px;
  }
  .lesson-slide-copy h3 {
    font-size: 1.3rem;
  }
  .lesson-slide-copy p {
    font-size: .8rem;
  }
  .lesson-visual {
    padding: 7px;
  }
  .lesson-takeaways div {
    min-height: 40px;
    padding: 5px 8px;
    font-size: .74rem;
  }
  .lesson-takeaways b {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
  .lesson-deck-nav {
    min-height: 54px;
    padding-block: 4px;
  }
  .lesson-deck-nav .btn {
    min-height: 44px;
  }
}

/* ============================================================
   Stable classroom scenes — explicit geometry, no card overlap
   ============================================================ */
@media (min-width: 701px) {
  .lesson-visual[data-visual="opening-hand"],
  .lesson-visual[data-visual="mulligan"],
  .lesson-visual[data-visual="attached"] {
    padding: 12px 18px;
  }

  .opening-scene,
  .mulligan-scene,
  .attach-scene {
    width: min(100%, 1160px);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
  }

  .opening-scene {
    display: grid;
    grid-template-columns: minmax(580px, 1fr) 92px 160px;
    align-items: center;
    gap: 18px;
  }

  .opening-hand-panel,
  .chosen-basic,
  .bad-hand,
  .new-hand,
  .attach-demo {
    min-width: 0;
    min-height: 0;
    padding: 12px;
    border: 1px solid var(--bp-line);
    border-radius: 8px;
    background: #fff;
  }

  .opening-hand-panel,
  .bad-hand,
  .attach-demo {
    height: min(100%, 330px);
    display: grid;
    align-content: center;
    justify-items: stretch;
    gap: 10px;
  }

  .scene-label {
    width: max-content;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    color: #4b3800;
    background: var(--bp-gold);
    font-size: .76rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
  }

  .scene-note {
    color: #38577e;
    font-size: .78rem;
    line-height: 1.35;
    text-align: center;
  }

  .opening-hand-panel .hand-fan {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    justify-items: center;
    gap: 5px;
  }

  .opening-hand-panel .hand-fan > * {
    width: 82px;
    min-width: 0;
    margin: 0;
    transform: none;
  }

  .opening-hand-panel .hand-fan .tcg-card figcaption,
  .bad-hand-row .tcg-card figcaption {
    display: none;
  }

  .opening-hand-panel .hand-fan .card-back-face,
  .opening-hand-panel .hand-fan .pokemon-card-figure img,
  .opening-hand-panel .hand-fan .energy-card-figure,
  .opening-hand-panel .hand-fan .energy-card-face,
  .opening-hand-panel .hand-fan .trainer-card-figure,
  .opening-hand-panel .hand-fan .trainer-card-face {
    width: 82px;
  }

  .opening-hand-panel .hand-fan .energy-card-face,
  .opening-hand-panel .hand-fan .trainer-card-face {
    border-width: 3px;
    padding: 4px;
    gap: 2px;
  }

  .opening-hand-panel .hand-fan .energy-card-face {
    grid-template-rows: 16px 1fr 14px;
  }

  .opening-hand-panel .hand-fan .trainer-card-face {
    grid-template-rows: 13px 16px 44px minmax(18px, 1fr) auto 5px;
  }

  .opening-hand-panel .hand-fan .trainer-card-band,
  .opening-hand-panel .hand-fan .energy-card-face header {
    font-size: .34rem;
  }

  .opening-hand-panel .hand-fan .trainer-card-face h4 {
    font-size: .56rem;
  }

  .opening-hand-panel .hand-fan .trainer-card-face > p,
  .opening-hand-panel .hand-fan .trainer-rule-strip {
    padding: 2px;
    font-size: .22rem;
  }

  .opening-hand-panel .hand-fan .trainer-card-face > small {
    display: none;
  }

  .opening-hand-panel .hand-fan .energy-core {
    width: 35px;
    height: 35px;
    border-width: 3px;
  }

  .opening-hand-panel .hand-fan .energy-core::after {
    transform: scale(.65);
  }

  .opening-scene > .scene-arrow,
  .mulligan-scene > .scene-arrow {
    min-width: 0;
    width: 92px;
  }

  .chosen-basic,
  .new-hand {
    width: 160px;
    align-self: center;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 7px;
  }

  .chosen-basic .pokemon-card-figure img,
  .new-hand .pokemon-card-figure img {
    width: 118px;
  }

  .chosen-basic .tcg-card figcaption,
  .new-hand .tcg-card figcaption {
    min-height: 28px;
    margin-top: 4px;
    font-size: .72rem;
  }

  .mulligan-scene {
    display: grid;
    grid-template-columns: minmax(430px, 1fr) 118px 170px;
    align-items: center;
    gap: 20px;
  }

  .bad-hand-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 110px);
    align-items: center;
    justify-content: center;
    gap: 14px;
  }

  .bad-hand-row .energy-card-figure,
  .bad-hand-row .energy-card-face,
  .bad-hand-row .trainer-card-figure,
  .bad-hand-row .trainer-card-face {
    width: 110px;
  }

  .bad-hand-row .energy-card-face,
  .bad-hand-row .trainer-card-face {
    border-width: 3px;
    padding: 4px;
    gap: 2px;
  }

  .bad-hand-row .trainer-card-face {
    grid-template-rows: 15px 18px 60px minmax(24px, 1fr) auto 6px;
  }

  .bad-hand-row .trainer-card-face > p {
    padding: 2px 3px;
    font-size: .28rem;
  }

  .bad-hand-row .trainer-rule-strip {
    padding: 2px 3px;
    font-size: .25rem;
  }

  .attach-scene {
    display: grid;
    grid-template-columns: minmax(620px, 1.25fr) minmax(320px, .75fr);
    align-items: center;
    gap: 28px;
  }

  .attach-stack {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 210px 125px 125px;
    align-items: end;
    justify-content: center;
    gap: 18px;
  }

  .attach-stack .attach-main .pokemon-card-figure img {
    width: 190px;
  }

  .attach-card {
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: end;
    gap: 5px;
  }

  .attach-card > b {
    color: var(--bp-ink);
    font-size: .72rem;
  }

  .attach-card .energy-card-figure,
  .attach-card .energy-card-face,
  .attach-card .trainer-card-figure,
  .attach-card .trainer-card-face {
    width: 112px;
  }

  .attach-card .trainer-card-face {
    grid-template-rows: 15px 18px 60px minmax(24px, 1fr) auto 6px;
    padding: 4px;
    gap: 2px;
    border-width: 3px;
  }

  .attach-card .trainer-card-face > p,
  .attach-card .trainer-rule-strip {
    padding: 2px 3px;
    font-size: .27rem;
  }

  .attach-card .tcg-card figcaption {
    min-height: 30px;
    margin-top: 4px;
    font-size: .7rem;
  }

  .attach-copy {
    min-width: 0;
    padding: 18px 20px;
    display: grid;
    gap: 10px;
    border: 1px solid var(--bp-line);
    border-left: 5px solid var(--bp-gold);
    border-radius: 8px;
    background: #fff;
  }

  .attach-copy h4 {
    margin: 0 0 2px;
    color: var(--bp-ink);
    font-size: 1.05rem;
  }

  .attach-copy > div {
    min-width: 0;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    color: #415c7f;
    font-size: .8rem;
    line-height: 1.45;
  }

  .attach-copy > div > b {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #3d2e00;
    background: var(--bp-gold);
  }
}

/* ============================================================
   Trainer registration and printable license
   ============================================================ */
.trainer-type-grass { --trainer-accent: #38a653; --trainer-soft: #edfff2; --trainer-deep: #155d35; --trainer-glow: #c6f16a; --trainer-scene-x: 8%; }
.trainer-type-fire { --trainer-accent: #eb4d3d; --trainer-soft: #fff0e7; --trainer-deep: #9b271f; --trainer-glow: #ffb23e; --trainer-scene-x: 22%; }
.trainer-type-water { --trainer-accent: #2696db; --trainer-soft: #e9f8ff; --trainer-deep: #14598b; --trainer-glow: #73d9ff; --trainer-scene-x: 38%; }
.trainer-type-lightning { --trainer-accent: #e8ab00; --trainer-soft: #fff9d7; --trainer-deep: #6d5200; --trainer-glow: #ffe36a; --trainer-scene-x: 86%; }
.trainer-type-psychic { --trainer-accent: #8957cb; --trainer-soft: #f4edff; --trainer-deep: #523183; --trainer-glow: #d7a7ff; --trainer-scene-x: 65%; }
.trainer-type-fighting { --trainer-accent: #c66b31; --trainer-soft: #fff1e2; --trainer-deep: #773b19; --trainer-glow: #ffc16f; --trainer-scene-x: 18%; }
.trainer-type-darkness { --trainer-accent: #43506a; --trainer-soft: #edf1f7; --trainer-deep: #1d2941; --trainer-glow: #a7b6d1; --trainer-scene-x: 70%; }
.trainer-type-metal { --trainer-accent: #6c879a; --trainer-soft: #eef5f7; --trainer-deep: #385267; --trainer-glow: #c9e2ea; --trainer-scene-x: 46%; }
.trainer-type-dragon { --trainer-accent: #c98725; --trainer-soft: #fff5dc; --trainer-deep: #72500d; --trainer-glow: #efd04a; --trainer-scene-x: 28%; }
.trainer-type-colorless { --trainer-accent: #6d7f91; --trainer-soft: #f3f6f8; --trainer-deep: #3d4d5c; --trainer-glow: #dce5ec; --trainer-scene-x: 50%; }

.trainer-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.trainer {
  min-height: 254px;
  border-top: 5px solid var(--trainer-accent, var(--bp-blue));
}

.trainer::after {
  display: none;
}

.trainer .photo {
  box-shadow: 0 0 0 3px var(--trainer-soft, #eaf2ff), 0 0 0 5px var(--trainer-accent, var(--bp-blue));
}

.trainer-card-type {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--trainer-deep, var(--bp-ink));
  font-size: .76rem;
  font-weight: 900;
}

.trainer-card-type img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--trainer-accent, var(--bp-blue));
}

.trainer-card-type i {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--trainer-accent, var(--bp-blue));
  font-size: .58rem;
  font-style: normal;
  font-weight: 900;
}

.trainer-pass-button {
  min-height: 36px;
  padding: 5px 9px;
}

.trainer-register-modal {
  width: min(1060px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
}

.trainer-register-head,
.credential-head {
  position: relative;
  isolation: isolate;
  min-height: 92px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--bp-line);
  background: #fff;
}

.trainer-register-head {
  overflow: hidden;
  background:
    linear-gradient(90deg, #fff 0 48%, rgba(255,255,255,.82) 68%, #fff 100%),
    linear-gradient(135deg, #fff6c9, #e6f5ff 56%, #edfff0);
}

.trainer-register-world {
  position: absolute;
  z-index: -1;
  right: 68px;
  top: -36px;
  width: 520px;
  height: 190px;
  overflow: hidden;
  background: url("../img/generated/trainer-license-pokemon-arena-reference.jpg") center / cover no-repeat;
  filter: saturate(1.14) contrast(1.02) brightness(1.12);
  mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.92) 18%, #000 42% 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.92) 18%, #000 42% 100%);
}

.trainer-register-world::before {
  content: "";
  position: absolute;
  inset: 10px 8px 0 138px;
  background: url("../img/generated/trainer-license-mascot-ball-v1.png") right center / 360px auto no-repeat;
  filter: saturate(1.06) brightness(1.03);
  mask-image: linear-gradient(90deg, transparent 0, #000 22% 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22% 100%);
}

.trainer-register-head > div,
.credential-head > div {
  min-width: 0;
}

.trainer-register-head h2,
.credential-head h2 {
  margin: 3px 0 0;
  color: var(--bp-ink);
}

.trainer-register-head p {
  margin: 4px 0 0;
  color: var(--bp-muted);
}

.eyebrow,
.preview-label {
  color: var(--bp-blue);
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.registration-step {
  margin-left: auto;
  padding: 8px 11px;
  border: 1px solid var(--bp-line);
  border-radius: 6px;
  color: var(--bp-muted);
  font-size: .74rem;
  font-weight: 900;
  white-space: nowrap;
}

.trainer-register-grid {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  background: #f7faff;
}

.trainer-register-form {
  min-width: 0;
  display: grid;
  gap: 15px;
}

.trainer-register-form label,
.trainer-type-field legend {
  margin-bottom: 7px;
  color: var(--bp-ink);
  font-size: .78rem;
  font-weight: 900;
}

.photo-field {
  min-width: 0;
}

.photo-pick {
  position: relative;
  width: 100%;
  height: 168px;
  margin: 0;
  padding: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 2px dashed #9db8d8;
  border-radius: 8px;
  color: var(--bp-muted);
  background: #fff;
  overflow: hidden;
}

.photo-pick:hover {
  color: var(--bp-blue);
  border-color: var(--bp-blue);
  background: #f4f9ff;
}

.photo-pick .bp-icon {
  width: 28px;
  height: 28px;
}

.photo-pick img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
}

.photo-change {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  color: #fff;
  background: rgba(18, 52, 91, .86);
  font-size: .7rem;
  font-weight: 900;
}

.trainer-type-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.trainer-type-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.trainer-type-option {
  min-width: 0;
  min-height: 58px;
  padding: 6px 3px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid var(--bp-line);
  border-radius: 7px;
  color: var(--trainer-deep);
  background: #fff;
}

.trainer-type-option:hover,
.trainer-type-option.selected {
  border-color: var(--trainer-accent);
  background: var(--trainer-soft);
  box-shadow: inset 0 0 0 2px var(--trainer-accent);
}

.trainer-type-dot {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--trainer-accent);
  font-size: .66rem;
  font-style: normal;
  font-weight: 900;
}

.trainer-type-option b {
  font-size: .67rem;
}

.registration-note {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 1px solid #cddcf0;
  border-radius: 7px;
  color: #49617f;
  background: #eef5ff;
}

.registration-note p {
  margin: 0;
  font-size: .72rem;
  line-height: 1.45;
}

.trainer-pass-preview {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.trainer-pass-preview > div {
  min-width: 0;
}

.trainer-register-actions,
.credential-actions {
  min-height: 70px;
  padding: 12px 24px;
  border-top: 1px solid var(--bp-line);
  background: #fff;
}

.credential-dialog {
  width: min(760px, 100%);
  padding: 0;
}

.credential-head .icon-btn {
  margin-left: auto;
}

.credential-print-root {
  padding: 28px;
  background: #edf3fa;
}

.credential-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.trainer-pass-frame {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 429px;
  margin: 0 auto;
  overflow: hidden;
}

.trainer-pass {
  --trainer-accent: #6d7f91;
  --trainer-soft: #f1f4f7;
  --trainer-deep: #3e4d5b;
  --trainer-glow: #dce5ec;
  --trainer-scene-x: 50%;
  position: relative;
  isolation: isolate;
  width: 680px;
  height: 429px;
  margin: 0;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr) 39px;
  transform-origin: left top;
  overflow: hidden;
  border: 3px solid var(--trainer-accent);
  border-radius: 14px;
  color: #142c4d;
  background:
    linear-gradient(108deg, rgba(255,255,255,1) 0 48%, rgba(255,255,255,.94) 60%, color-mix(in srgb, var(--trainer-soft) 72%, #fff) 100%),
    var(--trainer-soft);
  box-shadow:
    0 18px 36px rgba(28, 61, 100, .18),
    0 0 0 1px rgba(255, 255, 255, .92) inset;
}

.trainer-pass::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 88% 26%, color-mix(in srgb, var(--trainer-glow) 48%, transparent) 0 18%, transparent 43%),
    linear-gradient(115deg, transparent 0 48%, color-mix(in srgb, var(--trainer-accent) 18%, transparent) 48% 100%),
    repeating-linear-gradient(135deg, transparent 0 20px, rgba(34, 73, 117, .035) 20px 22px);
  pointer-events: none;
}

.trainer-pass::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--trainer-accent), var(--trainer-glow), var(--trainer-accent));
  pointer-events: none;
}

.trainer-pass-world {
  position: absolute;
  z-index: 0;
  right: 0;
  top: 68px;
  bottom: 39px;
  width: 322px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.28), transparent 34%),
    url("../img/generated/trainer-license-pokemon-arena-reference.jpg") center / cover no-repeat;
  opacity: 1;
  filter: saturate(1.12) contrast(1.02) brightness(1.1);
  mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.94) 17%, #000 35% 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.94) 17%, #000 35% 100%);
  pointer-events: none;
}

.trainer-pass-mascot {
  position: absolute;
  z-index: 1;
  right: -1px;
  bottom: 41px;
  width: 260px;
  height: 202px;
  overflow: hidden;
  background: url("../img/generated/trainer-license-mascot-ball-v1.png") center bottom / 260px auto no-repeat;
  filter:
    saturate(1.08)
    brightness(1.04)
    drop-shadow(0 5px 6px rgba(10, 43, 83, .2));
  clip-path: inset(0 0 0 72px);
  pointer-events: none;
}

.trainer-pass-energy-lines {
  content: "";
  position: absolute;
  z-index: 0;
  right: 28px;
  top: 104px;
  width: 220px;
  height: 220px;
  border: 18px solid color-mix(in srgb, var(--trainer-accent) 10%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--trainer-glow) 8%, transparent),
    0 0 0 24px color-mix(in srgb, var(--trainer-accent) 5%, transparent);
  pointer-events: none;
}

.trainer-pass-energy-lines::before,
.trainer-pass-energy-lines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 8px);
  height: 16px;
  background: color-mix(in srgb, var(--trainer-accent) 11%, transparent);
}

.trainer-pass-energy-lines::after {
  transform: rotate(58deg);
}

.trainer-pass-header {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding: 13px 16px 9px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 105px;
  align-items: center;
  gap: 11px;
  color: var(--trainer-deep);
  border-bottom: 1px solid color-mix(in srgb, var(--trainer-accent) 38%, #fff);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(5px);
}

.trainer-pass-header img {
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--trainer-accent), 0 5px 12px rgba(28, 61, 100, .12);
}

.trainer-pass-header div {
  min-width: 0;
  display: grid;
  gap: 2px;
  line-height: 1.05;
}

.trainer-pass-header b {
  overflow: hidden;
  font-size: 1.03rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-pass-header span {
  color: var(--trainer-accent);
  font-size: .5rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .06em;
}

.trainer-pass-header strong {
  min-height: 42px;
  padding: 6px 9px;
  display: grid;
  align-content: center;
  gap: 1px;
  border: 1px solid color-mix(in srgb, var(--trainer-accent) 45%, #fff);
  border-radius: 8px;
  color: var(--trainer-deep);
  background: color-mix(in srgb, var(--trainer-soft) 75%, #fff);
  font-size: .78rem;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.trainer-pass-header strong small {
  color: var(--trainer-accent);
  font-size: .45rem;
  letter-spacing: .05em;
}

.trainer-pass-body {
  position: relative;
  z-index: 3;
  min-height: 0;
  padding: 15px 16px 14px;
  display: grid;
  grid-template-columns: 166px 276px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.trainer-pass-photo-wrap {
  min-width: 0;
  min-height: 0;
  padding: 7px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--trainer-accent) 44%, #fff);
  border-radius: 10px;
  color: var(--trainer-deep);
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 7px 18px rgba(28, 61, 100, .09);
}

.trainer-pass-photo-wrap > span {
  color: var(--trainer-accent);
  font-size: .47rem;
  font-weight: 900;
  letter-spacing: .06em;
}

.trainer-pass-photo-wrap > b {
  font-size: .61rem;
  text-align: center;
}

.trainer-pass-photo {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  overflow: hidden;
  border: 2px solid var(--trainer-accent);
  border-radius: 7px;
  color: var(--trainer-deep);
  background: var(--trainer-soft);
  box-shadow: 0 0 0 3px #fff;
}

.trainer-pass-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.trainer-pass-initial {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--trainer-accent), var(--trainer-deep));
  font-size: 2.15rem;
  font-weight: 900;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--trainer-accent) 12%, transparent);
}

.trainer-pass-identity {
  position: relative;
  z-index: 4;
  min-width: 0;
  padding: 10px 12px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: center;
  border: 1px solid color-mix(in srgb, var(--trainer-accent) 20%, #fff);
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(255,255,255,.96), rgba(255,255,255,.78));
  box-shadow: 0 7px 18px rgba(28, 61, 100, .08);
}

.trainer-pass-label {
  color: var(--trainer-accent);
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.trainer-pass-identity h3 {
  min-width: 0;
  margin: 2px 0 10px;
  padding-bottom: 8px;
  overflow: hidden;
  border-bottom: 3px solid var(--trainer-accent);
  font-size: 1.82rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-pass-type {
  position: relative;
  z-index: 4;
  isolation: isolate;
  min-width: 0;
  padding: 7px 9px;
  display: grid;
  align-content: center;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255,255,255,.94), rgba(255,255,255,.76));
  box-shadow: inset 3px 0 0 var(--trainer-accent);
}

.trainer-pass-type div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.trainer-pass-type b {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--trainer-deep);
  font-size: 1.04rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-pass-type small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #5e7390;
  font-size: .64rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-pass dl {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: 1fr .86fr 1fr;
  gap: 6px;
}

.trainer-pass dl div {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid color-mix(in srgb, var(--trainer-accent) 25%, #d7e1ed);
  border-radius: 6px;
  background: rgba(255,255,255,.83);
}

.trainer-pass dt {
  color: var(--trainer-accent);
  font-size: .45rem;
  font-weight: 900;
}

.trainer-pass dd {
  margin: 1px 0 0;
  overflow: hidden;
  font-size: .58rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-pass-affinity {
  position: relative;
  z-index: 3;
  min-width: 0;
  width: 82px;
  align-self: end;
  justify-self: end;
  min-height: 142px;
  padding: 7px 6px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--trainer-accent) 48%, #fff);
  border-radius: 10px;
  color: var(--trainer-deep);
  background: rgba(255, 255, 255, .91);
  box-shadow: 0 10px 24px rgba(28, 61, 100, .16);
}

.trainer-pass-affinity > span {
  color: var(--trainer-accent);
  font-size: .46rem;
  font-weight: 900;
  letter-spacing: .05em;
}

.trainer-pass-energy {
  width: 52px;
  height: 70px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 7px;
  background: var(--trainer-soft);
  box-shadow: 0 0 0 2px var(--trainer-accent);
}

.trainer-pass-energy img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.trainer-pass-energy span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--trainer-accent), var(--trainer-deep));
  font-size: .72rem;
  font-weight: 900;
}

.trainer-pass-affinity b {
  color: var(--trainer-deep);
  font-size: .68rem;
}

.trainer-pass-affinity small {
  color: #627792;
  font-size: .44rem;
  line-height: 1.25;
  text-align: center;
}

.trainer-pass-footer {
  position: relative;
  z-index: 2;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(90deg, var(--trainer-deep), var(--trainer-accent));
  font-size: .54rem;
  font-weight: 900;
}

.trainer-pass-footer span {
  height: 15px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.88) 0 2px, transparent 2px 5px);
  opacity: .56;
}

.trainer-pass-footer b,
.trainer-pass-footer strong {
  white-space: nowrap;
}

@media (min-width: 701px) and (max-width: 980px) {
  .trainer-register-grid {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
  }
}

@media (min-width: 981px) and (max-height: 850px) {
  .trainer-register-head,
  .credential-head {
    min-height: 78px;
    padding: 14px 22px;
  }

  .trainer-register-grid {
    padding: 14px 22px;
    gap: 24px;
  }

  .trainer-register-form {
    gap: 10px;
  }

  .photo-pick {
    height: 138px;
  }

  .trainer-type-option {
    min-height: 50px;
  }

  .trainer-type-dot {
    width: 24px;
    height: 24px;
  }

  .registration-note {
    padding: 7px 10px;
  }

  .trainer-register-actions,
  .credential-actions {
    min-height: 60px;
    padding: 9px 22px;
  }
}

@media print {
  @page {
    size: 85.6mm 54mm;
    margin: 0;
  }

  body * {
    visibility: hidden !important;
  }

  #credentialBody,
  #credentialBody * {
    visibility: visible !important;
  }

  #credentialBody {
    position: fixed;
    inset: 0;
    width: 85.6mm;
    height: 54mm;
    padding: 0;
    background: #fff;
  }

  #credentialBody .trainer-pass-frame {
    width: 85.6mm;
    max-width: none;
    height: 54mm !important;
    overflow: visible;
  }

  #credentialBody .trainer-pass {
    width: 680px;
    height: 429px;
    transform: scale(.4755) !important;
    transform-origin: left top;
    border-radius: 14px;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Qualification sheets: print a clean A4 landscape handout from the referee console. */
.qualification-print-sheet { display: none; }
.qualification-print-toolbar { border-color: var(--bp-gold); }

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  body.printing-qualifier,
  body.printing-qualifier * {
    visibility: hidden !important;
  }

  body.printing-qualifier .qualification-print-sheet,
  body.printing-qualifier .qualification-print-sheet * {
    visibility: visible !important;
  }

  body.printing-qualifier #credentialBody,
  body.printing-qualifier #credentialBody * {
    visibility: hidden !important;
  }

  body.printing-qualifier .qualification-print-sheet {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    color: #142b4d;
    background: #fff;
    font-family: "Noto Sans TC", sans-serif;
  }

  .print-sheet-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding-bottom: 7mm;
    border-bottom: 2px solid #142b4d;
  }

  .print-kicker {
    margin: 0 0 2mm;
    color: #d99b00;
    font-size: 10pt;
    font-weight: 900;
    letter-spacing: .12em;
  }

  .print-sheet-head h1 {
    margin: 0 0 2mm;
    font-size: 25pt;
    line-height: 1;
  }

  .print-sheet-head p { margin: 0; color: #627796; font-size: 10pt; }
  .print-date { color: #627796; text-align: right; font-size: 9pt; line-height: 1.7; }
  .print-date b { color: #142b4d; font-size: 11pt; }

  .print-summary { margin-top: 7mm; }
  .print-summary h2 { margin: 0 0 2mm; font-size: 14pt; }
  .print-summary p { margin: 0 0 3mm; color: #627796; font-size: 9pt; }
  .print-summary table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9pt; }
  .print-summary th,
  .print-summary td { padding: 2.2mm 2.5mm; border: 1px solid #bdcbe0; text-align: left; vertical-align: middle; }
  .print-summary th { color: #fff; background: #315d9b; font-weight: 800; }
  .print-summary tbody tr:nth-child(even) { background: #f3f7fc; }
  .print-summary .print-no { width: 12mm; font-weight: 900; }
  .print-summary .print-vs { white-space: nowrap; font-weight: 800; color: #315d9b; }
  .print-summary td:nth-last-child(-n+3),
  .print-summary th:nth-last-child(-n+3) { width: 15mm; text-align: center; }
  .print-sheet-foot { display: flex; justify-content: space-between; margin-top: 6mm; padding-top: 3mm; border-top: 1px solid #bdcbe0; color: #627796; font-size: 8.5pt; }
}

@media (min-width: 701px) and (max-width: 1180px) {
  .opening-scene {
    grid-template-columns: minmax(500px, 1fr) 78px 145px;
    gap: 10px;
  }

  .opening-hand-panel .hand-fan > *,
  .opening-hand-panel .hand-fan .card-back-face,
  .opening-hand-panel .hand-fan .pokemon-card-figure img,
  .opening-hand-panel .hand-fan .energy-card-figure,
  .opening-hand-panel .hand-fan .energy-card-face,
  .opening-hand-panel .hand-fan .trainer-card-figure,
  .opening-hand-panel .hand-fan .trainer-card-face {
    width: 70px;
  }

  .attach-scene {
    grid-template-columns: minmax(520px, 1.2fr) minmax(280px, .8fr);
    gap: 18px;
  }

  .attach-stack {
    grid-template-columns: 180px 104px 104px;
    gap: 10px;
  }

  .attach-stack .attach-main .pokemon-card-figure img {
    width: 165px;
  }

  .attach-card .energy-card-figure,
  .attach-card .energy-card-face,
  .attach-card .trainer-card-figure,
  .attach-card .trainer-card-face {
    width: 98px;
  }
}

/* A special condition rotates the physical card, not its teaching caption. */
@media (min-width: 701px) {
  .status-figure.sleep .status-card,
  .status-figure.paralyze .status-card {
    width: 300px;
    height: 218px;
    display: grid;
    place-items: center;
    transform: none;
  }

  .status-figure.sleep .status-card .pokemon-card-figure,
  .status-figure.paralyze .status-card .pokemon-card-figure {
    position: relative;
    width: 300px;
    height: 218px;
    display: block;
  }

  .status-figure.sleep .status-card .pokemon-card-figure img,
  .status-figure.paralyze .status-card .pokemon-card-figure img {
    position: absolute;
    left: 50%;
    top: 86px;
    width: 220px;
    transform: translate(-50%, -50%) rotate(90deg) scale(.78);
    transform-origin: center;
  }

  .status-figure.sleep .status-card .pokemon-card-figure figcaption,
  .status-figure.paralyze .status-card .pokemon-card-figure figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-height: 38px;
    margin: 0;
    transform: none;
  }
}

/* ============================================================
   Laptop classroom QA: card internals and grouped diagrams
   ============================================================ */
.trainer-card-face > *,
.trainer-card-band > * {
  min-width: 0;
}

.trainer-card-band {
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.trainer-card-band > * {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trainer-card-face h4 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*
 * Trainer cards appear at several teaching sizes. Scale every internal part
 * from the card itself so a compact card can never keep full-size typography.
 */
.trainer-card-figure {
  container-type: inline-size;
}

.trainer-card-face {
  box-sizing: border-box;
  grid-template-rows: 14cqw 14cqw 57cqw minmax(0, 1fr) auto 5cqw !important;
  gap: 1.8cqw !important;
  padding: 3.6cqw !important;
  border-width: 2.4cqw !important;
}

.trainer-card-band {
  padding: .8cqw 2.6cqw !important;
  font-size: 3.9cqw !important;
  line-height: 1.12 !important;
}

.trainer-card-face h4 {
  padding-inline: 1.8cqw !important;
  font-size: 6.7cqw !important;
  line-height: 1 !important;
}

.trainer-card-face > p {
  padding: 2cqw 2.6cqw !important;
  font-size: 3.1cqw !important;
  line-height: 1.22 !important;
  overflow: hidden !important;
}

.trainer-rule-strip {
  padding: 1.8cqw 2.6cqw !important;
  font-size: 2.75cqw !important;
  line-height: 1.18 !important;
  overflow: hidden !important;
}

.trainer-card-face > small {
  font-size: 2cqw !important;
  line-height: 1 !important;
}

@media (min-width: 701px) {
  /* One visible scale per teaching role: overview, action and full card. */
  .scene-card-kinds {
    width: min(100%, 1080px);
    max-width: 1080px;
    gap: 22px;
  }

  .scene-card-kinds .tcg-card {
    min-height: 300px;
  }

  .scene-card-kinds .pokemon-card-figure img,
  .scene-card-kinds .pokemon-ex-figure img,
  .scene-card-kinds .energy-card-figure,
  .scene-card-kinds .energy-card-face,
  .scene-card-kinds .trainer-card-figure.compact,
  .scene-card-kinds .trainer-card-figure.compact .trainer-card-face {
    width: 174px;
  }

  .action-showcase {
    width: min(100%, 1180px);
    gap: 12px;
  }

  .action-card {
    min-height: 270px;
    grid-template-rows: 194px auto;
  }

  .action-card-visual .pokemon-card-figure img,
  .action-card-visual .energy-card-figure,
  .action-card-visual .energy-card-face,
  .action-card-visual .trainer-card-figure.compact,
  .action-card-visual .trainer-card-figure.compact .trainer-card-face {
    width: 118px;
  }

  .trainer-showcase {
    width: min(100%, 1080px);
    gap: 20px;
  }

  .trainer-showcase .trainer-card-figure,
  .trainer-showcase .trainer-card-face {
    width: 186px;
  }

  .trainer-showcase .trainer-card-figure {
    grid-template-rows: auto minmax(78px, auto);
  }

  .trainer-showcase .tcg-card figcaption {
    min-height: 78px;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 3px;
    overflow: visible;
  }

  .trainer-showcase .tcg-card figcaption b,
  .trainer-showcase .tcg-card figcaption span {
    line-height: 1.32;
  }

  /* Turn-flow scenes use the same compact card size as the action overview. */
  .draw-scene .trainer-card-figure.compact,
  .draw-scene .trainer-card-figure.compact .trainer-card-face,
  .action-card-visual .trainer-card-figure.compact,
  .action-card-visual .trainer-card-figure.compact .trainer-card-face {
    width: 118px;
  }

  .draw-scene .trainer-card-face > small,
  .action-card-visual .trainer-card-face > small {
    display: none;
  }

  /* Mulligan: all three unavailable cards share one centered row. */
  .bad-hand {
    grid-template-columns: minmax(0, 1fr);
  }

  .bad-hand > .scene-label,
  .bad-hand > .bad-hand-row,
  .bad-hand > .scene-note {
    grid-column: 1;
    justify-self: center;
  }

  .bad-hand-row {
    width: min(100%, 420px);
    grid-template-columns: repeat(3, 112px);
    gap: 14px;
  }

  .bad-hand-row .tcg-card,
  .bad-hand-row .energy-card-figure,
  .bad-hand-row .energy-card-face,
  .bad-hand-row .trainer-card-figure.compact,
  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    width: 112px;
  }

  .bad-hand-row .energy-card-face {
    grid-template-rows: 16px minmax(0, 1fr) 14px;
    gap: 3px;
    padding: 4px;
    border-width: 3px;
  }

  .bad-hand-row .energy-card-face header,
  .bad-hand-row .energy-card-face footer {
    padding: 1px 3px;
    font-size: .34rem;
  }

  .bad-hand-row .energy-card-face header b {
    font-size: .42rem;
  }

  .bad-hand-row .energy-core {
    width: 38px;
    height: 38px;
    border-width: 3px;
  }

  .bad-hand-row .energy-core::after {
    scale: .64;
  }

  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    grid-template-rows: 13px 15px 54px minmax(18px, 1fr) auto 5px;
    gap: 2px;
    padding: 4px;
    border-width: 3px;
  }

  .bad-hand-row .trainer-card-band {
    padding: 1px 3px;
    font-size: .33rem;
  }

  .bad-hand-row .trainer-card-face h4 {
    padding-inline: 2px;
    font-size: .52rem;
    line-height: 1;
  }

  .bad-hand-row .trainer-card-face > p {
    padding: 2px 3px;
    font-size: .23rem;
    line-height: 1.18;
    overflow: hidden;
  }

  .bad-hand-row .trainer-rule-strip {
    padding: 2px 3px;
    font-size: .21rem;
    line-height: 1.12;
    overflow: hidden;
  }

  .bad-hand-row .trainer-card-face > small {
    display: none;
  }

  /* Two attached energies remain secondary to the Pokemon card. */
  .ready-pokemon {
    grid-template-columns: minmax(150px, 176px) minmax(180px, 1fr);
    gap: 14px;
  }

  .attached-energy-pair {
    gap: 8px;
  }

  .attached-energy-pair .energy-card-figure,
  .attached-energy-pair .energy-card-face {
    width: 86px;
  }

  .attached-energy-pair .energy-card-face {
    grid-template-rows: 15px minmax(0, 1fr) 13px;
    gap: 3px;
    padding: 4px;
    border-width: 3px;
  }

  .attached-energy-pair .energy-card-face header,
  .attached-energy-pair .energy-card-face footer {
    padding: 1px 3px;
    font-size: .32rem;
  }

  .attached-energy-pair .energy-card-face header b {
    font-size: .4rem;
  }

  .attached-energy-pair .energy-core {
    width: 36px;
    height: 36px;
    border-width: 3px;
  }

  .attached-energy-pair .energy-core::after {
    scale: .62;
  }

  .attached-energy-pair .tcg-card figcaption {
    min-height: 30px;
    margin-top: 4px;
    font-size: .64rem;
    line-height: 1.15;
  }

  .attached-energy-pair .tcg-card figcaption span {
    font-size: .54rem;
  }

  /* Four card-category overview: headers stay inside every miniature card. */
  .scene-card-kinds .trainer-card-band {
    padding: 1px 5px;
    font-size: .5rem;
  }

  .scene-card-kinds .trainer-card-face h4 {
    padding-inline: 3px;
    font-size: .72rem;
    line-height: 1;
  }

  .scene-card-kinds .trainer-card-face > p {
    padding: 3px 4px;
    font-size: .34rem;
    line-height: 1.22;
    overflow: hidden;
  }

  .scene-card-kinds .trainer-rule-strip {
    padding: 3px 4px;
    font-size: .3rem;
    line-height: 1.16;
    overflow: hidden;
  }

  /* Attached-card lesson uses the same compact internal typography. */
  .attach-card .trainer-card-band {
    padding: 1px 3px;
    font-size: .34rem;
  }

  .attach-card .trainer-card-face h4 {
    padding-inline: 2px;
    font-size: .54rem;
    line-height: 1;
  }

  .attach-card .trainer-card-face > p,
  .attach-card .trainer-rule-strip {
    overflow: hidden;
  }
}

@media (min-width: 701px) and (max-height: 720px) {
  .scene-card-kinds .trainer-card-band {
    padding-inline: 3px;
    font-size: .36rem;
  }

  .scene-card-kinds .trainer-card-face h4 {
    padding-inline: 2px;
    font-size: .54rem;
  }

  .scene-card-kinds .trainer-card-face > p {
    padding: 2px 3px;
    font-size: .24rem;
  }

  .scene-card-kinds .trainer-rule-strip {
    padding: 2px 3px;
    font-size: .22rem;
  }
}

/* ============================================================
   Large laptop classroom scale — fill the stage without collisions
   ============================================================ */
@media (min-width: 1400px) and (min-height: 820px) {
  .lesson-visual {
    padding: 16px 22px;
  }

  .scene-card-kinds {
    width: min(100%, 1240px);
    max-width: 1240px;
    gap: 28px;
  }

  .scene-card-kinds .tcg-card {
    min-height: 408px;
  }

  .scene-card-kinds .pokemon-card-figure img,
  .scene-card-kinds .pokemon-ex-figure img,
  .scene-card-kinds .energy-card-figure,
  .scene-card-kinds .energy-card-face,
  .scene-card-kinds .trainer-card-figure.compact,
  .scene-card-kinds .trainer-card-figure.compact .trainer-card-face {
    width: clamp(224px, 12.4vw, 250px);
  }

  .action-showcase {
    width: min(100%, 1320px);
    gap: 14px;
  }

  .action-card {
    min-height: 356px;
    padding: 12px;
    grid-template-rows: 266px auto;
  }

  .action-card-visual .pokemon-card-figure img,
  .action-card-visual .energy-card-figure,
  .action-card-visual .energy-card-face,
  .action-card-visual .trainer-card-figure.compact,
  .action-card-visual .trainer-card-figure.compact .trainer-card-face {
    width: clamp(154px, 8.4vw, 170px);
  }

  .action-card b {
    font-size: .94rem;
  }

  .action-card small {
    font-size: .74rem;
  }

  .trainer-showcase {
    width: min(100%, 1180px);
    gap: 26px;
  }

  .trainer-showcase .trainer-card-figure,
  .trainer-showcase .trainer-card-face {
    width: clamp(230px, 12.6vw, 254px);
  }

  .trainer-showcase .trainer-card-figure {
    grid-template-rows: auto 94px;
  }

  .trainer-showcase .tcg-card figcaption {
    min-height: 94px;
    padding-inline: 6px;
  }

  .mulligan-scene {
    width: min(100%, 1220px);
    grid-template-columns: minmax(560px, 1fr) 128px 194px;
    gap: 26px;
  }

  .bad-hand {
    height: min(100%, 410px);
    padding: 18px;
    gap: 14px;
  }

  .bad-hand-row {
    width: min(100%, 560px);
    grid-template-columns: repeat(3, 156px);
    gap: 22px;
  }

  .bad-hand-row .tcg-card,
  .bad-hand-row .energy-card-figure,
  .bad-hand-row .energy-card-face,
  .bad-hand-row .trainer-card-figure.compact,
  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    width: 156px;
  }

  .bad-hand-row .energy-card-face {
    grid-template-rows: 20px minmax(0, 1fr) 18px;
    gap: 4px;
    padding: 5px;
    border-width: 4px;
  }

  .bad-hand-row .energy-card-face header,
  .bad-hand-row .energy-card-face footer {
    padding: 2px 4px;
    font-size: .42rem;
  }

  .bad-hand-row .energy-card-face header b {
    font-size: .54rem;
  }

  .bad-hand-row .energy-core {
    width: 50px;
    height: 50px;
    border-width: 4px;
  }

  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    grid-template-rows: 18px 20px 70px minmax(24px, 1fr) auto 7px;
    gap: 3px;
    padding: 5px;
    border-width: 4px;
  }

  .bad-hand-row .trainer-card-band {
    padding: 2px 4px;
    font-size: .42rem;
  }

  .bad-hand-row .trainer-card-face h4 {
    padding-inline: 3px;
    font-size: .66rem;
  }

  .bad-hand-row .trainer-card-face > p {
    padding: 3px 4px;
    font-size: .29rem;
  }

  .bad-hand-row .trainer-rule-strip {
    padding: 3px 4px;
    font-size: .27rem;
  }

  .new-hand {
    width: 194px;
    padding: 16px;
  }

  .new-hand .pokemon-card-figure img {
    width: 158px;
  }

  .new-hand .tcg-card figcaption {
    min-height: 36px;
    font-size: .78rem;
  }

  .energy-lesson-scene,
  .attack-ready-scene {
    width: min(100%, 1200px);
    grid-template-columns: minmax(560px, 1.12fr) minmax(360px, .88fr);
    gap: 56px;
  }

  .ready-pokemon {
    grid-template-columns: minmax(232px, 258px) minmax(310px, 1fr);
    gap: 22px;
  }

  .ready-pokemon > .tcg-card .pokemon-card-figure img {
    width: 248px;
  }

  .attached-energy-pair {
    gap: 14px;
  }

  .attached-energy-pair .energy-card-figure,
  .attached-energy-pair .energy-card-face {
    width: 140px;
  }

  .attached-energy-pair .energy-card-face {
    grid-template-rows: 20px minmax(0, 1fr) 18px;
    gap: 4px;
    padding: 5px;
    border-width: 4px;
  }

  .attached-energy-pair .energy-card-face header,
  .attached-energy-pair .energy-card-face footer {
    padding: 2px 4px;
    font-size: .42rem;
  }

  .attached-energy-pair .energy-card-face header b {
    font-size: .52rem;
  }

  .attached-energy-pair .energy-core {
    width: 48px;
    height: 48px;
    border-width: 4px;
  }

  .attached-energy-pair .tcg-card figcaption {
    min-height: 38px;
    margin-top: 6px;
    font-size: .72rem;
  }

  .attached-energy-pair .tcg-card figcaption span {
    font-size: .62rem;
  }

  .energy-legend {
    gap: 14px;
  }

  .energy-legend > * {
    min-height: 66px;
    padding: 16px 18px;
    font-size: .9rem;
  }
}

/* ============================================================
   Desktop classroom QA v8 — fixed stage scale and card typography
   ============================================================ */
.trainer-card-band {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 4px;
}

.trainer-card-band > span,
.trainer-card-band > b {
  display: block;
  min-width: 0;
  max-width: 100%;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
}

.trainer-card-band > b {
  text-align: right;
}

.trainer-card-face h4 {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1100px) and (min-height: 620px) {
  /*
   * Percentage widths shrink to their contents inside the centered grid.
   * Explicit desktop widths keep every lesson diagram readable and balanced.
   */
  .lesson-visual > .scene-card-kinds,
  .lesson-visual > .action-showcase,
  .lesson-visual > .trainer-showcase,
  .lesson-visual > .mulligan-scene,
  .lesson-visual > .opening-scene,
  .lesson-visual > .attach-scene,
  .lesson-visual > .setup-scene,
  .lesson-visual > .energy-lesson-scene,
  .lesson-visual > .attack-ready-scene,
  .lesson-visual > .teach-playmat {
    width: 1280px !important;
    max-width: 100% !important;
  }

  .lesson-visual > .card-map,
  .lesson-visual > .anatomy-scene,
  .lesson-visual > .attack-read-scene,
  .lesson-visual > .bottom-read-scene,
  .lesson-visual > .battle-scene,
  .lesson-visual > .zone-scene,
  .lesson-visual > .draw-scene,
  .lesson-visual > .turn-timeline,
  .lesson-visual > .damage-scene,
  .lesson-visual > .evolution-scene,
  .lesson-visual > .wait-scene,
  .lesson-visual > .evolution-result-scene,
  .lesson-visual > .status-grid,
  .lesson-visual > .confused-scene,
  .lesson-visual > .prize-rule-scene,
  .lesson-visual > .empty-field-scene,
  .lesson-visual > .deckout-scene,
  .lesson-visual > .strategy-scene,
  .lesson-visual > .mistake-scene,
  .lesson-visual > .judge-scene {
    width: 1200px !important;
    max-width: 100% !important;
  }

  .scene-card-kinds .trainer-card-band,
  .action-card-visual .trainer-card-band,
  .trainer-showcase .trainer-card-band,
  .bad-hand-row .trainer-card-band,
  .attach-card .trainer-card-band {
    padding-inline: 5px !important;
    font-size: 7px !important;
  }

  .scene-card-kinds .trainer-card-face h4,
  .action-card-visual .trainer-card-face h4,
  .trainer-showcase .trainer-card-face h4,
  .bad-hand-row .trainer-card-face h4,
  .attach-card .trainer-card-face h4 {
    padding-inline: 4px !important;
    font-size: 11px !important;
    line-height: 1 !important;
  }

  .mulligan-scene {
    grid-template-columns: minmax(620px, 1fr) 142px 210px;
    gap: 30px;
  }

  .bad-hand {
    padding: 22px;
  }

  .bad-hand-row {
    width: 570px;
    max-width: 100%;
    grid-template-columns: repeat(3, 172px);
    align-items: start;
    justify-content: center;
    gap: 18px;
  }

  .bad-hand-row .tcg-card,
  .bad-hand-row .energy-card-figure,
  .bad-hand-row .energy-card-face,
  .bad-hand-row .trainer-card-figure.compact,
  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    width: 172px;
    min-width: 0;
    max-width: 172px;
  }

  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    grid-template-rows: 22px 24px 86px minmax(36px, 1fr) auto 8px !important;
  }

  .bad-hand-row .trainer-card-face > p {
    padding: 4px 5px !important;
    font-size: 5px !important;
    line-height: 1.25 !important;
  }

  .bad-hand-row .trainer-rule-strip {
    padding: 4px 5px !important;
    font-size: 5px !important;
    line-height: 1.2 !important;
  }

  .attached-energy-pair {
    align-items: flex-start;
  }

  .attached-energy-pair .tcg-card {
    width: 140px;
    min-width: 0;
  }

  .attached-energy-pair .tcg-card figcaption {
    min-height: 36px;
    margin-top: 6px;
    padding: 0 2px;
    font-size: 11px !important;
    line-height: 1.25 !important;
    text-align: center;
  }

  .attached-energy-pair .tcg-card figcaption b,
  .attached-energy-pair .tcg-card figcaption span {
    display: block;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: 700;
  }

  .attached-energy-pair .tcg-card figcaption span {
    margin-top: 2px;
    color: #60738f;
    font-size: 10px !important;
    font-weight: 600;
  }

  .trainer-showcase .trainer-card-band {
    font-size: 9px !important;
  }

  .trainer-showcase .trainer-card-face h4 {
    font-size: 15px !important;
  }
}

/* ============================================================
   Desktop classroom QA v9 — one scale system for all 33 slides
   ============================================================ */
@media (min-width: 1100px) and (min-height: 620px) {
  .lesson-visual {
    padding: 16px 22px;
  }

  .lesson-visual > .scene-card-kinds,
  .lesson-visual > .card-map,
  .lesson-visual > .anatomy-scene,
  .lesson-visual > .attack-read-scene,
  .lesson-visual > .bottom-read-scene,
  .lesson-visual > .battle-scene,
  .lesson-visual > .teach-playmat,
  .lesson-visual > .zone-scene,
  .lesson-visual > .opening-scene,
  .lesson-visual > .mulligan-scene,
  .lesson-visual > .attach-scene,
  .lesson-visual > .setup-scene,
  .lesson-visual > .draw-scene,
  .lesson-visual > .action-showcase,
  .lesson-visual > .turn-timeline,
  .lesson-visual > .energy-lesson-scene,
  .lesson-visual > .attack-ready-scene,
  .lesson-visual > .damage-scene,
  .lesson-visual > .evolution-scene,
  .lesson-visual > .wait-scene,
  .lesson-visual > .evolution-result-scene,
  .lesson-visual > .status-grid,
  .lesson-visual > .confused-scene,
  .lesson-visual > .prize-rule-scene,
  .lesson-visual > .empty-field-scene,
  .lesson-visual > .deckout-scene,
  .lesson-visual > .strategy-scene,
  .lesson-visual > .mistake-scene,
  .lesson-visual > .trainer-showcase,
  .lesson-visual > .judge-scene {
    width: 1380px !important;
    max-width: 100% !important;
  }

  /* 01 — card categories */
  .scene-card-kinds {
    gap: 28px;
  }

  .scene-card-kinds > * {
    flex: 0 1 260px;
  }

  .scene-card-kinds .pokemon-card-figure img {
    width: 260px;
  }

  .scene-card-kinds .energy-card-figure,
  .scene-card-kinds .energy-card-face,
  .scene-card-kinds .trainer-card-figure,
  .scene-card-kinds .trainer-card-face {
    width: 238px;
  }

  .scene-card-kinds .trainer-card-face {
    grid-template-rows: 30px 34px 148px minmax(66px, 1fr) auto 13px;
    gap: 5px;
    padding: 9px;
    border-width: 5px;
  }

  .scene-card-kinds .trainer-card-band {
    padding-inline: 7px !important;
    font-size: 10px !important;
  }

  .scene-card-kinds .trainer-card-face h4 {
    padding-inline: 7px !important;
    font-size: 18px !important;
  }

  .scene-card-kinds .trainer-card-face > p {
    padding: 7px 8px;
    font-size: 9px;
    line-height: 1.35;
  }

  .scene-card-kinds .trainer-rule-strip {
    padding: 6px 8px;
    font-size: 8px;
    line-height: 1.3;
  }

  /* 02 — reading one card */
  .card-map,
  .attack-read-scene,
  .bottom-read-scene {
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 48px;
  }

  .card-map .pokemon-card-figure img,
  .attack-read-scene .pokemon-card-figure img,
  .bottom-read-scene .pokemon-card-figure img {
    width: 330px;
  }

  .map-callouts {
    gap: 12px;
  }

  .map-callouts span {
    min-height: 84px;
    padding: 15px 20px;
    font-size: 17px;
    line-height: 1.45;
  }

  .anatomy-scene {
    grid-template-columns: 430px minmax(0, 1fr);
    gap: 42px;
  }

  .anatomy-card-wrap .pokemon-card-figure img {
    width: 320px;
  }

  .anatomy-pin {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .anatomy-scene ol {
    gap: 12px;
  }

  .anatomy-scene li {
    min-height: 78px;
    padding: 12px 14px;
    font-size: 16px;
    line-height: 1.35;
  }

  .attack-zoom,
  .bottom-zoom {
    padding: 24px;
  }

  .attack-zoom > div {
    min-height: 110px;
    padding: 20px;
  }

  .bottom-zoom > div {
    min-height: 110px;
    padding: 18px;
    font-size: 17px;
  }

  /* 03–05 — table, setup, draw and turn */
  .battle-scene .pokemon-card-figure img,
  .zone-scene .pokemon-card-figure img,
  .draw-scene .pokemon-card-figure img,
  .wait-scene .pokemon-card-figure img,
  .empty-field-scene .pokemon-card-figure img,
  .deckout-scene .pokemon-card-figure img {
    width: 280px;
  }

  .teach-playmat {
    width: 1380px !important;
    aspect-ratio: 2.65 / 1;
    grid-template-columns: 190px 1fr 190px;
    padding: 18px;
    gap: 14px;
  }

  .playmat-active .pokemon-card-figure img,
  .playmat-bench .pokemon-card-figure img {
    width: 158px;
  }

  .prize-stack {
    width: 125px;
    height: 190px;
  }

  .prize-stack i {
    width: 88px;
    height: 124px;
    background-size: 54px;
  }

  .zone-scene {
    grid-template-columns: repeat(3, 1fr);
    gap: 46px;
  }

  .zone-key span {
    min-height: 58px;
    padding: 12px;
    font-size: 16px;
  }

  .opening-scene {
    grid-template-columns: minmax(760px, 1fr) 110px 200px;
    gap: 26px;
  }

  .opening-hand-panel,
  .bad-hand,
  .attach-demo {
    height: min(100%, 500px);
    padding: 20px;
    gap: 14px;
  }

  .opening-hand-panel .hand-fan {
    gap: 10px;
  }

  .opening-hand-panel .hand-fan > *,
  .opening-hand-panel .hand-fan .card-back-face,
  .opening-hand-panel .hand-fan .pokemon-card-figure img,
  .opening-hand-panel .hand-fan .energy-card-figure,
  .opening-hand-panel .hand-fan .energy-card-face,
  .opening-hand-panel .hand-fan .trainer-card-figure,
  .opening-hand-panel .hand-fan .trainer-card-face {
    width: 106px;
  }

  .chosen-basic,
  .new-hand {
    width: 200px;
    padding: 18px;
  }

  .chosen-basic .pokemon-card-figure img,
  .new-hand .pokemon-card-figure img {
    width: 160px;
  }

  .mulligan-scene {
    grid-template-columns: minmax(720px, 1fr) 130px 220px;
    gap: 28px;
  }

  .bad-hand-row {
    width: 660px;
    grid-template-columns: repeat(3, 190px);
    gap: 24px;
  }

  .bad-hand-row .tcg-card,
  .bad-hand-row .energy-card-figure,
  .bad-hand-row .energy-card-face,
  .bad-hand-row .trainer-card-figure.compact,
  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    width: 190px;
    max-width: 190px;
  }

  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    grid-template-rows: 25px 28px 104px minmax(44px, 1fr) auto 9px !important;
  }

  .bad-hand-row .trainer-card-band {
    padding-inline: 6px !important;
    font-size: 8px !important;
  }

  .bad-hand-row .trainer-card-face h4 {
    padding-inline: 6px !important;
    font-size: 14px !important;
  }

  .bad-hand-row .trainer-card-face > p,
  .bad-hand-row .trainer-rule-strip {
    padding: 5px 6px !important;
    font-size: 6px !important;
  }

  .attach-scene {
    grid-template-columns: minmax(780px, 1.2fr) minmax(400px, .8fr);
    gap: 42px;
  }

  .attach-stack {
    grid-template-columns: 300px 170px 170px;
    gap: 24px;
  }

  .attach-stack .attach-main .pokemon-card-figure img {
    width: 280px;
  }

  .attach-card .energy-card-figure,
  .attach-card .energy-card-face,
  .attach-card .trainer-card-figure,
  .attach-card .trainer-card-face {
    width: 155px;
  }

  .attach-card .trainer-card-face {
    grid-template-rows: 20px 23px 84px minmax(34px, 1fr) auto 7px;
  }

  .attach-card > b,
  .attach-card .tcg-card figcaption {
    min-height: 34px;
    font-size: 13px;
  }

  .attach-copy h4 {
    font-size: 20px;
  }

  .attach-copy > div {
    font-size: 16px;
  }

  .setup-checks {
    min-width: 285px;
    gap: 12px;
  }

  .setup-checks span,
  .setup-checks b {
    padding: 16px;
    font-size: 16px;
  }

  .draw-scene {
    gap: 60px;
  }

  .draw-scene .card-back-face {
    width: 210px;
  }

  .action-showcase {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
  }

  .action-card {
    min-height: 390px;
    padding: 14px;
    grid-template-rows: 292px auto;
  }

  .action-card-visual .pokemon-card-figure img,
  .action-card-visual .energy-card-figure,
  .action-card-visual .energy-card-face,
  .action-card-visual .trainer-card-figure.compact,
  .action-card-visual .trainer-card-figure.compact .trainer-card-face {
    width: 178px;
  }

  .action-card-visual .trainer-card-figure.compact .trainer-card-face {
    grid-template-rows: 23px 27px 98px minmax(42px, 1fr) auto 9px;
  }

  .action-card-visual .trainer-card-band {
    font-size: 8px !important;
  }

  .action-card-visual .trainer-card-face h4 {
    font-size: 14px !important;
  }

  .action-card > div:last-child {
    padding-top: 12px;
  }

  .action-card b {
    font-size: 15px;
  }

  .action-card small {
    font-size: 12px;
  }

  .turn-timeline {
    width: 1320px !important;
    gap: 32px;
  }

  .turn-timeline > div:not(.scene-arrow) {
    min-width: 270px;
    min-height: 390px;
    padding: 22px;
    font-size: 18px;
  }

  /* 06 — energy, attack and damage */
  .energy-lesson-scene,
  .attack-ready-scene {
    grid-template-columns: minmax(760px, 1.12fr) minmax(420px, .88fr);
    gap: 58px;
  }

  .ready-pokemon {
    grid-template-columns: minmax(270px, 300px) minmax(380px, 1fr);
    gap: 26px;
  }

  .ready-pokemon > .tcg-card .pokemon-card-figure img {
    width: 290px;
  }

  .attached-energy-pair {
    gap: 18px;
  }

  .attached-energy-pair .tcg-card,
  .attached-energy-pair .energy-card-figure,
  .attached-energy-pair .energy-card-face {
    width: 166px;
  }

  .attached-energy-pair .tcg-card figcaption {
    min-height: 45px;
    font-size: 13px !important;
  }

  .attached-energy-pair .tcg-card figcaption span {
    font-size: 11px !important;
  }

  .energy-legend > * {
    min-height: 82px;
    padding: 18px 20px;
    font-size: 17px;
    line-height: 1.4;
  }

  .red-frame {
    gap: 24px;
    padding: 20px;
  }

  .red-frame .pokemon-card-figure img,
  .weakness-target .pokemon-card-figure img {
    width: 260px;
  }

  .red-rule {
    gap: 14px;
    font-size: 17px;
  }

  .math-box span,
  .math-box b {
    width: 90px;
    height: 90px;
    font-size: 2rem;
  }

  /* 07–09 — evolution, status and winning */
  .evolution-scene {
    gap: 50px;
  }

  .evolution-scene .pokemon-card-figure img,
  .wait-scene .pokemon-card-figure img {
    width: 270px;
  }

  .stop-sign {
    min-width: 190px;
    min-height: 120px;
    font-size: 18px;
  }

  .evolution-result-scene {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
  }

  .evolution-result-row {
    grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
    gap: 28px;
  }

  .evolution-result-card .pokemon-card-figure img {
    width: 275px;
  }

  .evolution-result-summary > * {
    min-height: 56px;
    font-size: 15px;
  }

  .status-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 34px;
  }

  .status-figure {
    min-height: 520px;
    padding: 24px;
  }

  .status-card .pokemon-card-figure img,
  .confused-scene .pokemon-card-figure img {
    width: 285px;
  }

  .status-figure b {
    font-size: 21px;
  }

  .status-figure small {
    font-size: 15px;
  }

  .confused-scene {
    gap: 50px;
  }

  .coin {
    width: 190px;
    height: 190px;
    font-size: 18px;
  }

  .prize-rule-scene {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px;
  }

  .prize-case {
    min-height: 470px;
  }

  .prize-rule-scene .pokemon-card-figure img {
    width: 255px;
  }

  .empty-bench,
  .cannot-draw {
    min-width: 470px;
    min-height: 300px;
    padding: 34px;
    font-size: 17px;
  }

  /* 10–11 — strategy, trainer cards and judge procedures */
  .strategy-scene {
    gap: 24px;
  }

  .strategy-case {
    min-height: 470px;
    padding: 18px;
    gap: 14px;
  }

  .strategy-scene .pokemon-card-figure img,
  .mistake-scene .pokemon-card-figure img {
    width: 175px;
  }

  .strategy-scene .energy-card-figure,
  .strategy-scene .energy-card-face,
  .mistake-scene .energy-card-figure,
  .mistake-scene .energy-card-face {
    width: 120px;
  }

  .strategy-split .strategy-unit {
    grid-template-columns: 175px 110px;
  }

  .strategy-split .energy-card-figure,
  .strategy-split .energy-card-face {
    width: 110px;
  }

  .strategy-case-copy strong,
  .mistake-scene b {
    font-size: 16px;
    line-height: 1.4;
  }

  .mistake-scene > div {
    min-height: 430px;
    padding: 24px;
    gap: 14px;
  }

  .trainer-showcase {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
  }

  .trainer-showcase .trainer-card-figure,
  .trainer-showcase .trainer-card-face {
    width: 250px;
  }

  .trainer-showcase .trainer-card-figure {
    grid-template-rows: auto 92px;
  }

  .trainer-showcase .trainer-card-face {
    grid-template-rows: 32px 36px 150px minmax(72px, 1fr) auto 14px;
    gap: 5px;
    padding: 9px;
    border-width: 5px;
  }

  .trainer-showcase .trainer-card-band {
    padding-inline: 7px !important;
    font-size: 10px !important;
  }

  .trainer-showcase .trainer-card-face h4 {
    padding-inline: 7px !important;
    font-size: 18px !important;
  }

  .trainer-showcase .trainer-card-face > p {
    padding: 7px 8px;
    font-size: 9px;
    line-height: 1.35;
  }

  .trainer-showcase .trainer-rule-strip {
    padding: 6px 8px;
    font-size: 8px;
    line-height: 1.3;
  }

  .trainer-showcase .tcg-card figcaption {
    min-height: 88px;
    grid-template-rows: 28px 1fr;
  }

  .trainer-showcase .tcg-card figcaption b {
    font-size: 16px;
  }

  .trainer-showcase .tcg-card figcaption span {
    font-size: 13px;
  }

  .judge-scene {
    grid-template-columns: minmax(420px, .9fr) minmax(0, 1.4fr);
    gap: 30px;
  }

  .judge-mascot {
    min-height: 500px;
  }

  .judge-steps .action-tile {
    min-height: 185px;
    font-size: 16px;
  }
}

/* ============================================================
   Laptop classroom QA v10 — fluid 1280–1499px lesson staging
   ============================================================ */
@media (min-width: 1100px) and (max-width: 1499px) and (min-height: 620px) {
  .lesson-visual {
    padding: 14px 18px;
    overflow: hidden;
  }

  #lessonView .lesson-visual > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .energy-lesson-scene,
  .attack-ready-scene {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr) !important;
    gap: 28px !important;
  }

  .energy-lesson-scene > *,
  .attack-ready-scene > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .mulligan-scene {
    grid-template-columns: minmax(0, 1fr) 82px 174px !important;
    gap: 14px !important;
  }

  .bad-hand {
    min-width: 0;
    padding: 14px !important;
  }

  .bad-hand-row {
    width: min(100%, 540px) !important;
    grid-template-columns: repeat(3, minmax(0, 164px)) !important;
    gap: 12px !important;
  }

  .bad-hand-row .tcg-card,
  .bad-hand-row .energy-card-figure,
  .bad-hand-row .energy-card-face,
  .bad-hand-row .trainer-card-figure.compact,
  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    width: 164px !important;
    max-width: 100% !important;
  }

  .scene-arrow {
    min-width: 0;
  }

  .new-hand {
    width: 174px !important;
    min-width: 0 !important;
    padding: 10px !important;
  }

  .new-hand .pokemon-card-figure img {
    width: 138px !important;
  }

  .trainer-showcase {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }

  .trainer-showcase .trainer-card-figure,
  .trainer-showcase .trainer-card-face {
    width: min(100%, 218px) !important;
  }

  .trainer-showcase .trainer-card-face {
    grid-template-rows: 28px 32px 130px minmax(66px, 1fr) auto 12px !important;
    gap: 4px !important;
    padding: 8px !important;
  }

  .trainer-showcase .trainer-card-band {
    height: 28px;
    min-height: 28px;
    padding-inline: 6px !important;
    font-size: 8px !important;
    line-height: 1 !important;
  }

  .trainer-showcase .trainer-card-face h4 {
    height: 32px;
    min-height: 32px;
    padding-inline: 6px !important;
    font-size: 15px !important;
    line-height: 1 !important;
  }

  .trainer-showcase .trainer-card-face > p {
    min-height: 0;
    overflow: hidden;
  }

  .trainer-showcase .tcg-card figcaption {
    min-height: 78px !important;
    grid-template-rows: 24px 1fr !important;
  }

  .attached-energy-pair .energy-card-figure,
  .attached-energy-pair .energy-card-face {
    width: 142px !important;
  }

  .attached-energy-pair .tcg-card figcaption {
    min-height: 40px !important;
    padding-top: 7px;
  }

  .attached-energy-pair .tcg-card figcaption b {
    font-size: 14px !important;
    line-height: 1.15 !important;
  }

  .attached-energy-pair .tcg-card figcaption span {
    font-size: 10px !important;
    line-height: 1.15 !important;
  }
}

/* Tournament date archive and venue switcher */
.event-switcher {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 420px) auto auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0 20px;
  padding: 16px 18px;
  border: 1px solid #c9ddfb;
  border-left: 6px solid var(--bp-blue);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 67, 126, .08);
}

.event-current {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.event-kicker,
.event-select-label > span {
  color: var(--bp-muted);
  font-size: 12px;
  font-weight: 800;
}

.event-current strong {
  overflow: hidden;
  color: var(--bp-ink);
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-current small {
  color: var(--bp-muted);
  font-size: 13px;
  font-weight: 700;
}

.event-select-label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.event-select-label select {
  width: 100%;
  min-height: 42px;
  padding: 8px 38px 8px 12px;
  border: 1px solid #bed3f2;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--bp-ink);
  font: 700 14px/1.25 "Noto Sans TC", sans-serif;
}

.event-modal {
  width: min(620px, calc(100vw - 40px));
}

.event-form-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  margin: 18px 0;
}

@media (max-width: 1100px) {
  .event-switcher {
    grid-template-columns: minmax(240px, 1fr) minmax(280px, 1fr);
  }

  .event-switcher > .btn {
    width: 100%;
  }
}

/* Damage math visual: keep the attack card, reading arrow and weakness card
   in one stable teaching sequence on laptop screens. */
@media (min-width: 1100px) {
  .lesson-visual > .damage-scene {
    width: min(1180px, 100%) !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(190px, 250px) minmax(100px, 150px) minmax(430px, 1fr) !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 24px !important;
  }

  .lesson-visual > .damage-scene > * {
    min-width: 0 !important;
  }

  .lesson-visual > .damage-scene > .scene-arrow {
    width: auto !important;
  }

  .lesson-visual > .damage-scene > .weakness-target {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(170px, 230px) minmax(100px, 1fr) !important;
    align-items: center !important;
    gap: 18px !important;
  }

  .lesson-visual > .damage-scene .pokemon-card-figure img {
    width: 210px !important;
    max-width: 100% !important;
  }

  .lesson-visual > .damage-scene .math-box {
    justify-self: center;
  }
}

/* ============================================================
   Laptop classroom QA v14 — proportional cards and clean scenes
   ============================================================ */
@media (min-width: 1100px) and (min-height: 620px) {
  /*
   * Every trainer-card measurement follows the card width. This final layer
   * deliberately replaces the older fixed-pixel teaching overrides.
   */
  .lesson-visual .trainer-card-figure:not(.compact) .trainer-card-face {
    box-sizing: border-box !important;
    grid-template-rows:
      12cqw
      12cqw
      56cqw
      minmax(0, 1fr)
      18cqw
      4cqw !important;
    gap: 1.2cqw !important;
    padding: 3cqw !important;
    border-width: 2.4cqw !important;
  }

  .lesson-visual .trainer-card-figure:not(.compact) .trainer-card-band {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: .7cqw 2cqw !important;
    font-size: 3.45cqw !important;
    line-height: 1 !important;
  }

  .lesson-visual .trainer-card-figure:not(.compact) .trainer-card-face h4 {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding-inline: 1.6cqw !important;
    font-size: 5.9cqw !important;
    line-height: 1 !important;
  }

  .lesson-visual .trainer-card-figure:not(.compact) .trainer-card-face > p {
    min-height: 0 !important;
    padding: 1.4cqw 1.9cqw !important;
    font-size: 2.55cqw !important;
    line-height: 1.18 !important;
    overflow: hidden !important;
  }

  .lesson-visual .trainer-card-figure:not(.compact) .trainer-rule-strip {
    min-height: 0 !important;
    padding: 1.35cqw 1.9cqw !important;
    font-size: 2.2cqw !important;
    line-height: 1.12 !important;
    overflow: hidden !important;
  }

  .lesson-visual .trainer-card-figure:not(.compact) .trainer-card-face > small {
    font-size: 1.55cqw !important;
    line-height: 1 !important;
  }

  .trainer-showcase {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: start !important;
    justify-content: center !important;
    gap: 24px !important;
  }

  .trainer-showcase .trainer-card-figure,
  .trainer-showcase .trainer-card-face {
    width: 196px !important;
    max-width: 196px !important;
  }

  .trainer-showcase .trainer-card-figure {
    grid-template-rows: auto 66px !important;
  }

  .trainer-showcase .tcg-card figcaption {
    width: 100% !important;
    min-height: 70px !important;
    margin-top: 8px !important;
    padding: 0 3px !important;
    display: grid !important;
    grid-template-rows: 24px minmax(0, 1fr) !important;
    align-content: start !important;
    overflow: hidden !important;
  }

  .trainer-showcase .tcg-card figcaption b {
    font-size: 15px !important;
    line-height: 1.25 !important;
  }

  .trainer-showcase .tcg-card figcaption span {
    font-size: 11px !important;
    line-height: 1.32 !important;
  }

  .attach-scene {
    width: min(100%, 1160px) !important;
    max-width: 1160px !important;
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr) !important;
    align-items: stretch !important;
    gap: 24px !important;
  }

  .attach-demo {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 18px !important;
    align-content: center !important;
    overflow: visible !important;
  }

  .attach-stack {
    grid-template-columns: 218px 132px 132px !important;
    align-items: end !important;
    justify-content: center !important;
    gap: 18px !important;
  }

  .attach-stack .attach-main .pokemon-card-figure img {
    width: 210px !important;
  }

  .attach-card .energy-card-figure,
  .attach-card .energy-card-face,
  .attach-card .trainer-card-figure,
  .attach-card .trainer-card-face {
    width: 124px !important;
    max-width: 124px !important;
  }

  .attach-main .tcg-card figcaption {
    min-height: 42px !important;
    margin-top: 6px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  .attach-card > b,
  .attach-card .tcg-card figcaption {
    min-height: 36px !important;
    margin-top: 5px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }

  .attach-copy {
    align-content: center !important;
    padding: 22px !important;
    gap: 12px !important;
  }

  .attach-copy h4 {
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  .attach-copy > div {
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .bad-hand-row .trainer-card-figure.compact .trainer-card-face {
    grid-template-rows:
      18px
      20px
      76px
      minmax(35px, 1fr)
      32px
      6px !important;
    gap: 3px !important;
  }

  .bad-hand-row .trainer-card-figure.compact .trainer-card-face > p {
    padding: 3px 4px !important;
    font-size: 5px !important;
    line-height: 1.2 !important;
  }

  .bad-hand-row .trainer-card-figure.compact .trainer-rule-strip {
    min-height: 32px !important;
    padding: 3px 4px !important;
    font-size: 5px !important;
    line-height: 1.2 !important;
  }
}

@media (min-width: 1100px) and (max-width: 1499px) and (min-height: 620px) {
  .trainer-showcase {
    gap: 18px !important;
  }

  .trainer-showcase .trainer-card-figure,
  .trainer-showcase .trainer-card-face {
    width: 184px !important;
    max-width: 184px !important;
  }

  .trainer-showcase .trainer-card-figure {
    grid-template-rows: auto 62px !important;
  }

  .trainer-showcase .tcg-card figcaption {
    min-height: 68px !important;
  }

  .attach-scene {
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr) !important;
    gap: 18px !important;
  }

  .attach-stack {
    grid-template-columns: 204px 120px 120px !important;
    gap: 14px !important;
  }

  .attach-stack .attach-main .pokemon-card-figure img {
    width: 194px !important;
  }

  .attach-card .energy-card-figure,
  .attach-card .energy-card-face,
  .attach-card .trainer-card-figure,
  .attach-card .trainer-card-face {
    width: 114px !important;
    max-width: 114px !important;
  }
}
