/* Playerr — shared look: colours, type, buttons, inputs, modals, toasts, full-screen gates. */
:root {
  --ui-scale: 1;
  --bg: #0b0d12; --bg2: #12151c; --card: #171b24; --card2: #1e2330; --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.14);
  --text: #eef1f6; --dim: #9aa3b2; --dim2: #6c7485;
  --acc: #4f8cff; --acc2: #7c5cff; --good: #35d07f; --bad: #ff5d6c; --warn: #ffb547;
  --r: 14px; --r2: 20px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  color-scheme: dark;
  font-size: calc(15px * var(--ui-scale));
}
html.hc { --bg: #000; --bg2: #000; --card: #0b0b0b; --card2: #141414; --line: rgba(255,255,255,.35); --line2: #fff; --dim: #d6d6d6; --dim2: #bdbdbd; --acc: #6aa8ff; }
html[data-cb="protan"] body { filter: url('#cb-protan'); }
html[data-cb="deutan"] body { filter: url('#cb-deutan'); }
html[data-cb="tritan"] body { filter: url('#cb-tritan'); }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
.dim { color: var(--dim); } .small { font-size: .85rem; } .hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.center { justify-content: center; } .grow { flex: 1; }

.btn { appearance: none; border: 1px solid transparent; border-radius: 999px; padding: .6rem 1.2rem; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; color: var(--text); background: var(--card2); transition: transform .12s, background .2s, border-color .2s, opacity .2s; white-space: nowrap; }
.btn:hover { background: #262c3b; } .btn:active { transform: scale(.97); } .btn[disabled] { opacity: .55; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; box-shadow: 0 6px 20px rgba(79,140,255,.3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line2); } .btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { padding: .38rem .85rem; font-size: .85rem; } .btn.lg { padding: .85rem 1.8rem; font-size: 1.05rem; } .btn.block { width: 100%; }
.btn.icon { padding: .5rem; width: 2.4rem; height: 2.4rem; }
.input, select.input, textarea.input { width: 100%; padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); font: inherit; outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(79,140,255,.2); }
.field-msg { min-height: 1.3em; font-size: .85rem; margin: .35rem 0; color: var(--dim); } .field-msg.good { color: var(--good); } .field-msg.bad { color: var(--bad); }
.chip { border: 1px solid var(--line2); background: transparent; color: var(--text); border-radius: 999px; padding: .3rem .75rem; font: inherit; font-size: .8rem; cursor: pointer; } .chip:hover, .chip.on { background: rgba(79,140,255,.18); border-color: var(--acc); }
.badge { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: 999px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 1.2rem; }
.logo-mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 10px; background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; font-weight: 900; font-size: 1.1rem; box-shadow: 0 4px 14px rgba(124,92,255,.45); transform: rotate(-6deg); }

/* spinner */
.spin-wrap { display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 1.5rem; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--acc); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toasts */
.toasts { position: fixed; z-index: 1000; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: rgba(23,27,36,.96); border: 1px solid var(--line2); border-radius: 14px; padding: .8rem 1rem; box-shadow: var(--shadow); transform: translateY(12px); opacity: 0; transition: .25s; backdrop-filter: blur(12px); }
.toast.in { transform: none; opacity: 1; } .toast.good { border-color: rgba(53,208,127,.5); } .toast.bad { border-color: rgba(255,93,108,.5); }
.toast-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: .6rem; }

/* modals */
.modal-back { position: fixed; inset: 0; z-index: 900; background: rgba(4,6,10,.62); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .2s; backdrop-filter: blur(6px); }
.modal-back.in { opacity: 1; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 22px; padding: 1.5rem; box-shadow: var(--shadow); transform: translateY(10px) scale(.98); transition: transform .2s; }
.modal.wide { width: min(760px, 100%); } .modal-back.in .modal { transform: none; }
.modal-title { font-size: 1.3rem; } .modal-body p { margin: .4rem 0 .8rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.2rem; flex-wrap: wrap; }

