:root {
  --bg: #04060b; --panel: #0a0f17; --panel2: #101823; --line: #1b2a3a; --text: #dcefe9; --dim: #6c8791;
  --a1: #4df0c0; --a2: #6aa8ff; --ok: #7dffa0; --warn: #ffc45c; --grad: linear-gradient(120deg, #4df0c0, #6aa8ff);
  --ground: #070b12; --grid: #17414a; --grid2: #0f1e2a; --fog: #04060b; --sky: #0b1b2b; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overscroll-behavior: none;
  font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { touch-action: manipulation; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 30px; margin: 0; letter-spacing: -0.5px; } h2 { font-size: 13px; margin: 26px 0 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 1.2px; }
p { margin: 0 0 10px; }
[hidden] { display: none !important; }

#view { min-height: 100%; padding: calc(var(--top) + 18px) 16px calc(var(--bottom) + 96px); max-width: 640px; margin: 0 auto; }
#view.full { padding: 0; max-width: none; height: 100dvh; }

#tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom) + 12px); display: flex; gap: 4px; padding: 6px;
  background: color-mix(in srgb, var(--panel) 84%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 24px; z-index: 20; }
#tabs a { display: flex; flex-direction: column; align-items: center; width: 84px; padding: 6px 0 5px; border-radius: 18px; font-size: 11px; color: var(--dim); font-weight: 600; }
#tabs a span { font-size: 19px; line-height: 1.1; }
#tabs a.on { background: var(--grad); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); font-weight: 650; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn:disabled { opacity: 0.4; }
.btn:active { transform: scale(0.97); }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.dim { color: var(--dim); } .sm { font-size: 13px; }
input[type=text], textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; outline: none; }
input[type=text]:focus, textarea:focus { border-color: var(--a1); }
textarea { min-height: 90px; resize: vertical; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--panel2); color: var(--dim); border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: #1f6b4e; } .pill.warn { color: var(--warn); border-color: #6b4a1f; } .pill.new { background: var(--grad); color: #fff; border: 0; }

/* who */
.who { min-height: 80dvh; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.who .logo { font-size: 54px; font-weight: 800; letter-spacing: -2px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.who .person { padding: 18px; font-size: 20px; font-weight: 700; text-align: left; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }

/* learn */
.hello { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 800; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hero { flex: 0 0 78%; scroll-snap-align: center; border-radius: 22px; padding: 16px; min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); }
.hero .glyph { position: absolute; right: -8px; top: -18px; font-size: 110px; opacity: 0.22; }
.hero h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.3px; } .hero p { font-size: 14px; opacity: 0.9; margin: 0; }
.card { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 10px; }
.card:active { background: var(--panel2); }
.tile { flex: 0 0 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 25px; }
.card h3 { margin: 0; font-size: 16px; } .card p { margin: 1px 0 5px; font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lvl i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin-right: 3px; } .lvl i.on { background: var(--warn); }
details summary { color: var(--dim); font-size: 14px; padding: 8px 0; }

/* game */
.game { height: 100dvh; display: flex; flex-direction: column; }
.stagewrap { position: relative; flex: 0 0 44dvh; background: radial-gradient(120% 90% at 50% 0%, var(--sky) 0%, var(--fog) 70%); touch-action: none; }
#stage { position: absolute; inset: 0; } #stage canvas { display: block; }
.back { position: absolute; top: calc(var(--top) + 10px); left: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(11, 13, 26, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 20px; z-index: 3; }
.hud { position: absolute; top: calc(var(--top) + 10px); right: 12px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; pointer-events: none; z-index: 2; }
.hud div { background: rgba(11, 13, 26, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 10px; padding: 3px 9px; font-size: 13px; font-variant-numeric: tabular-nums; }
.hud b { font-weight: 700; margin-left: 6px; }
.goalbar { position: absolute; left: 12px; right: 12px; bottom: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(11, 13, 26, 0.66); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13.5px; font-weight: 600; border: 1px solid var(--line); z-index: 2; pointer-events: none; }
.goalbar.hit { border-color: var(--ok); color: var(--ok); }
.coach { position: absolute; left: 66px; bottom: 58px; transform: scale(0.9); transform-origin: left bottom; max-width: calc(100% - 82px); padding: 9px 14px; border-radius: 16px 16px 16px 4px; background: var(--grad); color: #fff; font-weight: 650; font-size: 14.5px; opacity: 0; transition: 0.25s; pointer-events: none; z-index: 4; box-shadow: 0 10px 40px rgba(91, 108, 255, 0.5); }
.coach.show { opacity: 1; transform: scale(1); }
.sheet { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px calc(var(--bottom) + 24px); background: var(--bg); border-radius: 22px 22px 0 0; margin-top: -14px; position: relative; z-index: 5; border-top: 1px solid var(--line); }
.steps { display: flex; gap: 4px; margin-bottom: 10px; } .steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); } .steps i.on { background: var(--grad); }
.steptext { font-size: 16.5px; } .steptext code { background: var(--panel2); padding: 1px 6px; border-radius: 6px; font-size: 14px; }
.eq { margin: 10px 0; padding: 12px; border-radius: 14px; background: var(--panel2); text-align: center; font: italic 600 19px Georgia, "Times New Roman", serif; white-space: pre-wrap; border: 1px solid var(--line); }
.ask { margin-top: 10px; } .ask .row { margin-top: 6px; }
.ask input.bad { border-color: var(--a2); animation: shake 0.3s; } .ask input.good { border-color: var(--ok); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.slider { margin-bottom: 10px; } .slider .row { justify-content: space-between; font-size: 14px; } .slider b { font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: #fff; border: 5px solid var(--a1); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 5px solid var(--a1); }
.calc .out { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-height: 32px; margin: 6px 2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; } .chips button { padding: 6px 10px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); font-size: 14px; font-family: ui-monospace, Menlo, monospace; }
.stars { display: flex; gap: 6px; justify-content: center; margin: 10px 0; } .stars button { font-size: 34px; color: var(--line); } .stars button.on { color: var(--warn); }

/* ideas, root */
.vote { flex: 0 0 48px; height: 52px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; line-height: 1.1; }
.vote.on { background: var(--grad); border-color: transparent; }
.comment { padding: 10px 0; border-top: 1px solid var(--line); } .comment b { font-size: 14px; }
.seg { display: flex; background: var(--panel2); border-radius: 12px; padding: 3px; } .seg button { flex: 1; padding: 7px 0; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--dim); } .seg button.on { background: var(--a1); color: #fff; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 4px 0 10px; } .bar i { display: block; height: 100%; background: var(--grad); border-radius: 4px; }
.stat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; } .stat b { display: block; font-size: 20px; } .stat span { font-size: 11px; color: var(--dim); }
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 14, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; }
#modal .box { width: 100%; max-height: 92dvh; overflow-y: auto; background: var(--panel); border-radius: 22px 22px 0 0; padding: 16px 16px calc(var(--bottom) + 16px); border-top: 1px solid var(--line); }
#modal textarea { min-height: 46dvh; font: 12.5px/1.4 ui-monospace, Menlo, Consolas, monospace; white-space: pre; }
.err { color: var(--a2); font-size: 14px; margin: 8px 0; }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 96px); transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; z-index: 60; font-size: 14px; font-weight: 600; max-width: 86%; text-align: center; }

