:root{--ink:#232044;--muted:#625e7d;--purple:#5345b7;--lav:#eeeafb;--pink:#fce4ee;--mint:#ddf7ec;--yellow:#fff1c9;--paper:#fffefa;--edge:#e3dfec;--bg:#f7f4fd;--blue:#e6f3fe;--orange:#ffbb78;--shadow:0 8px 30px #30214a12;--radius:20px;--body:16px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:var(--body);line-height:1.45}body.dark{--ink:#f2efff;--muted:#c1b9da;--purple:#a99dff;--lav:#302c50;--pink:#452f47;--mint:#213f3e;--yellow:#463c2e;--paper:#24223b;--edge:#514c70;--bg:#171625;--blue:#283e57;--shadow:0 8px 30px #0005}
button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #f1b349;outline-offset:2px}a{color:var(--purple)}.shell{min-height:100vh;padding-bottom:95px}.top{background:var(--paper);border-bottom:1px solid var(--edge);position:sticky;top:0;z-index:10;box-shadow:0 2px 14px #22113d0a}.top-inner{max-width:1170px;margin:auto;padding:9px 18px;display:flex;align-items:center;gap:11px}.logo{display:flex;align-items:center;gap:8px;min-width:0}.brand-name{font-size:1.28rem;line-height:1.05;letter-spacing:-.035em;font-weight:950;color:var(--purple)}.brand-name small{display:block;font-size:.64rem;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);font-weight:700;margin-top:4px}.mascot{height:49px;width:49px;flex-shrink:0}.top-right{margin-left:auto;display:flex;align-items:center;gap:9px}.pill{border-radius:999px;background:var(--yellow);font-size:.8rem;font-weight:800;padding:8px 12px;white-space:nowrap}.avatar{width:38px;height:38px;display:grid;place-items:center;background:var(--lav);border-radius:50%;font-size:1.25rem;border:0}.wrap{max-width:1170px;margin:auto;padding:23px 18px 50px}.intro{display:flex;align-items:center;gap:18px;justify-content:space-between;margin-bottom:22px}.intro h1{font-size:clamp(1.65rem,4vw,2.5rem);line-height:1.14;letter-spacing:-.045em;margin:0 0 5px}.intro p{color:var(--muted);margin:0}.card{background:var(--paper);border:1px solid var(--edge);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;margin-bottom:16px}.card h2,.card h3{margin:0 0 10px;line-height:1.25}.card h2{font-size:1.28rem}.card h3{font-size:1.03rem}.card p{margin:7px 0;color:var(--muted)}.hero{border:0;background:linear-gradient(120deg,#644ed1,#9870cc);color:white;display:grid;grid-template-columns:1fr 120px;align-items:center;gap:15px;padding:24px}.hero h1{font-size:clamp(1.7rem,5vw,2.45rem);line-height:1.13;margin:0 0 9px}.hero p{color:#f4eaff;max-width:600px}.hero .mascot{height:120px;width:120px;filter:drop-shadow(0 6px 5px #24145644)}.hero .eyebrow{color:#ffe99e;font-size:.83rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.hero .btn{background:white;color:#473796}.cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.tile{border:1px solid var(--edge);border-radius:17px;background:var(--paper);min-height:135px;display:flex;flex-direction:column;align-items:flex-start;text-align:left;padding:17px;gap:8px;box-shadow:var(--shadow);color:var(--ink)}.tile:hover,.small-tile:hover{transform:translateY(-2px);border-color:var(--purple)}.tile span:first-child{font-size:1.9rem}.tile strong{font-size:1.05rem}.tile small{color:var(--muted)}.btn{background:var(--purple);color:white;border:0;border-radius:13px;padding:11px 16px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;gap:7px;max-width:100%;text-align:center}.btn.secondary{color:var(--purple);background:var(--lav)}.btn.soft{background:var(--mint);color:#206752}.btn.danger{background:#ba3357;color:#fff}.btn.ghost{color:var(--ink);background:transparent;border:1px solid var(--edge)}.btn.sm{padding:7px 10px;font-size:.85rem;border-radius:9px}.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.end{margin-left:auto}.muted{color:var(--muted)}.tiny{font-size:.77rem;color:var(--muted)}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.section-title h2{margin:0}.item{padding:13px 0;border-bottom:1px solid var(--edge)}.item:last-child{border-bottom:0;padding-bottom:0}.item:first-child{padding-top:0}.item-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.item strong{overflow-wrap:anywhere}.item p{margin:4px 0;color:var(--muted);font-size:.91rem}.tag{font-size:.73rem;font-weight:850;border-radius:7px;padding:4px 7px;display:inline-block;background:var(--lav);color:var(--purple)}.tag.pink{background:var(--pink);color:#af3568}.tag.mint{background:var(--mint);color:#206e4d}.tag.yellow{background:var(--yellow);color:#a05e13}.meta{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin:7px 0}.strike{text-decoration:line-through;opacity:.55}.empty{text-align:center;padding:24px 12px;background:var(--lav);border-radius:15px;color:var(--muted)}.empty .big{font-size:2.2rem;display:block}.toolbar{display:flex;gap:9px;flex-wrap:wrap;margin-bottom:15px;align-items:center}.search{flex:1;min-width:160px}.field{display:flex;flex-direction:column;gap:5px;margin-bottom:13px}.field label{font-size:.84rem;font-weight:800}.field input,.field select,.field textarea,.toolbar input,.toolbar select{background:var(--paper);color:var(--ink);border:1.5px solid var(--edge);border-radius:12px;padding:10px 11px;min-height:43px;width:100%;outline:0}.field textarea{min-height:135px;resize:vertical}.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--purple)}.form-cols{display:grid;grid-template-columns:1fr 1fr;gap:12px}.checkline{display:flex;align-items:center;gap:11px}.checkline input{height:20px;width:20px;accent-color:var(--purple);flex:none}.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:var(--paper);z-index:11;border-top:1px solid var(--edge);display:flex;justify-content:center;padding:8px max(8px,env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));box-shadow:0 -5px 25px #22113d12}.nav-items{display:flex;max-width:800px;width:100%;justify-content:space-around}.nav-btn{display:grid;justify-items:center;gap:1px;background:none;color:var(--muted);border:0;border-radius:11px;font-size:.72rem;font-weight:750;padding:4px 11px}.nav-btn span{font-size:1.42rem}.nav-btn.active{color:var(--purple);background:var(--lav)}.more-menu{display:flex;gap:9px;flex-wrap:wrap;justify-content:center;padding:14px;margin-bottom:8px;border-radius:15px;background:var(--lav)}.modal-wrap{position:fixed;inset:0;background:#110c2a99;z-index:30;display:flex;align-items:flex-start;justify-content:center;padding:20px 12px;overflow:auto}.modal{background:var(--paper);border-radius:20px;padding:22px;max-width:620px;width:100%;margin:auto;box-shadow:0 25px 80px #110c2a55;max-height:calc(100vh - 30px);overflow:auto}.modal-wide{max-width:790px}.modal-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.modal-title h2{margin:0}.x{font-size:1.35rem;border:0;background:var(--lav);border-radius:10px;width:36px;height:36px;color:var(--ink)}.modal .actions{margin-top:12px}.splash,.auth{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;text-align:center;padding:25px}.logo-big{font-size:4rem}.auth-card{background:var(--paper);padding:28px;width:min(100%,440px);border:1px solid var(--edge);border-radius:24px;box-shadow:var(--shadow);text-align:left}.auth-head{text-align:center}.auth-head h1{margin:8px 0 0;font-size:2rem;color:var(--purple)}.auth-head p{margin:6px 0 24px;color:var(--muted)}.auth-head .mascot{width:110px;height:110px}.auth-card .btn{width:100%}.auth-note{font-size:.82rem;color:var(--muted);margin-top:16px}.code{font-size:1.8rem;font-weight:950;letter-spacing:.16em;background:var(--yellow);border-radius:12px;padding:15px;text-align:center;color:#4e3e26;user-select:all;overflow-wrap:anywhere}.squad-icon{font-size:2rem}.room{border:2px dashed var(--edge);background:var(--lav);border-radius:16px;padding:18px;margin-bottom:14px}.players{display:flex;gap:8px;flex-wrap:wrap}.player{background:var(--blue);border-radius:11px;padding:8px 12px;font-size:.87rem}.quiz-choice{width:100%;display:block;text-align:left;background:var(--paper);border:2px solid var(--edge);border-radius:13px;margin:10px 0;padding:13px;color:var(--ink);font-weight:700}.quiz-choice:hover{border-color:var(--purple);background:var(--lav)}.ttt{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-width:300px;margin:19px auto}.ttt button{aspect-ratio:1;border:2px solid var(--edge);background:var(--paper);border-radius:14px;color:var(--purple);font-size:3rem;font-weight:900}.ttt button:hover{background:var(--lav)}.flashcard{background:linear-gradient(140deg,var(--lav),var(--blue));border:2px solid var(--edge);border-radius:20px;min-height:230px;display:grid;place-items:center;text-align:center;padding:24px;cursor:pointer;font-size:clamp(1.25rem,4vw,1.9rem);font-weight:850;overflow-wrap:anywhere}.flashcard small{font-size:.75rem;display:block;font-weight:500;color:var(--muted);margin-top:13px}.timer{font-size:clamp(3.5rem,12vw,6rem);font-weight:950;letter-spacing:-.06em;text-align:center;color:var(--purple);font-variant-numeric:tabular-nums}.timer-container{text-align:center;background:var(--lav);border-radius:18px;padding:25px}.timer-container .actions{justify-content:center}.list-pill{display:flex;justify-content:space-between;gap:8px;align-items:center;background:var(--lav);padding:11px;border-radius:12px;margin-bottom:8px}.subjects{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:17px}.subjects button{border:1px solid var(--edge);border-radius:100px;background:var(--paper);color:var(--ink);padding:7px 12px;font-size:.83rem}.subjects .chosen{background:var(--purple);color:#fff;border-color:var(--purple)}.memory-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;max-width:430px}.memory-grid button{border:1px solid var(--edge);border-radius:12px;aspect-ratio:1;font-size:1.9rem;background:var(--lav)}.memory-grid button.open{background:var(--mint)}.drawing{width:100%;height:300px;touch-action:none;background:white;border:2px dashed #cec9dd;border-radius:15px}.progress{height:10px;background:var(--edge);border-radius:99px;overflow:hidden;margin:9px 0}.progress div{height:100%;background:var(--purple);border-radius:99px}.kpi{border-radius:14px;padding:17px;background:var(--lav)}.kpi strong{font-size:1.8rem;display:block;color:var(--purple)}.kpi span{font-size:.83rem;color:var(--muted)}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:15px}.cheat{background:var(--yellow);padding:15px;border-radius:13px;margin-bottom:8px}.cheat strong{display:block;color:#775318}.cheat p{color:#574b38}.dark .cheat strong,.dark .cheat p{color:var(--ink)}.footer{text-align:center;color:var(--muted);font-size:.8rem;padding:13px 0 19px}.footer a{color:var(--muted)}.alert{padding:12px;border-radius:11px;background:var(--yellow);color:#62421b;font-size:.88rem;margin-bottom:14px}.alert a{color:#62421b}.dark .alert{color:var(--ink)}#toast{position:fixed;left:50%;bottom:100px;transform:translateX(-50%);z-index:99;background:#242044;color:#fff;padding:11px 16px;border-radius:12px;box-shadow:0 10px 25px #0003;display:none;max-width:90vw;text-align:center}#toast.show{display:block}.align-center{text-align:center}.font-big{font-size:2.5rem}.nowrap{white-space:nowrap}.desktop-nav{display:flex;gap:4px;margin-left:auto;flex-wrap:wrap}.desktop-nav button{border:0;background:transparent;color:var(--muted);padding:10px 11px;border-radius:10px;font-weight:800;font-size:.86rem}.desktop-nav button.on{background:var(--lav);color:var(--purple)}.counter{background:var(--blue);border-radius:15px;padding:14px;text-align:center}.counter strong{font-size:1.45rem}.sr-only{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
@media(min-width:860px){.bottom-nav{display:none}.shell{padding-bottom:20px}}
@media(max-width:859px){.desktop-nav{display:none}.top-right .pill{display:none}}
@media(max-width:740px){.tiles{grid-template-columns:repeat(2,minmax(0,1fr))}.cols{grid-template-columns:1fr}.wrap{padding:17px 12px 18px}.hero{grid-template-columns:1fr 80px;padding:18px}.hero .mascot{height:78px;width:78px}.form-cols{grid-template-columns:1fr}.card{padding:16px}.intro{align-items:flex-start}.stats{gap:6px}.kpi{padding:11px}.kpi strong{font-size:1.35rem}.top-inner{padding:8px 12px}.brand-name{font-size:1.15rem}}
@media(max-width:370px){.hero{grid-template-columns:1fr 64px}.hero .mascot{width:60px;height:60px}.nav-btn{padding:4px 6px}.brand-name{font-size:1.02rem}.mascot{width:40px;height:40px}}

/* Friends & temporary study chats */
.chat-messages{display:flex;flex-direction:column;gap:12px;min-height:210px;max-height:410px;overflow-y:auto;padding:14px;background:rgba(124,89,206,.06);border-radius:16px;margin:16px 0;scrollbar-width:thin}
.chat-bubble{background:var(--card,#fff);border:1px solid rgba(123,88,190,.2);padding:11px 14px;border-radius:16px 16px 16px 5px;max-width:90%;align-self:flex-start;overflow-wrap:anywhere}
.chat-bubble.mine{align-self:flex-end;border-radius:16px 16px 5px 16px;background:#ede4ff;color:#2f2052}
.chat-bubble strong{display:block;font-size:.76rem;opacity:.74;margin-bottom:5px}
.chat-bubble p{margin:0 0 3px;white-space:pre-wrap;line-height:1.45}
.chat-bubble small{font-size:.7rem;opacity:.75}
.chat-compose{display:flex;gap:8px;align-items:flex-end}
.chat-compose textarea{min-width:0;flex:1;max-height:150px;resize:vertical}
.chat-compose .btn{flex-shrink:0}
@media(max-width:560px){.chat-compose{flex-wrap:wrap}.chat-compose .btn{width:100%}.chat-messages{max-height:50vh}.item-head>.actions{flex-wrap:wrap;justify-content:flex-end}}
