@font-face { font-family: "Baloo"; src: url("/fonts/baloo2.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("/fonts/kalam-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("/fonts/kalam-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #000; --bg2: #121212; --card: #141414; --card2: #1c1c1c; --line: #2a2a2a;
  --text: #fafafa; --muted: #a1a1aa; --pink: #ff4fa3; --violet: #fafafa; --cyan: #e5e5e5; --lime: #a3e635;
  --gold: #fbbf24; --good: #22c55e; --bad: #ef4444; --warn: #f59e0b;
  --grad: #fafafa;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: "Baloo", system-ui, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cyan); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.wrap { max-width: 860px; margin: 0 auto; padding: 14px 16px 90px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(11,8,32,.75); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .back { background: var(--card); border: 1px solid var(--line); border-radius: 12px; width: 40px; height: 40px; font-size: 1.2rem; }
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: .3px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.logo .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top .sp { flex: 1; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .9rem; }
.iconbtn { background: var(--card); border: 1px solid var(--line); border-radius: 12px; height: 40px; min-width: 40px; font-size: 1.1rem; }

/* hero */
.hero { text-align: center; padding: 26px 8px 8px; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.05; margin: 6px 0; }
.hero h1 .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 6px 0 0; font-size: 1.05rem; }
.bounce { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-6deg); } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .9rem; }

/* cards */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 14px 0; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; text-align: left; transition: transform .15s, border-color .15s, background .15s; }
.card:hover, .card:active { transform: translateY(-2px) scale(1.01); border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.09); }
.card .ic { font-size: 2.1rem; line-height: 1; }
.card b { display: block; font-size: 1.1rem; margin-top: 8px; }
.card small { color: var(--muted); line-height: 1.3; display: block; margin-top: 2px; }
.card .glow { position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%; filter: blur(30px); opacity: .45; }
.card.big { padding: 22px; }
.card.big .ic { font-size: 3rem; }
.card.big b { font-size: 1.6rem; }
.card.soon { opacity: .55; }
.tag { position: absolute; top: 10px; right: 10px; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.12); }
.tag.ok { background: rgba(34,197,94,.2); color: #86efac; }
.sec { font-size: 1.15rem; margin: 22px 0 6px; display: flex; align-items: center; gap: 8px; }

/* tabs */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; white-space: nowrap; }
.tab.on { background: var(--grad); border-color: transparent; font-weight: 700; }

