/* Student dashboard. The teacher page uses style.css. */
:root {
  --bg: #eef0f7;
  --card: #ffffff;
  --soft: #f1f3f9;
  --text: #121a2c;
  --muted: #69718a;
  --line: #e1e5f0;
  --accent: #4f5dff;
  --accent-2: #9b5cff;
  --gold: #ffb020;
  --good: #14b866;
  --warn: #ff8a1f;
  --danger: #ef3b4d;
  --night: #0d1530;
  --night-2: #1b2552;
  --radius: 20px;
  --shadow: 0 1px 2px rgb(18 26 44 / 0.05), 0 8px 24px rgb(18 26 44 / 0.06);
  --bar-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080c1a; --card: #121a30; --soft: #1a2340; --text: #eef1fa; --muted: #93a0bd;
    --line: #232d4d; --accent: #7a86ff; --accent-2: #b48bff; --night: #060a17; --night-2: #141d40;
    --shadow: 0 8px 24px rgb(0 0 0 / 0.25); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 100% -10%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%),
    radial-gradient(700px 500px at 20% 110%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.15; }
h2 { margin: 0; font-size: 1.15rem; font-weight: 900; letter-spacing: -0.01em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.eyebrow { margin: 0 0 8px; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pill { padding: 4px 12px; border-radius: 99px; background: var(--soft); font-size: 0.85rem; font-weight: 900; color: var(--muted); }
.pill.all { background: color-mix(in srgb, var(--good) 15%, var(--card)); color: var(--good); }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar-h);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 20px;
  background: var(--night); color: #fff;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 900; font-size: 0.95rem; box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 50%, transparent); }
.brand strong { display: block; font-size: 1.05rem; font-weight: 900; line-height: 1.1; }
.brand small { display: block; font-size: 0.72rem; color: rgb(255 255 255 / 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.dates { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; margin-right: 4px; }
.hebdate { font-family: "Frank Ruhl Libre", serif; font-size: 1.05rem; font-weight: 500; }
.greg { font-size: 0.7rem; color: rgb(255 255 255 / 0.55); }
.clock, .streak, .icon-btn { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 99px; background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.1); font-size: 0.88rem; white-space: nowrap; }
.clock small { font-size: 0.62rem; font-weight: 900; letter-spacing: 0.1em; color: rgb(255 255 255 / 0.55); }
.clock strong { font-variant-numeric: tabular-nums; }
.streak { font-weight: 900; color: #ffd27a; }
.icon-btn { cursor: pointer; font-weight: 800; color: #fff; }
.icon-btn:hover { background: rgb(255 255 255 / 0.14); }
.icon-btn[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--night); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.me { height: 36px; padding: 0 16px; border-radius: 99px; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 900; cursor: pointer; white-space: nowrap; }
.me.set { background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.1); }

/* ---------- Layout: schedule sidebar + main ---------- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
.main { display: grid; gap: 18px; max-width: 1000px; width: 100%; margin: 0 auto; padding: 22px 28px 64px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.row-head a { font-size: 0.85rem; font-weight: 800; text-decoration: none; }
.duo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }

/* Focus mode (automatic during a live question/timer, or by the 🎯 button). */
body.focus .secondary, body.focus .tools .notes, body.focus .tools .breathe-card { display: none; }
body.focus .main { max-width: 820px; }

/* ---------- Sidebar ---------- */
.side {
  position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); overflow-y: auto;
  padding: 22px 0;
  background: linear-gradient(180deg, var(--night), var(--night-2));
  color: #fff;
}
.side-title { margin: 0; padding: 0 20px; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: rgb(255 255 255 / 0.5); }
.side-day { margin: 2px 0 14px; padding: 0 20px; font-size: 0.82rem; color: rgb(255 255 255 / 0.7); font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0 10px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 25px; top: 10px; bottom: 10px; width: 2px; background: rgb(255 255 255 / 0.1); }
.timeline li { position: relative; padding: 7px 10px 7px 36px; border-radius: 12px; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--night); border: 2px solid rgb(255 255 255 / 0.4); }
.timeline .time { font-size: 0.72rem; color: rgb(255 255 255 / 0.5); font-variant-numeric: tabular-nums; line-height: 1.3; }
.timeline .title { font-size: 0.92rem; font-weight: 800; line-height: 1.3; }
.timeline .break { padding-top: 1px; padding-bottom: 1px; font-size: 0.72rem; color: rgb(255 255 255 / 0.45); }
.timeline .break::before { width: 4px; height: 4px; left: 14px; top: 9px; border: 0; background: rgb(255 255 255 / 0.25); }
.timeline .past { opacity: 0.35; }
.timeline .past:not(.break)::before { background: var(--good); border-color: var(--good); }
.timeline li.now:not(.break) { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.timeline li.now:not(.break)::before { background: #fff; border-color: #fff; box-shadow: 0 0 0 4px rgb(255 255 255 / 0.3); animation: beat 2s infinite; }
.timeline li.now .time { color: rgb(255 255 255 / 0.85); }
.timeline .break.now { color: #7dffb6; font-weight: 900; }
.timeline li.muted { color: rgb(255 255 255 / 0.6); padding-left: 36px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 30px 32px;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(125deg, #2b1fa8, #4f5dff 45%, #9b5cff);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--accent) 30%, transparent);
}
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / 0.18), transparent 70%); pointer-events: none; }
body[data-period="break"] .hero { background: linear-gradient(125deg, #087a4a, #14b866 55%, #6fe0a5); box-shadow: 0 18px 40px rgb(20 184 102 / 0.3); }
body[data-period="off"] .hero { background: linear-gradient(125deg, #1b1446, #3b2a8a 55%, #7b4fd6); }
.hero .eyebrow { color: rgb(255 255 255 / 0.7); }
.hero h1 { margin: 0; font-size: clamp(2rem, 4.8vw, 3.1rem); font-weight: 900; letter-spacing: -0.02em; }
.hero-sub { margin: 8px 0 0; font-weight: 800; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-sub span:empty { display: none; }
#now-time { color: rgb(255 255 255 / 0.7); font-variant-numeric: tabular-nums; }
.hero-next { margin: 14px 0 0; display: inline-block; padding: 6px 14px; border-radius: 99px; background: rgb(255 255 255 / 0.16); font-size: 0.9rem; font-weight: 800; }
.hero-next:empty { display: none; }

.ring { position: relative; flex: none; width: 132px; height: 132px; }
.ring svg, .mini-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle, .mini-ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: rgb(255 255 255 / 0.2); }
.ring .bar-c { stroke: #fff; stroke-linecap: round; filter: drop-shadow(0 0 6px rgb(255 255 255 / 0.7)); transition: stroke-dasharray 1s linear; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring-center strong { font-size: 2.2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.ring-center span { margin-top: 4px; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: rgb(255 255 255 / 0.75); }

/* ---------- Bars ---------- */
.track-line { height: 12px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.track-line > div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.7s cubic-bezier(.2,.8,.2,1); }
.track-line.slim { height: 8px; margin: 6px 0 14px; }
.track-line.slim > div { background: linear-gradient(90deg, var(--good), #6fe0a5); }
.track-line.gold > div { background: linear-gradient(90deg, var(--gold), #ffe08a); box-shadow: 0 0 12px var(--gold); }

/* ---------- Live timer ---------- */
.timer { text-align: center; }
.timer-digits { font-size: clamp(4rem, 15vw, 8rem); font-weight: 900; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.timer[data-state="soon"] .track-line > div { background: var(--warn); }
.timer[data-state="end"] .timer-digits { color: var(--danger); animation: pulse 1s infinite; }
.timer[data-state="end"] .track-line > div, .timer[data-state="done"] .track-line > div { background: var(--danger); }
.timer[data-state="done"] .timer-digits { color: var(--danger); }
.timer .track-line > div { transition: width 0.25s linear; }

/* ---------- Live question ---------- */
.activity { border: 3px solid var(--accent); box-shadow: 0 16px 44px color-mix(in srgb, var(--accent) 28%, transparent); animation: arrive 0.4s cubic-bezier(.2,.8,.2,1); }
.activity .prompt { margin: 2px 0 18px; font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 900; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 18px; font-size: 1.25rem; font-weight: 900; text-align: left; border: 3px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s; }
.choice:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 18%, transparent); }
.choice:active { transform: scale(0.97); }
.choice.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.letter { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; color: #fff; font-size: 1rem; font-weight: 900; background: var(--accent); }
.choice:nth-child(2) .letter { background: #ff5a5f; }
.choice:nth-child(3) .letter { background: var(--good); }
.choice:nth-child(4) .letter { background: var(--accent-2); }
.choice:nth-child(5) .letter { background: var(--gold); }
.choices.thumbs .choice { flex-direction: column; justify-content: center; text-align: center; font-size: 1.1rem; }
.got-it { margin: 14px 0 0; font-weight: 900; color: var(--good); }
.ticket { display: grid; gap: 12px; }
textarea { width: 100%; font: inherit; font-size: 1.05rem; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--soft); color: var(--text); resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); background: var(--card); }
.ticket textarea { font-size: 1.15rem; }
.btn { justify-self: start; padding: 12px 22px; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 1rem; font-weight: 900; cursor: pointer; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: var(--soft); color: var(--text); box-shadow: none; border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.results { display: grid; gap: 10px; }
.result { display: grid; grid-template-columns: minmax(80px, 30%) 1fr 2.5em; align-items: center; gap: 12px; font-weight: 900; }
.result.mine .r-label::after { content: "  ← you"; color: var(--accent); font-size: 0.85em; }
.r-bar { height: 32px; border-radius: 10px; background: var(--soft); overflow: hidden; }
.r-bar span { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.7s cubic-bezier(.2,.8,.2,1); }
.r-n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Goal ---------- */
.goal { border-left: 6px solid var(--gold); }
.goal-text { margin: 0 0 12px; font-size: 1.5rem; font-weight: 900; }
.goal-text:empty { display: none; }
.agenda-head { font-size: 0.85rem; font-weight: 900; color: var(--muted); }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: step; }
.agenda li { counter-increment: step; display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; font-weight: 800; }
.agenda li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--line); font-size: 0.8rem; font-weight: 900; color: var(--muted); }
.agenda li.done { color: var(--muted); text-decoration: line-through; }
.agenda li.done::before { content: "✓"; background: var(--good); border-color: var(--good); color: #fff; }
.agenda li.current { background: color-mix(in srgb, var(--accent) 10%, var(--card)); color: var(--accent); font-weight: 900; }
.agenda li.current::before { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }

/* ---------- Tools ---------- */
.tools { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 18px; }
body.focus .tools { grid-template-columns: 1fr; }
.tool { display: flex; flex-direction: column; }
.tool-text { margin: 0 0 14px; font-weight: 700; flex: 1; }
.sprint-body { display: flex; align-items: center; gap: 16px; }
.mini-ring { position: relative; width: 96px; height: 96px; flex: none; }
.mini-ring .track { stroke: var(--soft); }
.mini-ring .bar-c { stroke: url(#none); stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray 0.3s linear; }
.mini-ring strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.sprint.running .mini-ring .bar-c { filter: drop-shadow(0 0 5px var(--accent)); }
.sprint-ctl { display: grid; gap: 8px; }
.sprint-ctl p { margin: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--soft); }
.seg button { border: 0; background: none; padding: 4px 12px; border-radius: 9px; font-weight: 900; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.sprint.running .seg { opacity: 0.4; pointer-events: none; }
.notes textarea { flex: 1; min-height: 96px; }

/* ---------- Homework ---------- */
.hw-list { display: grid; gap: 10px; }
.hw { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--soft); transition: opacity 0.3s; }
.hw h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 900; }
.hw p { margin: 6px 0 0; white-space: pre-wrap; color: var(--muted); }
.hw.is-done { opacity: 0.5; }
.hw.is-done h3 { text-decoration: line-through; }
.check { position: relative; flex: none; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.check span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; border: 2.5px solid var(--muted); background: var(--card); transition: transform 0.15s; }
.check input:checked + span { background: var(--good); border-color: var(--good); transform: scale(1.1); box-shadow: 0 0 12px color-mix(in srgb, var(--good) 60%, transparent); }
.check input:checked + span::after { content: "✓"; color: #fff; font-weight: 900; }
.check input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.due { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 0.76rem; font-weight: 900; background: var(--card); color: var(--muted); }
.due.today { background: var(--danger); color: #fff; }
.due.soon { background: var(--warn); color: #fff; }
.due.late { background: color-mix(in srgb, var(--danger) 14%, var(--card)); color: var(--danger); }
.empty { margin: 0; padding: 18px; text-align: center; border-radius: 14px; background: var(--soft); font-weight: 800; color: var(--muted); }

/* ---------- Class goal, announcements ---------- */
.team-line { margin: 0 0 10px; font-size: 1rem; font-weight: 800; color: var(--muted); }
.team-line strong { font-size: 2.4rem; font-weight: 900; color: var(--text); }
.reward { margin: 10px 0 0; font-weight: 900; }
.reward:empty { display: none; }
.team.reached .track-line > div { background: linear-gradient(90deg, var(--good), #6fe0a5); box-shadow: 0 0 12px var(--good); }
.shoutouts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
#team-goal[hidden] + .shoutouts { margin-top: 0; }
.shoutouts:empty { display: none; }
.shoutouts li { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 14%, var(--card)); font-size: 0.95rem; }
.shoutouts li::before { content: "🌟 "; }
.shoutouts li.mine { outline: 2px solid var(--gold); }
.ann-list { display: grid; gap: 10px; margin-top: 12px; }
.ann h3 { margin: 0; font-size: 1rem; font-weight: 900; }
.ann p { margin: 4px 0 0; white-space: pre-wrap; color: var(--muted); font-size: 0.95rem; }
.ann + .ann { padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- Games ---------- */
.games iframe { display: block; width: 100%; height: min(70vh, 640px); border: 0; border-radius: 12px; background: var(--soft); }

/* ---------- Reading cycles: glowing orbs ---------- */
#sheets { display: grid; gap: 18px; }
#sheets:empty { display: none; }
.cycle {
  background: linear-gradient(160deg, var(--night), var(--night-2));
  color: #fff; border: 0; padding: 24px;
}
.cycle .row-head { margin-bottom: 6px; }
.cycle .eyebrow { color: rgb(255 255 255 / 0.55); margin: 0; }
.cycle-score { font-size: 0.9rem; font-weight: 900; color: #ffd27a; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 18px; font-size: 0.85rem; font-weight: 800; color: rgb(255 255 255 / 0.75); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); vertical-align: 0; }
.orbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 10px; }
.orb { display: grid; justify-items: center; gap: 8px; text-align: center; }
.orb-svg { position: relative; width: 84px; height: 84px; }
.orb-svg svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.orb-svg circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.orb-svg .seg-off { stroke: rgb(255 255 255 / 0.1); }
.orb-svg .seg-on { stroke: var(--c); filter: drop-shadow(0 0 6px var(--c)); animation: light 0.8s ease-out; }
.orb-core { position: absolute; inset: 14px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / 0.06); font-weight: 900; font-size: 1.05rem; letter-spacing: 0.02em; color: rgb(255 255 255 / 0.55); transition: background 0.4s, color 0.4s, box-shadow 0.4s; }
.orb.some .orb-core { color: #fff; background: rgb(255 255 255 / 0.12); }
.orb.full .orb-core { background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 60%, #e08600); color: var(--night); box-shadow: 0 0 26px rgb(255 176 32 / 0.75); animation: glow 2.4s ease-in-out infinite; }
.orb-name { font-size: 0.8rem; font-weight: 800; line-height: 1.2; color: rgb(255 255 255 / 0.75); max-width: 110px; }
.orb.mine .orb-name { color: #ffd27a; }
.orb.mine .orb-svg::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px dashed rgb(255 210 122 / 0.7); animation: spin 14s linear infinite; }

/* ---------- Progress tables: clean ---------- */
.grid-card summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.grid-card summary::-webkit-details-marker { display: none; }
.grid-card summary::after { content: ""; width: 10px; height: 10px; flex: none; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform 0.2s; }
.grid-card[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.grid-card summary .pill { margin-left: auto; }
.table-wrap { overflow-x: auto; margin: 16px -22px -20px; padding: 0 22px 20px; }
.tbl { border-collapse: separate; border-spacing: 0 6px; min-width: 100%; font-size: 0.92rem; }
.tbl th { padding: 0 8px 4px; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.04em; color: var(--muted); text-align: center; white-space: nowrap; }
.tbl th.lead { text-align: left; }
.tbl td { padding: 0 4px; text-align: center; }
.tbl td.lead { position: sticky; left: 0; z-index: 1; padding: 0 14px 0 0; text-align: left; white-space: nowrap; font-weight: 800; background: var(--card); }
.tbl .grp { display: inline-block; margin-inline-end: 8px; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); font-size: 0.7rem; font-weight: 900; color: var(--accent); letter-spacing: 0.06em; }
.cell { display: grid; place-items: center; min-width: 40px; height: 38px; padding: 0 10px; border-radius: 10px; background: var(--soft); color: var(--muted); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
.cell.empty::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.cell.text { background: color-mix(in srgb, var(--accent) 9%, var(--card)); color: var(--text); }
.cell.on { background: linear-gradient(135deg, var(--good), #3fd88a); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--good) 35%, transparent); }
.cell.on:empty::after { content: "✓"; font-weight: 900; }
tr.mine td.lead { color: var(--accent); }
tr.mine td.lead::before { content: "★ "; }
tr.mine .cell { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -2px; }
.tbl .mine-col .cell { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -2px; }
.tbl th.mine-col { color: var(--accent); }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; text-align: center; }
.attention { background: radial-gradient(circle at 50% 40%, var(--night-2), var(--night)); color: #fff; }
.attention-icon { font-size: clamp(5rem, 20vw, 10rem); animation: look 3s ease-in-out infinite; }
#attention-msg { margin: 8px 0; font-size: clamp(2rem, 7vw, 4rem); font-weight: 900; }
.attention-sub { color: rgb(255 255 255 / 0.7); font-size: 1.2rem; }
.spotlight { background: rgb(8 12 26 / 0.65); animation: arrive 0.3s; }
.spotlight-inner { padding: 40px 56px; border-radius: 28px; background: var(--card); box-shadow: 0 24px 70px rgb(0 0 0 / 0.35); animation: pop 0.45s cubic-bezier(.2,1.4,.4,1); }
.spotlight-name { margin: 0; font-size: clamp(2.5rem, 9vw, 5rem); font-weight: 900; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spotlight.is-me .spotlight-inner { outline: 8px solid var(--gold); }

.breathe { background: radial-gradient(circle at 50% 45%, #1d2a66, var(--night)); color: #fff; }
.breath-orb { width: 200px; height: 200px; margin: 0 auto 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c9d2ff, var(--accent) 55%, var(--accent-2)); box-shadow: 0 0 80px color-mix(in srgb, var(--accent) 70%, transparent); transform: scale(0.55); transition: transform 4s ease-in-out; }
.breath-orb.big { transform: scale(1); }
.breath-word { margin: 0; font-size: clamp(2rem, 6vw, 3rem); font-weight: 900; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-btn.light { margin-top: 18px; color: rgb(255 255 255 / 0.7); font-size: 1rem; }

.who { border: 0; border-radius: 26px; padding: 28px; width: min(600px, calc(100vw - 32px)); background: var(--card); color: var(--text); }
.who::backdrop { background: rgb(8 12 26 / 0.6); backdrop-filter: blur(4px); }
.who h2 { font-size: 1.7rem; }
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.who-btn { padding: 16px 10px; border-radius: 16px; border: 2px solid var(--line); background: var(--soft); font-size: 1.02rem; font-weight: 900; cursor: pointer; }
.who-btn:hover, .who-btn.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, 20px); padding: 12px 24px; border-radius: 99px; background: var(--night); color: #fff; font-weight: 900; box-shadow: 0 10px 30px rgb(0 0 0 / 0.3); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; z-index: 110; width: 100%; height: 100%; pointer-events: none; }

@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes beat { 50% { box-shadow: 0 0 0 8px rgb(255 255 255 / 0); } }
@keyframes arrive { from { transform: translateY(10px); opacity: 0; } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes light { from { stroke-opacity: 0; } }
@keyframes glow { 50% { box-shadow: 0 0 40px rgb(255 176 32 / 0.95); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes look { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-12px); } 60% { transform: translateX(12px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
  .tools { grid-template-columns: 1fr 1fr; }
  .tools .notes { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 16px 0 10px; }
  .timeline { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 6px; }
  .timeline::before, .timeline li::before { display: none; }
  .timeline li { flex: none; padding: 8px 12px; background: rgb(255 255 255 / 0.06); }
  .timeline .break { display: none; }
  .timeline .break.now { display: block; align-self: center; }
  .side-title, .side-day { padding: 0 16px; }
  .main { padding: 16px 16px 48px; }
  .duo { grid-template-columns: 1fr; }
  .dates { display: none; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .bar { padding: 0 12px; gap: 8px; }
  .brand small, .clock small, .icon-btn span { display: none; }
  .bar-right { gap: 6px; }
  .clock, .streak, .icon-btn { padding: 0 10px; }
  .hero { padding: 22px; gap: 14px; }
  .ring { width: 96px; height: 96px; }
  .ring-center strong { font-size: 1.6rem; }
  .card { padding: 16px; }
  .tools { grid-template-columns: 1fr; }
  .table-wrap { margin: 14px -16px -16px; padding: 0 16px 16px; }
  .orbs { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

/* Sheet switcher: one reading cycle and one table at a time */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 18px; padding: 4px; border-radius: 14px; background: var(--soft); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 7px 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 900; font-size: 0.9rem; cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.cycle .tabs { background: rgb(255 255 255 / 0.07); }
.cycle .tab { color: rgb(255 255 255 / 0.6); }
.cycle .tab:hover { color: #fff; }
.cycle .tab.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.grid-card .table-wrap { margin-top: 0; }

/* Perek / sicha picker inside a table */
.groups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.groups-label { margin-right: 4px; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.grp-btn { min-width: 40px; height: 40px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-family: "Frank Ruhl Libre", "Nunito", serif; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: transform 0.12s, border-color 0.15s; }
.grp-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.grp-btn.on { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.grid-card .tabs { margin-top: 0; }

/* ================= Rewards: level, quests, trophies ================= */
.lvl-chip { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 8px; border-radius: 99px; border: 1px solid rgb(255 210 122 / 0.35); background: linear-gradient(135deg, rgb(255 176 32 / 0.22), rgb(155 92 255 / 0.22)); color: #fff; cursor: pointer; white-space: nowrap; }
.lvl-star { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); font-size: 0.8rem; box-shadow: 0 0 12px var(--gold); }
.lvl-txt { font-size: 0.85rem; font-weight: 800; }
.lvl-txt b { font-weight: 900; }
.lvl-bar { width: 46px; height: 6px; border-radius: 99px; background: rgb(255 255 255 / 0.15); overflow: hidden; }
.lvl-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold), #ffe08a); transition: width 0.8s cubic-bezier(.2,.8,.2,1); }
.snd { padding: 0 10px; }

.prog { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.prog-level { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 6px; border-radius: 18px; background: linear-gradient(160deg, var(--night), var(--night-2)); color: #fff; padding: 18px 12px; }
.prog-level p { margin: 0; }
.prog-level .muted { color: rgb(255 255 255 / 0.6); }
.lvl-ring { position: relative; width: 120px; height: 120px; }
.lvl-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.lvl-ring circle { fill: none; stroke-width: 10; }
.lvl-ring .track { stroke: rgb(255 255 255 / 0.12); }
.lvl-ring .bar-c { stroke: var(--gold); stroke-linecap: round; filter: drop-shadow(0 0 7px var(--gold)); transition: stroke-dasharray 0.9s cubic-bezier(.2,.8,.2,1); }
.lvl-ring > div { position: absolute; inset: 0; display: grid; place-content: center; line-height: 1; }
.lvl-ring small { font-size: 0.6rem; font-weight: 900; letter-spacing: 0.14em; color: rgb(255 255 255 / 0.6); }
.lvl-ring strong { font-size: 2.6rem; font-weight: 900; }
.prog-rank { margin-top: 6px !important; font-size: 1.1rem; font-weight: 900; }
.xp-pill { margin-top: 6px !important; padding: 3px 12px; border-radius: 99px; background: rgb(255 176 32 / 0.18); color: #ffd27a; font-weight: 900; font-size: 0.85rem; }

.quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quests li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--soft); font-weight: 800; transition: background 0.3s; }
.q-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--card); font-size: 1rem; box-shadow: var(--shadow); }
.quests li.done { background: color-mix(in srgb, var(--good) 14%, var(--card)); color: var(--muted); text-decoration: line-through; }
.quests li.done .q-icon { background: var(--good); color: #fff; font-weight: 900; box-shadow: 0 0 10px color-mix(in srgb, var(--good) 50%, transparent); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.badge { display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 14px; background: var(--soft); text-align: center; }
.badge span { font-size: 1.5rem; line-height: 1.1; filter: grayscale(1); opacity: 0.4; }
.badge small { font-size: 0.66rem; font-weight: 800; line-height: 1.15; color: var(--muted); }
.badge.got { background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 22%, var(--card)), var(--card)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 50%, transparent); }
.badge.got span { filter: none; opacity: 1; }
.badge.got small { color: var(--text); }

.xp-float { position: fixed; z-index: 130; transform: translate(-50%, 0); padding: 4px 12px; border-radius: 99px; background: linear-gradient(135deg, var(--gold), #ffd76a); color: #2a1a00; font-weight: 900; font-size: 0.9rem; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgb(255 176 32 / 0.5); animation: floatUp 1.3s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.7); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }

.cele { z-index: 115; background: rgb(8 12 26 / 0.55); cursor: pointer; animation: arrive 0.25s; }
.cele-inner { padding: 36px 56px; border-radius: 30px; background: linear-gradient(160deg, var(--night), var(--night-2)); color: #fff; box-shadow: 0 0 0 4px rgb(255 176 32 / 0.6), 0 30px 80px rgb(0 0 0 / 0.45); animation: pop 0.5s cubic-bezier(.2,1.5,.4,1); }
.cele-icon { font-size: 5rem; line-height: 1; animation: bob 1.2s ease-in-out infinite; }
.cele-title { margin: 12px 0 4px; font-size: clamp(2rem, 6vw, 3rem); font-weight: 900; background: linear-gradient(90deg, #ffd27a, #fff, #ffd27a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cele-sub { margin: 0; font-size: 1.15rem; font-weight: 800; color: rgb(255 255 255 / 0.75); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-6deg); } }

@media (max-width: 1000px) { .prog { grid-template-columns: 180px minmax(0, 1fr); } .prog-badges { grid-column: 1 / -1; } }
@media (max-width: 620px) { .prog { grid-template-columns: 1fr; } .lvl-bar, .lvl-txt { display: none; } .lvl-chip { padding: 0 6px; } }
@media (max-width: 620px) {
  html, body { overflow-x: hidden; }
  .bar .clock, .brand > div { display: none; }
  .bar-right { min-width: 0; }
  .me { max-width: 130px; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }
}