/* overlays stay light-on-dark in every theme */
.hud div, .goalbar, .back { color: #e9ecff; }
.goalbar.hit { color: #3ddc97; }

/* guide character */
.stagewrap .guide { position: absolute; left: 12px; bottom: 56px; z-index: 4; }

/* whiteboard */
.board { position: absolute; left: 12px; top: calc(var(--top) + 58px); max-width: 60%; padding: 8px 12px 9px; z-index: 2; background: rgba(248, 246, 238, 0.94); color: #1d2440; border-radius: 6px;
  border: 3px solid #c9c2b0; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); font: 15px/1.5 "Chalkboard SE", "Marker Felt", "Bradley Hand", "Comic Sans MS", cursive; transform: rotate(-1deg); }
.board.min > div { display: none; } .board.min::after { content: "✎ board"; font-size: 13px; }
.board .old { opacity: 0.45; font-size: 13px; } .board .now { color: #1c3fd1; font-weight: 700; white-space: nowrap; overflow: hidden; width: fit-content; max-width: 100%; animation: write 1.3s steps(26) both; }
.board .now:nth-of-type(2) { animation-delay: 0.9s; } .board .now:nth-of-type(3) { animation-delay: 1.8s; } .board .now:nth-of-type(4) { animation-delay: 2.7s; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
[data-theme=retro] .board { background: #1f3b2c; color: #e9f2e4; border-color: #7a5a36; } [data-theme=retro] .board .now { color: #fff7b8; }
[data-theme=neon] .board { background: rgba(4, 10, 28, 0.9); color: #9fefff; border: 1px solid #00e5ff; box-shadow: 0 0 18px rgba(0, 229, 255, 0.4); transform: none; } [data-theme=neon] .board .now { color: #ff7de9; }

/* theme character */
[data-theme=neon] .panel, [data-theme=neon] .card, [data-theme=neon] .btn, [data-theme=neon] .hero, [data-theme=neon] .tile { border-radius: 8px; }
[data-theme=neon] .card, [data-theme=neon] .panel { box-shadow: 0 0 16px rgba(0, 229, 255, 0.12); } [data-theme=neon] h1, [data-theme=neon] h2 { letter-spacing: 2px; text-transform: uppercase; }
[data-theme=retro] .panel, [data-theme=retro] .card, [data-theme=retro] .btn, [data-theme=retro] .hero, [data-theme=retro] .tile, [data-theme=retro] input, [data-theme=retro] textarea { border-radius: 4px; }
[data-theme=retro] .card, [data-theme=retro] .panel, [data-theme=retro] .btn { box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45); }
[data-theme=retro] body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 99; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.13) 0 1px, transparent 1px 3px); }
[data-theme=paper] .panel, [data-theme=paper] .card { box-shadow: 0 2px 10px rgba(40, 40, 80, 0.08); } [data-theme=paper] .btn.primary, [data-theme=paper] #tabs a.on { color: #fff; }

/* settings */
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .swatch { border-radius: 12px; padding: 8px 4px 6px; border: 2px solid var(--line); font-size: 11.5px; font-weight: 650; text-align: center; }
.swatch.on { border-color: var(--a1); } .swatch i { display: block; height: 30px; border-radius: 7px; margin-bottom: 5px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14px; }
input[type=color] { width: 44px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; }
select { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; max-width: 62%; font-size: 16px; }
.chars { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; } .char { flex: none; width: 84px; padding: 10px 4px; border-radius: 14px; border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; }
.char.on { border-color: var(--a1); background: var(--panel2); }
.auth { min-height: 86dvh; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.auth .logo { font-size: 52px; font-weight: 800; letter-spacing: -2px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
input[type=password] { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; outline: none; font-size: 16px; }
.btn.on { background: var(--a1); border-color: transparent; color: #fff; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 9px; margin: 10px 0; }
.opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; min-height: 58px; border-radius: 14px; background: var(--panel2); border: 2px solid var(--line); font-weight: 600; font-size: 15px; transition: 0.15s; }
.opt .key { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); font-size: 13px; color: var(--dim); }
.opt.sel { border-color: var(--a1); } .opt.good { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, var(--panel2)); } .opt.good .key { background: var(--ok); color: #fff; }
.opt.bad { border-color: var(--a2); opacity: 0.5; animation: shake 0.3s; } .opt:active { transform: scale(0.98); }
.why { margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 12%, transparent); border-left: 3px solid var(--ok); font-size: 14.5px; }

/* ---- v0.3: instrument look, the field, timeline, scope, evolve ---- */
#wave { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.5; }
#view { position: relative; z-index: 1; }
h2 { font-family: var(--mono); font-weight: 500; letter-spacing: 2px; text-transform: lowercase; }
h2::before { content: "∿ "; color: var(--a1); }
[data-theme=signal] .panel, [data-theme=signal] .card { border-radius: 10px; background: color-mix(in srgb, var(--panel) 88%, transparent); }
[data-theme=signal] .btn { border-radius: 9px; background: transparent; font-family: var(--mono); font-weight: 500; font-size: 14px; }
[data-theme=signal] .btn.primary, [data-theme=signal] .btn.on { background: color-mix(in srgb, var(--a1) 14%, transparent); border-color: var(--a1); color: var(--a1); box-shadow: 0 0 14px color-mix(in srgb, var(--a1) 25%, transparent); }
[data-theme=signal] .coach { background: var(--panel2); border: 1px solid var(--a1); color: var(--text); box-shadow: 0 0 22px color-mix(in srgb, var(--a1) 30%, transparent); }
[data-theme=signal] #tabs { border-radius: 12px; } [data-theme=signal] #tabs a { border-radius: 8px; font-family: var(--mono); font-weight: 500; }
[data-theme=signal] #tabs a.on { background: color-mix(in srgb, var(--a1) 16%, transparent); color: var(--a1); }
[data-theme=signal] .opt { border-radius: 8px; border-width: 1px; } [data-theme=signal] .eq { border-radius: 8px; font-family: var(--mono); font-style: normal; font-size: 16px; color: var(--a1); }
[data-theme=signal] .pill.new { background: transparent; border: 1px solid var(--a2); color: var(--a2); }
.auth .word { font: 300 44px var(--mono); letter-spacing: 6px; color: var(--a1); text-shadow: 0 0 24px color-mix(in srgb, var(--a1) 55%, transparent); }

/* the welcome screen: this server's logo and name while the app loads, then it fades into the field */
#welcome { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg, #04060b); transition: opacity 0.6s ease, transform 0.6s ease; }
#welcome.gone { opacity: 0; transform: scale(1.04); pointer-events: none; }
#welcome .mark { min-height: 96px; display: grid; place-items: center; color: var(--a1, #4df0c0); }
#welcome .word, .brandmark .word { font: 300 44px var(--mono, monospace); letter-spacing: 6px; color: var(--a1, #4df0c0); text-shadow: 0 0 24px color-mix(in srgb, var(--a1, #4df0c0) 55%, transparent); text-align: center; overflow-wrap: anywhere; }
#welcome .by, .brandmark .by { font: 400 13px var(--mono, monospace); letter-spacing: 3px; color: var(--dim, #7c8aa5); min-height: 16px; }
#welcome .bar { width: 150px; height: 2px; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--a1, #4df0c0) 18%, transparent); margin-top: 8px; }
#welcome .bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--a1, #4df0c0); animation: welcomebar 1.1s ease-in-out infinite; }
@keyframes welcomebar { from { transform: translateX(-110%); } to { transform: translateX(280%); } }
.brandmark { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* the guide: a signal, not a face */
.guide { display: flex; align-items: center; justify-content: center; gap: 9%; flex: none; border-radius: 50%; border: 1px solid var(--g1, var(--a1)); background: color-mix(in srgb, var(--g1, var(--a1)) 10%, var(--bg)); box-shadow: 0 0 16px color-mix(in srgb, var(--g1, var(--a1)) 35%, transparent); }
.guide i { width: 9%; height: 18%; border-radius: 2px; background: linear-gradient(var(--g1, var(--a1)), var(--g2, var(--a2))); animation: idle 2.6s ease-in-out infinite; }
.guide i:nth-child(2) { animation-delay: -0.4s; } .guide i:nth-child(3) { animation-delay: -0.8s; } .guide i:nth-child(4) { animation-delay: -1.2s; } .guide i:nth-child(5) { animation-delay: -1.6s; }
.guide.talk i { animation: speak 0.42s ease-in-out infinite alternate; } .guide.talk i:nth-child(2) { animation-duration: 0.3s; } .guide.talk i:nth-child(3) { animation-duration: 0.5s; } .guide.talk i:nth-child(4) { animation-duration: 0.27s; }
@keyframes idle { 50% { height: 34%; } } @keyframes speak { from { height: 14%; } to { height: 66%; } }

/* the field */
.full > .field { display: block; margin: 0; position: relative; height: 100dvh; overflow: hidden; background: radial-gradient(90% 70% at 50% 45%, var(--sky), var(--bg) 75%); }
.fieldhost { position: absolute; inset: 0; }
.fieldtop { position: absolute; left: 12px; right: 12px; top: calc(var(--top) + 10px); z-index: 3; pointer-events: none; } .fieldtop > * { pointer-events: auto; }
input.seek { flex: 1; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 0; border-bottom: 1px solid var(--a1); border-radius: 0; padding: 10px 2px; font-family: var(--mono); font-size: 16px; color: var(--text); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
input.seek:focus { border-color: var(--a2); } .fieldtop .row span { font: 12px var(--mono); }
.modes { display: flex; gap: 14px; margin-top: 8px; align-items: center; font: 13px var(--mono); } .modes button { color: var(--dim); padding: 4px 0; border-bottom: 1px solid transparent; } .modes button.on { color: var(--a1); border-color: var(--a1); }
.modes a { margin-left: auto; color: var(--dim); font-size: 18px; }
.fieldstat { position: absolute; left: 14px; bottom: calc(var(--bottom) + 84px); z-index: 2; font: 12px var(--mono); color: var(--a1); letter-spacing: 1px; pointer-events: none; text-shadow: 0 0 10px var(--bg); }
.toolbox { position: absolute; left: 10px; right: 10px; bottom: calc(var(--bottom) + 80px); z-index: 4; padding: 12px 14px; background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line); border-top: 1px solid var(--a1); border-radius: 12px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: rise 0.25s ease-out; max-width: 560px; margin: 0 auto; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.toolbox h3 { margin: 0; font-size: 18px; } .toolbox .x { font-size: 24px; color: var(--dim); width: 32px; height: 32px; } .toolbox .sum { font-size: 14px; color: var(--dim); margin: 2px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 11.5px var(--mono); color: var(--dim); margin-bottom: 10px; } .facts span:first-child { color: var(--a1); }
.tbs { display: flex; gap: 8px; } .tb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 7px; border: 1px solid var(--line); border-radius: 10px; font: 12px var(--mono); color: var(--dim); }
.tb b { font-size: 18px; font-weight: 400; color: var(--text); } .tb.main { border-color: var(--a1); color: var(--a1); } .tb.main b { color: var(--a1); } .tb.on { border-color: var(--a2); color: var(--a2); } .tb.on b { color: var(--a2); }
.rel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font: 12px var(--mono); align-items: center; } .rel button { padding: 4px 8px; border: 1px dashed var(--a2); border-radius: 8px; color: var(--a2); }

/* timeline: tap any moment, past or future */
.steps { align-items: center; gap: 3px; } .steps i { height: 22px; background: none; position: relative; cursor: pointer; border-radius: 0; }
.steps i::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--line); } .steps i.on::before { background: var(--grad); }
.steps i.q::after, .steps i.goal::after { content: ""; position: absolute; left: 50%; top: 5px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--warn); } .steps i.goal::after { border-radius: 2px; transform: rotate(45deg); border-color: var(--ok); }
.steps i.cur::before { height: 8px; top: 7px; box-shadow: 0 0 10px var(--a1); } .steps .nav { flex: none; width: 26px; height: 26px; color: var(--dim); font-size: 20px; line-height: 1; }

/* oscilloscope */
.scope { padding: 10px; } .scope canvas { display: block; width: 100%; height: 120px; background: #020508; border: 1px solid var(--line); border-radius: 6px; }
.scope .legend { margin-top: 8px; display: grid; gap: 3px; font: 12px var(--mono); } .scope .legend div { display: flex; gap: 8px; align-items: baseline; } .scope .legend i { width: 14px; height: 3px; border-radius: 2px; align-self: center; }
.scope .legend b { font-weight: 500; } .scope .legend span { color: var(--text); min-width: 54px; } .scope .legend em { color: var(--dim); font-style: normal; margin-left: auto; text-align: right; }

/* evolve */
.btn.evolve { gap: 4px; padding-left: 8px; } .btn.evolve svg { width: 20px; height: 20px; color: var(--a1); animation: twist 3s linear infinite; } .dna svg { color: var(--a1); animation: twist 3s linear infinite; }
@keyframes twist { 50% { transform: scaleX(-1); } }
.seen { padding: 10px 12px; border-left: 2px solid var(--a1); background: color-mix(in srgb, var(--a1) 6%, transparent); margin: 6px 0 10px; display: grid; gap: 5px; font-size: 14px; }
.req { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 14.5px; } .reply { font-size: 13.5px; padding-left: 10px; border-left: 1px solid var(--line); color: var(--dim); } .reply b { color: var(--text); }[data-theme=signal] .board { background: rgba(2, 6, 10, 0.82); color: var(--dim); border: 1px solid var(--line); border-left: 2px solid var(--a1); border-radius: 4px; transform: none; font: 13px/1.6 var(--mono); box-shadow: none; }
[data-theme=signal] .board .now { color: var(--a1); font-weight: 500; text-shadow: 0 0 10px color-mix(in srgb, var(--a1) 60%, transparent); } [data-theme=signal] .board .old { font-size: 12px; }

/* ---- v0.4: controller cells, memory, composer, terms ---- */
.prog { margin-bottom: 12px; font: 12.5px var(--mono); } .cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(34px, 1fr)); gap: 6px; margin-top: 8px; }
.cell { height: 44px; border-radius: 8px; border: 1px solid var(--line); font: 600 13px var(--mono); color: rgba(0, 0, 0, 0.72); transition: transform 0.1s; box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.18); } .cell:active { transform: scale(0.92); }
.mem { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font: 12.5px var(--mono); }
.slot { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; } .slot button { padding: 6px 9px; color: var(--text); } .slot .del { color: var(--dim); border-left: 1px solid var(--line); padding: 6px 7px; }
button.slot.add { padding: 6px 9px; color: var(--a1); border-color: var(--a1); }
.modes .new { margin-left: 4px; color: var(--a1); border: 1px solid var(--a1); border-radius: 8px; padding: 3px 8px; }
pre.terms { white-space: pre-wrap; font: 13px/1.6 var(--mono); color: var(--text); margin-top: 14px; }
input[type=file] { font-size: 13px; max-width: 100%; }

