/* Elemath Academy: the look. Palette version 4, tuned (art/palette-v4.json; the owner's final palette, 2026-11-21): a daylight sky behind
   parchment panels with ink outlines and text, wood and slate frames, and the eight element colors for houses, spells, and art.
   Every color the stylesheets use is named here (the Bio Card, class panel, question, and world sheets read these names too).
   Text keeps 4.5:1 contrast or more on parchment; lines and icons 3:1. */
:root {
  --sky1: #cfe6f5; --sky2: #eef6e9;                                  /* the page behind everything */
  --bg: #eef6e9; --bg2: #f3e7c9; --card: #fbf4e2; --well: #fffaf0;   /* parchment: panels, deeper panels, cards, wells (inputs) */
  --track: #e6d8b4; --line: #d9c49a; --edge: #8a7f92;                /* bar tracks; decorative edges; control edges (3:1) */
  --ink: #2b2233; --dim: #5a4e63; --faint: #665b70;                  /* text: 13.9, 7.1, 5.8 to 1 on parchment */
  --wood: #8a5a34; --slate: #3d4a5c; --hi: #8a5a34;                  /* frames; --hi: hover, focus, chosen (5.3 to 1) */
  --gold: #fcda7c; --goldink: #7a5e02;                               /* reward gold for fills; gold for text (5.6 to 1) */
  --go: #429f02; --goink: #2e6e05; --bad: #8c3441; --mana: #010085;  /* signals (18 apart for every kind of color vision) */
  --right-bg: #dbfed0; --wrong-bg: #e79da5;                          /* answer and feedback backgrounds (18.7 apart, total color blindness included) */
  --tint-gold: #fbe6b8; --tint-blue: #d6e4fb; --tint-green: #d7efc8; --tint-rose: #f6d3d9;
  --glass: rgba(251, 244, 226, .86); --glass-edge: rgba(43, 34, 51, .35); --veil: rgba(43, 34, 51, .55);
  --shade: rgba(43, 34, 51, .16); --shade2: rgba(43, 34, 51, .28);
  --sc: #3d4a5c;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: linear-gradient(180deg, var(--sky1), var(--sky2)) fixed var(--bg); color: var(--ink); font-family: 'Andika', system-ui, -apple-system, 'Segoe UI', sans-serif; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .btn, .tile b, .rg-name { font-family: 'Fredoka', 'Andika', system-ui, sans-serif; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.2rem; margin: 18px 0 8px; } h3 { font-size: 1rem; margin: 12px 0 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--hi); outline-offset: 2px; }
small { color: var(--dim); font-size: .82rem; }
.center { text-align: center; } .note { color: var(--dim); font-size: .9rem; margin: 8px 0; } .note.warn { background: var(--tint-gold); border: 1px solid var(--wood); color: var(--ink); padding: 10px 12px; border-radius: 10px; }
.fine { color: var(--dim); font-size: .8rem; margin-top: 26px; } .eyebrow { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
.link { background: none; border: 0; color: var(--wood); text-decoration: underline; padding: 2px 4px; }
.btn { background: var(--card); border: 2px solid var(--edge); color: var(--ink); border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 1rem; min-height: 44px; }
.btn:hover:not(:disabled) { border-color: var(--hi); } .btn:disabled { opacity: .45; cursor: default; }
.btn.go { background: var(--go); border-color: var(--goink); color: var(--ink); } .btn.sm { padding: 6px 14px; font-size: .88rem; min-height: 36px; } .btn.danger { background: var(--wrong-bg); border-color: var(--bad); }
.btn.pulse { border-color: var(--hi); box-shadow: 0 0 0 0 rgba(138, 90, 52, .55); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(138, 90, 52, 0); } 100% { box-shadow: 0 0 0 0 rgba(138, 90, 52, 0); } }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9rem; margin: 10px 0; flex: 1 1 180px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; margin: 6px 0; flex: none; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { background: var(--well); border: 2px solid var(--edge); border-radius: 10px; padding: 9px 12px; min-height: 42px; width: 100%; }
input[type=color] { width: 46px; height: 40px; border: 2px solid var(--edge); border-radius: 8px; background: none; padding: 2px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--go); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 10px 0; } legend { font-weight: 800; padding: 0 6px; }
.st { color: var(--edge); } .st.on { color: var(--goldink); }
.bar, .hpbar { height: 10px; background: var(--track); border-radius: 999px; overflow: hidden; border: 1px solid var(--edge); } .bar i, .hpbar i { display: block; height: 100%; background: var(--goldink); border-radius: 999px; transition: width .4s; }

/* home, setup */
.home, .setup, .desk, .result { max-width: 860px; margin: 0 auto; padding: 22px 16px 60px; }
.brand { text-align: center; padding: 14px 0 8px; } .brand h1 { font-size: 2.3rem; color: var(--wood); letter-spacing: .01em; } .tag { color: var(--dim); }
.who { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: .92rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile { display: flex; gap: 12px; align-items: center; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 84px; }
.tile:hover { border-color: var(--hi); } .tile b { display: block; font-size: 1.05rem; } .t-ico { flex: none; width: 56px; text-align: center; line-height: 0; } .t-ico.big { font-size: 2.2rem; line-height: 1; }
.gbtn { min-height: 44px; } .loading { text-align: center; padding: 80px 0; color: var(--dim); }
.houses { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.house { background: var(--card); border: 3px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.house.on { border-color: var(--hc); background: color-mix(in srgb, var(--hc) 22%, var(--card)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hc) 40%, transparent); }
.myhouse { display: flex; gap: 12px; align-items: center; background: var(--bg2); border-radius: 12px; padding: 12px; margin: 10px 0; }

/* map */
.mapscreen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.hud { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--bg2); border-bottom: 2px solid var(--line); }
.hud-me { display: flex; gap: 8px; align-items: center; } .hud-me small, .hud-lv small { display: block; }
.hud-lv { flex: 1 1 150px; max-width: 260px; } .hud-n { display: flex; gap: 12px; font-weight: 800; color: var(--goldink); } .hud-b { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; padding: 6px 12px; overflow-x: auto; } .chip { background: color-mix(in srgb, var(--c) 22%, var(--card)); border: 2px solid var(--c); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .82rem; white-space: nowrap; }
.mapwrap { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; } .map { display: block; margin: 0 auto; width: max(1100px, min(100%, 1500px)); height: auto; }
.rg-name { font-size: 26px; font-weight: 700; paint-order: stroke; stroke: var(--card); stroke-width: 5px; stroke-linejoin: round; } .rg-sub { font-size: 14px; fill: var(--ink); font-weight: 700; paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }      /* a parchment outline keeps the words readable on any painted region */
.node { cursor: pointer; } .node:hover circle, .node:hover > path, .node:focus circle { filter: brightness(1.25); } .node.locked text { opacity: .6; } .node:focus { outline: none; } .node:focus-visible circle, .node:focus-visible > path { stroke: var(--hi); stroke-width: 5; }
.nd-num { font: 700 20px 'Fredoka', sans-serif; fill: #fff; paint-order: stroke; stroke: var(--ink); stroke-width: 3px; pointer-events: none; } .nd-num.on { fill: var(--ink); stroke: #fff; } .nd-flag { font: 800 14px sans-serif; fill: #fff; paint-order: stroke; stroke: var(--ink); stroke-width: 3px; } .nd-st { font-size: 13px; letter-spacing: 1px; } .nd-t { font-size: 11.5px; fill: var(--ink); font-weight: 700; paint-order: stroke; stroke: var(--card); stroke-width: 3px; } .nd-t.big { font-size: 15px; fill: var(--goldink); }

/* sheet, toast */
.sheet { position: fixed; inset: 0; background: var(--veil); display: flex; align-items: center; justify-content: center; padding: 14px; z-index: 20; }
.sheet-card { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 20px; width: min(560px, 100%); max-height: 92vh; overflow: auto; position: relative; }
.sheet-card h2 { margin-top: 0; padding-right: 34px; } .x { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--card); font-size: 1.3rem; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--card); color: var(--ink); border: 2px solid var(--hi); box-shadow: 0 6px 18px var(--shade2); padding: 10px 18px; border-radius: 999px; z-index: 30; max-width: 92vw; text-align: center; }
.tiers { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; } .tier, .quest { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tier small, .quest small { display: block; } .tier.won { border-color: var(--hi); } .quest { margin: 8px 0; } .score { color: var(--goldink); }
.badge { font-size: .7rem; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--bg2); color: var(--ink); border: 1px solid var(--line); } .badge.test { background: var(--tint-rose); } .badge.assignment { background: var(--tint-blue); } .badge.practice { background: var(--tint-green); }