/* list rows */
.row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 8px 0; width: 100%; text-align: left; }
.row .ic { font-size: 1.6rem; }
.row .t { flex: 1; }
.row .t b { display: block; }
.row .t small { color: var(--muted); }
.bar { height: 6px; background: rgba(255,255,255,.1); border-radius: 9px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 9px; }
.go { background: var(--grad); border: 0; border-radius: 12px; padding: 8px 14px; font-weight: 700; color: #fff; }

/* big buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 16px; padding: 13px 18px; font-weight: 800; font-size: 1.05rem; color: #fff; background: var(--grad); box-shadow: 0 8px 24px rgba(139,92,246,.35); }
.btn.ghost { background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.btn.green { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 8px 24px rgba(34,197,94,.3); }
.btn.block { width: 100%; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.btns .btn { flex: 1; min-width: 140px; }

/* quiz */
.qtop { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.qtop .prog { flex: 1; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; padding: 6px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.timer.low { color: #fff; background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.qmeta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.qmeta span { font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.1); }
.qmeta .y { background: rgba(251,191,36,.18); color: #fde68a; }
.qtext { font-size: 1.12rem; line-height: 1.5; white-space: pre-wrap; }
.qfig { display: block; max-width: 100%; margin: 12px auto 4px; border-radius: 12px; background: #fff; padding: 6px; }
.opts { display: grid; gap: 10px; margin-top: 14px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: rgba(255,255,255,.05); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 1.02rem; line-height: 1.4; transition: transform .1s, border-color .15s, background .15s; }
.opt:hover { border-color: rgba(255,255,255,.35); }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); font-weight: 800; }
.opt.sel { border-color: var(--violet); background: rgba(139,92,246,.18); }
.opt.sel .k { background: var(--violet); }
.opt.right { border-color: var(--good); background: rgba(34,197,94,.18); animation: pop .35s; }
.opt.right .k { background: var(--good); }
.opt.wrong { border-color: var(--bad); background: rgba(239,68,68,.16); animation: shake .4s; }
.opt.wrong .k { background: var(--bad); }
.opt:disabled { cursor: default; }
@keyframes pop { 40% { transform: scale(1.04); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.ex { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3); line-height: 1.5; }
.ex b { color: var(--cyan); }
.note { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.3); font-size: .92rem; }
.qnav { display: flex; gap: 10px; margin-top: 14px; }
.qnav .btn { flex: 1; white-space: nowrap; padding-left: 8px; padding-right: 8px; min-width: 0; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 14px 0; }
.palette button { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 700; }
.palette .ans { background: rgba(139,92,246,.35); border-color: var(--violet); }
.palette .mark { background: rgba(251,191,36,.3); border-color: var(--gold); }
.palette .cur { outline: 2px solid #fff; }
.floater { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: 5rem; pointer-events: none; z-index: 60; animation: floatup 1s ease-out forwards; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.4); } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -110%) scale(1); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* battle scoreboard */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; margin-bottom: 10px; }
.vs .p { display: flex; align-items: center; gap: 8px; }
.vs .p.r { justify-content: flex-end; text-align: right; }
.vs .av { font-size: 1.8rem; }
.vs .sc { font-size: 1.5rem; font-weight: 800; }
.vs .mid { font-weight: 800; color: var(--gold); }
.typing { font-size: .8rem; color: var(--muted); }
.players { display: grid; gap: 8px; margin: 10px 0; }
.player { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.player .rk { width: 28px; text-align: center; font-weight: 800; }
.player .nm { flex: 1; }
.player .pt { font-weight: 800; }
.code { font-size: 2.4rem; font-weight: 800; letter-spacing: .3em; text-align: center; background: var(--card); border: 2px dashed var(--violet); border-radius: 18px; padding: 10px; margin: 10px 0; }
input.in { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font-size: 1.05rem; outline: none; }
input.in:focus { border-color: var(--violet); }

/* result */
.res-top { text-align: center; padding: 10px 0; }
.res-emoji { font-size: 5rem; line-height: 1; animation: pop .6s; }
.grade { display: inline-block; font-size: 1.6rem; font-weight: 800; padding: 4px 18px; border-radius: 999px; margin: 8px 0; }
.ring { width: 150px; height: 150px; margin: 10px auto; border-radius: 50%; display: grid; place-items: center; }
.ring > div { width: 118px; height: 118px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 2rem; line-height: 1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; }
.stat small { color: var(--muted); font-size: .78rem; }
.stat.g b { color: #4ade80; } .stat.r b { color: #f87171; } .stat.s b { color: #fbbf24; } .stat.a b { color: #a5b4fc; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; margin: 12px 0; line-height: 1.55; }
.review h3 { margin: 0 0 6px; font-size: 1.1rem; }
.review ul { margin: 6px 0; padding-left: 20px; }
.chbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: .92rem; }
.chbar .n { width: 46%; }
.chbar .b { flex: 1; height: 10px; border-radius: 9px; background: rgba(255,255,255,.1); overflow: hidden; }
.chbar .b i { display: block; height: 100%; border-radius: 9px; }
.chbar .p { width: 44px; text-align: right; font-weight: 700; }
.rq { border-left: 4px solid var(--line); padding: 10px 12px; margin: 10px 0; background: rgba(255,255,255,.03); border-radius: 0 12px 12px 0; }
.rq.ok { border-color: var(--good); } .rq.no { border-color: var(--bad); } .rq.sk { border-color: var(--gold); }
.rq .yo { font-size: .9rem; margin-top: 6px; }

/* notes: notebook with handwriting */
.notebook { background: #fffdf4; color: #1e293b; border-radius: 14px; padding: 20px 18px 20px 54px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  background-image: linear-gradient(#fffdf4 0, #fffdf4 0), repeating-linear-gradient(#fffdf4 0 31px, #c7d7f2 31px 32px); font-family: "Kalam", "Comic Sans MS", cursive; font-size: 1.12rem; line-height: 32px; }
.notebook::before { content: ""; position: absolute; left: 40px; top: 0; bottom: 0; width: 2px; background: #f19aa8; }
.notebook h2 { font-family: "Kalam", cursive; font-weight: 700; color: #b91c1c; margin: 0 0 4px; font-size: 1.6rem; line-height: 40px; }
.notebook h3 { font-weight: 700; color: #1d4ed8; margin: 12px 0 0; font-size: 1.25rem; }
.notebook ul { margin: 0; padding-left: 18px; }
.notebook li { margin: 0; }
.notebook .hl { background: linear-gradient(transparent 55%, #fde68a 55%); }
.notebook .hard { color: #7c2d12; }
.qa { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin: 10px 0; overflow: hidden; }
.qa summary { padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; display: flex; gap: 10px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: "❓"; }
.qa[open] summary::before { content: "💡"; }
.qa .ans { padding: 0 14px 14px 40px; line-height: 1.55; color: #e2e8f0; }
.qa .yr { font-size: .75rem; color: #fde68a; margin-left: auto; white-space: nowrap; }

/* sheet (modal) */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { width: 100%; max-width: 560px; background: var(--bg2); border: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: 18px 18px 26px; max-height: 90dvh; overflow-y: auto; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { margin: 0 0 6px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.seg button { flex: 1; min-width: 80px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.seg button.on { background: var(--grad); border-color: transparent; font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; z-index: 70; animation: up .2s; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px; }
@media (min-width: 700px) { .stats { gap: 12px; } .qtext { font-size: 1.2rem; } }

/* ===== black & white theme (overrides) ===== */
.top { background: rgba(0,0,0,.85); }
.logo .g, .hero h1 .g { background: none; color: #fff; -webkit-text-fill-color: #fff; text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; text-decoration-color: #fff; }
.btn { background: #fafafa; color: #0a0a0a; box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.green { background: #16a34a; color: #fff; box-shadow: none; }
.btn.red { background: #dc2626; color: #fff; }
.tab.on, .seg button.on { background: #fafafa; color: #0a0a0a; border-color: #fafafa; }
.go { background: #fafafa; color: #0a0a0a; }
.bar i { background: #fafafa; }
.card .glow { display: none; }
.card:hover, .card:active { background: var(--card2); border-color: #3f3f46; }
.opt.sel { border-color: #fafafa; background: #262626; }
.opt.sel .k { background: #fafafa; color: #0a0a0a; }
.opt.right .k, .opt.wrong .k { color: #fff; }
.ex { background: #111; border-color: #333; }
.ex b { color: #fff; }
.palette .ans { background: #3f3f46; border-color: #a1a1aa; }
.code { border-color: #fafafa; }
input.in:focus { border-color: #fafafa; }
.stat.a b { color: #fafafa; }
.toast { background: #1f1f1f; }
.qa .yr { color: #fbbf24; }
.row.on { border-color: #fafafa; }
.row.dim { opacity: .7; }
.center { text-align: center; }
.chips.left { justify-content: flex-start; }

/* hero + class cards */
.hero.sm { padding-top: 12px; }
.hero-ic { font-size: 2.8rem; line-height: 1.2; }
.linkbtn { background: none; border: 0; color: #fff; text-decoration: underline; padding: 0; font-size: inherit; }
.clsc { min-height: 150px; }
.clsc .num { font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.clsc.on { border-color: #fafafa; }
.card.subj { padding-top: 14px; }
.card.subj .thumb { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; font-size: 1.9rem; background: color-mix(in srgb, var(--c) 26%, #111); border: 1px solid color-mix(in srgb, var(--c) 55%, #111); }
.stars { font-size: .8rem; margin-left: 4px; }

/* written questions */
.wq { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin: 12px 0; }
.wq.known { border-color: rgba(34,197,94,.6); }
.wq.unknown { border-color: rgba(239,68,68,.6); }
.wq .qtext { margin: 4px 0 12px; font-weight: 600; }
.qmeta .mk { background: none; margin-left: auto; padding: 0; font-weight: 700; }
.wq .ans { margin-top: 12px; }
.model { background: #fffdf4; color: #1e293b; border-radius: 12px; padding: 12px 14px; font-family: "Kalam", cursive; font-size: 1.08rem; line-height: 1.6; }
.selfmark { display: flex; gap: 10px; margin-top: 10px; }
.selfmark .btn { flex: 1; padding: 11px 8px; }
.dtab { width: 100%; border-collapse: collapse; background: #fffdf4; color: #1e293b; border-radius: 12px; overflow: hidden; font-size: .95rem; }
.dtab th { background: #1e293b; color: #fff; padding: 8px; text-align: left; }
.dtab td { padding: 8px; border-top: 1px solid #e2e8f0; vertical-align: top; }
.dtab td:first-child { font-weight: 700; width: 26%; }
.stats.three { grid-template-columns: repeat(3, 1fr); }

/* notes extras */
.notebook .intro { margin: 0 0 6px; color: #334155; }
.notebook .toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; line-height: 1.3; }
.notebook .toc a { font-family: "Baloo", sans-serif; font-size: .82rem; color: #1e293b; background: #e2e8f0; border-radius: 999px; padding: 4px 10px; text-decoration: none; }
.notebook section { scroll-margin-top: 70px; }
.tblwrap { overflow-x: auto; margin: 8px 0; }
.notebook table { border-collapse: collapse; width: 100%; font-family: "Baloo", sans-serif; font-size: .9rem; line-height: 1.35; background: #fff; }
.notebook th { background: #1e293b; color: #fff; padding: 7px 8px; text-align: left; }
.notebook td { padding: 7px 8px; border: 1px solid #e2e8f0; vertical-align: top; }
.fbox { background: #eef2ff; border: 2px dashed #6366f1; border-radius: 12px; padding: 8px 12px; margin: 10px 0; line-height: 1.6; font-family: "Baloo", sans-serif; font-weight: 700; color: #312e81; }
.fbox b { display: block; color: #4338ca; }
.fig { margin: 12px 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; text-align: center; }
.fig img { max-width: 100%; height: auto; }
.fig figcaption { font-size: .95rem; color: #475569; line-height: 1.4; margin-top: 6px; }
.notebook .exam { color: #065f46; }

/* history */
.hrow small { display: block; }
.hrow .pct { font-size: 1.3rem; font-weight: 800; }
.mini { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.mb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.mb i { width: 100%; border-radius: 6px 6px 2px 2px; display: block; }
.mb small { font-size: .7rem; color: var(--muted); }

/* random match */
.radar { position: relative; width: 120px; height: 120px; margin: 10px auto; display: grid; place-items: center; font-size: 3rem; }
.radar::before, .radar::after { content: ""; position: absolute; inset: 0; border: 2px solid #fafafa; border-radius: 50%; animation: ping 2s ease-out infinite; }
.radar::after { animation-delay: 1s; }
.radar.sm { width: 80px; height: 80px; font-size: 2rem; }
@keyframes ping { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
.countdown { text-align: center; font-size: 1.3rem; font-weight: 800; background: #fafafa; color: #0a0a0a; border-radius: 14px; padding: 10px; margin: 10px 0; animation: pulse 1s infinite; }
/* invite share + doubts */
.share { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.share .sh { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.share .sh span { font-size: 1.5rem; }
.share .sh.wa { border-color: #22c55e; }
.share .sh.tg { border-color: #38bdf8; }
.share .sh.ig { border-color: #f472b6; }
#codeTap { cursor: pointer; }
.kinds { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.kind { text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.kind.on { border-color: #fafafa; background: rgba(255,255,255,.12); font-weight: 700; }
textarea.in { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font: inherit; color: inherit; resize: vertical; outline: none; margin-top: 10px; }
.dbox .dst { font-weight: 700; margin: 6px 0; }
.dst.replied { color: #7dd3fc; } .dst.done { color: #86efac; } .dst.new { color: #fcd34d; }
.msg { border-radius: 14px; padding: 8px 12px; margin: 6px 0; background: var(--card2); border: 1px solid var(--line); }
.msg.a { border-color: #22c55e; background: rgba(34,197,94,.08); }
.msg small { color: var(--muted); display: block; margin-bottom: 2px; }
.dbox .more { display: flex; gap: 8px; margin-top: 8px; }
.dbox .more .btn { flex: 0 0 auto; }
.rep { margin-top: 8px; background: none; border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; color: var(--muted); font-size: .85rem; }
/* view solution */
.solbtn { display: block; width: 100%; margin-top: 12px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid #fafafa; font-weight: 800; font-size: 1rem; }
.btns .solbtn { margin-top: 0; flex: 1; }
.sol { margin-top: 12px; border: 1px solid #38bdf8; background: rgba(56,189,248,.07); border-radius: 16px; padding: 12px 14px; }
.sol .solh { font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.sol ol { margin: 0; padding-left: 22px; }
.sol li { font-size: 1.12rem; line-height: 1.55; margin: 8px 0; padding-bottom: 6px; border-bottom: 1px dashed rgba(255,255,255,.12); }
.sol li:last-child { border-bottom: 0; }
.sol .solans { margin-top: 8px; font-size: 1.1rem; padding: 10px 12px; border-radius: 12px; background: rgba(34,197,94,.15); border: 1px solid #22c55e; }
/* online + toppers */
.btn.sm { flex: 0 0 auto; min-width: 0; padding: 8px 14px; font-size: .95rem; }
.orow .ic { font-size: 1rem; }
.player.me { border-color: #fafafa; background: rgba(255,255,255,.1); }
/* owner dashboard */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 10px 0; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.tile .ti { font-size: 1.3rem; }
.tile .tn { font-size: 1.8rem; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.tile .tl { font-weight: 700; }
.tile .ts { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.dtabs { margin-top: 8px; }
/* unique name + badges */
input.in.big { font-size: 1.3rem; padding: 14px 16px; font-weight: 700; }
.nmerr { margin: 8px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #ef4444; background: rgba(239,68,68,.12); }
.chip.pick { cursor: pointer; border-color: #22c55e; font-weight: 700; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.badge.plat { background: linear-gradient(135deg, #e0f2fe, #a5b4fc); color: #1e1b4b; }
.badge.gold { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2300; }
.badge.silv { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #1e293b; }

/* Mission Board: countdown + day plan */
.cdown { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; margin: 6px 0 14px; padding: 14px 16px; border-radius: 20px; border: 1px solid #f97316; background: linear-gradient(135deg, #2a0f00, #1a0606 60%, #140014); box-shadow: 0 0 24px rgba(249,115,22,.25); animation: cdglow 2.4s ease-in-out infinite; }
@keyframes cdglow { 50% { box-shadow: 0 0 36px rgba(249,115,22,.5); } }
.cd-l { text-align: center; min-width: 78px; }
.cd-n { font-size: 2.9rem; font-weight: 800; line-height: 1; color: #fdba74; text-shadow: 0 0 18px rgba(249,115,22,.7); }
.cd-u { font-size: .8rem; color: #fed7aa; }
.cd-t { font-weight: 800; font-size: 1.15rem; color: #fff; }
.cd-s { font-size: .9rem; color: #fde68a; }
.cd-go { font-size: .85rem; color: #fb923c; margin-top: 2px; font-weight: 700; }
.mhero { text-align: center; padding: 22px 14px 16px; margin: 4px 0 12px; border-radius: 24px; border: 1px solid #f97316; background: radial-gradient(circle at 50% 0%, #4a1500, #160404 70%); }
.mh-t { font-weight: 800; letter-spacing: 2px; color: #fb923c; font-size: 1.05rem; }
.mh-n span { display: inline-block; font-size: 5.2rem; font-weight: 800; line-height: 1.05; color: #fff; text-shadow: 0 0 28px rgba(249,115,22,.9); animation: mhpulse 1.6s ease-in-out infinite; }
@keyframes mhpulse { 50% { transform: scale(1.06); } }
.mh-u { font-size: 1.05rem; color: #fed7aa; }
.mh-s { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.mh-bar { height: 10px; background: #2a2a2a; border-radius: 99px; margin: 12px 4px 6px; overflow: hidden; }
.mh-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f97316, #22c55e); border-radius: 99px; }
.mh-k { display: flex; justify-content: space-between; font-size: .85rem; color: #fde68a; padding: 0 4px; }
.row.today { border-color: #f97316; background: #1f0e02; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.dchip { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.dchip b { font-size: .9rem; } .dchip small { font-size: .72rem; color: var(--muted); } .dchip span { font-size: 1.05rem; }
.dchip.week { border-color: #3b82f6; } .dchip.final { border-color: #a855f7; } .dchip.rev { border-color: #eab308; } .dchip.exam { border-color: #ef4444; background: #1f0707; }
.dchip.done { background: #052e16; border-color: #22c55e; } .dchip.miss { opacity: .55; }
.dchip.now { border: 2px solid #f97316; box-shadow: 0 0 16px rgba(249,115,22,.6); animation: cdglow 1.6s ease-in-out infinite; }
.legend { margin: 8px 2px; }
.task { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .tick { background: none; border: 0; font-size: 1.4rem; padding: 0; }
.task .tx { flex: 1; }
.task.ok .tx { color: var(--muted); text-decoration: line-through; }

/* username pill + refer card */
.mepill { background: var(--card); border: 1px solid #22c55e; color: #bbf7d0; border-radius: 999px; padding: 6px 12px; font-size: .88rem; font-weight: 700; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refer { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin: 16px 0; padding: 16px; border-radius: 20px; border: 1px solid #eab308; background: linear-gradient(135deg, #2b1d00, #120a00 60%, #1a0d14); box-shadow: 0 0 24px rgba(234,179,8,.25); animation: rfglow 2.4s ease-in-out infinite; }
@keyframes rfglow { 50% { box-shadow: 0 0 38px rgba(234,179,8,.5); } }
.rf-ic { font-size: 2.6rem; animation: mhpulse 1.6s ease-in-out infinite; }
.rf-t { flex: 1; } .rf-t b { display: block; font-size: 1.12rem; color: #fde68a; } .rf-t small { color: #fcd34d; }
.rf-go { background: #eab308; color: #000; font-weight: 800; border-radius: 12px; padding: 8px 14px; }
.rfh { border-color: #eab308; background: radial-gradient(circle at 50% 0%, #4a3300, #140c00 70%); }
.rfh .mh-t { color: #facc15; } .rfh .mh-n span { text-shadow: 0 0 28px rgba(234,179,8,.9); }
.code.sm { font-size: .95rem; letter-spacing: 0; word-break: break-all; cursor: pointer; }
.logo { white-space: nowrap; }
@media (max-width: 440px) { .top { gap: 6px; padding: 10px 10px; } .logo { font-size: 1.02rem; gap: 4px; } .mepill { max-width: 36vw; padding: 5px 9px; font-size: .82rem; } .iconbtn { min-width: 36px; height: 36px; } .top .back { width: 36px; height: 36px; } }
.hero .hi { margin: 0 0 4px; color: #bbf7d0; font-size: 1.05rem; }

/* profile: gender + avatar */
.pstep { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin: 10px 0; }
.pstep > b { display: block; margin-bottom: 8px; font-size: 1.05rem; }
.gsel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gbtn { background: var(--card2); border: 2px solid var(--line); border-radius: 16px; padding: 12px; font-size: 2.2rem; display: flex; flex-direction: column; align-items: center; }
.gbtn span { font-size: 1rem; font-weight: 700; }
.gbtn.on { border-color: #22c55e; background: #052e16; transform: scale(1.03); }
.avgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avb { background: none; border: 3px solid transparent; border-radius: 50%; padding: 3px; display: flex; justify-content: center; transition: transform .15s; }
.avb.on { border-color: #22c55e; transform: scale(1.1); box-shadow: 0 0 18px rgba(34,197,94,.6); }
.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--ac) 55%, #fff), var(--ac)); width: 30px; height: 30px; font-size: 18px; vertical-align: middle; flex-shrink: 0; }
.av.sm { width: 22px; height: 22px; font-size: 13px; margin-right: 5px; }
.av.md { width: 34px; height: 34px; font-size: 20px; margin-right: 4px; }
.av.lg { width: 62px; height: 62px; font-size: 34px; }
.av.xl { width: 96px; height: 96px; font-size: 54px; box-shadow: 0 0 30px var(--ac); }
.mepill { display: inline-flex; align-items: center; }
.iconbtn.lang { font-weight: 800; font-size: .9rem; min-width: 44px; }
.reacts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 12px; }
.rbtn { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; font-size: 1.6rem; min-width: 52px; height: 52px; font-weight: 800; }
.rbtn:active { transform: scale(1.2); }
.react-big { font-size: 4.5rem; animation: mhpulse 1s ease-in-out infinite; }

/* idea / rating card */
.idea{display:flex;align-items:center;gap:12px;width:100%;margin:14px 0 4px;padding:14px;border:0;border-radius:18px;color:#fff;text-align:left;cursor:pointer;background:linear-gradient(120deg,#7c3aed,#db2777 55%,#f59e0b);box-shadow:0 8px 24px rgba(219,39,119,.35);animation:ideaGlow 3s ease-in-out infinite}
.idea .id-ic{font-size:2rem;animation:ideaBob 1.6s ease-in-out infinite}
.idea .id-t{flex:1;display:flex;flex-direction:column;gap:3px}.idea .id-t b{font-size:1.02rem}.idea .id-t small{opacity:.92;font-size:.8rem;line-height:1.3}
.idea .id-go{background:#fff;color:#db2777;font-weight:800;border-radius:999px;padding:7px 12px;font-size:.85rem;white-space:nowrap}
@keyframes ideaBob{0%,100%{transform:translateY(0) rotate(-8deg)}50%{transform:translateY(-5px) rotate(6deg)}}
@keyframes ideaGlow{0%,100%{box-shadow:0 8px 24px rgba(219,39,119,.35)}50%{box-shadow:0 8px 32px rgba(124,58,237,.55)}}
.stars{display:flex;justify-content:center;gap:6px;margin:8px 0}
.star{font-size:2.6rem;line-height:1;background:none;border:0;color:#cbd5e1;cursor:pointer;transition:transform .15s,color .15s}
.star.on{color:#f59e0b;transform:scale(1.12);text-shadow:0 0 14px rgba(245,158,11,.6)}
.rbar{display:flex;align-items:center;gap:8px;margin:5px 0}.rbar span{width:28px;font-weight:700}.rbar i{display:block;height:12px;border-radius:6px;background:linear-gradient(90deg,#f59e0b,#f97316);min-width:3px}.rbar b{font-size:.85rem}
.todo .row{padding:8px 0}
