@property --p {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

:root {
    --bg: #070713;
    --card: rgba(255, 255, 255, .055);
    --card2: rgba(255, 255, 255, .09);
    --border: rgba(255, 255, 255, .1);
    --text: #f3f3fb;
    --muted: #9b9db9;
    --a: #7c5cff;
    --b: #ff4d8d;
    --c: #22d3ee;
    --ok: #22c55e;
    --warn: #fbbf24;
    --err: #ef4444;
    --grad: linear-gradient(135deg, #7c5cff, #ff4d8d);
    --track: rgba(255, 255, 255, .1);
    --field: rgba(255, 255, 255, .05);
    --pop: #14142c;
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
    --r: 18px;
    --orb: .38;
}

:root[data-theme=light] {
    --bg: #f3f4fb;
    --card: rgba(255, 255, 255, .88);
    --card2: #fff;
    --border: rgba(30, 30, 80, .12);
    --text: #15152f;
    --muted: #5d6185;
    --track: rgba(30, 30, 80, .1);
    --field: rgba(30, 30, 80, .045);
    --pop: #fff;
    --shadow: 0 14px 40px rgba(60, 60, 130, .12);
    --orb: .2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(110px);
    opacity: var(--orb);
    pointer-events: none;
    animation: float 18s ease-in-out infinite alternate;
}

body::before {
    width: 560px;
    height: 560px;
    background: var(--a);
    top: -180px;
    left: -140px;
}

body::after {
    width: 520px;
    height: 520px;
    background: var(--b);
    bottom: -200px;
    right: -150px;
    animation-delay: -9s;
}

@keyframes float {
    to {
        transform: translate(70px, 40px) scale(1.12);
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@keyframes pulse {
    50% {
        opacity: .25;
    }
}

h1,
h2,
h3,
.logo,
.pin,
.stat b {
    font-family: 'Sora', 'Inter', sans-serif;
}

h1 {
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

h2 {
    font-size: 1.12rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h3 {
    font-size: 1rem;
    font-weight: 700;
}

.sub {
    color: var(--muted);
    margin: 4px 0 24px;
}

.hint {
    font-size: .82rem;
    color: var(--muted);
    margin-top: 8px;
}

.hint a {
    color: var(--c);
    cursor: pointer;
}

.muted,
small.muted {
    color: var(--muted);
}

.center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.nowrap {
    white-space: nowrap;
}

code {
    background: var(--field);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: .85em;
}

.ico {
    flex: none;
    vertical-align: middle;
}

/* layout */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px 70px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px clamp(16px, 3vw, 32px);
    background: var(--card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
}

.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--grad);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 8px 20px rgba(124, 92, 255, .4);
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: .9rem;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
    display: grid;
    place-items: center;
    flex: none;
}

.avatar.sm {
    width: 32px;
    height: 32px;
    font-size: .72rem;
}

.who-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-head {
    margin-bottom: 6px;
}

.app {
    display: grid;
    grid-template-columns: 256px 1fr;
    min-height: 100vh;
}

.side {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--card);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
}

.side-nav {
    display: grid;
    gap: 4px;
}

.side-nav button,
.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    transition: .2s;
    white-space: nowrap;
}

.side-nav button:hover,
.side-nav a:hover {
    background: var(--card2);
    color: var(--text);
}

.side-nav button.active {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 8px 22px rgba(124, 92, 255, .35);
}

.side-nav a.live-link {
    margin-top: 8px;
    border: 1px dashed var(--border);
    color: var(--c);
}

.side-foot {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.side-foot .who {
    display: flex;
    gap: 10px;
    align-items: center;
}

.side-foot small {
    color: var(--muted);
    display: block;
}

.row-btns {
    display: flex;
    gap: 8px;
}

.main {
    padding: 32px clamp(16px, 3vw, 40px) 70px;
    min-width: 0;
    animation: pop .4s ease;
}

@media (max-width:900px) {
    .app {
        grid-template-columns: 1fr;
    }

    .side {
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .side-nav {
        display: flex;
        overflow-x: auto;
        order: 3;
        width: 100%;
    }

    .side-foot {
        margin: 0 0 0 auto;
        display: flex;
        align-items: center;
    }

    .side-foot .who div {
        display: none;
    }
}

/* cards, buttons, forms */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 24px;
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    animation: pop .35s ease both;
}

.card.hover {
    transition: .25s;
}

.card.hover:hover {
    transform: translateY(-5px);
    border-color: var(--a);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--grad);
    cursor: pointer;
    transition: .2s;
    box-shadow: 0 8px 24px rgba(124, 92, 255, .35);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn:active {
    transform: none;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.btn.full {
    width: 100%;
    margin-top: 18px;
}

.btn.sm {
    padding: 8px 14px;
    font-size: .84rem;
    border-radius: 10px;
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
    color: var(--text);
}

.btn.ghost:hover {
    background: var(--card2);
}

.btn.danger {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 8px 24px rgba(239, 68, 68, .3);
}

.btn.ok {
    background: linear-gradient(135deg, #16a34a, #22d3ee);
    box-shadow: 0 8px 24px rgba(34, 197, 94, .3);
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: .2s;
    flex: none;
}

.icon-btn:hover {
    background: var(--card2);
}

.icon-btn.danger:hover {
    color: var(--err);
    border-color: var(--err);
}

label {
    display: block;
    font-size: .74rem;
    font-weight: 700;
    color: var(--muted);
    margin: 16px 0 6px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--field);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: .2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--a);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .2);
}

select option {
    background: var(--pop);
    color: var(--text);
}

textarea {
    resize: vertical;
    min-height: 76px;
}

input[type=radio],
input[type=checkbox] {
    width: 20px;
    height: 20px;
    accent-color: var(--a);
    flex: none;
    padding: 0;
}

input[type=file] {
    padding: 9px;
}

.row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.row3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width:640px) {

    .row2,
    .row3 {
        grid-template-columns: 1fr;
    }
}

.optrow {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar input,
.toolbar select {
    width: auto;
    flex: 1;
    min-width: 150px;
}

.tbtns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.imgprev {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

.imgprev img {
    max-height: 130px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
}

.imgprev button {
    position: absolute;
    top: -8px;
    right: -8px;
}

.tabs {
    display: flex;
    background: var(--field);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 10px;
    gap: 4px;
}

.tabs button {
    flex: 1;
    padding: 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: .2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tabs button.active {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 6px 16px rgba(124, 92, 255, .35);
}

.tabs.main {
    margin: 0 0 24px;
    max-width: 420px;
    overflow-x: auto;
}

/* stats, tables, chips */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.stat-ico {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--grad);
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
    box-shadow: 0 8px 20px rgba(124, 92, 255, .35);
}

.stat b {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat span {
    color: var(--muted);
    font-size: .82rem;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (max-width:1000px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

.stack,
.grid2 {
    display: grid;
    gap: 24px;
}

.grid2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

th {
    text-align: left;
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 10px 12px;
    white-space: nowrap;
}

td {
    padding: 13px 12px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

tr:hover td {
    background: var(--field);
}

.pill {
    padding: 5px 12px;
    border-radius: 99px;
    font-weight: 700;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.pill.hi {
    background: rgba(34, 197, 94, .17);
    color: #22c55e;
}

.pill.mid {
    background: rgba(251, 191, 36, .17);
    color: #d99a06;
}

.pill.lo {
    background: rgba(239, 68, 68, .17);
    color: #ef4444;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--field);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    margin: 0 6px 4px 0;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 36px 10px;
}

.live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    color: #22c55e;
    font-weight: 700;
}

.live::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 1.4s infinite;
}

.hbar {
    display: grid;
    grid-template-columns: minmax(90px, 170px) 1fr 50px;
    gap: 12px;
    align-items: center;
    margin: 10px 0;
    font-size: .9rem;
}

.hbar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbar b {
    text-align: right;
}

.track {
    height: 10px;
    background: var(--track);
    border-radius: 99px;
    overflow: hidden;
}

.track div {
    height: 100%;
    border-radius: 99px;
    transition: width .8s;
}

.track .hi {
    background: var(--ok);
}

.track .mid {
    background: var(--warn);
}

.track .lo {
    background: var(--err);
}

.bars {
    display: flex;
    gap: 8px;
    height: 210px;
}

.bars .col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.bars .wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bars .b {
    width: 70%;
    max-width: 42px;
    background: var(--grad);
    border-radius: 8px 8px 0 0;
    min-height: 3px;
}

.bars small {
    font-size: .7rem;
    color: var(--muted);
    margin-top: 4px;
}

.skeleton {
    height: 90px;
    border-radius: var(--r);
    background: linear-gradient(90deg, var(--field) 25%, var(--card2) 50%, var(--field) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

/* classes, assignments, question bank */
.class-card {
    display: grid;
    gap: 16px;
}

.cc-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.code-box {
    padding: 14px;
    border-radius: 14px;
    border: 1px dashed var(--a);
    background: rgba(124, 92, 255, .08);
    display: grid;
    gap: 8px;
}

.code-box small {
    font-size: .7rem;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 700;
}

.code {
    font-family: 'Sora', monospace;
    font-size: 2rem;
    letter-spacing: .18em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qitem {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 12px;
    background: var(--field);
}

.qitem h4 {
    margin: 10px 0;
    font-size: 1rem;
    line-height: 1.4;
}

.qopts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 10px 0;
    font-size: .88rem;
}

@media (max-width:600px) {
    .qopts {
        grid-template-columns: 1fr;
    }
}

.qopts span {
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--field);
}

.qopts span.right {
    background: rgba(34, 197, 94, .18);
    color: #22c55e;
    font-weight: 600;
}

.expl {
    font-size: .85rem;
    color: var(--muted);
    border-left: 3px solid var(--c);
    padding-left: 10px;
    margin: 8px 0;
}

.qbtns {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.imp-errs {
    max-height: 130px;
    overflow: auto;
    font-size: .8rem;
    color: #f87171;
    margin-top: 8px;
}

.qimg {
    max-width: 100%;
    max-height: 260px;
    border-radius: 14px;
    display: block;
    margin: 0 auto 16px;
    border: 1px solid var(--border);
}

.qimg.sm {
    max-height: 140px;
    margin: 8px 0;
}

/* student: quiz cards */
.subject {
    margin: 30px 0 14px;
    font-size: .85rem;
    font-weight: 800;
    color: var(--c);
    text-transform: uppercase;
    letter-spacing: .1em;
}

.classhead {
    margin: 36px 0 6px;
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}

.qcard-t h3 {
    margin-bottom: 6px;
}

.qcard-t p {
    color: var(--muted);
    font-size: .85rem;
    margin: 10px 0 16px;
    line-height: 1.7;
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 99px;
    background: var(--field);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: .85rem;
}

.chip button {
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
    display: grid;
}

.rules {
    list-style: none;
    margin: 16px 0;
    display: grid;
    gap: 10px;
}

.rules li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .92rem;
    color: var(--muted);
}

.rules .ico {
    color: var(--c);
    margin-top: 2px;
}

/* quiz */
.quiz {
    max-width: 740px;
    margin: 0 auto;
}

.qtop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    color: var(--muted);
    font-weight: 600;
}

.bar {
    height: 8px;
    background: var(--track);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 16px;
}

.bar div {
    height: 100%;
    background: var(--grad);
    width: 0;
    transition: width .5s;
    border-radius: 99px;
}

.guard {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: .8rem;
    padding: 8px;
    border-radius: 10px;
    background: rgba(251, 191, 36, .12);
    color: var(--warn);
    margin-bottom: 16px;
    font-weight: 600;
}

.timer {
    position: relative;
    width: 104px;
    height: 104px;
    margin: 0 auto 18px;
}

.timer svg {
    transform: rotate(-90deg);
}

.timer circle {
    fill: none;
    stroke-width: 8;
}

.timer .bg {
    stroke: var(--track);
}

.timer .fg {
    stroke-linecap: round;
    transition: stroke .3s;
}

.timer .fg.danger {
    stroke: var(--err);
}

.timer b {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
}

.qtext {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 22px;
    line-height: 1.45;
}

.opts {
    display: grid;
    gap: 12px;
}

.opts.tf {
    grid-template-columns: 1fr 1fr;
}

.opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: .18s;
}

.opt:hover:not(:disabled) {
    border-color: var(--a);
    background: rgba(124, 92, 255, .14);
    transform: translateX(4px);
}

.opt b {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--card2);
    display: grid;
    place-items: center;
    flex: none;
    font-family: 'Sora', sans-serif;
}

.opt .tick {
    margin-left: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex: none;
    opacity: .6;
}

.opt.sel {
    border-color: var(--a);
    background: rgba(124, 92, 255, .2);
}

.opt.sel .tick {
    background: var(--a);
    border-color: var(--a);
    opacity: 1;
}

.opt.correct {
    background: rgba(34, 197, 94, .2);
    border-color: var(--ok);
}

.opt.correct .tick {
    background: var(--ok);
    border-color: var(--ok);
    opacity: 1;
}

.opt.wrong {
    background: rgba(239, 68, 68, .18);
    border-color: var(--err);
    animation: shake .4s;
}

.opt:disabled {
    cursor: default;
    transform: none;
}

@keyframes shake {
    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

.fillbox {
    display: flex;
    gap: 10px;
}

.fillbox input {
    font-size: 1.1rem;
    padding: 14px;
}

.fillans {
    text-align: center;
    margin-top: 14px;
    color: var(--ok);
}

.feedback {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    animation: pop .25s;
}

.feedback span {
    display: block;
    font-size: .88rem;
    opacity: .9;
}

.feedback.ok {
    background: rgba(34, 197, 94, .15);
    color: #22c55e;
}

.feedback.bad {
    background: rgba(239, 68, 68, .14);
    color: #ef4444;
}

/* result + report */
.result {
    text-align: center;
    max-width: 560px;
    margin: 30px auto;
}

.result .emoji {
    font-size: 3.2rem;
}

.ring {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 20px auto;
    display: grid;
    place-items: center;
    transition: --p 1.3s cubic-bezier(.2, .8, .2, 1);
    background: conic-gradient(var(--a), var(--b) calc(var(--p) * 1%), var(--track) 0);
}

.ring div {
    width: 162px;
    height: 162px;
    border-radius: 50%;
    background: var(--pop);
    display: grid;
    place-items: center;
    font-size: 2.7rem;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
}

.report h3 {
    margin: 24px 0 14px;
    font-size: 1.05rem;
}

.rstats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin: 16px 0 8px;
}

.rstats div {
    background: var(--field);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.rstats b {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
}

.rstats span {
    font-size: .74rem;
    color: var(--muted);
}

.warnbox {
    display: flex;
    gap: 12px;
    margin: 14px 0;
    padding: 14px;
    border-radius: 14px;
    background: rgba(251, 191, 36, .12);
    color: var(--warn);
    font-size: .9rem;
}

.evlist {
    margin-top: 8px;
}

.mistake {
    border: 1px solid rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .06);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}

.mnum {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #f87171;
    font-weight: 700;
}

.mistake h4 {
    margin: 8px 0 12px;
    line-height: 1.4;
}

.ans,
.explain {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 13px;
    border-radius: 10px;
    margin-top: 8px;
    font-size: .92rem;
}

.ans.bad {
    background: rgba(239, 68, 68, .14);
    color: #f87171;
}

.ans.good {
    background: rgba(34, 197, 94, .14);
    color: #22c55e;
}

.explain {
    background: rgba(34, 211, 238, .1);
    border-left: 3px solid var(--c);
    line-height: 1.5;
    margin-top: 10px;
}

.perfect {
    padding: 30px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    background: rgba(34, 197, 94, .1);
    border-radius: 14px;
    margin-top: 20px;
    color: #22c55e;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

details {
    margin-top: 20px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--c);
}

.goodlist {
    margin: 12px 0 0 20px;
    font-size: .9rem;
    line-height: 1.7;
    color: var(--muted);
}

.delta-up {
    color: #22c55e;
    font-weight: 700;
}

.delta-down {
    color: #ef4444;
    font-weight: 700;
}

/* leaderboard */
.lb {
    display: grid;
    grid-template-columns: 42px 1fr auto 70px;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: var(--field);
}

.lb.me {
    border: 1px solid var(--a);
    background: rgba(124, 92, 255, .15);
}

.lb .pos {
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
}

.lb .nm {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb .tm {
    color: var(--muted);
    font-size: .85rem;
    text-align: right;
}

/* modal + toast */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 15, .75);
    backdrop-filter: blur(7px);
    display: grid;
    place-items: start center;
    overflow: auto;
    padding: 30px 16px;
    z-index: 50;
    animation: pop .2s;
}

.modal-card {
    width: 100%;
    max-width: 840px;
    background: var(--pop);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: min(420px, calc(100vw - 32px));
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--pop);
    border: 1px solid var(--border);
    font-weight: 600;
    transform: translateY(20px);
    opacity: 0;
    transition: .3s;
    z-index: 99;
    box-shadow: var(--shadow);
}

.toast.show {
    transform: none;
    opacity: 1;
}

.toast.err {
    border-color: var(--err);
}

.toast.err .ico {
    color: var(--err);
}

.toast.ok .ico {
    color: var(--ok);
}

.toast.info .ico {
    color: var(--c);
}

.confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
}

/* auth page */
.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

@media (max-width:860px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .hero {
        display: none;
    }
}

.hero h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    line-height: 1.1;
    margin: 22px 0 14px;
}