/* battle */
.battle { max-width: 760px; margin: 0 auto; padding: 10px 12px 40px; }
.b-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; } .b-title { font-weight: 800; text-align: center; color: var(--sc); } .b-count { font-size: .85rem; color: var(--dim); white-space: nowrap; }
.arena { display: flex; align-items: end; justify-content: space-around; padding: 8px 0 4px; min-height: 150px; }
.fighter { text-align: center; width: 150px; } .fighter svg { max-height: 130px; width: auto; } .hpbar { margin: 4px 10px; } .hpbar i { background: var(--go); } .hpbar.foe i { background: var(--bad); }
.fighter.hit svg { animation: hit .5s; } .fighter.cast svg { animation: cast .45s; }
@keyframes hit { 20% { transform: translateX(-8px) rotate(-4deg); filter: brightness(2.2); } 50% { transform: translateX(7px) rotate(3deg); } }
@keyframes cast { 40% { transform: translateY(-10px) scale(1.06); } }
@keyframes qvflash { to { visibility: hidden; } }      /* a picture shown at a glance (starglyph-qview.css .qv-flash) */
.bolt { font-size: 2.2rem; color: var(--goldink); opacity: 0; align-self: center; } .bolt.go { animation: bolt .55s; }
@keyframes bolt { 0% { opacity: 1; transform: translateX(-90px) scale(.6); } 80% { opacity: 1; transform: translateX(90px) scale(1.5); } 100% { opacity: 0; transform: translateX(100px) scale(2); } }
.pw { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; font-weight: 800; font-size: .88rem; color: var(--goldink); } .pw.calm { justify-content: center; color: var(--dim); }
.pw-track { flex: 1; height: 14px; background: var(--track); border: 1px solid var(--edge); border-radius: 999px; overflow: hidden; } .pw-track i { display: block; height: 100%; background: linear-gradient(90deg, #fa662d, #e8a917, #c99a00); border-radius: 999px; }
.qcard { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; }
.qprompt { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; } .qvis { text-align: center; margin: 6px 0 14px; overflow-x: auto; }
.opts { display: grid; gap: 8px; } .opts.grid { grid-template-columns: 1fr 1fr; }
.opt { background: var(--well); border: 2px solid var(--edge); border-radius: 12px; padding: 12px 14px; font-size: 1.1rem; font-weight: 700; min-height: 52px; text-align: center; }
.opt:hover:not(:disabled) { border-color: var(--hi); } .opt.on { border-color: var(--hi); background: var(--tint-gold); } .opt.right { border-color: var(--go); background: #dbfed0; } .opt.wrong { border-color: var(--bad); background: #e79da5; } .opt:disabled { cursor: default; }
.opt.tog::before { content: '☐ '; } .opt.tog.on::before { content: '☑ '; }
.cmp { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; } .side { font-size: 1.3rem; font-weight: 800; background: var(--card); border-radius: 12px; padding: 12px 16px; max-width: 40%; text-align: center; } .syms { display: flex; gap: 6px; } .sym { min-width: 56px; font-size: 1.5rem; }
.entry { display: flex; align-items: center; justify-content: center; gap: 10px; } .entry input { width: 190px !important; font-size: 1.5rem; text-align: center; font-weight: 800; }
.entry.frac span { display: inline-flex; flex-direction: column; gap: 4px; align-items: center; } .entry.frac input { width: 110px !important; } .entry.frac i { display: block; height: 3px; width: 120px; background: var(--ink); border-radius: 2px; }
.cast { display: block; margin: 14px auto 0; min-width: 200px; }
.ord .slots, .ord .pool { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 58px; padding: 6px; } .ord .slots { border: 2px dashed var(--line); border-radius: 12px; margin-bottom: 8px; align-items: center; } .ph { color: var(--dim); }
.hint { background: var(--bg2); border-left: 4px solid var(--hi); padding: 8px 12px; border-radius: 8px; margin-top: 12px; }
.fb { padding: 10px 14px; border-radius: 12px; margin-top: 12px; } .fb.good { background: #dbfed0; border: 1px solid var(--go); } .fb.bad { background: #e79da5; border: 1px solid var(--bad); }
.qfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; min-height: 44px; }
.vis { max-width: 100%; height: auto; } .vt { font: 700 13px 'Andika', sans-serif; fill: var(--ink); } .vl { font: 600 11px 'Andika', sans-serif; fill: var(--dim); } .vg { stroke: var(--line); stroke-width: 1; } .vax { stroke: var(--ink); stroke-width: 2; }
.vb { fill: #a1b2fe; stroke: var(--ink); stroke-width: 1.5; } .ve { fill: var(--well); stroke: var(--ink); stroke-width: 1.5; } .vm { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; } .vd { stroke: var(--goldink); stroke-width: 2; stroke-dasharray: 4 3; } .vstar { fill: var(--gold); stroke: var(--goldink); stroke-width: 1.2; }
.vclock { fill: var(--well); stroke: var(--ink); stroke-width: 3; } .vhand { stroke: var(--wood); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; } .vhand.h { stroke: var(--ink); stroke-width: 6; } .vdot { fill: var(--ink); } .vpt { fill: var(--gold); stroke: var(--ink); } .vp { fill: var(--goldink); font-size: 15px; }
.vtable { margin: 0 auto; border-collapse: collapse; } .vtable caption { font-weight: 800; padding-bottom: 6px; } .vtable th, .vtable td { border: 2px solid var(--line); padding: 6px 16px; font-size: 1.1rem; text-align: center; } .vtable th { background: var(--bg2); } .vtable td.q { color: var(--goldink); font-weight: 800; }

/* result */
.result { text-align: center; } .result h1 { font-size: 2.2rem; color: var(--wood); margin: 10px 0; } .result.lost h1 { color: var(--dim); } .result .big { font-size: 1.4rem; font-weight: 800; } .gain { color: var(--goldink); font-weight: 800; margin: 8px 0; } .levelup { background: var(--tint-gold); border: 2px solid var(--hi); border-radius: 12px; padding: 10px; margin: 10px auto; max-width: 420px; font-weight: 800; } .result .row { justify-content: center; }

/* teacher's desk */
.d-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; } .d-top h1 small { font-size: .9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; } .card { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 14px; text-align: left; } .card:hover { border-color: var(--hi); } .card b { display: block; font-size: 1.1rem; }
.newcls, .asg, .addstu { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 14px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); overflow-x: auto; } .tab { background: none; border: 0; padding: 10px 14px; font-weight: 800; color: var(--dim); border-bottom: 3px solid transparent; white-space: nowrap; } .tab.on { color: var(--wood); border-color: var(--wood); }
#d-body { padding-top: 12px; } .tablewrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: .9rem; } .grid th, .grid td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; } .grid th { color: var(--dim); font-size: .8rem; } .grid input, .grid select { min-height: 34px !important; padding: 4px 8px !important; min-width: 90px; } .grid tr.low td { background: var(--tint-rose); }
.hrow { display: flex; gap: 10px; align-items: center; margin: 8px 0; flex-wrap: wrap; } .hrow input:not([type=color]) { flex: 1 1 140px; width: auto !important; } .hrow select { width: 110px !important; }
.objpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; } .whopick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); padding-left: 28px; }
.hs { display: grid; grid-template-columns: 34px 120px 1fr 80px; gap: 8px; align-items: center; margin: 4px 0; }
@media (max-width: 560px) { .qprompt { font-size: 1.1rem; } .fighter { width: 120px; } .side { font-size: 1.05rem; padding: 10px; } .hud-lv { order: 5; max-width: none; flex-basis: 100%; } .hs { grid-template-columns: 34px 90px 1fr 70px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* version 0.2: joining, gems, the Elemental Cup, logos, read-aloud, reports, printing */
.join { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 14px 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; } .join input { text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.sheet-card.wide { width: min(760px, 100%); }
.logo { border-radius: 10px; object-fit: contain; background: #fff; vertical-align: middle; }
.gems, .won-gems { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0; } .gem { display: inline-flex; flex-direction: column; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; min-width: 70px; } .gem b { font-size: .95rem; } .won-gems .gem { border-color: var(--gold); animation: cast .6s; }
.codes { font-size: .72rem; font-weight: 700; color: var(--goldink); background: var(--bg2); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.say { background: var(--card); border: 2px solid var(--hi); border-radius: 50%; width: 40px; height: 40px; font-size: 1.1rem; vertical-align: middle; }
.tabs.sm { margin: 6px 0 10px; } .tabs.sm .tab { padding: 6px 10px; font-size: .85rem; }
.grid tr.me td { background: var(--tint-gold); font-weight: 800; } .grid td .crest { vertical-align: middle; }
.hs small { grid-column: auto; } .hstand .hs { grid-template-columns: 34px minmax(90px, 150px) 1fr 90px; }
.upl { flex: none !important; margin: 0; background: var(--card); border: 2px solid var(--edge); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .82rem; } .upl input { display: none; }
code { font: 800 .95rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--goldink); }
.node.cup circle { filter: drop-shadow(0 0 10px rgba(255, 211, 77, .5)); }
#print-area { display: none; }


/* version 0.3: eight element houses and their spellbooks */
.house .el { color: var(--hs, var(--ink)); font-weight: 800; }      /* words take the house's dark shade (palette version 4): its color is too light for text */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 8px 0; }
.book { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; } .book.mine { border-color: var(--hc); } .book.done { box-shadow: inset 0 0 0 2px var(--goldink); } .book.shut { opacity: .55; }
.bk-top { display: flex; gap: 8px; align-items: center; } .bk-top small { display: block; }
.book ol { list-style: none; margin: 6px 0; } .book li { display: flex; justify-content: space-between; gap: 6px; font-size: .85rem; padding: 2px 0; color: var(--dim); } .book li.on { color: var(--ink); font-weight: 700; } .book li.on span::before { content: '✧ '; color: var(--hc); }
.bolt.r2 { font-size: 2.6rem; } .bolt.r3 { font-size: 3rem; } .bolt.r4 { font-size: 3.5rem; text-shadow: 0 0 14px currentColor; } .bolt.r5 { font-size: 4.2rem; text-shadow: 0 0 22px currentColor, 0 0 44px currentColor; }
.houses { grid-template-columns: repeat(4, 1fr); } @media (max-width: 640px) { .houses { grid-template-columns: repeat(2, 1fr); } }

/* version 0.4: a modern look (glass panels, light, depth), the battle scene, spell effects, and the forge */
body { background: linear-gradient(180deg, var(--sky1), var(--sky2)) fixed var(--bg); }
/* (the night theme's star field is gone with palette version 4) */
#app, .sheet, .toast { position: relative; z-index: 1; } .sheet { position: fixed; } .toast { position: fixed; }
h1 { letter-spacing: .01em; } .brand h1, .result h1, .setup h1, .d-top h1 { background: linear-gradient(180deg, #9a6a3a 10%, #8a5a34 55%, #5c3a1a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .7)); }
.brand h1 { font-size: 2.8rem; } .brand svg { filter: drop-shadow(0 6px 14px var(--shade2)); animation: bob 5s ease-in-out infinite; } @keyframes bob { 50% { transform: translateY(-6px); } }
.btn { background: linear-gradient(180deg, var(--well), var(--bg2)); border: 1.5px solid var(--edge); box-shadow: 0 2px 6px var(--shade), inset 0 1px 0 rgba(255, 255, 255, .8); transition: transform .12s, box-shadow .12s, border-color .12s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--hi); box-shadow: 0 6px 14px var(--shade2), 0 0 0 3px rgba(138, 90, 52, .16); } .btn:active:not(:disabled) { transform: translateY(1px); }
.btn.go { background: linear-gradient(180deg, #7cc84c, var(--go)); border-color: var(--goink); color: var(--ink); box-shadow: 0 4px 12px rgba(66, 159, 2, .3), inset 0 1px 0 rgba(255, 255, 255, .5); }
.tile, .card, .qcard, .sheet-card, .who, .newcls, .asg, .addstu, .join, .house, .tier, .quest, .book, .gem, .wcard { background: linear-gradient(160deg, var(--well), var(--card)); border: 1.5px solid var(--line); box-shadow: 0 6px 18px var(--shade), inset 0 1px 0 rgba(255, 255, 255, .8); }
.tile, .card, .house { transition: transform .15s, border-color .15s, box-shadow .15s; } .tile:hover, .card:hover, .house:hover { transform: translateY(-3px); border-color: var(--hi); box-shadow: 0 12px 26px var(--shade2); }
.house.on { box-shadow: 0 0 0 3px var(--hc), 0 0 34px color-mix(in srgb, var(--hc) 55%, transparent); transform: translateY(-3px); } .house .crest { filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--hc) 60%, transparent)); }
.sheet { background: var(--veil); } .sheet-card { border-radius: 22px; animation: pop .22s ease-out; } @keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.hud { background: linear-gradient(180deg, var(--card), var(--bg2)); border-bottom: 1px solid var(--line); box-shadow: 0 4px 14px var(--shade); }
.bar i, .hpbar i { box-shadow: 0 0 10px currentColor; } .bar i { background: linear-gradient(90deg, #9a6a00, var(--goldink)); }
.node.open circle, .node.open > path { filter: drop-shadow(0 0 8px rgba(255, 255, 255, .35)); } .node.open:not(.done) circle { filter: drop-shadow(0 0 12px rgba(255, 255, 255, .55)); }
.node.done circle { filter: drop-shadow(0 0 12px rgba(255, 211, 77, .8)); }

/* the battle scene */
.battle { max-width: 860px; }
.arena { position: relative; height: 270px; min-height: 0; padding: 0; margin: 8px 0 6px; border-radius: 22px; overflow: hidden; border: 1.5px solid rgba(150, 150, 175, .35); box-shadow: 0 16px 44px rgba(0, 0, 0, .55), inset 0 0 60px rgba(0, 0, 0, .35); display: block; isolation: isolate; }
.arena .scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.arena canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.arena::after { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: #fff; opacity: 0; transition: opacity .25s; } .arena.flash::after { opacity: .55; transition: none; }
.arena .fighter { position: absolute; bottom: 8px; z-index: 2; width: 190px; text-align: center; } .arena .fighter.me { left: 5%; } .arena .fighter.foe-side { right: 5%; }
.arena .fighter svg { max-height: 176px; width: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55)); } .arena .foe-side svg.foe { animation: hover 3.2s ease-in-out infinite; } @keyframes hover { 50% { transform: translateY(-7px); } }
.arena .fighter small { color: #fff; font-weight: 800; text-shadow: 0 1px 4px #000; } .arena .hpbar { height: 12px; margin: 4px 22px; border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .55); } .arena .hpbar i { transition: width .5s cubic-bezier(.2, .9, .3, 1); background: linear-gradient(90deg, var(--go), #8fd45a); } .arena .hpbar.foe i { background: linear-gradient(90deg, var(--bad), #d9707e); }
.arena .fighter.cast svg.wizard { animation: castpose .5s ease-out; transform-origin: 50% 90%; } @keyframes castpose { 25% { transform: rotate(-7deg) translateX(-6px); } 55% { transform: rotate(8deg) translateX(10px) scale(1.04); } }
.arena .fighter.hit svg { animation: hit .5s; } @keyframes hit { 15% { transform: translateX(10px) rotate(5deg); filter: brightness(3) saturate(0); } 45% { transform: translateX(-8px) rotate(-3deg); filter: brightness(1.4); } }
.dmg { position: absolute; left: 50%; top: 8%; transform: translateX(-50%); font: 700 2rem 'Fredoka', sans-serif; color: #fff; text-shadow: 0 0 10px var(--gold), 0 2px 0 #000; pointer-events: none; z-index: 5; animation: floatup 1.1s ease-out forwards; white-space: nowrap; } .dmg.bad { color: #ffd0d6; text-shadow: 0 0 10px #8c3441, 0 2px 0 #000; }
.dmg.r4, .dmg.r5 { font-size: 2.5rem; } .dmg.r6, .dmg.r7 { font-size: 3rem; } .dmg.r8 { font-size: 3.6rem; color: #fefc8f; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.25); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
.pw-track { height: 16px; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6); } .pw-track i { box-shadow: 0 0 14px #fcda7c; }
.qcard { border-radius: 22px; } .qprompt { font-size: 1.35rem; }
.opt { background: linear-gradient(180deg, var(--well), var(--card)); border: 1.5px solid var(--edge); box-shadow: 0 2px 6px var(--shade); transition: transform .1s, border-color .1s, box-shadow .1s; }
.opt:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px var(--shade2), 0 0 0 3px rgba(138, 90, 52, .18); } .opt.right { background: var(--right-bg); box-shadow: 0 0 0 2px var(--go); } .opt.wrong { background: var(--wrong-bg); }
.fb.good { background: var(--right-bg); } .levelup { box-shadow: 0 0 30px rgba(255, 211, 77, .25); }

/* the forge */
.ess { color: var(--goldink); } .forge { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.wcard { display: flex; gap: 10px; border-radius: 16px; padding: 10px; } .wcard.on { border-color: var(--hc); box-shadow: 0 0 0 2px var(--hc), 0 0 26px color-mix(in srgb, var(--hc) 45%, transparent); } .wcard.shut .w-art { filter: grayscale(.8) brightness(.7); }
.w-art { flex: none; width: 62px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--hc) 35%, transparent), transparent 70%); border-radius: 12px; }
.w-body { flex: 1; min-width: 0; } .w-body b { display: block; font-family: 'Fredoka', sans-serif; font-size: 1.05rem; } .w-body small { display: block; } .w-body .ench { color: var(--hs, var(--ink)); font-weight: 800; } .w-body .row { margin: 6px 0 0; align-items: center; gap: 6px; } .w-body select { width: auto !important; min-height: 34px !important; padding: 4px 8px !important; }
.books { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 560px) { .arena { height: 220px; } .arena .fighter { width: 140px; } .arena .fighter svg { max-height: 132px; } .arena .fighter.me { left: 0; } .arena .fighter.foe-side { right: 0; } .brand h1 { font-size: 2.1rem; } }

/* version 0.5: the near-black theme (owner, 2026-11-18), and the Guide Scroll */
/* (the near-black theme of version 0.5 was withdrawn by the owner on 2026-11-20; palette version 4 is a daylight look) */
.scroll { margin: 14px 0 4px; position: relative; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .6)); }
.scroll::before, .scroll::after { content: ''; position: absolute; left: -6px; right: -6px; height: 16px; border-radius: 10px; background: linear-gradient(180deg, #c99a52, #8a5e24 55%, #5c3c14); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); z-index: 1; }
.scroll::before { top: -6px; } .scroll::after { bottom: -6px; }
.scroll-in { position: relative; background: radial-gradient(120% 80% at 50% 0%, #fbf0d4, #ecd7a6 70%, #dcc08a); color: #3b2a12; border-radius: 4px; padding: 20px 20px 18px; border-left: 2px solid rgba(110, 76, 30, .35); border-right: 2px solid rgba(110, 76, 30, .35); }
.scroll-head { display: flex; align-items: center; gap: 10px; border-bottom: 1.5px dashed rgba(110, 76, 30, .45); padding-bottom: 8px; margin-bottom: 8px; }
.scroll-head > div { flex: 1; } .scroll-head small { color: #8a5e24; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; } .scroll-head h3 { margin: 0; font-family: 'Fredoka', sans-serif; font-size: 1.15rem; color: #3b2a12; }
.scroll-ico { font-size: 1.7rem; } .scroll .say { background: #fff7e0; border-color: #8a5e24; }
.scroll-steps { margin: 4px 0 10px 22px; } .scroll-steps li { margin: 5px 0; line-height: 1.45; padding-left: 4px; } .scroll-steps li::marker { color: #8a5e24; font-weight: 800; }
.scroll-ex { background: rgba(255, 255, 255, .45); border: 1.5px solid rgba(110, 76, 30, .3); border-radius: 10px; padding: 10px 12px; } .scroll-ex > b { color: #8a5e24; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; } .scroll-ex p { margin: 4px 0; }
.scroll-ex .qvis { background: var(--well); border-radius: 10px; padding: 8px; } .ex-cmp { font-weight: 800; font-size: 1.1rem; } .ex-cmp span { color: #8a5e24; padding: 0 6px; }
.ex-ch { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 6px 0; } .ex-ch li { background: #fff7e0; border: 1px solid rgba(110, 76, 30, .35); border-radius: 8px; padding: 3px 10px; font-weight: 700; }
.scroll details { margin-top: 6px; } .scroll summary { cursor: pointer; font-weight: 800; color: #6b4410; text-decoration: underline; min-height: 32px; display: flex; align-items: center; } .scroll details[open] summary { margin-bottom: 4px; }
.vt.big { font-size: 30px; } .vpoly { fill: rgba(252, 218, 124, .35); stroke: var(--goldink); stroke-width: 2.5; }

/* version 0.6: the Guide Scroll button, reports, crest picker, certificates, and printing with wide margins */
.scroll-btn { display: block; width: 100%; margin-top: 12px; background: linear-gradient(180deg, #f6e3b4, #d9b56c); color: #3b2a12; border-color: #8a5e24; font-size: 1.02rem; }
.scroll-btn:hover:not(:disabled) { border-color: #5c3c14; }
.scroll-btn.flash { animation: scrollflash 1.1s ease-in-out 5; box-shadow: 0 0 0 0 rgba(255, 211, 77, .7); }
@keyframes scrollflash { 50% { box-shadow: 0 0 0 8px rgba(255, 211, 77, 0), 0 0 26px rgba(255, 211, 77, .85); transform: scale(1.015); } }
.codes { display: inline-flex; flex-wrap: wrap; gap: 4px; background: none; padding: 0; } .codes > span { font-size: .72rem; font-weight: 700; color: var(--goldink); background: var(--bg2); border-radius: 6px; padding: 1px 6px; white-space: nowrap; } .codes > span.off { color: var(--dim); border: 1px dashed var(--edge); }
.repbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; } .repbar label { flex: 1 1 160px; } .rep-sum { flex: 1 1 300px; margin: 0; }
.grid.rep td { white-space: nowrap; } .grid.rep th { white-space: normal; vertical-align: bottom; line-height: 1.2; } #d-body { overflow-x: auto; } .grid.rep td small { display: inline; }
.grid select[data-k="school"], .grid select[data-k="house"] { min-width: 150px; } .grid select[data-k="grade"] { min-width: 110px; }
.crests { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; } .crestpick { background: var(--card); border: 2px solid var(--edge); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; } .crestpick.on, .crestpick:hover { border-color: var(--hi); }
.award-preview { margin-top: 14px; border-radius: 12px; overflow: hidden; } .award-preview .award { transform: scale(.62); transform-origin: top left; width: 10in; height: 7.2in; margin-bottom: calc(-7.2in * .38); }

/* the certificate: a white page, the house's colors, a medal, and room to sign */
.award { width: 10in; height: 7.2in; background: #fff; color: #1d1d28; box-sizing: border-box; padding: .22in; font-family: 'Andika', sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.aw-in { position: relative; height: 100%; box-sizing: border-box; border: 10px solid var(--hc); border-radius: 22px; outline: 3px solid #d9a441; outline-offset: -20px; display: flex; align-items: center; gap: .3in; padding: .35in .5in; background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--hc) 12%, #fff), #fff 55%), #fff; }
.aw-corner { position: absolute; font-size: 28px; color: #d9a441; } .aw-corner.tl { top: 20px; left: 26px; } .aw-corner.tr { top: 20px; right: 26px; } .aw-corner.bl { bottom: 20px; left: 26px; } .aw-corner.br { bottom: 20px; right: 26px; }
.aw-medal { flex: none; } .aw-text { flex: 1; text-align: center; min-width: 0; }
.aw-top { font: 700 15pt 'Fredoka', sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #8a6a10; margin: 0; }
.aw-title { font: 700 30pt 'Fredoka', sans-serif; color: var(--hs, var(--hc)); margin: 4px 0 8px; -webkit-text-stroke: .5px rgba(0, 0, 0, .25); }
.aw-pre { font-size: 13pt; color: #555; margin: 0; }
.award h1 { font: 700 40pt 'Fredoka', sans-serif !important; margin: 4px 0; color: #1d1d28 !important; background: none !important; -webkit-text-fill-color: #1d1d28; filter: none !important; border-bottom: 3px solid #d9a441; display: inline-block; padding: 0 .25in 4px; }
.aw-line { font-size: 15pt; margin: 10px auto 0; max-width: 90%; color: #333; }
.aw-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: .35in; }
.aw-sign { flex: 1; } .aw-sign span { display: block; border-bottom: 2px solid #1d1d28; font-size: 13pt; padding-bottom: 3px; min-height: 26px; } .aw-sign small { color: #555; font-size: 10pt; }
.aw-houses { display: flex; flex-direction: column; align-items: center; gap: 2px; } .aw-houses .crest, .aw-houses .logo { display: inline-block; } .aw-houses small { color: #555; font-size: 9pt; }
.slips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; } .slip { border: 1px dashed #666; padding: 14px 10px; text-align: center; break-inside: avoid; } .slip b { display: block; font-size: 13pt; } .slip span { font: 800 18pt ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; }

@media print {
  body.printing { background: #fff !important; color: #000; } body.printing::before { display: none; }
  body.printing #app > .desk > :not(#print-area), body.printing .sheet, body.printing .toast { display: none !important; } body.printing #print-area { display: block; } body.printing .desk { max-width: none; padding: 0; margin: 0; }
  #print-area h1 { font-size: 18pt; color: #000; background: none; -webkit-text-fill-color: #000; filter: none; } #print-area p, #print-area small { color: #000; }
  #print-area .grid { width: 100%; table-layout: auto; font-size: 9pt; } #print-area .grid th, #print-area .grid td { color: #000; border-bottom: 1px solid #999; white-space: normal; padding: 4px 5px; } #print-area .grid tr.low td { background: #fde3e3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } #print-area .link, #print-area button { display: none; }
  #print-area .codes > span { color: #000; background: none; border: 1px solid #999; }
  .awards .award { page: certificate; break-after: page; margin: 0 auto; }
  @page { size: letter portrait; margin: .75in; }
  @page certificate { size: letter landscape; margin: .4in; }
}

/* Exploring a region on foot, pets, elements, and the Surge (2026-11-19) */
.explore { max-width: 1240px; margin: 0 auto; padding: 10px 12px 30px; }
.ex-help { margin: 6px 0; }
.exwrap { overflow: auto; max-height: 70vh; border-radius: 18px; border: 1.5px solid var(--line); background: var(--bg2); -webkit-overflow-scrolling: touch; }
.exmap { display: block; max-width: none; height: auto; cursor: pointer; touch-action: manipulation; }
.ex-zone { fill: rgba(43, 34, 51, .78); font: 700 18px Fredoka, sans-serif; }
.ex-num { fill: #fff; font: 700 16px Fredoka, sans-serif; pointer-events: none; }
.ex-btn { fill: #1a1300; font: 700 14px Fredoka, sans-serif; pointer-events: none; }
.ex-mark, .ex-spot { cursor: pointer; }
.ex-list { margin-top: 10px; } .ex-list summary { cursor: pointer; font-weight: 700; } .ex-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.petgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.petcard { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center; }
.petcard small { color: var(--dim); } .petcard .home { color: var(--faint); font-size: .75rem; } .petcard .lock { color: var(--goldink); font-size: .75rem; }
.petcard.on { border-color: var(--hi); } .petcard.unknown { opacity: .7; }
.petcard.r-epic { box-shadow: inset 0 0 0 2px #ab98b5; } .petcard.r-legendary { box-shadow: inset 0 0 0 2px var(--goldink); }
.pc-art { height: 80px; display: flex; align-items: center; justify-content: center; } .pc-q { font: 700 46px Fredoka, sans-serif; color: var(--faint); }
.eltag { font-weight: 800; } .weakto { display: block; font-size: .72rem; color: var(--dim); }
.weakhit { color: var(--goldink); } .surge { color: var(--goldink); }
.pw.surge .pw-track i { background: linear-gradient(90deg, #c99a00, var(--gold)); } .surge-tag { color: var(--goldink); font: 700 .9rem Fredoka, sans-serif; letter-spacing: .08em; margin-right: 6px; }
.arena.surging { box-shadow: 0 0 0 3px var(--gold), 0 16px 44px var(--shade2); }

/* Trading cards (2026-11-19): rarity shows in the frame's material and pattern and in the diamonds, never in color alone */
.binder { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.tcard { border-radius: 14px; padding: 5px; background: var(--edge); box-shadow: 0 6px 16px var(--shade2); }
.tc-in { border-radius: 10px; background: linear-gradient(180deg, var(--well), var(--bg2)); padding: 8px; display: flex; flex-direction: column; gap: 4px; height: 100%; border: 1px solid rgba(43, 34, 51, .12); }
.tc-top { display: flex; gap: 6px; align-items: center; } .tc-top b { font: 700 .95rem Fredoka, sans-serif; line-height: 1.1; }
.tc-art { height: 104px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--hc) 45%, transparent), transparent 70%); }
.tc-rar { font-size: .78rem; color: var(--dim); } .tc-rar .pips { color: var(--hl); letter-spacing: 1px; } .tc-rar .gl { color: var(--goldink); }
.tc-home { color: var(--faint); font-size: .72rem; line-height: 1.25; flex: 1; }
.tc-foot { display: flex; justify-content: space-between; font-size: .72rem; color: var(--faint); } .tc-foot b { color: var(--goldink); font-size: .9rem; }
.tcard.r-common { background: linear-gradient(135deg, #b5ab9b, var(--edge)); }
.tcard.r-uncommon { background: linear-gradient(135deg, #8a6a3e, #4e3a20); }
.tcard.r-rare { background: repeating-linear-gradient(45deg, #9fb4d6 0 6px, #6c82a8 6px 12px); }
.tcard.r-epic { background: linear-gradient(135deg, #ab98b5, #36124e); box-shadow: 0 0 0 2px #ab98b5, 0 6px 16px var(--shade2); }
.tcard.r-legendary { background: conic-gradient(from 45deg, var(--gold), #b08a10, #fefc8f, #b08a10, var(--gold)); box-shadow: 0 0 0 2px var(--goldink), 0 0 18px rgba(252, 218, 124, .6); }
.tcard.gleam { position: relative; } .tcard.gleam .tc-in { background: linear-gradient(160deg, rgba(161, 178, 254, .4), rgba(252, 218, 124, .35) 40%, rgba(171, 152, 181, .4) 70%, rgba(255, 250, 240, 0)), var(--well); border-color: var(--goldink); }
.tcard.gleam::after { content: "✦"; position: absolute; top: -8px; right: -6px; color: var(--goldink); font-size: 22px; text-shadow: 0 0 6px var(--gold); }
/* Bio Cards, the keep-or-replace choice, and pet levels (2026-11-20) */
.tcard[data-act] { cursor: pointer; } .tc-sci { color: var(--dim); font-size: .74rem; display: block; min-height: 1.1em; } .tc-foot .link { font-size: .74rem; }
table.bio th { text-align: left; white-space: nowrap; color: var(--dim); font-weight: 700; vertical-align: top; } table.bio td { text-align: left; }
.fact { background: var(--card); border-left: 4px solid var(--hi); border-radius: 10px; padding: 10px 12px; }
.spare { background: var(--card); border: 2px solid var(--hi); border-radius: 14px; padding: 12px 14px; margin: 10px 0; text-align: left; } .spare p { margin: 6px 0 10px; }
.petcard .plv { color: var(--goldink); font-size: .76rem; } .ground { color: var(--dim); font-weight: 400; margin-left: 6px; }
.tcard.empty { opacity: .45; } .tcard.empty .tc-art { background: none; }
.gleamwrap { display: inline-block; } .gleamwrap svg { filter: drop-shadow(0 0 8px #fcda7c) drop-shadow(0 0 20px #a1b2fe); transform: scale(1.15); }
.tgive { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; } .tgive input { width: 70px; }

/* Achievements (2026-11-19): the tier shows in the badge's shape (circle, hexagon, star, diamond) as well as its color */
.achgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.ach { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; opacity: .72; }
.ach.got { opacity: 1; border-color: var(--hi); } .ach b { display: block; } .ach small { display: block; color: var(--dim); } .ach .when { color: var(--goldink); } .ach .bar { margin: 4px 0 2px; }
.achb { font-size: 22px; line-height: 1; width: 28px; text-align: center; flex: none; } .achb.t-bronze { color: #9a5b22; } .achb.t-silver { color: #6f7c8f; } .achb.t-gold { color: var(--goldink); } .achb.t-diamond { color: #2a56b8; text-shadow: 0 0 4px #a1b2fe; }

/* ---- 2026-11-20 (evening): the party in a battle, mana and moves, the next-question count, the calculator, no copying, the inventory, pets ---- */
.party { display: flex; gap: 5px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.pchip { position: relative; width: 46px; background: rgba(0, 0, 0, .5); border: 1.5px solid var(--line); border-radius: 10px; padding: 2px 2px 4px; text-align: center; }
.arena .fighter .pchip svg, .pchip svg { width: 34px; height: 34px; max-height: 34px; display: block; margin: 0 auto; filter: none; animation: none; }
.pchip .plv { position: absolute; top: -7px; right: -5px; background: var(--gold); color: var(--ink); font-weight: 800; font-size: .62rem; border-radius: 8px; padding: 0 5px; line-height: 1.5; }
.pchip.down { opacity: .38; filter: grayscale(1); } .pchip.down::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.3rem; text-shadow: 0 0 4px #000; }
.pchip.hit { animation: hit .5s; } .pchip .dmg { font-size: 1.2rem; top: -10%; }
.hpbar.sm { height: 5px; margin: 3px 2px 0; }
.movebar { display: grid; grid-template-columns: minmax(150px, 1fr) 3fr; gap: 6px 12px; align-items: center; margin: 0 0 10px; }
.mana { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--mana); } .mana b { font-weight: 800; }
.mana-track { flex: 1; height: 12px; background: var(--track); border: 1px solid var(--edge); border-radius: 999px; overflow: hidden; }
.mana-track i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--mana) 0 10px, #3971e4 10px 12px); border-radius: 999px; transition: width .4s; }
.moves { display: flex; gap: 6px; flex-wrap: wrap; }
.mv { background: var(--well); color: var(--ink); border: 1.5px solid var(--edge); border-radius: 999px; padding: 6px 12px; font: 700 .82rem 'Andika', sans-serif; cursor: pointer; min-height: 36px; }
.mv.on { border-color: var(--hi); box-shadow: 0 0 0 2px var(--hi); background: var(--tint-gold); } .mv.on::before { content: "● "; color: var(--goldink); } .mv:disabled { opacity: .5; cursor: default; }
.mv-note { grid-column: 1 / -1; color: var(--dim); font-size: .78rem; min-height: 1.2em; }
@media (max-width: 640px) { .movebar { grid-template-columns: 1fr; } }
#nx-t { font-variant-numeric: tabular-nums; opacity: .85; }
.calc { margin-top: 10px; } .calc-pad { margin-top: 8px; max-width: 250px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; }
.calc output { display: block; background: var(--well); border: 1px solid var(--edge); border-radius: 8px; padding: 6px 10px; text-align: right; font: 700 1.3rem 'Fredoka', sans-serif; min-height: 1.9em; overflow: hidden; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.ck { min-height: 42px; border-radius: 10px; border: 1px solid var(--edge); background: var(--bg2); color: var(--ink); font: 700 1.05rem 'Fredoka', sans-serif; cursor: pointer; } .ck.op { background: var(--tint-blue); } .ck.wide { grid-column: 1 / -1; }
/* A question cannot be selected, copied, or dragged out, and nothing can be pasted into an answer (see the handlers in starglyph.js). */
.qcard, .qcard * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.qcard input { -webkit-user-select: text; user-select: text; }
.pstat { color: var(--ink) !important; font-weight: 800; } .pstat span:first-child { color: var(--bad); } .pstat span:last-child { color: var(--goldink); }
.petcard .how { color: var(--faint); font-size: .72rem; } .petcard .row { margin: 4px 0 0; justify-content: center; gap: 6px; }
.row.wrap { align-items: stretch; } .binder .bc-small { cursor: pointer; }
.binder { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; align-items: start; }
/* duels and the class lobby */
.dsides { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 8px 0 12px; }
.dteam { flex: 1; min-width: 0; text-align: center; } .dteam .tname { display: block; font: 700 1rem 'Fredoka', sans-serif; }
.dmembers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; } .vs { align-self: center; color: var(--dim); font-weight: 800; font-size: .8rem; text-transform: uppercase; }
.dside { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; min-width: 120px; flex: 1; max-width: 300px; }
.dside.me { border-color: var(--hi); } .dside.out { opacity: .45; } .dside svg.wizard { display: block; margin: 0 auto; } .dside b { display: block; }
.dstate { display: block; min-height: 1.2em; color: var(--dim); } .dres { text-align: left; margin: 10px 0 0; padding-left: 18px; } .dres li { margin: 3px 0; }
.lobbygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.lmate { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
/* traveling between regions: a portal in the region's colors (it runs once, for about a second) */
.ex-gate { fill: #fff; font: 700 15px Fredoka, sans-serif; paint-order: stroke; stroke: #0a0a0f; stroke-width: 4px; }
.portal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle at 50% 50%, #fff 0 4%, var(--p1) 12%, var(--p2) 34%, var(--ink) 62%); animation: portal 1.25s ease-in-out forwards; }
.portal span { font: 700 2rem 'Fredoka', sans-serif; color: #fff; text-shadow: 0 2px 12px #000, 0 0 30px var(--p1); animation: portalname 1.25s ease-out forwards; }
@keyframes portal { 0% { opacity: 0; transform: scale(.2) rotate(-40deg); } 38% { opacity: 1; transform: scale(1.6) rotate(0deg); } 62% { opacity: 1; transform: scale(2.2) rotate(8deg); } 100% { opacity: 0; transform: scale(5) rotate(20deg); } }
@keyframes portalname { 0%, 20% { opacity: 0; } 45%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .portal { animation-duration: .01s; } }
/* with pets beside the wizard, the wizard is drawn smaller so the whole group fits the scene */
.arena .fighter.hasparty svg.wizard { max-height: 124px; } .arena .fighter .party { flex-wrap: nowrap; }
@media (max-width: 560px) { .arena .fighter.hasparty svg.wizard { max-height: 92px; } .arena .fighter .pchip { width: 40px; } .arena .fighter .pchip svg { width: 28px; height: 28px; max-height: 28px; } .arena .fighter .party { gap: 3px; margin-top: 4px; } .arena .hpbar { margin: 3px 14px; } }
.ex-coin { fill: #5a4300; font: 700 12px Fredoka, sans-serif; }

/* ---- 2026-11-20 (night): pictures from the art pack, and the battle laid out on its battle map ---- */
.cr-img { display: block; object-fit: contain; max-width: 100%; height: auto; margin: 0 auto; -webkit-user-drag: none; }
.cr-img.flip { transform: scaleX(-1); }
.pchip img.cr-img { width: 34px; height: 34px; }
.arena .scene-img { object-fit: cover; object-position: 50% 62%; }
.arena .fighter img.cr-img { max-height: 176px; width: auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55)); }
.arena .fighter.hit img.cr-img { animation: hit .5s; } .pc-art img.cr-img, .lmate img.cr-img { margin: 0 auto; }
.battle.staged { max-width: 1240px; }
/* the battle map also fills the page behind the question, blurred and dimmed, so the whole screen belongs to the place */
.battle.painted::before { content: ''; position: fixed; inset: -30px; z-index: -1; background: var(--ground) center / cover no-repeat; filter: blur(22px) brightness(.42); }
/* wide screens: the battle map with the fighters on the left, the question beside it on the right, so neither covers the other.
   narrow screens: the battle map on top and the question under it. */
@media (min-width: 980px) {
  .b-stage { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
  .b-stage .arena { height: min(58vh, 470px); margin-top: 8px; }
  .b-stage .arena .fighter { width: 240px; bottom: 14px; }
  .b-stage .arena .fighter svg { max-height: 220px; } .b-stage .arena .fighter img.cr-img { max-height: 230px; }
  .b-stage .arena .fighter.hasparty svg.wizard { max-height: 168px; }
  .b-ask .qcard { margin-top: 8px; max-height: calc(100vh - 92px); overflow: auto; }
}
@media (max-width: 560px) { .arena .fighter img.cr-img { max-height: 124px; } }
/* short menus: one lead line, and long explanations folded under "How it works" */
.lead { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 6px 0 10px; }
details.more { margin: 8px 0; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: rgba(255, 255, 255, .5); }
details.more > summary { cursor: pointer; padding: 9px 0; font-weight: 800; color: var(--wood); list-style: none; } details.more > summary::before { content: "? "; display: inline-block; width: 1.3em; height: 1.3em; line-height: 1.3em; text-align: center; margin-right: 6px; border-radius: 50%; background: var(--gold); color: var(--ink); }
details.more[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; } details.more > summary::-webkit-details-marker { display: none; }
.hud-b .btn span { font-size: 1.05em; }
/* from the code audit (2026-11-20): one quiet line for screen readers instead of announcing the whole screen; larger things to tap */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qcard:focus { outline: none; } .mv { min-height: 44px; } .qfoot .link { font-size: .92rem; padding: 8px 0; }
/* a region drawn by the open world module: the frame gives the canvas its height */
#exworld { height: min(68vh, 620px); min-height: 320px; max-height: none; overflow: hidden; position: relative; }

/* ---- 2026-11-21: the battle fills the screen (owner: "Battle maps should be full screen with the questions overlayed across the top
   center of the map with probably a slightly transparent background"), and the fighters stand on the ground of the scene ---- */
.battle.staged { position: fixed; inset: 0; max-width: none; margin: 0; padding: 0; z-index: 1; overflow: hidden; }
.battle.staged.painted::before { content: none; }
.battle.staged .b-top { position: absolute; top: 0; left: 0; right: 0; z-index: 8; padding: 8px 12px; background: linear-gradient(rgba(251, 244, 226, .88), rgba(251, 244, 226, 0)); }
.battle.staged .b-stage { position: absolute; inset: 0; display: block; }
.battle.staged .arena { position: absolute; inset: 0; height: auto; margin: 0; border-radius: 0; border: 0; box-shadow: none; }
.battle.staged .arena .scene-img { object-position: 50% 70%; }
/* the question: a see-through panel across the top center, never over the fighters' feet */
.battle.staged .b-ask { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); width: min(780px, calc(100vw - 24px)); z-index: 7; }
.battle.staged .b-ask .qcard { margin: 0; background: var(--glass); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); border: 1px solid var(--glass-edge); max-height: 50vh; overflow: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
/* the power bar and the moves sit along the bottom edge */
.battle.staged .pw { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); z-index: 7; margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--glass); }
.battle.staged .movebar { position: absolute; left: 12px; right: 12px; bottom: 8px; z-index: 7; margin: 0; grid-template-columns: auto 1fr; }
.battle.staged .movebar .mv-note { display: none; }
.battle.staged .mana { background: var(--glass); padding: 6px 10px; border-radius: 999px; }
/* standing in the scene: both sides share one ground line; a soft shadow under the feet; name and health above the head */
.battle.staged .arena .fighter { bottom: 15vh; width: auto; display: flex; flex-direction: column; align-items: center; }
.battle.staged .arena .fighter.me { left: 16%; } .battle.staged .arena .fighter.foe-side { right: 14%; }
.battle.staged .arena .fighter .hpbar { order: -2; width: 150px; margin: 0 0 2px; } .battle.staged .arena .fighter > small { order: -1; margin-bottom: 4px; }
.battle.staged .arena .fighter svg.wizard { max-height: min(30vh, 230px); }
.battle.staged .arena .fighter.foe-side svg, .battle.staged .arena .fighter.foe-side img.cr-img { max-height: min(36vh, 300px); width: auto; }
.battle.staged .arena .fighter .feet { position: absolute; left: 50%; bottom: -6px; width: 70%; height: 16px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, 0) 70%); z-index: -1; }
.battle.staged .arena .fighter.foe-side svg.foe { animation: none; }
/* pets stand on the same ground, beside and a little behind the wizard */
.battle.staged .arena .fighter.me .party { position: absolute; right: 70%; bottom: 0; margin: 0; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 0; flex-wrap: nowrap; }
.battle.staged .arena .fighter.me .pchip { width: auto; background: none; border: 0; padding: 0 2px; position: relative; }
.battle.staged .arena .fighter.me .pchip img.cr-img, .battle.staged .arena .fighter.me .pchip svg { width: min(11vh, 96px); height: min(11vh, 96px); max-height: none; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .45)); }
.battle.staged .arena .fighter.me .pchip .hpbar.sm { width: 70%; margin: 2px auto 0; }
.battle.staged .arena .fighter.me .pchip .plv { top: 0; right: 0; }
.battle.staged .arena .fighter.me .pchip.down { opacity: .35; }
@media (max-width: 700px) {
  .battle.staged .b-ask { top: 44px; } .battle.staged .b-ask .qcard { max-height: 46vh; }
  .battle.staged .arena .fighter { bottom: 17vh; } .battle.staged .arena .fighter.me { left: 30%; } .battle.staged .arena .fighter.foe-side { right: 4%; }
  .battle.staged .arena .fighter svg.wizard { max-height: 18vh; } .battle.staged .arena .fighter.foe-side svg, .battle.staged .arena .fighter.foe-side img.cr-img { max-height: 22vh; }
  .battle.staged .arena .fighter.me .pchip img.cr-img, .battle.staged .arena .fighter.me .pchip svg { width: 8vh; height: 8vh; }
  .battle.staged .arena .fighter .hpbar { width: 96px; } .battle.staged .pw { bottom: 96px; } .battle.staged .movebar { grid-template-columns: 1fr; }
}
/* fixes after the first look in the browser: pictures keep their size inside the pets' row; the wizard is drawn as large as the foe's scale;
   the question card stays narrower so the foe's name plate shows beside it */
.battle.staged .arena .fighter.me .pchip img.cr-img { max-width: none; }
.battle.staged .arena .fighter svg.wizard { height: min(27vh, 210px); width: auto; }
.battle.staged .arena .fighter { bottom: 11vh; }
.battle.staged .arena .fighter.foe-side svg, .battle.staged .arena .fighter.foe-side img.cr-img { height: min(32vh, 270px); max-height: none; }
.battle.staged .b-ask { width: min(640px, calc(100vw - 24px)); } .battle.staged .b-ask .qcard { max-height: 44vh; }
@media (max-width: 700px) { .battle.staged .arena .fighter svg.wizard { height: 17vh; } .battle.staged .arena .fighter.foe-side svg, .battle.staged .arena .fighter.foe-side img.cr-img { height: 20vh; } .battle.staged .arena .fighter { bottom: 15vh; } }
/* a pet that is resting, or a premium pet kept but not usable in this record */
.badge.rest { background: var(--tint-blue); color: var(--ink); } .badge.prem { background: var(--tint-gold); color: var(--goldink); }
.petcard.locked .pc-art { filter: grayscale(.7) brightness(.8); }

/* The class list on the map (starglyph-classui.css draws it; 2026-11-21): on a laptop the map, its top bar, and its buttons move left so the
   list never covers them, and the list runs the full height beside them. On a phone the list is a drawer, so nothing moves. */
@media (min-width: 761px) {
  .mapscreen.with-cp { padding-right: var(--cp-width, 260px); }
  .mapscreen.with-cp .cp-panel { --cp-top: 0px; }
}

/* 2026-11-22: skill labels (starglyph-path.js skill()): a mark and a word on a tint, never color alone; text 4.5:1 or more on each tint */
.skill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--edge); background: var(--well); color: var(--dim); font-size: .8rem; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.skill b { font-weight: 800; }
.skill.sk-intervention { background: var(--tint-rose); border-color: var(--bad); color: var(--bad); }
.skill.sk-developing { background: var(--tint-gold); border-color: var(--goldink); color: var(--goldink); }
.skill.sk-proficient { background: var(--tint-green); border-color: var(--goink); color: var(--goink); }
.skill.sk-mastering { background: var(--tint-blue); border-color: var(--mana); color: var(--mana); }
.skillrow { display: inline-flex; flex-wrap: wrap; gap: 4px; }
ul.skills { list-style: none; margin: 4px 0 10px; display: grid; gap: 4px; } ul.skills li { display: flex; gap: 8px; align-items: center; }
/* focus mode: the question is covered while the student is away (opaque: nothing of the question shows through) */
.focus-cover { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: linear-gradient(180deg, var(--sky1), var(--sky2)) var(--bg); }
.focus-cover .fc-card { background: var(--card); border: 2px solid var(--wood); border-radius: 18px; padding: 24px; width: min(460px, 100%); text-align: center; }
.focus-cover .fc-card h2 { margin-top: 0; } .focus-cover .fc-card p { margin: 10px 0 16px; }
/* the parent report: on screen in a sheet, and one printed page for each student */
.pr-parent h1 { font-size: 1.6rem; margin: 2px 0; } .pr-parent h2 { margin-top: 16px; } .pr-parent .pp-top { font-weight: 800; color: var(--goldink); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.pr-parent .pp-sub { color: var(--dim); } .pr-parent ul { margin: 6px 0 8px 22px; } .pr-parent p { margin: 6px 0; } .pr-parent .grid { width: 100%; font-size: .9rem; } .pr-parent .grid th, .pr-parent .grid td { white-space: normal; vertical-align: top; } .pr-parent .grid .skill { white-space: nowrap; }
.pp-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; } .pp-stat { background: var(--well); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-width: 110px; } .pp-stat b { display: block; font-size: 1.3rem; } .pp-stat small { display: block; }
.pp-tip { border-left: 4px solid var(--line); padding: 2px 0 2px 12px; margin: 10px 0; } .pp-tip h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pp-key { color: var(--dim); font-size: .85rem; margin-top: 14px !important; } .pp-view { margin-top: 12px; } .pp-copy { width: 100%; font-family: inherit; }
fieldset.pcon { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin: 8px 0; } fieldset.pcon .row { margin: 6px 0; }
#print-solo { display: none; }
@media print {
  /* a question is never printed from a battle, a duel, or the placement quiz (rule 54) */
  body:not(.printing):not(.printing-solo) .qcard { visibility: hidden !important; }
  body.printing-solo { background: #fff !important; } body.printing-solo::before { display: none; } body.printing-solo > :not(#print-solo) { display: none !important; } body.printing-solo #print-solo { display: block; }
  .pr-parents .pr-parent { break-after: page; page-break-after: always; color: #000; } .pr-parents .pr-parent:last-child { break-after: auto; page-break-after: auto; }
  .pr-parents .pr-parent h1 { font-size: 18pt; color: #000; -webkit-text-fill-color: #000; background: none; filter: none; } .pr-parents .pp-stat { border: 1px solid #999; background: none; }
  .pr-parents .skill { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .pr-parents .noprint, #print-solo .noprint { display: none !important; }
}
/* House shields (2026-11-22): the carried shield beside the wizard, and its share of a strike floating up when it takes one */
.fighter .shieldmark { position: absolute; left: -6px; bottom: 34%; z-index: 4; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); line-height: 0; }
.fighter .shieldmark.block { animation: shieldblock .6s ease-out; }
@keyframes shieldblock { 0% { transform: scale(1); } 35% { transform: scale(1.45) rotate(-8deg); filter: drop-shadow(0 0 10px #fcda7c); } 100% { transform: scale(1); } }
.dmg.shield { color: #e6f1ff; font-size: 1.4rem; text-shadow: 0 0 10px #3971e4, 0 2px 0 #000; top: 30%; }
.shieldhit { color: var(--goldink); }
.shieldcard .w-art { line-height: 0; }
@media (prefers-reduced-motion: reduce) { .fighter .shieldmark.block { animation: none; } }
.titems { display: block; margin-top: 2px; opacity: .9; }
