/* Dice In Class — styles.
   1. Themes (all colors live here)   2. Base   3. Buttons and inputs   4. Layout and top bar
   5. Game: toolbar, team goal, cards   6. Big screen   7. Students, reports, settings
   8. Overlays and modals   9. Dice time   10. Small screens and motion */

/* ---------- 1. Themes ---------- */
/* Classic: light and friendly. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f5f6fa;
  --surface: #ffffff;        /* cards, panels, modals */
  --surface-2: #eceff5;      /* quiet fills: tracks, chips */
  --surface-3: #f1f3f8;      /* hover */
  --input-bg: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e4e7ee;
  --accent: #3b5bdb;
  --accent-hover: #3049b8;
  --accent-ink: #ffffff;     /* text on the accent color */
  --accent-soft: #e8edff;
  --star: #f5b301;
  --star-soft: #fff6db;
  --star-line: #f3dc8f;
  --star-ink: #7a5600;
  --gold: #e8a700;           /* big result numbers */
  --good: #2f9e44;
  --good-soft: #ebfbee;
  --good-line: #b2f2bb;
  --bad: #e03131;
  --bad-soft: #fff0f0;
  --bad-line: #ffd6d6;
  --empty-star: #d6d9e0;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --pill: 99px;
  --border-w: 1px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 14px rgba(20, 30, 60, .06);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .25);
  --overlay: rgba(20, 25, 40, .55);
  --topbar-bg: rgba(255, 255, 255, .92);
  --toast-bg: #1f2430;
  --toast-ink: #ffffff;
  --stage-bg: radial-gradient(ellipse 75% 70% at 50% 55%, #ffffff 0%, #f2f4fa 60%, #e1e5ef 100%);
  --roll-bg: linear-gradient(180deg, #4c6ef5, #3b5bdb);
  --roll-edge: #2b44a8;
  --dice-time-bg: linear-gradient(180deg, #ffd43b, #fab005);
  --dice-time-ink: #5c3d00;
  --bar-fill: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 60%), linear-gradient(90deg, #ffd43b, #fab005);
  color-scheme: light;
}

/* Omarchy: Tokyo Night colors, flat, square corners, thin borders, code font. */
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(vendor/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url(vendor/fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 800 900; font-display: swap; src: url(vendor/fonts/jetbrains-mono-latin-800-normal.woff2) format("woff2"); }
:root[data-theme="omarchy"] {
  --font: "JetBrainsMono Nerd Font", "JetBrains Mono", ui-monospace, monospace;
  --bg: #1a1b26;
  --surface: #1f2335;
  --surface-2: #292e42;
  --surface-3: #2f3549;
  --input-bg: #16161e;
  --ink: #c0caf5;
  --muted: #7f88b2;
  --line: #414868;
  --accent: #7aa2f7;
  --accent-hover: #7da6ff;
  --accent-ink: #1a1b26;
  --accent-soft: rgba(122, 162, 247, .16);
  --star: #e0af68;
  --star-soft: rgba(224, 175, 104, .13);
  --star-line: rgba(224, 175, 104, .5);
  --star-ink: #e0af68;
  --gold: #e0af68;
  --good: #9ece6a;
  --good-soft: rgba(158, 206, 106, .12);
  --good-line: rgba(158, 206, 106, .5);
  --bad: #f7768e;
  --bad-soft: rgba(247, 118, 142, .12);
  --bad-line: rgba(247, 118, 142, .45);
  --empty-star: #3b4261;
  --radius: 0px;
  --radius-sm: 0px;
  --radius-lg: 0px;
  --pill: 0px;
  --border-w: 1px;
  --shadow: none;
  --shadow-lg: 0 0 0 1px #414868, 0 24px 60px rgba(0, 0, 0, .55);
  --overlay: rgba(14, 14, 20, .75);
  --topbar-bg: rgba(19, 20, 28, .95);
  --toast-bg: #24283b;
  --toast-ink: #c0caf5;
  --stage-bg: radial-gradient(ellipse 75% 70% at 50% 55%, #24283b 0%, #1a1b26 65%, #13141c 100%);
  --roll-bg: #7aa2f7;
  --roll-edge: #3d59a1;
  --dice-time-bg: #e0af68;
  --dice-time-ink: #1a1b26;
  --bar-fill: linear-gradient(90deg, #e0af68, #ff9e64);
  color-scheme: dark;
}
/* Omarchy cards and panels get a thin border instead of a shadow. */
:root[data-theme="omarchy"] :is(.card, .panel, .team, .auth-card, .dt-q, .seg, .notice, .team-result, .dice-stage) {
  border: var(--border-w) solid var(--line);
}
:root[data-theme="omarchy"] h2, :root[data-theme="omarchy"] .brand { letter-spacing: -.02em; }
:root[data-theme="omarchy"] .card[data-act="star"]:hover { border-color: var(--star-line); }
:root[data-theme="omarchy"] .card.has-dice { border-color: var(--star); }
:root[data-theme="omarchy"] .dt-q.current { border-color: var(--accent); }

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.4 var(--font); min-height: 100vh; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; margin: 4px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.spacer { flex: 1; }
p.small { font-size: .85rem; margin: 0; }
@keyframes pop { 40% { transform: scale(1.05); } }
@keyframes land { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- 3. Buttons and inputs ---------- */
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: inherit; background: var(--input-bg);
  border: var(--border-w) solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.btn {
  border: var(--border-w) solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 9px 16px; font-weight: 600; white-space: nowrap; transition: transform .08s, background .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.star { background: var(--star-soft); border-color: var(--star-line); color: var(--star-ink); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { padding: 8px 10px; }
.btn.wide { width: 100%; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.huge { font-size: 1.4rem; padding: 14px 40px; }
.end-btn { border-color: var(--good-line); color: var(--good); }
.end-btn:hover { background: var(--good-soft); }
.dice-time-btn { background: var(--dice-time-bg); border-color: var(--star); color: var(--dice-time-ink); }
.dice-time-btn:hover { filter: brightness(1.06); background: var(--dice-time-bg); }
.dice-time-btn:disabled { background: var(--surface); border-color: var(--line); color: var(--muted); filter: none; }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 4px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: calc(var(--radius-sm) - 2px); font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
:root[data-theme="omarchy"] .seg button.on { background: var(--accent); color: var(--accent-ink); }
label.switch { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; cursor: pointer; }
label.switch input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }

/* ---------- 4. Layout and top bar ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px; width: min(400px, 100%); display: grid; gap: 14px; }
.auth-card label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.auth-card .seg { justify-self: start; }
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand.big { font-size: 1.6rem; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--topbar-bg); backdrop-filter: blur(6px); border-bottom: var(--border-w) solid var(--line);
}
.class-pick { display: flex; gap: 4px; align-items: center; }
.class-pick select { font-weight: 700; min-width: 140px; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--accent-soft); color: var(--accent); }
:root[data-theme="omarchy"] .tabs button.on { box-shadow: inset 0 -2px 0 var(--accent); }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.save-status { font-size: .85rem; color: var(--muted); }
.save-status.bad { color: var(--bad); font-weight: 600; }
main { padding: 20px; max-width: 1500px; margin: 0 auto; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 3rem; }
.empty h2 { color: var(--ink); margin: 10px 0 6px; }

/* ---------- 5. Game: toolbar, team goal, cards ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .btn.primary { font-size: 1.05rem; }
.tool-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.subbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; font-size: .92rem; }

.team { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 18px 34px; margin-bottom: 16px; }
.team-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.team-bonus { background: var(--surface-2); color: var(--muted); border-radius: var(--pill); padding: 3px 12px; font-size: .9rem; }
.team-bonus.on { background: var(--star-soft); color: var(--star-ink); box-shadow: inset 0 0 0 1px var(--star-line); }
.team-track { position: relative; margin-right: 22px; }
.team-bar { height: 16px; background: var(--surface-2); border-radius: var(--pill); overflow: hidden; }
.team-bar div { height: 100%; border-radius: var(--pill); background: var(--bar-fill); transition: width .5s cubic-bezier(.3, 1.3, .5, 1); }
.chest { position: absolute; top: 8px; transform: translate(-50%, -50%); display: grid; justify-items: center; }
.chest-icon {
  width: 38px; height: 38px; display: grid; place-items: center; font-size: 22px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 2px var(--line); filter: grayscale(.6); opacity: .85;
}
.chest-label { position: absolute; top: 40px; font-size: .8rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.chest.open .chest-icon { filter: none; opacity: 1; box-shadow: 0 0 0 3px var(--star), 0 4px 14px rgba(245, 179, 1, .4); animation: land .5s ease; }
.chest.open .chest-label { color: var(--gold); }
:root[data-theme="omarchy"] .chest-icon { border-radius: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card {
  position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 14px 14px; display: grid; gap: 8px; justify-items: center; text-align: center;
  border: 2px solid transparent; transition: border-color .2s, opacity .2s;
}
.card[data-act="star"] { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.card[data-act="star"]:hover { border-color: var(--star-line); }
.card[data-act="star"]:active { transform: scale(.98); }
.card[data-act="star"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card.has-dice { border-color: var(--star); }
.card.absent { opacity: .45; }
.card.pop { animation: pop .35s ease; }
.card .avatar { font-size: 2.6rem; line-height: 1; }
.card .name { font-weight: 700; font-size: 1.2rem; word-break: break-word; }
.card .points { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.card .points small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.card .stars { font-size: 1.35rem; letter-spacing: 2px; color: var(--empty-star); min-height: 1.6em; }
.card .stars .on { color: var(--star); }
.card .medal { position: absolute; top: 8px; left: 10px; font-size: 1.4rem; }
.card .away {
  position: absolute; top: 6px; right: 6px; border: 0; background: transparent;
  font-size: .8rem; color: var(--good); font-weight: 600; padding: 4px 6px; border-radius: var(--radius-sm);
}
.card .away:hover { background: var(--surface-2); }
.card .away.is-absent { color: var(--bad); background: var(--bad-soft); }
.card .picked-mark { position: absolute; top: 34px; right: 10px; color: var(--good); font-weight: 800; font-size: .8rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
.card-foot .minus { padding: 6px 14px; }
.dice-badge { background: var(--star-soft); color: var(--star-ink); box-shadow: inset 0 0 0 1px var(--star-line); border-radius: var(--pill); padding: 4px 12px; font-weight: 800; }
.dice-badge.none { visibility: hidden; }

/* ---------- 6. Big screen ---------- */
body.board-mode .topbar { display: none; }
body.board-mode main { padding: 0; max-width: none; }
.board { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; padding: 14px; gap: 12px; }
.board-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.board-title { font-weight: 800; font-size: 1.3rem; white-space: nowrap; flex: none; }
.board-top .team { margin: 0; order: 9; flex: 1 1 100%; padding: 8px 16px 30px; }
.board-top .team-head { margin-bottom: 12px; }
.board-grid { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); }
.board-grid .card { container-type: size; min-height: 0; padding: 10px; grid-template-rows: auto auto auto auto 1fr; gap: 1.5cqmin; align-content: center; }
.board-grid .card .away, .board-grid .card .picked-mark { display: none; }
.board-grid .card .avatar { font-size: 17cqmin; }
.board-grid .card .name { font-size: 11cqmin; line-height: 1.1; }
.board-grid .card .points { font-size: 19cqmin; }
.board-grid .card .points small { font-size: 6cqmin; }
.board-grid .card .stars { font-size: 9cqmin; min-height: 0; }
.board-grid .card .medal { font-size: 11cqmin; top: 3cqmin; left: 4cqmin; }
.board-grid .card .card-foot { align-self: end; }
.board-grid .card .card-foot .btn { font-size: max(13px, 5.5cqmin); padding: 1.5cqmin 4cqmin; }
.board-grid .card .dice-badge { font-size: max(13px, 6cqmin); }

/* ---------- 7. Students, reports, settings ---------- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 1.15rem; }
.panel textarea { width: 100%; min-height: 110px; resize: vertical; }
.panel label:not(.switch):not(.btn), .set-group label:not(.switch):not(.btn) { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.student-list { display: grid; gap: 8px; }
.student-row { display: flex; gap: 8px; align-items: center; }
.student-row .emoji-btn { font-size: 1.6rem; border: var(--border-w) solid var(--line); background: var(--input-bg); border-radius: var(--radius-sm); width: 48px; height: 44px; }
.student-row input { flex: 1; min-width: 0; }
.add-box { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.add-box label { display: block !important; font-weight: 400 !important; }
.danger-zone { box-shadow: none; border: 1px solid var(--bad-line) !important; background: var(--bad-soft); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
details.lesson { border-top: 1px solid var(--line); padding: 10px 0; }
details.lesson summary { cursor: pointer; font-weight: 600; display: flex; gap: 10px; align-items: center; }
details.lesson summary .muted { font-weight: 400; }
.pet-table td.pet { font-weight: 800; color: var(--good); font-size: 1.15rem; }
.pet-table td.pet.zero { color: var(--muted); font-weight: 600; }
.pet-table tr.done td { opacity: .45; text-decoration: line-through; }
.pet-table input { width: 20px; height: 20px; accent-color: var(--accent); }
.notice { background: var(--star-soft); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-weight: 600; box-shadow: inset 0 0 0 1px var(--star-line); }
.team-result { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; }
.team-result.on { background: var(--star-soft); box-shadow: inset 0 0 0 1px var(--star-line); }

.set-group { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.set-row { display: flex; gap: 12px; flex-wrap: wrap; }
.set-row label { flex: 1; min-width: 150px; }
.help-list { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; line-height: 1.45; }

/* Style picker in Settings */
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-opt {
  display: grid; gap: 8px; padding: 10px; text-align: left; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface); font-weight: 700;
}
.theme-opt.on { border-color: var(--accent); }
.theme-swatch { height: 56px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; }
.theme-swatch i { display: block; }
.theme-swatch.classic { background: #f5f6fa; border-radius: 8px; }
.theme-swatch.classic i { border-radius: 6px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.theme-swatch.classic i:nth-child(2) { background: #3b5bdb; } .theme-swatch.classic i:nth-child(3) { background: #fab005; }
.theme-swatch.omarchy { background: #1a1b26; }
.theme-swatch.omarchy i { background: #24283b; box-shadow: inset 0 0 0 1px #414868; }
.theme-swatch.omarchy i:nth-child(2) { background: #7aa2f7; } .theme-swatch.omarchy i:nth-child(3) { background: #e0af68; } .theme-swatch.omarchy i:nth-child(4) { background: #bb9af7; }

/* ---------- 8. Overlays and modals ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: var(--overlay); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.overlay-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 32px; width: min(560px, 100%);
  box-shadow: var(--shadow-lg); text-align: center; display: grid; gap: 18px; max-height: calc(100vh - 32px); overflow: auto;
}
.modal-card { position: relative; text-align: left; width: min(480px, 100%); }
.modal-card h2 { margin: 0; }
.modal-card h3 { margin: 0 0 8px; font-size: 1rem; }
.modal-card label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.modal-card textarea { width: 100%; resize: vertical; font-size: .95rem; line-height: 1.5; }
.celebrate { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 10px 0; }
.celebrate .big { font-size: 5rem; line-height: 1; animation: land .5s ease; }
.celebrate h2 { font-size: 2rem; }
.celebrate .reward { font-size: 1.6rem; font-weight: 800; color: var(--accent); margin: 0; }
.picker-name { font-size: clamp(2.4rem, 8vw, 4.5rem); font-weight: 800; min-height: 1.3em; line-height: 1.15; }
.picker-name .av { display: block; font-size: 1.1em; }
.picker-name.final { color: var(--accent); animation: land .4s ease; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: var(--toast-bg); color: var(--toast-ink); padding: 10px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center;
}
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700; }
:root:not([data-theme="omarchy"]) .toast button { color: #9db4ff; }
.confetti { position: absolute; top: 45%; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 5; }

/* ---------- 9. Dice time ---------- */
.dt-card {
  position: relative; overflow: hidden; width: min(1320px, 100%); height: calc(100vh - 32px);
  padding: 18px 22px 22px; gap: 14px; grid-template-rows: auto 1fr; text-align: left;
}
.dt-head { display: flex; align-items: center; gap: 12px; }
.dt-body { display: grid; grid-template-columns: 1fr 290px; gap: 16px; min-height: 0; }
.dt-card.solo .dt-body { grid-template-columns: 1fr; }
.dt-card.solo .dt-side { display: none; }

/* The stage: name on top, dice in the middle, result below. */
.dice-stage {
  position: relative; min-height: 0; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--stage-bg); box-shadow: inset 0 0 0 1px var(--line);
}
.dice-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
.dt-action { min-width: 150px; font-size: 1.05rem; }
/* The kid whose turn it is: in the top bar, so the dice never cover the name. */
.dt-hero { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dt-hero.in { animation: hero-in .45s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes hero-in { from { opacity: 0; transform: translateX(-12px); } }
.dt-avatar {
  width: 64px; height: 64px; display: grid; place-items: center; flex: none; font-size: 40px;
  background: var(--surface-2); border-radius: 50%; box-shadow: 0 0 0 3px var(--star);
}
:root[data-theme="omarchy"] .dt-avatar { border-radius: 0; }
.dt-hero-text { display: grid; min-width: 0; }
.dt-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dt-name { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 900; line-height: 1.05; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-meta { color: var(--muted); font-weight: 700; font-size: .92rem; }
.dt-result {
  position: absolute; z-index: 2; left: 0; right: 0; top: 68%; display: grid; justify-items: center; gap: 8px;
  pointer-events: none; opacity: 0;
}
.dt-result.show { opacity: 1; animation: result-in .55s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes result-in { from { opacity: 0; transform: translateY(14px) scale(.85); } }
.dt-plus { font-size: clamp(3rem, 11vh, 6.4rem); font-weight: 900; line-height: 1; color: var(--gold); letter-spacing: -.03em; text-shadow: 0 6px 24px rgba(232, 167, 0, .3); }
.dt-break { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; font-weight: 700; color: var(--muted); font-size: clamp(.95rem, 2vh, 1.15rem); }
.dt-break b { color: var(--ink); }
.dt-chip { min-width: 1.9em; padding: 2px 8px; text-align: center; background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); font-weight: 800; }
.dt-op { color: var(--muted); }
.dice-stage.flat .dt-result { position: static; margin: 24px auto; width: max-content; }

.dice-stage.clickable { cursor: pointer; }
.dt-hint { font-weight: 700; color: var(--muted); background: var(--surface); padding: 6px 14px; border-radius: var(--pill); box-shadow: inset 0 0 0 1px var(--line); font-size: clamp(.9rem, 1.9vh, 1.05rem); }

/* The line-up */
.dt-side { display: grid; grid-template-rows: auto 1fr; gap: 10px; min-height: 0; }
.dt-side-head { display: flex; gap: 8px; align-items: baseline; padding: 0 4px; }
.dt-side-head .muted { font-size: .85rem; }
.dt-count { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.dt-queue { list-style: none; margin: 0; padding: 2px; overflow-y: auto; display: grid; align-content: start; gap: 6px; }
.dt-q {
  display: grid; grid-template-columns: 22px auto 1fr auto; gap: 10px; align-items: center;
  padding: 8px 12px 8px 8px; border-radius: var(--radius-sm); background: var(--surface-2); border: 2px solid transparent;
  transition: background .2s, border-color .2s;
}
.dt-q-num { font-size: .8rem; font-weight: 800; color: var(--muted); text-align: center; }
.dt-q .av { font-size: 1.6rem; line-height: 1; }
.dt-q .nm { font-weight: 700; display: grid; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-q .nm small { font-weight: 600; color: var(--muted); font-size: .78rem; }
.dt-q .st { font-weight: 800; color: var(--muted); white-space: nowrap; }
.dt-q.pickable { cursor: pointer; }
.dt-q.pickable:hover { border-color: var(--line); background: var(--surface-3); }
.dt-q.current { background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow); }
.dt-q.current .dt-q-num, .dt-q.current .st { color: var(--accent); }
.dt-q.done { background: var(--star-soft); }
.dt-q.done .st { color: var(--gold); font-size: 1.15rem; }
.dt-q.done .dt-q-num::before { content: "✓"; color: var(--good); }
.dt-q.done .dt-q-num { font-size: 0; }
.dt-q.done .dt-q-num::before { font-size: .9rem; }

/* ---------- Kid pictures: picker and background colors ---------- */
:root {
  --av-red: #ffc9c9; --av-orange: #ffd8a8; --av-yellow: #ffec99; --av-green: #b2f2bb; --av-teal: #96f2d7;
  --av-blue: #a5d8ff; --av-purple: #d0bfff; --av-pink: #fcc2d7; --av-brown: #e6ccb2;
}
:root[data-theme="omarchy"] {
  --av-red: color-mix(in srgb, #f7768e 38%, #1f2335); --av-orange: color-mix(in srgb, #ff9e64 38%, #1f2335);
  --av-yellow: color-mix(in srgb, #e0af68 38%, #1f2335); --av-green: color-mix(in srgb, #9ece6a 38%, #1f2335);
  --av-teal: color-mix(in srgb, #73daca 38%, #1f2335); --av-blue: color-mix(in srgb, #7aa2f7 38%, #1f2335);
  --av-purple: color-mix(in srgb, #bb9af7 38%, #1f2335); --av-pink: color-mix(in srgb, #ff7a93 30%, #2f3549);
  --av-brown: color-mix(in srgb, #a27e5e 45%, #1f2335);
}
.av-red { --av: var(--av-red); } .av-orange { --av: var(--av-orange); } .av-yellow { --av: var(--av-yellow); }
.av-green { --av: var(--av-green); } .av-teal { --av: var(--av-teal); } .av-blue { --av: var(--av-blue); }
.av-purple { --av: var(--av-purple); } .av-pink { --av: var(--av-pink); } .av-brown { --av: var(--av-brown); }
.av-bg { background: var(--av); border-radius: 50%; display: inline-grid; place-items: center; line-height: 1; }
:root[data-theme="omarchy"] .av-bg { border-radius: 0; }
.card .avatar.av-bg { width: 1.5em; height: 1.5em; font-size: 2.1rem; }
.board-grid .card .avatar.av-bg { font-size: 13cqmin; }
.dt-q .av.av-bg { width: 2.1rem; height: 2.1rem; font-size: 1.25rem; }
.dt-avatar.av-bg { background: var(--av); }
.student-row .emoji-btn.av-bg { border-color: transparent; }

.pic-modal { width: min(660px, 100%); }
.pic-head { display: flex; gap: 16px; align-items: center; }
.pic-preview {
  width: 84px; height: 84px; flex: none; display: grid; place-items: center; font-size: 52px; line-height: 1;
  background: var(--surface-2); border-radius: 50%; box-shadow: 0 0 0 3px var(--star);
}
:root[data-theme="omarchy"] .pic-preview { border-radius: 0; }
.pic-preview.av-bg { background: var(--av); }
.pic-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pic-tabs button {
  display: inline-flex; gap: 6px; align-items: center; border: var(--border-w) solid var(--line); background: var(--surface);
  border-radius: var(--pill); padding: 5px 12px 5px 8px; font-size: .85rem; font-weight: 700; color: var(--muted);
}
.pic-tabs button span { font-size: 1.15rem; }
.pic-tabs button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; padding: 3px; }
.emoji-grid button {
  font-size: 2rem; line-height: 1; padding: 8px 0; border: var(--border-w) solid var(--line);
  background: var(--input-bg); border-radius: var(--radius-sm); transition: transform .1s;
}
.emoji-grid button:hover { background: var(--accent-soft); transform: scale(1.08); }
.emoji-grid button.on { outline: 3px solid var(--accent); outline-offset: 1px; background: var(--accent-soft); }
.emoji-grid button.taken { opacity: .35; }
.pic-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: var(--border-w) solid var(--line); padding: 0; }
.swatch.none { background: linear-gradient(135deg, transparent 45%, var(--bad) 45%, var(--bad) 55%, transparent 55%), var(--surface); }
.swatch.on { outline: 3px solid var(--accent); outline-offset: 2px; }
:root[data-theme="omarchy"] .swatch { border-radius: 0; }

/* ---------- 10. Small screens and motion ---------- */
@media (max-width: 800px) {
  .dt-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .dt-side-head { display: none; }
  .dt-queue { grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); overflow-x: auto; overflow-y: hidden; }
}
@media (max-width: 700px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  main { padding: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .overlay-card { padding: 22px; }
  .dt-card { padding: 12px; height: calc(100vh - 24px); }
  .dt-hero { gap: 10px; }
  .dt-avatar { width: 44px; height: 44px; font-size: 28px; }
  .dt-name { font-size: 1.35rem; }
  .dt-kicker { display: none; }
  .dt-action { min-width: 0; }
}
