/* Playscape v3 website. One kid-sized frame that swaps screens. Single bright daytime look, committed on purpose. */
:root {
  color-scheme: light;
  --sky: #CFE8FF;          /* page ground, daytime city sky */
  --paper: #FFFFFF;
  --ink: #1D2340;          /* text, deep navy */
  --ink-soft: #5A6285;
  --line: #DCE3F2;
  --earn: #1FA35B;         /* green badge: you get this */
  --earn-soft: #DDF5E7;
  --spend: #F2701D;        /* orange badge: this costs */
  --spend-soft: #FFE6D5;
  --free: #5B7CFA;         /* blue badge: free to enjoy */
  --free-soft: #E3E9FF;
  --gem: #7A4DFF;          /* spendable currency */
  --star: #F5B700;         /* public score */
  --wrong: #E5484D;
  --wrong-soft: #FFE1E2;
  --admin: #2B3350;
  --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Lexend", "Segoe UI", system-ui, sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--sky); color: var(--ink); }
body { font-family: var(--body); font-size: 15px; line-height: 1.5; padding-inline: 16px; padding-block: 20px 48px; margin: 0; min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gem); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; text-wrap: balance; margin: 0; }

/* ---------- device frame ---------- */
.device { max-width: 1120px; margin: 0 auto; background: var(--paper); border-radius: 28px; border: 3px solid var(--ink); overflow: hidden; box-shadow: 0 10px 0 var(--ink); position: relative; }
.screen { min-height: 560px; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.me { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 20px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--paper); flex: none; }
.home-btn { border: 0; background: var(--sky); border-radius: 14px; padding: 8px 14px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.wallet { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.spendable { display: flex; align-items: center; gap: 8px; background: #F1EBFF; border: 2.5px solid var(--gem); border-radius: 18px; padding: 4px 14px 4px 8px; }
.spendable .num { font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--gem); font-variant-numeric: tabular-nums; line-height: 1; }
.spendable .lbl, .score .lbl { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); line-height: 1.1; }
.score { display: flex; align-items: center; gap: 6px; padding: 2px 4px; }
.score .num { font-family: var(--display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1; }
.timeleft { white-space: nowrap; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.25); } }
.dip { animation: dip .5s ease; }
@keyframes dip { 30% { transform: translateY(4px) scale(.92); color: var(--wrong); } }