.hero h1 span {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 460px;
}

.features {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.feature {
    display: flex;
    gap: 14px;
    align-items: center;
    font-weight: 600;
}

.feature .stat-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

/* live */
.live-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 20px 60px;
    text-align: center;
}

.pin {
    font-size: clamp(3rem, 10vw, 5.5rem);
    font-weight: 800;
    letter-spacing: .12em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 8px 0;
}

.players {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 24px 0;
    min-height: 48px;
}

.players .chip {
    animation: pop .3s;
}

.live-scope .opt {
    border-width: 0;
    color: #fff;
    min-height: 74px;
    font-weight: 700;
}

.live-scope .opt b {
    background: rgba(255, 255, 255, .22);
}

.live-scope .opt.c0 {
    background: linear-gradient(135deg, #7c5cff, #5b3df5);
}

.live-scope .opt.c1 {
    background: linear-gradient(135deg, #ff4d8d, #e11d74);
}

.live-scope .opt.c2 {
    background: linear-gradient(135deg, #22d3ee, #0891b2);
}

.live-scope .opt.c3 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.live-scope .opts {
    grid-template-columns: 1fr 1fr;
}

@media (max-width:560px) {
    .live-scope .opts {
        grid-template-columns: 1fr;
    }
}

.live-scope .opt.sel {
    outline: 4px solid #fff;
}

.live-scope .opt.dim {
    opacity: .3;
}

.live-scope .opt.correct {
    outline: 4px solid var(--ok);
    box-shadow: 0 0 30px rgba(34, 197, 94, .5);
}

.live-scope .opt.wrong {
    opacity: .45;
}

.big-result {
    font-size: 4rem;
    margin: 6px 0;
}

.pts {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
}

.podium {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: center;
    margin: 26px 0;
}

.podium div {
    flex: 1;
    max-width: 170px;
    border-radius: 16px 16px 0 0;
    padding: 14px 8px;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
}

.podium .p1 {
    height: 190px;
}

.podium .p2 {
    height: 150px;
    opacity: .85;
}

.podium .p3 {
    height: 120px;
    opacity: .7;
}

.podium small {
    display: block;
    font-weight: 500;
}

.podium .medal {
    font-size: 2rem;
}

.dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 3px;
    border-radius: 50%;
    background: var(--a);
    animation: pulse 1.2s infinite;
}

.dots span:nth-child(2) {
    animation-delay: .2s;
}

.dots span:nth-child(3) {
    animation-delay: .4s;
}

.hostbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    color: var(--muted);
    font-weight: 600;
}

@media print {
    body {
        background: #fff !important;
    }

    body::before,
    body::after {
        display: none;
    }

    body>*:not(#modal) {
        display: none !important;
    }

    #modal {
        position: static;
        background: #fff;
        padding: 0;
        display: block;
    }

    .modal-card {
        background: #fff;
        border: 0;
        padding: 0;
        max-width: none;
        box-shadow: none;
    }

    .modal-actions {
        display: none;
    }

    .report,
    .report * {
        color: #111 !important;
        background: transparent !important;
    }

    .mistake,
    .rstats div,
    .ans,
    .explain {
        border: 1px solid #999 !important;
        break-inside: avoid;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== Stage 1: avatars + profile ===== */
.av2 {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    flex: none;
    overflow: hidden;
    width: 38px;
    height: 38px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25)
}

.av2.sm {
    width: 32px;
    height: 32px
}

.av2.lg {
    width: 104px;
    height: 104px
}

.av2 svg {
    width: 82%;
    height: 82%
}

.avatar.lg {
    width: 104px;
    height: 104px;
    font-size: 2rem
}

.lb .nm {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0
}

.lb .nm span:last-child {
    overflow: hidden;
    text-overflow: ellipsis
}

.prof-head {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 6px
}

.pgroup {
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 14px 0 6px
}

.pgrid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px
}

