/* olonlog — Багшийн хэрэглүүр (bright, child-friendly) */
:root {
  --bg: #fff7ea; --card: #ffffff; --ink: #2b2d42; --muted: #7a7f95; --line: #f0e3cc;
  --brand: #ff9f1c; --blue: #4c6ef5; --green: #2fb380; --red: #f03e3e; --yellow: #ffd43b;
  --r: 22px; --shadow: 0 6px 0 rgba(43,45,66,.08), 0 14px 30px rgba(43,45,66,.08);
  --font: "Segoe UI Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg) radial-gradient(circle at 1px 1px, rgba(255,159,28,.18) 1.2px, transparent 1.6px) 0 0 / 26px 26px;
  color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px clamp(12px, 3vw, 28px);
  background: rgba(255,247,234,.92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { fill: var(--brand); }
.brand b { display: block; font-size: 20px; line-height: 1; }
.brand small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.class-pick { margin-left: auto; display: flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; }
.class-pick select { border: none; background: transparent; font-weight: 700; font-size: 15px; padding: 4px 6px; max-width: 180px; cursor: pointer; }
.class-pick select:focus { outline: none; }
.top-right { display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.lang button { border: none; background: transparent; padding: 6px 11px; font-weight: 800; font-size: 13px; color: var(--muted); cursor: pointer; }
.lang button.on { background: var(--brand); color: #fff; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .12s;
  box-shadow: 0 3px 0 rgba(43,45,66,.08); }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(43,45,66,.1); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 0 #d97f00; }
.btn.danger { color: var(--red); border-color: #ffc9c9; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn.big { min-height: 54px; padding: 0 24px; font-size: 18px; border-radius: 16px; }
.btn.huge { min-height: 76px; min-width: 120px; padding: 0 34px; font-size: 30px; border-radius: 22px; }
.btn.round { width: 64px; min-height: 64px; border-radius: 50%; font-size: 20px; padding: 0; }
.seg { display: inline-flex; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { border: none; background: transparent; border-radius: 10px; padding: 8px 14px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--blue); color: #fff; }
.seg.big button { padding: 12px 22px; font-size: 18px; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.center { text-align: center; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea, select, textarea, input[type=text] {
  border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px; background: #fff; color: var(--ink); font-weight: 600; }
.field input:focus, .field select:focus, textarea:focus, input[type=text]:focus { outline: none; border-color: var(--blue); }

/* ---------- views ---------- */
main { padding: 18px clamp(12px, 3vw, 28px) 40px; }
.view { display: none; }
.view.on { display: block; animation: pop .35s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.vbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.vbar h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); flex: 1; }
.back { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 14px; background: #fff; border: 2px solid var(--line); text-decoration: none; font-weight: 800; }
.back:hover { border-color: var(--brand); }
.view:fullscreen { background: var(--bg); padding: 24px; overflow: auto; }
.view:fullscreen .vbar .back { display: none; }

/* ---------- home ---------- */
.hello h1 { margin: 6px 0 2px; font-size: clamp(28px, 4vw, 42px); }
.hello p { margin: 0 0 8px; color: var(--muted); font-size: 18px; font-weight: 600; }
.group-title { margin: 26px 0 12px; font-size: 18px; color: var(--muted); text-transform: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.tile { --c: var(--brand); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 160px; padding: 18px 12px;
  border-radius: 26px; background: #fff; border: 3px solid color-mix(in srgb, var(--c) 35%, white); text-decoration: none; text-align: center;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 40%, white); transition: transform .18s cubic-bezier(.2,.9,.3,1.5), box-shadow .18s; }
.tile:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 11px 0 color-mix(in srgb, var(--c) 45%, white); }
.tile .em { width: 78px; height: 78px; border-radius: 24px; display: grid; place-items: center; font-size: 42px; background: color-mix(in srgb, var(--c) 18%, white); }
.tile b { font-size: 18px; }

/* ---------- my class ---------- */
.class-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
.class-list h3 { margin: 0 0 10px; }
#clsList { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#clsList li { padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; }
#clsList li:hover { background: #fff3df; }
#clsList li.on { background: var(--blue); color: #fff; }
#clsList li small { opacity: .75; }
.class-edit { display: flex; flex-direction: column; gap: 14px; }
.cls-row { display: flex; align-items: flex-end; gap: 12px; } .cls-row .field { flex: 1; }
.import-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.names-head { display: flex; justify-content: space-between; font-weight: 700; color: var(--muted); }
#clsNames { min-height: 360px; resize: vertical; font-size: 17px; line-height: 1.6; }

/* ---------- picker ---------- */
.picker-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.wheel-box { position: relative; width: min(100%, 72vh); aspect-ratio: 1; margin: 0 auto; }
#wheel { width: 100%; height: 100%; display: block; filter: drop-shadow(0 12px 18px rgba(43,45,66,.18)); }
.pointer { position: absolute; top: -6px; left: 50%; width: 0; height: 0; transform: translateX(-50%); border-left: 22px solid transparent; border-right: 22px solid transparent; border-top: 46px solid var(--ink); filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.spin-btn { position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 6px solid #fff; background: var(--brand); color: #fff;
  font-weight: 900; font-size: clamp(14px, 2.2vw, 24px); cursor: pointer; box-shadow: 0 6px 0 #d97f00, 0 10px 20px rgba(0,0,0,.2); }
.spin-btn:disabled { opacity: .8; cursor: wait; }
.picker-side { display: flex; flex-direction: column; gap: 12px; }
.picker-side h4 { margin: 6px 0 0; }
.picker-side .left { margin: 0; font-weight: 700; color: var(--muted); }
#pkDone { margin: 0; padding-left: 22px; max-height: 46vh; overflow: auto; font-weight: 600; }
.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(43,45,66,.45); padding: 16px; }
.win { background: #fff; border-radius: 32px; padding: 30px 40px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: bounce .5s cubic-bezier(.2,.9,.3,1.6); max-width: 92vw; }
@keyframes bounce { from { transform: scale(.5); opacity: 0; } }
.win-emoji { font-size: 64px; }
.win-name { font-size: clamp(40px, 8vw, 96px); font-weight: 900; color: var(--brand); line-height: 1.1; margin: 6px 0 18px; word-break: break-word; }
.win-acts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.confetti { position: fixed; width: 11px; height: 15px; border-radius: 3px; z-index: 60; pointer-events: none; }

/* ---------- groups ---------- */
.grp-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.stepper { display: inline-flex; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 16px; overflow: hidden; }
.stepper button { width: 48px; height: 48px; border: none; background: #fff3df; font-size: 26px; font-weight: 900; cursor: pointer; }
.stepper output { min-width: 56px; text-align: center; font-size: 26px; font-weight: 900; }
#gHint { margin: 12px 0; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gcard { --c: var(--blue); background: #fff; border-radius: 22px; border: 3px solid color-mix(in srgb, var(--c) 45%, white); box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 40%, white); overflow: hidden; }
.gcard.fresh { animation: pop .4s both; }
.gcard header { background: var(--c); color: #fff; padding: 10px 16px; font-weight: 900; font-size: 20px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.gcard header small { font-weight: 700; opacity: .9; font-size: 14px; }
.gcard ul { list-style: none; margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.gcard li { padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, white); font-weight: 700; font-size: 18px; cursor: pointer; border: 2px solid transparent; }
.gcard li.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 25%, white); }
.gcard.target header { box-shadow: inset 0 0 0 4px #fff; }

/* ---------- timer ---------- */
.timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.timer-face { position: relative; width: min(78vw, 46vh); aspect-ratio: 1; }
.timer-face svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: #fff; stroke: #ffe8c2; stroke-width: 16; }
.ring { fill: none; stroke: var(--brand); stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.tm-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(56px, 14vmin, 170px); font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.timer-face.done .tm-text { color: var(--red); animation: blink .6s steps(2) infinite; }
.timer-face.done .ring { stroke: var(--red); }
.timer-face.warn .ring { stroke: var(--red); }
@keyframes blink { 50% { opacity: .25; } }
.presets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.presets button { min-height: 48px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 17px; cursor: pointer; }
.presets button:hover { border-color: var(--brand); }
.tm-ctrl { display: flex; align-items: center; gap: 16px; }

/* ---------- noise ---------- */
.noise-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.nz-face { width: min(70vw, 40vh); aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #d3f9d8;
  border: 10px solid #fff; box-shadow: var(--shadow); transition: background .3s, transform .2s; }
.nz-face.mid { background: #fff3bf; } .nz-face.loud { background: #ffc9c9; animation: shake .35s infinite; }
@keyframes shake { 25% { transform: rotate(-3deg) scale(1.03); } 75% { transform: rotate(3deg) scale(1.03); } }
.nz-emoji { font-size: clamp(90px, 22vmin, 200px); line-height: 1; }
.nz-msg { font-size: clamp(20px, 3.5vmin, 34px); font-weight: 900; margin-top: 8px; text-align: center; padding: 0 16px; }
.nz-meter { position: relative; width: min(90vw, 720px); height: 34px; border-radius: 999px; background: #fff; border: 3px solid var(--line); overflow: hidden; }
.nz-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #51cf66, #fcc419 60%, #ff6b6b); transition: width .08s linear; }
.nz-limit { position: absolute; top: -4px; bottom: -4px; width: 4px; background: var(--ink); border-radius: 2px; }
.nz-ctrl { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.nz-th { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.nz-th input { width: 200px; accent-color: var(--brand); }
.nz-quiet { font-weight: 700; font-size: 18px; }
#nzStars { font-size: 22px; letter-spacing: 2px; }

/* ---------- board ---------- */
.board-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; }
.pens { display: flex; gap: 6px; }
.pens button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.pens button.on { box-shadow: 0 0 0 3px var(--ink); }
.board-bar .sep { width: 2px; height: 30px; background: var(--line); }
#bSize button { font-size: 12px; } #bSize button.xl { font-size: 20px; }
#bEraser.on { background: #ffe8cc; border-color: var(--brand); }
.board-wrap { height: calc(100vh - 240px); min-height: 360px; border-radius: var(--r); overflow: hidden; border: 3px solid var(--line); background: #fff; box-shadow: var(--shadow); }
/* bigger in full screen */
.view:fullscreen .timer-face { width: min(80vw, 62vh); }
.view:fullscreen .nz-face { width: min(70vw, 52vh); }
.view:fullscreen .board-wrap { height: calc(100vh - 150px); }
#board { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }

/* ---------- dice ---------- */
.dice-wrap { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-top: 10px; }
.dice-area { display: flex; gap: clamp(16px, 4vw, 40px); justify-content: center; flex-wrap: wrap; min-height: 180px; }
.die { width: clamp(110px, 22vmin, 200px); aspect-ratio: 1; border-radius: 22%; background: #fff; border: 4px solid var(--line); box-shadow: 0 8px 0 #f0d9b5, 0 16px 26px rgba(0,0,0,.12);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; }
.die.roll { animation: roll .55s cubic-bezier(.3,.7,.4,1); }
@keyframes roll { 0% { transform: rotate(0) scale(.8); } 40% { transform: rotate(200deg) translateY(-30px) scale(1.05); } 100% { transform: rotate(360deg); } }
.die i { width: 72%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); place-self: center; opacity: 0; }
.die i.on { opacity: 1; }
.die.red i.on { background: var(--red); }
.dice-sum { font-size: clamp(30px, 6vmin, 60px); font-weight: 900; min-height: 1.3em; }

/* ---------- score ---------- */
.score-bar { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.team { --c: var(--blue); background: #fff; border-radius: 26px; border: 3px solid color-mix(in srgb, var(--c) 45%, white); box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 40%, white); padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.team input { text-align: center; font-weight: 900; font-size: 22px; border: none; background: color-mix(in srgb, var(--c) 14%, white); color: var(--ink); border-radius: 14px; padding: 8px; }
.team .tname { display: flex; align-items: center; gap: 8px; }
.team .tname input { flex: 1; min-width: 0; }
.team .temo { font-size: 40px; line-height: 1; }
.team .pts { font-size: clamp(64px, 12vmin, 130px); font-weight: 900; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; }
.team .pts.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.25); } }
.team .acts { display: flex; gap: 8px; justify-content: center; }
.team .acts button { flex: 1; min-height: 54px; border-radius: 16px; border: none; font-size: 22px; font-weight: 900; cursor: pointer; background: color-mix(in srgb, var(--c) 18%, white); color: var(--ink); }
.team .acts button.plus { background: var(--c); color: #fff; }
.team .del { align-self: flex-end; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; margin: -6px -4px -8px 0; }

/* ---------- worksheets ---------- */
.sheet-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.sheet-opts { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.chips { display: flex; gap: 8px; }
.chips button { width: 52px; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-size: 24px; font-weight: 900; cursor: pointer; color: var(--muted); }
.opgrp { margin-top: 8px; } .opgrp small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 800; }
.chips { flex-wrap: wrap; } .chips button.txt { width: auto; height: 40px; padding: 0 12px; font-size: 14px; font-weight: 800; }
.chips button.on { background: var(--green); border-color: var(--green); color: #fff; }
.letter-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.letter-grid button { height: 38px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 17px; cursor: pointer; color: var(--muted); padding: 0; }
.letter-grid button.on { background: #7048e8; border-color: #7048e8; color: #fff; }
.letter-grid.mon button { font-family: olMongol, serif; font-size: 22px; height: 44px; }
.mini-acts { display: flex; gap: 8px; margin-top: 8px; }
#wWords.mon { font-family: olMongol, serif; font-size: 22px; }
.sheet-preview { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 6px 0 30px; }
.sheet-preview .sheet { box-shadow: 0 10px 30px rgba(43,45,66,.18); }

/* A4 page (also used for printing) */
.sheet { width: 210mm; height: 297mm; background: #fff; color: #222; padding: 14mm 14mm 12mm; position: relative; overflow: hidden; font-family: "Segoe UI", Arial, sans-serif; flex: none; }
.sheet .sh-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8mm; border-bottom: .6mm solid #222; padding-bottom: 3mm; margin-bottom: 6mm; }
.sheet .sh-title { font-size: 7.5mm; font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .sh-fields { font-size: 4.2mm; display: flex; gap: 6mm; white-space: nowrap; }
.sheet .sh-fields span { min-width: 45mm; border-bottom: .3mm solid #555; display: inline-block; padding: 0 1mm; }
.sheet .sh-fields b { font-weight: 700; }
.sheet .key-tag { position: absolute; top: 6mm; right: 14mm; font-size: 3.6mm; color: #c92a2a; font-weight: 700; }
.mgrid { display: grid; column-gap: 8mm; }
.mp { display: flex; align-items: center; font-variant-numeric: tabular-nums; font-family: "Segoe UI", Arial, sans-serif; white-space: nowrap; }
.mp .n { color: #888; font-size: .6em; width: 1.8em; flex: none; }
.mp .blank { display: inline-block; min-width: 2.6em; border-bottom: .3mm solid #333; text-align: center; margin: 0 .15em; }
.mp.wide { white-space: normal; line-height: 1.25; }
.mp .fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; margin: 0 .2em; font-size: .8em; }
.mp .fr i { font-style: normal; padding: 0 .25em; } .mp .fr i:first-child { border-bottom: .35mm solid currentColor; }
.mp small { font-size: .65em; color: #666; margin-left: .4em; }
.mp .ans { color: #c92a2a; font-weight: 700; }
.mcol { display: inline-grid; justify-items: end; font-variant-numeric: tabular-nums; padding: 0 2mm; position: relative; }
.mcol .bar { border-top: .5mm solid #222; width: 100%; height: 1.15em; text-align: right; }
.mcolcell { display: flex; justify-content: center; align-items: center; }
.wline svg { display: block; width: 100%; }
.mon-cols { display: flex; gap: 2mm; height: 238mm; }
.mon-col { position: relative; height: 100%; border-left: .25mm solid #dbe4ff; border-right: .25mm solid #dbe4ff; }
.mon-col::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: .3mm dashed #a5b4fc; }
.mon-col .mtxt { position: absolute; inset: 0; writing-mode: vertical-lr; font-family: olMongol, serif; display: flex; align-items: center; justify-content: flex-start; gap: .25em; white-space: nowrap; overflow: hidden; }
.mon-col .solid { color: #222; }
.mon-col .hollow { color: transparent; -webkit-text-stroke: .28mm #9aa5b8; }

#printArea { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; }
  #printArea .sheet { box-shadow: none; page-break-after: always; break-after: page; zoom: 1 !important; }
}

.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 16px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast.warn { background: #e8590c; } .toast.err { background: var(--red); }

@media (max-width: 900px) {
  .class-wrap, .picker-wrap, .sheet-wrap { grid-template-columns: 1fr; }
  .sheet-opts { position: static; max-height: none; }
  .brand small { display: none; }
}
@media (max-width: 560px) { .vbar .fs { display: none; } .vbar h2 { font-size: 20px; } .tiles { grid-template-columns: repeat(2, 1fr); } .tile { min-height: 130px; } .top { flex-wrap: wrap; } .class-pick { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .view.on, .tile, .gcard, .win, .die.roll, .nz-face.loud, .timer-face.done .tm-text { animation: none !important; transition: none !important; } }

.fcards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 260px; overflow-y: auto; padding: 2px; }
.fcard { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); min-width: 0; }
.fcard small { font-size: 11px; font-weight: 800; color: var(--muted); font-family: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard span { font-size: 20px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard.on { border-color: #7048e8; background: #f3efff; }
.fcards.mon .fcard span { writing-mode: vertical-lr; height: 78px; font-size: 22px; align-self: center; }

.font-prev { border: 2px dashed var(--line); border-radius: 12px; padding: 8px 12px; background: #fff; color: #d6221f; font-size: 22px; line-height: 1.35; font-weight: 400; overflow: hidden; }
.font-prev.mon { display: flex; gap: 14px; justify-content: center; font-size: 26px; }
.font-prev.mon div { writing-mode: vertical-lr; height: 90px; }

.letter-grid button:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; background: #f1f1f4; }

.nz-db { font-size: 20px; font-weight: 800; color: var(--ink); } .nz-db b { font-size: 30px; font-variant-numeric: tabular-nums; } .nz-db span { color: var(--muted); font-size: 14px; font-weight: 700; }
.nz-th b { min-width: 48px; display: inline-block; text-align: right; }

.nz-mic { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-weight:700; justify-content:center; } .nz-mic select { max-width:100%; min-width:200px; padding:8px 10px; border-radius:10px; border:2px solid var(--line,#ddd); font:inherit; background:var(--card,#fff); color:var(--ink); }