/* home */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; padding: 20px; }
.hello { font-size: 30px; font-weight: 800; }
.hello-sub { color: var(--ink-soft); margin: 2px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.tile { border: 0; padding: 0; background: none; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.cover { position: relative; aspect-ratio: 3 / 4; max-width: 100%; border-radius: 16px; overflow: hidden; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; color: var(--paper); }
.tile:hover .cover, .tile:focus-visible .cover { transform: translateY(-4px); box-shadow: 0 9px 0 var(--ink); }
.cover.wide { aspect-ratio: 16 / 10; }
.cover .art { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; padding-bottom: 34px; }
.cover .ctitle { position: relative; font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.cover .bar { position: relative; height: 7px; background: rgba(255,255,255,.4); border-radius: 9px; margin-top: 8px; overflow: hidden; }
.cover .bar i { display: block; height: 100%; background: var(--paper); border-radius: 9px; }
.badge { position: absolute; top: 8px; right: 8px; z-index: 2; font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1; padding: 6px 10px 4px; border-radius: 999px; border: 2.5px solid var(--ink); font-variant-numeric: tabular-nums; }
.badge.earn { background: var(--earn); color: var(--paper); }
.badge.spend { background: var(--spend); color: var(--paper); }
.badge.free { background: var(--free); color: var(--paper); }
.service { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 8px; }
.tile .sub { font-size: 12.5px; color: var(--ink-soft); padding-left: 2px; }

/* leaderboard */
.board { align-self: start; border: 2.5px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.board h3 { font-size: 20px; padding: 10px 14px; background: var(--star); display: flex; align-items: center; gap: 8px; }
.board ol { list-style: none; margin: 0; padding: 6px 8px 8px; }
.board li { display: grid; grid-template-columns: 22px 30px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 7px 6px; border-radius: 12px; }
.board li.you { background: #FFF6D6; outline: 2px solid var(--star); }
.board .rank { font-family: var(--display); font-weight: 800; color: var(--ink-soft); }
.board .av { width: 30px; height: 30px; font-size: 14px; }
.board .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .pts { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.board .vel { display: block; font-size: 11.5px; font-weight: 500; }
.vel.up { color: var(--earn); } .vel.down { color: var(--wrong); }
.board .foot { font-size: 11.5px; color: var(--ink-soft); padding: 0 14px 12px; }
.legend { margin-top: 16px; display: grid; gap: 8px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 10px; }
.legend .badge { position: static; font-size: 15px; padding: 4px 9px 2px; min-width: 46px; text-align: center; }

/* quiz */
.quiz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 22px; }
.passage { background: #FFFBF0; border: 2px solid #F0E3BF; border-radius: var(--r); padding: 20px 22px; font-size: 17px; line-height: 1.75; }
.passage h2 { font-size: 28px; margin-bottom: 8px; }
.passage p { margin: 0 0 12px; max-width: 60ch; }
.qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); border: 2px solid var(--ink); }
.dots i.ok { background: var(--earn); } .dots i.bad { background: var(--wrong); } .dots i.now { background: var(--star); }
.worth { margin-left: auto; font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.question { font-family: var(--display); font-weight: 700; font-size: 27px; line-height: 1.2; display: flex; gap: 10px; align-items: flex-start; }
.speak { flex: none; border: 2px solid var(--ink); background: var(--sky); border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; }
.choices { display: grid; gap: 12px; margin-top: 18px; }
.choice { border: 3px solid var(--ink); background: var(--paper); border-radius: 18px; padding: 14px 18px; font-size: 18px; font-weight: 500; text-align: left; box-shadow: 0 5px 0 var(--ink); transition: transform .1s ease, box-shadow .1s ease, background .2s ease; display: flex; align-items: center; gap: 14px; }
.choice:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.choice:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.choice .key { width: 34px; height: 34px; border-radius: 10px; background: var(--sky); display: grid; place-items: center; font-family: var(--display); font-weight: 800; flex: none; }
.choice.right { background: var(--earn-soft); border-color: var(--earn); box-shadow: 0 5px 0 var(--earn); }
.choice.right .key { background: var(--earn); color: #fff; }
.choice.wrong { background: var(--wrong-soft); border-color: var(--wrong); box-shadow: 0 5px 0 var(--wrong); animation: shake .4s ease; }
.choice.wrong .key { background: var(--wrong); color: #fff; }
.choice:disabled { cursor: default; }
@keyframes shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.feedback { min-height: 64px; margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cheer { font-family: var(--display); font-weight: 800; font-size: 26px; }
.cheer.ok { color: var(--earn); } .cheer.bad { color: var(--wrong); }
.next { margin-left: auto; border: 3px solid var(--ink); background: var(--star); border-radius: 16px; padding: 10px 22px; font-family: var(--display); font-weight: 800; font-size: 20px; box-shadow: 0 5px 0 var(--ink); }
.done { text-align: center; padding: 30px 10px; display: grid; gap: 12px; justify-items: center; }
.done h2 { font-size: 40px; }
.done .big { font-family: var(--display); font-weight: 800; font-size: 54px; color: var(--gem); display: flex; align-items: center; gap: 10px; }

/* flying gems */
.fly { position: fixed; z-index: 50; pointer-events: none; width: 26px; height: 26px; }
.float { position: fixed; z-index: 51; pointer-events: none; font-family: var(--display); font-weight: 800; font-size: 30px; text-shadow: 0 2px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff; }

/* reader */
.reader { padding: 22px; display: grid; gap: 16px; justify-items: center; }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 720px; }
.panel { aspect-ratio: 4 / 3; border: 3px solid var(--ink); border-radius: 10px; position: relative; display: grid; place-items: center; font-size: 56px; overflow: hidden; }
.panel .speech { position: absolute; left: 10px; top: 10px; right: 30%; background: #fff; border: 2px solid var(--ink); border-radius: 14px; font-family: var(--display); font-weight: 700; font-size: 15px; padding: 6px 10px; line-height: 1.2; }
.pager { display: flex; gap: 12px; align-items: center; }
.pager button { border: 3px solid var(--ink); background: var(--paper); border-radius: 14px; padding: 8px 18px; font-family: var(--display); font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 var(--ink); }

/* video */
.video { padding: 22px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; }
.player { aspect-ratio: 16 / 9; background: #10142A; border-radius: var(--r); position: relative; display: grid; place-items: center; overflow: hidden; border: 3px solid var(--ink); }
.player .play { width: 84px; height: 84px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; border: 0; }
.player .scrub { position: absolute; left: 16px; right: 16px; bottom: 16px; height: 8px; border-radius: 8px; background: rgba(255,255,255,.25); }
.player .scrub i { display: block; width: 22%; height: 100%; background: var(--spend); border-radius: 8px; }
.player .tag { position: absolute; top: 14px; left: 14px; color: #fff; font-size: 13px; background: rgba(255,255,255,.12); padding: 3px 10px; border-radius: 8px; }
.side { display: grid; gap: 14px; align-content: start; }
.side h2 { font-size: 30px; }
.upnext { font-size: 15px; color: var(--ink-soft); margin: 0; }
.room { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.room button { border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); padding: 10px; text-align: left; font-size: 13px; line-height: 1.3; }
.room button b { display: block; font-family: var(--display); font-size: 17px; }
.room button[aria-pressed="true"] { background: var(--spend-soft); border-color: var(--spend); }
.cost { display: flex; align-items: center; gap: 10px; font-size: 14px; background: var(--spend-soft); border-radius: 14px; padding: 10px 12px; }

/* music */
.music { padding: 22px; display: grid; gap: 18px; }
.music .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.music .cover { aspect-ratio: 1; }
.nowplaying { display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--paper); border-radius: var(--r); padding: 12px 16px; flex-wrap: wrap; }
.eq { display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.eq i { width: 5px; background: var(--star); border-radius: 3px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%,100% { height: 6px; } 50% { height: 26px; } }
.nowplaying .t { font-family: var(--display); font-weight: 700; font-size: 18px; }
.nowplaying .s { font-size: 12.5px; opacity: .75; }
.nowplaying .who { margin-left: auto; font-size: 12.5px; opacity: .8; }

/* sign in */
.signin { padding: 30px 22px; display: grid; gap: 22px; justify-items: center; text-align: center; }
.signin h2 { font-size: 40px; }
.kids { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.kid-wrap { position: relative; }
.kid { border: 0; background: none; display: grid; gap: 6px; justify-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); padding: 4px; width: 112px; }
.kid .kname { line-height: 1.1; overflow-wrap: anywhere; }
.kid small { font-family: var(--body); font-weight: 500; font-size: 11.5px; color: var(--ink-soft); margin-top: -4px; }
.kid .avatar { width: 84px; height: 84px; font-size: 38px; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); transition: transform .12s ease, box-shadow .12s ease; }
.kid:hover .avatar { transform: translateY(-3px); box-shadow: 0 8px 0 var(--ink); }
.kid:active .avatar { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.kid[aria-pressed="true"] .avatar { outline: 5px solid var(--star); outline-offset: 3px; }
.kid.grown .avatar { border-radius: 24px; }
.kid.add .avatar.plus { background: var(--sky); color: var(--ink); border-style: dashed; box-shadow: none; font-size: 50px; font-weight: 800; padding-bottom: 4px; }
.kid.add:hover .avatar.plus { background: #B8DCFF; box-shadow: none; }
/* Remove-from-this-device button: on the picked profile (works on tablets), and on hover with a mouse. */
.forget { position: absolute; top: -2px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--ink); background: var(--wrong); color: var(--paper); font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; display: grid; place-items: center; padding: 0 0 2px; opacity: 0; transform: scale(.6); pointer-events: none; transition: opacity .12s ease, transform .12s ease; }
.kid-wrap:has(.kid[aria-pressed="true"]) .forget { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) { .kid-wrap:hover .forget, .forget:focus-visible { opacity: 1; transform: none; pointer-events: auto; } }
.pin-ask { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 0 0 -8px; }
.back-pill { border: 2.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 6px 18px; font-family: var(--display); font-weight: 700; font-size: 17px; box-shadow: 0 3px 0 var(--ink); }
.signin .hint { color: var(--ink-soft); }
.pad button.go { background: var(--earn); color: var(--paper); }
.pin { display: flex; gap: 10px; }
.pin i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); }
.pin i.on { background: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.pad button { height: 64px; border: 3px solid var(--ink); border-radius: 18px; background: var(--paper); font-family: var(--display); font-weight: 800; font-size: 28px; box-shadow: 0 4px 0 var(--ink); }

/* modal */
.scrim { position: absolute; inset: 0; background: rgba(29,35,64,.55); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { background: var(--paper); border: 3px solid var(--ink); border-radius: 24px; padding: 24px; max-width: 460px; width: 100%; text-align: center; display: grid; gap: 14px; box-shadow: 0 8px 0 var(--ink); }
.modal h2 { font-size: 32px; }
.boost { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.boost div { border: 2.5px solid var(--line); border-radius: 16px; padding: 12px 6px; display: grid; gap: 4px; justify-items: center; }
.boost .kind { font-size: 13px; color: var(--ink-soft); }
.boost .nums { font-family: var(--display); font-weight: 800; font-size: 28px; display: flex; align-items: center; gap: 8px; }
.boost .old { color: var(--ink-soft); text-decoration: line-through; font-size: 22px; }
.boost .new { color: var(--earn); }
.modal .go { border: 3px solid var(--ink); border-radius: 16px; background: var(--earn); color: #fff; font-family: var(--display); font-weight: 800; font-size: 21px; padding: 10px; box-shadow: 0 5px 0 var(--ink); }
.modal .go:disabled { background: var(--line); color: var(--ink-soft); cursor: wait; }

/* admin */
.admin { background: #F4F6FB; padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; font-size: 14px; }
.admin .card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.admin h2 { font-family: var(--body); font-weight: 600; font-size: 17px; }
.admin label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-soft); }
.admin input, .admin select { font: inherit; color: var(--ink); border: 1px solid #C5CDE0; border-radius: 9px; padding: 8px 10px; background: var(--paper); }
.admin .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin .primary { border: 0; background: var(--admin); color: #fff; border-radius: 9px; padding: 10px; font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 74px minmax(0,1fr) auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); align-items: baseline; }
.feed .when { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed .what { min-width: 0; }
.feed .what small { display: block; color: var(--ink-soft); font-size: 12px; }
.feed .amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.amt.plus { color: var(--earn); } .amt.minus { color: var(--wrong); } .amt.spendonly { color: var(--spend); }
.chip { display: inline-block; font-size: 11px; border-radius: 6px; padding: 1px 6px; margin-right: 4px; font-weight: 500; }
.chip.award { background: #EEE7FF; color: var(--gem); }
.chip.q { background: var(--earn-soft); color: #137a42; }
.chip.w { background: var(--wrong-soft); color: #b3262b; }
.chip.s { background: var(--spend-soft); color: #b04b0c; }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.totals div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.totals b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.totals span { font-size: 12px; color: var(--ink-soft); }
.values { display: grid; gap: 6px; }
.values div { display: grid; grid-template-columns: minmax(0,1fr) 70px; gap: 10px; align-items: center; }
.toast { background: var(--earn-soft); color: #137a42; border-radius: 9px; padding: 8px 10px; font-size: 13px; }

@media (max-width: 860px) {
  .home, .quiz, .video, .admin { grid-template-columns: minmax(0, 1fr); }
  .board { order: -1; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .question { font-size: 22px; }
  .spendable .num { font-size: 24px; }
  .wallet { margin-left: 0; }
  .pad { grid-template-columns: repeat(3, 64px); }
  .room, .boost { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- v3 additions ---------- */
.cover .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0) 55%); }
.cover.has-photo .ctitle, .cover.has-photo .bar { z-index: 1; }
.cover .letters { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 40px; font-family: var(--display); font-weight: 800; font-size: 64px; color: rgba(255,255,255,.35); letter-spacing: -.02em; }
.page { padding: 20px; display: grid; gap: 16px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 32px; font-weight: 800; }
.back { color: var(--ink); text-decoration: none; display: inline-block; border: 2.5px solid var(--ink); background: var(--paper); border-radius: 14px; padding: 6px 14px; font-family: var(--display); font-weight: 700; font-size: 16px; box-shadow: 0 3px 0 var(--ink); }
.empty { color: var(--ink-soft); padding: 30px 0; text-align: center; }
.error-box { background: var(--wrong-soft); color: #9b1c21; border-radius: 14px; padding: 12px 14px; }
.ytframe { width: 100%; aspect-ratio: 16 / 9; border: 3px solid var(--ink); border-radius: var(--r); background: #10142A; }
.passage h1, .passage h3 { font-family: var(--display); margin: 12px 0 6px; }
.player video, .player audio { width: 100%; height: 100%; background: #10142A; }
.music-player { display: grid; gap: 12px; }
.music-player audio { width: 100%; }
.kid-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--paper); border-radius: 18px; padding: 12px 20px; font-family: var(--display); font-weight: 700; font-size: 19px; box-shadow: 0 6px 0 rgba(0,0,0,.25); max-width: calc(100% - 32px); text-align: center; }
.signin form { display: grid; gap: 10px; width: min(320px, 100%); text-align: left; }
.signin input { font: inherit; border: 2.5px solid var(--ink); border-radius: 12px; padding: 10px 12px; }
.linkish { border: 0; background: none; color: var(--ink-soft); text-decoration: underline; font-size: 13px; }
.signin .go-btn { border: 3px solid var(--ink); background: var(--star); border-radius: 14px; padding: 10px; font-family: var(--display); font-weight: 800; font-size: 19px; box-shadow: 0 4px 0 var(--ink); }
.admin { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.admin table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin th, .admin td { text-align: left; padding: 6px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin th { font-weight: 600; color: var(--ink-soft); font-size: 12px; border-top: 0; }
.admin td.num, .admin th.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin tr.sel { background: #EEF2FF; }
.admin tr[data-student] { cursor: pointer; }
.admin .scroll { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.admin .mini { border: 1px solid #C5CDE0; background: var(--paper); border-radius: 7px; padding: 3px 8px; font-size: 12px; }
.admin input.small { width: 70px; padding: 4px 6px; }
.admin .wide { grid-column: 1 / -1; }
.admin .hint { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.admin-top { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: #F4F6FB; }
.admin-top h1 { font-family: var(--body); font-weight: 600; font-size: 18px; }
.admin-top .spacer { flex: 1; }
.toast.err { background: var(--wrong-soft); color: #9b1c21; }

/* "Already done": finished covers, chapters and episodes, folded away at the bottom */
.done-box { margin-top: 26px; border-top: 2px dashed var(--line); padding-top: 16px; }
.done-box summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; border: 2.5px solid var(--ink); background: var(--earn-soft); border-radius: 999px; padding: 8px 18px 8px 8px; font-family: var(--display); font-weight: 800; font-size: 20px; box-shadow: 0 4px 0 var(--ink); user-select: none; }
.done-box summary::-webkit-details-marker { display: none; }
.done-box summary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.done-box summary:focus-visible { outline: 3px solid var(--gem); outline-offset: 2px; }
.done-box .tick { width: 32px; height: 32px; border-radius: 50%; background: var(--earn); color: var(--paper); display: grid; place-items: center; font-size: 18px; }
.done-box .count { background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 0 10px; font-size: 16px; font-variant-numeric: tabular-nums; }
.done-box .chev { width: 10px; height: 10px; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease; }
.done-box[open] .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.done-box > .grid { margin-top: 18px; }
.done-box .tile { opacity: .8; }
.done-box .tile:hover, .done-box .tile:focus-visible { opacity: 1; }