@media(max-width:560px) {
    .pgrid {
        grid-template-columns: repeat(4, 1fr)
    }
}

.pick {
    aspect-ratio: 1;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--field);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 6px;
    transition: .15s
}

.pick svg {
    width: 100%;
    height: 100%
}

.pick:hover {
    border-color: var(--a)
}

.pick.sel {
    border-color: var(--a);
    background: rgba(124, 92, 255, .2)
}

.crow {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.cpick {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer
}

.cpick.sel {
    border-color: var(--text)
}

.linkbtn {
    background: none;
    border: 0;
    color: var(--c);
    cursor: pointer;
    font: inherit;
    font-weight: 600
}

/* ===== Stage 2: short answers ===== */
.sp-row {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    margin-bottom: 12px;
    display: grid;
    gap: 8px
}

.sp-top {
    display: flex;
    align-items: center;
    gap: 12px
}

.sp-top b {
    flex: 1
}

.sp-m {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .85rem
}

.sp-m input {
    width: 84px
}

.sp-test {
    margin-top: 18px;
    padding-top: 6px;
    border-top: 1px solid var(--border)
}

.sp-res {
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    background: var(--field)
}

.hits {
    list-style: none;
    margin: 8px 0 0;
    display: grid;
    gap: 4px;
    font-size: .9rem
}

.hits li.h {
    color: #22c55e
}

.hits li.m {
    color: #ef4444
}

.shortin {
    min-height: 130px;
    font-size: 1.05rem
}

.markbox {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--field);
    font-size: .92rem
}

