:root {
  --bg: #f3f0ff; --bg2: #e9f4ff; --card: #ffffff; --ink: #2b2240; --muted: #7a7194; --line: #e7e2f5;
  --pri: #6c4cf5; --pri2: #8b6bff; --pri-ink: #fff; --gold: #ffb703; --gold2: #ff9500;
  --pos: #22c55e; --pos2: #16a34a; --neg: #ff4d6d; --neg2: #e11d48;
  --shadow: 0 8px 24px rgba(60, 40, 140, .10), 0 2px 6px rgba(60, 40, 140, .06);
  --shadow-lg: 0 24px 60px rgba(40, 20, 110, .22);
  --r: 22px; --font: 'Nunito', system-ui, sans-serif; --fun: 'Fredoka', 'Nunito', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: radial-gradient(1200px 600px at 10% -10%, #e6ddff 0, transparent 60%), radial-gradient(900px 500px at 110% 10%, #d8f0ff 0, transparent 55%), var(--bg); background-attachment: fixed; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: var(--ink); }
h1, h2, h3 { font-family: var(--fun); margin: 0; letter-spacing: .2px; }
h2 { font-size: 24px; margin-bottom: 10px; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.end { justify-content: flex-end; } .row.center { justify-content: center; } .row.wrap { flex-wrap: wrap; } .gap { gap: 10px; }
.stack { display: grid; gap: 10px; }
.center { text-align: center; }
.ic { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 14px; font-weight: 800; background: #fff; box-shadow: inset 0 0 0 2px var(--line); transition: transform .12s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: linear-gradient(180deg, var(--pri2), var(--pri)); color: #fff; box-shadow: 0 4px 0 #4b2fc9, 0 8px 18px rgba(108, 76, 245, .35); }
.btn.primary:active { box-shadow: 0 2px 0 #4b2fc9; }
.btn.gold { background: linear-gradient(180deg, #ffd23f, var(--gold)); color: #4a2a00; box-shadow: 0 4px 0 #d98a00, 0 8px 18px rgba(255, 170, 0, .35); }
.btn.danger { background: linear-gradient(180deg, #ff6b81, var(--neg2)); color: #fff; box-shadow: 0 4px 0 #b3123a; }
.btn.ghost { background: rgba(255, 255, 255, .7); }
.btn.ghost.light { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); }
.btn.lg { padding: 15px 26px; font-size: 18px; border-radius: 18px; }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }
.danger-t { color: var(--neg2) !important; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; transition: background .2s, transform .12s; }
.icon-btn:hover { background: rgba(108, 76, 245, .08); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.light { color: #fff; }
.icon-btn.light:hover { background: rgba(255, 255, 255, .18); }
.link { color: var(--pri); font-weight: 800; margin-top: 10px; }
.chip { padding: 4px 10px; border-radius: 99px; font-weight: 800; font-size: 13px; }
.chip.present { background: #dcfce7; color: #15803d; } .chip.absent { background: #ffe4e6; color: #be123c; } .chip.late { background: #fef3c7; color: #b45309; }
.chip-btn { padding: 8px 14px; border-radius: 99px; background: #f1edff; font-weight: 800; color: var(--pri); transition: .15s; }
.chip-btn:hover, .chip-btn.on { background: var(--pri); color: #fff; }

/* forms */
label { display: grid; gap: 6px; font-weight: 800; font-size: 14px; color: #4a4163; margin-bottom: 12px; }
.lbl { font-weight: 800; font-size: 14px; color: #4a4163; margin: 4px 0 8px; }
input:not([type=checkbox]):not([type=radio]), textarea, select { width: 100%; padding: 13px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fbfaff; outline: none; transition: border .2s, box-shadow .2s; font-weight: 600; }
input:focus, textarea:focus, select:focus { border-color: var(--pri2); box-shadow: 0 0 0 4px rgba(139, 107, 255, .18); }
textarea { resize: vertical; min-height: 150px; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 12px 0; }
.check-row input { width: 20px; height: 20px; accent-color: var(--pri); }
.check-row.center { justify-content: center; }
.err { color: var(--neg2); font-weight: 800; min-height: 20px; margin-bottom: 6px; font-size: 14px; }
.seg { display: flex; background: #efeaff; padding: 5px; border-radius: 16px; gap: 4px; margin-bottom: 16px; }
.seg button { flex: 1; padding: 10px 12px; border-radius: 12px; font-weight: 800; color: var(--muted); transition: .2s; }
.seg button.on { background: #fff; color: var(--pri); box-shadow: 0 3px 10px rgba(80, 50, 180, .12); }

/* avatars */
.av { display: block; width: 100%; height: 100%; }
.av-img { position: relative; }
.av-img img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 6px 6px rgba(40, 20, 80, .18)); user-select: none; -webkit-user-drag: none; transform-origin: 50% 90%; }
.av-img.mood-n img { animation: breathe 3.4s ease-in-out infinite; animation-delay: var(--dl, 0s); }
.av-img.mood-happy img { animation: happyJump .7s cubic-bezier(.3, 1.6, .5, 1) 3; }
.av-img.mood-sad img { animation: sadDroop 2.4s ease forwards; }
.av-img .tear { position: absolute; right: 30%; top: 30%; width: 12%; aspect-ratio: .75; background: radial-gradient(circle at 35% 35%, #fff 0 15%, #8fd3ff 35%, #3b9ae8 100%); border-radius: 50% 50% 50% 50% / 62% 62% 40% 40%; transform: rotate(180deg); animation: tear 1.4s ease-in infinite; box-shadow: 0 2px 4px rgba(0, 60, 140, .25); }
.av-img .spark { position: absolute; width: 18%; aspect-ratio: 1; background: radial-gradient(circle, #fff 0 18%, #ffe066 30%, transparent 62%); animation: spark 1s ease-out infinite; }
.av-img .spark.s1 { left: 6%; top: 12%; } .av-img .spark.s2 { right: 4%; top: 26%; animation-delay: .3s; } .av-img .spark.s3 { left: 20%; top: 52%; animation-delay: .6s; width: 12%; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, .985) translateY(1%); } }
@keyframes happyJump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14%) scale(1.04, .96) rotate(-4deg); } 60% { transform: translateY(0) scale(1.08, .92); } 80% { transform: scale(.98, 1.03) rotate(3deg); } 100% { transform: none; } }
@keyframes sadDroop { 0% { transform: none; filter: drop-shadow(0 6px 6px rgba(40, 20, 80, .18)); } 15% { transform: translateX(-4%) rotate(-4deg); } 30% { transform: translateX(4%) rotate(4deg); } 45% { transform: translateX(-2%) rotate(-2deg); } 100% { transform: translateY(3%) scale(.97); filter: saturate(.55) brightness(.92) drop-shadow(0 4px 4px rgba(40, 20, 80, .15)); } }
@keyframes tear { 0% { transform: rotate(180deg) translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: rotate(180deg) translateY(-90%); opacity: 0; } }
@keyframes spark { 0% { transform: scale(0) rotate(0); opacity: 1; } 60% { transform: scale(1.2) rotate(90deg); opacity: 1; } 100% { transform: scale(.4) rotate(180deg); opacity: 0; } }
@keyframes boxIdle { 0%, 82%, 100% { transform: none; } 86% { transform: rotate(-6deg); } 90% { transform: rotate(6deg); } 94% { transform: rotate(-3deg); } }
.wiggle img { animation: boxIdle 1.6s ease-in-out infinite; }

/* splash */
.splash { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; }
.splash .av { width: 140px; height: 140px; }
.splash.small { min-height: 60vh; }
.spin { width: 42px; height: 42px; border-radius: 50%; border: 5px solid #e2dbff; border-top-color: var(--pri); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* logo */
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--fun); font-weight: 700; font-size: 24px; color: var(--ink); text-decoration: none; }
.logo-mark { width: 44px; height: 44px; display: block; border-radius: 14px; background: linear-gradient(160deg, #ffe7a8, #ffc65c); box-shadow: 0 4px 10px rgba(255, 170, 0, .3); overflow: hidden; }
.logo-mark .av img { transform: scale(1.25) translateY(10%); animation: none; filter: none; }
.logo.big { justify-content: center; font-size: 36px; }
.logo.big .logo-mark { width: 64px; height: 64px; border-radius: 20px; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; background: linear-gradient(160deg, #7b5cff 0%, #5b8bff 55%, #45c4ff 100%); }
.auth-card { position: relative; z-index: 2; width: min(440px, 100%); background: rgba(255, 255, 255, .96); border-radius: 30px; padding: 30px 26px 24px; box-shadow: var(--shadow-lg); backdrop-filter: blur(10px); }
.auth-card .tag { text-align: center; color: var(--muted); font-weight: 700; margin: 6px 0 20px; }
.auth-card form { display: grid; }
.demo-note { margin-top: 16px; background: #fff7e0; border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: #7a5300; display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.parade { position: absolute; inset: 0; pointer-events: none; }
.parade .pa { position: absolute; left: var(--x); bottom: -160px; width: calc(120px * var(--s, 1)); height: calc(120px * var(--s, 1)); animation: floatUp var(--dur, 18s) linear infinite; animation-delay: var(--d, 0s); opacity: .95; }
.parade .pa .av img { animation: none; }
@keyframes floatUp { 0% { transform: translate(0, 0) rotate(-6deg); } 25% { transform: translate(var(--sw), -32vh) rotate(5deg); } 50% { transform: translate(0, -64vh) rotate(-4deg); } 75% { transform: translate(calc(var(--sw) * -1), -96vh) rotate(6deg); } 100% { transform: translate(0, -130vh) rotate(-6deg); } }

/* topbar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.avatar-btn { background: linear-gradient(160deg, var(--pri2), var(--pri)); color: #fff; font-weight: 900; font-family: var(--fun); font-size: 18px; border-radius: 50%; }
.avatar-btn:hover { background: linear-gradient(160deg, var(--pri2), var(--pri)); filter: brightness(1.08); }

/* classes page */
.classes-page { max-width: 1100px; margin: 0 auto; padding: 28px 18px 60px; }
.hello h1 { font-size: 34px; }
.hello { margin-bottom: 22px; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.class-card { position: relative; height: 210px; border-radius: 26px; padding: 18px; text-decoration: none; color: #fff; background: linear-gradient(150deg, var(--a), var(--b)); box-shadow: 0 10px 26px color-mix(in srgb, var(--b) 40%, transparent); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; transition: transform .2s; text-align: left; }
.class-card:hover { transform: translateY(-4px) rotate(-.5deg); }
.class-card::before { content: ''; position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.cc-av { position: absolute; right: 6px; top: 4px; width: 128px; height: 128px; }
.cc-name { font-family: var(--fun); font-size: 26px; font-weight: 700; position: relative; text-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.cc-sub { opacity: .9; font-weight: 700; position: relative; }
.class-card.new { background: rgba(255, 255, 255, .7); color: var(--pri); box-shadow: inset 0 0 0 3px #d8cfff; align-items: center; justify-content: center; gap: 10px; font-family: var(--fun); font-size: 20px; font-weight: 700; }
.class-card.new::before { display: none; }
.class-card.new .plus { width: 64px; height: 64px; border-radius: 50%; background: var(--pri); color: #fff; display: grid; place-items: center; }
.class-card.new .plus .ic { width: 32px; height: 32px; }
.empty-hero { position: relative; height: 260px; margin-top: 24px; display: grid; place-items: center; border-radius: 28px; overflow: hidden; background: linear-gradient(160deg, #efeaff, #e3f3ff); }
.empty-hero .btn { position: relative; z-index: 2; }

/* class view */
.class-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; padding: 10px 14px; color: #fff; background: linear-gradient(120deg, var(--a), var(--b)); box-shadow: 0 6px 20px color-mix(in srgb, var(--b) 35%, transparent); }
.ch-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ch-av { width: 50px; height: 50px; flex: none; background: rgba(255, 255, 255, .25); border-radius: 16px; overflow: hidden; }
.ch-av .av img { transform: scale(1.3) translateY(12%); animation: none; }
.ch-title h1 { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sub { font-weight: 700; opacity: .92; font-size: 14px; }
.modebar { max-height: 0; overflow: hidden; transition: max-height .3s; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 70px; z-index: 19; }
.modebar.show { max-height: 120px; }
.mb-in { display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex-wrap: wrap; }
.class-main { padding: 18px 14px 120px; max-width: 1600px; margin: 0 auto; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(var(--cw), 1fr)); --cw: 138px; }
.grid.size-s { --cw: 108px; } .grid.size-l { --cw: 190px; }
.card { position: relative; background: var(--card); border-radius: var(--r); padding: 10px 8px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform .18s, box-shadow .18s; user-select: none; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(60, 40, 140, .16); }
.card:active { transform: scale(.96); }
.card .av-wrap { width: 100%; aspect-ratio: 1; border-radius: 18px; background: radial-gradient(circle at 50% 38%, #fff 0, var(--bg, #f1edff) 70%); display: grid; place-items: center; overflow: visible; position: relative; }
.card .av-wrap > .av { width: 96%; height: 96%; }
.card .nm { margin-top: 8px; font-weight: 900; font-size: 15px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: .3px; }
.size-l .card .nm { font-size: 19px; } .size-s .card .nm { font-size: 13px; }
.pts { position: absolute; top: 4px; right: 4px; min-width: 38px; height: 38px; padding: 0 9px; border-radius: 99px; display: grid; place-items: center; font-family: var(--fun); font-weight: 700; font-size: 18px; color: #fff; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .15); z-index: 2; }
.size-l .pts { min-width: 48px; height: 48px; font-size: 22px; }
.pts.p { background: linear-gradient(180deg, #34d399, var(--pos2)); }
.pts.n { background: linear-gradient(180deg, #ff6b81, var(--neg2)); }
.pts.z { background: linear-gradient(180deg, #b7b0cc, #948ab0); }
.pts.bump { animation: bump .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.card.whole .av-wrap { background: radial-gradient(circle at 50% 40%, #fff7d6, #ffe08a); }
.whole-av { display: grid !important; grid-template-columns: 1fr 1fr; padding: 8px; }
.whole-av .av { width: 100%; height: 100%; }
.whole-av .av img { animation: none; }
.card.add { background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 3px #ddd5ff; color: var(--pri); }
.card.add .av-wrap { background: none; }
.card.add .plus { width: 54%; aspect-ratio: 1; border-radius: 50%; background: var(--pri); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(108, 76, 245, .35); }
.card.add .plus .ic { width: 50%; height: 50%; }
.card .check { position: absolute; top: 6px; left: 6px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px #d6cfee; color: transparent; display: none; place-items: center; z-index: 3; }
.card .check .ic { width: 18px; height: 18px; }
[data-mode=select] .card[data-id] .check { display: grid; }
.card.sel { box-shadow: 0 0 0 4px var(--pri), var(--shadow); }
.card.sel .check { background: var(--pri); box-shadow: none; color: #fff; }
.card.absent { opacity: .5; filter: grayscale(.8); }
[data-mode=attendance] .card.absent { opacity: .75; }
.att-tag { position: absolute; left: 6px; top: 8px; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 99px; z-index: 2; }
.att-tag.present { background: #dcfce7; color: #15803d; } .att-tag.absent { background: #ffe4e6; color: #be123c; } .att-tag.late { background: #fef3c7; color: #b45309; }
[data-mode=normal] .att-tag.present { display: none; }
.card.hop { animation: hop .7s cubic-bezier(.3, 1.6, .5, 1); }
.card.shake { animation: shake .6s ease; }
.card.revealed { animation: hop .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hop { 0% { transform: none; } 30% { transform: translateY(-14px) scale(1.06); } 60% { transform: translateY(0) scale(.97, 1.03); } 100% { transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px) rotate(-3deg); } 40% { transform: translateX(8px) rotate(3deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
.pop-in { animation: popIn .45s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes popIn { from { opacity: 0; transform: scale(.7) translateY(10px); } to { opacity: 1; transform: none; } }
.grid-empty { position: relative; text-align: center; padding: 40px 16px; margin-top: 10px; border-radius: 28px; background: rgba(255, 255, 255, .6); overflow: hidden; min-height: 280px; display: grid; place-items: center; align-content: center; gap: 14px; }
.grid-empty p, .grid-empty .btn { position: relative; z-index: 2; font-weight: 800; font-size: 18px; }

/* toolbar */
.toolbar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30; display: flex; gap: 4px; padding: 6px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); border-radius: 22px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 20px); overflow-x: auto; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.toolbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 12px; border-radius: 16px; font-weight: 800; font-size: 12.5px; color: #5a4f7a; min-width: 72px; transition: .15s; }
.toolbar button .ic { width: 26px; height: 26px; color: var(--b); }
.toolbar button:hover { background: #f3efff; }
.toolbar button.on { background: linear-gradient(160deg, var(--a), var(--b)); color: #fff; }
.toolbar button.on .ic { color: #fff; }

/* modals */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(30, 18, 70, .45); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .22s; }
.modal-back.show { opacity: 1; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 28px; padding: 24px; box-shadow: var(--shadow-lg); transform: translateY(20px) scale(.96); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.modal-back.show .modal { transform: none; }
.modal.small { width: min(420px, 100%); }
.modal.mid { width: min(640px, 100%); }
.modal.award { width: min(860px, 100%); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.modal.reports { width: min(980px, 100%); }
.swatches { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sw input, .ms input { display: none; }
.sw span { display: block; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(150deg, var(--a), var(--b)); cursor: pointer; transition: .15s; }
.sw input:checked + span { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--b); transform: scale(1.06); }
.mascots { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 240px; overflow: auto; padding: 4px; margin-bottom: 14px; }
.mascots.big { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); max-height: 320px; }
.ms span { display: block; aspect-ratio: 1; border-radius: 16px; padding: 4px; cursor: pointer; transition: .15s; }
.ms span .av img { animation: none; }
.ms input:checked + span, .ms.on span { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pri); transform: scale(1.05); }
button.ms { padding: 0; }

/* award modal */
.aw-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px 14px; background: linear-gradient(180deg, #f6f3ff, #fff); }
.aw-av { width: 86px; height: 86px; border-radius: 24px; background: radial-gradient(circle at 50% 38%, #fff 0, var(--bg, #efeaff) 75%); flex: none; }
.aw-av.multi { display: flex; background: none; width: auto; }
.aw-av.multi .av { width: 66px; height: 66px; margin-right: -18px; }
.aw-t h2 { margin: 0; font-size: 28px; }
.aw-pts { display: flex; gap: 8px; margin-top: 4px; }
.aw-pts span { font-family: var(--fun); font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.aw-pts .p { background: #dcfce7; color: #15803d; } .aw-pts .n { background: #ffe4e6; color: #be123c; }
.aw-tabs { margin: 0 20px 4px; }
.aw-body { overflow: auto; padding: 8px 20px 24px; max-height: calc(100vh - 240px); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
.skill { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: 22px; background: #fbfaff; box-shadow: inset 0 0 0 2px #efeaff; transition: transform .15s, box-shadow .15s, background .15s; }
.skill:hover { transform: translateY(-3px) scale(1.03); background: #fff; box-shadow: 0 10px 24px rgba(80, 50, 180, .14); }
.skill:active, .skill.pressed { transform: scale(.94); }
.skill .sn { font-weight: 800; font-size: 14.5px; line-height: 1.2; }
.skill .val { position: absolute; top: 8px; right: 8px; font-family: var(--fun); font-weight: 700; font-size: 14px; padding: 2px 8px; border-radius: 99px; color: #fff; }
.skill .val.pos { background: var(--pos); } .skill .val.neg { background: var(--neg); }
.skill .badge { width: 78px; height: 78px; }
.add-skill { box-shadow: inset 0 0 0 2px dashed #d6ccff; color: var(--pri); background: transparent; border: 2px dashed #d6ccff; }
.badge.ghostb { background: #f1edff !important; color: var(--pri); border-color: transparent; box-shadow: none; }

/* icon badges */
.badge { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--bc) 50%, #fff) 0%, var(--bc) 52%, color-mix(in srgb, var(--bc) 72%, #000) 100%);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .14), inset 0 4px 0 rgba(255, 255, 255, .38), 0 6px 14px color-mix(in srgb, var(--bc) 40%, transparent); border: 3px solid #fff; }
.badge svg { width: 84%; height: 84%; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .16)); }
.badge img { width: 92%; height: 92%; object-fit: contain; }
.badge.xs { width: 28px; height: 28px; border-width: 2px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); }
.badge.sm { width: 46px; height: 46px; }
.badge.xl { width: 150px; height: 150px; border-width: 6px; }

/* toast */
#toasts { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #241a45; color: #fff; padding: 10px 12px 10px 16px; border-radius: 16px; box-shadow: var(--shadow-lg); font-weight: 700; opacity: 0; transform: translateY(14px) scale(.96); transition: .25s; }
.toast span { display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: var(--neg2); }
.toast-btn { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .16); padding: 7px 12px; border-radius: 11px; font-weight: 800; color: #fff; }
.toast-btn .ic { width: 18px; height: 18px; }

/* spotlight */
.spot { position: fixed; inset: 0; z-index: 200; pointer-events: none; display: grid; place-items: center; }
.spot::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%); animation: fadeIn .2s; }
.spot.neg::before { background: radial-gradient(circle at 50% 50%, rgba(255, 220, 230, .5), rgba(255, 255, 255, 0) 60%); }
.spot-card { position: relative; display: flex; align-items: center; gap: 22px; padding: 22px 30px 22px 22px; border-radius: 34px; background: #fff; box-shadow: 0 30px 80px rgba(40, 20, 110, .3); animation: spotIn .55s cubic-bezier(.3, 1.6, .5, 1); }
.spot.out .spot-card { animation: spotOut .4s ease forwards; }
.spot-av { width: 170px; height: 170px; border-radius: 30px; background: radial-gradient(circle at 50% 38%, #fff 0, var(--bg) 75%); }
.spot-badge { position: relative; animation: badgeSpin .7s cubic-bezier(.3, 1.6, .5, 1); }
.spot-val { position: absolute; right: -12px; bottom: -6px; font-family: var(--fun); font-weight: 700; font-size: 34px; color: #fff; background: var(--pos); border: 4px solid #fff; border-radius: 99px; padding: 0 14px; box-shadow: 0 6px 14px rgba(0, 0, 0, .2); }
.spot.neg .spot-val { background: var(--neg); }
.spot-who { font-family: var(--fun); font-size: 40px; font-weight: 700; text-transform: uppercase; }
.spot-sk { font-size: 24px; font-weight: 800; color: var(--muted); }
.spot.remote .spot-card { box-shadow: 0 0 0 6px rgba(108, 76, 245, .25), 0 30px 80px rgba(40, 20, 110, .3); }
@keyframes spotIn { from { transform: scale(.4) translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spotOut { to { transform: scale(.8) translateY(-30px); opacity: 0; } }
@keyframes badgeSpin { from { transform: rotate(-200deg) scale(.2); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
.float-pts { position: fixed; z-index: 250; transform: translate(-50%, 0); font-family: var(--fun); font-weight: 700; font-size: 34px; pointer-events: none; animation: floatPts 1.3s ease-out forwards; text-shadow: 0 3px 0 #fff, 0 0 12px #fff; }
.float-pts.pos { color: var(--pos2); } .float-pts.neg { color: var(--neg2); }
@keyframes floatPts { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.25); } 100% { opacity: 0; transform: translate(-50%, -80px) scale(1); } }
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 260; }

/* reveal */
.reveal { position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; align-content: center; gap: 12px; background: radial-gradient(circle at 50% 45%, #6c4cf5, #2a1660 75%); color: #fff; opacity: 0; transition: opacity .3s; text-align: center; padding: 20px; }
.reveal.show { opacity: 1; }
.rays { position: absolute; left: 50%; top: 45%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(rgba(255, 255, 255, .09) 0 10deg, transparent 10deg 20deg); animation: rays 18s linear infinite; opacity: .5; transition: opacity .5s; pointer-events: none; }
.reveal.opened .rays { opacity: 1; background: repeating-conic-gradient(rgba(255, 230, 120, .22) 0 10deg, transparent 10deg 20deg); }
@keyframes rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
.rv-title { position: relative; font-family: var(--fun); font-size: clamp(22px, 4vw, 38px); font-weight: 700; }
.rv-stage { position: relative; width: min(56vh, 80vw); height: min(56vh, 80vw); display: grid; place-items: center; }
.rv-box { position: absolute; inset: 8%; cursor: pointer; transition: transform .4s, opacity .4s; }
.rv-box.shaking .av img { animation: boxShake 1.6s ease-in-out infinite; }
@keyframes boxShake { 0%, 50%, 100% { transform: none; } 55% { transform: rotate(-8deg) scale(1.03); } 62% { transform: rotate(8deg) scale(1.05); } 69% { transform: rotate(-6deg); } 76% { transform: rotate(5deg); } 83% { transform: none; } }
.reveal.opened .rv-box { transform: scale(1.6) translateY(10%); opacity: 0; }
.rv-animal { position: absolute; inset: 0; display: grid; place-items: center; }
.rv-circle { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fff 0, var(--bg) 65%, transparent 71%); animation: rvPop .8s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
.rv-circle.swap { animation: rvPop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rvPop { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.rv-name { position: relative; font-family: var(--fun); font-size: clamp(24px, 4.4vw, 44px); min-height: 1.2em; }
.rv-actions { position: relative; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.rv-left { position: relative; opacity: .8; font-weight: 700; }
.bx-hero { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.bx-hero .av { width: 90px; height: 90px; }

/* overlay tools */
.overlay-tool { position: fixed; inset: 0; z-index: 150; background: rgba(30, 18, 70, .45); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.tool-card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 30px; padding: 24px; box-shadow: var(--shadow-lg); text-align: center; }
.tool-card.wide { width: min(1100px, 100%); text-align: left; }
.tool-x { position: absolute; right: 12px; top: 12px; }
.rnd-stage { display: grid; justify-items: center; gap: 8px; margin: 10px 0; }
.rnd-av { width: min(260px, 60vw); height: min(260px, 60vw); }
.rnd-circle { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fff 0, var(--bg) 70%); }
.random-tool.done .rnd-circle { animation: rvPop .6s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 0 0 8px #ffe08a, 0 0 60px #ffd23f; }
.rnd-name { font-family: var(--fun); font-size: 40px; font-weight: 700; text-transform: uppercase; min-height: 48px; }
.t-ring { position: relative; width: min(340px, 70vw); aspect-ratio: 1; margin: 6px auto 14px; }
.t-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.t-bg { fill: none; stroke: #efeaff; stroke-width: 16; }
.t-fg { fill: none; stroke: url(#tgrad) var(--pri); stroke: var(--pri); stroke-width: 16; stroke-linecap: round; stroke-dasharray: 1000; transition: stroke-dashoffset .25s linear, stroke .3s; }
.low .t-fg { stroke: var(--neg); }
.t-time { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--fun); font-weight: 700; font-size: clamp(44px, 12vw, 84px); }
.ring .t-time { color: var(--neg2); animation: shake .5s ease 3; font-size: 40px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.timer-mini { position: fixed; right: 16px; top: 84px; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; background: #fff; box-shadow: var(--shadow-lg); font-family: var(--fun); font-weight: 700; font-size: 22px; color: var(--pri); }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.group { background: #faf8ff; border-radius: 22px; padding: 12px; box-shadow: inset 0 0 0 2px #efeaff; }
.gh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gh .av { width: 44px; height: 44px; }
.gh b { font-family: var(--fun); font-size: 20px; }
.gh .btn { margin-left: auto; }
.gm { display: grid; gap: 6px; }
.gs { display: flex; align-items: center; gap: 8px; font-weight: 800; background: #fff; border-radius: 14px; padding: 4px 8px; }
.gav { width: 34px; height: 34px; }
.gav .av img { animation: none; }

/* skills editor */
.sk-list { display: grid; gap: 8px; margin-bottom: 12px; max-height: 50vh; overflow: auto; padding: 2px; }
.sk-row { display: flex; align-items: center; gap: 8px; }
.sk-row select { width: 84px; }
.sk-ic { border-radius: 50%; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.icon-pick button { display: grid; place-items: center; padding: 6px; border-radius: 18px; transition: .15s; }
.icon-pick button:hover { background: #f3efff; transform: scale(1.06); }

/* menus */
.pop-menu { position: fixed; z-index: 120; min-width: 220px; background: #fff; border-radius: 18px; padding: 6px; box-shadow: var(--shadow-lg); animation: popIn .25s cubic-bezier(.3, 1.4, .5, 1); }
.pop-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; font-weight: 700; text-align: left; min-height: 42px; }
.pop-menu button:hover { background: #f3efff; }
.pop-menu button .ic { width: 20px; height: 20px; color: var(--pri); }
.pop-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.pm-h { padding: 8px 12px 4px; font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

/* reports */
.rp-top h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.rp-av { width: 40px; height: 40px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.rp-av .av img { animation: none; }
.rp-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; margin-bottom: 14px; }
.rp-card { background: #faf8ff; border-radius: 22px; padding: 16px; box-shadow: inset 0 0 0 2px #efeaff; margin-bottom: 14px; }
.rp-card h3 { margin-bottom: 10px; }
.rp-card.sum { display: flex; align-items: center; gap: 18px; }
.donut { width: 160px; height: 160px; transform: rotate(-90deg); flex: none; }
.donut circle { fill: none; stroke-width: 16; }
.d-bg { stroke: #eee8ff; } .d-neg { stroke: var(--neg); stroke-dasharray: 100 100; } .d-pos { stroke: var(--pos); stroke-linecap: round; }
.donut text { transform: rotate(90deg); transform-origin: 60px 60px; font-family: var(--fun); }
.d-big { font-size: 24px; font-weight: 700; fill: var(--ink); } .d-sm { font-size: 10px; fill: var(--muted); font-weight: 700; }
.sum-n .big { font-family: var(--fun); font-size: 34px; font-weight: 700; }
.big.p, td.p, b.p { color: var(--pos2); } .big.n, td.n, b.n { color: var(--neg2); }
.bar-row { display: grid; grid-template-columns: 28px 1fr 1.2fr 34px; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.bar { height: 12px; background: #ece6ff; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; animation: grow .6s ease; }
.bar i.pos { background: linear-gradient(90deg, #34d399, var(--pos2)); } .bar i.neg { background: linear-gradient(90deg, #ff8fa3, var(--neg2)); }
@keyframes grow { from { width: 0 !important; } }
.rp-table { width: 100%; border-collapse: collapse; font-weight: 700; }
.rp-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 6px; letter-spacing: .5px; }
.rp-table td { padding: 6px; border-top: 1px solid var(--line); }
.rp-table tr[data-stu] { cursor: pointer; }
.rp-table tr[data-stu]:hover td { background: #f3efff; }
.rp-table td:first-child { display: flex; align-items: center; }
.h-row { display: grid; grid-template-columns: 28px 1fr 40px 130px; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-weight: 700; }
.hist { max-height: 50vh; overflow: auto; }

/* demo ribbon */
body.demo .topbar::after, body.demo .class-head::after { content: 'DEMO'; position: absolute; right: 50%; bottom: -10px; transform: translateX(50%); font-size: 10px; font-weight: 900; letter-spacing: 1px; background: #ffb703; color: #4a2a00; padding: 2px 8px; border-radius: 99px; }

/* responsive */
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .grid { --cw: 104px; gap: 10px; }
  .grid.size-l { --cw: 140px; }
  .card .nm { font-size: 13px; }
  .pts { min-width: 32px; height: 32px; font-size: 15px; }
  .ch-title h1 { font-size: 19px; }
  .ch-av { width: 40px; height: 40px; }
  .modebar { top: 64px; }
  .toolbar { bottom: 8px; border-radius: 18px; }
  .toolbar button { min-width: 64px; padding: 7px 8px; font-size: 11.5px; }
  .modal { padding: 18px; border-radius: 24px; }
  .modal.award { padding: 0; }
  .skill-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .skill .badge { width: 60px; height: 60px; }
  .skill .sn { font-size: 13px; }
  .aw-av { width: 64px; height: 64px; }
  .aw-t h2 { font-size: 22px; }
  .spot-card { flex-direction: column; text-align: center; gap: 10px; padding: 18px; margin: 16px; }
  .spot-av { width: 120px; height: 120px; }
  .badge.xl { width: 110px; height: 110px; }
  .spot-who { font-size: 28px; }
  .rp-grid { grid-template-columns: 1fr; }
  .rp-card.sum { flex-direction: column; }
  .rp-table { font-size: 13px; }
  .rp-table th:nth-child(n+5), .rp-table td:nth-child(n+5) { display: none; }
  .class-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .class-card { height: 170px; }
  .cc-av { width: 100px; height: 100px; }
  .cc-name { font-size: 21px; }
  .hello h1 { font-size: 26px; }
}
@media (min-width: 1600px) { .grid { --cw: 160px; } .grid.size-l { --cw: 220px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
/* 3D icon badges */
.badge.b3d { background: radial-gradient(circle at 50% 35%, #fff 0%, color-mix(in srgb, var(--bc) 22%, #fff) 60%, color-mix(in srgb, var(--bc) 40%, #fff) 100%); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--bc) 30%, transparent), 0 6px 14px color-mix(in srgb, var(--bc) 30%, transparent); border-color: #fff; overflow: visible; }
.badge.b3d img { width: 96%; height: 96%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(40, 20, 80, .22)); transform: translateY(-2%); }
.skill:hover .badge.b3d img { animation: iconWiggle .6s ease; }
@keyframes iconWiggle { 0%,100% { transform: translateY(-2%); } 30% { transform: translateY(-10%) rotate(-8deg) scale(1.08); } 60% { transform: translateY(-4%) rotate(6deg); } }
/* rewards */
.aw-pts .bal { background: #efeaff; color: var(--pri); }
.aw-pts .sp { background: #fff3d6; color: #b45309; }
.skill.reward .val.cost { background: linear-gradient(180deg, #ffd23f, #ffb703); color: #4a2a00; }
.skill.reward .val.cost::after { content: ' pts'; font-size: 11px; }
.skill.reward.locked { opacity: .55; filter: grayscale(.5); }
.skill.reward.locked:hover { transform: none; }
.skill .need { font-size: 12px; font-weight: 800; color: var(--muted); }
.skill.shake { animation: shake .5s ease; }
.cost-in { display: flex; align-items: center; gap: 6px; margin: 0; width: 120px; flex: none; }
.cost-in input { width: 80px !important; text-align: center; }
.cost-in span { font-weight: 800; color: var(--muted); }
.spot.redeem::before { background: radial-gradient(circle at 50% 50%, rgba(255, 230, 140, .6), rgba(255, 255, 255, 0) 60%); }
.spot.redeem .spot-val { background: linear-gradient(180deg, #ffd23f, #ffa000); color: #4a2a00; }
.spot-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: #b45309; background: #fff3d6; padding: 4px 12px; border-radius: 99px; margin-bottom: 4px; }
.spot-tag .ic { width: 18px; height: 18px; }
.float-pts.spend { color: #e08a00; }
.big.sp, td.sp, b.sp { color: #d97706; }
@media (max-width: 720px) { .sk-row { flex-wrap: wrap; } .cost-in { width: auto; } }

/* sign-up fine print + site credit */
.auth-fine { margin: 12px 2px 0; font-size: 12.5px; line-height: 1.45; color: #6b6488; text-align: center; }
.auth-by { display: block; margin-top: 14px; text-align: center; font-size: 12px; font-weight: 700; color: #8a82a8; text-decoration: none; letter-spacing: .02em; }
.auth-by:hover { color: #6c4cf5; text-decoration: underline; }
