:root {
  --gold: #c98b2c;
  --gold-tint: #f3e6cf;
  --gold-ink: #7a5212;
  --terra: #bf5f49;
  --terra-d: #a8503c;
  --terra-tint: #f3ddd6;
  --terra-ink: #7d3a2a;
  --slate: #5c707a;
  --slate-tint: #e1e8eb;
  --slate-ink: #34444b;
  --charcoal: #3f4d51;
  --deep: #324952;
  --cream: #f7f2eb;
  --paper: #ece5da;
  --sea: #dcebef;
  --green-tint: #eaf1ec;
  --green-ink: #2f5a3f;
  --white: #ffffff;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--charcoal); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
svg { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- board (shared) ---------- */
.board { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.board-stage { position: relative; }
.board-slide, .board-ink, .board-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.board-slide svg { width: 100%; height: 100%; display: block; }
.board-ink { pointer-events: none; }
.board-fx { pointer-events: none; }
.board-stage.can-draw .board-ink { pointer-events: auto; touch-action: none; cursor: crosshair; }
.board-stage.can-draw[data-tool="laser"] .board-ink { cursor: none; }
.board-stage.can-draw[data-tool="eraser"] .board-ink { cursor: cell; }

/* ---------- shared bits ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.btn { border: 0; border-radius: 999px; padding: 0 22px; height: 52px; font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-primary { background: var(--terra-d); color: var(--white); }
.btn-dark { background: var(--charcoal); color: var(--cream); }
.btn-ghost { background: transparent; border: 1px solid #c9bfae; color: var(--charcoal); }
.btn:disabled { opacity: 0.55; cursor: default; }
.video-tile { position: relative; overflow: hidden; background: var(--slate); }
.video-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-tile .no-video { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-tile .no-video svg { width: 60%; height: 60%; }

/* ---------- join page ---------- */
.join-page { background: var(--cream); min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.join-card { width: 100%; max-width: 920px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--white); border-radius: 28px; overflow: hidden; }
.join-art { background: var(--sea); position: relative; min-height: 420px; display: flex; align-items: flex-end; }
.join-art svg { width: 100%; height: auto; display: block; }
.join-form { padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.join-logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 700; }
.join-logo span.mark { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--charcoal); }
.join-form h1 { margin: 0; font-family: var(--serif); font-size: 36px; line-height: 1.1; }
.join-form p { margin: 0; color: var(--slate); line-height: 1.5; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: var(--paper); border-radius: 999px; }
.role-switch button { height: 46px; border: 0; border-radius: 999px; background: transparent; font-size: 16px; font-weight: 700; color: var(--charcoal); }
.role-switch button[aria-pressed="true"] { background: var(--charcoal); color: var(--cream); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.field input { height: 52px; border-radius: 14px; border: 1px solid #d9d2c7; background: var(--cream); padding: 0 16px; font-size: 18px; font-family: inherit; color: var(--charcoal); }
.field .hint { font-size: 13px; color: var(--slate); }
.row { display: flex; gap: 10px; align-items: center; }
.row .field { flex: 1; }
.error { color: var(--terra-d); font-size: 14px; min-height: 1em; }
@media (max-width: 760px) {
  .join-card { grid-template-columns: 1fr; }
  .join-art { min-height: 200px; }
  .join-form { padding: 24px; }
}

/* ---------- gate (pre-join) and end screens ---------- */
.gate { position: fixed; inset: 0; z-index: 50; background: rgba(63, 77, 81, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate-card { width: 100%; max-width: 560px; background: var(--cream); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 16px; text-align: center; align-items: center; }
.gate-card h2 { margin: 0; font-family: var(--serif); font-size: 32px; }
.gate-card p { margin: 0; color: var(--slate); line-height: 1.5; }
.gate-preview { width: 320px; max-width: 100%; aspect-ratio: 4 / 3; border-radius: 20px; }
.gate-card .btn { height: 72px; font-size: 22px; padding: 0 34px; }
.end-stars { font-family: var(--serif); font-size: 72px; font-weight: 700; color: var(--gold); line-height: 1; }

/* ---------- kid classroom ---------- */
.kid-page { background: var(--paper); height: 100%; overflow: hidden; }
.kid { height: 100dvh; display: flex; flex-direction: column; }
.kid-top { height: 72px; flex-shrink: 0; background: var(--charcoal); color: var(--cream); display: flex; align-items: center; gap: 18px; padding: 0 20px; }
.kid-top .leave { height: 44px; padding: 0 14px; border: 1px solid #8a9aa1; border-radius: 12px; background: transparent; color: var(--cream); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.kid-title { font-family: var(--serif); font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.steps { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: 6px; }
.steps li { padding: 6px 12px; border-radius: 999px; font-size: 13px; border: 1px solid #8a9aa1; white-space: nowrap; }
.steps li.done { background: var(--slate); border-color: var(--slate); }
.steps li.now { background: var(--gold); border-color: var(--gold); color: var(--charcoal); font-weight: 700; }
.star-count { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--cream); color: var(--charcoal); font-size: 22px; font-weight: 700; }
.kid-main { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 20px; }
.kid-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.kid-board { position: relative; flex: 1; min-height: 0; border-radius: 24px; background: var(--sea); box-shadow: 0 0 0 6px var(--white); overflow: hidden; }
.kid-prompt { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 10px 22px; border-radius: 999px; background: var(--gold); color: var(--charcoal); font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; box-shadow: 0 6px 16px rgba(63, 77, 81, 0.18); }
.kid-tools { height: 122px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--white); border-radius: 24px; padding: 0 20px; }
.tool-group { display: flex; align-items: center; gap: 12px; }
.tool-round { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--cream); display: flex; align-items: center; justify-content: center; color: var(--charcoal); }
.tool-round[aria-pressed="true"] { box-shadow: inset 0 0 0 4px var(--charcoal); }
.tool-round:disabled { opacity: 0.35; cursor: default; }
.swatch { width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--white); box-shadow: 0 0 0 1px #d9d2c7; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--charcoal); }
.swatch:disabled { opacity: 0.35; cursor: default; }
.react-thumb { background: var(--slate-tint); }
.react-heart { background: var(--terra-tint); color: var(--terra-ink); }
.hand-btn { height: 84px; padding: 0 28px; border-radius: 42px; border: 0; background: var(--terra-d); color: var(--white); font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.hand-btn[aria-pressed="true"] { background: var(--gold); color: var(--charcoal); }
.kid-side { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.teacher-tile { height: 280px; border-radius: 24px; }
.tile-name { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 8px; background: var(--charcoal); color: var(--cream); font-size: 14px; font-weight: 700; z-index: 2; }
.tile-live { position: absolute; right: 12px; top: 12px; padding: 4px 10px; border-radius: 999px; background: var(--cream); font-size: 12px; font-weight: 700; z-index: 2; }
.friends { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.friend { height: 120px; border-radius: 18px; background: #a3b0b5; overflow: visible; }
.friend .video-tile-inner { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; }
.friend.me { box-shadow: 0 0 0 4px var(--charcoal); }
.friend.me .tile-name { background: var(--charcoal); }
.friend.on-board { box-shadow: 0 0 0 4px var(--gold); }
.friend .stars { position: absolute; right: -8px; top: -12px; z-index: 3; padding: 4px 10px; border-radius: 999px; background: var(--gold); color: var(--charcoal); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 4px; box-shadow: 0 2px 0 #8a5c14; }
.friend .hand { position: absolute; right: 8px; bottom: 8px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; background: var(--terra-d); display: flex; align-items: center; justify-content: center; }
.friend.empty { background: transparent; border: 2px dashed #c9bfae; }
.mic-card { flex: 1; min-height: 76px; border-radius: 24px; background: var(--white); display: flex; align-items: center; gap: 14px; padding: 0 18px; }
.mic-card .dot { width: 64px; height: 64px; border-radius: 50%; background: var(--green-tint); display: flex; align-items: center; justify-content: center; color: var(--green-ink); flex-shrink: 0; }
.mic-card.off .dot { background: var(--terra-tint); color: var(--terra-ink); }
.mic-card strong { font-size: 17px; display: block; }
.mic-card span { font-size: 14px; color: var(--slate); }

.star-pop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.star-pop .burst { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: pop 1.8s ease forwards; }
.star-pop .burst span { padding: 10px 22px; border-radius: 999px; background: var(--gold); color: var(--charcoal); font-size: 24px; font-weight: 700; }
@keyframes pop {
  0% { transform: scale(0.3); opacity: 0; }
  15% { transform: scale(1.1); opacity: 1; }
  25% { transform: scale(1); }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.9) translateY(-40px); opacity: 0; }
}
.float-react { position: absolute; z-index: 5; font-size: 0; animation: floatup 1.6s ease-out forwards; pointer-events: none; }
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-80px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; padding: 12px 20px; border-radius: 999px; background: var(--charcoal); color: var(--cream); font-size: 15px; }

@media (max-width: 1000px) {
  .kid-top { gap: 10px; padding: 0 12px; }
  .steps { display: none; }
  .kid-main { padding: 12px; gap: 12px; }
  .kid-side { width: 220px; }
  .teacher-tile { height: 200px; }
  .friend { height: 96px; }
  .kid-tools { height: auto; padding: 12px; flex-wrap: wrap; }
  .tool-round { width: 60px; height: 60px; }
  .swatch { width: 44px; height: 44px; }
  .hand-btn { height: 64px; font-size: 18px; padding: 0 20px; }
}
@media (orientation: portrait) and (max-width: 1100px) {
  .kid-page { overflow: auto; }
  .kid { height: auto; min-height: 100dvh; }
  .kid-main { flex-direction: column; }
  .kid-left { flex: none; }
  .kid-board { flex: none; aspect-ratio: 16 / 10; }
  .kid-side { width: auto; flex-direction: row; align-items: stretch; }
  .teacher-tile { flex: 1; height: 240px; }
  .friends { width: 260px; flex-shrink: 0; }
  .friend { height: auto; min-height: 110px; }
  .mic-card { display: none; }
}
@media (max-width: 720px) {
  .kid-page { overflow: auto; }
  .kid { height: auto; min-height: 100dvh; }
  .kid-main { flex-direction: column; }
  .kid-board { flex: none; aspect-ratio: 16 / 10; }
  .kid-side { width: auto; flex-direction: row; flex-wrap: wrap; }
  .teacher-tile { width: 100%; height: 220px; }
  .friends { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mic-card { display: none; }
}

/* ---------- teacher console ---------- */
.teacher-page { background: #1b2224; color: #ece6dc; height: 100%; overflow: hidden; }
.tc { height: 100dvh; display: flex; flex-direction: column; }
.tc-top { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 20px; padding: 0 20px; border-bottom: 1px solid #323c3f; }
.tc-brand { font-family: var(--serif); font-size: 20px; }
.tc-lesson { font-size: 14px; color: #c9d0d2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tc-lesson em { font-family: var(--serif); }
.tc-status { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 13px; color: #c9d0d2; white-space: nowrap; }
.tc-status .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #e08a72; display: inline-block; margin-right: 6px; }
.tc-timer { font-size: 16px; font-variant-numeric: tabular-nums; color: #ece6dc; }
.tc-end { height: 36px; padding: 0 16px; border: 1px solid #e08a72; border-radius: 999px; background: transparent; color: #e08a72; font-size: 13px; font-weight: 500; }
.tc-main { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 20px; }
.tc-nav { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.tc-label { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #9aa8ad; }
.thumb { text-align: left; border: 1px solid #323c3f; border-radius: 12px; background: #252e31; padding: 8px; display: flex; flex-direction: column; gap: 6px; color: #ece6dc; }
.thumb img { width: 100%; aspect-ratio: 16 / 10; border-radius: 7px; background: var(--sea); display: block; }
.thumb .meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.thumb .meta span:last-child { color: #9aa8ad; }
.thumb[aria-current="true"] { border-color: var(--gold); background: #2b3437; }
.thumb[aria-current="true"] .meta { font-weight: 700; }
.thumb[aria-current="true"] .meta span:last-child { color: #d9a24a; }
.tc-center { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tc-toolbar { min-height: 56px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; background: #252e31; border: 1px solid #323c3f; border-radius: 14px; padding: 6px 8px; }
.ttool { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; display: flex; align-items: center; justify-content: center; color: #ece6dc; }
.ttool[aria-pressed="true"] { background: #ece6dc; color: #1f2629; }
.tsep { width: 1px; height: 26px; background: #364145; margin: 0 8px; }
.tswatch { width: 26px; height: 26px; margin: 0 4px; border-radius: 50%; border: 2px solid #252e31; }
.tswatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #ece6dc; }
.ttext { height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #ece6dc; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.ttext[aria-pressed="true"] { background: #3a4549; }
.tnav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tnav .counter { font-size: 13px; color: #9aa8ad; margin-right: 6px; font-variant-numeric: tabular-nums; }
.tnav button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #364145; background: transparent; color: #ece6dc; display: flex; align-items: center; justify-content: center; }
.tnav button.next { background: #ece6dc; color: #1f2629; border: 0; }
.tc-board { flex: 1; min-height: 0; border-radius: 16px; background: var(--sea); overflow: hidden; }
.tc-notes { height: 170px; flex-shrink: 0; border: 1px solid #323c3f; border-radius: 16px; padding: 16px 20px; display: flex; gap: 28px; }
.tc-notes .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.tc-notes p { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.45; }
.tc-notes .levels { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: #9aa8ad; margin-top: auto; }
.tc-notes .levels b { color: #ece6dc; font-weight: 500; }
.tc-timing { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid #323c3f; padding-left: 22px; }
.timing-bar { display: flex; gap: 4px; height: 4px; }
.timing-bar span { border-radius: 2px; background: #46535a; }
.timing-bar span.done { background: #9aa8ad; }
.timing-bar span.now { background: var(--gold); }
.timing-labels { display: flex; justify-content: space-between; font-size: 11px; color: #9aa8ad; gap: 4px; }
.tc-left-in-step { margin-top: auto; font-family: var(--serif); font-size: 24px; }
.tc-left-in-step small { font-family: var(--sans); font-size: 13px; color: #9aa8ad; }
.tc-side { width: 330px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.self-tile { height: 150px; border-radius: 14px; background: #3a4549; }
.share { border: 1px solid #323c3f; border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 12px; color: #9aa8ad; }
.share > span { white-space: nowrap; }
.share code { font-family: inherit; font-size: 18px; font-weight: 700; color: #ece6dc; letter-spacing: 0.08em; }
.share button { margin-left: auto; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #46535a; background: transparent; color: #ece6dc; font-size: 12px; white-space: nowrap; }
.student { border: 1px solid #323c3f; border-radius: 14px; background: #252e31; padding: 8px; display: flex; gap: 10px; align-items: center; }
.student.on-board { border-color: #ece6dc; }
.student.hand-up { border-color: #d9a24a; }
.student .thumbv { width: 76px; height: 56px; border-radius: 9px; flex-shrink: 0; background: #3a4549; }
.student .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.student .info strong { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student .info span { font-size: 11px; color: #9aa8ad; }
.student.on-board .info span { color: #ece6dc; }
.student.hand-up .info span { color: #d9a24a; }
.sbtn { width: 34px; height: 34px; border: 1px solid #46535a; border-radius: 9px; background: transparent; display: flex; align-items: center; justify-content: center; color: #ece6dc; flex-shrink: 0; }
.sbtn[aria-pressed="true"] { background: #ece6dc; color: #1f2629; border-color: #ece6dc; }
.bulk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.bulk button { height: 44px; border-radius: 999px; border: 1px solid #46535a; background: transparent; color: #ece6dc; font-size: 13px; }
.bulk button.primary { background: #ece6dc; color: #1f2629; border: 0; font-weight: 500; }
.bulk button[aria-pressed="true"] { background: #3a4549; }
.empty-students { border: 1px dashed #46535a; border-radius: 14px; padding: 16px; font-size: 13px; color: #9aa8ad; line-height: 1.5; }
.teacher-page .gate { background: rgba(27, 34, 36, 0.8); }
.teacher-page .gate-card { color: var(--charcoal); }
@media (max-width: 1180px) {
  .tc-nav { width: 140px; }
  .tc-side { width: 280px; }
  .tc-timing { display: none; }
}

/* ---------- on stage (spotlight) ---------- */
.spot { position: absolute; right: 16px; top: 16px; z-index: 3; width: 34%; max-width: 360px; border-radius: 22px; background: var(--white); padding: 6px; box-shadow: 0 0 0 4px var(--gold), 0 12px 28px rgba(63, 77, 81, 0.25); }
.spot .video-tile { aspect-ratio: 4 / 3; border-radius: 17px; }
.spot-name { text-align: center; font-size: 18px; font-weight: 700; padding: 8px 4px 4px; }
.spot.me .spot-name { color: var(--terra-d); }
.tc-board { position: relative; }
.tc-board .spot { width: 26%; max-width: 260px; right: 12px; top: 12px; }
.tc-board .spot-name { font-size: 14px; color: var(--charcoal); }

/* ---------- questions: child ---------- */
.quiz { position: absolute; inset: 0; z-index: 4; display: flex; align-items: flex-end; justify-content: center; padding: 16px; pointer-events: none; }
.quiz-card { pointer-events: auto; width: 100%; max-width: 920px; background: var(--cream); border-radius: 24px; padding: 18px 20px 20px; box-shadow: 0 12px 30px rgba(63, 77, 81, 0.25); display: flex; flex-direction: column; gap: 14px; }
.quiz-drag { align-items: stretch; background: rgba(63, 77, 81, 0.35); pointer-events: auto; }
.quiz-drag .quiz-card { max-width: none; }
.quiz-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.quiz-tag { padding: 5px 12px; border-radius: 999px; background: var(--charcoal); color: var(--cream); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.quiz-head h3 { margin: 0; flex: 1; min-width: 200px; font-family: var(--serif); font-size: 28px; line-height: 1.15; }
.quiz-status { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--white); font-size: 17px; font-weight: 700; }
.quiz-status.win { background: var(--gold); color: var(--charcoal); }
.quiz-status.win svg path { fill: var(--white); }
.quiz-status.try { background: var(--terra-tint); color: var(--terra-ink); }
.quiz-options { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; }
.quiz-options.many { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.quiz-opt { position: relative; min-height: 96px; border: 0; border-radius: 22px; background: var(--c); color: var(--t); font-size: 34px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 8px 12px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18); }
.quiz-options.many .quiz-opt { min-height: 72px; font-size: 28px; }
.quiz-opt span { overflow-wrap: break-word; min-width: 0; }
.quiz-opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); }
.quiz-opt.picked { box-shadow: 0 0 0 6px var(--charcoal), 0 6px 0 rgba(0, 0, 0, 0.18); }
.quiz-opt i { position: absolute; top: -12px; right: -12px; width: 40px; height: 40px; border-radius: 50%; background: var(--charcoal); color: var(--white); display: flex; align-items: center; justify-content: center; }
.quiz-opt.right { box-shadow: 0 0 0 6px #4f8a63; }
.quiz-opt.right i { background: #4f8a63; }
.quiz-opt.wrong { opacity: 0.6; }
.quiz-opt.wrong i { background: var(--terra-d); }
.quiz-opt.dim { opacity: 0.4; }
.quiz-opt:disabled { cursor: default; }
.quiz-targets { flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; }
.quiz-target { min-height: 130px; border-radius: 20px; background: var(--white); border: 4px dashed var(--c); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.quiz-target.over { background: var(--gold-tint); border-style: solid; }
.quiz-target-label { padding: 6px 10px; border-radius: 12px; background: var(--c); color: var(--white); font-size: 20px; font-weight: 700; text-align: center; }
.quiz-drop { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; justify-content: center; }
.quiz-answer-here { margin-top: auto; font-size: 15px; font-weight: 700; color: #4f8a63; text-align: center; }
.quiz-tray { min-height: 88px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; padding: 12px; border-radius: 18px; background: var(--paper); }
.quiz-tray-empty { color: var(--slate); font-weight: 700; }
.quiz-chip { position: relative; min-width: 110px; height: 64px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--c); color: var(--t); font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18); }
.quiz-chip.selected { box-shadow: 0 0 0 5px var(--charcoal); }
.quiz-chip.lifted { opacity: 0.3; }
.quiz-chip.ghost { position: fixed; z-index: 80; pointer-events: none; opacity: 0.95; transform: scale(1.08); }
.quiz-chip i { position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); }
.quiz-chip i.ok { background: #4f8a63; }
.quiz-chip i.no { background: var(--terra-d); }
.quiz-chip:disabled { cursor: default; }
.quiz-done { align-self: center; height: 64px; padding: 0 40px; border: 0; border-radius: 999px; background: var(--terra-d); color: var(--white); font-size: 22px; font-weight: 700; }
.quiz-done:disabled { background: var(--slate); opacity: 0.7; cursor: default; }
@media (max-width: 1000px) {
  .quiz { padding: 10px; }
  .quiz-card { padding: 14px; gap: 10px; }
  .quiz-head h3 { font-size: 22px; }
  .quiz-opt { min-height: 72px; font-size: 26px; }
  .quiz-options.many .quiz-opt { min-height: 56px; font-size: 22px; }
  .quiz-chip { height: 54px; min-width: 90px; font-size: 18px; }
  .quiz-target { min-height: 100px; }
  .quiz-target-label { font-size: 16px; }
  .spot { width: 30%; }
  .spot-name { font-size: 14px; }
}

/* ---------- questions: teacher ---------- */
.tc-notes.quiz-mode { height: auto; min-height: 170px; max-height: 300px; }
.tq { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.tq-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tq-count { font-size: 12px; color: #9aa8ad; }
.tq-prompt { margin: 0; font-family: var(--serif); font-size: 18px; }
.tq-options { display: flex; flex-direction: column; gap: 4px; }
.tq-opt { display: grid; grid-template-columns: 14px minmax(60px, 120px) minmax(60px, 1fr) minmax(0, 1.4fr) auto; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 10px; font-size: 13px; }
.tq-opt.right { background: #2b3a31; }
.tq-dot { width: 14px; height: 14px; border-radius: 50%; }
.tq-label { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-label em { font-style: normal; font-weight: 400; font-size: 11px; color: #d9a24a; }
.tq-bar { height: 8px; border-radius: 4px; background: #364145; overflow: hidden; }
.tq-bar span { display: block; height: 100%; background: var(--gold); }
.tq-who { color: #c9d0d2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-pick { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid #46535a; background: transparent; color: #ece6dc; font-size: 12px; white-space: nowrap; }
.tq-mark { font-size: 12px; font-weight: 700; color: #9fd0ad; }
.tq-kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.tq-kid { border: 1px solid #323c3f; border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.tq-kid span { font-size: 12px; color: #9aa8ad; }
.tq-kid.right { border-color: #6aa57e; }
.tq-foot { margin-top: auto; padding-top: 4px; display: flex; align-items: center; gap: 8px; }
.tq-note { flex: 1; font-size: 12px; color: #9aa8ad; }
.tq-btn { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid #46535a; background: transparent; color: #ece6dc; font-size: 13px; white-space: nowrap; }
.tq-btn.primary { background: #ece6dc; color: #1f2629; border: 0; font-weight: 500; }

/* ---------- teacher popovers (ask, lessons) ---------- */
.pop-wrap { position: relative; }
.popover { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: 340px; max-height: 70vh; overflow-y: auto; background: #252e31; border: 1px solid #46535a; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45); color: #ece6dc; }
.popover h4 { margin: 0; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #9aa8ad; }
.popover .pop-main { width: 100%; text-align: left; border: 0; border-radius: 12px; background: #ece6dc; color: #1f2629; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.popover .pop-main small { font-size: 12px; color: #5c707a; }
.pop-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-presets button { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #46535a; background: transparent; color: #ece6dc; font-size: 13px; }
.pop-custom { display: flex; flex-direction: column; gap: 6px; }
.pop-custom input { height: 36px; border-radius: 10px; border: 1px solid #46535a; background: #1b2224; color: #ece6dc; padding: 0 10px; font: inherit; font-size: 13px; }
.pop-custom button { align-self: flex-start; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--gold); color: #1f2629; font-size: 13px; font-weight: 700; }
.lesson-pick { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid #323c3f; border-radius: 12px; background: #1f2629; color: #ece6dc; padding: 8px; }
.lesson-pick[aria-current="true"] { border-color: var(--gold); }
.lesson-pick img { width: 72px; aspect-ratio: 16 / 10; border-radius: 6px; object-fit: cover; background: var(--sea); flex-shrink: 0; }
.lesson-pick span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.lesson-pick small { font-size: 12px; color: #9aa8ad; }
.pop-link { color: #d9a24a; font-size: 13px; text-decoration: none; }
.tc-lesson-btn { min-width: 0; display: flex; align-items: center; gap: 6px; border: 1px solid #364145; border-radius: 999px; background: transparent; color: #c9d0d2; padding: 6px 12px; font-size: 14px; }
.tc-lesson-btn .tc-lesson { color: inherit; }

/* ---------- end of class (teacher) ---------- */
.gate-card.wide { max-width: 820px; max-height: calc(100dvh - 32px); overflow-y: auto; text-align: left; align-items: stretch; }
.gate-card.wide h2, .gate-card.wide > p { text-align: center; }
.rrows { display: flex; flex-direction: column; gap: 12px; }
.rrow { background: var(--white); border-radius: 18px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rrow h4 { margin: 0; font-size: 18px; }
.rrow .facts { font-size: 13px; color: var(--slate); margin-top: 2px; }
.rrow .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rrow textarea { grid-column: 1 / -1; min-height: 60px; border-radius: 12px; border: 1px solid #d9d2c7; background: var(--cream); padding: 10px 12px; font: inherit; font-size: 15px; color: var(--charcoal); resize: vertical; }
.btn-sm, .gate-card .btn.btn-sm { height: 42px; padding: 0 16px; font-size: 14px; }
.end-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ttext.has-q { color: #d9a24a; }

/* ---------- lessons page (teacher admin) ---------- */
.admin-page, .report-page { background: var(--cream); min-height: 100%; }
.admin-top, .report-top { height: 64px; background: var(--charcoal); color: var(--cream); display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.admin-brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-family: var(--serif); font-size: 20px; font-weight: 700; }
.admin-brand .mark { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--charcoal); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.admin-crumb { font-size: 14px; color: #c9d0d2; }
.admin-main { max-width: 1080px; margin: 0 auto; padding: 28px 16px 120px; }
.admin-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 8px; }
.admin-head h1 { margin: 0; font-family: var(--serif); font-size: 36px; }
.admin-intro { margin: 0 0 22px; max-width: 720px; color: var(--slate); line-height: 1.55; }
.admin-hint { font-size: 13px; color: var(--slate); font-weight: 400; margin: 0; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lcard { background: var(--white); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; }
.lcard img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--sea); display: block; }
.lcard-body { padding: 14px 16px 4px; }
.lcard h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 22px; }
.lcard p { margin: 0; font-size: 14px; color: var(--slate); line-height: 1.45; }
.lcard .warn { color: var(--terra-d); }
.lcard-acts { padding: 12px 16px 16px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.badge { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--gold-tint); color: var(--gold-ink); font-size: 13px; font-weight: 700; }
.upload-box { margin: 18px 0; border: 2px dashed #c9bfae; border-radius: 22px; background: var(--white); padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; color: var(--charcoal); }
.upload-box.over { border-color: var(--gold); background: var(--gold-tint); }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-box:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.upload-box strong { font-size: 18px; }
.upload-box span { font-size: 14px; color: var(--slate); }
.progress { margin: -6px 0 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--slate); }
.progress .bar { height: 8px; border-radius: 4px; background: var(--paper); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.admin-card { background: var(--white); border-radius: 22px; padding: 20px; margin-bottom: 18px; }
.admin-card h2, .slides-title { margin: 0 0 14px; font-family: var(--serif); font-size: 24px; }
.admin-card h3 { margin: 18px 0 4px; font-size: 16px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.admin-page .field input, .admin-page .field select, .admin-page .field textarea, .opt-row input, .opt-row select, .step-row input { height: 44px; border-radius: 12px; border: 1px solid #d9d2c7; background: var(--cream); padding: 0 12px; font: inherit; font-size: 15px; color: var(--charcoal); }
.admin-page .field textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.admin-page .field label { font-size: 13px; }
.steps-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.step-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-row .step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.step-row input:first-of-type { flex: 1; min-width: 140px; }
.step-row input[type="number"] { width: 80px; }
.step-row .unit { font-size: 14px; color: var(--slate); }
.link-btn { border: 0; background: transparent; color: var(--terra-d); font-size: 14px; font-weight: 700; padding: 6px 4px; align-self: flex-start; }
.slides-edit { display: flex; flex-direction: column; gap: 14px; }
.scard { background: var(--white); border-radius: 22px; padding: 16px; display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.scard-img { position: relative; position: sticky; top: 12px; }
.scard-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 12px; background: var(--paper); display: block; }
.scard-n { position: absolute; left: 8px; top: 8px; min-width: 30px; height: 30px; border-radius: 999px; background: var(--charcoal); color: var(--cream); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.scard-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.qedit { border-top: 1px solid var(--paper); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.qedit h4 { margin: 4px 0 0; font-size: 14px; }
.opt-rows { display: flex; flex-direction: column; gap: 8px; }
.opt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opt-row input:first-child { flex: 1; min-width: 150px; }
.opt-row .ans { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.opt-row .ans input[type="radio"] { flex: none; width: 20px; height: 20px; min-width: 0; padding: 0; accent-color: var(--terra-d); }
.opt-row .ans select { width: auto; }
.save-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--white); border-top: 1px solid var(--paper); padding: 12px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.save-bar span { font-size: 14px; color: var(--terra-d); flex: 1; text-align: right; }
@media (max-width: 760px) {
  .scard { grid-template-columns: 1fr; }
  .scard-img { position: relative; top: 0; }
  .admin-head h1 { font-size: 28px; }
}

/* ---------- parent report ---------- */
.report { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.report-loading { color: var(--slate); text-align: center; padding: 40px 0; }
.report-hero { background: var(--sea); border-radius: 28px; padding: 28px 24px; display: flex; flex-direction: column; gap: 6px; }
.report-kicker { margin: 0; font-size: 14px; color: var(--slate); }
.report-hero h1 { margin: 0; font-family: var(--serif); font-size: 40px; line-height: 1.1; }
.report-lesson { margin: 0; font-size: 18px; color: var(--deep); }
.report-stars { margin-top: 14px; align-self: flex-start; display: flex; align-items: center; gap: 12px; background: var(--white); border-radius: 999px; padding: 8px 22px 8px 10px; }
.report-stars strong { display: block; font-family: var(--serif); font-size: 36px; line-height: 1; }
.report-stars span { font-size: 14px; color: var(--slate); }
.report-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.report-facts div { background: var(--white); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.report-facts strong { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--charcoal); }
.report-facts span { font-size: 14px; color: var(--slate); }
.report-card { background: var(--white); border-radius: 24px; padding: 20px 22px; }
.report-card h1, .report-card h2 { margin: 0 0 10px; font-family: var(--serif); font-size: 24px; }
.report-card p { margin: 0; line-height: 1.55; color: var(--slate); }
.report-comment { background: var(--terra-tint); }
.report-comment p { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--terra-ink); }
.report-art { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.art { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.art-frame { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--sea); }
.art-frame img, .art-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.art figcaption { font-size: 14px; color: var(--slate); }
.report-foot { text-align: center; font-size: 13px; color: var(--slate); margin: 8px 0 0; }
@media (max-width: 520px) {
  .report-hero h1 { font-size: 32px; }
}
.manage-link { align-self: center; color: var(--terra-d); font-weight: 700; font-size: 15px; }
.kid-prompt { max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.kid-board.has-spot .kid-prompt { left: 16px; transform: none; max-width: calc(64% - 32px); }
@media (max-width: 720px) {
  .quiz { position: fixed; inset: auto 0 0 0; z-index: 40; padding: 10px; }
  .quiz-drag { inset: 0; align-items: center; }
  .quiz-card { max-height: calc(100dvh - 20px); overflow-y: auto; }
  .quiz-head h3 { font-size: 20px; min-width: 0; }
  .quiz-opt { min-height: 64px; font-size: 20px; border-radius: 18px; }
  .quiz-options.many { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .quiz-options.many .quiz-opt { min-height: 52px; font-size: 18px; }
  .quiz-targets { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; }
  .quiz-target { min-height: 84px; }
  .quiz-drop { justify-content: flex-start; }
  .quiz-chip { height: 50px; min-width: 80px; font-size: 17px; padding: 0 14px; }
  .quiz-done { height: 56px; font-size: 19px; }
  .kid-prompt { font-size: 15px; padding: 8px 14px; top: 10px; }
  .spot { width: 40%; right: 10px; top: 10px; padding: 4px; }
}
.kid-prompt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- round 2: video, stamps, celebrations, gallery ---------- */
.board-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #1b2224; }
.tap-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; border: 0; border-radius: 999px; background: var(--terra-d); color: var(--white); font-size: 22px; font-weight: 700; padding: 16px 30px 16px 22px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; }
.gate-lesson { font-weight: 700; color: var(--charcoal) !important; }
.gate-materials { width: 100%; text-align: left; background: var(--gold-tint); border-radius: 18px; padding: 12px 16px; font-size: 15px; color: var(--gold-ink); }
.gate-materials ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }
.quiz-timer { min-width: 64px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--charcoal); color: var(--cream); font-size: 20px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.tq-timer { color: #d9a24a; font-weight: 700; font-variant-numeric: tabular-nums; }
.pop-presets button[aria-pressed="true"] { background: #ece6dc; color: #1f2629; border-color: #ece6dc; }
.stamp-menu { width: 230px; }
.stamp-row { display: flex; gap: 8px; }
.stamp-row button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #46535a; background: #1f2629; display: flex; align-items: center; justify-content: center; }
#stamp-btn svg { width: 20px; height: 20px; }
.self-tile .self-ctrls { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: flex; gap: 6px; }
.self-ctrls button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(27, 34, 36, 0.75); color: #ece6dc; display: flex; align-items: center; justify-content: center; }
.self-ctrls button.off { background: #bf5f49; }
.student.net-bad { border-color: #e08a72; }
.student.net-bad .info span { color: #e08a72; }
.thumb .thumb-video { width: 100%; aspect-ratio: 16 / 10; border-radius: 7px; background: #324952; color: #ece6dc; display: flex; align-items: center; justify-content: center; }
.tc-gallery { position: absolute; inset: 0; z-index: 6; background: #1b2224; padding: 12px; display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px; }
.gtile { border-radius: 14px; background: #3a4549; }
.gtile.hand-up { box-shadow: inset 0 0 0 3px #d9a24a; }
.gtile .tile-name { font-size: 15px; }
.gtile .gstar { position: absolute; right: 10px; bottom: 10px; z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(27, 34, 36, 0.8); display: flex; align-items: center; justify-content: center; }
.gtile .gstar svg { width: 22px; height: 22px; }
.gallery-empty { grid-column: 1 / -1; align-self: center; text-align: center; color: #9aa8ad; }
.board-stage.can-draw[data-tool="stamp"] .board-ink { cursor: copy; }
.pw-card { margin-top: 28px; max-width: 560px; }
.pw-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; align-items: flex-start; }
.pw-form .field { width: 100%; max-width: 360px; }
.pw-form .field input { width: 100%; }

/* fit the extra stamp tool on iPad-sized screens */
@media (max-width: 1280px) {
  .kid-tools { gap: 10px; padding: 0 14px; }
  .tool-group { gap: 8px; }
  .tool-round { width: 60px; height: 60px; }
  .swatch { width: 44px; height: 44px; }
  .hand-btn { height: 70px; padding: 0 20px; font-size: 19px; }
}
.ttool { width: 40px; height: 40px; }
.tsep { margin: 0 4px; }
.tswatch { margin: 0 3px; }

/* ---------- round 3: growth, chest, media answers, avatars ---------- */
.gate-card { max-height: calc(100dvh - 32px); overflow-y: auto; }
.avatar-choose { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.avatar-pick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.avatar-opt { width: 62px; height: 62px; border-radius: 50%; border: 0; padding: 4px; background: transparent; display: flex; align-items: center; justify-content: center; }
.avatar-opt[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--terra-d); }
.gate-check { font-size: 14px; color: var(--terra-d); font-weight: 700; }
.level-chip { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px; background: var(--cream); color: var(--charcoal); font-size: 15px; font-weight: 700; }
.level-chip svg { border-radius: 50%; }
.chest-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #2f3b3f; color: var(--cream); font-size: 14px; font-weight: 700; }
.chest-icon { font-size: 20px; line-height: 1; }
.chest-bar { width: 70px; height: 8px; border-radius: 4px; background: #46535a; overflow: hidden; }
.chest-bar span { display: block; height: 100%; background: var(--gold); transition: width 0.4s; }
.rec-chip { padding: 4px 10px; border-radius: 999px; background: #bf5f49; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; animation: recblink 1.6s infinite; }
@keyframes recblink { 50% { opacity: 0.55; } }
.tile-helper { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 3px 9px; border-radius: 8px; background: var(--gold); color: var(--charcoal); font-size: 12px; font-weight: 700; }
.tile-avatar { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; background: var(--sea); }
.tile-avatar svg { width: 64%; height: 64%; }
.cam-btn { margin-left: auto; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid #d9d2c7; background: var(--cream); color: var(--charcoal); font-size: 13px; font-weight: 700; }
.cam-btn[aria-pressed="false"] { background: var(--terra-tint); color: var(--terra-ink); border-color: transparent; }
.showcase { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(63, 77, 81, 0.82); padding: 20px; }
.showcase img { max-width: 92%; max-height: 80%; border-radius: 18px; border: 6px solid #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); background: #fff; }
.showcase span { color: #fff; font-size: 22px; font-weight: 700; }
.chest-open { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(247, 242, 235, 0.92); text-align: center; animation: pop 3.2s ease forwards; }
.chest-open strong { font-family: var(--serif); font-size: 40px; }
.chest-open span { font-size: 18px; color: var(--slate); }
.chest-big { font-size: 96px; line-height: 1; color: inherit !important; }
.end-growth { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.end-garden { display: flex; align-items: center; gap: 14px; background: var(--white); border-radius: 20px; padding: 10px 18px 10px 10px; text-align: left; }
.end-garden svg { border-radius: 16px; }
.end-garden strong { display: block; font-size: 18px; }
.end-garden span { font-size: 14px; color: var(--slate); }
.end-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.badge-pop { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--gold-tint); color: var(--gold-ink); font-weight: 700; font-size: 15px; animation: pop 2.4s ease both; animation-iteration-count: 1; }
.badge-pop i { font-style: normal; font-size: 20px; }
/* buzzer, photo, voice */
.quiz-buzzer .quiz-card, .quiz-media .quiz-card { max-width: 760px; }
.quiz-media { align-items: center; background: rgba(63, 77, 81, 0.35); pointer-events: auto; }
.buzz-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 0 6px; }
.buzz-btn { width: 150px; height: 150px; border-radius: 50%; border: 0; background: var(--terra-d); color: #fff; font-size: 32px; font-weight: 800; letter-spacing: 0.04em; box-shadow: 0 10px 0 #7d3a2a, 0 14px 24px rgba(0, 0, 0, 0.2); }
.buzz-btn:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 4px 0 #7d3a2a; }
.buzz-btn.pressed { background: var(--gold); color: var(--charcoal); box-shadow: 0 6px 0 #8a5c14; }
.buzz-btn:disabled { cursor: default; }
.buzz-note { margin: 0; color: var(--slate); font-weight: 700; text-align: center; }
.photo-box, .voice-box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.photo-view { width: min(100%, 460px); aspect-ratio: 4 / 3; border-radius: 18px; background: var(--paper); overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.photo-view video, .photo-view img { width: 100%; height: 100%; object-fit: cover; }
.media-hint { color: var(--slate); font-weight: 700; padding: 16px; text-align: center; }
.media-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.media-btn { height: 56px; padding: 0 24px; border-radius: 999px; border: 2px solid var(--charcoal); background: var(--white); color: var(--charcoal); font-size: 18px; font-weight: 700; display: inline-flex; align-items: center; cursor: pointer; }
.media-btn.primary { background: var(--terra-d); border-color: var(--terra-d); color: #fff; }
.media-btn:disabled { opacity: 0.6; }
.media-done { color: #4f8a63; font-weight: 700; }
.voice-orb { width: 120px; height: 120px; border-radius: 50%; background: var(--sea); color: var(--deep); display: flex; align-items: center; justify-content: center; }
.voice-orb.on { background: var(--terra-d); color: #fff; animation: recblink 1s infinite; }
.voice-left { font-size: 44px; font-weight: 800; }
.voice-box audio { width: min(100%, 360px); }
/* teacher side of media answers */
.tq-buzz { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tq-buzz li { padding: 6px 12px; border-radius: 999px; border: 1px solid #46535a; font-size: 14px; }
.tq-buzz li.first { border-color: #d9a24a; color: #d9a24a; }
.tq-buzz em { font-style: normal; font-size: 11px; }
.tq-wait { margin: 0; color: #9aa8ad; font-size: 13px; }
.tq-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tq-photos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tq-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #3a4549; }
.tq-photos figcaption { font-size: 12px; }
.tq-voices { display: flex; flex-direction: column; gap: 6px; }
.tq-voice { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.tq-voice audio { height: 32px; flex: 1; }
@media (max-width: 720px) {
  .level-chip span, .chest-chip .chest-bar { display: none; }
  .buzz-btn { width: 120px; height: 120px; font-size: 26px; }
}

/* teacher console: assistant mode, AI drafts, quiet children */
.is-assistant #end, .is-assistant .tnav, .is-assistant #play, .is-assistant #rec-btn { display: none !important; }
.is-assistant #lesson-btn { pointer-events: none; opacity: 0.7; }
.is-assistant .tc-brand::after { content: " · Assistant"; font-family: var(--sans); font-size: 13px; color: #d9a24a; }
.ai-btn { justify-self: start; grid-column: 1 / -1; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid #c9bfae; background: var(--gold-tint); color: var(--gold-ink); font-size: 13px; font-weight: 700; }
.ai-btn:disabled { opacity: 0.6; }
.student.quiet { border-color: #8a7a5a; }
.student.quiet .info span { color: #d9a24a; }
.thumbv .tile-avatar svg { width: 80%; height: 80%; }
.sounds-menu { width: 300px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; align-self: flex-end; height: 52px; white-space: nowrap; }
.check-line input { width: 20px; height: 20px; accent-color: var(--terra-d); }

/* ---------- admin ---------- */
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 12px; }
.admin-tabs button, .admin-tabs a { height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: #c9d0d2; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; }
.admin-tabs [aria-current="page"] { background: var(--cream); color: var(--charcoal); }
.admin-top { flex-wrap: wrap; height: auto; min-height: 64px; padding: 10px 20px; }
.form-foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.search { height: 42px; border-radius: 999px; border: 1px solid #d9d2c7; background: var(--white); padding: 0 16px; font: inherit; font-size: 15px; min-width: 240px; }
.day-title { margin: 26px 0 10px; font-family: var(--serif); font-size: 22px; }
.class-card { background: var(--white); border-radius: 18px; padding: 14px 16px; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; margin-bottom: 10px; align-items: start; }
.class-card.cancelled { opacity: 0.55; }
.class-time strong { display: block; font-size: 18px; }
.class-time span { font-size: 13px; color: var(--slate); }
.class-main h4 { margin: 0 0 4px; font-size: 17px; }
.class-main p { margin: 0; font-size: 14px; color: var(--slate); }
.class-acts { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--paper); color: var(--charcoal); font-size: 12px; font-weight: 700; }
.booking-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.booking-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.booking-list li > span { margin-right: auto; }
.mini-btn { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid #c9bfae; background: var(--cream); color: var(--charcoal); font-size: 13px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap; }
.book-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.book-row select, .pack-add select, .book-acts select { height: 34px; border-radius: 10px; border: 1px solid #d9d2c7; background: var(--cream); font: inherit; font-size: 13px; max-width: 320px; }
.check-line.small { height: auto; font-size: 13px; align-self: center; }
.check-line.consent { white-space: normal; height: auto; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--slate); margin-top: 12px; }
.check-line.consent input { margin-top: 2px; flex-shrink: 0; }
.child-rows { display: flex; flex-direction: column; gap: 8px; }
.child-row { display: flex; gap: 8px; }
.child-row input { height: 44px; border-radius: 12px; border: 1px solid #d9d2c7; background: var(--cream); padding: 0 12px; font: inherit; font-size: 15px; }
.child-row input:first-child { flex: 1; }
.child-row input:last-child { width: 90px; }
.fam-list { display: flex; flex-direction: column; gap: 12px; }
.fam-card { background: var(--white); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.fam-head { display: flex; justify-content: space-between; gap: 14px; }
.fam-head h3 { margin: 0; font-size: 18px; }
.fam-head p { margin: 2px 0 0; font-size: 14px; color: var(--slate); }
.fam-balance { text-align: right; }
.fam-balance strong { display: block; font-family: var(--serif); font-size: 30px; line-height: 1; }
.fam-balance span { font-size: 12px; color: var(--slate); }
.fam-kids { display: flex; gap: 8px; flex-wrap: wrap; }
.kid-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 999px; background: var(--sea); font-size: 14px; }
.kid-chip svg { border-radius: 50%; }
.fam-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pack-add { display: inline-flex; gap: 6px; }
.ledger { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--slate); line-height: 1.7; }
.ledger .plus { color: #4f8a63; }
.ledger .minus { color: var(--terra-d); }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--paper); font-size: 14px; line-height: 1.5; }
.stars-line { color: var(--gold); letter-spacing: 1px; }
@media (max-width: 760px) {
  .class-card { grid-template-columns: 1fr; }
  .class-acts { flex-direction: row; flex-wrap: wrap; }
  .admin-tabs { margin-left: 0; }
}

/* ---------- family, child, trial, check ---------- */
.small-note { font-size: 13px; color: var(--slate); margin: 8px 0 0; }
.small-note a, .report-foot a { color: var(--terra-d); font-weight: 700; }
.welcome-card { background: var(--gold-tint); }
.fam-hero h1 { font-size: 34px; }
.fam-credits { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--white); border-radius: 20px; padding: 12px 16px; align-self: flex-start; }
.fam-credits strong { font-family: var(--serif); font-size: 36px; line-height: 1; }
.fam-credits span { font-size: 14px; color: var(--slate); }
.kid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.kid-card { background: var(--white); border-radius: 22px; padding: 14px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--charcoal); }
.kid-avatar svg { display: block; }
.kid-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kid-info strong { font-size: 19px; }
.kid-info > span { font-size: 13px; color: var(--slate); }
.kid-badges i { font-style: normal; font-size: 18px; margin-right: 2px; }
.kid-garden svg { border-radius: 14px; display: block; }
.book-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.book-cards li { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--paper); }
.book-cards li > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.book-cards strong { font-size: 16px; }
.book-cards span { font-size: 14px; color: var(--slate); }
.book-cards em { font-style: normal; font-size: 13px; color: var(--gold-ink); font-weight: 700; }
.book-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.past-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.past-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.past-list i { color: var(--slate); font-size: 13px; }
.growth-top { display: flex; align-items: center; gap: 14px; }
.growth-avatar svg { display: block; }
.garden-block { margin-top: 14px; display: flex; gap: 16px; align-items: center; background: var(--white); border-radius: 22px; padding: 12px; }
.garden-block svg { border-radius: 18px; flex-shrink: 0; }
.garden-block > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.garden-level { font-family: var(--serif); font-size: 24px; }
.garden-bar { height: 10px; border-radius: 5px; background: var(--paper); overflow: hidden; }
.garden-bar span { display: block; height: 100%; background: var(--gold); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gbadge { border-radius: 16px; background: var(--cream); padding: 12px; display: flex; flex-direction: column; gap: 4px; text-align: center; align-items: center; opacity: 0.45; filter: grayscale(1); }
.gbadge.got { opacity: 1; filter: none; background: var(--gold-tint); }
.gbadge i { font-style: normal; font-size: 32px; }
.gbadge strong { font-size: 14px; }
.gbadge span { font-size: 12px; color: var(--slate); }
.part-bars { display: flex; flex-direction: column; gap: 10px; }
.part { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.part-bar { height: 12px; border-radius: 6px; background: var(--paper); overflow: hidden; }
.part-bar span { display: block; height: 100%; background: var(--deep); }
.garden-card { display: flex; align-items: center; gap: 14px; }
.garden-card svg { border-radius: 16px; flex-shrink: 0; }
.garden-card h2 { margin-bottom: 4px; }
.mission-card { background: var(--sea); display: flex; flex-direction: column; gap: 8px; }
.mission-card h2 { margin: 0; }
.mission-card p { color: var(--deep); }
.trial-cta { background: var(--gold-tint); display: flex; flex-direction: column; gap: 8px; }
.feedback-card { display: flex; flex-direction: column; gap: 10px; }
.rate { display: flex; gap: 8px; }
.rate button { width: 54px; height: 54px; border-radius: 50%; border: 2px solid transparent; background: var(--cream); font-size: 28px; }
.rate button[aria-checked="true"] { border-color: var(--terra-d); background: var(--terra-tint); }
.feedback-card textarea { border-radius: 12px; border: 1px solid #d9d2c7; background: var(--cream); padding: 10px 12px; font: inherit; font-size: 15px; }
.report-voice { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--slate); flex-wrap: wrap; }
.trial-hero h1 { font-size: 38px; }
.trial-form { display: flex; flex-direction: column; gap: 12px; }
.trial-form .field input, .trial-form .field select { height: 48px; border-radius: 12px; border: 1px solid #d9d2c7; background: var(--cream); padding: 0 12px; font: inherit; font-size: 16px; }
.trial-form h3 { margin: 6px 0 0; }
.trial-classes { display: flex; flex-direction: column; gap: 8px; }
.trial-class { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--cream); cursor: pointer; }
.trial-class input { width: 20px; height: 20px; accent-color: var(--terra-d); margin-top: 2px; }
.trial-class span { display: flex; flex-direction: column; gap: 2px; }
.trial-class em { font-style: normal; font-size: 14px; color: var(--slate); }
.trial-form .btn { align-self: flex-start; }
.checks { display: flex; flex-direction: column; gap: 14px; }
.check { border-radius: 16px; background: var(--cream); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ck-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ck-head em { font-style: normal; color: var(--slate); font-size: 14px; }
.ck-dot { width: 14px; height: 14px; border-radius: 50%; background: #c9bfae; }
.check[data-status="ok"] .ck-dot { background: #4f8a63; }
.check[data-status="warn"] .ck-dot { background: var(--gold); }
.check[data-status="bad"] .ck-dot { background: var(--terra-d); }
.ck-video { width: 240px; max-width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; }
.mic-meter { height: 14px; border-radius: 7px; background: var(--paper); overflow: hidden; }
.mic-meter span { display: block; height: 100%; width: 0; background: #4f8a63; transition: width 0.08s; }
.ck-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tip-list { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; color: var(--slate); }

/* mic card fits narrower tablets */
.cam-btn { white-space: nowrap; flex-shrink: 0; }
.mic-card > div { min-width: 0; }
@media (max-width: 1280px) {
  .mic-card { gap: 10px; padding: 0 12px; }
  .mic-card .dot { width: 44px; height: 44px; }
  .mic-card .dot svg { width: 22px; height: 22px; }
  .mic-card strong { font-size: 15px; line-height: 1.2; }
  .mic-card span { font-size: 12px; }
  .cam-btn { padding: 0 10px; font-size: 12px; }
}
.showcase { z-index: 6; }
.media-hint .media-btn { margin-top: 10px; }
@media (max-width: 1280px) {
  #mic-sub { display: none; }
  .mic-card strong { font-size: 14px; }
}
@media (max-width: 1200px) {
  #cam-text { display: none; }
  .cam-btn { width: 40px; padding: 0; justify-content: center; }
}

/* ---------- landing page (/) ---------- */
.lp { background: var(--cream); color: var(--charcoal); min-height: 100%; }
.lp a:where(:not(.btn)) { color: inherit; }
.lp .btn { text-decoration: none; }
.lp-wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.lp-kicker { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terra-d); }
.lp-h2 { margin: 0; font-family: var(--serif); font-size: 40px; line-height: 1.12; max-width: 720px; }
.lp-sub { margin: 14px 0 0; font-size: 18px; line-height: 1.6; color: var(--slate-ink); max-width: 680px; }
.lp-note { margin: 10px 0 0; font-size: 14px; color: var(--slate); line-height: 1.5; }
.lp-textlink { font-weight: 700; color: var(--terra-d) !important; text-underline-offset: 3px; }
.lp-section { padding: 88px 0; }
.lp-band { background: var(--white); }

.lp-nav { position: sticky; top: 0; z-index: 20; background: rgba(247, 242, 235, 0.94); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--paper); }
.lp-nav-in { height: 72px; display: flex; align-items: center; gap: 24px; }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.lp-brand .mark { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-size: 19px; color: var(--charcoal); }
.lp-brand em { font-style: normal; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cream); background: var(--deep); padding: 3px 8px; border-radius: 6px; }
.lp-links { display: flex; gap: 26px; margin-left: 12px; }
.lp-links a { text-decoration: none; font-weight: 500; font-size: 15px; color: var(--slate-ink); }
.lp-links a:hover { color: var(--terra-d); }
.lp-nav-cta { margin-left: auto; display: flex; gap: 10px; }

.lp-hero { padding: 64px 0 32px; overflow: hidden; }
.lp-hero-in { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
.lp-hero h1 { margin: 0; font-family: var(--serif); font-size: 58px; line-height: 1.05; letter-spacing: -0.01em; }
.lp-lead { margin: 20px 0 0; font-size: 20px; line-height: 1.55; color: var(--slate-ink); max-width: 520px; }
.lp-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.lp-facts { list-style: none; padding: 0; margin: 40px 0 0; display: flex; gap: 32px; flex-wrap: wrap; }
.lp-facts li { display: flex; flex-direction: column; gap: 2px; }
.lp-facts strong { font-family: var(--serif); font-size: 38px; line-height: 1; color: var(--gold-ink); }
.lp-facts span { font-size: 14px; color: var(--slate); }

.lp-mock { margin: 0; background: var(--paper); border-radius: 26px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(50, 73, 82, 0.45), 0 0 0 1px rgba(63, 77, 81, 0.06); }
.lp-mock-top { height: 50px; background: var(--charcoal); color: var(--cream); display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.lp-mock-title { font-family: var(--serif); font-size: 16px; font-weight: 700; white-space: nowrap; }
.lp-mock-steps { display: flex; gap: 6px; margin: 0 auto; min-width: 0; overflow: hidden; }
.lp-mock-steps i { font-style: normal; font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid #8a9aa1; white-space: nowrap; }
.lp-mock-steps i.done { background: var(--slate); border-color: var(--slate); }
.lp-mock-steps i.now { background: var(--gold); border-color: var(--gold); color: var(--charcoal); font-weight: 700; }
.lp-mock-stars { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border-radius: 999px; background: var(--cream); color: var(--charcoal); font-weight: 700; font-size: 15px; }
.lp-mock-body { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 12px; padding: 12px; }
.lp-mock-board { position: relative; border-radius: 16px; overflow: hidden; background: var(--white); box-shadow: 0 0 0 4px var(--white); align-self: start; }
.lp-mock-board img { display: block; width: 100%; height: auto; }
.lp-mock-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-mock-prompt { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--gold); color: var(--charcoal); font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.lp-mock-side { display: flex; flex-direction: column; gap: 8px; }
.lp-mock-teacher { position: relative; border-radius: 14px; overflow: hidden; }
.lp-mock-teacher svg { display: block; width: 100%; height: auto; }
.lp-mock-teacher span { position: absolute; left: 6px; bottom: 6px; background: var(--charcoal); color: var(--cream); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.lp-mock-kids { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lp-mock-kid { position: relative; background: var(--white); border-radius: 12px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; }
.lp-mock-kid svg { width: 40px; height: 40px; }
.lp-mock-kid b { position: absolute; top: -6px; right: -4px; background: var(--gold); border-radius: 999px; padding: 1px 6px; font-size: 10px; }
.lp-mock-kid.on { box-shadow: 0 0 0 3px var(--gold); }

.lp-courses { margin-top: 40px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.lp-course { background: var(--white); border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 0 1px rgba(63, 77, 81, 0.06); }
.lp-course-art svg { display: block; width: 100%; height: auto; }
.lp-course-body { padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.lp-course h3 { margin: 0; font-family: var(--serif); font-size: 30px; }
.lp-course p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--slate-ink); }
.lp-course-acts { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.lp-tag { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; padding: 5px 11px; border-radius: 999px; }
.lp-tag-open { background: var(--green-tint); color: var(--green-ink); }
.lp-tag-soon { background: var(--slate-tint); color: var(--slate-ink); }

.lp-modules { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.lp-modules li { display: flex; gap: 14px; align-items: center; background: var(--cream); border-radius: 18px; padding: 14px 16px; }
.lp-modules b { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--deep); color: var(--cream); font-family: var(--serif); font-size: 19px; display: flex; align-items: center; justify-content: center; }
.lp-modules li:nth-child(3n+2) b { background: var(--terra-d); }
.lp-modules li:nth-child(3n) b { background: var(--gold); color: var(--charcoal); }
.lp-modules span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lp-modules strong { font-size: 15px; line-height: 1.3; }
.lp-modules em { font-style: normal; font-size: 13px; color: var(--slate); }

.lp-week { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: center; background: var(--sea); border-radius: 28px; padding: 28px; }
.lp-week img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 0 0 4px var(--white); }
.lp-week h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 32px; }
.lp-week p { margin: 0; line-height: 1.6; color: var(--deep); }
.lp-week .lp-note { color: var(--slate-ink); margin-top: 16px; }
.lp-steps { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lp-steps li { display: flex; gap: 6px; align-items: baseline; background: var(--white); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.lp-steps em { font-style: normal; font-weight: 400; color: var(--slate); font-size: 13px; }

.lp-how { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.lp-how li { background: var(--white); border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.lp-how-n { width: 40px; height: 40px; border-radius: 50%; background: var(--gold-tint); color: var(--gold-ink); font-family: var(--serif); font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.lp-how h3 { margin: 6px 0 0; font-size: 19px; }
.lp-how p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--slate-ink); }
.lp-promise { margin-top: 24px; display: flex; gap: 14px; align-items: center; background: var(--green-tint); border-radius: 20px; padding: 16px 20px; }
.lp-promise p { margin: 0; line-height: 1.55; color: var(--green-ink); }

.lp-parents { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.lp-parent-card { background: var(--cream); border-radius: 26px; padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.lp-parent-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 26px; }
.lp-parent-card p { margin: 0 0 16px; line-height: 1.6; color: var(--slate-ink); }
.lp-parent-card #parent-new .lp-note { margin: 0; }
.lp-parent-links { list-style: none; padding: 16px 0 0; margin: 0; border-top: 1px solid var(--paper); display: flex; gap: 22px; flex-wrap: wrap; }
.lp-parent-links a { font-weight: 700; font-size: 15px; color: var(--terra-d); text-underline-offset: 3px; }

.lp-faq-wrap { max-width: 860px; }
.lp-faq { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.lp-faq details { background: var(--white); border-radius: 18px; padding: 0 22px; }
.lp-faq summary { cursor: pointer; list-style: none; padding: 18px 28px 18px 0; font-weight: 700; font-size: 17px; position: relative; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 400; color: var(--terra-d); }
.lp-faq details[open] summary::after { content: "–"; }
.lp-faq details p { margin: 0; padding: 0 0 20px; line-height: 1.6; color: var(--slate-ink); }

.lp-final { background: var(--deep); color: var(--cream); padding: 80px 0; text-align: center; }
.lp-final-in { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lp-final h2 { margin: 0; font-family: var(--serif); font-size: 42px; line-height: 1.1; }
.lp-final p { margin: 0 0 10px; font-size: 18px; color: #c9d6da; }
.lp-final .btn-primary { background: var(--gold); color: var(--charcoal); }

.lp-foot { padding: 32px 0 40px; font-size: 14px; color: var(--slate); }
.lp-foot-in { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.lp-foot .lp-brand { font-size: 18px; color: var(--charcoal); }
.lp-foot .lp-brand .mark { width: 30px; height: 30px; font-size: 16px; }
.lp-foot nav { margin-left: auto; display: flex; gap: 18px; }
.lp-foot nav a { color: var(--slate-ink); }

@media (max-width: 1040px) {
  .lp-hero-in { grid-template-columns: 1fr; gap: 44px; }
  .lp-hero h1 { font-size: 50px; }
  .lp-how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-week { grid-template-columns: 1fr; gap: 24px; }
  .lp-parents { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  .lp-wrap { padding: 0 16px; }
  .lp-links { display: none; }
  .lp-nav-in { height: 64px; gap: 10px; }
  .lp-brand { font-size: 19px; }
  .lp-brand em { display: none; }
  .lp-nav-cta .btn { padding: 0 12px; height: 38px; font-size: 13px; }
  .lp-hero { padding: 36px 0 16px; }
  .lp-hero h1 { font-size: 38px; }
  .lp-lead { font-size: 17px; }
  .lp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
  .lp-facts span { font-size: 13px; }
  .lp-modules li { padding: 10px 14px; }
  .lp-modules b { width: 34px; height: 34px; font-size: 16px; }
  .lp-facts strong { font-size: 30px; }
  .lp-section { padding: 56px 0; }
  .lp-h2 { font-size: 30px; }
  .lp-sub { font-size: 16px; }
  .lp-courses, .lp-modules, .lp-how { grid-template-columns: 1fr; }
  .lp-course-body { padding: 22px; }
  .lp-course h3 { font-size: 26px; }
  .lp-week { padding: 16px; border-radius: 22px; }
  .lp-week h3 { font-size: 26px; }
  .lp-mock-body { grid-template-columns: 1fr; }
  .lp-mock-side { flex-direction: row; }
  .lp-mock-teacher { width: 34%; flex-shrink: 0; align-self: flex-start; }
  .lp-mock-kids { flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: start; }
  .lp-mock-steps i:not(.now) { display: none; }
  .lp-mock-prompt { font-size: 10px; padding: 4px 9px; }
  .lp-parent-card { padding: 22px; }
  .lp-final h2 { font-size: 32px; }
  .lp-foot nav { margin-left: 0; }
}
@media (max-width: 380px) {
  .lp-nav-cta .btn-ghost { display: none; }
}

/* ---------- tablet fit (iPad and Android tablets) ---------- */
/* Taps feel instant, and long presses don't pop up text selection or image menus */
.kid-page button, .kid-page a, .kid-page .board-stage { touch-action: manipulation; }
.kid-page { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.kid-page img { -webkit-user-drag: none; }
.hand-btn { white-space: nowrap; }

/* Pre-class card: never squash the camera or the Join button */
.gate-info, .gate-setup { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.gate-card > *, .gate-info > *, .gate-setup > * { flex-shrink: 0; }
/* Landscape tablets: materials on the left, camera and Join on the right, so it fits without scrolling */
@media (orientation: landscape) and (max-height: 900px) and (min-width: 700px) {
  .kid-page #gate .gate-card { max-width: 900px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px 32px; }
  .kid-page #gate .gate-info { align-items: flex-start; text-align: left; gap: 12px; }
  .kid-page #gate .gate-setup { gap: 12px; }
  .kid-page #gate .gate-preview { width: 100%; max-width: 300px; }
  .kid-page #gate .gate-card .btn { height: 64px; }
  .kid-page #gate .avatar-pick { flex-wrap: nowrap; gap: 4px; }
  .kid-page #gate .avatar-pick > * { width: 58px; height: 58px; }
  .kid-page #gate .avatar-pick svg { width: 100%; height: 100%; }
}

/* Landscape tablets narrower than 1100px (older iPads, 1024 wide): keep the toolbar on one line */
@media (orientation: landscape) and (max-width: 1100px) and (min-width: 721px) {
  .kid-main { gap: 16px; padding: 16px; }
  .kid-left { gap: 16px; }
  .kid-side { width: 240px; }
  .teacher-tile { height: 220px; }
  .friend { height: 100px; }
  .kid-tools { height: auto; min-height: 96px; padding: 12px 16px; flex-wrap: nowrap; }
  .tool-group { gap: 8px; }
  .tool-round { width: 56px; height: 56px; }
  .swatch { width: 40px; height: 40px; }
  .hand-btn { height: 64px; font-size: 18px; padding: 0 20px; gap: 8px; }
  .hand-btn svg { width: 30px; height: 30px; }
}

/* Portrait tablets: one tidy toolbar row, and the videos fill the rest of the screen instead of leaving a gap */
@media (orientation: portrait) and (max-width: 1100px) and (min-width: 600px) {
  .kid-side { flex: 0 0 auto; flex-wrap: nowrap; align-items: stretch; }
  .teacher-tile { flex: 3 1 0; width: auto; height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  .friends { flex: 2 1 0; width: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
  .friend { height: auto; min-height: 0; }
  .kid-tools { height: auto; padding: 10px 12px; flex-wrap: wrap; row-gap: 10px; }
  .kid-tools > .tool-group:last-child { margin-left: auto; }
  .tool-group { gap: 8px; }
  .tool-round { width: 52px; height: 52px; }
  .swatch { width: 40px; height: 40px; }
  .hand-btn { height: 60px; font-size: 17px; padding: 0 18px; gap: 8px; }
  .hand-btn svg { width: 28px; height: 28px; }
}

/* ---------- swap game & market game (children trade with each other) ---------- */
.quiz-trade { align-items: center; background: rgba(63, 77, 81, 0.35); pointer-events: auto; }
.quiz-trade .quiz-card { position: relative; max-width: 980px; max-height: 100%; overflow-y: auto; }
.trade-body { display: grid; grid-template-columns: minmax(180px, 230px) 1fr; gap: 12px; align-items: start; }
.trade-side { display: flex; flex-direction: column; gap: 10px; }
.trade-me { display: flex; flex-direction: column; gap: 8px; align-items: stretch; padding: 10px; border-radius: 20px; background: var(--white); }
.trade-me.got { background: var(--green-tint); box-shadow: inset 0 0 0 3px #4f8a63; }
.trade-me.watch p { margin: 6px; font-size: 20px; font-weight: 700; color: var(--slate); }
.trade-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 16px; background: var(--cream); }
.trade-slot.want { background: var(--gold-tint); }
.trade-cap { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate-ink); }
.trade-hand, .trade-purse { position: relative; display: flex; gap: 6px; align-items: center; justify-content: center; min-height: 64px; }
.trade-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 34px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.trade-icon.big { font-size: 54px; }
.trade-icon.small { font-size: 24px; }
.trade-coin { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--white); font-weight: 700; font-size: 18px; box-shadow: inset 0 0 0 3px #e2b465, 0 3px 0 var(--gold-ink); }
.trade-purse .trade-coin { width: 46px; height: 46px; font-size: 20px; }
.trade-tick { position: absolute; top: -8px; right: -18px; width: 34px; height: 34px; border-radius: 50%; background: #4f8a63; color: var(--white); display: flex; align-items: center; justify-content: center; }
.trade-tick.small { position: static; width: 26px; height: 26px; }
.trade-tick.small svg { width: 18px; height: 18px; }
.trade-hint { margin: 0; text-align: center; font-size: 17px; line-height: 1.3; font-weight: 700; color: var(--deep); }
.trade-friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.trade-friend { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 18px; background: var(--white); border: 3px solid transparent; }
.trade-friend.asking { border-color: var(--gold); background: var(--gold-tint); }
.trade-friend-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 17px; min-height: 26px; }
.trade-friend-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-friend-items { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 66px; align-items: center; }
.trade-ask { width: 66px; height: 66px; border: 0; border-radius: 18px; background: var(--cream); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.14); display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
.trade-ask .trade-icon { font-size: 40px; }
.trade-ask:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.14); }
.trade-ask:disabled { opacity: 0.55; cursor: default; }
.trade-friend-want { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: 0.06em; }
.trade-mini-coins { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; }
.trade-mini-coins .trade-coin { width: 22px; height: 22px; font-size: 11px; box-shadow: inset 0 0 0 2px #e2b465; }
.trade-asking { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: var(--gold-ink); }
.trade-cancel { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--white); color: var(--charcoal); font-weight: 700; }
.trade-empty { color: var(--slate); font-weight: 700; font-size: 15px; }
.trade-news { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 10px 22px; border-radius: 999px; font-size: 20px; font-weight: 700; box-shadow: 0 8px 20px rgba(63, 77, 81, 0.25); animation: trade-pop 0.3s ease-out; z-index: 2; white-space: nowrap; }
.trade-news.ok { background: #4f8a63; color: var(--white); }
.trade-news.no { background: var(--terra-tint); color: var(--terra-ink); }
@keyframes trade-pop { from { transform: translateX(-50%) scale(0.7); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.trade-ask-me { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; border-radius: 24px; background: rgba(247, 242, 235, 0.97); text-align: center; }
.trade-ask-me p { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 26px; font-family: var(--serif); }
.trade-ask-me .trade-icon { font-size: 56px; }
.trade-you-get { font-family: var(--sans) !important; font-size: 20px !important; font-weight: 700; color: var(--slate-ink); }
.trade-yesno { display: flex; gap: 16px; margin-top: 8px; }
.trade-yes, .trade-no { min-width: 150px; height: 84px; border: 0; border-radius: 24px; font-size: 32px; font-weight: 700; color: var(--white); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18); }
.trade-yes { background: #4f8a63; }
.trade-no { background: var(--terra-d); }
.trade-yes:disabled, .trade-no:disabled { opacity: 0.6; }
@media (max-width: 760px) {
  .trade-body { grid-template-columns: 1fr; }
  .trade-me { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .trade-slot { min-width: 110px; }
  .trade-icon.big { font-size: 42px; }
  .trade-ask { width: 58px; height: 58px; }
}
/* teacher panel */
.tq-trade-sum { margin: 0; font-size: 14px; color: var(--cream); }
.tq-trade { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.tq-trade-row { font-size: 13px; }
.tq-trade-log { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.tq-trade-log li { padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.tq-trade-log li.ok { color: #9fd0ae; }
.tq-trade-log li.no { color: #f0b3a3; }
.tq-trade-log li.wait { color: #e8c98e; }