.tcomment {
    margin-top: 8px;
    padding: 8px 12px;
    border-left: 3px solid var(--c);
    background: rgba(34, 211, 238, .1);
    border-radius: 8px
}

.rv-ans {
    padding: 12px;
    border-radius: 10px;
    background: var(--field);
    margin: 8px 0;
    white-space: pre-wrap;
    word-break: break-word
}

.rv-set {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 10px
}

.rv-set input {
    min-width: 110px
}

/* fix: date/time fields overflowing the card */
.row2,
.row3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.row3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row2>*,
.row3>* {
    min-width: 0;
}

input[type=datetime-local],
input[type=date],
input[type=time] {
    min-width: 0;
    max-width: 100%;
    font-size: .92rem;
    padding-left: 10px;
    padding-right: 10px;
}

@media (max-width: 640px) {

    .row2,
    .row3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

#aForm .row2:has(input[type=datetime-local]) {
    grid-template-columns: minmax(0, 1fr);
}

/* show/hide password button */
.pw-wrap {
    position: relative;
    display: block;
}

.pw-wrap input {
    padding-right: 48px;
}

.pw-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    z-index: 2;
}

.pw-eye:hover {
    color: var(--text);
    background: var(--card2);
}

.pw-eye:focus-visible {
    outline: 2px solid var(--a);
    outline-offset: 1px;
}

