/* Layout: sticky glass nav over a calm canvas; home is a hero + tool grid; each tool is a page with one main panel; the board takes the whole screen. */
:root {
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #EEF0F6;
  --ink: #0E1120;
  --muted: #5E6378;
  --line: #E3E6EF;
  --cobalt: #2563EB;
  --coral: #F2643D;
  --emerald: #0FA974;
  --rose: #E5397A;
  --amber: #E89A00;
  --violet: #7B4DEB;
  --sky: #0B9BD8;
  --lime: #5E9C0C;
  --focus: #2563EB;
  --shadow-sm: 0 1px 2px rgba(14, 17, 32, .05), 0 2px 8px rgba(14, 17, 32, .04);
  --shadow: 0 1px 2px rgba(14, 17, 32, .04), 0 12px 32px -8px rgba(14, 17, 32, .12);
  --shadow-lg: 0 2px 4px rgba(14, 17, 32, .06), 0 24px 60px -12px rgba(14, 17, 32, .28);
  --display: "Gabarito", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible Next", "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0E19; --surface: #161A2B; --surface-2: #1F2438; --ink: #F1F3FB; --muted: #A0A6C0; --line: #282E46;
    --cobalt: #6B97FF; --coral: #FF845F; --emerald: #2FD199; --rose: #FF6B9E; --amber: #FFC043; --violet: #A383FF; --sky: #4CC3F5; --lime: #9BD94A;
    --focus: #6B97FF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 12px 32px -8px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C0E19; --surface: #161A2B; --surface-2: #1F2438; --ink: #F1F3FB; --muted: #A0A6C0; --line: #282E46;
  --cobalt: #6B97FF; --coral: #FF845F; --emerald: #2FD199; --rose: #FF6B9E; --amber: #FFC043; --violet: #A383FF; --sky: #4CC3F5; --lime: #9BD94A;
  --focus: #6B97FF;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 12px 32px -8px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* Accent helper: any element with a c-* class gets --c and a soft tint */
.c-cobalt { --c: var(--cobalt); } .c-coral { --c: var(--coral); } .c-emerald { --c: var(--emerald); }
.c-rose { --c: var(--rose); } .c-amber { --c: var(--amber); } .c-violet { --c: var(--violet); }
.c-sky { --c: var(--sky); } .c-lime { --c: var(--lime); }
[class*="c-"] { --c-soft: color-mix(in srgb, var(--c) 12%, var(--surface)); --c-line: color-mix(in srgb, var(--c) 30%, var(--line)); }

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.center { justify-content: center; }

/* Buttons */
.btn {
  appearance: none; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  border-radius: 12px; padding: 10px 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--cobalt)); }
.btn.big { font-size: 17px; padding: 14px 24px; border-radius: 14px; }
.btn.big svg { width: 20px; height: 20px; }
.btn.small { font-size: 14px; padding: 7px 12px; border-radius: 10px; box-shadow: none; }
.btn.icon-only { padding: 10px; }
.btn.icon-only.big { padding: 14px; }
.btn.glass {
  background: rgba(255, 255, 255, .72); border-color: rgba(255, 255, 255, .6); color: #0E1120;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn.glass:hover { background: rgba(255, 255, 255, .9); }
.confirm { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 24px;
  padding: 12px max(20px, env(safe-area-inset-right, 0px)) 12px max(20px, env(safe-area-inset-left, 0px));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo { width: 36px; height: 36px; border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px; background: var(--ink); }
.logo i { border-radius: 3px; }
.logo i:nth-child(1) { background: #4F86FF; } .logo i:nth-child(2) { background: #FF7A52; }
.logo i:nth-child(3) { background: #22C993; } .logo i:nth-child(4) { background: #FFC043; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.nav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; margin-left: auto; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }

/* Page frame */
.page {
  max-width: 1240px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: 40px 64px;
  display: flex; flex-direction: column; gap: 40px;
}

/* Home */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero-side { display: flex; flex-direction: column; gap: 12px; width: min(340px, 100%); }
.hero-side .date-card { align-self: stretch; }
.hero h1 { margin: 0; font-size: clamp(36px, 5vw, 60px); font-weight: 700; line-height: 1.02; }
.hero p { margin: 10px 0 0; color: var(--muted); font-size: 18px; max-width: 52ch; }
.date-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 18px 10px 10px; box-shadow: var(--shadow-sm); }
.date-day { width: 52px; height: 52px; border-radius: 12px; background: var(--coral); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1; }
.date-text b { display: block; font-size: 16px; }
.date-text span { color: var(--muted); font-size: 14px; }

.feature {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  border-radius: 24px; padding: clamp(24px, 3.5vw, 40px);
  background: linear-gradient(120deg, color-mix(in srgb, var(--cobalt) 10%, var(--surface)) 0%, var(--surface) 50%, color-mix(in srgb, var(--coral) 12%, var(--surface)) 100%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.feature-q { margin: 10px 0 0; font-family: var(--display); font-size: clamp(22px, 2.8vw, 34px); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.feature-q .x { color: var(--cobalt); } .feature-q .y { color: var(--coral); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 26px; font-weight: 700; }
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tool {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.tool:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--c-line); }
.tool-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 100%);
  box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--c) 60%, transparent);
}
.tool-icon svg { width: 26px; height: 26px; }
.tool h3 { margin: 4px 0 0; font-size: 20px; font-weight: 700; }
.tool p { margin: 0; color: var(--muted); font-size: 15px; }
.tool .go { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 14.5px; color: var(--c); display: inline-flex; align-items: center; gap: 6px; }
.tool .go svg { width: 16px; height: 16px; transition: transform .18s ease; }
a.tool:hover .go svg { transform: translateX(3px); }
.tool.soon { box-shadow: none; background: transparent; border-style: dashed; }
.tool.soon .tool-icon { filter: grayscale(.4); opacity: .7; box-shadow: none; }
.tool.soon .go { color: var(--muted); }

/* My links */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.link { display: flex; align-items: center; gap: 12px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 10px 12px; box-shadow: var(--shadow-sm); }
.link:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.link a { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; }
.badge { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--c); }
.link-text { min-width: 0; }
.link-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-url { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remove { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; flex: none; }
.remove:hover { background: var(--surface-2); color: var(--ink); }
.remove svg { width: 16px; height: 16px; }
.empty { border: 1.5px dashed var(--line); border-radius: 16px; padding: 22px; color: var(--muted); grid-column: 1 / -1; text-align: center; }
.add-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
input[type="text"], textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; min-width: 0;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.add-form input { flex: 1 1 200px; }
.form-msg { width: 100%; margin: 0; font-size: 14px; color: var(--rose); }

/* Tool pages */
.tool-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.tool-head h1 { margin: 6px 0 0; font-size: clamp(30px, 4vw, 44px); font-weight: 700; line-height: 1.05; }
.tool-head p { margin: 8px 0 0; color: var(--muted); font-size: 17px; max-width: 60ch; }
.tool-head .eyebrow::before { background: var(--c); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(20px, 3vw, 36px); min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.page.fs { max-width: none; min-height: 100vh; justify-content: center; }

/* Timer */
.timer { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.timer-dial { display: flex; align-items: center; gap: 20px; }
.timer-ring { position: relative; width: min(440px, 72vw); aspect-ratio: 1; container-type: inline-size; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--emerald); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s ease; }
.timer.warning .ring-fg { stroke: var(--amber); }
.timer.done .ring-fg { stroke: var(--coral); }
.timer-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqi; }
.timer-digits { font-family: var(--display); font-weight: 700; font-size: 22cqi; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.timer-status { font-size: max(12px, 4.5cqi); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.timer.done .timer-digits, .timer.done .timer-status { color: var(--coral); }
.timer.done .timer-ring { animation: pulse 1s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.presets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.preset {
  appearance: none; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
}
.preset:hover { border-color: var(--emerald); color: var(--emerald); }

/* Class list */
.roster { display: flex; flex-direction: column; gap: 14px; }
.roster-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.roster-head h3 { margin: 0; font-size: 19px; }
.roster-count { font-size: 14px; color: var(--muted); }
.roster-note { margin: 0; font-size: 14px; color: var(--muted); }
.roster-note.warn { color: var(--ink); background: color-mix(in srgb, var(--amber) 16%, var(--surface)); border-radius: 10px; padding: 8px 12px; }
.roster-editor { display: flex; flex-direction: column; gap: 10px; }
.roster-input { width: 100%; resize: vertical; min-height: 220px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
}
.chip:hover { border-color: var(--muted); }
.chip.absent { background: transparent; color: var(--muted); text-decoration: line-through; border-style: dashed; }
.chip.static { cursor: default; }
.chips.small .chip { font-size: 13px; padding: 4px 10px; }

/* Name picker */
.picker { display: flex; flex-direction: column; gap: 24px; }
.pick-stage {
  border-radius: 20px; min-height: 280px; padding: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--violet) 22%, var(--surface)) 0%, transparent 60%),
              radial-gradient(120% 120% at 100% 100%, color-mix(in srgb, var(--rose) 22%, var(--surface)) 0%, transparent 60%),
              var(--surface-2);
}
.pick-name { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 8vw, 112px); line-height: 1.05; letter-spacing: -.03em; overflow-wrap: anywhere; }
.pick-sub { color: var(--muted); font-weight: 600; }
.pick-stage.spinning .pick-name { opacity: .55; }
.pick-stage.reveal .pick-name { animation: reveal .5s cubic-bezier(.2, 1.4, .4, 1); color: var(--violet); }
@keyframes reveal { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pick-extra { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--violet); }
.picked-head { display: flex; justify-content: space-between; align-items: center; }
.picked-head h3 { margin: 0; font-size: 16px; font-family: var(--body); letter-spacing: 0; }