/* ---- v0.6: map facets, zoom line, files, part viewer ---- */
.modes.views { margin-top: 6px; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.zoomwrap { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.zoomwrap button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; color: var(--a1); font: 18px var(--mono); background: color-mix(in srgb, var(--bg) 70%, transparent); }
input.zoomline { writing-mode: vertical-lr; direction: rtl; width: 30px; height: 190px; -webkit-appearance: slider-vertical; }
.rel button.solid { border-style: solid; border-color: var(--a1); color: var(--a1); }
.files .frow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; } .files .frow span.grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files label.btn input { display: none; }
.viewer { width: 100%; min-height: 240px; background: radial-gradient(90% 80% at 50% 30%, var(--sky), var(--bg)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 8px; } .viewer canvas { display: block; width: 100%; height: auto; touch-action: none; }

/* scratch whiteboard: the learner's own working, next to the question */
.scratchbox { margin: 10px 0; } .scratchbox summary { cursor: pointer; }
.scratch { border-radius: 8px; border: 3px solid #c9c2b0; background: #f8f6ee; overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
.scratch .tools { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #ebe6d6; border-bottom: 1px solid #c9c2b0; }
.scratch .tools button { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 9px; color: #1d2440; font-size: 14px; font-weight: 650; }
.scratch .tools button.on { background: #1d2440; color: #f8f6ee; }
.scratch .tools .ink { min-width: 26px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid transparent; } .scratch .tools .ink.on { border-color: #f8f6ee; box-shadow: 0 0 0 2px #1d2440; }
.scratch .pad { position: relative; height: 240px; } .scratch.big .pad { height: 62dvh; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; } .scratch .pad.erasing canvas { cursor: cell; }
.scratch .hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; color: #a9a391; font: 15px "Chalkboard SE", "Marker Felt", "Bradley Hand", "Comic Sans MS", cursive; }
/* ---- v0.7: glyphs, tracing pad, sketches ---- */
svg.glyph { flex: none; animation: turn 12s linear infinite; } @keyframes turn { to { transform: rotate(360deg); } }
.tile svg.glyph { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
canvas.pad { display: block; width: 100%; aspect-ratio: 5 / 3; margin-top: 8px; background: #020508; border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; }
svg.sketch { display: block; margin: 6px 0; color: var(--a1); background: #020508; border: 1px solid var(--line); border-radius: 6px; }

/* ---- v0.8: rod-pixel panel, data tree, runner and parts ---- */
canvas.pixel { display: block; flex: none; image-rendering: pixelated; }
.pface { position: absolute; left: 10px; bottom: 54px; z-index: 4; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--bg) 72%, transparent); cursor: pointer; }
.stagewrap .pface + .coach, .coach { left: 104px; max-width: calc(100% - 118px); }
.auth canvas.pixel { margin-bottom: 4px; }
.tree details { margin-left: 12px; border-left: 1px solid var(--line); padding-left: 10px; } .tree > details { margin-left: 0; border-left: 0; padding-left: 0; }
.tree summary { padding: 6px 0; color: var(--text); font: 13.5px var(--mono); } .tree .leaf { font-size: 13.5px; padding: 2px 0 2px 12px; }
.runner .facts { margin: 6px 0 0; } .runner .facts b { font-weight: 500; color: var(--a1); }
details.bom summary { padding: 5px 0; font-size: 14px; color: var(--text); } details.bom .facts { margin: 0 0 6px 14px; }
[data-theme=cyberpunk] .panel, [data-theme=cyberpunk] .card, [data-theme=cyberpunk] .btn { border-radius: 2px; } [data-theme=cyberpunk] h1, [data-theme=cyberpunk] h2 { text-transform: uppercase; letter-spacing: 2px; }
[data-theme=cyberpunk] .btn.primary, [data-theme=cyberpunk] #tabs a.on { background: var(--a1); color: #07050d; }
[data-theme=academic] .btn.primary, [data-theme=academic] #tabs a.on { color: #fff; } [data-theme=academic] .panel, [data-theme=academic] .card { box-shadow: 0 1px 6px rgba(30, 40, 80, 0.08); }
[data-theme=deep] .panel, [data-theme=deep] .card { border-radius: 14px; }

/* ---- v0.9: logos ---- */
svg.glyph.flat { animation: none; }
.logoprev { display: flex; gap: 14px; align-items: center; } .logoprev p { margin: 0; }
.pxgrid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; max-width: 300px; margin: 6px auto; }
.pxgrid button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 4px; background: var(--panel2); padding: 0; }
.pxgrid button.on { background: var(--a1); border-color: var(--a1); box-shadow: 2px 2px 0 color-mix(in srgb, var(--a1) 40%, #000); }

/* ---- v0.10: one screen format, drawn the viewer's way ---- */
.skind { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 12px var(--mono); letter-spacing: 0.4px; color: var(--a1); text-transform: lowercase; }
.skind b { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--a1); border-radius: 6px; font-size: 12px; }
.skind .ttl { color: var(--text); font-weight: 650; } .skind .dim { margin-left: auto; }
.seq { margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seq > div { display: flex; gap: 12px; padding: 7px 10px; font-size: 14px; border-bottom: 1px solid var(--line); color: var(--dim); transition: 0.2s; }
.seq > div .at { flex: 0 0 48px; font-family: var(--mono); font-size: 12.5px; } .seq > div.was { color: var(--text); }
.seq > div.on { color: var(--text); background: color-mix(in srgb, var(--a1) 14%, transparent); box-shadow: inset 3px 0 0 var(--a1); }
.seq > .btn { margin: 7px 10px; }
.caption { position: absolute; left: 50%; bottom: 114px; transform: translateX(-50%); width: max-content; max-width: min(78%, 620px); padding: 6px 12px; border-radius: 8px; background: rgba(2, 5, 8, 0.78); color: #fff; font-size: 15px; line-height: 1.35; text-align: center; z-index: 3; pointer-events: none; }
.game.lay-cinema .stagewrap { flex-basis: 62dvh; }
.game.txt-large .sheet { zoom: 1.16; } .game.txt-small .sheet { zoom: 0.9; }
.game.ans-list .opts { grid-template-columns: 1fr; } .game.ans-list .opt { min-height: 46px; }
@media (min-width: 860px) {
  .game.lay-side { flex-direction: row; } .game.lay-side .stagewrap { flex: 1 1 58%; }
  .game.lay-side .sheet { flex: 0 0 42%; margin-top: 0; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); }
}

/* ---- v0.11: widgets, the scientific calculator, the helper, the library ---- */
.wbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 10px; font: 12px var(--mono); }
.wbar button { padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--dim); background: none; font: inherit; }
.wbar button.on { color: var(--text); border-color: color-mix(in srgb, var(--a1) 55%, var(--line)); } .wbar .reset { margin-left: auto; }
.widget { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-bottom: 10px; overflow: hidden; }
.widget > header { display: flex; align-items: center; gap: 2px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); font: 12px var(--mono); letter-spacing: 0.4px; text-transform: lowercase; color: var(--dim); }
.widget > header b { flex: 1; font-weight: 500; cursor: pointer; padding: 5px 0; } .widget > header button { width: 30px; height: 28px; color: var(--dim); font-size: 14px; border-radius: 6px; }
.widget > header button:active { background: var(--panel2); } .widget.min > header { border-bottom: 0; } .widget.min > .wbody { display: none; }
.widget .wbody > .panel, .widget .wbody > div > .panel { border: 0; border-radius: 0; margin: 0; background: none; }
.widget.max { position: fixed; inset: 0; z-index: 40; margin: 0; border-radius: 0; border: 0; background: var(--bg); overflow-y: auto; padding-top: var(--top); }
.widget.max > header { position: sticky; top: 0; background: var(--bg); z-index: 1; padding: 8px 10px 8px 16px; font-size: 13px; } .widget.max .scope canvas { height: 56dvh; }
.widget.max .calcbody { max-width: 460px; margin: 0 auto; }
.modes.charts { margin: 8px 12px 0; }
/* calculator */
.calcbody { user-select: none; -webkit-user-select: none; }
.cscreen { background: #c9d6c2; color: #10190f; border-radius: 8px; padding: 8px 10px; border: 2px solid #0a0f0a; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35); font-family: var(--mono); }
.cscreen .row { justify-content: space-between; font-size: 10.5px; opacity: 0.75; min-height: 14px; } .cscreen .cprev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.cscreen .cexpr { width: 100%; background: none; border: 0; outline: 0; color: inherit; font: 15px var(--mono); padding: 2px 0; user-select: text; -webkit-user-select: text; }
.cscreen .cres { text-align: right; font-size: 26px; font-weight: 600; min-height: 34px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cres.soft { opacity: 0.55; } .cres.bad { font-size: 14px; font-weight: 500; padding-top: 10px; }
.cown { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font: 12px var(--mono); }
.ckeys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.ck { height: 42px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 3px; font: 600 16px var(--mono); color: var(--text); }
.ck:active { transform: translateY(2px); border-bottom-width: 1px; } .ck.f { font-size: 13.5px; font-weight: 500; color: var(--a2); height: 36px; } .ck.o { color: var(--a1); font-size: 19px; }
.ck.c { background: color-mix(in srgb, var(--warn) 22%, var(--panel2)); font-size: 13px; } .ck.eq { grid-column: span 2; background: var(--a1); color: #04120e; border-color: var(--a1); font-size: 20px; }
.ck.m { height: 30px; font-size: 11.5px; font-weight: 500; color: var(--dim); } .ck.m.on { color: var(--a1); border-color: var(--a1); } .ck.m.wide { grid-column: span 3; } .ck.l { height: 32px; padding: 0 10px; font-size: 13px; color: var(--ok); }
/* helper */
.helper .hsay { flex: 1; font-size: 15.5px; line-height: 1.4; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; background: var(--panel2); }
/* library */
.shelf { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin: 0 -14px 6px; padding-left: 14px; padding-right: 14px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.shelf .card { flex: 0 0 min(300px, 82vw); margin: 0; scroll-snap-align: start; } .card .grow { min-width: 0; }
.card.idea { border-style: dashed; } .card.idea .tile { background: none; border: 1px dashed var(--line); }
.fieldgroup { margin-bottom: 6px; } .fieldgroup > summary { padding: 8px 0; color: var(--text); font: 14px var(--mono); text-transform: lowercase; }
.shelf { scrollbar-width: thin; scrollbar-color: var(--line) transparent; } .shelf::-webkit-scrollbar { height: 6px; } .shelf::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; } .shelf::-webkit-scrollbar-track { background: transparent; }

/* layout templates */
.wbar .lead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 0 100%; margin-bottom: 2px; }
.wbar select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); color: var(--text); font: inherit; max-width: 230px; } .wbar .about { flex: 1 0 100%; }

/* ---- v0.12: animated widgets, the floating calculator, problems, simple profile ---- */
.widget { animation: wpop 0.28s ease both; } @keyframes wpop { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.widget > .wbody { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.26s ease; } .widget > .wbody > * { min-height: 0; overflow: hidden; }
.widget.min > .wbody { display: grid; grid-template-rows: 0fr; } .widget.max { animation: wmax 0.22s ease both; } @keyframes wmax { from { opacity: 0; transform: scale(0.97); } }
.widget > header button { transition: 0.15s; } .widget > header button:hover { color: var(--a1); }
.calcfab { position: fixed; right: 14px; bottom: calc(var(--bottom) + 14px); z-index: 31; width: 50px; height: 50px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); font-size: 22px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); transition: 0.2s; }
.calcfab.on { opacity: 0; pointer-events: none; transform: scale(0.6); } .calcfab.need { border-color: var(--a1); animation: need 1.4s ease-in-out infinite; }
@keyframes need { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--a1) 22%, transparent), 0 8px 24px rgba(0, 0, 0, 0.45); transform: translateY(-3px); } }
.calcdock { position: fixed; right: 10px; bottom: calc(var(--bottom) + 10px); z-index: 32; width: min(340px, calc(100vw - 20px)); max-height: min(64dvh, 560px); overflow-y: auto; padding: 0 10px 10px; border-radius: 18px; background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  transform: translateY(24px) scale(0.94); transform-origin: right bottom; opacity: 0; pointer-events: none; transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15), opacity 0.18s, width 0.22s; }
.calcdock.open { transform: none; opacity: 1; pointer-events: auto; } .calcdock.basic { width: min(272px, calc(100vw - 20px)); }
.calcdock > header { position: sticky; top: 0; display: flex; align-items: center; gap: 6px; padding: 8px 2px 6px; background: inherit; font: 12px var(--mono); color: var(--dim); z-index: 1; }
.calcdock > header b { flex: 1; font-weight: 500; } .calcdock > header button { padding: 4px 8px; border-radius: 7px; border: 1px solid var(--line); color: var(--text); font: inherit; }
.calcdock .ck { height: 38px; } .calcdock .ck.f { height: 32px; } .calcbody.basic .ck.f, .calcbody.basic .ck.sci { display: none; } .calcbody.basic .ck.m.wide { grid-column: span 5; }
.cscreen .cres { flex: 1; } .ckeep { padding: 2px 8px; margin-bottom: 4px; border-radius: 6px; border: 1px solid rgba(16, 25, 15, 0.45); font: 11.5px var(--mono); color: inherit; background: none; white-space: nowrap; }
.ck.l i { font-style: normal; font-weight: 400; opacity: 0.7; }
.ckept { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font: 12px var(--mono); }
.kline { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; } .kline button { padding: 4px 7px; color: var(--text); font: inherit; } .kline .del { color: var(--dim); border-left: 1px solid var(--line); }
.game.calc-open .sheet { padding-bottom: 66dvh; }
@media (min-width: 860px) { .game.calc-open .sheet { padding-bottom: 24px; } .game.lay-side .calcdock, .game.lay-side .calcfab { right: calc(42% + 14px); } }
.card.problem .tile { background: none; border: 1px solid var(--warn); color: var(--warn); font: 600 22px var(--mono); }
.modes.secs { flex-wrap: wrap; margin: 6px 0 4px; } .modes.secs .more { color: var(--a1); }
@media (prefers-reduced-motion: reduce) { .widget, .widget.max, .calcfab.need { animation: none; } .widget > .wbody, .calcdock { transition: none; } }
.calcdock { max-height: min(58dvh, 500px); } .calcdock .cscreen { padding: 5px 9px; } .calcdock .cres { font-size: 22px; min-height: 28px; } .calcdock .ckeys { gap: 5px; margin-top: 6px; } .calcdock .ck { height: 34px; font-size: 15px; } .calcdock .ck.f { height: 28px; font-size: 12.5px; } .calcdock .ck.m { height: 26px; } .calcdock .cown, .calcdock .ckept { margin-top: 6px; } .calcdock .ck.l { height: 28px; }