/* ===== Student home v2 ===== */
.container.wide {
    max-width: 1240px;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.home-side {
    display: grid;
    gap: 20px;
    position: sticky;
    top: 90px;
}

@media (max-width: 1050px) {
    .home-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-side {
        position: static;
    }
}

.home-tools {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 26px 0 4px;
}

.searchbox {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 340px;
}

.searchbox .ico {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.searchbox input {
    padding-left: 40px;
}

.filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fchip {
    padding: 8px 14px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--field);
    color: var(--muted);
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.fchip b {
    margin-left: 4px;
    opacity: .8;
}

.fchip:hover {
    color: var(--text);
}

.fchip.active {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(124, 92, 255, .35);
}

.clsgroup {
    margin-top: 0;
}

.clsgroup>summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px 0 4px;
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    list-style: none;
    cursor: pointer;
}

.clsgroup>summary::-webkit-details-marker {
    display: none;
}

.clsgroup>summary small {
    margin-left: auto;
    font-family: 'Inter', sans-serif;
    font-size: .8rem;
    font-weight: 600;
}

.clsgroup>summary::after {
    content: '';
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: .2s;
    margin: 0 4px 3px 8px;
}

.clsgroup[open]>summary::after {
    transform: rotate(-135deg);
    margin-bottom: -2px;
}

.subject {
    margin: 18px 0 12px;
    font-size: .8rem;
}

:root[data-theme=light] .subject {
    color: #0e7490;
}

.qgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.qcard {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.qcard.can {
    cursor: pointer;
}

.qc-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.qc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    color: var(--muted);
    font-size: .84rem;
}

.qc-meta .ico {
    margin-right: 2px;
}

.qc-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 6px;
}

