:root { --sky: #c6e2ff; --sky2: #8ec5ff; --sky3: #7f9df1; --lilac: #e2d6fd; --lilac2: #cbb6fb; --purple: #8b5cf6; --deep: #5b3fd1; --deep2: #6e4be0; --tint0: #eff7ff; --tint: #f1ebfe; --tint2: #f7f4fe; --tint3: #e8defd; --acc: 139,92,246; --acc2: 91,63,209; --ink: #2d225a; --muted: #7166a5; --grad: linear-gradient(135deg, #8ec5ff 0%, #8c90fa 55%, #8b5cf6 100%); --hero: linear-gradient(135deg, #89b8fa 0%, #8c86fa 55%, #7a52e9 100%); --bg: linear-gradient(160deg, #e8f3ff 0%, #f1ebfe 55%, #e8defd 100%); --blob1: #b0d6ff; --blob2: #c5aefa; --htmlbg: #e8defd; }
html[data-theme="lilac"] { --sky: #e2dafe; --sky2: #c4b5fd; --sky3: #aa8bf2; --lilac: #e9d4fd; --lilac2: #d8b2fb; --purple: #a855f7; --deep: #6d28d9; --deep2: #853ae5; --tint0: #f7f5ff; --tint: #f5ebfe; --tint2: #f9f3fe; --tint3: #eeddfd; --acc: 168,85,247; --acc2: 109,40,217; --ink: #341a5d; --muted: #795ca8; --grad: linear-gradient(135deg, #c4b5fd 0%, #b685fa 55%, #a855f7 100%); --hero: linear-gradient(135deg, #bba7f9 0%, #b37bf9 55%, #9345ec 100%); --bg: linear-gradient(160deg, #f3f0ff 0%, #f5ebfe 55%, #eeddfd 100%); --blob1: #d6cbfe; --blob2: #d4aafb; --htmlbg: #eeddfd; }
html[data-theme="blue"] { --sky: #bee9fe; --sky2: #7dd3fc; --sky3: #60abf1; --lilac: #cee0fd; --lilac2: #a7c7fb; --purple: #3b82f6; --deep: #1d4ed8; --deep2: #2963e4; --tint0: #edf9ff; --tint: #e7f0fe; --tint2: #f1f6fe; --tint3: #d8e6fd; --acc: 59,130,246; --acc2: 29,78,216; --ink: #16285d; --muted: #576da8; --grad: linear-gradient(135deg, #7dd3fc 0%, #5caaf9 55%, #3b82f6 100%); --hero: linear-gradient(135deg, #73c6f8 0%, #55a2f8 55%, #3070ec 100%); --bg: linear-gradient(160deg, #e5f6fe 0%, #e7f0fe 55%, #d8e6fd 100%); --blob1: #a4e0fd; --blob2: #9dc0fa; --htmlbg: #d8e6fd; }
html[data-theme="teal"] { --sky: #b3f4fc; --sky2: #67e8f9; --sky3: #4dc6cf; --lilac: #c4ede9; --lilac2: #95dfd7; --purple: #14b8a6; --deep: #0f766e; --deep2: #119084; --tint0: #eafcfe; --tint: #e3f6f4; --tint2: #effaf9; --tint3: #d0f1ed; --acc: 20,184,166; --acc2: 15,118,110; --ink: #103734; --muted: #517e7a; --grad: linear-gradient(135deg, #67e8f9 0%, #3ed0d0 55%, #14b8a6 100%); --hero: linear-gradient(135deg, #5eddeb 0%, #35cbc7 55%, #12a192 100%); --bg: linear-gradient(160deg, #e1fafe 0%, #e3f6f4 55%, #d0f1ed 100%); --blob1: #95effb; --blob2: #8adcd2; --htmlbg: #d0f1ed; }
html[data-theme="green"] { --sky: #b6f3db; --sky2: #6ee7b7; --sky3: #4ec69a; --lilac: #c3eee0; --lilac2: #93e0c6; --purple: #10b981; --deep: #047857; --deep2: #099268; --tint0: #ebfcf5; --tint: #e2f7f0; --tint2: #eefaf6; --tint3: #cff1e6; --acc: 16,185,129; --acc2: 4,120,87; --ink: #0c382c; --muted: #4c7e70; --grad: linear-gradient(135deg, #6ee7b7 0%, #3fd09c 55%, #10b981 100%); --hero: linear-gradient(135deg, #63dcad 0%, #36cb97 55%, #0ca272 100%); --bg: linear-gradient(160deg, #e2faf1 0%, #e2f7f0 55%, #cff1e6 100%); --blob1: #9aeecd; --blob2: #88dcc0; --htmlbg: #cff1e6; }
html[data-theme="yellow"] { --sky: #fee9a6; --sky2: #fcd34d; --sky3: #dcae3a; --lilac: #f7e7c2; --lilac2: #f1d491; --purple: #e0a00b; --deep: #92560e; --deep2: #b1740d; --tint0: #fff9e6; --tint: #fbf4e2; --tint2: #fdf8ee; --tint3: #f9ecce; --acc: 224,160,11; --acc2: 146,86,14; --ink: #422b10; --muted: #897051; --grad: linear-gradient(135deg, #fcd34d 0%, #eeba2c 55%, #e0a00b 100%); --hero: linear-gradient(135deg, #f1c647 0%, #ebb425 55%, #c5860c 100%); --bg: linear-gradient(160deg, #fef6db 0%, #fbf4e2 55%, #f9ecce 100%); --blob1: #fde082; --blob2: #f0d085; --htmlbg: #f9ecce; }
html[data-theme="orange"] { --sky: #fedcba; --sky2: #fdba74; --sky3: #eb9655; --lilac: #fedcc5; --lilac2: #fcc096; --purple: #f97316; --deep: #c2410c; --deep2: #d85510; --tint0: #fff5ec; --tint: #feeee3; --tint2: #fff5ef; --tint3: #fee3d0; --acc: 249,115,22; --acc2: 194,65,12; --ink: #54230f; --muted: #9e6750; --grad: linear-gradient(135deg, #fdba74 0%, #fb9645 55%, #f97316 100%); --hero: linear-gradient(135deg, #f7ae6a 0%, #fb8f3c 55%, #e66212 100%); --bg: linear-gradient(160deg, #fff1e3 0%, #feeee3 55%, #fee3d0 100%); --blob1: #fecf9e; --blob2: #fcb98a; --htmlbg: #fee3d0; }
html[data-theme="sunset"] { --sky: #fedcba; --sky2: #fdba74; --sky3: #ea896d; --lilac: #fad1e6; --lilac2: #f6add1; --purple: #ec4899; --deep: #be185d; --deep2: #d02b75; --tint0: #fff5ec; --tint: #fde9f3; --tint2: #fef2f8; --tint3: #fbdaeb; --acc: 236,72,153; --acc2: 190,24,93; --ink: #53142e; --muted: #9c5572; --grad: linear-gradient(135deg, #fdba74 0%, #f48186 55%, #ec4899 100%); --hero: linear-gradient(135deg, #f7aa72 0%, #f3768a 55%, #dc3784 100%); --bg: linear-gradient(160deg, #fff1e3 0%, #fde9f3 55%, #fbdaeb 100%); --blob1: #fecf9e; --blob2: #f6a4cc; --htmlbg: #fbdaeb; }
html[data-theme="red"] { --sky: #fed2d2; --sky2: #fca5a5; --sky3: #e07985; --lilac: #f8c6d1; --lilac2: #f299ad; --purple: #e11d48; --deep: #9f1239; --deep2: #b9163f; --tint0: #fff2f2; --tint: #fbe4e9; --tint2: #fdeff2; --tint3: #f9d2da; --acc: 225,29,72; --acc2: 159,18,57; --ink: #471120; --muted: #8f5363; --grad: linear-gradient(135deg, #fca5a5 0%, #ee6176 55%, #e11d48 100%); --hero: linear-gradient(135deg, #f3969a 0%, #ec536d 55%, #ca1943 100%); --bg: linear-gradient(160deg, #feeded 0%, #fbe4e9 55%, #f9d2da 100%); --blob1: #fdc0c0; --blob2: #f08ea4; --htmlbg: #f9d2da; }
html[data-theme="pink"] { --sky: #fcd4ea; --sky2: #f9a8d4; --sky3: #e77db0; --lilac: #fad1e6; --lilac2: #f6add1; --purple: #ec4899; --deep: #be185d; --deep2: #d02b75; --tint0: #fef3f9; --tint: #fde9f3; --tint2: #fef2f8; --tint3: #fbdaeb; --acc: 236,72,153; --acc2: 190,24,93; --ink: #53142e; --muted: #9c5572; --grad: linear-gradient(135deg, #f9a8d4 0%, #f278b6 55%, #ec4899 100%); --hero: linear-gradient(135deg, #f39ac8 0%, #f16eb1 55%, #dc3784 100%); --bg: linear-gradient(160deg, #feeef6 0%, #fde9f3 55%, #fbdaeb 100%); --blob1: #fbc2e1; --blob2: #f6a4cc; --htmlbg: #fbdaeb; }
html[data-theme="brown"] { --sky: #ecdac7; --sky2: #d9b48f; --sky3: #b8926f; --lilac: #e7dbcf; --lilac2: #d4bfa9; --purple: #a0703f; --deep: #6b4423; --deep2: #80562e; --tint0: #faf4ef; --tint: #f4eee8; --tint2: #f8f5f2; --tint3: #ece2d9; --acc: 160,112,63; --acc2: 107,68,35; --ink: #332418; --muted: #79685a; --grad: linear-gradient(135deg, #d9b48f 0%, #bc9267 55%, #a0703f 100%); --hero: linear-gradient(135deg, #cea984 0%, #b78b5f 55%, #8d6135 100%); --bg: linear-gradient(160deg, #f7f0e9 0%, #f4eee8 55%, #ece2d9 100%); --blob1: #e4cab1; --blob2: #d0b89f; --htmlbg: #ece2d9; }
html[data-theme="graphite"] { --sky: #d2dae4; --sky2: #a5b4c8; --sky3: #7c8a9e; --lilac: #d6dae0; --lilac2: #b5bcc7; --purple: #5b6b82; --deep: #1e293b; --deep2: #364357; --tint0: #f2f4f7; --tint: #ebedf0; --tint2: #f4f5f6; --tint3: #dee1e6; --acc: 91,107,130; --acc2: 30,41,59; --ink: #161a21; --muted: #585d64; --grad: linear-gradient(135deg, #a5b4c8 0%, #8090a5 55%, #5b6b82 100%); --hero: linear-gradient(135deg, #98a6ba 0%, #79889e 55%, #465469 100%); --bg: linear-gradient(160deg, #edf0f4 0%, #ebedf0 55%, #dee1e6 100%); --blob1: #c0cad8; --blob2: #adb5c0; --htmlbg: #dee1e6; }
/* topic – styles · babyblue + lilac */
:root {
  --line: rgba(var(--acc2), .14);
  --card: rgba(255, 255, 255, .74); --card2: rgba(255, 255, 255, .9);
  --ok: #22c38e; --okbg: #e3fbf2; --bad: #ff5d7a; --badbg: #ffe9ee; --warn: #ffb547;
  --r: 20px; --shadow: 0 10px 30px rgba(var(--acc2), .14); --shadow2: 0 4px 14px rgba(var(--acc2), .12);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --head: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--htmlbg); }
body {
  font-family: var(--font); color: var(--ink); font-size: 16px; line-height: 1.5;
  background: var(--bg) fixed;
  overflow-x: hidden;
}
body::before, body::after {
  content: ''; position: fixed; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none;
}
body::before { width: 340px; height: 340px; background: var(--blob1); top: -80px; left: -90px; }
body::after { width: 380px; height: 380px; background: var(--blob2); bottom: -120px; right: -120px; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: var(--ink); }
img { max-width: 100%; }
a { color: var(--deep); }
.hidden { display: none !important; }

/* layout */
#app { max-width: 820px; margin: 0 auto; padding: 14px 16px calc(110px + var(--safe-b)); min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; }
.topbar .back { width: 42px; height: 42px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow2); display: grid; place-items: center; font-size: 20px; }
.topbar .title { flex: 1; min-width: 0; font-family: var(--head); font-weight: 800; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 900; font-size: 1.6rem; letter-spacing: -.03em; }
.brand img { width: 36px; height: 36px; border-radius: 11px; box-shadow: var(--shadow2); }
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spacer { flex: 1; }

.card { background: var(--card); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.7); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card.tight { padding: 12px 14px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .g3 { grid-template-columns: repeat(2, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 16px; font-weight: 800; font-size: 1rem; background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(var(--acc), .35); transition: transform .12s, box-shadow .12s, opacity .12s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--card2); color: var(--deep); box-shadow: var(--shadow2); }
.btn.soft { background: var(--tint); color: var(--deep); box-shadow: none; }
.btn.ok { background: linear-gradient(135deg, #3ee0a6, #1fb985); box-shadow: 0 6px 18px rgba(34,195,142,.35); }
.btn.danger { background: linear-gradient(135deg, #ff8aa0, #ff5d7a); box-shadow: 0 6px 18px rgba(255,93,122,.3); }
.btn.sm { padding: 8px 13px; font-size: .88rem; border-radius: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--tint); color: var(--deep); font-weight: 800; font-size: .82rem; }
.chip.blue { background: var(--tint0); color: var(--deep); border: 1px solid rgba(var(--acc2), .1); }
.chip.ok { background: var(--okbg); color: #128a62; }
.chip.bad { background: var(--badbg); color: #c42c4a; }
.icon-btn { width: 40px; height: 40px; border-radius: 13px; background: var(--card2); box-shadow: var(--shadow2); display: inline-grid; place-items: center; font-size: 18px; flex: none; }
.icon-btn.on { background: var(--grad); color: #fff; }

/* language switch */
.lang { display: inline-flex; background: var(--card2); border-radius: 999px; padding: 4px; box-shadow: var(--shadow2); }
.lang button { padding: 6px 11px; border-radius: 999px; font-weight: 900; font-size: .8rem; color: var(--muted); }
.lang button.on { background: var(--grad); color: #fff; }

/* hero */
.hero { background: var(--grad); color: #fff; border-radius: 28px; padding: 20px; box-shadow: 0 14px 34px rgba(var(--acc), .35); position: relative; overflow: hidden; margin-bottom: 16px; }
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.16); }
.hero h1 { font-size: 1.6rem; margin-bottom: 4px; }
.xpbar { height: 12px; background: rgba(255,255,255,.3); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.xpbar > i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .6s; }
.stats { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.stat { background: rgba(255,255,255,.2); padding: 7px 12px; border-radius: 14px; font-weight: 800; font-size: .88rem; }

/* tiles */
.tile { position: relative; display: block; text-align: left; width: 100%; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; border: 1px solid rgba(255,255,255,.7); transition: transform .15s; overflow: hidden; color: var(--ink); text-decoration: none; }
.tile:active { transform: scale(.98); }
.tile .em { width: 46px; height: 46px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; margin-bottom: 10px; font-size: 24px; box-shadow: 0 6px 16px rgba(var(--acc), .3); }
.tile h3 { margin: 0 0 2px; }
.tile .bg { position: absolute; right: -14px; bottom: -18px; font-size: 104px; opacity: .1; color: var(--deep); line-height: 1; }
.topic-card { display: flex; gap: 14px; align-items: stretch; padding: 0; }
.topic-card .cv { width: 118px; flex: none; background: var(--tint0); display: grid; place-items: center; overflow: hidden; }
.topic-card .cv svg, .topic-card .cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topic-card .tx { padding: 14px 14px 14px 0; flex: 1; min-width: 0; }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--purple) calc(var(--p) * 1%), var(--tint3) 0); display: grid; place-items: center; flex: none; }
.ring::before { content: attr(data-l); width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: .72rem; font-weight: 900; color: var(--deep); }

/* tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 -4px 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; padding: 10px 15px; border-radius: 14px; background: var(--card); font-weight: 800; color: var(--muted); box-shadow: var(--shadow2); }
.tabs button.on { background: var(--grad); color: #fff; }

/* learning text */
.section { position: relative; }
.section .tools { display: flex; gap: 6px; float: right; margin: -4px -4px 6px 8px; }
.section .media { margin: 10px 0; border-radius: 16px; overflow: hidden; background: var(--tint0); }
.section .media svg, .section .media img, .section .media video { width: 100%; display: block; }
.de { color: var(--deep2); font-style: italic; background: var(--tint2); border-left: 4px solid var(--lilac2); padding: 8px 12px; border-radius: 10px; margin-top: 8px; font-size: .95rem; }
.de::before { content: 'DE'; font-style: normal; font-size: .66rem; font-weight: 800; letter-spacing: .06em; background: var(--lilac2); color: #fff; padding: 2px 6px; border-radius: 6px; margin-right: 8px; vertical-align: 1px; }
.video { position: relative; padding-top: 56.25%; border-radius: 16px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
mark.kw { background: var(--tint3); color: var(--deep); padding: 0 3px; border-radius: 5px; }

/* vocab flashcards */
.flash { perspective: 1000px; height: 220px; margin-bottom: 12px; }
.flash .in { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; cursor: pointer; }
.flash.flip .in { transform: rotateY(180deg); }
.flash .f, .flash .b { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 24px; display: grid; place-items: center; text-align: center; padding: 20px; box-shadow: var(--shadow); }
.flash .f { background: var(--grad); color: #fff; font-family: var(--head); font-size: 2rem; font-weight: 900; }
.flash .b { background: #fff; transform: rotateY(180deg); }
.vlist .v { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.vlist .v:last-child { border: 0; }

/* timeline */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 4px; border-radius: 4px; background: var(--grad); }
.tl .it { position: relative; margin-bottom: 14px; }
.tl .it::before { content: ''; position: absolute; left: -23px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--purple); }
.tl .y { font-family: var(--head); font-weight: 900; color: var(--deep); }

/* quiz */
.qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress { flex: 1; height: 12px; background: rgba(255,255,255,.7); border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.06); }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s; }
.combo { font-weight: 900; color: #ff8a3d; min-width: 46px; text-align: right; }
.qtype { font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--purple); }
.question { font-family: var(--head); font-size: 1.3rem; font-weight: 800; margin: 6px 0 12px; }
.qimg { border-radius: 16px; overflow: hidden; margin-bottom: 12px; background: var(--tint0); }
.qimg svg, .qimg img { width: 100%; display: block; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; padding: 14px 16px; border-radius: 16px; background: var(--card2); box-shadow: var(--shadow2); font-weight: 700; border: 2px solid transparent; display: flex; gap: 12px; align-items: center; transition: transform .1s, border-color .15s, background .15s; }
.opt:active { transform: scale(.98); }
.opt .k { width: 30px; height: 30px; border-radius: 10px; background: var(--tint); color: var(--deep); display: grid; place-items: center; font-weight: 900; flex: none; font-size: .85rem; }
.opt.sel { border-color: var(--purple); background: var(--tint2); }
.opt.right { border-color: var(--ok); background: var(--okbg); }
.opt.wrong { border-color: var(--bad); background: var(--badbg); }
.opt.gone { opacity: .25; pointer-events: none; }
.opt small { display: block; color: var(--deep2); font-weight: 600; font-style: italic; }
.tfrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tfrow .opt { justify-content: center; font-size: 1.15rem; padding: 22px; }
.gaptext { font-size: 1.12rem; line-height: 2.3; }
.gaptext input { width: 9.5em; padding: 4px 10px; border-radius: 10px; border: 2px dashed var(--lilac2); background: #fff; font-weight: 800; text-align: center; }
.gaptext input.right { border: 2px solid var(--ok); background: var(--okbg); }
.gaptext input.wrong { border: 2px solid var(--bad); background: var(--badbg); }
.bank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bank button { padding: 8px 13px; border-radius: 12px; background: #fff; box-shadow: var(--shadow2); font-weight: 800; }
.bank button.used { opacity: .3; }
.txtin { width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--lilac2); background: #fff; font-size: 1.1rem; font-weight: 700; outline: none; }
.txtin:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(var(--acc), .15); }
textarea.txtin { min-height: 110px; resize: vertical; font-weight: 600; font-size: 1rem; }
.order-list { display: grid; gap: 8px; }
.order-item { padding: 12px 14px; border-radius: 14px; background: var(--card2); box-shadow: var(--shadow2); font-weight: 700; display: flex; gap: 10px; align-items: center; text-align: left; }
.order-item .n { width: 28px; height: 28px; border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; font-size: .85rem; }
.order-item.pool .n { background: var(--tint3); color: var(--muted); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match .col { display: grid; gap: 8px; align-content: start; }
.match button { padding: 12px; border-radius: 14px; background: var(--card2); box-shadow: var(--shadow2); font-weight: 700; border: 2px solid transparent; min-height: 52px; }
.match button.sel { border-color: var(--purple); background: var(--tint2); }
.match button.done { border-color: var(--ok); background: var(--okbg); opacity: .75; }
.match button.shake { animation: shake .35s; border-color: var(--bad); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.feedback { border-radius: 20px; padding: 14px 16px; margin-top: 14px; animation: pop .25s ease-out; }
.feedback.ok { background: var(--okbg); border: 2px solid #8eeacb; }
.feedback.bad { background: var(--badbg); border: 2px solid #ffb3c1; }
.feedback h3 { margin: 0 0 4px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.qactions { display: flex; gap: 10px; margin-top: 14px; }
.qactions .btn { flex: 1; }
.big-say { width: 92px; height: 92px; border-radius: 50%; font-size: 40px; background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgba(var(--acc), .4); display: grid; place-items: center; margin: 6px auto 14px; }
.big-say.playing { animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }

/* results */
.result-num { font-family: var(--head); font-size: 3.4rem; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.stars { font-size: 2.4rem; display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.stars .st { color: var(--tint3); }
.stars .st.on { color: var(--purple); }
.stars .st.on svg { fill: currentColor; }
.review-item { border-left: 5px solid var(--ok); padding: 8px 12px; margin-bottom: 8px; background: #fff; border-radius: 12px; }
.review-item.bad { border-color: var(--bad); }

/* profiles */
.avatar { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; font-size: 30px; color: #fff; overflow: hidden; flex: none; box-shadow: var(--shadow2); background: var(--lilac); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 40px; height: 40px; border-radius: 14px; font-size: 22px; }
.avatar.lg { width: 96px; height: 96px; border-radius: 30px; font-size: 52px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.pcard { background: var(--card); border-radius: 22px; padding: 14px 8px; box-shadow: var(--shadow); text-align: center; display: grid; justify-items: center; gap: 8px; font-weight: 800; }
.pcard.add { border: 2px dashed var(--lilac2); background: rgba(255,255,255,.45); color: var(--deep); }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.emojis button { height: 46px; border-radius: 14px; background: #fff; font-size: 22px; color: var(--deep); box-shadow: var(--shadow2); border: 2px solid transparent; display: grid; place-items: center; }
.emojis button.on { border-color: var(--purple); background: var(--tint2); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: var(--shadow2); }
.colors button.on { outline: 3px solid var(--purple); }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 14px 0; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; background: var(--tint3); transition: background .15s, transform .15s; }
.pin-dots i.on { background: var(--purple); transform: scale(1.1); }
.pin-dots.err { animation: shake .35s; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 290px; margin: 0 auto; }
.pinpad button { height: 62px; border-radius: 20px; background: var(--card2); box-shadow: var(--shadow2); font-size: 1.5rem; font-weight: 900; font-family: var(--head); }
.pinpad button:active { background: var(--tint); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 9px 14px; border-radius: 12px; background: #fff; box-shadow: var(--shadow2); font-weight: 800; }
.seg button.on { background: var(--grad); color: #fff; }

/* badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 12px 6px; border-radius: 18px; background: #fff; box-shadow: var(--shadow2); font-size: .76rem; font-weight: 800; }
.badge .e { width: 48px; height: 48px; margin: 0 auto 6px; border-radius: 16px; background: var(--grad); color: #fff; font-size: 26px; display: grid; place-items: center; }
.badge.locked { filter: grayscale(1); opacity: .4; }

/* bottom nav */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: min(560px, calc(100% - 24px)); background: rgba(255,255,255,.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 24px; box-shadow: 0 10px 30px rgba(var(--acc2), .22); display: flex; padding: 6px; z-index: 40; }
.nav a { flex: 1; text-align: center; padding: 7px 2px 5px; border-radius: 18px; text-decoration: none; color: var(--muted); font-weight: 800; font-size: .7rem; position: relative; }
.nav a .i { display: block; font-size: 22px; line-height: 1; height: 24px; margin-bottom: 2px; }
.nav a.on { background: var(--grad); color: #fff; }
.nav .dot { position: absolute; top: 4px; right: calc(50% - 20px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.footer { text-align: center; font-size: .8rem; color: var(--muted); margin: 26px 0 8px; font-weight: 700; letter-spacing: .02em; }
.footer b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 18, 40, .38); backdrop-filter: blur(4px); z-index: 90; display: grid; place-items: end center; padding: 12px; animation: fade .2s; }
@media (min-width: 640px) { .modal-bg { place-items: center; } }
.modal { background: #fff; border-radius: 28px; padding: 22px; width: min(480px, 100%); max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(20, 18, 40, .3); animation: up .25s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 14px; font-weight: 800; z-index: 100; box-shadow: var(--shadow); animation: up .25s; max-width: 90vw; text-align: center; }
.xp-pop { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); font-family: var(--head); font-weight: 900; font-size: 2.2rem; color: var(--purple); pointer-events: none; z-index: 95; animation: xp 1s ease-out forwards; text-shadow: 0 4px 12px rgba(var(--acc), .35); }
@keyframes xp { to { transform: translate(-50%, -140%); opacity: 0; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 96; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty .e { font-size: 46px; display: block; margin-bottom: 6px; color: var(--lilac2); }
.msg { padding: 10px 14px; border-radius: 16px; margin-bottom: 8px; max-width: 88%; }
.msg.me { background: var(--grad); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.msg.her { background: #fff; box-shadow: var(--shadow2); border-bottom-left-radius: 4px; }
.spin { width: 38px; height: 38px; border: 4px solid var(--tint3); border-top-color: var(--purple); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 20px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.splash { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.splash img { width: 110px; height: 110px; border-radius: 32px; box-shadow: 0 16px 40px rgba(var(--acc), .35); animation: pulse 1.6s infinite; }

/* ───── admin ───── */
#app.adm { max-width: 1100px; }
.adm-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-tabs button { padding: 10px 14px; border-radius: 14px; background: var(--card); font-weight: 800; box-shadow: var(--shadow2); color: var(--muted); position: relative; }
.adm-tabs button.on { background: var(--grad); color: #fff; }
.adm-tabs .dot { position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff; border-radius: 10px; font-size: .7rem; padding: 1px 6px; }
.inp { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--lilac2); background: #fff; outline: none; }
.inp:focus { border-color: var(--purple); }
textarea.inp { min-height: 80px; resize: vertical; font-size: .93rem; line-height: 1.45; }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; min-height: 260px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: var(--shadow2); margin-bottom: 8px; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-ed { border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; background: rgba(255,255,255,.7); }
.task-ed summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; gap: 8px; align-items: center; }
.task-ed summary::-webkit-details-marker { display: none; }
.dropzone { border: 3px dashed var(--lilac2); border-radius: 22px; padding: 30px 16px; text-align: center; background: rgba(255,255,255,.55); cursor: pointer; transition: background .15s; }
.dropzone.over { background: var(--tint); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs div { width: 82px; height: 82px; border-radius: 12px; overflow: hidden; background: #eee; position: relative; font-size: .7rem; display: grid; place-items: center; text-align: center; padding: 4px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.kpi { font-family: var(--head); font-size: 2rem; font-weight: 900; color: var(--deep); line-height: 1; }
.note { background: #fff7e6; border: 1.5px solid #ffd99a; border-radius: 14px; padding: 10px 12px; font-size: .9rem; }

/* ───── icons + refresh ───── */
.ic { width: 1.15em; height: 1.15em; vertical-align: -.22em; flex: none; display: inline-block; }
.btn .ic, .chip .ic, .tabs .ic, .seg .ic { width: 1.1em; height: 1.1em; }
.icon-btn .ic { width: 20px; height: 20px; }
.nav a .i .ic { width: 23px; height: 23px; }
.tile .em .ic { width: 25px; height: 25px; }
.avatar .ic { width: 52%; height: 52%; stroke-width: 1.8; }
.avatar .ini { font-family: var(--head); font-weight: 700; font-size: .78em; letter-spacing: -.02em; }
.avatar.sm .ini { font-size: .8em; }
.big-say .ic { width: 40px; height: 40px; }
.de-badge { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .06em; background: var(--lilac2); color: #fff; padding: 2px 6px; border-radius: 6px; vertical-align: 2px; font-style: normal; }
.icon-prev { width: 44px; height: 44px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 22px; flex: none; }
.rk-pos { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-family: var(--head); background: var(--tint); color: var(--deep); flex: none; }
.rk-pos.p1 { background: linear-gradient(135deg, #ffd978, #f5a524); color: #fff; }
.rk-pos.p2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #fff; }
.rk-pos.p3 { background: linear-gradient(135deg, #f3c19b, #c47a45); color: #fff; }
.hero .stat .ic { opacity: .9; }
h1, h2, .brand, .question, .result-num, .kpi { letter-spacing: -.025em; }
.brand { font-weight: 700; }
.question { font-weight: 700; }
.btn, .chip, .seg button, .tabs button { font-weight: 700; }
.topic-card .cv .ic { width: 44px; height: 44px; color: var(--deep); }
.hero { background: var(--hero); }
.hero .eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; opacity: .85; font-weight: 700; }

/* theme picker */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; margin-top: 8px; }
.themes button { display: grid; justify-items: center; gap: 5px; padding: 8px 4px; border-radius: 14px; background: #fff; box-shadow: var(--shadow2); border: 2px solid transparent; font-size: .7rem; font-weight: 700; color: var(--muted); line-height: 1.15; }
.themes button i { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.themes button.on { border-color: var(--purple); color: var(--ink); }
.cap { font-size: .8rem; font-style: italic; color: var(--muted); margin: -4px 0 10px; }
.section .media img { max-height: 340px; object-fit: cover; }

.pw-wrap { position: relative; }
.pw-wrap .inp { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 10px; color: var(--muted); display: grid; place-items: center; }
.inp.masked { -webkit-text-security: disc; text-security: disc; font-family: text-security-disc, var(--font); letter-spacing: .15em; }