/* ---- compose box, glance, new ---- */
.composer textarea { width: 100%; } .refpick { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 8px; }
.reflist { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; } .reflist button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text); text-align: left; }
.reflist button i { font: 11px var(--mono); font-style: normal; color: var(--a1); } .reflist button:active { background: var(--panel2); }
.refbtn { margin-left: 10px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; font: 11px var(--mono); color: var(--a1); }
.glance .weeks { display: flex; align-items: flex-end; justify-content: center; gap: 7px; height: 56px; margin: 14px 0 4px; } .glance .weeks i { width: 22px; border-radius: 4px 4px 1px 1px; background: var(--grad, var(--a1)); opacity: 0.9; }
#tabs a[data-tab=new] span { font-size: 19px; }

.arrange { margin: 18px 0 8px; } .arrange > summary { color: var(--dim); font: 13px var(--mono); }

/* ---- v0.13: a device's own control panel ---- */
.device { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--panel2) 80%, #000), var(--panel)); overflow: hidden; margin-bottom: 10px; }
.device > header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font: 12.5px var(--mono); background: rgba(0, 0, 0, 0.28); }
.device > header > b { font-weight: 600; letter-spacing: 0.4px; } .dled { width: 9px; height: 9px; border-radius: 50%; background: var(--ok, #3ddc97); box-shadow: 0 0 8px var(--ok, #3ddc97); }
.device.running .dled { background: var(--warn); box-shadow: 0 0 10px var(--warn); animation: dblink 0.7s steps(2) infinite; } @keyframes dblink { 50% { opacity: 0.25; } }
.dnote { color: var(--warn); } .dstat { display: inline-flex; gap: 6px; align-items: baseline; } .dstat b { color: var(--a1); font-size: 14px; }
.dcap { font: 11px var(--mono); letter-spacing: 0.3px; color: var(--dim); text-transform: lowercase; }
.device section { padding: 10px 12px; border-bottom: 1px solid var(--line); } .device section:last-child { border-bottom: 0; }
.device h4 { margin: 0 0 8px; font: 500 11.5px var(--mono); letter-spacing: 0.6px; color: var(--a2); text-transform: lowercase; }
.ditems { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.dgridwrap { flex: 1 0 100%; } .dgrid { display: grid; gap: 6px; } .dgrid button { height: 40px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--dim); font: 12px var(--mono); transition: 0.15s; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35); }
.dgrid button.on { color: #06110e; border-color: transparent; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 0 12px color-mix(in srgb, var(--a1) 35%, transparent); } .dgrid button:active { transform: translateY(1px); }
.ddial { display: grid; justify-items: center; gap: 3px; min-width: 92px; } .ddial b { font: 600 14px var(--mono); }
.dknob { --turn: -135deg; --fill: 0deg; position: relative; width: 66px; height: 66px; border-radius: 50%; touch-action: none; cursor: grab; outline: none;
  background: radial-gradient(circle at 50% 50%, var(--panel2) 0 54%, transparent 55%), conic-gradient(from -135deg, var(--a1) 0 var(--fill), var(--line) var(--fill) 270deg, transparent 270deg); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.dknob i { position: absolute; left: 50%; top: 50%; width: 3px; height: 21px; margin: -24px 0 0 -1.5px; border-radius: 2px; background: var(--text); transform-origin: 50% 24px; transform: rotate(var(--turn)); }
.dknob.hold { cursor: grabbing; } .dknob:focus-visible { box-shadow: 0 0 0 2px var(--a1); }
.dstep { display: grid; gap: 4px; } .dstep > div { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; } .dstep button { width: 38px; height: 36px; font-size: 18px; color: var(--a1); background: var(--bg); } .dstep b { min-width: 54px; text-align: center; font: 600 14px var(--mono); }
.dslide { flex: 1 1 180px; } .dslide .row { justify-content: space-between; } .dsel { display: grid; gap: 4px; }
.dswitch { display: grid; justify-items: center; gap: 5px; } .dswitch i { width: 40px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: 0.18s; } .dswitch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: 0.18s; }
.dswitch.on i { background: var(--a1); } .dswitch.on i::after { left: 21px; }
.dbtn { padding: 9px 13px; border-radius: 9px; border: 1px solid var(--line); border-bottom-width: 3px; background: var(--panel2); color: var(--text); font: 500 13px var(--mono); } .dbtn:active { transform: translateY(2px); border-bottom-width: 1px; }
.dbtn.prog { color: var(--a1); border-color: color-mix(in srgb, var(--a1) 50%, var(--line)); } .dbtn.on { background: var(--a1); color: #06110e; }
.dmeter { flex: 1 1 170px; } .dmeter .row { justify-content: space-between; } .dmeter b, .dread b { font: 600 14px var(--mono); } .dmeter .track { height: 9px; margin-top: 5px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; } .dmeter .track i { display: block; height: 100%; background: var(--grad, var(--a1)); transition: width 0.15s; }
.dlamp { display: flex; align-items: center; gap: 7px; } .dlamp i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); transition: 0.2s; } .dlamp.on i { background: var(--ok, #3ddc97); box-shadow: 0 0 10px var(--ok, #3ddc97); } .dlamp.on .dcap { color: var(--text); }
.dread { display: grid; gap: 2px; } .moreset { margin: 4px 0 8px; } .moreset > summary { color: var(--dim); font: 12.5px var(--mono); }

/* creator's page and viewer's page */
.seg.pagemode { width: auto; margin-left: auto; } .seg.pagemode button { padding: 5px 11px; font-size: 12.5px; }
.row.creator { gap: 8px; margin: -2px 0 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px; font: 12px var(--mono); }
.forknote { margin: -2px 0 10px; padding: 9px 12px; border-left: 3px solid var(--a2); background: var(--panel2); border-radius: 0 10px 10px 0; font-size: 13.5px; color: var(--dim); } .forknote a { color: var(--a1); }

/* the ruler of sizes on the map */
.ruler { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); z-index: 3; display: grid; gap: 1px; padding: 4px 3px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ruler button { width: 34px; padding: 3px 0; font: 11px var(--mono); color: var(--dim); border-radius: 6px; transition: 0.2s; } .ruler button.on { color: var(--bg); background: var(--a1); font-weight: 600; }
@media (max-height: 560px) { .ruler { display: none; } }
.dsel .seg { width: auto; display: inline-flex; flex-wrap: wrap; } .dsel .seg button { white-space: nowrap; padding: 8px 12px; flex: 0 0 auto; }

/* ---- v0.14: the project page as four clean tabs, the opening, a creator's presentation ---- */
.phead { gap: 10px; margin-bottom: 10px; } .phead h3 { margin: 0; font-size: 19px; }
.ptabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); position: sticky; top: -14px; z-index: 6; }
.ptabs button { flex: 1; padding: 9px 4px; border-radius: 9px; color: var(--dim); font: 500 13.5px var(--mono); letter-spacing: 0.3px; transition: 0.18s; } .ptabs button.on { background: color-mix(in srgb, var(--a1) 16%, transparent); color: var(--a1); }
.pane { animation: wpop 0.24s ease both; } .pane > .panel { margin-bottom: 12px; } .tbar { gap: 8px; margin-bottom: 10px; } .tbar .skip { color: var(--dim); border-style: dashed; }
.psec { margin: 0 0 14px; } .psec > h4 { margin: 0 0 7px 2px; font: 500 11.5px var(--mono); letter-spacing: 0.6px; text-transform: lowercase; color: var(--dim); }
.lede { margin: 0 2px 12px; font-size: 16px; line-height: 1.45; }
.people .prow { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 5px 0; font-size: 14px; } .people .prow > .dim { flex: 0 0 150px; font: 12px var(--mono); }
.intro { position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; background: radial-gradient(80% 60% at 50% 42%, var(--sky, var(--panel)), var(--bg) 78%); transition: opacity 0.45s, transform 0.45s; cursor: pointer; }
.intro.out { opacity: 0; transform: scale(1.04); pointer-events: none; } .intro svg.glyph { animation: turn 9s linear infinite, ipop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; } .intro svg.glyph.flat { animation: ipop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes ipop { from { opacity: 0; transform: scale(0.6); } }
.ibrand { font: 300 30px var(--mono); letter-spacing: 6px; color: var(--a1); text-shadow: 0 0 22px color-mix(in srgb, var(--a1) 50%, transparent); animation: wpop 0.6s 0.15s ease both; } .iline { color: var(--dim); font-size: 14px; animation: wpop 0.6s 0.25s ease both; }
.intro h2 { margin: 14px 0 0; font-size: 22px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text); animation: wpop 0.6s 0.35s ease both; }
.iload { width: 170px; height: 3px; margin: 12px 0 4px; border-radius: 2px; background: var(--line); overflow: hidden; } .iload i { display: block; height: 100%; width: 40%; border-radius: 2px; background: var(--a1); animation: iload 1.1s ease-in-out infinite; } @keyframes iload { from { transform: translateX(-110%); } to { transform: translateX(280%); } }
.game.pf-rounded .sheet { font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif; } .game.pf-serif .sheet { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; } .game.pf-mono .sheet { font-family: var(--mono); }
.game.pc-sharp .sheet :is(.panel, .btn, .opt, .ptabs, .ptabs button, .device, .dbtn, .eq, .seq) { border-radius: 3px; } .game.pc-round .sheet :is(.btn, .opt, .ptabs button, .dbtn) { border-radius: 999px; } .game.pc-round .sheet :is(.panel, .device, .ptabs) { border-radius: 22px; }

/* ---- the menu bar, the related strip, the film sheet ---- */
.menubar { position: absolute; left: 10px; top: calc(var(--top) + 8px); z-index: 8; display: flex; gap: 2px; padding: 3px; border-radius: 11px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 62%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.menubar > button, .menu > button { padding: 6px 10px; border-radius: 8px; font: 12.5px var(--mono); color: var(--text); } .menubar .mback { font-size: 17px; padding: 3px 10px; } .menu { position: relative; } .menu > button:hover { background: var(--panel2); }
.mdrop { position: absolute; left: 0; top: calc(100% + 7px); min-width: 228px; padding: 5px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 96%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); display: grid; animation: wpop 0.16s ease both; }
.mdrop[hidden] { display: none; } .mdrop button, .mdrop a { display: block; text-align: left; padding: 9px 11px; border-radius: 8px; font-size: 14px; color: var(--text); } .mdrop button:hover, .mdrop a:hover { background: var(--panel2); } .mdrop button.on::after { content: "✓"; float: right; color: var(--a1); } .mdrop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.stagewrap .board { top: calc(var(--top) + 56px); }
.railwrap { margin-top: 22px; } .rail { display: flex; align-items: center; overflow-x: auto; padding: 6px 2px 12px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; scroll-behavior: smooth; }
.rnode { flex: 0 0 132px; display: grid; justify-items: center; gap: 5px; padding: 10px 6px; border-radius: 14px; text-align: center; border: 1px solid transparent; } a.rnode:active { background: var(--panel2); } .rnode.here { border-color: var(--a1); background: color-mix(in srgb, var(--a1) 8%, transparent); }
.rnode b { font-size: 13px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .rnode span { font: 10.5px var(--mono); color: var(--dim); }
.rline { flex: 0 0 34px; height: 0; border-top: 2px solid var(--a1); opacity: 0.7; } .rline.dash { border-top: 2px dashed var(--line); opacity: 1; }
.exports { display: grid; gap: 8px; } .exports .btn { text-align: left; }

/* whiteboard layers and tools */
.scratch canvas.layer { pointer-events: none; } .scratch .pad.lasering canvas { cursor: none; } .scratch .tools { flex-wrap: wrap; }
/* nothing sits on top of anything else: on a narrow screen the readouts and the board move below the menu bar and share the width */
@media (max-width: 560px) { .hud { top: calc(var(--top) + 54px); max-width: 48%; } .hud div { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .stagewrap .board, .board { top: calc(var(--top) + 54px); max-width: 46%; font-size: 12px; } .caption { max-width: 92%; font-size: 13.5px; bottom: 112px; } .ptabs button { font-size: 12.5px; padding: 9px 2px; } }
.phead h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .phead .pill { flex: none; } .tbar { flex-wrap: wrap; }
.people .prow > .dim { flex: 0 0 auto; min-width: 128px; } .field { flex-wrap: wrap; } .calcfab { width: 46px; height: 46px; opacity: 0.92; }
.sheet { padding-bottom: calc(var(--bottom) + 84px); }

.calcbtn.on { border-color: var(--a1); color: var(--a1); } .calcbtn.need { border-color: var(--a1); animation: need 1.4s ease-in-out infinite; }
.stagewrap .goalbar { bottom: 20px; } .stagewrap .pface { bottom: 66px; } .stagewrap .coach { bottom: 72px; } .caption { bottom: 126px; }

/* ---- v0.15: the editor chat, the me page ---- */
.menubar .meditor { color: var(--a1); border: 1px solid color-mix(in srgb, var(--a1) 45%, transparent); margin-left: 4px; } .menubar .meditor.on { background: var(--a1); color: var(--bg); }
.chatpane { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(430px, 100vw); display: flex; flex-direction: column; padding: calc(var(--top) + 10px) 12px calc(var(--bottom) + 12px); background: var(--bg); border-left: 1px solid var(--line); animation: chatin 0.26s ease both; } .chatpane[hidden] { display: none; }
@keyframes chatin { from { transform: translateX(40px); opacity: 0; } }
@media (min-width: 900px) { .game.with-chat { margin-right: min(430px, 42vw); } .chatpane { width: min(430px, 42vw); } }
.chatpane > header { display: flex; align-items: baseline; gap: 8px; padding-bottom: 8px; font: 12.5px var(--mono); } .chatpane > header b { font-size: 15px; color: var(--a1); } .chatpane > header button { font-size: 20px; padding: 0 8px; color: var(--dim); }
.chatnote { font-size: 13px; color: var(--dim); padding: 0 2px 8px; } .chatnote.ai { color: var(--warn); } .chatnote.you { color: var(--ok, #3ddc97); } .chatnote:empty { display: none; }
.chatlist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; min-height: 80px; }
.cmsg { max-width: 92%; padding: 9px 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-size: 14.5px; } .cmsg.you { align-self: flex-end; background: color-mix(in srgb, var(--a1) 10%, var(--panel)); border-color: color-mix(in srgb, var(--a1) 35%, var(--line)); } .cmsg.ai { align-self: flex-start; }
.cmsg.system { align-self: center; border: 0; background: none; color: var(--dim); font: 12px var(--mono); padding: 0; } .cmsg .steptext { font-size: 14.5px; }
.cwho { display: flex; gap: 8px; align-items: center; font: 11px var(--mono); color: var(--dim); margin-bottom: 4px; } .cwho button { margin-left: auto; color: var(--dim); font-size: 15px; padding: 0 4px; }
.crefs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; } .crefs span { font: 11px var(--mono); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--a1); }
.cplan { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: grid; gap: 6px; } .cstep { display: grid; gap: 1px; padding-left: 10px; border-left: 2px solid var(--a1); } .cstep span { font-size: 12.5px; color: var(--dim); }
.cq { margin-top: 10px; display: grid; gap: 6px; } .copts { display: grid; gap: 6px; } .copts button { text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 14px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.copts button.on { border-color: var(--a1); } .copts button:disabled:not(.on) { opacity: 0.45; } .copts i { flex: none; font: 10.5px var(--mono); font-style: normal; padding: 2px 6px; border-radius: 6px; background: var(--bg); color: var(--a2); }
.cdec { font-size: 13.5px; } .cdec > summary { color: var(--dim); font: 12px var(--mono); } .cdec > div { display: grid; gap: 2px; padding: 7px 0; border-bottom: 1px solid var(--line); } .cdec > div:last-child { border-bottom: 0; } .cdec span { color: var(--dim); font-size: 13px; }
.chatpane .composer textarea { min-height: 64px; }
.mylist .myrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); } .mylist .myrow:last-child { border-bottom: 0; } .myrow b { min-width: 120px; font-weight: 600; font-size: 14.5px; } .myrow:active { background: var(--panel2); }
.mypic { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; }
.rnode .rlv { display: flex; gap: 6px; align-items: center; } #tabs .bulb .hz { stroke: var(--a1); stroke-dasharray: 3 2.2; animation: hz 1.1s linear infinite; } @keyframes hz { to { stroke-dashoffset: -10.4; } }
.chatpane { width: 100vw; } @media (min-width: 720px) { .game.with-chat { margin-right: min(430px, 46vw); } .chatpane { width: min(430px, 46vw); } } .chatlist, .reflist { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ---- v0.16: navigation on top, the side panel, the start page ---- */
#tabs { top: calc(var(--top) + 8px); bottom: auto; left: 10px; transform: none; border-radius: 12px; padding: 3px; gap: 2px; align-items: center; z-index: 20; }
#tabs a { flex-direction: row; gap: 6px; width: auto; padding: 7px 12px; border-radius: 9px; font: 500 12.5px var(--mono); } #tabs a span { font-size: 14px; line-height: 1; display: inline-flex; } #tabs a span svg { width: 16px; height: 16px; }
#logo { padding: 4px 6px; border-radius: 9px; display: flex; } #logo:hover { background: var(--panel2); } #logo canvas { pointer-events: none; }
#view { padding-top: calc(var(--top) + 66px); padding-bottom: calc(var(--bottom) + 40px); } #view.full { padding: 0; }
.fieldtop { top: calc(var(--top) + 56px); } .fieldstat { bottom: calc(var(--bottom) + 14px); } .toolbox { bottom: calc(var(--bottom) + 12px); } .toast { bottom: calc(var(--bottom) + 28px); }
#shade { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.5); } #shade[hidden], #drawer[hidden] { display: none; }
#drawer { position: fixed; left: 0; top: 0; bottom: 0; z-index: 81; width: min(310px, 86vw); overflow-y: auto; padding: calc(var(--top) + 12px) 12px calc(var(--bottom) + 16px); background: var(--panel); border-right: 1px solid var(--line); animation: drawin 0.22s ease both; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
@keyframes drawin { from { transform: translateX(-30px); opacity: 0; } }
#drawer .dhead { display: flex; align-items: center; margin-bottom: 8px; font: 300 20px var(--mono); letter-spacing: 3px; color: var(--a1); } #drawer .dhead b { flex: 1; font-weight: 300; } #drawer .dhead button { font-size: 22px; color: var(--dim); padding: 0 8px; }
#drawer a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; font-size: 14.5px; color: var(--text); } #drawer a:hover, #drawer a:active { background: var(--panel2); }
#drawer h4 { margin: 16px 10px 4px; font: 500 11px var(--mono); letter-spacing: 0.7px; text-transform: lowercase; color: var(--dim); } #drawer p { margin: 2px 10px; }
#drawer i { margin-left: auto; font: 10.5px var(--mono); font-style: normal; color: var(--dim); } #drawer i.you { color: var(--ok, #3ddc97); }
#drawer details > summary { display: flex; padding: 8px 10px; border-radius: 9px; color: var(--text); font-size: 14.5px; cursor: pointer; } #drawer details a { padding-left: 24px; font-size: 14px; }
.startpage { display: grid; justify-items: center; gap: 14px; padding-top: 6dvh; text-align: center; } .startpage h1 { font-size: 24px; margin: 4px 0 2px; } .startpage .composer { width: 100%; text-align: left; } .startpage > .btn { min-width: 160px; }
.helper.talk { display: grid; justify-items: center; gap: 12px; text-align: center; } .talkface { padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg); transition: 0.2s; } .talkface:active { transform: scale(0.97); border-color: var(--a1); } .talkface canvas { pointer-events: none; }
.helper.talk .hsay { flex: none; border-radius: 14px; max-width: 460px; } .typeit { width: 100%; text-align: left; } .typeit > summary { color: var(--dim); font: 12.5px var(--mono); } .tline { display: grid; gap: 2px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; } .tline span { color: var(--dim); }
.glance .trace { margin: 10px 0 2px; } .ptabs .ed { color: var(--a1); } .ptabs .ed.on { background: var(--a1); color: var(--bg); }
.full > .field::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--top) + 236px); z-index: 2; pointer-events: none; background: linear-gradient(var(--bg) 0, var(--bg) 62%, transparent); } .full > .field::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 54px; z-index: 1; pointer-events: none; background: linear-gradient(transparent, var(--bg)); }