.due {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 700;
    background: var(--field);
    color: var(--muted);
}

.due.warn {
    background: rgba(251, 191, 36, .18);
    color: #c98a06;
}

:root:not([data-theme=light]) .due.warn {
    color: #fbbf24;
}

.due.past {
    opacity: .8;
}

.chipico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: none;
}

.chipico.g {
    background: rgba(34, 197, 94, .16);
    color: #22c55e;
}

.chipico.p {
    background: rgba(124, 92, 255, .16);
    color: #7c5cff;
}

.chipico.y {
    background: rgba(251, 191, 36, .18);
    color: #d99a06;
}

:root:not([data-theme=light]) .chipico.p {
    color: #b3a6ff;
}

.wk-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: .92rem;
}

.wk-row small {
    font-size: .8rem;
}

.dl-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 6px;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: .2s;
}

.dl-row:first-child {
    border-top: 0;
}

.dl-row:hover {
    background: var(--field);
}

.dl-t {
    flex: 1;
    min-width: 0;
    display: grid;
}

.dl-t b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dl-t small {
    font-size: .8rem;
}

/* pill theme switch (same as login page) */
.pill-switch {
    position: relative;
    display: block;
    width: 70px;
    height: 38px;
    padding: 0;
    border-radius: 99px;
    cursor: pointer;
    flex: none;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: border-color .2s;
}

