.g-page.wide { max-width: 1120px; }
.bigemoji { font-size: 3.4rem; }
.labs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
@media (max-width: 1000px) { .labs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .labs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lab-btn[data-lab="daily"] { grid-column: 1 / -1; } }
.lab-btn {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 12px 14px;
  text-align: left;
  color: var(--ink);
  font-family: var(--font);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--line-strong);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.lab-btn .ic { grid-row: 1 / 3; font-size: 1.9rem; line-height: 1; }
.lab-btn b { font-size: 1rem; }
.lab-btn small { color: var(--muted); font-weight: 600; font-size: 0.72rem; }
.lab-btn:hover { transform: translateY(-2px); }
.lab-btn[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 4px 0 var(--gold-deep); }
.lab-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tabs { margin-bottom: 14px; }
.lab-body { display: grid; gap: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(10px); max-width: 90%; padding: 9px 18px; border-radius: 999px; font-weight: 800; font-size: 0.9rem; color: #fff; background: rgba(20, 30, 60, 0.94); border: 1px solid rgba(255, 255, 255, 0.2); opacity: 0; pointer-events: none; z-index: 60; transition: opacity 0.2s, transform 0.2s; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.good { background: #1c8a58; }
.toast.bad { background: #c23a3f; }
.note { margin: 20px 4px 0; font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.note a { color: var(--blue); }
:root[data-theme="dark"] .note a { color: var(--focus); }
.two > * { min-width: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 980px) { .two { grid-template-columns: minmax(0, 1fr) 340px; } }
.lbl { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.sm { padding: 7px 14px; font-size: 0.85rem; }
.missed { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 16px; max-height: 140px; overflow: auto; }
.missed span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 0.85rem; }
.missed b { width: 100%; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ---------- periodic table ---------- */
:root {
  --c-alkali: #d04146; --c-alkaline: #a76406; --c-trans: #466fd5; --c-post: #1c8458; --c-metalloid: #0e8181;
  --c-nonmetal: #8457e9; --c-noble: #c53f98; --c-lanth: #5865e8; --c-actin: #984edd; --c-unknown: #64748b;
}
.pt-wrap { overflow-x: auto; padding-bottom: 6px; }
.pt-grid { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 3px; min-width: 610px; }
.el {
  position: relative;
  aspect-ratio: 1 / 1.05;
  padding: 2px 3px 3px;
  display: grid;
  align-content: space-between;
  justify-items: center;
  text-align: center;
  color: #fff;
  font-family: var(--font);
  background: var(--col);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.2s ease, filter 0.2s ease;
}
.el .n { justify-self: start; font-size: 0.56rem; line-height: 1.2; padding: 0 3px; border-radius: 4px; background: rgba(0, 0, 0, 0.42); color: #fff; font-weight: 800; }
.el .s { font-size: 1.05rem; font-weight: 800; line-height: 1; }
.el .nm { display: none; font-size: 0.5rem; font-weight: 600; opacity: 0.95; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el:hover { transform: scale(1.14); z-index: 3; }
.el.dim { opacity: 0.18; filter: grayscale(0.6); }
.el.sel { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 4; transform: scale(1.14); }
.el.gap { visibility: hidden; }
.el:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pt-note { grid-column: 3 / 13; align-self: center; font-size: 0.72rem; color: var(--muted); font-weight: 600; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.legend button { display: inline-flex; align-items: center; gap: 6px; font: 700 0.75rem var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.legend button i { width: 11px; height: 11px; border-radius: 3px; background: var(--col); }
.legend button[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }
.search { flex: 1 1 200px; min-width: 0; max-width: 100%; box-sizing: border-box; font: 700 0.95rem var(--font); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; }
.search:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.detail { display: grid; gap: 12px; }
.detail .empty { color: var(--muted); }
.big-el { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.tile { width: 92px; height: 100px; display: grid; align-content: center; justify-items: center; color: #fff; background: var(--col); border-radius: 14px; box-shadow: var(--shadow); position: relative; }
.tile .n { position: absolute; left: 8px; top: 6px; font-size: 0.8rem; font-weight: 700; }
.tile .s { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.tile .m { font-size: 0.7rem; font-weight: 700; margin-top: 4px; }
.big-el h2 { margin: 0; font-size: 1.5rem; }
.big-el p { margin: 3px 0 0; color: var(--muted); font-size: 0.9rem; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv div { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.kv span { display: block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kv b { display: block; font-size: 0.92rem; overflow-wrap: anywhere; }
.kv .wide { grid-column: 1 / -1; }
.sumtext { font-size: 0.9rem; line-height: 1.55; color: var(--ink); }
.bohr { width: 100%; max-width: 210px; justify-self: center; }
.bohr circle.orbit { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.bohr circle.e { fill: var(--gold-deep); }
:root[data-theme="dark"] .bohr circle.e { fill: var(--gold); }
.bohr circle.core { fill: var(--col); }
.bohr text { fill: #fff; font: 800 11px var(--font); text-anchor: middle; dominant-baseline: central; }

/* ---------- challenge / quiz ---------- */
.qbox { display: grid; gap: 12px; max-width: 760px; }
.qhead { display: flex; justify-content: space-between; align-items: center; font-weight: 800; gap: 12px; }
.qhead .pills { display: flex; gap: 8px; }
.qhead .pill { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.qbar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.qbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #22a06b, #f0b400); transform-origin: left; }
.qtext { font-size: 1.3rem; font-weight: 800; line-height: 1.35; }
.qbig { font-size: 3.2rem; font-weight: 800; text-align: center; padding: 10px 0; }
.clues { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.clues li { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 650; }
.clues li.new { animation: pop 0.3s ease; border-color: var(--gold); }
@keyframes pop { from { transform: scale(0.96); opacity: 0.3; } }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .choices { grid-template-columns: 1fr; } }
.choice { padding: 14px; text-align: left; font: 700 1rem var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 3px 0 var(--line-strong); cursor: pointer; }
.choice:hover:not(:disabled) { background: var(--gold-soft); }
.choice.right { background: color-mix(in srgb, var(--green) 26%, var(--surface)); border-color: var(--green); }
.choice.wrong { background: color-mix(in srgb, var(--red) 22%, var(--surface)); border-color: var(--red); }
.explain { padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold); font-weight: 600; line-height: 1.5; }
.explain:empty { display: none; }
.picker { display: grid; gap: 10px; }

/* ---- physics ---- */
.sim { width: 100%; display: block; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); touch-action: none; }
.ctl { display: grid; gap: 12px; }
.ctl label { display: grid; gap: 4px; font-weight: 700; font-size: 0.9rem; }
.ctl label span { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; }
.ctl label span b { color: var(--ink); }
.ctl input[type=range] { width: 100%; accent-color: var(--gold); }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.readout div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.readout small { display: block; color: var(--muted); font-size: 0.7rem; letter-spacing: .06em; text-transform: uppercase; }
.readout b { font-size: 1.05rem; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }

/* ---- biology ---- */
.cellsvg { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.cellsvg .org { cursor: pointer; transition: filter .15s; }
.cellsvg .org:hover, .cellsvg .org.sel { filter: brightness(1.25) drop-shadow(0 0 5px var(--gold)); }
.cellsvg text { pointer-events: none; font: 700 11px system-ui; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width: 3px; }
.orglist { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.dnaq { text-align: center; }
.strand { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.base { width: 46px; height: 58px; border-radius: 12px; display: grid; place-items: center; font: 800 1.4rem var(--font); color: #fff; }
.base.ans { background: transparent; border: 2px dashed var(--line-strong); color: var(--ink); }
.base.ans.cur { border-color: var(--gold); }
.base.ok { outline: 3px solid var(--green); }
.base.bad { outline: 3px solid var(--red); }
.bA { background: #e5484d; } .bT { background: #3b82f6; } .bC { background: #16a34a; } .bG { background: #f59e0b; color: #222; } .bU { background: #a855f7; }
.pad { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.pad .base { cursor: pointer; border: 0; }
.pad .base:active { transform: scale(.94); }
.strand .base { width: clamp(24px, calc((100vw - 80px) / 10 - 6px), 46px); height: clamp(38px, 12vw, 58px); font-size: clamp(1rem, 4vw, 1.4rem); }
.quizsetup { display: grid; gap: 14px; }

.dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.dstats div { padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); text-align: center; }
.dstats small { display: block; color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em; }
.dstats b { font-size: 1.3rem; }

/* ---- more activities ---- */
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chain { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; min-height: 84px; }
.fcard { display: grid; justify-items: center; gap: 2px; min-width: 84px; padding: 10px 8px; border: 2px solid var(--line-strong); border-radius: 14px; background: var(--surface-2); font: 700 0.85rem var(--font); color: var(--ink); cursor: pointer; }
.fcard span { font-size: 2rem; line-height: 1.1; }
.fcard.placed { border-color: var(--green); background: color-mix(in srgb, var(--green) 18%, var(--surface-2)); cursor: default; }
.fcard.shake { animation: shake .3s; border-color: var(--red); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.slots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 8px 0; }
.slot { width: 84px; height: 84px; border: 2px dashed var(--line-strong); border-radius: 14px; display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 0.75rem; text-align: center; }
.slot.filled { border-style: solid; border-color: var(--green); color: var(--ink); }
.arrow { color: var(--muted); font-weight: 800; }
.punn { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px; max-width: 360px; margin: 12px auto; }
.punn div { display: grid; place-items: center; min-height: 64px; border-radius: 12px; font: 800 1.2rem var(--font); }
.punn .h { color: var(--muted); background: transparent; min-height: 40px; }
.punn .c { border: 2px solid var(--line-strong); background: var(--surface-2); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font: 700 1.4rem var(--font); margin: 14px 0; }
.mol { display: grid; justify-items: center; gap: 4px; }
.mol .step { display: flex; align-items: center; gap: 4px; }
.mol button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: 800 1rem var(--font); cursor: pointer; }
.mol .co { min-width: 26px; text-align: center; color: var(--gold); }
.mol .f { font-size: 1.5rem; }
.mol .f sub { font-size: .65em; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin: 10px 0; }
.counts div { padding: 8px; border-radius: 10px; border: 2px solid var(--line); text-align: center; font-weight: 700; font-size: .85rem; }
.counts div.ok { border-color: var(--green); }
.counts div.no { border-color: var(--red); }
.circuit { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.circuit .wire { fill: none; stroke: var(--muted); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.circuit .flow { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1 13; animation: flow var(--dur, 1s) linear infinite; }
@keyframes flow { to { stroke-dashoffset: -14; } }
html[data-saver="on"] .circuit .flow { animation: none; }
.circuit text { font: 700 12px system-ui; fill: var(--muted); }

.anat { position: relative; max-width: 640px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.anat img { display: block; width: 100%; height: auto; }
.anat svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.anat .hs ellipse { fill: transparent; stroke: transparent; stroke-width: 5; cursor: pointer; transition: fill .15s, stroke .15s; }
.anat .hs:hover ellipse { fill: rgba(245, 180, 0, 0.22); stroke: rgba(245, 180, 0, 0.7); }
.anat .hs.sel ellipse { fill: rgba(245, 180, 0, 0.3); stroke: #e08a00; stroke-width: 6; }