/* select mode in the editor */
.pickbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border-radius: 8px; border: 1px solid var(--a1); font: 12.5px var(--mono); } .pchip i { font-style: normal; color: var(--a1); font-size: 11px; } .pchip button { color: var(--dim); padding: 0 5px; font-size: 15px; }
.pcode { flex: 1 0 100%; } .pcode > summary { color: var(--dim); font: 12px var(--mono); } .pcode > div { display: grid; gap: 3px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; } .pcode span { color: var(--dim); font: 12px var(--mono); }
.pcode pre { margin: 4px 0 0; padding: 8px; max-height: 200px; overflow: auto; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font: 11.5px var(--mono); white-space: pre-wrap; word-break: break-word; }
.game.picking [data-ref] { outline: 1px dashed color-mix(in srgb, var(--a1) 70%, transparent); outline-offset: 2px; cursor: crosshair; } .game [data-ref].pickedel { outline: 2px solid var(--a1); outline-offset: 2px; } .game.picking #stage { cursor: crosshair; }
@media (max-width: 719px) { .chatpane.peek { top: auto; height: auto; max-height: 46dvh; border-left: 0; border-top: 1px solid var(--a1); padding-top: 8px; } .chatpane.peek > :not(.pickbar) { display: none; } }
#drawer summary svg.glyph { flex: none; margin-right: 2px; }