.pill-switch:hover {
    border-color: var(--a);
}

.pill-switch .ps {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    display: grid;
}

.ps-sun {
    left: 10px;
}

.ps-moon {
    right: 10px;
}

.ps-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--grad);
    box-shadow: 0 4px 12px rgba(124, 92, 255, .45);
    transform: translateX(32px);
    transition: transform .3s cubic-bezier(.4, .1, .2, 1);
}

:root[data-theme=light] .ps-knob {
    transform: translateX(0);
}

/* glass + focus on the student pages */
body.sh button:focus-visible,
body.sh summary:focus-visible,
body.sh .fchip:focus-visible {
    outline: 2px solid var(--a);
    outline-offset: 2px;
}

:root[data-theme=light] body.sh .card {
    background: rgba(255, 255, 255, .62);
    border-color: rgba(255, 255, 255, .9);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
}

:root[data-theme=light] body.sh::before {
    opacity: .3;
}

:root[data-theme=light] body.sh::after {
    opacity: .32;
}

/* ===== Home toolbar inside the first class heading ===== */
#toolsPark .home-tools {
    margin: 20px 0 0;
}

.cls-head {
    display: flex;
    align-items: center;
    gap: 12px 20px;
    flex-wrap: wrap;
    margin: 30px 0 4px;
}

.cls-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    border-radius: 8px;
}

.cls-toggle small {
    font-family: 'Inter', sans-serif;
    font-size: .8rem;
    font-weight: 600;
}

.cls-toggle .chev {
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-135deg);
    margin: 4px 0 0 4px;
    transition: .2s;
}

.cls-toggle[aria-expanded=false] .chev {
    transform: rotate(45deg);
    margin-top: -2px;
}

.cls-toggle:focus-visible {
    outline: 2px solid var(--a);
    outline-offset: 2px;
}

.cls-slot {
    margin-left: auto;
}

.cls-slot .home-tools {
    margin: 0;
    flex-wrap: nowrap;
    gap: 10px;
}

.cls-slot .searchbox {
    width: 220px;
    min-width: 150px;
    flex: none;
}

.cls-slot .searchbox input {
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: .9rem;
}

.cls-slot .fchip {
    padding: 7px 12px;
    font-size: .82rem;
}

.cls-body[hidden] {
    display: none;
}

@media (max-width: 760px) {
    .cls-slot {
        margin-left: 0;
        width: 100%;
    }

    .cls-slot .home-tools {
        flex-wrap: wrap;
    }

    .cls-slot .searchbox {
        width: 100%;
        flex: 1 1 100%;
    }
}

:root {
    --glass: rgba(255, 255, 255, .06);
    --glass-line: rgba(255, 255, 255, .16);
    --glass-hi: rgba(255, 255, 255, .28);
    --glass-shadow: 0 18px 50px rgba(0, 0, 0, .38);
}

:root[data-theme=light] {
    --glass: rgba(255, 255, 255, .58);
    --glass-line: rgba(255, 255, 255, .95);
    --glass-hi: rgba(255, 255, 255, 1);
    --glass-shadow: 0 16px 44px rgba(90, 70, 180, .14), 0 0 0 1px rgba(124, 92, 255, .07);
}

/* glass cards */
body:not(.login) .card,
body:not(.login) .modal-card,
body:not(.login) .toast {
    background: var(--glass);
    border: 1px solid var(--glass-line);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
}