/* full-screen gates (sign in, banned, deactivated) */
body.gated > *:not(.gate):not(.toasts):not(.modal-back):not(svg) { filter: blur(8px); pointer-events: none; }
.gate { position: fixed; inset: 0; z-index: 800; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, rgba(79,140,255,.25), transparent 60%), radial-gradient(900px 600px at 110% 110%, rgba(124,92,255,.25), transparent 60%), var(--bg); }
.gate.soft { background: rgba(11,13,18,.88); }
.gate.danger { background: radial-gradient(900px 600px at 50% -10%, rgba(255,93,108,.25), transparent 60%), var(--bg); }
.gate-card { width: min(440px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.gate-card h1 { font-size: 1.9rem; } .gate-card p { margin: 0; }
.gate-logo { display: flex; align-items: center; gap: .14em; font-weight: 800; font-size: 1.5rem; margin-bottom: 1rem; }
.gate-icon { font-size: 3rem; } .gate-note { color: var(--warn); }
.sync-btn { margin: 1.2rem 0 .6rem; background: #fff; color: #0b0d12; padding: .85rem 1.6rem; font-size: 1.05rem; width: 100%; max-width: 320px; }
.sync-btn:hover { background: #eef1f6; }
.sync-mark { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #0b0d12; color: #fff; font-weight: 900; font-size: .9rem; }
.ring-wrap { position: relative; width: 140px; height: 140px; margin: .5rem 0 1rem; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line2); stroke-width: 8; } .ring-fg { fill: none; stroke: url(#ringGrad); stroke: var(--acc); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.ring-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; }
.username-form .input { font-size: 1.1rem; }

/* top bar + bottom bar */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1.2rem; padding: .7rem 1.4rem; background: rgba(11,13,18,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .14em; font-weight: 800; font-size: 1.2rem; }
.tabs { display: flex; gap: .3rem; } .tabs a { padding: .45rem .9rem; border-radius: 999px; color: var(--dim); font-weight: 600; } .tabs a.on, .tabs a:hover { color: var(--text); background: rgba(255,255,255,.07); }
.search { flex: 1; max-width: 460px; } .search input { width: 100%; padding: .55rem 1rem .55rem 2.3rem; border-radius: 999px; border: 1px solid var(--line2); background: var(--bg2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa3b2' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat .85rem center; color: var(--text); font: inherit; outline: none; }
.search input:focus { border-color: var(--acc); }
.me { display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .25rem .6rem .25rem .25rem; border-radius: 999px; margin-left: auto; } .me:hover { background: rgba(255,255,255,.06); }
.pfp { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; font-weight: 800; font-size: .85rem; color: #fff; flex-shrink: 0; }
.menu { position: absolute; right: 1.2rem; top: 3.6rem; min-width: 190px; background: var(--card); border: 1px solid var(--line2); border-radius: 14px; padding: .4rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.menu a, .menu button { text-align: left; padding: .6rem .8rem; border-radius: 10px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; } .menu a:hover, .menu button:hover { background: rgba(255,255,255,.07); }
.bottombar { display: none; }
@media (max-width: 760px) {
  .topbar { gap: .6rem; padding: .6rem .8rem; } .tabs, .me-name, .brand-name { display: none; } .search { max-width: none; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(11,13,18,.95); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: .35rem 0 max(.35rem, env(safe-area-inset-bottom)); }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--dim); gap: 2px; } .bottombar a span { font-size: 1.25rem; } .bottombar a.on { color: var(--text); }
  body { padding-bottom: 64px; }
  .toasts { bottom: 76px; }
}

/* Smooth page changes: the browser cross-fades between pages (where supported) and the top bar stays put. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; animation-timing-function: ease; }
.topbar { view-transition-name: topbar; }
.bottombar { view-transition-name: bottombar; }
.page, .spanel { animation: pagein .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pagein { from { opacity: 0; transform: translateY(8px); } }
html.reduce-motion .page, html.reduce-motion .spanel { animation: none; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } .page, .spanel { animation: none; } }

.ban-box { margin: .4rem 0 1.2rem; border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; text-align: left; }
.ban-box div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; } .ban-box div + div { border-top: 1px solid var(--line); }

/* ===================== Page loader (your avatar dancing) ===================== */
html.pl-wait body > *:not(#pageLoader):not(.toasts):not(.gate) { visibility: hidden; }
.pl { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  background: radial-gradient(ellipse at 50% 38%, #18213a 0%, var(--bg) 62%); color: var(--text); opacity: 1; transition: opacity .38s ease, visibility .38s; view-transition-name: pageloader; }
.pl.pl-out { opacity: 0; visibility: hidden; pointer-events: none; }
.pl.pl-leaving { opacity: 1; visibility: visible; animation: plIn .22s ease both; }
@keyframes plIn { from { opacity: 0; } }
.pl-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(79,140,255,.22), transparent 65%); filter: blur(10px); animation: plPulse 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes plPulse { 50% { transform: scale(1.12); opacity: .7; } }
.pl-stage { position: relative; width: min(300px, 70vw); aspect-ratio: 1; }
.pl-avatar { position: absolute; inset: 0; opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .5s, transform .6s cubic-bezier(.2,.8,.2,1); z-index: 2; }
.pl-avatar.in { opacity: 1; transform: none; }
.pl-avatar canvas { width: 100% !important; height: 100% !important; display: block; }
.pl-spot { position: absolute; left: 50%; top: -30%; width: 70%; height: 130%; transform: translateX(-50%); background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 80%); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); pointer-events: none; }
.pl-floor { position: absolute; left: 50%; bottom: 7%; width: 62%; height: 14%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(124,92,255,.55), rgba(79,140,255,.15) 55%, transparent 72%); filter: blur(2px); animation: plFloor 1.1s ease-in-out infinite alternate; }
@keyframes plFloor { to { transform: translateX(-50%) scale(1.1); opacity: .75; } }
.pl-brand { display: flex; align-items: center; gap: .14em; font-weight: 900; font-size: 1.5rem; margin-top: .4rem; letter-spacing: -.01em; }
.pl-brand .logo-mark { width: 1.6rem; height: 1.6rem; font-size: 1rem; border-radius: 8px; }
.pl-text { color: var(--dim); font-weight: 600; min-height: 1.5em; }
.pl-dots i { font-style: normal; animation: plDot 1.2s infinite; } .pl-dots i:nth-child(2) { animation-delay: .2s; } .pl-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes plDot { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }
.pl-bar { width: 180px; height: 4px; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.08); margin-top: .4rem; }
.pl-bar i { display: block; width: 40%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--acc), var(--acc2)); animation: plBar 1.1s ease-in-out infinite; }
@keyframes plBar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
/* something went wrong: the avatar turns sad, the light goes red, then the error appears */
.pl.pl-sad .pl-glow { background: radial-gradient(circle, rgba(255,93,108,.2), transparent 65%); animation: none; }
.pl.pl-sad .pl-floor { background: radial-gradient(ellipse, rgba(120,120,140,.35), transparent 70%); animation: none; }
.pl.pl-sad .pl-bar { display: none; }
.pl-err { width: min(420px, 90vw); text-align: center; margin-top: .6rem; opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s; }
.pl-err.in { opacity: 1; transform: none; }
.pl-err h2 { font-size: 1.45rem; margin: 0 0 .5rem; }
.pl-code { display: inline-block; font-weight: 800; font-size: .85rem; color: #ff8a8a; background: rgba(255,93,108,.12); border: 1px solid rgba(255,93,108,.3); border-radius: 999px; padding: .25rem .85rem; margin-bottom: .8rem; word-break: break-word; }
.pl-err p { color: #c9d0dc; margin: 0 0 1rem; }
.pl-btns { display: flex; gap: .6rem; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .pl, .pl-avatar { transition: none; } .pl-glow, .pl-floor, .pl-bar i { animation: none; } }

/* ===================== Party ===================== */
.party-fab { position: fixed; left: 18px; bottom: 18px; z-index: 70; display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .95rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(23,27,36,.92); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.party-fab.in-party { border-color: var(--acc); background: linear-gradient(135deg, rgba(79,140,255,.25), rgba(124,92,255,.25)), rgba(23,27,36,.92); }
.party-panel { position: fixed; left: 18px; bottom: 70px; z-index: 71; width: min(330px, calc(100vw - 36px)); max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 18px; padding: .9rem; box-shadow: var(--shadow); }
.pp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.pt-chat { margin: .5rem 0; max-height: 150px; overflow: auto; font-size: .85rem; background: rgba(255,255,255,.04); border-radius: 10px; padding: .45rem .6rem; display: grid; gap: .2rem; }
.btn.block { width: 100%; }
@media (max-width: 760px) { .party-fab { bottom: 84px; left: 12px; } .party-panel { bottom: 134px; left: 12px; } }
html.studio .party-fab, html.studio .party-panel { display: none; }

/* on Home (desktop) the party lives on the side rail */
@media (min-width: 761px) {
  .home2-body .party-fab { display: none; }
  .party-panel.from-rail, .home2-body .party-panel { left: 88px; bottom: auto; top: 50%; transform: translateY(-30%); }
}

/* room UI elements (js/core/gui.js) — used by the game and Studio's preview */
.gui { position: absolute; box-sizing: border-box; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; font-weight: 700; line-height: 1.15; padding: 0 .4em; white-space: pre-wrap; word-break: break-word; pointer-events: none; }
.gui-hidden { display: none !important; }
.gui-label { text-shadow: 0 2px 8px rgba(0,0,0,.55); }
.gui-button { pointer-events: auto; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.3); transition: transform .1s, filter .15s; user-select: none; }
.gui-button:hover { filter: brightness(1.12); } .gui-button:active { transform: scale(.96); }
.gui-icon { padding: 0; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.gui-bar { padding: 0; justify-content: flex-start; position: absolute; }
.gui-bar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .25s; }
.gui-bar span { position: relative; width: 100%; font-size: .8em; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* search suggestions (js/core/search-suggest.js) */
.sg-host { position: relative; z-index: 120; }
.sg-box { position: fixed; z-index: 400; background: #141821; backdrop-filter: blur(14px); border: 1px solid var(--line2, rgba(255,255,255,.14)); border-radius: 16px; padding: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.45); transform-origin: top; animation: sgOpen .16s ease-out; min-width: 260px; }
@keyframes sgOpen { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } }
.sg-ai, .sg-row { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border-radius: 11px; color: var(--text); text-decoration: none; font: inherit; text-align: left; background: none; border: 0; cursor: pointer; }
.sg-ai { background: linear-gradient(135deg, rgba(79,140,255,.18), rgba(160,90,255,.18)); margin-bottom: 4px; font-weight: 700; }
.sg-ai em { font-style: normal; font-weight: 500; color: var(--dim); } .sg-ai kbd { font: 700 .66rem ui-monospace, monospace; padding: .15rem .4rem; border-radius: 6px; background: rgba(255,255,255,.1); color: var(--dim); }
.sg-ai:hover, .sg-ai.on { background: linear-gradient(135deg, rgba(79,140,255,.32), rgba(160,90,255,.32)); }
.sg-row:hover, .sg-row.on { background: rgba(255,255,255,.07); }
.sg-row.sg-new { animation: sgSlide .28s cubic-bezier(.2,1,.35,1) both; animation-delay: var(--d, 0ms); }
@keyframes sgSlide { from { opacity: 0; transform: translateY(-12px); } }
.sg-ic { font-size: 1.1rem; } .sg-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sg-name b { color: var(--acc); }
.sg-by { display: block; font-size: .75rem; color: var(--dim); } .sg-go { color: var(--dim); font-size: .85rem; }
.sg-none { padding: .5rem .7rem; font-size: .82rem; color: var(--dim); animation: sgSlide .25s ease-out; }
.grow { flex: 1; min-width: 0; }

/* daily tasks (menu pages and the game) */
.daily { display: grid; gap: .5rem; } .daily-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; } .daily-top b { font-size: 1.15rem; }
.daily-bar { height: 9px; border-radius: 9px; background: rgba(127,140,160,.22); overflow: hidden; } .daily-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #ffc83d, #ff9f1c); transition: width .5s; } .daily-bar.sm { height: 5px; margin-top: .35rem; } .daily-bar.sm i { background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.daily-row { display: flex; align-items: center; gap: .8rem; padding: .6rem .75rem; border-radius: 14px; background: rgba(127,140,160,.09); } .daily-row .grow { flex: 1; min-width: 0; } .daily-row .di { font-size: 1.3rem; } .daily-row .dt { font-weight: 600; font-size: .92rem; } .daily-row .dp { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-size: .88rem; } .daily-row.done .daily-bar.sm i { background: var(--good); } .good { color: var(--good); }

/* who can get in (rooms and houses) */
.access-row { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; cursor: pointer; } .access-row input { margin-top: .25rem; }
.link-box { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; } .link-box .input { flex: 1 1 200px; min-width: 0; } .link-box p { flex-basis: 100%; margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--acc); font: inherit; cursor: pointer; text-decoration: underline; }
