@font-face { font-family: "Space Grotesk"; src: url(../fonts/space-grotesk.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url(../fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0d0e1a;
  --bg2: #121428;
  --card: #181b33;
  --card2: #20244200;
  --raise: #232845;
  --line: rgba(255,255,255,.08);
  --line2: rgba(255,255,255,.14);
  --text: #eef0ff;
  --muted: #9aa0c6;
  --dim: #8a90b8;   /* minst 4,5:1 mot bakgrund och kort (WCAG AA) */
  --xp: #ffd23f;
  --good: #3ddc97;
  --bad: #ff5d73;
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --pink: #ff6bcb;
  --accent: var(--violet);
  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --top: 60px;
  --tabs: 50px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--body); overflow-x: hidden;
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(34,211,238,.10), transparent 60%);
  background-attachment: fixed;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 700; }
h2 { font-size: clamp(21px, 3.2vw, 28px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 .9em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--display); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 12px; padding: 0 max(16px, env(safe-area-inset-left));
  background: rgba(13,14,26,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { font-family: var(--display); font-weight: 700; font-size: 21px; text-decoration: none; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; user-select: none; }
.logo img { width: 28px; height: 28px; }
.logo span { background: linear-gradient(90deg, var(--violet), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 2px; }
.topbar .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.pill .ico { font-size: 15px; }
.pill.streak.on { border-color: rgba(255,140,60,.5); box-shadow: 0 0 18px -6px rgba(255,140,60,.8); }
.pill.lvl { padding-right: 6px; gap: 8px; }
.lvlbar { width: 64px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.lvlbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--xp), #ff9f1c); border-radius: inherit; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line2); font-size: 19px; text-decoration: none; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { text-decoration: none; padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 15px; }
.topnav a:hover { color: var(--text); background: var(--card); }
.topnav a.on { color: var(--text); background: var(--card); }

/* ---------- course tabs ---------- */
.coursetabs {
  position: sticky; top: var(--top); z-index: 25; height: var(--tabs);
  display: flex; align-items: center; gap: 6px; padding: 0 16px; overflow-x: auto; scrollbar-width: none;
  background: rgba(13,14,26,.7); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.coursetabs::-webkit-scrollbar { display: none; }
.coursetabs .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 0 4px 0 10px; white-space: nowrap; font-weight: 600; }
.coursetabs .grp:first-child { padding-left: 0; }
.ctab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted); border: 1px solid transparent; white-space: nowrap; position: relative; }
.ctab:hover { color: var(--text); background: var(--card); }
.ctab.on { color: var(--text); background: color-mix(in srgb, var(--c) 18%, transparent); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.ctab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.ctab .done { font-size: 11px; color: var(--xp); }

/* ---------- layout ---------- */
main { display: block; max-width: 1120px; margin: 0 auto; padding: 24px 16px 120px; outline: none; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card.tight { padding: 14px 16px; }
.section { margin: 34px 0 14px; display: flex; align-items: baseline; gap: 12px; justify-content: space-between; }
.section h2 { margin: 0; }
.section a { font-size: 14px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--line2); background: var(--raise); font-weight: 600; font-family: var(--display); font-size: 16px; text-decoration: none; transition: transform .12s, background .2s, box-shadow .2s; }
.btn:hover { background: #2b3156; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { border: 0; background: linear-gradient(135deg, var(--violet), #5b7cff); box-shadow: 0 6px 0 #3d2fa3, 0 10px 30px -10px rgba(124,92,255,.8); }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #3d2fa3; }
.btn.gold { border: 0; color: #2a1d00; background: linear-gradient(135deg, #ffe066, #ffb703); box-shadow: 0 6px 0 #b07800; }
.btn.gold:active { transform: translateY(4px); box-shadow: 0 2px 0 #b07800; }
.btn.good { border: 0; color: #00281a; background: var(--good); box-shadow: 0 6px 0 #1f9a66; }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.xp { color: var(--xp); border-color: rgba(255,210,63,.3); background: rgba(255,210,63,.08); }
.tag.good { color: var(--good); border-color: rgba(61,220,151,.3); background: rgba(61,220,151,.08); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.hello { position: relative; overflow: hidden; padding: 26px; }
.hello h1 { margin-bottom: 6px; }
.hello .big-avatar { position: absolute; right: -10px; bottom: -24px; font-size: 130px; opacity: .14; transform: rotate(-12deg); pointer-events: none; }
.levelbox { margin-top: 18px; }
.levelbox .row { justify-content: space-between; font-size: 14px; }
.bar { height: 14px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--xp), #ff9f1c); transition: width .8s cubic-bezier(.2,.8,.2,1); position: relative; }
.bar.c i { background: var(--c); }
.bar.thin { height: 7px; margin-top: 6px; }
.lvltitle { font-family: var(--display); font-weight: 700; color: var(--xp); }

.quests h3 { display: flex; justify-content: space-between; align-items: center; }
.quest { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.quest:first-of-type { border-top: 0; }
.quest .qi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--raise); font-size: 17px; }
.quest.done .qi { background: rgba(61,220,151,.15); }
.quest .t { font-size: 14px; font-weight: 500; }
.quest .bar { height: 6px; margin-top: 5px; }
.quest .bar i { background: var(--cyan); }
.quest.done .bar i { background: var(--good); }
.chest { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,210,63,.07); border: 1px dashed rgba(255,210,63,.35); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.chest.open { border-style: solid; }

.challenge { display: flex; gap: 18px; align-items: center; background: radial-gradient(400px 200px at 0% 0%, rgba(255,107,203,.25), transparent 70%), radial-gradient(400px 200px at 100% 100%, rgba(34,211,238,.18), transparent 70%), var(--card); }
.challenge .emo { font-size: 46px; }
.challenge > div { flex: 1; }
@media (max-width: 560px) { .challenge { flex-direction: column; align-items: flex-start; } }

.ccard { position: relative; display: block; text-decoration: none; overflow: hidden; padding: 18px; border-radius: var(--r); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%), var(--card); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); transition: transform .18s, box-shadow .18s, border-color .18s; }
.ccard:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -18px color-mix(in srgb, var(--c) 70%, transparent); border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.ccard .emo { font-size: 30px; line-height: 1; }
.ccard h3 { margin: 12px 0 2px; }
.ccard .sub { font-size: 13px; color: var(--muted); min-height: 2.6em; }
.ccard .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 12px; }
.ccard .crown { position: absolute; top: 12px; right: 14px; font-size: 20px; }
.ccard.soon { opacity: .5; pointer-events: none; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--raise); color: var(--text); }

/* ---------- course ---------- */
.chead { position: relative; overflow: hidden; padding: 28px; border-radius: 24px; background: radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--c) 40%, transparent), transparent 70%), var(--card); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); }
.chead .emo-bg { position: absolute; right: 18px; top: 8px; font-size: 110px; opacity: .2; }
.chead .crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.chead .crumbs a { text-decoration: none; }
.chead .tagline { font-size: 18px; color: var(--text); opacity: .9; max-width: 60ch; }
.chead .stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px; }
.stat b { display: block; font-family: var(--display); font-size: 24px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); }
.ring::before { content: ""; grid-area: 1/1; width: 60px; height: 60px; border-radius: 50%; background: var(--card); }
.ring b { grid-area: 1/1; font-family: var(--display); font-size: 17px; position: relative; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.map { position: relative; padding: 10px 0; }
.node { position: relative; display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; margin: 0 0 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); text-decoration: none; transition: transform .15s, border-color .15s, background .15s; }
.node:hover { transform: translateX(4px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.node .orb { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 28px; background: color-mix(in srgb, var(--c) 14%, var(--bg2)); border: 2px solid color-mix(in srgb, var(--c) 40%, transparent); position: relative; }
.node.passed .orb { background: color-mix(in srgb, var(--c) 35%, var(--bg2)); border-color: var(--c); box-shadow: 0 0 24px -6px var(--c); }
.node .num { position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line2); font-size: 12px; font-weight: 700; display: grid; place-items: center; font-family: var(--display); }
.node h3 { margin: 0 0 2px; font-size: 17px; }
.node p { margin: 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stars { display: flex; gap: 2px; font-size: 17px; letter-spacing: -2px; }
.stars .off { filter: grayscale(1); opacity: .25; }
.node.boss { background: radial-gradient(300px 120px at 0% 50%, rgba(255,93,115,.22), transparent 70%), var(--card); border-color: rgba(255,93,115,.35); }
.node.boss .orb { background: #2a1420; border-color: var(--bad); }
.node.boss.locked { opacity: .65; }
.node.boss.won .orb { border-color: var(--xp); box-shadow: 0 0 28px -4px var(--xp); }

.side .card + .card { margin-top: 16px; }
.links { list-style: none; margin: 0; padding: 0; }
.links li + li { border-top: 1px solid var(--line); }
.links a { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 2px; text-decoration: none; font-size: 14px; }
.links a:hover .lt { text-decoration: underline; }
.links .k { font-size: 18px; }
.links .src { font-size: 12px; color: var(--dim); }
.links .arrow { color: var(--dim); }

/* ---------- goal ---------- */
.ghead { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.ghead .orb { width: 70px; height: 70px; flex: none; border-radius: 22px; display: grid; place-items: center; font-size: 34px; background: color-mix(in srgb, var(--c) 22%, var(--bg2)); border: 2px solid color-mix(in srgb, var(--c) 60%, transparent); }
.ghead .crumbs { font-size: 13px; color: var(--muted); }
.ghead .crumbs a { text-decoration: none; }
.ghead h1 { font-size: clamp(24px, 4vw, 36px); margin: 2px 0 0; }
.skv { margin: 16px 0 6px; padding: 14px 16px; border-radius: var(--r-sm); background: rgba(255,255,255,.03); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.skv b { color: var(--text); font-weight: 600; }
.tabs { display: flex; gap: 4px; padding: 5px; margin: 18px 0 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; position: sticky; top: calc(var(--top) + var(--tabs) + 8px); z-index: 10; overflow-x: auto; scrollbar-width: none; }
.tabs a { flex: 1; text-align: center; text-decoration: none; padding: 10px 12px; border-radius: 12px; font-weight: 600; font-family: var(--display); color: var(--muted); white-space: nowrap; font-size: 15px; }
.tabs a.on { background: color-mix(in srgb, var(--c) 25%, var(--raise)); color: var(--text); }
.tabs a .badge { font-size: 12px; margin-left: 4px; }

.lesson { max-width: 720px; margin: 0 auto; font-size: 17px; }
.lesson .blk { margin: 0 0 22px; }
.lesson ul, .lesson ol, .md ul, .md ol { padding-left: 1.3em; margin: 0 0 .9em; }
.lesson li, .md li { margin: .25em 0; }
.md code, .lesson code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; }
.md strong, .lesson strong { color: #fff; font-weight: 650; }
.box { border-radius: var(--r); padding: 18px 20px; border: 1px solid var(--line); background: var(--card); }
.box > :last-child, .box .md > :last-child { margin-bottom: 0; }
.box .lbl { font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.box.key { border-color: color-mix(in srgb, var(--c) 40%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, transparent), transparent), var(--card); }
.box.key .lbl { color: var(--c); }
.box.ex .lbl { color: var(--cyan); }
.box.ex details { margin-top: 12px; border-top: 1px dashed var(--line2); padding-top: 12px; }
.box.ex summary { cursor: pointer; font-weight: 600; color: var(--cyan); list-style: none; font-family: var(--display); }
.box.ex summary::-webkit-details-marker { display: none; }
.box.ex summary::before { content: "▶ "; font-size: 12px; }
.box.ex details[open] summary::before { content: "▼ "; }
.box.formula { text-align: center; border-color: rgba(255,210,63,.3); background: rgba(255,210,63,.05); }
.box.formula .f { font-family: var(--display); font-size: clamp(19px, 3vw, 24px); font-weight: 600; color: var(--xp); margin: 4px 0 8px; white-space: pre-wrap; }
.box.formula .md { font-size: 15px; color: var(--muted); }
.box.fun { border-color: rgba(255,107,203,.3); background: rgba(255,107,203,.06); }
.box.fun .lbl { color: var(--pink); }
.box.pit { border-color: rgba(255,93,115,.3); background: rgba(255,93,115,.06); }
.box.pit .lbl { color: var(--bad); }
.tbl { overflow-x: auto; border-radius: var(--r-sm); border: 1px solid var(--line); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 15px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--raise); font-family: var(--display); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.readdone { text-align: center; padding: 26px; margin-top: 30px; }

/* ---------- quiz ---------- */
.quiz { max-width: 680px; margin: 0 auto; }
.qtop { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.qtop .bar { flex: 1; margin: 0; }
.qtop .bar i { background: linear-gradient(90deg, var(--c, var(--violet)), var(--cyan)); }
.combo { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--muted); min-width: 64px; text-align: right; transition: transform .2s; }
.combo.hot { color: #ff8c3c; text-shadow: 0 0 14px rgba(255,140,60,.7); }
.combo.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.35); } }
.qcard { padding: 26px; }
.qmeta { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.qtext { font-size: 20px; font-weight: 500; line-height: 1.45; margin-bottom: 20px; }
.qtext p:last-child { margin: 0; }
.opts { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 14px 16px; border-radius: 14px; background: var(--raise); border: 2px solid var(--line); font-size: 16px; transition: border-color .15s, background .15s, transform .1s; }
.opt:hover:not([disabled]) { border-color: var(--line2); background: #2a3052; }
.opt .k { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.07); font-family: var(--display); font-weight: 700; font-size: 14px; }
.opt.right { border-color: var(--good); background: rgba(61,220,151,.12); }
.opt.right .k { background: var(--good); color: #002a1a; }
.opt.wrong { border-color: var(--bad); background: rgba(255,93,115,.12); animation: shake .35s; }
.opt.wrong .k { background: var(--bad); color: #2a0008; }
.opt[disabled] { cursor: default; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.tf { grid-template-columns: 1fr 1fr; }
.tf .opt { grid-template-columns: 1fr; text-align: center; font-weight: 700; font-family: var(--display); font-size: 18px; padding: 18px; }
.numin { display: flex; gap: 10px; }
.numin input { flex: 1; min-width: 0; height: 54px; border-radius: 14px; border: 2px solid var(--line2); background: var(--bg2); color: var(--text); font: 600 20px var(--display); padding: 0 16px; }
.numin input:focus { border-color: var(--violet); outline: none; }
.numin .unit { align-self: center; color: var(--muted); font-weight: 600; }
.numin input.right { border-color: var(--good); }
.numin input.wrong { border-color: var(--bad); }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 14px; animation: rise .25s ease-out; }
.feedback.ok { background: rgba(61,220,151,.1); border: 1px solid rgba(61,220,151,.35); }
.feedback.no { background: rgba(255,93,115,.08); border: 1px solid rgba(255,93,115,.35); }
.feedback .h { font-family: var(--display); font-weight: 700; font-size: 18px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 10px; }
.feedback.ok .h { color: var(--good); }
.feedback.no .h { color: var(--bad); }
.feedback .md { font-size: 15px; }
.feedback .md p:last-child { margin: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.qnext { margin-top: 16px; display: flex; justify-content: flex-end; }
.xpfloat { position: fixed; z-index: 60; pointer-events: none; font-family: var(--display); font-weight: 700; color: var(--xp); font-size: 22px; text-shadow: 0 2px 12px rgba(0,0,0,.6); animation: floatup 1s ease-out forwards; }
@keyframes floatup { to { transform: translateY(-60px); opacity: 0; } }

.result { text-align: center; padding: 34px 24px; }
.result .big { font-size: 72px; line-height: 1; margin-bottom: 10px; }
.result .score { font-family: var(--display); font-size: 54px; font-weight: 700; line-height: 1; }
.result .gained { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 24px; }
.result .gained .tag { font-size: 14px; padding: 6px 12px; }
.result .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.review { text-align: left; margin-top: 24px; }
.review details { border-top: 1px solid var(--line); padding: 10px 0; }
.review summary { cursor: pointer; font-size: 15px; }

/* ---------- flashcards ---------- */
.fc-wrap { max-width: 560px; margin: 0 auto; text-align: center; }
.fc { perspective: 1200px; height: 300px; margin: 10px 0 20px; cursor: pointer; }
.fc-in { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.3,1.3,.5,1); transform-style: preserve-3d; }
.fc.flip .fc-in { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; padding: 30px; border-radius: 24px; font-size: 22px; font-weight: 600; font-family: var(--display); background: radial-gradient(400px 200px at 50% 0%, color-mix(in srgb, var(--c) 25%, transparent), transparent), var(--card); border: 2px solid color-mix(in srgb, var(--c) 40%, var(--line)); box-shadow: var(--shadow); }
.fc-face.back { transform: rotateY(180deg); font-family: var(--body); font-weight: 500; font-size: 18px; }
.fc-face .hint { position: absolute; bottom: 14px; left: 0; right: 0; font-size: 12px; color: var(--dim); font-weight: 500; font-family: var(--body); }
.fc-acts { display: flex; gap: 12px; justify-content: center; }

/* ---------- achievements ---------- */
.ach { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.ach .ai { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; background: var(--raise); }
.ach h3 { margin: 0; font-size: 16px; }
.ach p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ach.locked .ai { filter: grayscale(1); opacity: .35; }
.ach.locked h3 { color: var(--muted); }
.ach.r-rare { border-color: rgba(34,211,238,.35); }
.ach.r-epic { border-color: rgba(124,92,255,.5); }
.ach.r-legend { border-color: rgba(255,210,63,.55); background: radial-gradient(300px 100px at 0% 50%, rgba(255,210,63,.12), transparent), var(--card); }
.ach.locked { border-color: var(--line) !important; background: var(--card) !important; }
.ach .rar { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.r-common .rar { color: var(--muted); } .r-rare .rar { color: var(--cyan); } .r-epic .rar { color: #a993ff; } .r-legend .rar { color: var(--xp); }
.ach .prog { margin-top: 6px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 70; top: calc(var(--top) + 10px); right: 16px; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: #1e2242; border: 1px solid rgba(255,210,63,.45); box-shadow: 0 20px 40px -12px rgba(0,0,0,.7), 0 0 30px -10px rgba(255,210,63,.6); animation: toastin .5s cubic-bezier(.2,1.4,.4,1); }
.toast.out { animation: toastout .3s forwards; }
.toast .ti { font-size: 32px; text-align: center; }
.toast small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--xp); font-weight: 700; }
.toast b { font-family: var(--display); }
.toast.info { border-color: var(--line2); box-shadow: 0 20px 40px -12px rgba(0,0,0,.7); }
.toast.info small { color: var(--cyan); }
@keyframes toastin { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toastout { to { opacity: 0; transform: translateX(40px); } }
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 65; }

.levelup { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(5,6,14,.75); backdrop-filter: blur(6px); animation: rise .3s; padding: 16px; }
.levelup .card { text-align: center; max-width: 380px; padding: 34px 28px; border-color: rgba(255,210,63,.5); }
.levelup .n { font-family: var(--display); font-size: 90px; font-weight: 700; line-height: 1; background: linear-gradient(180deg, #fff3b0, var(--xp), #ff9f1c); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.2); } }

/* ---------- onboarding ---------- */
.onb { max-width: 560px; margin: 4vh auto 0; }
.onb .card { padding: 30px; }
.field { display: block; margin: 18px 0; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.field input[type=text] { width: 100%; height: 50px; border-radius: 14px; border: 2px solid var(--line2); background: var(--bg2); color: var(--text); font: 500 17px var(--body); padding: 0 16px; }
.field input[type=text]:focus { border-color: var(--violet); outline: none; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 8px; }
.avatars button { height: 50px; border-radius: 14px; border: 2px solid var(--line); background: var(--raise); font-size: 24px; }
.avatars button.on { border-color: var(--violet); background: rgba(124,92,255,.2); }
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--raise); }
.choice .e { font-size: 28px; text-align: center; }
.choice b { display: block; font-family: var(--display); }
.choice small { color: var(--muted); }
.choice.on { border-color: var(--violet); background: rgba(124,92,255,.15); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.np-course { display: grid; grid-template-columns: 1fr; gap: 8px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kv .card { padding: 16px; }
.kv b { display: block; font-family: var(--display); font-size: 28px; line-height: 1.1; }
.kv span { font-size: 13px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); }
.footer { margin-top: 60px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); text-align: center; }
.footer a { color: var(--muted); }
.boot { display: grid; place-items: center; min-height: 60vh; }
.boot-logo { font: 700 36px var(--display); animation: pulse 1.2s infinite; }
.boot-logo span { color: var(--cyan); }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- bottom nav (mobile) ---------- */
.bottomnav { display: none; }
@media (max-width: 760px) {
  :root { --top: 56px; }
  .topnav { display: none; }
  .pill.lvl .lvlbar { display: none; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(13,14,26,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .bottomnav a { display: grid; justify-items: center; gap: 1px; padding: 6px 0; text-decoration: none; font-size: 11px; color: var(--dim); border-radius: 12px; font-weight: 600; }
  .bottomnav a .i { font-size: 21px; filter: grayscale(.7); }
  .bottomnav a.on { color: var(--text); background: var(--card); }
  .bottomnav a.on .i { filter: none; }
  main { padding-top: 18px; }
  .card { padding: 16px; }
  .chead { padding: 20px; }
  .chead .emo-bg { font-size: 80px; }
  .qcard { padding: 18px; }
  .qtext { font-size: 18px; }
  .node { grid-template-columns: 52px 1fr; }
  .node .orb { width: 52px; height: 52px; font-size: 23px; border-radius: 16px; }
  .node .stars { grid-column: 2; }
  .lesson { font-size: 16px; }
  .toasts { top: auto; bottom: 86px; }
  .fc { height: 260px; }
}
@media (max-width: 420px) {
  .pill.streak .lbl, .logo .txt { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
main:focus, main:focus-visible { outline: none; }
.challenge .emo { flex: none; }
.ccard .old { font-size: 12px; color: var(--dim); margin: -2px 0 4px; }
.navrow .btn { height: auto; min-height: 36px; padding: 8px 14px; max-width: 48%; line-height: 1.3; }

/* ================= konto / tävling / prov ================= */
.tag.lp { color: #7cf3ff; border-color: rgba(34,211,238,.35); background: rgba(34,211,238,.1); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; }
.formerr { color: var(--bad); font-size: 14px; min-height: 1.2em; margin: 4px 0 10px; }
.field input[type=password], .field input[type=date] { width: 100%; height: 50px; border-radius: 14px; border: 2px solid var(--line2); background: var(--bg2); color: var(--text); font: 500 17px var(--body); padding: 0 16px; }
.field input[type=password]:focus, .field input[type=date]:focus { border-color: var(--violet); outline: none; }
.seg.wide { display: flex; width: 100%; } .seg.wide button { flex: 1; padding: 10px; }
.namepick { display: flex; flex-wrap: wrap; gap: 8px; }
.namepick button { border: 2px solid var(--line); background: var(--raise); border-radius: 12px; padding: 9px 12px; font: 600 15px var(--display); }
.namepick button.on { border-color: var(--violet); background: rgba(124,92,255,.2); }
.namepick .shuffle { border-style: dashed; color: var(--muted); }
.avatars button { position: relative; }
.avatars button.locked { opacity: .5; cursor: not-allowed; font-size: 16px; }
.avatars button small { position: absolute; bottom: 2px; left: 0; right: 0; font-size: 9px; color: var(--muted); font-weight: 700; }
.reccode { font-size: clamp(24px, 6vw, 34px); font-weight: 700; letter-spacing: .08em; text-align: center; padding: 22px; margin: 18px 0; border-radius: 16px; background: var(--bg2); border: 2px dashed var(--xp); color: var(--xp); }
.modal { max-width: 520px !important; width: 100%; text-align: left !important; max-height: 90vh; overflow: auto; }
.goalpick { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 4px; }
.goalpick label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--raise); font-size: 14px; cursor: pointer; }
.goalpick input { width: 18px; height: 18px; accent-color: var(--violet); }

.lpcard.cta { display: flex; gap: 16px; align-items: center; text-decoration: none; background: radial-gradient(400px 160px at 0% 0%, rgba(124,92,255,.25), transparent 70%), var(--card); }
.lpcard.cta .emo { font-size: 42px; }
.lpcard.cta > div:nth-child(2) { flex: 1; }
@media (max-width: 560px) { .lpcard.cta { flex-direction: column; align-items: flex-start; } }
.lpgrid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 20px; align-items: center; }
@media (max-width: 760px) { .lpgrid { grid-template-columns: 1fr 1fr; } .lpmeters { grid-column: 1 / -1; } }
.lpbig { font: 700 38px/1.1 var(--display); }
.lpbig small { font-size: 16px; color: var(--muted); }
.lpmeters { display: grid; gap: 10px; }
.streakwarn { display: flex; gap: 14px; align-items: center; margin-top: 16px; font-size: 15px; border-color: rgba(255,140,60,.5); background: radial-gradient(300px 100px at 0% 50%, rgba(255,140,60,.18), transparent), var(--card); }
.streakwarn > div { flex: 1; }
.exam .exam-cd { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 6px; }
.exam .exam-cd .n { font: 700 48px/1 var(--display); color: var(--c); }
.examcta h3 { margin-bottom: 6px; }

.lbcontrols { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin: 10px 0 18px; }
.lbcontrols .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.lbcontrols .seg button { white-space: nowrap; }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; max-width: 560px; margin: 10px auto 18px; text-align: center; }
.pod .pav { font-size: 42px; line-height: 1.1; }
.pod.p1 .pav { font-size: 56px; animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
.pod .pname { font: 600 14px var(--display); word-break: break-word; margin-top: 4px; }
.pod .plp { font-size: 13px; color: var(--muted); }
.pod .pblock { margin-top: 8px; border-radius: 14px 14px 4px 4px; display: grid; place-items: center; font-size: 30px; background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.02)); border: 1px solid var(--line2); }
.pod.p1 .pblock { height: 110px; background: linear-gradient(180deg, rgba(255,210,63,.35), rgba(255,210,63,.05)); border-color: rgba(255,210,63,.5); }
.pod.p2 .pblock { height: 80px; background: linear-gradient(180deg, rgba(200,210,230,.3), rgba(200,210,230,.04)); }
.pod.p3 .pblock { height: 60px; background: linear-gradient(180deg, rgba(205,127,50,.35), rgba(205,127,50,.05)); }
.pod.me .pname { color: var(--cyan); }
.lblist { padding: 6px; }
.lbrow { display: grid; grid-template-columns: 46px 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; }
.lbrow + .lbrow { border-top: 1px solid var(--line); }
.lbrow .rk { text-align: center; font-weight: 700; font-size: 17px; }
.lbrow .av { font-size: 26px; }
.lbrow .nm small { display: block; color: var(--muted); font-size: 12px; }
.lbrow .lp { font-weight: 700; font-size: 17px; }
.lbrow.me { background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.35); }
.lbrow.sep { margin-top: 10px; }
.rules summary { cursor: pointer; }
.rules .md { margin-top: 12px; font-size: 15px; }

/* ================= NP-event ================= */
.evbanner { position: sticky; top: calc(var(--top) + var(--tabs)); z-index: 24; display: flex; align-items: center; gap: 10px; padding: 9px 16px; text-decoration: none; font-size: 14px; color: #fff; background: linear-gradient(90deg, #ff3d81, #ff8a00, #ff3d81); background-size: 200% 100%; animation: evslide 6s linear infinite; white-space: nowrap; overflow: hidden; }
.evbanner b { font-family: var(--display); letter-spacing: .02em; }
.evbanner .ev-sep { opacity: .6; }
.evbanner .ev-cd { font-weight: 700; background: rgba(0,0,0,.25); padding: 2px 8px; border-radius: 8px; margin-left: 4px; }
.evbanner .ev-go { margin-left: auto; font-weight: 700; }
.ev-pulse { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.8); animation: evpulse 1.6s infinite; flex: none; }
@keyframes evpulse { 70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
@keyframes evslide { to { background-position: -200% 0; } }
@media (max-width: 760px) { .evbanner { font-size: 12.5px; } .evbanner .ev-go, .evbanner .ev-sep { display: none; } .evbanner { text-overflow: ellipsis; } }

.ev-kicker { font: 700 12px var(--display); letter-spacing: .16em; text-transform: uppercase; color: #ffcf5c; }
.evhero { display: block; margin-top: 16px; text-decoration: none; position: relative; overflow: hidden; padding: 26px; border: 1px solid rgba(255,61,129,.5); background: radial-gradient(500px 240px at 100% 0%, rgba(255,138,0,.35), transparent 70%), radial-gradient(500px 260px at 0% 100%, rgba(255,61,129,.35), transparent 70%), #1a0b22; }
.evhero h2 { font-size: clamp(26px, 4.5vw, 38px); margin: 6px 0 4px; }
.evhero .ev-next { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 14px 0 16px; }
.evhero .ev-next span:first-child { color: var(--muted); font-size: 13px; width: 100%; }
.evhero .ev-big { font: 700 26px var(--display); color: #ffcf5c; }
.evpage .evtop { text-align: center; padding: 34px 20px; border-radius: 28px; position: relative; overflow: hidden; border: 1px solid rgba(255,61,129,.5); background: radial-gradient(600px 300px at 50% -10%, rgba(255,138,0,.4), transparent 70%), radial-gradient(500px 300px at 0% 110%, rgba(255,61,129,.4), transparent 70%), radial-gradient(500px 300px at 100% 110%, rgba(124,92,255,.4), transparent 70%), #160818; }
.evtitle { font-size: clamp(34px, 7vw, 64px); line-height: 1; margin: 10px 0; background: linear-gradient(180deg, #fff, #ffcf5c 60%, #ff8a00); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.evtag { font-size: 18px; opacity: .9; }
.evcount { margin: 20px auto 0; max-width: 460px; padding: 18px; border-radius: 20px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.12); }
.evclock { font-size: clamp(34px, 8vw, 56px); font-weight: 700; color: #ffcf5c; line-height: 1.1; margin: 6px 0; text-shadow: 0 0 30px rgba(255,138,0,.6); }
.timeline { padding: 6px 10px; }
.tl { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 11px 6px; border-top: 1px solid var(--line); font-size: 15px; }
.tl:first-child { border-top: 0; }
.tl.past { opacity: .45; }
.tl.mine .tll { font-weight: 600; }
.tl .tld { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { .tl { grid-template-columns: 1fr; gap: 4px; } }
.splash { text-align: center; }
.splash .evtitle { font-size: 44px; }

/* tema under NP-event */
:root[data-theme=np] {
  --bg: #12061a; --bg2: #1a0a24; --card: #1f0e2b; --raise: #2c1540;
  --violet: #ff3d81; --cyan: #ffb020; --pink: #ff3d81; --xp: #ffcf5c;
  --line: rgba(255,180,220,.1); --line2: rgba(255,180,220,.18);
}
:root[data-theme=np] body {
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(255,61,129,.22), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(255,138,0,.14), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(124,92,255,.18), transparent 60%);
}
:root[data-theme=np] .btn.primary { background: linear-gradient(135deg, #ff3d81, #ff8a00); box-shadow: 0 6px 0 #a3194f, 0 10px 30px -10px rgba(255,61,129,.8); }
:root[data-theme=np] .btn.primary:active { box-shadow: 0 2px 0 #a3194f; }
:root[data-theme=np] .logo span { background: linear-gradient(90deg, #ff3d81, #ffb020); -webkit-background-clip: text; background-clip: text; }
:root[data-theme=np] .topbar, :root[data-theme=np] .coursetabs, :root[data-theme=np] .bottomnav { background: rgba(18,6,26,.85); }

/* ================= interaktiva widgets ================= */
.widget { border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--c, var(--violet)) 45%, var(--line)); background: radial-gradient(500px 200px at 50% 0%, color-mix(in srgb, var(--c, var(--violet)) 12%, transparent), transparent), var(--bg2); padding: 16px; }
.wtitle { font: 600 16px var(--display); display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.wbadge { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--c, var(--cyan)); border: 1px solid currentColor; border-radius: 999px; padding: 2px 8px; }
.wstage { border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.18); }
.wsvg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; font-family: var(--body); }
.wsvg text { font-family: var(--body); }
.wcontrols { margin-top: 12px; }
.wctl { display: grid; gap: 8px; }
.wsl { display: grid; grid-template-columns: minmax(90px, auto) 1fr 84px; gap: 12px; align-items: center; font-size: 14px; }
.wlbl { color: var(--muted); font-weight: 600; }
.wval { font: 600 14px var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.wsl input[type=range] { width: 100%; accent-color: var(--c, var(--violet)); height: 28px; }
.wout { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: 14.5px; line-height: 1.55; }
.wout b { color: var(--xp); }
.wfx { font: 600 17px var(--display); color: var(--text); }
.wbtns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.wbtn { border: 1px solid var(--line2); background: var(--raise); border-radius: 10px; padding: 7px 12px; font-size: 14px; font-weight: 600; }
.wbtn.on { border-color: var(--c, var(--violet)); background: color-mix(in srgb, var(--c, var(--violet)) 22%, var(--raise)); }
.wbtn:hover { background: #2b3156; }
.whint { margin-top: 8px; font-size: 13px; color: var(--dim); }
.whint::before { content: "💡 "; }
.wcap { font-size: 14px; color: var(--muted); margin-top: 8px; }
.wtip { position: absolute; pointer-events: none; background: #0b0c18; border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; font-size: 13px; max-width: 260px; box-shadow: var(--shadow); z-index: 5; }
@media (max-width: 560px) { .wsl { grid-template-columns: 1fr 70px; } .wsl .wlbl { grid-column: 1 / -1; } .widget { padding: 12px; } }

/* ================= kursmeny ================= */
.ctab.menu-btn { position: sticky; left: 0; z-index: 2; background: var(--raise); border: 1px solid var(--line2); color: var(--text); font-weight: 600; box-shadow: 10px 0 14px -4px var(--bg); }
.ctab.menu-btn[aria-expanded=true] { border-color: var(--violet); }
.coursemenu { position: fixed; z-index: 40; top: calc(var(--top) + var(--tabs)); left: 0; right: 0; max-height: calc(100vh - var(--top) - var(--tabs) - 10px); overflow-y: auto; background: rgba(13,14,26,.97); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line2); box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); }
:root[data-theme=np] .coursemenu { background: rgba(18,6,26,.97); }
.cm-in { max-width: 1120px; margin: 0 auto; padding: 16px 16px 20px; }
.cm-grp { margin-top: 14px; }
.cm-h { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 700; margin-bottom: 6px; }
.cm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.cm-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 12px; text-decoration: none; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.cm-item:hover, .cm-item.on { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.cm-emo { font-size: 20px; text-align: center; }
.cm-t b { display: block; font-weight: 600; line-height: 1.25; }
.cm-t .bar { margin-top: 5px; }
.cm-p { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .coursemenu { bottom: 70px; max-height: none; } }
.topnav a { white-space: nowrap; }
@media (max-width: 1060px) { .topnav a { padding: 7px 8px; font-size: 14px; } .topnav { margin-left: 4px; } }
@media (max-width: 900px) and (min-width: 761px) { .pill.lvl .lvlbar, .pill.streak .lbl { display: none; } }
.privacy h1 { margin-top: 26px; } .privacy h2 { margin: 30px 0 10px; } .privacy .box { margin: 16px 0; }

/* ================= onboarding, avatar, kontroll, tur ================= */
.avsvg { display: block; overflow: visible; }
.avatar-btn { overflow: visible; padding: 0; }
.avatar-btn .avsvg { margin: auto; }
.hello .big-avatar { opacity: .9; right: 6px; bottom: 6px; transform: rotate(6deg); pointer-events: auto; transition: transform .2s; }
.hello .big-avatar:hover { transform: rotate(0) scale(1.05); }
@media (max-width: 560px) { .hello .big-avatar { opacity: 1; top: 12px; bottom: auto; right: 12px; } .hello .big-avatar svg { width: 76px; height: 76px; } }
.bottomnav a .i .avsvg { margin: 0 auto; }
.bottomnav a .i:has(.avsvg) { filter: none; }
.steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 18px; }
.steps span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--display); background: var(--raise); color: var(--muted); border: 2px solid var(--line2); }
.steps span.on { background: var(--violet); color: #fff; border-color: var(--violet); }
.steps span.done { background: var(--good); color: #00281a; border-color: var(--good); }
.steps i { width: 40px; height: 2px; background: var(--line2); }
.lead { font-size: 17px; color: var(--muted); }
.lead b { color: var(--text); }
.choices.big .choice { grid-template-columns: 50px 1fr auto; padding: 16px; }
.choices.big .choice .e { font-size: 32px; }
.choices.big .choice b { font-size: 18px; }
.choice .go { font-size: 22px; color: var(--muted); }
.choice:hover { border-color: var(--line2); background: #2a3052; }
.avbuild { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: start; margin-top: 10px; }
@media (max-width: 560px) { .avbuild { grid-template-columns: 1fr; } }
.avbig { display: grid; place-items: center; margin: 0 auto; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(124,92,255,.35), rgba(124,92,255,.05) 70%); }
.avbig .avsvg { animation: bob 3s ease-in-out infinite; }
.avbig.small { width: 120px; height: 120px; margin-bottom: 8px; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(2deg); } }
.avparts .note { margin: 8px 0 4px; font-weight: 600; }
.pickrow { display: flex; flex-wrap: wrap; gap: 6px; }
.avopt { width: 56px; height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--raise); display: grid; place-items: center; padding: 0; }
.avopt.on { border-color: var(--violet); background: rgba(124,92,255,.2); }
.swatch { width: 30px; height: 30px; border-radius: 50%; display: block; border: 2px solid rgba(255,255,255,.3); }
.swatch.big { width: 48px; height: 48px; }
.lockhint { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255,210,63,.07); border: 1px dashed rgba(255,210,63,.35); font-size: 14px; }
.checkreq { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 6px 0 16px; font-size: 14px; color: var(--muted); }
.checkreq .ok { color: var(--good); }
.checkdots { display: flex; gap: 6px; }
.checkdots i { width: 14px; height: 14px; border-radius: 50%; background: var(--raise); border: 2px solid var(--line2); }
.checkdots i.on { background: var(--good); border-color: var(--good); }
.readdone { text-align: center; }
.studio { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .studio { grid-template-columns: 1fr; } }
.studio-prev { text-align: center; position: sticky; top: calc(var(--top) + var(--tabs) + 12px); }
@media (max-width: 860px) { .studio-prev { position: static; } }
.studio-prev .avbig { width: 220px; height: 220px; margin-bottom: 10px; }
.studio-tabs { display: flex; flex-wrap: wrap; margin-bottom: 14px; }
.studio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.sopt { display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--raise); }
.sopt.on { border-color: var(--violet); background: rgba(124,92,255,.18); }
.sopt.locked { opacity: .45; filter: grayscale(.8); cursor: not-allowed; }
.sopt .sname { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; }
.nextrw { margin: 14px 0 4px; padding: 12px; border-radius: 14px; background: rgba(255,210,63,.07); border: 1px dashed rgba(255,210,63,.4); display: grid; gap: 8px; font-size: 14px; }
.nextrw-mini { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(255,210,63,.07); border: 1px dashed rgba(255,210,63,.35); text-decoration: none; font-size: 13px; color: var(--muted); width: fit-content; }
.nextrw-mini b { color: var(--xp); }
.lvrewards { margin: 8px 0 14px; }
.lvr { display: grid; justify-items: center; gap: 4px; font-size: 13px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.04); min-width: 110px; }
.nextstep { display: flex; gap: 18px; align-items: center; text-decoration: none; margin-bottom: 16px; padding: 22px 24px; border: 2px solid color-mix(in srgb, var(--c, var(--violet)) 60%, transparent); background: radial-gradient(500px 200px at 0% 0%, color-mix(in srgb, var(--c, var(--violet)) 28%, transparent), transparent 70%), var(--card); transition: transform .15s; }
.nextstep:hover { transform: translateY(-2px); }
.nextstep .ns-ico { font-size: 46px; }
.nextstep > div { flex: 1; }
.nextstep h2 { margin: 2px 0 4px; font-size: clamp(19px, 3vw, 24px); }
.nextstep p { margin: 0; }
.ns-k { font: 700 12px var(--display); text-transform: uppercase; letter-spacing: .12em; color: var(--c, var(--cyan)); }
@media (max-width: 620px) { .nextstep { flex-direction: column; align-items: flex-start; } .nextstep .btn { width: 100%; } }
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(5,6,14,.78), 0 0 0 3px var(--xp), 0 0 30px 6px rgba(255,210,63,.5); pointer-events: none; transition: all .3s; }
.tour-tip { position: fixed; width: 320px; max-width: calc(100vw - 32px); padding: 16px 18px; border-radius: 16px; background: #1e2242; border: 1px solid rgba(255,210,63,.5); box-shadow: 0 20px 50px -10px rgba(0,0,0,.8); animation: rise .25s; }
.tour-tip h3 { margin: 4px 0 6px; }
.tour-tip p { font-size: 15px; color: var(--muted); }
.tour-n { font-size: 12px; color: var(--xp); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lbrow .av, .pod .pav { display: grid; place-items: center; }
[hidden] { display: none !important; }

/* ================= tillgänglighet / mobil ================= */
.linkbtn { padding: 6px 2px; min-height: 32px; }
@media (max-width: 760px) {
  .seg button { min-height: 40px; }
  .btn.small { min-height: 40px; }
  .namepick button { min-height: 40px; }
}
.section > a { display: inline-block; padding: 8px 0; }

/* kryssruta med text (t.ex. "Visa mig inte på topplistan") */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; margin: 4px 0 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--violet, #7c5cff); }
.check .note { display: inline; }
.extnote { margin-top: 8px; font-size: 12px; }

/* ---------- rättning på servern, felrapport, repetition ---------- */
.qnext { justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.qnext .btn { margin-left: auto; }
.reportq { font-size: 12.5px; }
.feedback.wait { background: rgba(255,255,255,.04); border: 1px dashed var(--line, rgba(255,255,255,.18)); }
.feedback.wait .h { color: var(--muted); font-weight: 500; }
.opt.pending { outline: 2px solid var(--violet, #7c5cff); outline-offset: 2px; animation: qpulse 1s ease-in-out infinite alternate; }
@keyframes qpulse { from { opacity: 1; } to { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .opt.pending { animation: none; } }
.repcard { display: flex; gap: 16px; align-items: center; margin-top: 16px; text-decoration: none; color: inherit; border-color: rgba(34,211,238,.45); background: radial-gradient(360px 140px at 0% 50%, rgba(34,211,238,.16), transparent 70%), var(--card); }
.repcard .emo { font-size: 38px; flex: none; }
.repcard > div { flex: 1; }
.repcard.calm { border-color: var(--line, rgba(255,255,255,.12)); background: var(--card); font-size: 15px; }
@media (max-width: 560px) { .repcard:not(.calm) { flex-direction: column; align-items: flex-start; } }
.col { display: flex; flex-direction: column; }