body:not(.login) .modal-card {
    background: color-mix(in srgb, var(--pop) 78%, transparent);
    backdrop-filter: blur(26px) saturate(1.5);
    -webkit-backdrop-filter: blur(26px) saturate(1.5);
}

body:not(.login) .toast {
    background: color-mix(in srgb, var(--pop) 85%, transparent);
}

/* glass bars (top bar on student pages, sidebar on the teacher dashboard) */
body:not(.login) .topbar,
body:not(.login) .side {
    background: var(--glass);
    border-color: var(--glass-line);
    backdrop-filter: blur(22px) saturate(1.5);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
}

/* inputs inside glass stay legible */
:root[data-theme=light] body:not(.login) .card input,
:root[data-theme=light] body:not(.login) .card select,
:root[data-theme=light] body:not(.login) .card textarea {
    background: rgba(255, 255, 255, .65);
}

:root:not([data-theme=light]) body:not(.login) .card input,
:root:not([data-theme=light]) body:not(.login) .card select,
:root:not([data-theme=light]) body:not(.login) .card textarea {
    background: rgba(0, 0, 0, .25);
}

/* phones: smaller orbs and lighter blur so cheap devices don't lag */
@media (max-width: 700px) {
    body:not(.login) .card {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

/* ===== Dashboard background = login background recipe (login page untouched) ===== */
body:not(.login) {
    --bg-o1: rgba(124, 92, 255, .55);
    --bg-o2: rgba(255, 77, 141, .42);
    --bg-o3: rgba(99, 102, 241, .45);
}

:root[data-theme=light] body:not(.login) {
    --bg-o1: rgba(139, 92, 246, .5);
    --bg-o2: rgba(255, 122, 184, .6);
    --bg-o3: rgba(129, 140, 248, .5);
}

body:not(.login)::before,
body:not(.login)::after,
html:not(:has(body.login))::before {
    content: '';
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(90px);
    animation: lpfloat2 24s ease-in-out infinite alternate;
}

body:not(.login)::before {
    width: 600px;
    height: 600px;
    top: -140px;
    right: -100px;
    left: auto;
    bottom: auto;
    background: var(--bg-o1);
}

/* purple, top-right */
body:not(.login)::after {
    width: 520px;
    height: 520px;
    top: 32%;
    left: -170px;
    right: auto;
    bottom: auto;
    background: var(--bg-o2);
    animation-delay: -8s;
}

/* pink, mid-left */
html:not(:has(body.login))::before {
    width: 560px;
    height: 560px;
    bottom: -230px;
    left: 38%;
    top: auto;
    right: auto;
    background: var(--bg-o3);
    animation-delay: -15s;
}

/* blue-lilac, bottom */

@keyframes lpfloat2 {
    to {
        transform: translate(40px, 30px) scale(1.08);
    }
}

@media (max-width: 700px) {

    body:not(.login)::before,
    body:not(.login)::after,
    html:not(:has(body.login))::before {
        filter: blur(65px);
        width: 340px;
        height: 340px;
    }
}

@media (prefers-reduced-motion: reduce) {

    body:not(.login)::before,
    body:not(.login)::after,
    html:not(:has(body.login))::before {
        animation: none !important;
    }
}

/* ===== Background tuning (light mode stronger, glass more see-through) ===== */
:root[data-theme=light] body:not(.login) {
    --bg-o1: rgba(139, 92, 246, .62);
    --bg-o2: rgba(255, 122, 184, .72);
    --bg-o3: rgba(129, 140, 248, .62);
}

:root[data-theme=light] {
    --glass: rgba(255, 255, 255, .46);
}

body:not(.login)::before {
    top: -100px;
    right: 4%;
}

body:not(.login)::after {
    top: 40%;
    left: -80px;
}

html:not(:has(body.login))::before {
    bottom: -150px;
    left: 30%;
    width: 640px;
    height: 640px;
}

.bgorb {
    position: fixed;
    z-index: -1;
    width: 640px;
    height: 640px;
    border-radius: 50%;
    pointer-events: none;
    bottom: -160px;
    left: 30%;
    background: var(--bg-o3);
    filter: blur(90px);
    animation: lpfloat2 24s ease-in-out infinite alternate;
    animation-delay: -15s;
}

body.login .bgorb {
    display: none;
}

@media (max-width: 700px) {
    .bgorb {
        width: 340px;
        height: 340px;
        filter: blur(65px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bgorb {
        animation: none;
    }
}