.allfields { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--top) + 244px); z-index: 4; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--a1); background: color-mix(in srgb, var(--bg) 80%, transparent); color: var(--a1); font: 12.5px var(--mono); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } .allfields[hidden] { display: none; }

/* the code screen in the editor */
.chatpane > header { align-items: center; } .chatpane > header .seg button { padding: 5px 12px; font-size: 12.5px; }
.chatpane.showcode > :is(.chatnote, .chatlist, .composer, .sendrow) { display: none; } .chatpane:not(.showcode) > .codeview { display: none; }
.codeview { flex: 1; min-height: 0; display: flex; flex-direction: column; } .cjump { flex-wrap: wrap; margin: 0 0 8px; gap: 10px; }
.codeta { flex: 1; min-height: 220px; width: 100%; resize: none; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #05080d; color: #cfe3ee; font: 12px/17px var(--mono); tab-size: 1; white-space: pre; overflow: auto; }
.codeta:not([readonly]) { border-color: var(--a1); } .codeta::selection { background: color-mix(in srgb, var(--a1) 45%, transparent); }
@media (max-width: 719px) { .chatpane.peek.showcode > .codeview { display: none; } }

/* ---- v0.17: the travel line, versions, course ---- */
.travel { position: absolute; left: 10px; right: 10px; bottom: calc(var(--bottom) + 10px); z-index: 4; max-width: 720px; margin: 0 auto; padding: 8px 12px 10px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); } .travel[hidden] { display: none; }
.travel .taxis { margin: 0 0 4px; gap: 12px; flex-wrap: wrap; font-size: 12px; } .trow { gap: 8px; } .tstep { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); color: var(--a1); font-size: 18px; }
.trail { flex: 1; min-width: 0; height: 34px; accent-color: var(--a1); } .tfoot { gap: 8px; margin-top: 2px; align-items: center; } .tname { display: block; max-width: 100%; text-align: left; font-size: 16px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tinfo { font: 11.5px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .travel .fieldstat { position: static; margin-top: 4px; font-size: 11px; letter-spacing: 0.6px; opacity: 0.8; }
.full > .field::after { height: 190px; } .allfields.play { top: calc(var(--top) + 284px); border-color: var(--line); color: var(--text); }
.coursenext { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--a1); border-radius: 12px; font-size: 14px; }
.aithread:empty { display: none; }
.travel .trow { display: flex; flex-wrap: nowrap; align-items: center; } .travel .trail { width: auto; padding: 0; margin: 0; border: 0; background: none; } .travel .allfields { position: static; transform: none; top: auto; padding: 5px 12px; } .tinside { gap: 8px; flex-wrap: wrap; margin-bottom: 6px; } .tinside:has(.allfields:not([hidden])) { display: flex; } .tinside { display: none; }

.scope canvas { height: 176px; }

/* ---- v0.18: the AI's face in the chat, and colours for who said what ---- */
.aistrip { display: flex; gap: 10px; align-items: flex-start; padding: 8px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); } .aistrip canvas { flex: none; }
.aistrip.busy { border-color: var(--ok, #3ddc97); box-shadow: 0 0 18px color-mix(in srgb, var(--ok, #3ddc97) 22%, transparent); } .aistrip.ai { border-color: var(--warn); } .aistrip.you { border-color: var(--ok, #3ddc97); }
.ainow { font-size: 13.5px; line-height: 1.35; } .aitrail { margin-top: 5px; display: grid; gap: 2px; font: 11.5px var(--mono); color: var(--dim); } .aitrail .now { color: var(--ok, #3ddc97); } .aitrail div::before { content: "✓ "; opacity: 0.6; } .aitrail .now::before { content: "▸ "; opacity: 1; }
.cmsg.you { background: color-mix(in srgb, #ff5d6c 11%, var(--panel)); border-color: color-mix(in srgb, #ff5d6c 55%, var(--line)); } .cmsg.you .cwho { color: #ff8a94; }
.cmsg.ai { background: color-mix(in srgb, var(--ok, #3ddc97) 9%, var(--panel)); border-color: color-mix(in srgb, var(--ok, #3ddc97) 50%, var(--line)); } .cmsg.ai .cwho { color: var(--ok, #3ddc97); }
.cmsg.system { color: var(--dim); } .cstep { border-left-color: var(--ok, #3ddc97); }
.copts i.ai, .tag.ai { color: var(--ok, #3ddc97); } .copts i.you, .tag.you { color: #ff8a94; } .tag { font: 11px var(--mono); padding: 2px 7px; border-radius: 6px; background: var(--bg); }
.cq input[type=range] { width: 100%; accent-color: var(--ok, #3ddc97); }

/* ---- v0.19: the chat, small and quiet. No boxes round what the AI says; its status is one live line above the message box ---- */
.chatpane.v2 { padding-left: 14px; padding-right: 14px; } .chatpane.v2 > header { padding-bottom: 4px; }
.v2 .chatlist { gap: 16px; padding: 8px 2px 14px; }
.v2 .cmsg { max-width: 100%; padding: 0; border: 0; border-radius: 0; background: none; font-size: 14px; line-height: 1.5; } .v2 .cmsg .steptext { font-size: 14px; line-height: 1.5; }
.v2 .cmsg.ai { align-self: stretch; padding-left: 11px; border-left: 2px solid color-mix(in srgb, #3ddc97 55%, transparent); }
.v2 .cmsg.you { align-self: flex-end; max-width: 86%; padding: 7px 11px; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, #ff5d6c 9%, var(--panel)); border: 1px solid color-mix(in srgb, #ff5d6c 30%, var(--line)); }
.v2 .cmsg.system { align-self: center; font: 11px var(--mono); color: var(--dim); }
.v2 .cwho { margin: 5px 0 0; gap: 6px; font: 10.5px var(--mono); opacity: 0.5; } .v2 .cwho button { margin-left: 2px; font-size: 13px; opacity: 0; } .v2 .cmsg:hover .cwho button, .v2 .cwho button:focus { opacity: 1; } @media (hover: none) { .v2 .cwho button { opacity: 0.7; } }
ul.mdl { margin: 4px 0; padding-left: 18px; } ul.mdl li { margin: 2px 0; }
.v2 .cplan { border-top: 0; margin-top: 8px; padding-top: 0; gap: 5px; } .v2 .cstep { border-left: 1px solid var(--line); padding-left: 9px; font-size: 13.5px; } .v2 .cstep b { font-weight: 600; } .v2 .cstep span { font-size: 12px; }
.v2 .cq { margin-top: 10px; gap: 5px; font-size: 13.5px; } .v2 .copts { display: flex; flex-wrap: wrap; gap: 6px; } .v2 .copts button { padding: 5px 10px; border-radius: 999px; font-size: 13px; gap: 6px; }
.v2 .btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 999px; } .v2 .crefs span { font-size: 10.5px; padding: 1px 6px; }
.v2 .aistrip { display: block; margin: 0; padding: 0 2px 6px; border: 0; background: none; box-shadow: none; }
.ailine { display: flex; align-items: center; gap: 8px; min-height: 24px; } .ailine canvas { flex: none; }
.v2 .ainow { flex: 1; min-width: 0; font: 12px var(--mono); line-height: 1.3; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2 .aistrip.away .ainow, .v2 .aistrip.you .ainow { color: var(--warn); } .v2 .aistrip.done .ainow { color: var(--ok, #3ddc97); }
.ainow.shimmer { background: linear-gradient(90deg, var(--dim) 35%, var(--text) 50%, var(--dim) 65%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shim 1.7s linear infinite; }
@keyframes shim { from { background-position: 220% 0; } to { background-position: 0 0; } }
.aicount { flex: none; font: 11px var(--mono); color: var(--dim); }
.v2 .aitrail { display: block; margin: 0; padding-left: 2px; } .v2 .aitrail div { font: 11px var(--mono); line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: tick 9s ease-out both; } .v2 .aitrail div::before { content: "\2713  "; opacity: 0.8; }
@keyframes tick { 0% { opacity: 0; max-height: 0; transform: translateY(6px); } 5% { opacity: 1; max-height: 16px; transform: none; } 70% { opacity: 0.85; max-height: 16px; } 100% { opacity: 0; max-height: 0; } }
.composer.mini { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 8px 8px 6px; transition: border-color 0.15s; } .composer.mini:focus-within { border-color: color-mix(in srgb, var(--a1) 55%, var(--line)); }
.chatpane .composer.mini textarea, .composer.mini textarea { display: block; width: 100%; min-height: 0; border: 0; background: none; padding: 2px 4px; resize: none; font-size: 14.5px; line-height: 1.4; outline: none; box-shadow: none; }
.cbar { display: flex; align-items: center; gap: 2px; margin-top: 4px; min-width: 0; } .cbar .dim:empty { display: none; }
.ibtn { flex: none; width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: none; color: var(--dim); padding: 0; cursor: pointer; } .ibtn:hover { background: var(--panel2); color: var(--text); } .ibtn.on { color: var(--a1); background: var(--panel2); } .ibtn.rec { color: #ff5d6c; animation: recp 1.1s ease-in-out infinite; } .ibtn:disabled { opacity: 0.35; }
@keyframes recp { 50% { opacity: 0.45; } } .ico { display: inline-grid; }
.mchip { flex: 0 1 auto; min-width: 0; max-width: 140px; margin-right: 6px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); font: 11px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mchip:hover { color: var(--text); }
.sendbtn { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; padding: 0; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); } .sendbtn:hover { border-color: var(--a1); } .sendbtn canvas { pointer-events: none; }
.mmenu { display: grid; gap: 3px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); } .mmenu button { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 6px 8px; border-radius: 10px; text-align: left; font-size: 13px; color: var(--text); } .mmenu button.on { background: var(--panel2); } .mmenu button:hover { background: var(--panel2); }
.mmenu button span { grid-column: 1 / -1; font-size: 11.5px; color: var(--dim); } .mmenu i { font: 10.5px var(--mono); font-style: normal; color: #3ddc97; }
.v2 .pickbar:empty { display: none; } .chatpane.showcode > .aistrip, .chatpane.showcode > .pickbar { display: none; }

/* ---- v0.20: the spoken caption keeps off the 3D view. It is the first line of the page beside the picture, and stays there while the page scrolls ---- */
.sheet > .caption { position: sticky; top: 0; bottom: auto; left: auto; transform: none; z-index: 6; width: auto; max-width: none; margin: -14px -14px 10px; padding: 9px 16px 8px; border-radius: 22px 22px 0 0; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.4; text-align: center; pointer-events: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.sheet > .caption[hidden] { display: none; }
@media (min-width: 860px) { .game.lay-side .sheet > .caption { border-radius: 0; } }

/* ---- v0.21: exam questions (nine dots, red to green), the whiteboard beside them, the course page ---- */
.exdots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; } .exlv { display: inline-flex; align-items: center; gap: 5px; } .exlv i { font: 10.5px var(--mono); font-style: normal; color: var(--dim); margin-right: 1px; }
.exdot { width: 15px; height: 15px; padding: 0; border-radius: 50%; border: 1.5px solid var(--line); background: none; display: inline-block; } button.exdot { cursor: pointer; } .exdot.cur { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }
.exdot.red { background: #ff5d6c; border-color: #ff5d6c; } .exdot.yellow { background: #ffd166; border-color: #ffd166; } .exdot.blue { background: #5b9dff; border-color: #5b9dff; } .exdot.green { background: #3ddc97; border-color: #3ddc97; }
.exsum { font: 12px var(--mono); color: var(--dim); margin-left: auto; } .exsum.all { color: #3ddc97; }
.excard { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); display: grid; gap: 10px; }
.exhead { display: flex; align-items: baseline; gap: 10px; font: 12px var(--mono); color: var(--dim); } .exhead b { color: var(--a1); font-size: 13px; } .extimer { font-variant-numeric: tabular-nums; } .extimer.over { color: #ffd166; }
.exq .steptext { font-size: 16px; line-height: 1.5; } .exunit { font: 13px var(--mono); color: var(--dim); align-self: center; }
.excard input[type=text] { width: 100%; font-size: 16px; } .exam.boardfirst .scratch .pad { min-height: 300px; }
.exopts { display: grid; gap: 7px; } .exopts button { text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 14.5px; } .exopts button.good { border-color: #3ddc97; } .exopts button.bad { border-color: #ff5d6c; opacity: 0.55; }
.exfb { font-size: 14px; line-height: 1.4; } .exfb:empty { display: none; } .exfb.miss { color: var(--dim); } .exfb.red { color: #ff8a94; } .exfb.yellow { color: #ffd166; } .exfb.blue { color: #8fbaff; } .exfb.green { color: #3ddc97; }
.exwork:empty, .exteacher:empty { display: none; } .exwork, .exteacher { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; display: grid; gap: 6px; } .exwork ol, .exteacher ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; } .exwork .steptext { font-size: 14px; }
.exteacher { border-color: color-mix(in srgb, #3ddc97 45%, var(--line)); } .exteacher.waiting { border-style: dashed; border-color: var(--line); color: var(--dim); } .exteacher p { margin: 0; }
.exfoot { margin-top: 2px; } .exlink { font: 12px var(--mono); color: var(--dim); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; } .exall { color: #3ddc97; font-size: 15px; }
.course { max-width: 760px; margin: 0 auto; padding: 8px 4px 60px; } .units { list-style: none; counter-reset: unit; margin: 0; padding: 0; display: grid; gap: 8px; }
.units li { counter-increment: unit; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); } .units li.todo { background: none; border-style: dashed; }
.units li::before { content: counter(unit); flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font: 12px var(--mono); color: var(--dim); }
.utext { display: grid; gap: 2px; min-width: 180px; } .utext span { font-size: 13px; color: var(--dim); } .card.course { align-items: center; }

/* ---- v0.22: answers by keys or handwriting, teachers, hesitation help, calculator SHIFT ---- */
.apad { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); }
.aphead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; } .apslots { display: flex; gap: 6px; flex-wrap: wrap; }
.apslot { min-width: 96px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); display: flex; align-items: baseline; gap: 6px; font: 20px var(--mono); color: var(--text); } .apslot.on { border-color: var(--a1); } .apslot.empty b { color: var(--dim); }
.apslot i { font: 11px var(--mono); font-style: normal; color: var(--dim); } .apslot span { font-size: 13px; color: var(--dim); }
.aptabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; } .aptabs button { padding: 5px 12px; font-size: 12.5px; color: var(--dim); } .aptabs button.on { background: var(--panel); color: var(--text); }
.apkeys { display: grid; grid-template-columns: repeat(3, 1fr) ; gap: 6px; margin-top: 10px; max-width: 320px; } .apkeys.alg { grid-template-columns: repeat(5, 1fr); max-width: 460px; }
.apk { padding: 11px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 17px var(--mono); box-shadow: 0 2px 0 rgba(0,0,0,0.35); transition: transform 0.06s, box-shadow 0.06s; } .apk:active { transform: translateY(2px); box-shadow: none; }
.apk.op, .apk.var { color: var(--a1); } .apk.fn { color: var(--dim); font-size: 14px; } .apk.wide { grid-column: span 2; }
.apcells { display: flex; gap: 6px; margin: 10px 0 6px; flex-wrap: wrap; } .apcell { position: relative; display: grid; justify-items: center; gap: 2px; }
.apcell canvas { border-radius: 8px; background: #fbfaf6; border: 1px solid #c9c2ad; touch-action: none; background-image: linear-gradient(transparent 70%, rgba(40,70,140,0.18) 70%, rgba(40,70,140,0.18) calc(70% + 1px), transparent calc(70% + 1px)); }
.apcell i { font: 13px var(--mono); font-style: normal; color: var(--a1); min-height: 16px; } .apcell button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 1; background: var(--panel); color: var(--dim); border: 1px solid var(--line); }
.exnudge:empty { display: none; } .exnudge { display: grid; gap: 4px; padding: 8px 12px; border-left: 2px solid #5b9dff; font-size: 14px; } .exnudge .nline { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; } .exnudge .steptext { font-size: 14px; }
.twrap { position: relative; } .tchip { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); font: 11.5px var(--mono); color: var(--text); } .tchip i { font-style: normal; color: #3ddc97; margin-right: 5px; font-size: 9px; }
.tbox { position: absolute; z-index: 20; top: 28px; left: 0; width: 280px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); box-shadow: 0 12px 30px rgba(0,0,0,0.4); display: grid; gap: 5px; font: 13px system-ui, sans-serif; color: var(--text); } .tbox[hidden] { display: none; }
.trow { display: grid; text-align: left; padding: 6px 8px; border-radius: 10px; } .trow.on { background: var(--panel2); } .trow span { font-size: 12px; color: var(--dim); } .tbox select { font-size: 12.5px; }
.ck.hs { position: relative; padding-top: 14px; } .ck .sl { position: absolute; top: 2px; left: 0; right: 0; font-size: 9.5px; color: #e0a43a; opacity: 0.85; line-height: 1; pointer-events: none; } .ckeys.shifted .ck .sl { opacity: 0; } .ckeys.shifted .ck.hs { color: #ffbf47; }
.ck.shift { color: #ffbf47; } .ck.shift.on { background: #ffbf47; color: #1b1300; }

/* ---- v0.23: the bench, the IDE layout on wide screens, readings that explain themselves, the magic board card ---- */
.benchslot:empty { display: none; } .bench { display: grid; gap: 8px; margin-bottom: 12px; } .brow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .brow.time input { flex: 1; accent-color: var(--a1); } .brow select { font-size: 13px; }
.btools { display: flex; flex-wrap: wrap; gap: 5px; } .btool { display: grid; justify-items: center; gap: 1px; min-width: 62px; padding: 6px 6px 5px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); box-shadow: 0 3px 0 rgba(0,0,0,0.4); transition: transform 0.07s, box-shadow 0.07s; }
.btool:active { transform: translateY(3px); box-shadow: none; } .btool.on { border-color: var(--a1); box-shadow: 0 0 0 1px var(--a1), 0 3px 0 rgba(0,0,0,0.4); } .btool b { font-size: 17px; line-height: 1.1; } .btool span { font: 10.5px var(--mono); color: var(--dim); }
.btool.probe.vr b { color: #ff6b6b; } .btool.probe.vb b { color: #c9cfdc; } .btool.probe.ch1 b { color: #ffd166; } .btool.probe.ch2 b { color: #4dd2ff; }
.bnote { font-size: 13px; color: var(--dim); min-height: 18px; } .binsp:empty { display: none; } .binsp { display: grid; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--a1) 35%, var(--line)); background: var(--panel); }
.bset { display: flex; align-items: center; gap: 8px; font-size: 13.5px; } .bset span { min-width: 92px; color: var(--dim); } .bset b { min-width: 86px; text-align: center; font: 15px var(--mono); } .bset button { min-width: 34px; padding: 5px 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); } .bset button.on { border-color: var(--a1); }
.bspark canvas { display: block; margin-top: 4px; border-radius: 8px; background: rgba(0,0,0,0.25); } .btable { display: grid; gap: 3px; } .brd { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 8px; padding: 5px 8px; border-radius: 8px; text-align: left; font: 12.5px var(--mono); color: var(--text); } .brd.on, .brd:hover { background: var(--panel2); }
.hud .hudr { pointer-events: auto; cursor: pointer; } .hud .hudr:hover { outline: 1px solid var(--a1); }
.mcardwrap { position: relative; margin: 0 0 12px; display: flex; justify-content: center; } .mcard { max-width: 100%; height: auto !important; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); } .mcardx { position: absolute; top: 6px; right: max(6px, calc(50% - 280px + 6px)); width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.08); color: #333; font-size: 18px; }
@media (min-width: 1100px) {
  .game.ide.lay-side .stagewrap { flex: 1 1 62%; } .game.ide.lay-side .sheet { flex: 0 0 38%; max-width: 560px; }
  .game.ide.with-chat { margin-right: 0; } .game.ide.with-chat .sheet { display: none; } .game.ide.with-chat .stagewrap { margin-right: min(560px, 38vw); } .game.ide ~ .chatpane, .game.ide .chatpane { width: min(560px, 38vw); }
}
.chatpane .tocontrols { font: 11.5px var(--mono); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); font-size: 11.5px !important; } @media (max-width: 1099px) { .chatpane .tocontrols { display: none; } }

.bnow { font: 13.5px var(--mono); color: var(--a1); }

.scratch .pad .rods { pointer-events: none; z-index: 3; }

/* ---- v0.24: a calculator that looks and feels like the real thing ---- */
.calcbody { background: linear-gradient(180deg, #2b2f36, #1b1e23); border-radius: 18px; padding: 10px 12px 14px; border: 1px solid #3a3f48; box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 14px 30px rgba(0,0,0,0.45); }
.cbrand { display: flex; align-items: center; gap: 8px; padding: 0 2px 8px; font: 11px var(--mono); color: #aeb4c0; letter-spacing: 0.4px; } .cbrand b { font: 700 12.5px system-ui, sans-serif; color: #e8ebf2; letter-spacing: 0.2px; } .cbrand span { color: #8d94a1; }
.cbrand .solar { margin-left: auto; width: 74px; height: 16px; border-radius: 3px; background: repeating-linear-gradient(90deg, #3a2a1c 0 17px, #22170f 17px 18.5px); border: 1px solid #120c07; box-shadow: inset 0 1px 2px rgba(0,0,0,0.6); }
.calcbody .cscreen { background: linear-gradient(180deg, #c6d3b8, #b5c4a6); color: #172014; border: 3px solid #0d110c; border-radius: 9px; box-shadow: inset 0 3px 8px rgba(0,0,0,0.35); padding: 6px 10px 6px; }
.calcbody .cscreen .cres { font: 600 30px/1.15 'DSEG7 Classic', 'Segoe UI Mono', ui-monospace, monospace; letter-spacing: 0.5px; min-height: 36px; } .calcbody .cscreen .cexpr { font-size: 15px; }
.calcbody .ckeys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px 7px; margin-top: 10px; }
.calcbody .kc { display: grid; grid-template-rows: 13px auto; justify-items: stretch; min-width: 0; } .calcbody .kc.eqc { grid-column: span 2; } .calcbody .kc.m.wide { grid-column: span 3; }
.calcbody .kc .sl { position: static; font: 600 9.5px/13px system-ui, sans-serif; color: #e9a63a; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip; opacity: 0.95; transition: color 0.15s, text-shadow 0.15s; }
.calcbody .ckeys.shifted .kc .sl { color: #ffd27a; text-shadow: 0 0 6px rgba(255,191,71,0.8); opacity: 1; } .calcbody .ckeys.shifted .ck { color: inherit; }
.calcbody .ck { position: relative; height: 36px; padding: 0 2px; border-radius: 9px 9px 11px 11px; border: 0; font: 600 15px system-ui, sans-serif; color: #f2f4f8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, #4a505a 0%, #363b44 55%, #2c3038 100%); box-shadow: 0 3px 0 #15181c, 0 4px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18); transition: transform 0.05s, box-shadow 0.05s; }
.calcbody .ck:active { transform: translateY(3px); box-shadow: 0 0 0 #15181c, 0 1px 2px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.12); }
.calcbody .ck.f { height: 30px; font-size: 13px; font-weight: 600; color: #f2f4f8; background: linear-gradient(180deg, #343941, #24282e); }
.calcbody .ck.n { height: 40px; font-size: 18px; color: #1a1d22; background: linear-gradient(180deg, #f4f5f7 0%, #dfe2e7 60%, #cfd3d9 100%); box-shadow: 0 3px 0 #8e949d, 0 4px 6px rgba(0,0,0,0.4), inset 0 1px 0 #fff; }
.calcbody .ck.n:active { box-shadow: 0 0 0 #8e949d, 0 1px 2px rgba(0,0,0,0.4), inset 0 1px 0 #fff; }
.calcbody .ck.o { height: 40px; font-size: 20px; color: #f2f4f8; background: linear-gradient(180deg, #5b6270, #3f4550); }
.calcbody .ck.c { height: 40px; font-size: 14px; color: #fff; background: linear-gradient(180deg, #ff8a3d, #e25e0e); box-shadow: 0 3px 0 #8c3305, 0 4px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.35); }
.calcbody .ck.eq { height: 40px; font-size: 22px; color: #052019; background: linear-gradient(180deg, #6ff2c8, #2fc79a); box-shadow: 0 3px 0 #11604a, 0 4px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.5); }
.calcbody .ck.m { height: 28px; font: 600 11.5px system-ui, sans-serif; color: #cdd2db; background: linear-gradient(180deg, #30343b, #22252a); border-radius: 14px; }
.calcbody .ck.shift { color: #ffbf47; } .calcbody .ck.shift.on { color: #1b1300; background: linear-gradient(180deg, #ffd27a, #f0a22a); }
.calcbody .ck.m.wide:disabled { opacity: 0.45; }
.calcbody .cown, .calcbody .ckept { color: #cdd2db; } .calcbody .ck.l { height: 28px; border-radius: 14px; font-size: 12.5px; color: #7ff0c8; background: linear-gradient(180deg, #30343b, #22252a); }
.calcbody.basic .kc.f, .calcbody.basic .kc.sci { display: none; } .calcbody.basic .kc.m.wide { grid-column: span 5; }
.calcdock .calcbody { margin: 0; } .calcdock .calcbody .ck.n, .calcdock .calcbody .ck.o, .calcdock .calcbody .ck.c, .calcdock .calcbody .ck.eq { height: 36px; } .calcdock .calcbody .ck.f { height: 28px; }
@media (max-width: 420px) { .calcbody .ckeys { gap: 2px 5px; } .calcbody .kc .sl { font-size: 8.5px; } .calcbody .ck.f { font-size: 12px; } }

/* ---- tabs that look like tabs ---- */
.ptabs { display: flex; gap: 2px; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; overflow-x: auto; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs button { flex: 0 0 auto; padding: 9px 14px 8px; border-radius: 10px 10px 0 0; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; background: none; color: var(--dim); font: 13px var(--mono); }
.ptabs button.on { color: var(--text); background: var(--bg); border-color: var(--line); box-shadow: inset 0 2px 0 var(--a1); }
.ptabs button.ed { margin-left: auto; color: var(--a1); } .ptabs button:hover:not(.on) { color: var(--text); }

/* the calculator docks at the foot of the right column on wide screens: the page scrolls above it, nothing covers the 3D */
@media (min-width: 1100px) {
  .game.ide .calcdock { right: 0; left: auto; bottom: 0; width: min(560px, 38vw); max-height: 64dvh; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .game.ide.calc-open .sheet { padding-bottom: 64dvh; }
  .game.ide .calcfab { right: calc(min(560px, 38vw) + 14px); }
}

/* phones: the readings become one compact row along the top of the view */
@media (max-width: 719px) {
  .stagewrap .hud { left: 10px; right: 10px; top: calc(var(--top) + 52px); flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: none; }
  .stagewrap .hud div { font-size: 11px; padding: 2px 7px; } .stagewrap .hud b { margin-left: 4px; }
}
