:root {
  --bg: #9fd185; --cream: #fff8ec; --paper: #fffdf7; --card: #ffffff; --line: #f1e3cc; --line2: #ead7bb;
  --wood: #c98f5f; --wood-d: #8b5e3c; --wood-l: #e8c39a; --ink: #4a3424; --muted: #8a7462;
  --green: #6cc070; --green-d: #4e9f55; --yellow: #f6c445; --yellow-d: #c99a22; --red: #e86a6a; --red-d: #b94848; --blue: #7cc3e6; --blue-d: #4f97bb;
  --soft-g: #e1f4d8; --soft-y: #fff1c4; --soft-b: #dff1fb; --chip: #f6ecda; --fact: #eef8e6; --fact-b: #b9dea6;
  --hud: rgba(255, 248, 236, .95); --study-bg: linear-gradient(#dff3fb, #f5fbe9 40%, #e7f4d6);
  --shadow: 0 6px 0 rgba(90, 60, 30, .18), 0 12px 24px rgba(60, 40, 20, .18);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
:root[data-theme="dark"] {
  --bg: #1d2330; --cream: #262d3b; --paper: #2b3343; --card: #313a4c; --line: #3b4559; --line2: #46516a;
  --wood: #8a6a52; --wood-d: #5e4535; --wood-l: #6b5444; --ink: #eef0f5; --muted: #a9b1c3;
  --soft-g: #2f4a3a; --soft-y: #4a4230; --soft-b: #2d4458; --chip: #3a4356; --fact: #2c3d34; --fact-b: #45664f;
  --hud: rgba(38, 45, 59, .95); --study-bg: linear-gradient(#1c2433, #222b3a 40%, #1f2a2a);
  --shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 12px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 700; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; }
[hidden] { display: none !important; }
.wood { background: var(--cream); border: 4px solid var(--wood); border-radius: 22px; box-shadow: var(--shadow); }
.muted { color: var(--muted); font-weight: 600; font-size: 13px; }
.err { color: var(--red); min-height: 20px; margin: 4px 0 10px; font-size: 14px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 16px; background: var(--wood-l); color: var(--ink); box-shadow: 0 4px 0 var(--wood-d); transition: transform .08s, box-shadow .08s; font-weight: 800; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-d); }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d); text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.btn.yellow { background: var(--yellow); color: #4a3424; box-shadow: 0 4px 0 var(--yellow-d); }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-d); }
.btn.blue { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-d); }
.btn.ghost { background: var(--hud); box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.btn.big { padding: 16px 22px; font-size: 18px; width: 100%; }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- logowanie ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: radial-gradient(ellipse at 50% 120%, #8cc66f 0 40%, transparent 41%), radial-gradient(ellipse at 10% 110%, #9fd185 0 35%, transparent 36%), linear-gradient(#bfe8fb, #e6f7ff 55%, #c9eab0 56%); }
:root[data-theme="dark"] .login { background: radial-gradient(ellipse at 50% 120%, #2c4a32 0 40%, transparent 41%), radial-gradient(ellipse at 10% 110%, #345a3a 0 35%, transparent 36%), linear-gradient(#141a2a, #1f2a40 55%, #24402b 56%); }
.login-card { width: min(440px, 100%); padding: 24px 20px; text-align: center; margin: auto; }
.logo { font-size: 40px; letter-spacing: 4px; }
.login h1 { margin: 4px 0 0; font-size: 34px; font-weight: 900; color: var(--wood-d); }
:root[data-theme="dark"] .login h1 { color: var(--wood-l); color: #e8c39a; }
.sub { margin: 4px 0 14px; color: var(--muted); }
.tabs { display: flex; background: var(--line); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.tab { flex: 1; padding: 9px; border-radius: 10px; color: var(--muted); }
.tab.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.08); }
form label { display: block; text-align: left; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
form input:not([type=checkbox]) { display: block; width: 100%; margin-top: 4px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line2); background: var(--card); color: var(--ink); font-weight: 700; outline: none; }
form input:focus { border-color: var(--green); }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
label.check input { width: 20px; height: 20px; accent-color: var(--green); }
.klabel { text-align: left; font-size: 14px; color: var(--muted); margin: 4px 0 6px; } .klabel small { font-weight: 600; }
.kchoices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.kchoice { background: var(--card); border: 3px solid var(--line2); border-radius: 16px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; }
.kchoice span { font-size: 30px; } .kchoice.on { border-color: var(--green); background: var(--soft-g); }
.recentbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; justify-content: center; }
.recentbox .muted { width: 100%; }
.recent { display: inline-flex; background: var(--chip); border-radius: 999px; overflow: hidden; }
.recent button { padding: 6px 10px; font-size: 13px; } .recent .rx { padding: 6px 8px 6px 2px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin: 14px 0 0; font-weight: 600; }

/* ---------- gra ---------- */
#game { position: fixed; inset: 0; }
#farm { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.hud { position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.pill { display: flex; align-items: center; gap: 6px; background: var(--hud); border: 3px solid var(--wood); border-radius: 999px; padding: 6px 12px; box-shadow: 0 3px 0 rgba(90,60,30,.25); font-size: 16px; }
.farmpill { padding: 4px 14px 4px 4px; text-align: left; max-width: 58vw; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--soft-y); display: grid; place-items: center; font-size: 24px; border: 2px solid var(--wood-l); flex: none; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.who small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.xpbar { display: block; height: 6px; background: var(--line); border-radius: 4px; margin-top: 2px; overflow: hidden; width: 120px; max-width: 100%; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8fd0ef, #6cc070); border-radius: 4px; transition: width .4s; }
.ring { width: 54px; height: 54px; position: relative; background: var(--hud); border: 3px solid var(--wood); border-radius: 50%; box-shadow: 0 3px 0 rgba(90,60,30,.25); }
.ring svg { position: absolute; inset: 2px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; } .ring .bg { stroke: var(--line); } .ring .fg { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; transition: stroke-dashoffset .5s; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 900; } .ring.done .fg { stroke: var(--yellow); }
.tipbar { position: absolute; top: calc(78px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: var(--hud); border-radius: 14px; padding: 8px 14px; font-size: 13px; box-shadow: 0 3px 0 rgba(90,60,30,.18); max-width: min(560px, calc(100% - 24px)); text-align: center; pointer-events: none; transition: opacity .4s; }
.visit { position: absolute; top: calc(76px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 10px; align-items: center; background: var(--soft-y); border: 3px solid #e5b93a; border-radius: 16px; padding: 8px 10px 8px 14px; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 20px); }
.visit span { overflow: hidden; text-overflow: ellipsis; }
.dock { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 6px; align-items: flex-end; background: var(--hud); border: 4px solid var(--wood); border-radius: 24px; padding: 6px; box-shadow: var(--shadow); }
.dockbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; padding: 6px 8px; border-radius: 16px; min-width: 64px; }
.dockbtn span { font-size: 24px; line-height: 1; } .dockbtn:active { background: var(--line); }
.dockbtn.main { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d); margin-top: -18px; padding: 10px 12px; min-width: 88px; font-size: 12px; }
.dockbtn.main span { font-size: 30px; }
.zoombtns { position: absolute; right: 12px; bottom: calc(110px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.zoombtns button { width: 42px; height: 42px; border-radius: 50%; background: var(--hud); border: 3px solid var(--wood); font-size: 18px; box-shadow: 0 3px 0 rgba(90,60,30,.25); }
.sync { font-size: 16px; opacity: .85; }
.decobar { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); width: min(640px, calc(100% - 20px)); padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; z-index: 3; }
.decohead { grid-column: 1 / -1; display: flex; flex-direction: column; } .decohead small { color: var(--muted); font-size: 12px; font-weight: 600; }
.decoinv { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.inv { flex: none; width: 62px; height: 62px; border-radius: 14px; background: var(--card); border: 3px solid var(--line2); display: grid; place-items: center; font-size: 26px; position: relative; }
.inv small { position: absolute; bottom: 1px; right: 5px; font-size: 11px; } .inv.on { border-color: var(--green); background: var(--soft-g); } .inv.empty { opacity: .35; }

/* ---------- dział (poletko) ---------- */
.seminar { position: fixed; inset: 0; z-index: 8; display: flex; justify-content: center; align-items: flex-end; padding: 10px; pointer-events: none; }
.sempanel { pointer-events: auto; width: min(720px, 100%); max-height: calc(100% - 70px - var(--safe-t)); overflow: auto; padding: 18px 16px 16px; position: relative; animation: up .25s ease-out; margin-bottom: var(--safe-b); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sempanel h2 { margin: 2px 40px 10px 0; font-size: 20px; line-height: 1.25; }
.x { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--line); font-size: 16px; z-index: 2; }
.kicker { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-right: 40px; }
.progress { height: 14px; background: var(--line); border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #8ed27a, #6cc070); border-radius: 8px; }
.progress.full i { background: linear-gradient(90deg, #ffd66b, #f2b33d); }
.prow { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin: 6px 0 10px; color: var(--muted); flex-wrap: wrap; }
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; margin: 10px 0; gap: 2px; }
.seg button { flex: 1; padding: 8px 4px; border-radius: 9px; font-size: 13px; color: var(--muted); } .seg button.on { background: var(--card); color: var(--ink); }
.intro { background: var(--card); border-radius: 16px; padding: 4px 16px; margin-bottom: 12px; border: 2px solid var(--line); font-weight: 600; line-height: 1.55; font-size: 15px; }
.intro h3 { margin: 12px 0 4px; font-weight: 900; } .intro h4 { margin: 14px 0 2px; color: var(--green-d); }
.intro b { font-weight: 900; } .intro ul { padding-left: 20px; }
.fact { background: var(--fact); border: 2px dashed var(--fact-b); border-radius: 14px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin: 12px 0; }
.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 12px; }
.cn { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 8px 4px; text-align: center; font-size: 22px; font-weight: 900; }
.cn small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.cn.new { color: #3b82c4; } .cn.learn { color: #d9534f; } .cn.due { color: #3f9a4a; } .cn.mat { color: #b8860b; }
.lessons { display: flex; flex-direction: column; gap: 8px; }
.lesson { display: flex; gap: 10px; align-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.lesson .lt { flex: 1; min-width: 0; } .lesson .lt b { display: block; } .lesson .lt small { color: var(--muted); font-size: 12px; }
.lesson.locked { opacity: .65; } .lesson.done { border-color: var(--fact-b); }
.sbar { display: flex; height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.sbar i { display: block; height: 100%; } .sbar .m { background: #e0b23c; } .sbar .y { background: #6cc070; } .sbar .l { background: #e86a6a; }
.lg { display: inline-block; padding: 0 6px; border-radius: 6px; color: #fff; font-size: 11px; } .lg.m { background: #e0b23c; } .lg.y { background: #6cc070; } .lg.l { background: #e86a6a; }
.mnlist { display: flex; flex-direction: column; gap: 6px; }
.mn { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.mn b { display: block; font-weight: 900; color: var(--green-d); } .mn p { margin: 2px 0; }
/* mapa myśli */
.mm { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px; overflow-x: auto; margin-bottom: 12px; }
.mmroot { display: inline-block; background: var(--wood); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 900; margin-bottom: 6px; }
.mm ul { list-style: none; margin: 0; padding-left: 18px; position: relative; }
.mm li { position: relative; padding: 3px 0 3px 14px; font-size: 14px; }
.mm li::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: 3px solid var(--c); opacity: .45; }
.mm li::after { content: ''; position: absolute; left: 0; top: 15px; width: 11px; border-top: 3px solid var(--c); opacity: .45; }
.mm li:last-child::before { bottom: calc(100% - 16px); }
.mm summary { cursor: pointer; display: inline-block; background: color-mix(in srgb, var(--c) 22%, transparent); border: 2px solid var(--c); padding: 3px 10px; border-radius: 10px; font-weight: 800; list-style: none; }
.mm summary::-webkit-details-marker { display: none; }
.mm details:not([open]) > summary::after { content: ' ＋'; opacity: .7; }
.mm .leaf span { display: inline-block; padding: 2px 6px; font-weight: 600; }
.mm .b0 { --c: #e86a6a; } .mm .b1 { --c: #f2a33d; } .mm .b2 { --c: #5aa469; } .mm .b3 { --c: #4f97bb; } .mm .b4 { --c: #9b6fd1; } .mm .b5 { --c: #d36fa8; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(30,20,10,.4); display: grid; place-items: center; padding: 12px; z-index: 20; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.panel { width: min(660px, 100%); max-height: calc(100% - 10px); overflow: auto; padding: 20px 18px; position: relative; }
.panel h2 { margin: 0 36px 4px 0; font-size: 22px; } .panel h3 { margin: 18px 0 8px; font-size: 16px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.tile { background: var(--card); border-radius: 16px; padding: 10px; text-align: center; border: 2px solid var(--line); }
.tile b { display: block; font-size: 20px; } .tile small { color: var(--muted); font-size: 11px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 6px 4px 0; position: relative; border-bottom: 2px solid var(--line); }
.bars .goal { position: absolute; left: 0; right: 0; border-top: 2px dashed #f2b33d; }
.bars .b { flex: 1; background: #9ed98a; border-radius: 6px 6px 0 0; position: relative; min-height: 2px; } .bars .b.ok { background: var(--green); } .bars .b.today { outline: 2px solid var(--wood); }
.bars .b span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 9px; color: var(--muted); }
.heat { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; margin-top: 26px; overflow-x: auto; }
.heat i { border-radius: 3px; background: var(--line); } .heat i.l1 { background: #cdeebf; } .heat i.l2 { background: #9ed98a; } .heat i.l3 { background: #6cc070; } .heat i.l4 { background: #3f9a4a; }
.semrow { display: grid; grid-template-columns: 28px 1fr 70px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; cursor: pointer; }
.semrow .n { width: 26px; height: 26px; border-radius: 8px; background: var(--wood-l); display: grid; place-items: center; font-weight: 900; }
.semrow .t { min-width: 0; } .semrow .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .semrow .r { text-align: right; color: var(--muted); font-size: 12px; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.achi { background: var(--card); border-radius: 14px; padding: 8px 10px; border: 2px solid var(--line); display: flex; gap: 8px; align-items: center; font-size: 12px; } .achi span { font-size: 24px; } .achi.off { opacity: .4; filter: grayscale(1); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 10px 12px; border: 2px solid var(--line); }
.row .rk { width: 30px; text-align: center; font-size: 18px; } .row .grow { flex: 1; min-width: 0; } .row .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .row .grow small { color: var(--muted); font-size: 12px; }
.row.me { border-color: var(--green); background: var(--soft-g); }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.item { background: var(--card); border-radius: 16px; border: 2px solid var(--line); padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.item .ic { font-size: 34px; } .item small { color: var(--muted); font-size: 12px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; } .sw { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line2); } .sw.on { box-shadow: 0 0 0 3px var(--green); }
.field { display: flex; gap: 8px; margin: 6px 0; } .field input, .field select { flex: 1; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line2); background: var(--card); font-weight: 700; color: var(--ink); }
.btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feed { font-size: 13px; display: flex; flex-direction: column; gap: 6px; } .feed div { background: var(--soft-y); border-radius: 12px; padding: 8px 10px; }
.chip { background: var(--chip); border-radius: 999px; padding: 5px 10px; font-size: 13px; } .chip.g { background: var(--soft-g); } .chip.y { background: var(--soft-y); }

/* ---------- nauka ---------- */
.study { position: fixed; inset: 0; z-index: 15; background: var(--study-bg); display: flex; flex-direction: column; }
.study-top { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: calc(10px + var(--safe-t)) 12px 8px; }
.study-title { min-width: 0; text-align: center; } .study-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .study-title small { color: var(--muted); font-size: 12px; }
.q-n { color: #3b82c4; } .q-l { color: #d9534f; } .q-r { color: #3f9a4a; }
.study-timer { text-align: right; } .study-timer span { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; } .study-timer small { display: block; font-size: 11px; color: var(--green-d); }
.study-main { flex: 1; overflow: auto; padding: 12px 12px calc(20px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; }
.studystats { display: flex; gap: 8px; justify-content: center; margin: 0 0 16px; flex-wrap: wrap; }
.card { width: min(640px, 100%); background: var(--paper); border-radius: 26px; border: 4px solid var(--wood-l); box-shadow: var(--shadow); padding: 22px 20px; position: relative; }
.card .tag { position: absolute; top: -14px; left: 18px; background: var(--wood); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.tagn, .tagr, .tagl { position: absolute; top: -12px; right: 18px; font-size: 11px; padding: 3px 8px; border-radius: 999px; color: #fff; }
.tagn { background: #3b82c4; } .tagr { background: #3f9a4a; } .tagl { background: #d9534f; }
.card .q { font-size: 20px; line-height: 1.4; font-weight: 800; margin: 6px 0 12px; } .card .q p { margin: 0 0 6px; }
.card .a { font-size: 18px; color: var(--green-d); font-weight: 900; padding-top: 12px; border-top: 2px dashed var(--line2); line-height: 1.45; }
:root[data-theme="dark"] .card .a { color: #8fe09a; }
.card .a p, .card .why p { margin: 0 0 6px; } .card ul { margin: 4px 0; padding-left: 20px; }
.card .why { margin-top: 8px; font-size: 14px; color: var(--muted); font-weight: 600; line-height: 1.5; }
.mnbox { margin-top: 10px; background: var(--soft-y); border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.flipzone { cursor: pointer; }
.rate { width: min(640px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.rate .btn { flex-direction: column; gap: 2px; padding: 12px 6px; font-size: 14px; } .rate small { font-size: 11px; opacity: .9; font-weight: 800; }
.summary { text-align: center; } .summary .big { font-size: 54px; } .summary h2 { margin: 6px 0; }
.donebtns { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.paused { position: absolute; inset: 0; background: rgba(255,255,255,.75); display: grid; place-items: center; z-index: 2; backdrop-filter: blur(3px); }
:root[data-theme="dark"] .paused { background: rgba(20,24,34,.8); }
.paused div { text-align: center; font-size: 46px; } .paused b { display: block; font-size: 22px; } .paused small { display: block; font-size: 14px; color: var(--muted); max-width: 260px; }

.updatebar { position: fixed; left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%); z-index: 70; background: var(--cream); border: 3px solid var(--green); border-radius: 16px; padding: 8px 10px 8px 14px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); white-space: nowrap; }
.toasts { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(420px, calc(100% - 24px)); }
.toast { background: var(--cream); border: 3px solid var(--wood); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: tin .35s cubic-bezier(.2,1.4,.4,1); width: 100%; }
.toast span { font-size: 26px; } .toast.gold { background: var(--soft-y); border-color: #e5b93a; } .toast.out { animation: tout .3s forwards; }
@keyframes tin { from { transform: translateY(-20px) scale(.9); opacity: 0; } } @keyframes tout { to { transform: translateY(-20px); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -40px; font-style: normal; font-size: 26px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .dockbtn { min-width: 54px; padding: 6px 4px; font-size: 10px; } .dockbtn span { font-size: 22px; } .dockbtn.main { min-width: 74px; font-size: 11px; }
  .pill { padding: 5px 9px; font-size: 14px; } .hud { left: 6px; right: 6px; } .hud-right { gap: 5px; }
  .farmpill { max-width: 46vw; padding-right: 10px; } .avatar { width: 32px; height: 32px; font-size: 19px; } .farmpill .xpbar { width: 90px; }
  .ring { width: 46px; height: 46px; } .tipbar { top: calc(66px + var(--safe-t)); font-size: 12px; } .visit { top: calc(64px + var(--safe-t)); font-size: 13px; }
  .card .q { font-size: 18px; } .card .a { font-size: 16px; }
  .rate { grid-template-columns: repeat(2, 1fr); }
  .zoombtns { bottom: calc(100px + var(--safe-b)); } .zoombtns button { width: 38px; height: 38px; }
  .seg button { font-size: 12px; } .sempanel { padding: 16px 12px 12px; max-height: calc(100% - 60px); }
  .counts .cn { font-size: 18px; }
}

/* =================== v3: FARMing Corp. =================== */
/* --- ekran startowy: chmury z napisem --- */
.login { align-content: center; gap: 0; }
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sky .c { position: absolute; display: block; background: #fff; border-radius: 999px; opacity: .85; filter: drop-shadow(0 6px 10px rgba(80,120,160,.18)); animation: drift linear infinite; }
.sky .c::before, .sky .c::after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
.sky .c::before { width: 55%; height: 140%; left: 14%; top: -60%; } .sky .c::after { width: 40%; height: 110%; right: 14%; top: -40%; }
.sky .c1 { width: 180px; height: 52px; top: 8%; animation-duration: 70s; animation-delay: -10s; }
.sky .c2 { width: 120px; height: 36px; top: 22%; animation-duration: 55s; animation-delay: -30s; opacity: .7; }
.sky .c3 { width: 220px; height: 60px; top: 60%; animation-duration: 90s; animation-delay: -50s; opacity: .6; }
.sky .c4 { width: 140px; height: 40px; top: 40%; animation-duration: 65s; animation-delay: -5s; opacity: .5; }
.sky .c5 { width: 100px; height: 30px; top: 78%; animation-duration: 80s; animation-delay: -70s; opacity: .55; }
@keyframes drift { from { left: -260px; } to { left: 110%; } }
:root[data-theme="dark"] .sky .c { background: #3a4660; opacity: .6; }
.cloudtitle { position: relative; z-index: 1; margin: calc(14px + var(--safe-t)) auto 16px; width: min(560px, 94%); padding: 26px 30px 22px; text-align: center; background: #fff; border-radius: 120px; box-shadow: 0 14px 30px rgba(70,110,150,.25); animation: cloudIn 1.4s cubic-bezier(.2,1.2,.4,1) both, bob 6s ease-in-out 1.4s infinite; }
.cloudtitle::before, .cloudtitle::after { content: ''; position: absolute; background: #fff; border-radius: 50%; z-index: -1; }
.cloudtitle::before { width: 46%; height: 150%; left: 12%; top: -45%; } .cloudtitle::after { width: 34%; height: 120%; right: 12%; top: -30%; }
.ct-brand { display: block; font-weight: 900; font-size: clamp(30px, 7vw, 48px); letter-spacing: .5px; background: linear-gradient(90deg, #5aa469, #3f8fbf, #d9776b); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.05; }
.ct-sub { display: block; font-family: 'Caveat', cursive; font-size: clamp(24px, 5.5vw, 34px); color: #8b5e3c; margin-top: 2px; }
:root[data-theme="dark"] .cloudtitle, :root[data-theme="dark"] .cloudtitle::before, :root[data-theme="dark"] .cloudtitle::after { background: #2b3343; }
@keyframes cloudIn { from { transform: translateY(-120px) scale(.7); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
.login-card { position: relative; z-index: 1; }

/* --- duży zanikający napis --- */
.bigmsg { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 40; pointer-events: none; text-align: center; width: min(92vw, 760px);
  font-weight: 900; font-size: clamp(26px, 6vw, 54px); color: #fff; text-shadow: 0 3px 0 rgba(90,60,30,.55), 0 10px 30px rgba(0,0,0,.35); animation: bigfade 3.6s ease forwards; }
.bigmsg small { display: block; font-family: 'Caveat', cursive; font-size: .6em; font-weight: 700; }
@keyframes bigfade { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1.03); } }

/* --- HUD: pogoda, dzwonek --- */
.pill.weather, .pill.bell { position: relative; font-size: 18px; padding: 6px 10px; }
.badge { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.notif { position: fixed; top: calc(70px + var(--safe-t)); right: 10px; width: min(380px, calc(100% - 20px)); max-height: 70vh; overflow: auto; z-index: 30; padding: 12px; }
.nhead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; } .nhead b { flex: 1; } .notif .x { position: static; }
.nitem { display: flex; gap: 10px; padding: 10px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.nitem.unread { border-color: var(--yellow); } .nitem .ic { font-size: 24px; } .nitem small { display: block; color: var(--muted); margin-top: 2px; }
.nitem .btn { margin-top: 6px; }
.task { background: var(--soft-y); border-radius: 12px; padding: 8px 10px; margin-top: 6px; }
.task .bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 4px; } .task .bar i { display: block; height: 100%; background: var(--green); }
.condbar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; } .condbar i { display: block; height: 100%; }

/* --- notatka odręczna --- */
.note { position: relative; font-family: 'Patrick Hand', 'Caveat', cursive; font-size: 19px; line-height: 30px; color: #263a70; padding: 16px 16px 16px 52px; margin-bottom: 14px; border-radius: 6px;
  background: #fffef6 repeating-linear-gradient(transparent 0 29px, #c9dcf2 29px 30px); box-shadow: 0 2px 0 rgba(0,0,0,.05), 0 8px 18px rgba(60,40,20,.12); }
.note::before { content: ''; position: absolute; left: 38px; top: 0; bottom: 0; border-left: 2px solid #f2a3a3; }
.note::after { content: ''; position: absolute; left: 10px; top: 20px; bottom: 20px; width: 12px; background: radial-gradient(circle, #e9e1cf 5px, transparent 6px) 0 0 / 12px 60px repeat-y; }
:root[data-theme="dark"] .note { background: #232a38 repeating-linear-gradient(transparent 0 29px, #34405a 29px 30px); color: #d6e2ff; }
.note h3 { font-family: 'Caveat', cursive; font-size: 34px; line-height: 40px; margin: 0 0 8px; color: #b5452f; }
.note h4 { font-family: 'Caveat', cursive; font-size: 27px; line-height: 30px; margin: 14px 0 0; color: #1f5fa8; text-decoration: underline wavy rgba(31,95,168,.35); text-underline-offset: 4px; }
:root[data-theme="dark"] .note h4 { color: #8fb8ff; } :root[data-theme="dark"] .note h3 { color: #ff9b85; }
.note p { margin: 0 0 0; } .note ul { margin: 0; padding-left: 20px; } .note li { list-style: '✎ '; }
.note b { font-weight: 400; text-decoration: underline; text-decoration-color: #d9534f; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.note mark { color: inherit; background: linear-gradient(104deg, rgba(255,235,80,0) .9%, rgba(255,235,80,.85) 2.4%, rgba(255,224,60,.6) 92%, rgba(255,235,80,0) 98%); padding: 0 3px; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
:root[data-theme="dark"] .note mark { background: rgba(255,214,40,.35); }
.note .warn { border: 2.5px solid #d9534f; border-radius: 10px 14px 8px 12px; padding: 0 10px; margin: 6px 0; color: #b52f2b; transform: rotate(-.4deg); }
.note .warn::before { content: '⚠️ '; }
.note .tip { background: rgba(108,192,112,.15); border-radius: 18px; padding: 0 12px; margin: 6px 0; color: #2d7a3a; }
.note .tip::before { content: '💡 '; }
:root[data-theme="dark"] .note .tip { color: #9fe0a6; } :root[data-theme="dark"] .note .warn { color: #ff9b97; }

/* --- mapa myśli: karty gałęzi --- */
.mm2root { text-align: center; margin: 4px 0 12px; } .mm2root span { display: inline-block; background: var(--wood); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 900; font-size: 17px; }
.mm2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-bottom: 14px; }
.mmcard { background: var(--card); border-radius: 16px; border: 2px solid var(--c); overflow: hidden; }
.mmcard > h4 { margin: 0; background: var(--c); color: #fff; padding: 8px 12px; font-size: 15px; cursor: pointer; display: flex; justify-content: space-between; }
.mmcard.closed > div { display: none; } .mmcard.closed > h4::after { content: '＋'; }
.mmcard > div { padding: 8px 12px 10px; font-size: 14px; }
.mmsub { margin: 6px 0; } .mmsub > b { display: block; color: var(--c); font-weight: 900; border-bottom: 1px dashed color-mix(in srgb, var(--c) 40%, transparent); margin-bottom: 4px; }
.mmleaf { display: inline-block; background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 8px; padding: 2px 8px; margin: 2px 4px 2px 0; font-weight: 700; font-size: 13px; }
.mmsub .mmsub { margin-left: 10px; }
.mmc0 { --c: #e0605f; } .mmc1 { --c: #e98f2f; } .mmc2 { --c: #4f9a5c; } .mmc3 { --c: #3f86b5; } .mmc4 { --c: #8d63c9; } .mmc5 { --c: #c95d9b; } .mmc6 { --c: #2f9c9c; } .mmc7 { --c: #9a7a3a; } .mmc8 { --c: #5d6fc9; }

/* --- mnemotechniki --- */
.mnfilter { width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line2); background: var(--card); color: var(--ink); font-weight: 700; margin: 4px 0 10px; }
.mngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.mncard { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.mncard .drug { font-weight: 900; font-size: 15px; color: var(--green-d); }
.mncard .hook { font-family: 'Caveat', cursive; font-size: 24px; line-height: 1.15; margin: 4px 0; }
.mncard .hook mark, .mncard .hook b { background: rgba(255,224,60,.55); color: inherit; font-weight: 700; border-radius: 4px; padding: 0 2px; text-decoration: none; }
.mncard .exp { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.4; }

/* --- pełny ekran działu --- */
.x.fs { right: 52px; }
.seminar.full { padding: 0; align-items: stretch; } .seminar.full .sempanel { width: 100%; max-width: none; max-height: none; height: 100%; border-radius: 0; margin: 0; }
.seminar.full .note { max-width: 900px; margin-left: auto; margin-right: auto; }

/* --- wybór uprawy --- */
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.pick button { background: var(--card); border: 3px solid var(--line2); border-radius: 14px; padding: 8px 6px; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pick button span { font-size: 28px; } .pick button.on { border-color: var(--green); background: var(--soft-g); } .pick button .rec { color: var(--yellow-d); font-size: 10px; }

/* --- quiz / wyzwanie --- */
.quiz { position: fixed; inset: 0; z-index: 25; background: var(--study-bg); overflow: auto; padding: calc(12px + var(--safe-t)) 12px calc(20px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; }
.qtop { width: min(680px, 100%); display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 12px; }
.qplayer { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 8px 10px; font-size: 13px; } .qplayer b { display: block; font-size: 22px; }
.qplayer.me { border-color: var(--green); } .qplayer.op { text-align: right; border-color: var(--blue); }
.qtimer { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 20px; background: var(--card); border: 4px solid var(--yellow); }
.qq { width: min(680px, 100%); }
.opt { width: 100%; text-align: left; background: var(--card); border: 3px solid var(--line2); border-radius: 16px; padding: 12px 14px; font-size: 16px; display: flex; gap: 10px; box-shadow: 0 3px 0 var(--line2); margin-bottom: 10px; font-weight: 700; }
.opt .l { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--line); display: grid; place-items: center; font-size: 13px; }
.opt.good { border-color: var(--green); background: var(--soft-g); } .opt.bad { border-color: var(--red); background: #fde8e8; } :root[data-theme="dark"] .opt.bad { background: #4a2a2a; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; } .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); } .dots i.g { background: var(--green); } .dots i.b { background: var(--red); }
@media (max-width: 560px) { .pill.weather, .pill.bell { padding: 4px 7px; font-size: 15px; } .dockbtn { min-width: 48px; } .note { font-size: 17px; padding-left: 44px; } .note::before { left: 32px; } }
.brow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; } .brow input { flex: 1; min-width: 0; }
.qplayer.op .dots { justify-content: flex-end; }
@media (max-width: 480px) { .hud-right { gap: 5px; } .hud-right .pill { padding: 5px 8px; font-size: 14px; } .farmpill { min-width: 0; flex: 1 1 auto; max-width: 42vw; } .farmpill .who { min-width: 0; overflow: hidden; } .farmpill .who b, .farmpill .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; } #hudRing { width: 40px; height: 40px; } .hud-right .pill[title^="Seria"] { display: none; } }
/* ===== v3.2: grupy fiszek, pajęczyna, przytulna nauka ===== */
.grp { background: var(--card); border: 2px solid var(--line); border-radius: 22px; margin: 10px 0; overflow: hidden; }
.grp summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; }
.grp summary::-webkit-details-marker { display: none; }
.grp summary > div { flex: 1; min-width: 0; } .grp summary small { display: block; color: var(--muted); font-size: 12px; }
.grp .gi { font-size: 28px; } .grp .lessons { padding: 0 10px 10px; }
.grp.g1 { background: #fdeef2; border-color: #f5cdd8; } .grp.g2 { background: #eaf4fd; border-color: #c9e0f3; } .grp.g3 { background: #fff6e3; border-color: #f6e0ae; }
:root[data-theme="dark"] .grp.g1 { background: #3a2c33; border-color: #5a3f4a; } :root[data-theme="dark"] .grp.g2 { background: #2a3442; border-color: #3e4f63; } :root[data-theme="dark"] .grp.g3 { background: #3b3528; border-color: #5c5038; }
.spider { width: 100%; } .spsvg { width: 100%; height: auto; display: block; }
.spsvg .web { fill: none; stroke: var(--line); stroke-dasharray: 4 6; }
.spsvg .strand { fill: none; stroke-width: 3; opacity: .55; } .spsvg .strand.on { opacity: 1; stroke-width: 4; }
.spsvg .hub { fill: #fff4d6; stroke: #f2c879; stroke-width: 3; } .spsvg .hubt { font: 800 15px Nunito, sans-serif; text-anchor: middle; fill: #6b4a2b; }
.spsvg .spn { cursor: pointer; transition: transform .2s; } .spsvg .spn rect { stroke: rgba(0,0,0,.08); stroke-width: 2; } .spsvg .spn.on rect { stroke: #6b4a2b; stroke-width: 3; }
.spsvg .spt { font: 700 13px Nunito, sans-serif; text-anchor: middle; fill: #4a3a2e; pointer-events: none; }
.spcard { border: 3px solid; border-radius: 22px; overflow: hidden; background: var(--card); margin: 8px 0 14px; }
.spcard h4 { margin: 0; padding: 10px 14px; color: #4a3a2e; } .spcard ul { margin: 8px 0; padding-left: 22px; line-height: 1.5; } .spcard li { margin: 4px 0; } .spcard ul ul { font-size: 14px; }
/* przytulna, pastelowa nauka */
.study { --study-bg: linear-gradient(160deg, #fdf1f4, #f3f0fb 45%, #eef7f1); background: var(--study-bg); }
:root[data-theme="dark"] .study { --study-bg: linear-gradient(160deg, #2b2730, #262a35 45%, #25302c); }
.card { border: none; border-radius: 32px; background: #fffdf9; box-shadow: 0 10px 30px rgba(170,140,170,.18), 0 2px 0 rgba(170,140,170,.12); padding: 26px 24px; }
:root[data-theme="dark"] .card { background: #33303a; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.card .tag { background: #e9d8f2; color: #6a4f7a; border-radius: 999px; } :root[data-theme="dark"] .card .tag { background: #4a3f55; color: #e5d6f0; }
.card .q { color: #4a3f4f; font-weight: 800; } :root[data-theme="dark"] .card .q { color: #f0e8f2; }
.card .a, :root[data-theme="dark"] .card .a { color: #5a4a66; font-weight: 700; border-top: 2px dotted #e8d9ea; background: #fbf6ff; margin: 0 -10px; padding: 14px 10px 6px; border-radius: 0 0 20px 20px; }
:root[data-theme="dark"] .card .a { color: #e8dcf0; background: #3b3742; border-top-color: #554b5e; }
.card .why { color: #8a7c8f; }
.rate .btn { border-radius: 22px; box-shadow: none; border: none; font-weight: 800; }
.rate .btn:nth-child(1) { background: #f8c9cf; color: #8a3a46; } .rate .btn:nth-child(2) { background: #fbe0b8; color: #8a5a1a; }
.rate .btn:nth-child(3) { background: #cfe8d2; color: #2f6a3c; } .rate .btn:nth-child(4) { background: #cfe2f6; color: #2f5a85; }
.study-timer small, .tipbar { color: #8a7c8f; }
.toast.quote { background: #fff5f8; border: 2px solid #f6d3df; border-radius: 22px; font-family: 'Patrick Hand', cursive; font-size: 17px; color: #6a4f7a; }
#tipbar { border-radius: 999px; }
/* odwiedziny: baner na dole, w miejscu ukrytego docka */
.visit, .visit[style] { top: auto !important; bottom: calc(18px + var(--safe-b)); z-index: 12; padding: 10px 14px; font-size: 14px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 24px); }
.visit #visitBack { font-size: 15px; padding: 10px 16px; }
/* wybór uprawy: przypięty pasek z przyciskiem */
.pickbar { position: sticky; bottom: -20px; margin: 12px -18px -20px; padding: 12px 18px calc(12px + var(--safe-b)); background: var(--cream, #fff8ec); border-top: 2px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; z-index: 2; }
:root[data-theme="dark"] .pickbar { background: #262d3b; }
.pickbar span { flex: 1; min-width: 140px; font-weight: 800; }
.pick button { cursor: pointer; touch-action: manipulation; }

/* ===== v3.5 – spokojny interfejs nauki i menu poletka + motywy (domyślny / róż / zieleń) ===== */
:root { --ui-bg: linear-gradient(165deg, #faf7f2, #f4f1f7); --ui-card: #fffdfa; --ui-panel: #fbf9f6; --ui-soft: #f1ecf4; --ui-line: #e9e3ec; --ui-ink: #3f3a45; --ui-muted: #8b8492; --ui-accent: #8b7aa8; --ui-good: #b9d7c4; }
:root[data-ui="rose"] { --ui-bg: linear-gradient(165deg, #fdf3f5, #fbeff3); --ui-card: #fffafb; --ui-panel: #fff7f9; --ui-soft: #fbe5ec; --ui-line: #f2dce3; --ui-ink: #4b3a40; --ui-muted: #9a8189; --ui-accent: #c47f95; --ui-good: #e9c4d0; }
:root[data-ui="mint"] { --ui-bg: linear-gradient(165deg, #f0f8f3, #f3f8f6); --ui-card: #fbfefc; --ui-panel: #f6fbf8; --ui-soft: #e1f1e8; --ui-line: #d8eadf; --ui-ink: #37403c; --ui-muted: #7e8f87; --ui-accent: #6aa287; --ui-good: #bfe0cc; }
:root[data-theme="dark"] { --ui-bg: linear-gradient(165deg, #25232a, #22252c); --ui-card: #2f2c35; --ui-panel: #29272f; --ui-soft: #3a3542; --ui-line: #3e3946; --ui-ink: #eee8f2; --ui-muted: #a8a0ae; }

/* ekran nauki */
.study { background: var(--ui-bg); color: var(--ui-ink); }
.study-title small, .study-timer small, .study .tipbar { color: var(--ui-muted); }
.studystats .chip { background: var(--ui-soft); color: var(--ui-muted); border: none; box-shadow: none; font-weight: 700; font-size: 12px; }
.card { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 28px; box-shadow: 0 8px 28px rgba(70, 55, 80, .08); }
.card .tag { background: var(--ui-soft); color: var(--ui-ink); font-weight: 700; }
.card .q { color: var(--ui-ink); font-weight: 700; }
.card .a, :root[data-theme="dark"] .card .a { color: var(--ui-ink); background: var(--ui-soft); border-top: none; font-weight: 600; margin: 4px -10px 0; padding: 14px 12px 8px; border-radius: 18px; }
.card .why { color: var(--ui-muted); font-weight: 500; }
.card .tagn, .card .tagl, .card .tagr { opacity: .75; }
#flipHint { color: var(--ui-muted); font-size: 13px; }
.rate .btn { color: var(--ui-ink) !important; font-weight: 700; }
.rate .btn:nth-child(1) { background: #f3d6da; } .rate .btn:nth-child(2) { background: #f4e5cf; }
.rate .btn:nth-child(3) { background: #d8e9dd; } .rate .btn:nth-child(4) { background: #d8e3f0; }
:root[data-theme="dark"] .rate .btn:nth-child(n) { background: var(--ui-soft); }

/* hak pamięciowy – wyeksponowany na odwrocie fiszki */
.hook { margin-top: 12px; background: var(--ui-card); border: 1px solid var(--ui-line); border-left: 5px solid var(--ui-accent); border-radius: 16px; padding: 10px 14px 12px; }
.hook .hk { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ui-accent); font-weight: 800; margin-bottom: 4px; }
.hook .ht { font-family: 'Patrick Hand', cursive; font-size: 20px; line-height: 1.35; color: var(--ui-ink); }
.hook .ht p { margin: 0; }

/* spokojna wiadomość motywacyjna */
.note-pop { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); z-index: 60; width: max-content; max-width: min(440px, calc(100% - 32px)); background: var(--ui-card); color: var(--ui-ink); border: 1px solid var(--ui-line); border-radius: 18px; padding: 12px 20px; font-family: 'Patrick Hand', cursive; font-size: 20px; line-height: 1.3; text-align: center; box-shadow: 0 10px 30px rgba(70, 55, 80, .12); pointer-events: none; animation: npin .8s ease-out; transition: opacity .8s; }
.note-pop.out { opacity: 0; }
@keyframes npin { from { opacity: 0; transform: translate(-50%, 8px); } }

/* menu poletka */
.sempanel.wood { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 26px; box-shadow: 0 12px 40px rgba(70, 55, 80, .16); color: var(--ui-ink); }
.sempanel .kicker, .sempanel .prow, .sempanel .muted { color: var(--ui-muted); }
.sempanel .x { background: var(--ui-soft); color: var(--ui-ink); }
.sempanel .progress { height: 8px; background: var(--ui-soft); } .sempanel .progress i { background: var(--ui-accent); }
.sempanel .seg.semtabs { background: var(--ui-soft); } .sempanel .seg.semtabs button { color: var(--ui-muted); font-weight: 700; } .sempanel .seg.semtabs button.on { background: var(--ui-card); color: var(--ui-ink); box-shadow: 0 1px 4px rgba(70,55,80,.08); }
.sempanel .cn { background: var(--ui-card); border: 1px solid var(--ui-line); color: var(--ui-ink); font-weight: 800; }
.sempanel #goStudy { background: var(--ui-accent); color: #fff; box-shadow: none; border-radius: 18px; }
.sempanel #duelBtn { background: var(--ui-soft); color: var(--ui-ink); box-shadow: none; border-radius: 18px; font-size: 15px; }
.sempanel .fact { background: var(--ui-soft); border: none; color: var(--ui-ink); }
.sempanel .grp, .sempanel .grp.g1, .sempanel .grp.g2, .sempanel .grp.g3 { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 20px; }
.sempanel .grp summary { border-left: 5px solid var(--ui-accent); } .sempanel .grp.g2 summary { border-left-color: var(--ui-good); } .sempanel .grp.g3 summary { border-left-color: var(--ui-line); }
.sempanel .grp summary .btn { background: var(--ui-soft); color: var(--ui-ink); box-shadow: none; }
.sempanel .lesson { background: var(--ui-panel); border: 1px solid var(--ui-line); }
.sempanel .lesson .btn { background: var(--ui-soft); color: var(--ui-ink); box-shadow: none; }
.sempanel .lesson.done { border-color: var(--ui-good); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--ui-line); }
.dot.open { background: var(--ui-accent); } .dot.done { background: var(--ui-good); }

/* przełącznik motywu (trzy kropki) */
.uiswitch { display: inline-flex; gap: 6px; align-items: center; }
.study-title .uiswitch { display: flex; justify-content: center; margin-top: 4px; }
.uiswitch button { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ui-card); box-shadow: 0 0 0 1px var(--ui-line); padding: 0; }
.uiswitch button.on { box-shadow: 0 0 0 2px var(--ui-accent); }
.uiswitch .sw-default { background: #ddd3e8; } .uiswitch .sw-rose { background: #f4c7d4; } .uiswitch .sw-mint { background: #c4e5d2; }

.q-n, .q-l, .q-r { color: var(--ui-ink); font-weight: 700; }

/* ===== v3.6 – zakładka „Poletko”: 4 poziomy, kłódki, sklepy ===== */
.plotintro { margin: 4px 0 10px; font-size: 13px; }
.lvgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lv { position: relative; text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 150px; padding: 14px; border-radius: 20px; background: var(--ui-card); border: 1px solid var(--ui-line); color: var(--ui-ink); overflow: hidden; cursor: pointer; transition: transform .15s; }
.lv:not(.locked):active { transform: scale(.98); }
.lv::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--ui-accent); opacity: .85; }
.lv2::before { background: var(--ui-good); } .lv3::before { background: #e8c37a; } .lv4::before { background: linear-gradient(#f4c7d4, #cdb9ec, #a9d2f0); }
.lv .lvn { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ui-muted); font-weight: 800; }
.lv b { font-size: 18px; } .lv small { color: var(--ui-muted); font-size: 12px; line-height: 1.35; }
.lv .lvs { margin-top: auto; font-size: 12px; font-weight: 700; color: var(--ui-ink); background: var(--ui-soft); border-radius: 10px; padding: 5px 8px; }
.lv.locked { background: #ecebee; border-color: #dddbe0; color: #9b98a1; cursor: not-allowed; filter: grayscale(1); }
:root[data-theme="dark"] .lv.locked { background: #2a292e; border-color: #38363d; color: #77737d; }
.lv.locked small, .lv.locked .lvn { color: inherit; } .lv.locked .lvs { background: rgba(0,0,0,.05); color: inherit; }
.lv .lock { position: absolute; top: 12px; right: 12px; color: #8f8b96; }
.lv.crack { pointer-events: none; }
.lv.crack .lock { color: var(--ui-accent); animation: lockshake .6s ease-in-out 2, lockgone .5s ease-in 1.15s forwards; }
.lv.crack .lock .sh { transform-origin: 17px 11px; animation: shackle .45s ease-out 1.1s forwards; }
.lv.crack .lock .bd { animation: crackbody .45s ease-out 1.1s forwards; }
.lv.crack { animation: glowlv 1.5s ease-out; }
@keyframes lockshake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes shackle { to { transform: rotate(-35deg) translateY(-4px); } }
@keyframes crackbody { 0% { clip-path: inset(0); } 40% { clip-path: polygon(0 0, 48% 0, 40% 50%, 52% 100%, 0 100%); transform: translateX(-2px); } 100% { clip-path: polygon(0 0, 48% 0, 40% 50%, 52% 100%, 0 100%); transform: translate(-6px, 6px) rotate(-14deg); opacity: 0; } }
@keyframes lockgone { to { opacity: 0; transform: scale(1.4); } }
@keyframes glowlv { 0%, 70% { box-shadow: 0 0 0 0 transparent; } 85% { box-shadow: 0 0 0 6px var(--ui-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
.pshophead { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; font-weight: 800; }
.pshophead span:nth-child(2) { flex: 1; } .pshophead .money { font-size: 14px; color: var(--ui-muted); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.pitem { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 18px; padding: 10px 8px; }
.pitem img { width: 100%; height: 96px; object-fit: contain; }
.pitem b { font-size: 14px; line-height: 1.2; } .pitem small { color: var(--ui-muted); font-size: 12px; }
.pitem .btn { background: var(--ui-soft); color: var(--ui-ink); box-shadow: none; border-radius: 12px; }
.pitem .btn:disabled { opacity: .55; }
.pbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.summary .donebtns .btn { background: var(--ui-soft); color: var(--ui-ink); box-shadow: none; border-radius: 16px; }
.summary .donebtns .btn:first-child { background: var(--ui-accent); color: #fff; }
.studystats .chip.undo { background: var(--ui-card); color: var(--ui-ink); border: 1px solid var(--ui-line); cursor: pointer; }


/* ===== samouczek w dymkach ===== */
.tour-ov { position: fixed; inset: 0; z-index: 90; background: rgba(40, 32, 48, .42); }
.tour-ov.spot { background: transparent; }
.tour-ov.spot::after { content: ''; position: fixed; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border-radius: 16px; box-shadow: 0 0 0 9999px rgba(40, 32, 48, .42), 0 0 0 3px rgba(255,255,255,.9); pointer-events: none; transition: all .25s; }
.tour-tip { position: fixed; z-index: 91; background: var(--ui-card, #fffdfa); color: var(--ui-ink, #3f3a45); border: 1px solid var(--ui-line, #e9e3ec); border-radius: 18px; padding: 14px 16px 10px; box-shadow: 0 14px 40px rgba(40, 30, 50, .25); font-size: 15px; line-height: 1.45; animation: tourin .25s ease-out; }
.tour-tip::before { content: ''; position: absolute; left: calc(var(--ax, 50%) - 8px); width: 16px; height: 16px; background: inherit; border: inherit; border-width: 1px 0 0 1px; transform: rotate(45deg); }
.tour-tip.down::before { top: -9px; } .tour-tip.up::before { bottom: -9px; transform: rotate(225deg); }
.tour-tip .tb { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ui-muted, #8b8492); }
.tour-tip .tb span { flex: 1; }
.tour-tip button { border-radius: 12px; padding: 7px 14px; font-weight: 800; font-size: 13px; }
.tour-tip .tskip { background: transparent; color: var(--ui-muted, #8b8492); }
.tour-tip .tnext { background: var(--ui-accent, #8b7aa8); color: #fff; }
@keyframes tourin { from { opacity: 0; transform: translateY(6px); } }

/* ===== v3.8 – motywy interfejsu nauki (tła, karty, notatki, mapa myśli) – wygenerowane ===== */
:root, :root:not([data-ui]) { --ui-bg: linear-gradient(165deg, #f3eef8, #ebe4f3); --ui-bgflat: #f3eef8; --ui-panel: #f8f5fb; --ui-card: #fffdff; --ui-soft: #e8e0f1; --ui-line: #ddd3e8; --ui-ink: #3d3548; --ui-muted: #857a92; --ui-accent: #8b74ad; --ui-good: #c9b8e0; --ui-paper: #fffdf8; --ui-pline: #d7d0e8; --ui-pink: #2f3260; --ui-h3: #a0457a; --ui-h4: #4a5fae; }
:root[data-theme="dark"] { --ui-bg: linear-gradient(165deg, #211e28, #1c1a23); --ui-bgflat: #211e28; --ui-panel: #26232e; --ui-card: #2e2a37; --ui-soft: #3a3446; --ui-line: #433c50; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #2e2a37; --ui-pline: #433c50; --ui-pink: #e6e0f0; --ui-h3: #a0457a; --ui-h4: #a9c2ff; }
.uiswitch .sw-default, .uisw .sw-default { background: #d9cfe8; }
:root[data-ui="rose"] { --ui-bg: linear-gradient(165deg, #fbe3ea, #f8d6e1); --ui-bgflat: #fbe3ea; --ui-panel: #fdf0f4; --ui-card: #fff9fb; --ui-soft: #f8d9e3; --ui-line: #f0c9d6; --ui-ink: #4b2f3a; --ui-muted: #9a7380; --ui-accent: #c46a88; --ui-good: #eab8c8; --ui-paper: #fffafb; --ui-pline: #f2cdd9; --ui-pink: #5a2c3c; --ui-h3: #c0476a; --ui-h4: #8a4a9e; }
:root[data-theme="dark"][data-ui="rose"] { --ui-bg: linear-gradient(165deg, #2a1e23, #24191e); --ui-bgflat: #2a1e23; --ui-panel: #30232a; --ui-card: #3a2a32; --ui-soft: #4a3540; --ui-line: #563e4a; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #3a2a32; --ui-pline: #563e4a; --ui-pink: #e6e0f0; --ui-h3: #c0476a; --ui-h4: #a9c2ff; }
.uiswitch .sw-rose, .uisw .sw-rose { background: #f4c3d1; }
:root[data-ui="mint"] { --ui-bg: linear-gradient(165deg, #e2f3ea, #d4ece0); --ui-bgflat: #e2f3ea; --ui-panel: #f0f9f4; --ui-card: #fbfefc; --ui-soft: #d6eee1; --ui-line: #c4e2d2; --ui-ink: #2f3b36; --ui-muted: #72877e; --ui-accent: #4f9a78; --ui-good: #b6dcc6; --ui-paper: #fbfffc; --ui-pline: #cde6d8; --ui-pink: #263c4a; --ui-h3: #2f7a8f; --ui-h4: #6a5aa8; }
:root[data-theme="dark"][data-ui="mint"] { --ui-bg: linear-gradient(165deg, #1c2420, #18201c); --ui-bgflat: #1c2420; --ui-panel: #212b26; --ui-card: #283530; --ui-soft: #33433b; --ui-line: #3c4f46; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #283530; --ui-pline: #3c4f46; --ui-pink: #e6e0f0; --ui-h3: #2f7a8f; --ui-h4: #a9c2ff; }
.uiswitch .sw-mint, .uisw .sw-mint { background: #bfe3cf; }
:root[data-ui="sky"] { --ui-bg: linear-gradient(165deg, #e1eefb, #d3e6f8); --ui-bgflat: #e1eefb; --ui-panel: #f0f6fd; --ui-card: #fbfdff; --ui-soft: #d6e7f8; --ui-line: #c4dbf1; --ui-ink: #2c3a4b; --ui-muted: #6f8296; --ui-accent: #4a86c2; --ui-good: #b8d6f0; --ui-paper: #fbfdff; --ui-pline: #cddff2; --ui-pink: #1f3760; --ui-h3: #2f6db3; --ui-h4: #8a4a9e; }
:root[data-theme="dark"][data-ui="sky"] { --ui-bg: linear-gradient(165deg, #1b2230, #171d29); --ui-bgflat: #1b2230; --ui-panel: #202938; --ui-card: #273244; --ui-soft: #313f55; --ui-line: #3a4b63; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #273244; --ui-pline: #3a4b63; --ui-pink: #e6e0f0; --ui-h3: #2f6db3; --ui-h4: #a9c2ff; }
.uiswitch .sw-sky, .uisw .sw-sky { background: #bcdaf3; }
:root[data-ui="peach"] { --ui-bg: linear-gradient(165deg, #fde9db, #fbdcc7); --ui-bgflat: #fde9db; --ui-panel: #fff4ec; --ui-card: #fffaf6; --ui-soft: #f9dcc8; --ui-line: #f2cbb0; --ui-ink: #4a3328; --ui-muted: #94786a; --ui-accent: #d0805a; --ui-good: #f0c4a6; --ui-paper: #fffbf7; --ui-pline: #f3d6c2; --ui-pink: #4a2c1f; --ui-h3: #b5532f; --ui-h4: #7a4fa0; }
:root[data-theme="dark"][data-ui="peach"] { --ui-bg: linear-gradient(165deg, #2a201b, #241b17); --ui-bgflat: #2a201b; --ui-panel: #302620; --ui-card: #3a2e27; --ui-soft: #4a3a31; --ui-line: #56443a; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #3a2e27; --ui-pline: #56443a; --ui-pink: #e6e0f0; --ui-h3: #b5532f; --ui-h4: #a9c2ff; }
.uiswitch .sw-peach, .uisw .sw-peach { background: #f8cfb2; }
:root[data-ui="lemon"] { --ui-bg: linear-gradient(165deg, #fbf5da, #f6ecc4); --ui-bgflat: #fbf5da; --ui-panel: #fefbec; --ui-card: #fffef8; --ui-soft: #f5ecc6; --ui-line: #ece0ad; --ui-ink: #423a24; --ui-muted: #8c8162; --ui-accent: #b9962f; --ui-good: #e8d898; --ui-paper: #fffef7; --ui-pline: #ece2b8; --ui-pink: #3a3420; --ui-h3: #a0602a; --ui-h4: #4a5fae; }
:root[data-theme="dark"][data-ui="lemon"] { --ui-bg: linear-gradient(165deg, #27241a, #211e15); --ui-bgflat: #27241a; --ui-panel: #2d2a1f; --ui-card: #363226; --ui-soft: #443e2e; --ui-line: #4f4835; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #363226; --ui-pline: #4f4835; --ui-pink: #e6e0f0; --ui-h3: #a0602a; --ui-h4: #a9c2ff; }
.uiswitch .sw-lemon, .uisw .sw-lemon { background: #f3e3a2; }
:root[data-ui="lilac"] { --ui-bg: linear-gradient(165deg, #ece2fa, #e1d3f6); --ui-bgflat: #ece2fa; --ui-panel: #f6f0fd; --ui-card: #fdfbff; --ui-soft: #e2d6f6; --ui-line: #d4c3ef; --ui-ink: #3a2f4d; --ui-muted: #82769a; --ui-accent: #8b62c9; --ui-good: #cdb8ec; --ui-paper: #fdfbff; --ui-pline: #ddd0f2; --ui-pink: #2f2660; --ui-h3: #8a3fa8; --ui-h4: #3f6fb0; }
:root[data-theme="dark"][data-ui="lilac"] { --ui-bg: linear-gradient(165deg, #221d2c, #1d1826); --ui-bgflat: #221d2c; --ui-panel: #282233; --ui-card: #30293e; --ui-soft: #3c3350; --ui-line: #463c5c; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #30293e; --ui-pline: #463c5c; --ui-pink: #e6e0f0; --ui-h3: #8a3fa8; --ui-h4: #a9c2ff; }
.uiswitch .sw-lilac, .uisw .sw-lilac { background: #d5c2f0; }
:root[data-ui="sand"] { --ui-bg: linear-gradient(165deg, #f4ece0, #ece0cf); --ui-bgflat: #f4ece0; --ui-panel: #faf6ef; --ui-card: #fffdf9; --ui-soft: #ece2d3; --ui-line: #e0d2bd; --ui-ink: #3e3529; --ui-muted: #887b6a; --ui-accent: #a88a62; --ui-good: #d9c6a8; --ui-paper: #fffdf6; --ui-pline: #e6dccb; --ui-pink: #2e2a22; --ui-h3: #8a5a2b; --ui-h4: #4a5fae; }
:root[data-theme="dark"][data-ui="sand"] { --ui-bg: linear-gradient(165deg, #24211c, #1f1c17); --ui-bgflat: #24211c; --ui-panel: #2a2620; --ui-card: #332e27; --ui-soft: #403a31; --ui-line: #4a4339; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #332e27; --ui-pline: #4a4339; --ui-pink: #e6e0f0; --ui-h3: #8a5a2b; --ui-h4: #a9c2ff; }
.uiswitch .sw-sand, .uisw .sw-sand { background: #e2d3bd; }
:root[data-ui="aqua"] { --ui-bg: linear-gradient(165deg, #dff3f3, #cdebeb); --ui-bgflat: #dff3f3; --ui-panel: #eef9f9; --ui-card: #fafefe; --ui-soft: #d0ecec; --ui-line: #bde0e0; --ui-ink: #263f42; --ui-muted: #6b8a8c; --ui-accent: #3d9aa0; --ui-good: #a9dcdc; --ui-paper: #fafefe; --ui-pline: #c9e6e6; --ui-pink: #1f3a40; --ui-h3: #2a7a86; --ui-h4: #8a4a9e; }
:root[data-theme="dark"][data-ui="aqua"] { --ui-bg: linear-gradient(165deg, #192426, #152022); --ui-bgflat: #192426; --ui-panel: #1e2b2d; --ui-card: #253537; --ui-soft: #2f4346; --ui-line: #384f52; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #253537; --ui-pline: #384f52; --ui-pink: #e6e0f0; --ui-h3: #2a7a86; --ui-h4: #a9c2ff; }
.uiswitch .sw-aqua, .uisw .sw-aqua { background: #b5e3e3; }
:root[data-ui="graphite"] { --ui-bg: linear-gradient(165deg, #eceef1, #e2e5ea); --ui-bgflat: #eceef1; --ui-panel: #f5f6f8; --ui-card: #ffffff; --ui-soft: #e4e6ea; --ui-line: #d6d9df; --ui-ink: #2f3238; --ui-muted: #7b8089; --ui-accent: #6b7380; --ui-good: #c3c8d0; --ui-paper: #ffffff; --ui-pline: #dde0e6; --ui-pink: #2a2d33; --ui-h3: #4a5260; --ui-h4: #6b5a8a; }
:root[data-theme="dark"][data-ui="graphite"] { --ui-bg: linear-gradient(165deg, #1d1e22, #18191c); --ui-bgflat: #1d1e22; --ui-panel: #222327; --ui-card: #2a2b30; --ui-soft: #34363c; --ui-line: #3e4047; --ui-ink: #ece6f0; --ui-muted: #a8a0ae; --ui-paper: #2a2b30; --ui-pline: #3e4047; --ui-pink: #e6e0f0; --ui-h3: #4a5260; --ui-h4: #a9c2ff; }
.uiswitch .sw-graphite, .uisw .sw-graphite { background: #c9cbd1; }

/* tło i treść ekranu nauki oraz menu poletka zawsze z motywu */
.study, .seminar.full .sempanel { background: var(--ui-bg); color: var(--ui-ink); }
.sempanel.wood { background: var(--ui-panel); }
.sempanel h2, .sempanel h3, .study .card .q { color: var(--ui-ink); }
.sempanel .loading { color: var(--ui-muted); }
/* notatka */
.note, :root[data-theme="dark"] .note { background: var(--ui-paper) repeating-linear-gradient(transparent 0 29px, var(--ui-pline) 29px 30px); color: var(--ui-pink); box-shadow: 0 2px 0 rgba(0,0,0,.04), 0 8px 18px rgba(60,40,60,.10); }
.note h3, :root[data-theme="dark"] .note h3 { color: var(--ui-h3); }
.note h4, :root[data-theme="dark"] .note h4 { color: var(--ui-h4); text-decoration-color: color-mix(in srgb, var(--ui-h4) 40%, transparent); }
.note::before { border-left-color: color-mix(in srgb, var(--ui-h3) 45%, transparent); }
.note .tip, :root[data-theme="dark"] .note .tip { background: var(--ui-soft); color: var(--ui-pink); }
.sempanel .fact { background: var(--ui-soft); color: var(--ui-ink); }
/* mapa myśli */
.spsvg .web { stroke: var(--ui-line); }
.spsvg .hub { fill: var(--ui-soft); stroke: var(--ui-accent); } .spsvg .hubt { fill: var(--ui-ink); }
.spsvg .spn.on rect { stroke: var(--ui-accent); } .spsvg .spt { fill: #3a3340; }
.spcard { background: var(--ui-card); color: var(--ui-ink); } .spcard h4 { color: #3a3340; }
.mm { background: var(--ui-card); border-color: var(--ui-line); color: var(--ui-ink); }
/* wybór motywu – kropki i siatka w ustawieniach */
.uiswitch { flex-wrap: wrap; gap: 5px; max-width: 230px; }
.study-title .uiswitch button { width: 13px; height: 13px; }
.uisw { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 8px 0; }
.uisw button { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 700; color: var(--ink); }
.uisw button i { width: 16px; height: 16px; border-radius: 50%; flex: none; background: inherit; }
.uisw button.on { outline: 2px solid var(--ui-accent); }


#studyClose { background: var(--ui-card); color: var(--ui-ink); box-shadow: none; border: 1px solid var(--ui-line); border-radius: 14px; }

/* kolory: jedno kółko, reszta rozwija się po kliknięciu */
.uiswitch { flex-wrap: nowrap; max-width: none; gap: 0; }
.uiswitch .sw-cur { width: 18px !important; height: 18px !important; box-shadow: 0 0 0 2px var(--ui-accent); cursor: pointer; transition: transform .2s; flex: none; }
.uiswitch.open .sw-cur { transform: scale(1.1); }
.uiswitch .sw-pop { display: inline-flex; gap: 5px; align-items: center; max-width: 0; overflow: hidden; padding: 3px 0; transition: max-width .3s ease, margin .3s ease; }
.uiswitch.open .sw-pop { max-width: 240px; margin-left: 6px; padding: 3px; }
.uiswitch .sw-pop button { flex: none; transform: scale(0); opacity: 0; transition: transform .22s ease var(--d), opacity .22s ease var(--d); }
.uiswitch.open .sw-pop button { transform: scale(1); opacity: 1; }

/* zgłoszenia */
.chip.flag { cursor: pointer; opacity: .75; } .chip.flag:hover { opacity: 1; }
.repcard { background: var(--cream); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; margin: 8px 0 10px; font-size: 14px; }
.repcard p { margin: 2px 0; }
.reptext { width: 100%; min-height: 120px; margin: 8px 0; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line2); background: var(--card); color: var(--ink); font: inherit; resize: vertical; box-sizing: border-box; }

/* zwierzęta domowe */
#hudCoins.boost::after { content: '×1,2'; margin-left: 4px; font-size: .72em; padding: 1px 5px; border-radius: 999px; background: #f6c445; color: #5a4320; vertical-align: middle; }
.mood { background: var(--cream); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; margin: 10px 0; }
.mood .mrow { display: flex; justify-content: space-between; margin-bottom: 6px; }
.mood small { display: block; margin-top: 6px; }
.hcolors { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.hcolors .hc { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line2); padding: 0; cursor: pointer; }
.hcolors .hc.on { box-shadow: 0 0 0 3px var(--ui-accent, #7b67a8); }
.homebar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 12; display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-radius: 18px; max-width: calc(100vw - 32px); }

/* tryb antydopaminowy */
html.calm { filter: grayscale(1); }
html.calm .note-pop, html.calm #confetti, html.calm #bigMsg, html.calm #hudBell, html.calm #notifPanel, html.calm #hudWeather, html.calm #tipbar,
html.calm #hudLevel, html.calm .xpbar, html.calm #studyGrow, html.calm .studystats .chip:not(.undo):not(.flag) { display: none !important; }
html.calm .hud-right .pill:has(#hudCoins), html.calm .hud-right .pill:has(#hudStreak) { display: none !important; }
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
.pill.calmbtn { font-size: 18px; font-weight: 800; }
.pill.calmbtn.on { background: #2f2a36; color: #fff; }

/* ekran logowania: przewijanie od góry, bez ucinania logo */
.login { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.login > .cloudtitle { margin-top: auto; flex: none; }
.login > .login-card { margin-bottom: auto; flex: none; }
/* telefon: więcej miejsca na nazwę farmy */
@media (max-width: 430px) { #hudWeather { display: none; } .hud .who b { font-size: 14px; } }
.item .petthumb { width: 56px; height: 56px; object-fit: contain; display: block; margin: 0 auto 2px; }

/* logowanie e-mailem */
.loginmsg { background: var(--cream); border: 1px solid var(--line2); border-radius: 14px; padding: 10px 12px; font-size: 14px; text-align: left; }
.linkbtn { background: none; border: none; padding: 0; color: var(--wood-d); font-weight: 800; text-decoration: underline; cursor: pointer; font: inherit; }

/* samouczek: strzałka tylko przy wskazanym elemencie (bez kropki na środku dymka) */
.tour-tip:not(.down):not(.up)::before { display: none; }

/* notatki: wyróżnienie jak zakreślacz, nie czerwone podkreślenie */
.note b { text-decoration: none; background: linear-gradient(transparent 55%, rgba(255, 214, 102, .55) 55%); border-radius: 2px; padding: 0 1px; }
/* nauka: czas i układ przycisków */
.study-timer .tbtns { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 2px; }
.tbtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ui-line, #e6e1ec); background: var(--ui-card, #fff); color: var(--ui-ink, #3f3a45); font-size: 16px; cursor: pointer; padding: 0; }
.tbtn.on { background: var(--ui-soft, #efeaf7); }
.ratemenu { position: fixed; top: 70px; right: 12px; z-index: 30; background: var(--ui-card, #fffdfa); border: 1px solid var(--ui-line, #e6e1ec); border-radius: 16px; padding: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.ratemenu b { font-size: 13px; padding: 2px 6px 6px; color: var(--ui-muted, #8b8492); }
.ratemenu button { display: flex; gap: 10px; align-items: center; text-align: left; border: none; background: transparent; border-radius: 10px; padding: 8px 10px; font: inherit; font-weight: 700; color: var(--ui-ink, #3f3a45); cursor: pointer; }
.ratemenu button span { width: 22px; text-align: center; font-size: 18px; }
.ratemenu button.on, .ratemenu button:hover { background: var(--ui-soft, #efeaf7); }
.rate .rgrip { display: none; }
#study.rl-left .rate, #study.rl-right .rate { position: fixed; top: 50%; transform: translateY(-50%); width: 150px; grid-template-columns: 1fr; margin: 0; z-index: 5; }
#study.rl-left .rate { left: 14px; } #study.rl-right .rate { right: 14px; }
#study.rl-left .study-main { padding-left: 176px; } #study.rl-right .study-main { padding-right: 176px; }
#study.rl-bottom .rate { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b, 0px)); width: min(640px, calc(100% - 24px)); grid-template-columns: repeat(4, 1fr); margin: 0; z-index: 5; }
#study.rl-bottom .study-main { padding-bottom: 130px; }
#study.rl-free .rate { position: fixed; transform: translate(-50%, -50%); width: min(440px, calc(100% - 24px)); margin: 0; z-index: 5; padding-top: 20px; }
#study.rl-free .rate .rgrip { display: block; position: absolute; top: -4px; left: 50%; transform: translateX(-50%); padding: 0 16px; cursor: grab; touch-action: none; font-weight: 900; letter-spacing: 2px; color: var(--ui-muted, #8b8492); background: var(--ui-card, #fff); border-radius: 10px; }
@media (max-width: 600px) {
  #study.rl-left .rate, #study.rl-right .rate { width: 96px; }
  #study.rl-left .study-main { padding-left: 112px; } #study.rl-right .study-main { padding-right: 112px; }
  #study.rl-left .rate .btn, #study.rl-right .rate .btn { font-size: 12px; padding: 10px 4px; }
}
.undofab { position: fixed; left: 14px; bottom: calc(14px + var(--safe-b, 0px)); z-index: 6; width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--ui-line, #e6e1ec); background: var(--ui-card, #fffdfa); color: var(--ui-ink, #3f3a45); font-size: 24px; font-weight: 800; box-shadow: 0 6px 16px rgba(0,0,0,.15); cursor: pointer; }
#study.rl-bottom .undofab { bottom: calc(120px + var(--safe-b, 0px)); }
#study.rl-left .undofab { left: auto; right: 14px; }

/* aplikacja z ekranu głównego (iOS/Android): nic nie wchodzi pod pasek statusu */
.modal { padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); }
.modal .panel { max-height: calc(100dvh - 24px - var(--safe-t) - var(--safe-b)); }
.seminar { padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(10px + var(--safe-b)); }
.seminar.full .sempanel { padding-top: calc(18px + var(--safe-t)); }
.seminar.full .sempanel > .x, .seminar.full .semtop .x { top: calc(10px + var(--safe-t)); }
@media (display-mode: standalone) { html, body { background: var(--cream, #fdf6ec); } }

/* iPhone (aplikacja z ekranu głównego): obszar pod paskiem „home” ma kolor aktualnego ekranu, nie zielone tło farmy */
html:has(#study:not([hidden])), html:has(#study:not([hidden])) body { background: var(--ui-bg, #f6f3fb); }
html:has(#quiz:not([hidden])), html:has(#quiz:not([hidden])) body { background: var(--ui-bg, #f6f3fb); }
html:has(.seminar.full:not([hidden])), html:has(.seminar.full:not([hidden])) body { background: var(--ui-bg, #f6f3fb); }
html:has(#login:not([hidden])), html:has(#login:not([hidden])) body { background: #cfe6b8; }
.study, .quiz { bottom: calc(-1 * var(--safe-b, 0px)); padding-bottom: var(--safe-b, 0px); }

/* ---- notatka: interaktywny wstęp (3.17) ---- */
.notebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.ndots { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ndots button { width: 12px; height: 12px; border-radius: 50%; background: var(--line2); padding: 0; transition: transform .15s, background .15s; }
.ndots button.seen { background: color-mix(in srgb, var(--ui-h4, #1f5fa8) 45%, var(--line2)); }
.ndots button.on { background: var(--ui-h3, #b5452f); transform: scale(1.35); }
.ndots button.fin { border-radius: 3px; }
.ntools { display: flex; gap: 6px; } .ntools .btn { padding: 6px 10px; min-width: 40px; } .ntools .btn.on { background: var(--ui-soft, #ffe9a8); }
.ntoc { margin: 0 0 10px; font-size: 14px; } .ntoc summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.ntoc button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 700; }
.ntoc button span { color: var(--muted); margin-right: 4px; } .ntoc button.on { background: var(--line); }
.note.nstep { --ns: 1; font-size: calc(19px * var(--ns)); line-height: calc(30px * var(--ns)); background-size: 100% calc(30px * var(--ns)); min-height: 220px; animation: nIn .25s ease; touch-action: pan-y; }
.note.nstep h3 { font-size: calc(34px * var(--ns)); line-height: calc(40px * var(--ns)); } .note.nstep h4 { font-size: calc(27px * var(--ns)); line-height: calc(30px * var(--ns)); }
.note .nmeta { display: block; font-family: 'Nunito', system-ui, sans-serif; font-size: 12px; line-height: 18px; color: var(--muted); margin-bottom: 2px; }
.note.hidekey mark, .note.hidekey b { color: transparent; background: color-mix(in srgb, var(--ui-h4, #1f5fa8) 22%, transparent); border-radius: 6px; cursor: pointer; text-decoration: none; transition: color .2s; }
.note.hidekey mark.rev, .note.hidekey b.rev { color: inherit; background: rgba(255, 214, 102, .55); }
.note .nhint { font-family: 'Nunito', system-ui, sans-serif; font-size: 13px; line-height: 20px; margin-top: 10px; }
.nnav { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0 14px; } .nnav .btn { flex: 1; } .nnav .btn[disabled] { opacity: .45; }
.note.ndone .nnav { margin-top: 14px; }
@keyframes nIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .note.nstep { font-size: calc(17px * var(--ns)); } }
.check.agree { align-items: flex-start; font-size: 12px; font-weight: 600; line-height: 1.4; margin-top: 8px; } .check.agree a { color: inherit; text-decoration: underline; }