/* Group maker */
.groups { display: flex; flex-direction: column; gap: 18px; }
.groups-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg { appearance: none; font: inherit; font-weight: 600; font-size: 15px; border: 0; background: none; color: var(--muted); padding: 9px 14px; border-radius: 10px; cursor: pointer; }
.seg.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper-value { min-width: 44px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }
.groups-controls .btn.primary { margin-left: auto; }
.groups-hint { margin: 0; font-size: 15px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.group-card { background: var(--c-soft); border: 1px solid var(--c-line); border-radius: 18px; padding: 18px; }
.group-card.pop { animation: pop .4s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes pop { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.group-head h3 { margin: 0; font-size: 18px; flex: 1; }
.group-head .muted { font-size: 13px; }
.group-num { width: 30px; height: 30px; border-radius: 9px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.group-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.group-card li { font-weight: 600; font-size: 17px; padding: 6px 10px; background: var(--surface); border-radius: 10px; }

/* Would You Rather */
.wyr { display: flex; flex-direction: column; gap: 20px; }
.prompt { text-align: center; margin: 0; font-size: 18px; font-weight: 600; color: var(--muted); }
.choices { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; }
.choice {
  appearance: none; border: 2px solid var(--c-line); cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  border-radius: 24px; padding: clamp(20px, 3vw, 40px); background: var(--c-soft);
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-width: 0; min-height: 300px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.choice:hover { transform: translateY(-3px); border-color: var(--c); box-shadow: var(--shadow); }
.choice:active { transform: scale(.99); }
.tag { align-self: flex-start; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; padding: 6px 12px; border-radius: 999px; background: var(--c); }
.choice-text { font-family: var(--display); font-size: clamp(28px, 4vw, 54px); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.votes { display: flex; flex-direction: column; gap: 8px; }
.votes-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.votes-row strong { color: var(--ink); font-size: 22px; font-family: var(--display); }
.vbar { height: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.vbar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width .3s ease; }
.or { align-self: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 20px; box-shadow: var(--shadow); }
.wyr-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.progress { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; max-width: 420px; }
.progress-label { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-label b { color: var(--ink); }
.track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.track span { display: block; height: 100%; background: var(--emerald); border-radius: inherit; }

/* Classroom Board */
body.board-mode .nav { display: none; }
.board { position: relative; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: #8EC5FF; }
.board-top {
  position: relative; z-index: 5000; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}
.glass-pill { background: rgba(255,255,255,.85); color: #0E1120; border-radius: 14px; padding: 4px 4px 4px 12px; backdrop-filter: blur(12px); }
.board-canvas { position: relative; z-index: 1; flex: 1; margin: 12px 16px 0; }
.bg-wrap { position: relative; }
.bg-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(460px, 90vw); max-height: min(70vh, 640px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.bg-own { display: flex; gap: 8px; flex-wrap: wrap; }
.bg-own label { cursor: pointer; }
.color-btn input { width: 22px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; }
.bg-group h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.bg-swatch { background-size: auto; appearance: none; border: 2px solid transparent; border-radius: 12px; aspect-ratio: 1; cursor: pointer; position: relative; padding: 0; overflow: hidden; }
.bg-swatch span { position: absolute; left: 0; right: 0; bottom: 0; font: 600 11px var(--body); color: #fff; background: rgba(0,0,0,.35); padding: 3px 0; }
.bg-swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.dock-wrap { position: relative; z-index: 5000; display: flex; justify-content: center; padding: 12px 16px max(16px, env(safe-area-inset-bottom, 0px)); }
.dock {
  display: flex; gap: 4px; padding: 8px; border-radius: 22px; max-width: 100%; overflow-x: auto;
  background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.7); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.dock-btn { appearance: none; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 14px; color: #0E1120; font: 600 12px var(--body); white-space: nowrap; }
.dock-btn:hover { background: rgba(14,17,32,.07); }
.dock-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #0E1120; color: #fff; }
.dock-icon svg { width: 22px; height: 22px; }
.dock-btn { flex: none; } .dock-btn.on { background: rgba(14,17,32,.12); } .dock-pen { margin-left: 6px; padding-left: 14px; border-left: 1px solid rgba(14,17,32,.12); border-radius: 0 14px 14px 0; }

.widget {
  position: absolute; display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg);
  border: 0; overflow: hidden;
}
.widget.fresh { animation: pop .35s cubic-bezier(.2, 1.3, .4, 1); }
.w-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 0 14px; cursor: grab; touch-action: none; user-select: none; flex: none; }
.w-head:active { cursor: grabbing; }
.w-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.w-close { appearance: none; border: 0; background: none; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.w-close:hover { background: var(--surface-2); color: var(--ink); }
.w-close svg { width: 16px; height: 16px; }
.w-body { flex: 1; min-height: 0; position: relative; container-type: size; padding: 4px 14px 14px; display: flex; flex-direction: column; }
.w-resize { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none; }
.w-resize::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); border-radius: 0 0 3px 0; opacity: .6; }

/* Widget contents scale with the widget size */
.clock { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.clock-time { font-family: var(--display); font-weight: 700; font-size: min(26cqw, 52cqh); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.clock-date { font-size: min(7cqw, 12cqh); color: var(--muted); font-weight: 600; margin-top: 2cqh; }
.w-body .timer { flex: 1; gap: 3cqh; justify-content: center; }
.w-body .timer-ring { width: min(64cqh, 92cqw); }
.w-body .presets { gap: 4px; }
.w-body .preset { padding: 4px 10px; font-size: 13px; }
.w-body .btn.big { padding: 9px 16px; font-size: 15px; }
.note-area { flex: 1; width: 100%; resize: none; border: 0; background: transparent; padding: 4px; line-height: 1.25; font-family: var(--display); }
.note-area:focus { box-shadow: none; }
.w-body.middle { justify-content: center; }
.w-body.middle .note-area { flex: none; }
.widget.w-text { overflow: visible; }
.widget.w-text .w-title, .widget.w-text .w-close { color: var(--w-ink, var(--muted)); }
.widget.box-clear { box-shadow: none; border-color: transparent; }
.widget.box-clear .w-head, .widget.box-clear .w-resize { opacity: 0; transition: opacity .15s ease; }
.widget.box-clear:hover, .widget.box-clear:focus-within { border-color: rgba(255,255,255,.7); outline: 2px dashed rgba(14,17,32,.35); outline-offset: -2px; }
.widget.box-clear:hover .w-head, .widget.box-clear:hover .w-resize, .widget.box-clear:focus-within .w-head { opacity: 1; }
/* Floating toolbar under (or above) the text box */
.text-toolbar { position: absolute; left: 0; top: 100%; padding-top: 8px; z-index: 6; opacity: 0; visibility: hidden; transition: opacity .15s ease; width: max-content; max-width: min(520px, 92vw); }
.widget.tb-up .text-toolbar { top: auto; bottom: 100%; padding-top: 0; padding-bottom: 8px; }
.widget:hover .text-toolbar, .widget:focus-within .text-toolbar { opacity: 1; visibility: visible; }
.tb-panel { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.tb-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tb-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); width: 36px; }
.tb { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 13px var(--body); height: 30px; min-width: 30px; padding: 0 8px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.tb:hover { border-color: var(--muted); }
.tb svg { width: 16px; height: 16px; }
.tb.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tb-italic { font-style: italic; font-family: Georgia, serif; }
.tb-underline { text-decoration: underline; }
.tb-shadow { text-shadow: 1px 2px 0 rgba(0,0,0,.35); }
.tb-select { font: 600 13px var(--body); height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 6px; cursor: pointer; }
.tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.dot { appearance: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.dot.on { box-shadow: 0 0 0 2px var(--focus); }
.dot-auto { background: linear-gradient(135deg, #0E1120 50%, #fff 50%); }
.dot-default { background: var(--surface); }
.dot-clear { background: repeating-conic-gradient(#C9CEDB 0 25%, #fff 0 50%) 0 0/10px 10px; }
.dot-custom { width: 26px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; }
.traffic { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqh; }
.traffic-box { background: #1A1D2E; border-radius: min(14cqw, 8cqh); padding: min(6cqw, 3cqh); display: flex; flex-direction: column; gap: min(5cqw, 2.5cqh); }
.light { appearance: none; border: 0; cursor: pointer; width: min(54cqw, 22cqh); aspect-ratio: 1; border-radius: 50%; opacity: .22; transition: opacity .2s ease, box-shadow .2s ease; }
.light.red { background: #FF4D4D; } .light.yellow { background: #FFC233; } .light.green { background: #2EDC7A; }
.light.on { opacity: 1; box-shadow: 0 0 min(10cqw, 5cqh) currentColor; }
.light.red.on { color: #FF4D4D; } .light.yellow.on { color: #FFC233; } .light.green.on { color: #2EDC7A; }
.traffic-label { font-weight: 700; font-size: min(9cqw, 5cqh); text-align: center; }
.w-body .picker { flex: 1; gap: 3cqh; }
.w-body .pick-stage { flex: 1; min-height: 0; padding: 3cqh 4cqw; border-radius: 14px; }
.w-body .pick-name { font-size: min(15cqw, 26cqh); }
.w-body .pick-sub { font-size: max(11px, min(4cqw, 6cqh)); }
.w-body .wyr { flex: 1; gap: 0; }
.w-body .choices { flex: 1; gap: 2cqw; }
.w-body .choice { min-height: 0; padding: 3cqh 3cqw; border-radius: 14px; gap: 2cqh; }
.w-body .choice-text { font-size: min(5.2cqw, 12cqh); }
.w-body .tag { font-size: 10px; padding: 3px 8px; }
.w-body .or { width: min(9cqw, 16cqh); height: min(9cqw, 16cqh); font-size: min(3cqw, 5cqh); }
.w-body .votes-row { font-size: 11px; }
.w-body .votes-row strong { font-size: 16px; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-inner { flex-wrap: wrap; gap: 8px; }
  .nav-links { margin-left: 0; width: 100%; }
  .feature { grid-template-columns: 1fr; }
  .page { padding-block: 28px 48px; gap: 32px; }
  .choices { grid-template-columns: 1fr; }
  .or { justify-self: center; margin: -6px 0; }
  .choice { min-height: 180px; }
  .timer-dial .btn { display: none; }
  .groups-controls .btn.primary { margin-left: 0; }
  .dock-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Classroom Pet */
.pet-setup { display: flex; flex-direction: column; gap: 16px; }
.pet-setup h2 { margin: 0; font-size: 26px; }
.pet-setup p { margin: 0; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.pet-choice {
  appearance: none; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px 14px;
  border-radius: 18px; border: 2px solid var(--line); background: var(--surface);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.pet-choice:hover { transform: translateY(-3px); border-color: var(--c-line); }
.pet-choice[aria-checked="true"] { border-color: var(--c); background: var(--c-soft); }
.pet-emoji { font-size: 52px; line-height: 1; }
.pet-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.habitat {
  position: relative; border-radius: 24px; padding: clamp(20px, 3vw, 32px); min-height: 520px; overflow: hidden;
  display: flex; flex-direction: column; gap: 16px;
  background: radial-gradient(90% 70% at 50% 100%, color-mix(in srgb, var(--c) 28%, var(--surface)) 0%, transparent 70%), var(--c-soft);
  border: 1px solid var(--c-line);
}
.habitat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pet-name { margin: 0; font-size: clamp(28px, 3.5vw, 40px); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: baseline; gap: 6px; background: var(--surface); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow-sm); }
.stat b { font-family: var(--display); font-size: 18px; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; font-weight: 600; }
.pet-avatar { position: relative; flex: 1; display: grid; place-items: center; min-height: 240px; }
.pet-big { font-size: clamp(140px, 18vw, 220px); line-height: 1; filter: drop-shadow(0 18px 20px rgba(0,0,0,.18)); animation: breathe 3.2s ease-in-out infinite; }
.pet-avatar.sleepy .pet-big { filter: grayscale(.35) drop-shadow(0 18px 20px rgba(0,0,0,.18)); animation-duration: 5s; }
.pet-avatar.happy .pet-big { animation: bounce 1.4s ease-in-out infinite; }
.pet-avatar.hop .pet-big { animation: hop .6s cubic-bezier(.3, 1.6, .5, 1); }
.pet-hat { position: absolute; top: calc(50% - clamp(120px, 15vw, 180px)); left: 50%; transform: translateX(-30%) rotate(12deg); font-size: clamp(54px, 7vw, 84px); z-index: 2; }
@keyframes breathe { 50% { transform: scale(1.03); } }
@keyframes bounce { 50% { transform: translateY(-14px); } }
@keyframes hop { 40% { transform: translateY(-40px) scale(1.06); } }
.float-heart { position: absolute; bottom: 40%; font-size: 30px; animation: floatUp 1.5s ease-out forwards; pointer-events: none; }
@keyframes floatUp { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-180px) scale(1.2); opacity: 0; } }
.pet-mood { margin: 0; text-align: center; font-family: var(--display); font-size: clamp(18px, 2vw, 24px); font-weight: 600; text-wrap: balance; }
.day-progress .track { height: 10px; background: var(--surface); }
.day-progress .track span { background: var(--c); }
.care { display: flex; flex-direction: column; gap: 12px; }
.care-head { display: flex; justify-content: space-between; align-items: baseline; }
.care h3 { margin: 0; font-size: 19px; }
.care-sub { margin-top: 10px !important; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task {
  appearance: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, border-color .12s ease;
}
.task:hover:not(:disabled) { transform: translateX(3px); border-color: var(--emerald); }
.task-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; flex: none; }
.task-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.task-text b { font-size: 16px; }
.task-text small { color: var(--muted); font-size: 13px; font-weight: 600; }
.task-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: #fff; }
.task-check svg { width: 16px; height: 16px; }
.task.done { background: color-mix(in srgb, var(--emerald) 10%, var(--surface)); border-color: color-mix(in srgb, var(--emerald) 35%, var(--line)); cursor: default; box-shadow: none; }
.task.done .task-check { background: var(--emerald); border-color: var(--emerald); }
.task.done b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.bonus {
  appearance: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px;
  border: 1.5px dashed color-mix(in srgb, var(--amber) 60%, var(--line)); background: color-mix(in srgb, var(--amber) 10%, var(--surface));
}
.bonus-text { font-weight: 600; font-size: 16px; }
.bonus-cta { align-self: flex-start; font-weight: 700; font-size: 14px; background: var(--ink); color: var(--bg); padding: 6px 12px; border-radius: 999px; }
.bonus.done { border-style: solid; cursor: default; }
.bonus.done .bonus-cta { background: var(--emerald); color: #fff; }
.helper { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.helper-name { font-family: var(--display); font-weight: 700; font-size: 22px; }
.care-foot { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Games */
.game { display: flex; flex-direction: column; gap: 18px; align-items: center; }
.scorebar { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.team { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--surface-2); border: 2px solid transparent; font-weight: 700; transition: border-color .15s ease, background .15s ease; }
.team b { font-family: var(--display); font-size: 22px; min-width: 1.2em; text-align: center; font-variant-numeric: tabular-nums; }
.team-dot { width: 14px; height: 14px; border-radius: 50%; }
.team-0 .team-dot { background: #EF4444; } .team-1 .team-dot { background: #F5B301; }
.team.active { border-color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.game-status { margin: 0; font-family: var(--display); font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; text-align: center; }
/* Four in a Row */
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(6px, 1vw, 10px); padding: clamp(10px, 1.6vw, 16px); background: #2453D6; border-radius: 22px; width: min(640px, 100%); box-shadow: var(--shadow); }
.c4-cell { appearance: none; border: 0; padding: 0; aspect-ratio: 1; border-radius: 50%; background: #173A9E; cursor: pointer; display: grid; place-items: center; box-shadow: inset 0 4px 8px rgba(0,0,0,.35); }
.c4-cell span { width: 88%; height: 88%; border-radius: 50%; }
.c4-cell.p0 span { background: radial-gradient(circle at 35% 30%, #FF8A8A, #E11D2E); }
.c4-cell.p1 span { background: radial-gradient(circle at 35% 30%, #FFE680, #F5B301); }
.c4-cell.drop span { animation: dropIn .35s cubic-bezier(.4, 1.4, .6, 1); }
.c4-cell.win span { box-shadow: 0 0 0 4px #fff, 0 0 18px #fff; }
@keyframes dropIn { from { transform: translateY(-260%); } }
/* Tic-Tac-Toe */
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(420px, 100%); }
.ttt-cell { appearance: none; aspect-ratio: 1; border: 2px solid var(--line); background: var(--surface-2); border-radius: 18px; cursor: pointer; font-family: var(--display); font-weight: 800; font-size: clamp(56px, 9vw, 96px); line-height: 1; color: var(--ink); }
.ttt-cell:hover:empty { border-color: var(--muted); }
.ttt-cell.x { color: var(--cobalt); } .ttt-cell.o { color: var(--coral); }
.ttt-cell.win { background: color-mix(in srgb, var(--emerald) 20%, var(--surface)); border-color: var(--emerald); }
/* Checkers */
.ck { display: grid; grid-template-columns: repeat(8, 1fr); width: min(600px, 100%); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); border: 6px solid #6B4A2B; }
.ck-sq { appearance: none; border: 0; padding: 0; aspect-ratio: 1; background: #F3E3C3; display: grid; place-items: center; }
.ck-sq.dark { background: #A0703F; cursor: pointer; }
.ck-sq.sel { background: #6FA34B; }
.ck-sq.target { background: #8CC56A; box-shadow: inset 0 0 0 3px #fff; }
.ck-pc { width: 78%; height: 78%; border-radius: 50%; display: grid; place-items: center; color: #FFD54A; font-size: clamp(14px, 3vw, 26px); box-shadow: inset 0 -4px 0 rgba(0,0,0,.3), 0 3px 6px rgba(0,0,0,.35); }
.ck-pc.p0 { background: radial-gradient(circle at 35% 30%, #FF7A7A, #C81E1E); }
.ck-pc.p1 { background: radial-gradient(circle at 35% 30%, #5B5F70, #16181F); }
/* Memory */
.mem { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; width: min(720px, 100%); }
.mem-card { appearance: none; border: 0; padding: 0; background: none; aspect-ratio: 1; cursor: pointer; perspective: 800px; }
.mem-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .4s ease; transform-style: preserve-3d; }
.mem-card.open .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; display: grid; place-items: center; }
.mem-back { background: linear-gradient(135deg, var(--violet), var(--rose)); box-shadow: var(--shadow-sm); }
.mem-back::after { content: "?"; color: rgba(255,255,255,.85); font: 800 clamp(24px, 4vw, 40px) var(--display); }
.mem-front { background: var(--surface); border: 2px solid var(--line); transform: rotateY(180deg); font-size: clamp(32px, 6vw, 60px); }
.mem-card.matched .mem-front { border-color: var(--emerald); background: color-mix(in srgb, var(--emerald) 12%, var(--surface)); }
/* Word guess */
.balloons { display: flex; gap: 10px; justify-content: center; min-height: 80px; align-items: flex-end; }
.balloon { width: 44px; height: 56px; border-radius: 50% 50% 46% 46%; position: relative; transition: transform .3s ease, opacity .3s ease; }
.balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 22px; background: var(--muted); }
.balloon.b0 { background: var(--coral); } .balloon.b1 { background: var(--cobalt); } .balloon.b2 { background: var(--amber); } .balloon.b3 { background: var(--emerald); } .balloon.b4 { background: var(--violet); }
.balloon.popped { transform: scale(.2); opacity: 0; }
.word { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.letter { width: clamp(34px, 5vw, 56px); height: clamp(44px, 6.5vw, 70px); border-bottom: 4px solid var(--ink); display: grid; place-items: center; font: 700 clamp(26px, 4vw, 44px) var(--display); }
.letter.missed { color: var(--rose); }
.keys { display: grid; grid-template-columns: repeat(13, 1fr); gap: 6px; width: min(760px, 100%); }
.key { appearance: none; font: 700 18px var(--body); padding: 10px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.key:hover:not(:disabled) { border-color: var(--ink); }
.key.hit { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.key.miss { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.key:disabled { cursor: default; }
@media (max-width: 900px) { .pet-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .keys { grid-template-columns: repeat(7, 1fr); } .mem { grid-template-columns: repeat(4, 1fr); } }

/* Name Wheel */
.wheel { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wheel-wrap { position: relative; width: min(640px, 100%); }
.wheel-stage { position: relative; width: 100%; aspect-ratio: 1; }
.wheel-canvas { width: 100%; height: 100%; display: block; cursor: pointer; border-radius: 50%; }
.wheel-hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 21%; aspect-ratio: 1; border-radius: 50%; border: 6px solid #fff; cursor: pointer;
  background: var(--ink); color: var(--bg); font: 800 clamp(14px, 2.4vw, 22px) var(--display); letter-spacing: .04em;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.wheel-hub:hover { transform: translate(-50%, -50%) scale(1.04); }
.wheel-stage.spinning .wheel-hub { pointer-events: none; opacity: .9; }
.wheel-pointer {
  position: absolute; right: -10px; top: 50%; width: 0; height: 0; transform: translateY(-50%); transform-origin: 100% 50%;
  border-top: 22px solid transparent; border-bottom: 22px solid transparent; border-right: 44px solid var(--ink);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
}
.wheel-pointer.flick { animation: flick .12s ease-out; }
@keyframes flick { 50% { transform: translateY(-50%) rotate(-14deg); } }
.wheel-result {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, 92%);
  background: var(--surface); border-radius: 24px; padding: 28px; box-shadow: var(--shadow-lg); text-align: center;
  display: flex; flex-direction: column; gap: 12px; align-items: center; animation: pop .35s cubic-bezier(.2, 1.3, .4, 1);
}
.wheel-winner { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 6vw, 64px); line-height: 1.05; letter-spacing: -.03em; overflow-wrap: anywhere; color: var(--c); }
.wheel-hint { margin: 0; font-size: 14px; }
.wheel-history { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.wheel-history li.muted { list-style: none; margin-left: -22px; font-weight: 400; }

/* Class lists */
.class-select {
  font: inherit; font-weight: 700; font-size: 16px; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; cursor: pointer;
}
.roster-editor input[type="text"] { width: 100%; font-weight: 600; }
.move { border-top: 1px solid var(--line); padding-top: 12px; }
.move summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.move summary:hover { color: var(--ink); }
.move[open] { display: flex; flex-direction: column; gap: 10px; }
.backup { display: flex; flex-direction: column; gap: 8px; }
.backup label { cursor: pointer; }
.home-backup { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; }
.home-backup h3 { margin: 0; font-size: 18px; }
.home-backup p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }


/* Pet window on the home page */
.pet-mini { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); text-decoration: none; }
.pet-mini.empty-pet { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; border-style: dashed; box-shadow: none; }
.pet-mini.empty-pet:hover { border-color: var(--lime); }
.pet-mini-emoji { font-size: 34px; }
.pet-mini.empty-pet b, .mini-info b { display: block; font-size: 15px; }
.pet-mini.empty-pet small, .mini-info small { color: var(--muted); font-size: 13px; font-weight: 600; }
.mini-home { position: relative; height: 170px; overflow: hidden; cursor: pointer; }
.mini-pet { position: absolute; transform: translate(-50%, -50%); appearance: none; border: 0; background: none; padding: 0; cursor: pointer; font-size: 52px; line-height: 1; z-index: 3; }
.mini-pet-body { display: inline-block; filter: drop-shadow(0 6px 5px rgba(0,0,0,.18)); }
.mini-pet.wiggle .mini-pet-body { animation: wiggle .5s ease; }
@keyframes wiggle { 25% { translate: 0 -12px; } 50% { translate: 0 0; } 75% { translate: 0 -5px; } }
.mini-bubble { position: absolute; z-index: 4; transform: translate(-50%, -150%); background: #fff; color: #0E1120; font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 12px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.15); pointer-events: none; }
.mini-heart { position: absolute; z-index: 4; font-size: 20px; pointer-events: none; animation: floatUp 1.2s ease-out forwards; }
.mini-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; text-decoration: none; border-top: 1px solid var(--line); }
.mini-info:hover { background: var(--surface-2); }
.mini-go svg { width: 18px; height: 18px; color: var(--muted); }
.mini-decor { position: absolute; inset: 0; pointer-events: none; }
.mini-decor i { position: absolute; display: block; }
/* homes */
.home-tank { background: linear-gradient(180deg, #7FD3FF 0%, #2F8FE0 78%, #E9D29A 78%, #D9BC78 100%); box-shadow: inset 0 0 0 6px rgba(255,255,255,.35); }
.home-tank .bubble { bottom: 20%; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.8); animation: rise 4.2s linear infinite; }
@keyframes rise { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(-130px); opacity: 0; } }
.home-tank .weed { bottom: 18%; width: 10px; border-radius: 10px 10px 0 0; background: #2FA35A; transform-origin: bottom; animation: sway 3s ease-in-out infinite alternate; }
.home-tank .w1 { left: 8%; height: 50px; } .home-tank .w2 { left: 13%; height: 34px; animation-delay: .6s; } .home-tank .w3 { right: 10%; height: 44px; animation-delay: 1.2s; }
@keyframes sway { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.home-yard { background: linear-gradient(180deg, #BDE6FF 0%, #E6F6FF 60%, #8FD46A 60%, #6CBF4E 100%); }
.home-rainbow { background: radial-gradient(circle at 50% 110%, transparent 52%, #FF8FA3 52% 56%, #FFC46B 56% 60%, #FFF07A 60% 64%, #8EE59B 64% 68%, #7CC8FF 68% 72%, #B79CFF 72% 76%, transparent 76%), linear-gradient(180deg, #DDEBFF 0%, #F6F0FF 62%, #A8E38D 62%, #86CF6B 100%); }
.home-den { background: repeating-linear-gradient(90deg, rgba(0,0,0,.04) 0 2px, transparent 2px 9px), linear-gradient(180deg, #FFE9CC 0%, #FFF4E3 60%, #E8C48E 60%, #D9AE6E 100%); }
.home-terrarium { background: linear-gradient(180deg, #DDF5E3 0%, #C7EBCF 60%, #C9A66B 60%, #B38D52 100%); box-shadow: inset 0 0 0 6px rgba(255,255,255,.4); }
.home-bamboo { background: linear-gradient(180deg, #E5F7E0 0%, #F3FBEF 62%, #9BD77C 62%, #7CC05E 100%); }
.home-bamboo .stalk { bottom: 30%; width: 9px; height: 110px; background: repeating-linear-gradient(180deg, #5FA845 0 26px, #3F7F2E 26px 29px); border-radius: 4px; }
.home-bamboo .s1 { left: 8%; } .home-bamboo .s2 { left: 14%; height: 80px; } .home-bamboo .s3 { right: 9%; height: 120px; }
.home-ice { background: linear-gradient(180deg, #CDEBFF 0%, #EAF6FF 62%, #FFFFFF 62%, #DDEFFC 100%); }
.home-ice .flake { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(0,80,160,.3); animation: snow 6s linear infinite; top: -10px; }
.home-ice .f1 { left: 20%; } .home-ice .f2 { left: 55%; animation-delay: 2s; } .home-ice .f3 { left: 80%; animation-delay: 4s; }
@keyframes snow { to { transform: translateY(190px); } }
.home-pond { background: linear-gradient(180deg, #D8F1FF 0%, #EAF8FF 50%, #5CC0E8 50%, #3AA0CF 100%); }
.home-pond .pad { bottom: 14%; width: 54px; height: 18px; border-radius: 50%; background: #4CB860; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.home-pond .p1 { left: 10%; } .home-pond .p2 { left: 42%; bottom: 20%; } .home-pond .p3 { right: 8%; }
.home-sky { background: linear-gradient(180deg, #7CC4FF 0%, #CDE9FF 100%); }
.home-sky .cloud, .home-rainbow .cloud { width: 70px; height: 22px; background: #fff; border-radius: 20px; opacity: .9; animation: drift 18s linear infinite; }
.home-sky .cloud::before, .home-rainbow .cloud::before { content: ""; position: absolute; left: 14px; top: -12px; width: 34px; height: 30px; background: #fff; border-radius: 50%; }
.cloud.c1 { top: 18%; left: -80px; } .cloud.c2 { top: 52%; left: -80px; animation-delay: -9s; animation-duration: 24s; }
@keyframes drift { to { transform: translateX(460px); } }
@media (max-width: 760px) { .hero-side { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .mini-decor i { animation: none !important; } }

/* Board screens */
.screen-panel { left: 0; right: auto; width: min(400px, 90vw); }
.screen-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.caret { font-size: 11px; opacity: .7; }
.screen-list { display: flex; flex-direction: column; gap: 6px; }
.screen-item { appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 2px solid transparent; background: var(--surface-2); }
.screen-item:hover { border-color: var(--line); }
.screen-item.on { border-color: var(--ink); background: var(--surface); }
.screen-thumb { width: 56px; height: 36px; border-radius: 8px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.screen-text b { display: block; font-size: 15px; }
.screen-text small { color: var(--muted); font-size: 12px; font-weight: 600; }
.screen-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.screen-form input { flex: 1 1 160px; padding: 8px 12px; font-size: 15px; }

/* Widget lock */
.w-btns { display: inline-flex; align-items: center; }
.w-lock svg { width: 15px; height: 15px; }
.widget.locked .w-head { cursor: default; }
.widget.locked .w-resize, .widget.locked .w-btns .w-close:not(.w-lock) { display: none; }
.widget.locked .w-lock { color: var(--coral); }
.widget.box-clear:hover, .widget.box-clear:focus-within { outline: 2px dashed rgba(14,17,32,.3); outline-offset: -2px; }
.widget.box-clear.locked:hover { outline: 0; }

/* Riddle */
.riddle { gap: 22px; text-align: center; }
.riddle-q { margin: 0; font-size: clamp(28px, 4vw, 52px); line-height: 1.15; max-width: 22ch; }
.riddle-hints { display: flex; flex-direction: column; gap: 8px; width: min(640px, 100%); }
.hint { display: flex; gap: 12px; align-items: baseline; text-align: left; background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border-radius: 14px; padding: 12px 16px; font-size: 19px; font-weight: 600; animation: pop .3s ease; }
.hint b { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); flex: none; }
.riddle-answer { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 5vw, 60px); color: #fff; background: var(--emerald); padding: 14px 32px; border-radius: 20px; animation: reveal .5s cubic-bezier(.2, 1.4, .4, 1); }
/* Escape room */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; width: 100%; }
.room-card { appearance: none; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; border-radius: 20px; border: 2px solid var(--c-line); background: var(--c-soft); transition: transform .15s ease, border-color .15s ease; }
.room-card:hover { transform: translateY(-4px); border-color: var(--c); }
.room-card b { font-family: var(--display); font-size: 19px; text-align: center; }
.room-card small { color: var(--muted); font-weight: 600; }
.room-emoji { font-size: 54px; line-height: 1; }
.room-emoji.big { font-size: 84px; }
.room-intro { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: clamp(20px, 4vw, 44px); border-radius: 24px; background: var(--c-soft); border: 1px solid var(--c-line); width: 100%; }
.room-intro h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); }
.room-intro p { margin: 0; font-size: 20px; max-width: 56ch; }
.lock-card { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; width: 100%; padding: clamp(20px, 3vw, 36px); border-radius: 24px; background: var(--c-soft); border: 1px solid var(--c-line); }
.lock-card.shake { animation: shake .4s ease; }
.lock-card.open { border-color: var(--emerald); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lock-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 12px; flex-wrap: wrap; }
.lock-dots { display: flex; gap: 6px; font-size: 26px; }
.lock-dot { opacity: .35; } .lock-dot.done, .lock-dot.now { opacity: 1; }
.lock-dot.now { transform: scale(1.25); }
.esc-clock { font-family: var(--display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; background: var(--surface); padding: 6px 14px; border-radius: 999px; }
.lock-q { margin: 0; font-size: clamp(22px, 2.8vw, 34px); line-height: 1.25; max-width: 30ch; }
input.esc-input { font-size: 24px; font-weight: 700; text-align: center; padding: 12px 16px; width: min(320px, 100%); }
.esc-msg { margin: 0; min-height: 1.5em; font-weight: 700; font-size: 18px; }
/* Code breaker */
.cb-board { display: flex; flex-direction: column; gap: 8px; }
.cb-row { display: flex; align-items: center; gap: 16px; padding: 6px 12px; border-radius: 14px; }
.cb-row.active { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--line); }
.cb-row.reveal { background: color-mix(in srgb, var(--amber) 16%, var(--surface)); }
.cb-pegs { display: flex; gap: 8px; }
.cb-peg { width: clamp(30px, 4.4vw, 44px); aspect-ratio: 1; border-radius: 50%; display: block; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); }
.cb-peg.empty { background: var(--surface-2); box-shadow: inset 0 2px 4px rgba(0,0,0,.12); }
.cb-row.active .cb-peg.empty { background: var(--surface); }
.cb-palette { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
button.cb-peg.big { appearance: none; border: 3px solid var(--surface); width: 56px; cursor: pointer; outline: 2px solid var(--line); transition: transform .1s ease; }
button.cb-peg.big:hover { transform: scale(1.1); }
.cb-fbs { display: grid; grid-template-columns: repeat(2, 14px); gap: 4px; }
.cb-fb { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); vertical-align: middle; }
.cb-fb.exact { background: var(--emerald); box-shadow: none; }
.cb-fb.near { background: var(--amber); box-shadow: none; }
.cb-key { margin: 0; font-size: 15px; }
/* Trivia */
.trivia { width: 100%; }
.tv-grid { display: grid; gap: 8px; width: 100%; }
.tv-cat { background: var(--ink); color: var(--bg); font-family: var(--display); font-weight: 700; font-size: clamp(13px, 1.7vw, 20px); text-align: center; padding: 14px 6px; border-radius: 12px; overflow-wrap: anywhere; }
.tv-tile { appearance: none; border: 0; cursor: pointer; background: var(--cobalt); color: #fff; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3.4vw, 42px); padding: clamp(14px, 2.6vw, 30px) 4px; border-radius: 12px; transition: transform .12s ease, filter .12s ease; }
.tv-tile:hover:not(:disabled) { transform: scale(1.04); filter: brightness(1.12); }
.tv-tile.done { background: var(--surface-2); cursor: default; min-height: 60px; }
.tv-question { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; padding: 20px 0; }

/* Settings */
.nav-gear { flex: none; width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.nav-gear svg { width: 20px; height: 20px; }
.nav-gear:hover { color: var(--ink); background: var(--surface-2); }
.nav-gear.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.nav-links { margin-left: auto; }
.nav-inner { gap: 14px; }
.settings { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding: 20px 0; border-bottom: 1px solid var(--line); }
.set-row:first-child { padding-top: 0; } .set-row:last-child { border-bottom: 0; padding-bottom: 0; }
.set-row h3 { font-size: 17px; margin: 0 0 2px; }
.set-row p { margin: 0; font-size: 14.5px; }
.set-control { flex: 0 1 380px; min-width: 0; display: flex; justify-content: flex-end; }
.set-control input[type="text"] { width: 100%; font: inherit; font-weight: 600; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.set-control input[type="text"]:focus-visible { outline: 3px solid color-mix(in srgb, var(--cobalt) 45%, transparent); outline-offset: 1px; }
@media (max-width: 760px) { .set-control { flex-basis: 100%; justify-content: flex-start; } .nav-gear { position: absolute; top: 11px; right: 16px; } .nav-inner { position: relative; } }

/* Morning Meeting */
.mm { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.mm-hero { grid-column: 1 / -1; border-radius: 24px; padding: clamp(24px, 4vw, 44px); color: #2A1B00;
  background: radial-gradient(120% 140% at 100% 0%, #FFE08A 0%, transparent 55%), linear-gradient(135deg, #FFC56B 0%, #FF9E7A 100%); }
.mm-greeting { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5.6vw, 76px); line-height: 1.02; letter-spacing: -.03em; margin: 0; overflow-wrap: anywhere; }
.mm-date { font-weight: 700; font-size: clamp(17px, 2vw, 26px); margin: 10px 0 18px; opacity: .8; }
.mm-message { display: block; width: 100%; resize: vertical; font: inherit; font-weight: 600; font-size: clamp(17px, 1.9vw, 24px); line-height: 1.4; color: inherit;
  background: rgba(255,255,255,.5); border: 2px solid transparent; border-radius: 16px; padding: 14px 18px; }
.mm-message:hover { border-color: rgba(255,255,255,.7); }
.mm-message:focus-visible { outline: 0; border-color: #fff; background: rgba(255,255,255,.75); }
.mm-message::placeholder { color: rgba(42,27,0,.5); }
.mm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.mm-card > h3 { margin: 0; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mm-wide { grid-column: 1 / -1; }
.mm-weather { align-items: stretch; }
.mm-wx-big { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mm-wx-big b { font-family: var(--display); font-size: clamp(24px, 3vw, 40px); letter-spacing: -.02em; }
.mm-wx-big.unset b { font-size: 20px; color: var(--muted); font-family: inherit; }
.mm-wx-emoji { font-size: clamp(56px, 7vw, 92px); line-height: 1; }
.mm-temp-row { display: flex; align-items: baseline; gap: 4px; font-family: var(--display); font-weight: 700; font-size: 34px; }
.mm-temp { box-sizing: content-box; width: 3.2ch; font: inherit; text-align: right; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 2px 8px; }
.mm-temp:focus-visible { outline: 3px solid color-mix(in srgb, var(--amber) 55%, transparent); }
.mm-wx-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-wx { appearance: none; border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; width: 48px; height: 48px; font-size: 24px; line-height: 1; cursor: pointer; }
.mm-wx:hover { transform: translateY(-1px); }
.mm-wx.on { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 22%, var(--surface)); box-shadow: 0 0 0 2px var(--amber); }
.mm-wyr { flex: none; height: clamp(260px, 36vh, 400px); padding: 0; }
.mm-pet .pet-mini { box-shadow: none; }
.page.fs .mm { align-content: start; }
@media (max-width: 860px) { .mm { grid-template-columns: 1fr; } }

/* Brain Breaks */
.bb-stage { background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--emerald) 24%, var(--surface)) 0%, transparent 60%),
  radial-gradient(120% 120% at 100% 100%, color-mix(in srgb, var(--sky) 24%, var(--surface)) 0%, transparent 60%), var(--surface-2); }
.bb-activity { font-size: clamp(30px, 4.6vw, 64px); line-height: 1.12; max-width: 22ch; text-wrap: balance; }
.bb-stage.reveal .bb-activity { color: var(--emerald); }
.bb-track { width: min(520px, 100%); height: 10px; margin-top: 8px; }

/* Drawing pen */
.board-ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 900000; pointer-events: none; touch-action: none; }
.board-ink.on { pointer-events: auto; cursor: crosshair; }
.pen-bar { position: absolute; z-index: 900001; bottom: 4px; left: 50%; transform: translateX(-50%); max-width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 8px 10px; border-radius: 16px; background: rgba(255,255,255,.92); color: #0E1120; box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); }
.pen-bar .btn:not(.primary) { background: #fff; color: #0E1120; border-color: #D9DDEA; }
.pen-bar .btn.primary { background: #0E1120; color: #fff; border-color: #0E1120; }
.pen-group { display: flex; align-items: center; gap: 6px; }
.pen-color { appearance: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(14,17,32,.18); cursor: pointer; padding: 0; }
.pen-color.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0E1120; }
.pen-size { appearance: none; width: 32px; height: 32px; border-radius: 10px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.pen-size i { display: block; border-radius: 50%; background: #0E1120; }
.pen-size.on { background: rgba(14,17,32,.12); }

/* Extra board widgets */
.wx { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqh; text-align: center; }
.wx-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; flex: none; }
.wx-note { font-weight: 700; color: var(--muted); font-size: max(12px, min(5cqw, 7cqh)); flex: none; }
.wb { appearance: none; font: inherit; font-weight: 700; font-size: 14px; line-height: 1; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.wb:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.wb.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); padding-inline: 22px; }
.wb.round { width: 34px; height: 34px; padding: 0; font-size: 18px; flex: none; }
.wx-input { font: inherit; font-weight: 600; font-size: 14px; width: 100%; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.wx-area { flex: 1; width: 100%; min-height: 0; resize: none; font: inherit; font-weight: 600; font-size: 15px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.dice-row { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; display: flex; gap: 3cqw; align-items: center; justify-content: center; flex: 1; min-height: 0; width: 100%; }
.die { width: min(calc(94cqw / var(--n, 2) - 3cqw), 52cqh); aspect-ratio: 1; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 3cqmin; background: #fff; border: 1px solid #D9DDEA; border-radius: 18%; box-shadow: 0 6px 14px -6px rgba(14,17,32,.35), inset 0 -4px 0 rgba(14,17,32,.08); }
.die i { margin: 12%; border-radius: 50%; }
.die i.on { background: #0E1120; }
.spin-stage { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; position: relative; width: min(94cqw, 68cqh); aspect-ratio: 1; flex: none; }
.spin-canvas { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 0 0 4px var(--surface-2); }
.spin-pointer { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 18px solid var(--ink); filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.spin-result { color: var(--ink); font-family: var(--display); font-size: max(16px, min(8cqw, 9cqh)); overflow-wrap: anywhere; }
.sw-time { font-family: var(--display); font-weight: 700; font-size: min(24cqw, 44cqh); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.sw-time small { font-size: .45em; color: var(--muted); }
.poll { align-items: stretch; justify-content: flex-start; gap: 10px; }
.poll-q { font-family: var(--display); font-weight: 700; font-size: max(17px, min(6.5cqw, 10cqh)); line-height: 1.15; letter-spacing: -.02em; text-align: left; flex: none; }
.poll-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.poll-row { display: flex; align-items: center; gap: 6px; flex: 1; min-height: 38px; max-height: 72px; }
.poll-opt { appearance: none; position: relative; overflow: hidden; flex: 1; height: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 12px; padding: 0 14px; font: inherit; font-weight: 700; font-size: max(14px, min(4.4cqw, 6cqh)); cursor: pointer; text-align: left; }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; opacity: .32; transition: width .25s ease; }
.poll-t, .poll-opt b { position: relative; } .poll-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-edit { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.poll-edit-row { display: flex; gap: 6px; align-items: center; }
.wm { align-items: stretch; gap: 10px; }
.wm-big { flex: 1; min-height: 0; border-radius: 16px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqh; transition: background .25s ease; }
.wm-emoji { font-size: min(34cqw, 38cqh); line-height: 1; }
.wm-big b { font-family: var(--display); font-size: min(11cqw, 13cqh); letter-spacing: -.02em; line-height: 1.05; }
.wm-btn { appearance: none; width: 46px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 20px; line-height: 1; cursor: pointer; }
.wm-btn.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.cd { gap: 1.5cqh; }
.cd-num { font-family: var(--display); font-weight: 800; font-size: min(40cqw, 46cqh); line-height: .95; letter-spacing: -.04em; color: var(--amber); font-variant-numeric: tabular-nums; }
.cd-label { font-family: var(--display); font-weight: 700; font-size: max(15px, min(8cqw, 10cqh)); line-height: 1.1; overflow-wrap: anywhere; }
.cd-form { display: flex; gap: 6px; width: 100%; flex: none; margin-top: 1cqh; }
.cd-form input[type="date"] { flex: 0 0 auto; width: auto; }
.w-image .w-body { padding: 0; }
.img-box { position: relative; }
.img-box img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.img-change { position: absolute; right: 10px; top: 6px; opacity: 0; transition: opacity .15s; }
.w-image:hover .img-change, .img-change:focus-visible { opacity: 1; }
.img-empty { flex: 1; align-self: stretch; margin: 4px 14px 14px; border: 2px dashed var(--line); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--muted); }
.img-empty:hover { border-color: var(--c, var(--cobalt)); color: var(--ink); }
.img-empty svg { width: 34px; height: 34px; } .img-empty b { color: var(--ink); } .img-empty small { font-weight: 600; }
.img-box .form-msg { position: absolute; left: 10px; right: 10px; bottom: 10px; }

/* My Questions */
.cq { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.cq > .segmented { max-width: 100%; overflow-x: auto; }
.cq-body { align-self: stretch; display: flex; flex-direction: column; gap: 18px; }
.cq-body > p { margin: 0; max-width: 70ch; }
.cq-form { display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); border-radius: 18px; padding: 18px; }
.cq-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.cq-field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.cq input[type="text"], .cq textarea { width: 100%; font: inherit; font-weight: 600; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; }
.cq input:focus-visible, .cq textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--violet) 45%, transparent); outline-offset: 1px; }
.cq-wyr { display: flex; align-items: flex-end; gap: 12px; }
.cq-or { font-family: var(--display); font-weight: 700; padding-bottom: 12px; color: var(--muted); }
.cq-grid { display: grid; grid-template-columns: 1fr 2fr 1.2fr; gap: 12px; }
.cq-grid.two { grid-template-columns: 1fr 1fr; }
.cq-h { margin: 6px 0 0; font-size: 18px; }
.cq-list { display: flex; flex-direction: column; gap: 8px; }
.cq-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.cq-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.cq-text small { color: var(--muted); font-weight: 600; }
.cq-x { appearance: none; flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.cq-x:hover { background: color-mix(in srgb, var(--rose) 14%, transparent); color: var(--rose); }
.cq-x svg { width: 18px; height: 18px; }
.cq-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 16px; }
.cq-tag { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--emerald) 16%, transparent); color: color-mix(in srgb, var(--emerald) 70%, var(--ink)); }
.cq-tag.warn { background: color-mix(in srgb, var(--amber) 22%, transparent); color: color-mix(in srgb, var(--amber) 55%, var(--ink)); }
.cq-lock { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: var(--surface); min-width: 0; }
.cq-lock legend { font-weight: 700; padding: 0 6px; }
.cq-lock input[type="text"], .cq-lock textarea { background: var(--surface-2); }
@media (max-width: 760px) { .cq-wyr { flex-direction: column; align-items: stretch; } .cq-or { padding: 0; } .cq-grid, .cq-grid.two { grid-template-columns: 1fr; } .cq-item { flex-wrap: wrap; } .cq-text { flex-basis: 100%; } }

/* Multiplication Race board game */
.trail { width: 100%; }
.tr-die { width: 64px; height: 64px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 9px; background: #fff; border: 1px solid #D9DDEA; border-radius: 14px; box-shadow: 0 6px 14px -6px rgba(14,17,32,.35), inset 0 -4px 0 rgba(14,17,32,.08); flex: none; }
.tr-die i { margin: 12%; border-radius: 50%; } .tr-die i.on { background: #0E1120; }
.tr-team img { height: 34px; width: auto; margin: -6px 0; }
.tr-wrap { position: relative; width: min(100%, 1020px); border-radius: clamp(16px, 3vw, 30px); overflow: hidden; background: #02031c url("race/board-bg.jpg") center / 100% 100% no-repeat; padding: 8.5% 9.5%; box-shadow: var(--shadow-lg); }
.tr-board { --g: clamp(4px, 1.2vw, 14px); display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--g); }
.tr-tile { position: relative; aspect-ratio: 1; border-radius: 20%; background: #1B2150; border: 2px solid rgba(255,255,255,.2); box-shadow: inset 0 -5px 0 rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; min-width: 0; }
.tr-tile::after { content: ""; position: absolute; z-index: 0; background: repeating-linear-gradient(90deg, #FFF3C4 0 4px, transparent 4px 8px); opacity: .7; }
.tr-tile.r::after { left: calc(100% + 2px); top: 50%; width: var(--g); height: 3px; margin-top: -1px; }
.tr-tile.l::after { right: calc(100% + 2px); top: 50%; width: var(--g); height: 3px; margin-top: -1px; }
.tr-tile.d::after { top: calc(100% + 2px); left: 50%; height: var(--g); width: 3px; margin-left: -1px; background: repeating-linear-gradient(180deg, #FFF3C4 0 4px, transparent 4px 8px); }
.tr-n { position: absolute; left: 9%; top: 6%; font-size: clamp(9px, 1.3vw, 14px); font-weight: 800; color: rgba(255,255,255,.75); z-index: 1; }
.tr-ico { width: 66%; height: 66%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); user-select: none; }
.tr-tile.k-q { background: #3A1242; border-color: #FF4F87; }
.tr-tile.k-move { background: #2A1960; border-color: #A070FF; }
.tr-tile.k-boost { background: #0C3B4A; border-color: #2DD4D0; }
.tr-tile.k-slip { background: #4A3A08; border-color: #FFD43B; }
.tr-tile.k-again { background: #123F33; border-color: #5BE6A0; }
.tr-tile.k-swap { background: #13315C; border-color: #4DB8FF; }
.tr-tile.start { background: #14401C; border-color: #57D83A; }
.tr-tile.finish { background: #F7F1DE; border-color: #fff; } .tr-tile.finish .tr-n { color: #0E1120; }
.tr-tile.start .tr-n, .tr-tile.finish .tr-n { left: 0; right: 0; text-align: center; top: auto; bottom: 4%; font-size: clamp(8px, 1.2vw, 13px); text-transform: uppercase; letter-spacing: .05em; }
.tr-tile.start .tr-ico, .tr-tile.finish .tr-ico { width: 58%; height: 58%; margin-bottom: 12%; }
.tr-tokens { position: absolute; left: -10%; right: -10%; bottom: 2%; height: 78%; display: flex; justify-content: center; align-items: flex-end; z-index: 2; pointer-events: none; }
.tr-token { height: 100%; width: auto; margin: 0 -9%; filter: drop-shadow(0 4px 4px rgba(0,0,0,.55)); }
.tr-tokens:has(.tr-token:nth-child(3)) .tr-token { height: 80%; margin: 0 -8%; }
.tr-token.now { animation: tr-bob .9s ease-in-out infinite; z-index: 1; }
@keyframes tr-bob { 50% { transform: translateY(-10%); } }
.tr-card { position: absolute; inset: 0; margin: auto; width: min(92%, 620px); height: fit-content; max-height: 96%; overflow-y: auto; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: clamp(16px, 3vw, 30px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg), 0 0 0 100vmax rgba(2,3,28,.55); animation: pop .3s cubic-bezier(.2, 1.3, .4, 1); }
.tr-card-art { height: clamp(64px, 11vw, 120px); width: auto; filter: drop-shadow(0 6px 8px rgba(14,17,32,.25)); }
.tr-card h2 { margin: 0; font-size: clamp(20px, 2.8vw, 32px); }
.tr-card p { margin: 0; font-size: clamp(17px, 2.2vw, 25px); font-weight: 600; max-width: 30ch; }
.tr-extra { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tr-fact { font-family: var(--display); font-weight: 800; font-size: clamp(44px, 8vw, 92px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-ans { display: inline-block; min-width: 1.5em; padding: 0 .15em; border-radius: .18em; background: var(--surface-2); color: var(--muted); }
.tr-ans.shown { background: var(--emerald); color: #fff; animation: reveal .45s cubic-bezier(.2, 1.4, .4, 1); }
.tr-btn-art { width: 26px; height: 26px; object-fit: contain; flex: none; }
.tr-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font-size: 14px; color: var(--muted); max-width: 900px; }
.tr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tr-legend img { width: 26px; height: 26px; object-fit: contain; }
.tr-legend b { color: var(--ink); }
.tr-setup { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tr-tables { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tr-table { appearance: none; font: inherit; font-weight: 800; font-size: 15px; min-width: 48px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.tr-table.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 760px) { .tr-wrap { padding: 9% 7%; } .tr-tile { border-width: 1.5px; } .tr-card { position: fixed; max-height: 90vh; } .tr-legend { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .tr-token.now { animation: none; } }

/* Board: minimize the widget bar, and a small-icon look in full screen */
.dock-min { appearance: none; flex: none; align-self: center; width: 34px; height: 34px; margin-left: 4px; border: 0; border-radius: 10px; background: none; color: #0E1120; opacity: .55; cursor: pointer; display: grid; place-items: center; }
.dock-min:hover { opacity: 1; background: rgba(14,17,32,.08); }
.dock-min svg, .dock-show svg { width: 20px; height: 20px; }
.dock-wrap.min .dock { visibility: hidden; }
.dock-show { appearance: none; position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.82); color: #0E1120; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); backdrop-filter: blur(12px); opacity: .8; }
.dock-show:hover { opacity: 1; }
.board.fs-min .board-top > .row > .btn > span:not(:has(svg)), .board.fs-min .board-top .bg-wrap > .btn > span:not(:has(svg)) { display: none; }
.board.fs-min .board-top > .row > .btn, .board.fs-min .board-top .bg-wrap > .btn { padding: 10px; border-radius: 12px; opacity: .7; }
.board.fs-min .board-top > .row > .btn:hover, .board.fs-min .board-top .bg-wrap > .btn:hover, .board.fs-min .board-top .btn:focus-visible { opacity: 1; }
.board.fs-min .board-top { gap: 6px; }
.clock-time { white-space: nowrap; font-size: min(21cqw, 52cqh); }

/* Grouped menus in the top bar */
.nav-links { overflow: visible; align-items: center; }
.nav-menu { position: relative; }
.nav-drop { appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 14.5px; color: var(--muted); padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.nav-drop span { font-size: 11px; opacity: .7; }
.nav-drop:hover, .nav-drop[aria-expanded="true"] { color: var(--ink); background: var(--surface-2); }
.nav-drop.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.nav-pop { position: absolute; top: calc(100% + 10px); left: 0; min-width: 220px; z-index: 60; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.nav-links .nav-pop a { border-radius: 10px; padding: 10px 12px; font-size: 15px; color: var(--ink); }
.nav-links .nav-pop a:hover { background: var(--surface-2); }
.nav-links .nav-pop a.active { background: var(--surface-2); box-shadow: none; }
@media (max-width: 760px) {
  .nav-links { justify-content: space-between; gap: 0; }
  .nav-links > a, .nav-drop { padding: 8px 5px; font-size: 13.5px; }
  .nav-menu { position: static; }
  .nav-pop { left: 16px; right: 16px; top: calc(100% - 2px); }
}

/* Board screen switcher */
.screen-nav { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 14px; background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.7); color: #0E1120; backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); }
.screen-nav button { appearance: none; border: 0; background: none; color: inherit; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font: 700 22px/1 var(--body); display: grid; place-items: center; padding: 0 0 2px; }
.screen-nav button svg { width: 18px; height: 18px; margin-top: 2px; }
.screen-nav button:hover:not(:disabled) { background: rgba(14,17,32,.08); }
.screen-nav button:disabled { opacity: .3; cursor: default; }
.screen-count { font-weight: 700; font-size: 14px; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.board.fs-min .screen-nav { opacity: .7; } .board.fs-min .screen-nav:hover { opacity: 1; }

/* Sound Level */
.sl-stage { border-radius: 20px; min-height: 300px; padding: 32px clamp(16px, 4vw, 48px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; background: var(--surface-2); transition: background .3s ease; }
.sl-stage[data-s="quiet"] { background: color-mix(in srgb, var(--emerald) 16%, var(--surface)); }
.sl-stage[data-s="ok"] { background: color-mix(in srgb, var(--amber) 16%, var(--surface)); }
.sl-stage[data-s="loud"] { background: color-mix(in srgb, #E5484D 26%, var(--surface)); }
.sl-label { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 7vw, 96px); line-height: 1.05; letter-spacing: -.03em; }
.sl-meter { position: relative; width: min(100%, 820px); padding-top: 26px; }
.sl-bars { display: flex; gap: 5px; height: clamp(56px, 9vw, 96px); }
.sl-bars i { flex: 1; border-radius: 8px; background: color-mix(in srgb, var(--ink) 9%, transparent); transition: background .08s linear; }
.sl-bars i.green { background: #14B884; } .sl-bars i.amber { background: #F5AE14; } .sl-bars i.red { background: #E5484D; }
.sl-marker { position: absolute; top: 20px; bottom: -6px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.sl-marker b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding-bottom: 2px; }
.sl-controls { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; justify-content: center; }
.sl-slider { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); flex: 1 1 220px; max-width: 320px; }
.sl-slider input { width: 100%; accent-color: var(--ink); }

/* Daily Schedule */
.sched { display: flex; flex-direction: column; gap: 18px; }
.sched-now { display: flex; flex-direction: column; gap: 8px; padding: clamp(18px, 3vw, 32px); border-radius: 20px; background: color-mix(in srgb, var(--sky) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sky) 40%, var(--line)); }
.sched-now > b { font-family: var(--display); font-size: clamp(34px, 5.5vw, 72px); line-height: 1.05; letter-spacing: -.03em; overflow-wrap: anywhere; }
.sched-left { font-weight: 700; font-size: clamp(18px, 2.2vw, 26px); }
.sched-now .track { height: 10px; background: var(--surface); } .sched-now .track span { background: var(--sky); }
.sched-next { color: var(--muted); font-weight: 600; }
.sched-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sched-list li { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); font-weight: 700; font-size: 18px; }
.sched-list time { flex: none; width: 4.2em; color: var(--muted); font-variant-numeric: tabular-nums; }
.sched-list li.past { opacity: .45; }
.sched-list li.now { background: var(--ink); color: var(--bg); } .sched-list li.now time { color: inherit; opacity: .75; }
.sched-list li.end { background: none; border: 1.5px dashed var(--line); }
.sched-edit { display: flex; flex-direction: column; gap: 8px; }
.sched-row { display: flex; gap: 8px; align-items: center; }
.sched input[type="time"], .sched input[type="text"] { font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); min-width: 0; }
.sched input[type="text"] { flex: 1; }
.sched.compact { flex: 1; min-height: 0; gap: 8px; overflow-y: auto; }
.sched.compact .sched-now { padding: 12px 14px; border-radius: 14px; gap: 4px; flex: none; }
.sched.compact .sched-now > b { font-size: max(20px, min(9cqw, 12cqh)); }
.sched.compact .sched-left { font-size: 15px; } .sched.compact .sched-next { font-size: 13px; }
.sched.compact .sched-now .track { height: 6px; }
.sched.compact .sched-list { gap: 4px; }
.sched.compact .sched-list li { padding: 6px 10px; font-size: 14px; border-radius: 10px; gap: 8px; }
.sched.compact .sched-row input { padding: 6px 8px; font-size: 13px; }
.sched.compact > .muted { font-size: 12px; margin: 0; }

/* Class Jobs */
.jobs { display: flex; flex-direction: column; gap: 18px; }
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.job { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 18px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 38%, var(--line)); min-width: 0; }
.job-title { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 60%, var(--ink)); }
.job-who { font-family: var(--display); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.1; overflow-wrap: anywhere; }
.page.fs .jobs-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Class Points */
.pts { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.pts-body { align-self: stretch; display: flex; flex-direction: column; gap: 20px; }
.jar-layout { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(20px, 4vw, 56px); align-items: center; }
.jar { display: flex; flex-direction: column; align-items: center; }
.jar-lid { width: 62%; height: 26px; border-radius: 10px 10px 4px 4px; background: var(--ink); }
.jar-glass { width: 100%; aspect-ratio: 4 / 5; border: 5px solid color-mix(in srgb, var(--ink) 22%, var(--line)); border-top-width: 3px; border-radius: 22px 22px 56px 56px; background: linear-gradient(110deg, color-mix(in srgb, var(--sky) 14%, var(--surface)) 0%, var(--surface) 45%, color-mix(in srgb, var(--sky) 10%, var(--surface)) 100%); overflow: hidden; display: flex; align-items: flex-end; padding: 10px; }
.jar.full .jar-glass { border-color: var(--amber); box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber) 30%, transparent); }
.jar-marbles { display: grid; grid-template-columns: repeat(var(--per, 4), 1fr); gap: 4px; width: 100%; direction: rtl; transform: scaleY(-1); }
.jar-marbles i { aspect-ratio: 1; border-radius: 50%; box-shadow: inset -4px -5px 8px rgba(0,0,0,.22), inset 4px 4px 6px rgba(255,255,255,.5); }
.jar-marbles i.new { animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); }
.jar-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.jar-count { font-family: var(--display); font-weight: 700; color: var(--muted); font-size: clamp(22px, 3vw, 34px); }
.jar-count b { font-size: clamp(64px, 10vw, 128px); line-height: .9; color: var(--ink); letter-spacing: -.04em; }
.jar-title { margin: 0; font-size: clamp(24px, 3vw, 38px); }
.jar-reward { margin: 0; font-size: 19px; font-weight: 600; color: var(--muted); }
.jar-set { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.jar-set .cq-field.small { flex: 0 0 140px; }
.jar-set input { font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); width: 100%; }
.pts-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pts-team { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; border-radius: 20px; background: color-mix(in srgb, var(--c) 13%, var(--surface)); border: 2px solid color-mix(in srgb, var(--c) 35%, var(--line)); }
.pts-team.lead { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.pts-name { font: inherit; font-weight: 800; font-size: 18px; text-align: center; width: 100%; border: 1px solid transparent; background: none; color: var(--ink); border-radius: 10px; padding: 6px; }
.pts-name:hover, .pts-name:focus-visible { border-color: var(--line); background: var(--surface); }
.pts-score { font-family: var(--display); font-size: clamp(64px, 8vw, 110px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .jar-layout { grid-template-columns: 1fr; } .jar { max-width: 240px; margin: 0 auto; } .sched-list li { font-size: 16px; } }

/* Multiplication Race: hopping pawns */
.tr-fly { position: absolute; left: 0; top: 0; width: auto; z-index: 4; transform-origin: 50% 100%; pointer-events: none; filter: drop-shadow(0 8px 6px rgba(0,0,0,.55)); will-change: transform; }
.tr-tile.land { animation: tr-land .5s ease-out; }
@keyframes tr-land { 0% { transform: scale(.9); box-shadow: 0 0 0 0 var(--tc, #fff), inset 0 -5px 0 rgba(0,0,0,.25); } 45% { transform: scale(1.08); } 100% { transform: scale(1); box-shadow: 0 0 0 16px transparent, inset 0 -5px 0 rgba(0,0,0,.25); } }
.tr-count { position: absolute; z-index: 4; transform: translate(-50%, -50%); min-width: 1.9em; padding: .15em .4em; border-radius: 999px; color: #fff; font: 800 clamp(14px, 2.2vw, 24px)/1.4 var(--display); text-align: center; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.4); pointer-events: none; animation: tr-count .8s ease-out forwards; }
@keyframes tr-count { 0% { opacity: 0; transform: translate(-50%, 0) scale(.4); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -90%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -150%) scale(.9); } }

/* Accounts and plans */
.nav-account { flex: none; display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none;
  color: #fff; background: linear-gradient(135deg, var(--violet), var(--cobalt)); box-shadow: var(--shadow-sm); }
.nav-account:hover { filter: brightness(1.08); }
.nav-account.signed { padding: 0; width: 38px; justify-content: center; background: none; box-shadow: none; }
.nav-avatar { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--rose)); }
.nav-avatar.big { width: 56px; height: 56px; font-size: 24px; flex: none; }
.nav-account.signed.active .nav-avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--violet); }
@media (max-width: 760px) { .nav-account { position: absolute; top: 11px; right: 62px; } }
.acct { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.acct-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(20px, 3vw, 36px); max-width: 640px; }
.acct-card h2 { font-family: var(--display); font-size: clamp(22px, 2.6vw, 30px); margin: 0 0 6px; overflow-wrap: anywhere; }
.acct-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }
.acct-form input { flex: 1 1 240px; min-width: 0; font: inherit; font-size: 18px; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
#acctCode { letter-spacing: .3em; font-weight: 700; }
.acct-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-btn { width: 100%; justify-content: center; margin-top: 18px; gap: 12px; background: #fff; color: #1F1F1F; border: 1px solid #DADCE0; font-weight: 700; }
.google-btn:hover { background: #F8F9FA; border-color: #C6C9CE; }
.google-btn svg { width: 22px; height: 22px; }
.acct .small { font-size: 14px; }
.acct-who { display: flex; align-items: center; gap: 16px; }
.plan-badge { display: inline-block; font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.plan-badge.p-premium, .plan-badge.p-owner { color: #fff; background: linear-gradient(135deg, var(--violet), var(--rose)); }
.sync-status { margin: 16px 0 4px; font-weight: 600; color: var(--muted); }
.sync-status.s-saved { color: var(--emerald); }
.sync-status.s-error, .sync-status.s-offline { color: var(--amber); }
.acct-card .set-row { border-bottom: 0; padding: 16px 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 18px; max-width: 880px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.plan-card.premium { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--violet), var(--rose), var(--amber)) border-box; }
.plan-card h3 { font-family: var(--display); font-size: 24px; margin: 0; }
.plan-card .price { margin: 0; color: var(--muted); }
.plan-card .price b { font-size: 28px; color: var(--ink); font-family: var(--display); }
.plan-card ul { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; flex: 1; }
.plan-card li { display: flex; gap: 10px; align-items: baseline; }
.plan-card li span { font-weight: 800; color: var(--emerald); width: 14px; }
.plan-card li.no { color: var(--muted); } .plan-card li.no span { color: var(--muted); }
.plan-current { margin: 0; font-weight: 800; color: var(--violet); }
.upsell { margin: 0; }
.upsell a { font-weight: 800; color: var(--violet); white-space: nowrap; }
.sync-banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); font-weight: 600; }

.acct-sent { margin: 18px 0 14px; padding: 18px 20px; border-radius: 16px; background: var(--surface-2); }
.acct-sent h3 { margin: 0 0 6px; font-size: 18px; }
.acct-sent p { margin: 0 0 6px; }
