:root {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-text-size-adjust:100%;
  line-height:1.5;
}
* {box-sizing:border-box}
html {min-height:100%;scroll-padding:20px}
body {
  margin:0;min-width:280px;min-height:100vh;
  background:var(--page);background-attachment:fixed;color:var(--ink);
  font-size:16px;-webkit-font-smoothing:antialiased;
  --font-title:inherit;--card-radius:25px;--small-radius:15px;--nav-radius:28px;
  --shell-shadow:inset 0 1px 1px #ffffffe5,0 8px 28px -20px #61364f55;
  --cat-fur:#ffdcad;--cat-line:#623746;--cat-pink:#efa09c;
  --warm:#f3a3ae;--bright:#d889ab;--light:#ffe1b5;--art-line:#85465b;
  --pale:var(--soft);--accent2:var(--secondary);--nav:var(--bar);--shadow:var(--shell-shadow);
  --round:var(--card-radius);
}
body[data-style="sunset"] {
  color-scheme:light;
  --ink:#482e40;--muted:#705665;--accent:#a54063;--on-accent:#fff8f5;--secondary:#d77b82;
  --soft:#fae3e5;--panel:#fff9f6e8;--solid:#fff8f5;--line:#e8cbd2;--brightline:#fffaf4;
  --wash:linear-gradient(120deg,#fff2e3 2%,#f9dce4 51%,#ebd6f5);--button:linear-gradient(125deg,#a94365,#b35467 87%);--page:radial-gradient(ellipse at 10% 4%,#fff0d9 0,transparent 45%),radial-gradient(ellipse at 90% 18%,#eedff7 0,transparent 45%),linear-gradient(130deg,#fff8f0,#fff0ee 64%,#f6e9f1);
  --bar:#fff3f0ec;--selected:#f5d7df;--portrait:url("assets/sunset/hearth.webp");--face-x:77%;--face-y:36%;--zoom:410%;
  --sample:linear-gradient(145deg,#ffe8aa 4%,#edabb6 48%,#c8a2e8 95%);
  --card-radius:26px;--small-radius:16px;--logo:linear-gradient(147deg,#ffdaa9,#efaeb3 64%,#ddb4db);
}
body[data-style="glass"] {
  color-scheme:light;--ink:#322a45;--muted:#61586f;--accent:#685196;--on-accent:#fff;--secondary:#947bb9;
  --soft:#ece5f8;--panel:#ffffffb8;--solid:#fbf9ff;--line:#d9d0e8;--brightline:#fff;
  --wash:radial-gradient(ellipse at 85% 100%,#c7ddfb,transparent 48%),linear-gradient(128deg,#f7e9f3,#e2d5f8 60%,#d8ecfc);
  --button:linear-gradient(145deg,#56416d,#44354f);--page:radial-gradient(ellipse at 9% 10%,#eee6fa,transparent 47%),radial-gradient(ellipse at 90% 22%,#e2ebf9,transparent 42%),linear-gradient(140deg,#f8f5fa,#fbf5f9 65%,#edf3fb);
  --bar:#f8f5ffe3;--selected:#e9dff7;--portrait:url("assets/glass/cloud.webp");--face-x:80%;--face-y:29%;--zoom:375%;
  --sample:linear-gradient(145deg,#f4dcff,#a5bbff 58%,#ffe6d5);--logo:linear-gradient(145deg,#e7dafa,#c6c3f5 67%,#ccdcff);
  --cat-fur:#fff0d4;--cat-line:#57405e;--warm:#cfb4ee;--bright:#aaa6e9;--light:#e1d9ff;--art-line:#68558b;
  --shell-shadow:inset 0 1px 2px #fff,0 9px 30px -22px #49357566;
}
body[data-style="paper"] {
  color-scheme:light;--ink:#27203a;--muted:#625461;--accent:#aa2945;--on-accent:#fff7e3;--secondary:#be5948;
  --soft:#f6e6bf;--panel:#fff7df;--solid:#fff5dc;--line:#c9b28d;--brightline:#e8d6b0;
  --wash:repeating-linear-gradient(0deg,#0000 0 4px,#ae794208 4px 5px),linear-gradient(115deg,#fff0bf,#f8e4b8 55%,#efce9f);
  --button:#ab2d46;--page:repeating-linear-gradient(0deg,#0000 0 3px,#b4814220 4px,#0000 4.4px),#fff1d4;
  --bar:#fff4ddef;--selected:#f4dfb6;--portrait:url("assets/paper/gazette.webp");--face-x:50%;--face-y:33%;--zoom:305%;
  --sample:linear-gradient(130deg,#eed486 43%,#b33b4d 44% 67%,#302743 68%);--logo:#c64654;
  --cat-fur:#ffe5a4;--cat-line:#302438;--cat-pink:#efa471;--warm:#dc8b6f;--bright:#c1ab65;--light:#f8d69b;--art-line:#5c3d43;
  --font-title:Georgia,"Times New Roman",serif;--card-radius:10px;--small-radius:8px;--nav-radius:15px;
  --shell-shadow:2px 3px 0 #6d4d572b;
}
body[data-style="night"] {
  color-scheme:dark;--ink:#f0f3ff;--muted:#b5bed4;--accent:#ffcb94;--on-accent:#312236;--secondary:#b398e2;
  --soft:#243147;--panel:#152035ed;--solid:#152136;--line:#344459;--brightline:#40546c;
  --wash:radial-gradient(ellipse at 83% 39%,#3a385c 0,transparent 48%),linear-gradient(125deg,#172a43,#202b43 70%,#2a2841);
  --button:linear-gradient(139deg,#ffd6a5,#f3b77e);--page:radial-gradient(ellipse at 9% 8%,#15233a 0,transparent 45%),radial-gradient(ellipse at 90% 66%,#1b233b 0,transparent 49%),#0b1321;
  --bar:#152135ee;--selected:#343044;--portrait:url("assets/night/astronaut.webp");--face-x:77%;--face-y:29%;--zoom:320%;
  --sample:radial-gradient(circle at 31% 60%,#f9c794 0 10%,transparent 12%),linear-gradient(140deg,#13283d 29%,#587188 55%,#17182f 70%);--logo:linear-gradient(135deg,#35465b,#202f48);
  --cat-fur:#efc199;--cat-line:#493847;--cat-pink:#eaa090;--warm:#eba5a8;--bright:#aca2da;--light:#6a84a4;--art-line:#323e5b;
  --card-radius:20px;--small-radius:13px;--shell-shadow:inset 0 1px 0 #e2f1ff0e,0 9px 24px #02040a33;
}
button,input,select,textarea {font:inherit;color:inherit}
button {cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;border:0;background:none}
button:disabled {cursor:default;opacity:.57}
img {max-width:100%;display:block}
a,button,input,textarea,select {outline:none}
:where(a,button,input,textarea,select):focus-visible {outline:3px solid var(--accent);outline-offset:3px}
h1,h2,h3,p {margin:0}
svg {display:block}
.icon {width:1.25em;height:1.25em;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
[data-icon] {display:inline-flex;align-items:center;justify-content:center;font-style:normal}
.sprite {position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}
[hidden] {display:none!important}
.sr {position:absolute;inset:auto auto auto -9999px;width:1px;height:1px;overflow:hidden}
.skip-link {z-index:30;position:fixed;left:12px;top:-90px;background:var(--solid);color:var(--accent);padding:10px 14px;border-radius:10px}
.skip-link:focus {top:10px}
.app {min-height:100vh;min-height:100dvh}
#workspace,.top-inner {width:min(100%,1156px);margin-inline:auto;padding-inline:28px}
#workspace {padding-bottom:calc(123px + env(safe-area-inset-bottom));outline:none}
.screen:not(.active) {display:none}
.top {position:relative;z-index:5}
.top-inner {min-height:84px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding-top:env(safe-area-inset-top)}
.brand {display:flex;align-items:center;gap:11px;padding:0;text-align:left;font-size:clamp(18px,2vw,23px);letter-spacing:-.045em;font-family:var(--font-title);font-weight:650;line-height:1.06}
.brand b {font-weight:inherit}
.brand-mark {width:43px;height:43px;border-radius:14px;background:var(--logo);display:grid;place-items:center;box-shadow:inset 0 1px 1px #ffffff91,0 3px 10px #271b3520}
.brand-mark svg {width:91%;height:91%;transform:rotate(-6deg)}
.theme-inline,#theme,.theme-menu {background:var(--panel);border:1px solid var(--line);box-shadow:var(--shell-shadow)}
.theme-inline {display:flex;align-items:center;gap:3px;padding:4px;border-radius:999px}
.theme-button,.palette-choice {display:flex;align-items:center;justify-content:center;gap:7px;font-size:14px;font-weight:570;line-height:1.18;color:var(--muted)}
.theme-button {padding:8px 12px;border-radius:999px;min-height:36px;white-space:nowrap}
.theme-button.active,.theme-button[aria-pressed=true] {background:var(--soft);box-shadow:inset 0 0 0 1px var(--line);color:var(--ink)}
.sample,.current-sample {width:16px;height:16px;display:inline-block;border-radius:50%;border:1px solid #42334731;flex:none;box-shadow:inset 0 1px 1px #ffffff9e}
.current-sample {background:var(--sample)}
.sample-sunset {background:linear-gradient(145deg,#ffe6a4,#eeacb4 53%,#c9a4e8)}
.sample-glass {background:linear-gradient(145deg,#f3dcff,#a7bdff 61%,#ffe6d5)}
.sample-paper {background:linear-gradient(130deg,#f7dc91 43%,#b0394b 44% 67%,#352642 68%)}
.sample-night {background:radial-gradient(circle at 31% 60%,#ffc795 0 10%,transparent 12%),linear-gradient(140deg,#162d45 29%,#638198 55%,#17182f 70%)}
.theme-compact {display:none;position:relative}
#theme {border-radius:99px;display:flex;align-items:center;gap:7px;padding:9px 12px;font-size:14px;font-weight:600;min-height:42px}
.caret {width:7px;height:7px;display:block;border-right:1.6px solid;border-bottom:1.6px solid;transform:translateY(-2px) rotate(45deg)}
#theme[aria-expanded=true] .caret {transform:translateY(2px) rotate(225deg)}
.theme-menu {position:absolute;right:0;top:calc(100% + 7px);min-width:155px;padding:6px;display:grid;gap:3px;border-radius:var(--small-radius);background:var(--solid)}
.theme-menu .theme-button {justify-content:flex-start;padding:10px;min-height:42px;border-radius:calc(var(--small-radius) - 4px)}
.connection {font-size:14px;color:var(--ink);background:var(--soft);border:1px solid var(--line);padding:10px 14px;margin:0 0 12px;border-radius:var(--small-radius);overflow-wrap:anywhere}
.nav {position:fixed;z-index:8;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;gap:3px;padding:5px;max-width:calc(100vw - 16px);border-radius:var(--nav-radius);border:1px solid var(--line);background:var(--bar);-webkit-backdrop-filter:blur(22px) saturate(1.3);backdrop-filter:blur(22px) saturate(1.3);box-shadow:var(--shell-shadow),0 8px 23px #38213721}
.nav button {display:flex;align-items:center;justify-content:center;gap:8px;min-height:45px;padding:7px 15px;border-radius:calc(var(--nav-radius) - 5px);font-size:14px;font-weight:570;color:var(--muted);line-height:1.1}
.nav i,.nav .icon {width:20px;height:20px;flex:none}
.nav button.active {background:var(--selected);color:var(--accent)}
.nav button:not(.active):hover,.theme-button:not(.active):hover,.palette-choice:not(.active):hover {background:var(--soft);color:var(--ink)}
.portrait {flex:none;border-radius:50%;background:var(--soft) var(--portrait) var(--face-x) var(--face-y) / var(--zoom) auto no-repeat}
.care-strip {display:flex;align-items:center;gap:16px;background:var(--panel);border:1px solid var(--line);box-shadow:var(--shell-shadow);border-radius:var(--card-radius);padding:18px 23px;margin-top:22px}
.care-portrait {position:relative;width:58px;height:58px;border:2px solid var(--brightline)}
.accessory {position:absolute;left:50%;top:0;transform:translate(-50%,-27%);font-size:23px;line-height:1;pointer-events:none}
.accessory.glasses {top:35%;font-size:21px}
.accessory.bow {top:12%;left:80%}
.care-copy {flex:1;min-width:0}
.care-copy h2 {display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;color:var(--ink);font:650 20px/1.25 var(--ui,system-ui,sans-serif);letter-spacing:-.035em}
#mood-tag {font:500 13px/1.2 system-ui,sans-serif;color:var(--muted);letter-spacing:0}
.care-copy p {margin-top:4px;font-size:14px;line-height:1.4;color:var(--muted);max-width:52ch}
.care-actions {display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.primary,.secondary,.mini,.circle-btn,#sheet-content .secondary {display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:10px 15px;border-radius:var(--small-radius);font-weight:620;line-height:1.2;min-height:43px;text-align:center}
.primary,.chat-input button {color:var(--on-accent);background:var(--button);border:1px solid transparent}
.secondary,.mini,.circle-btn {background:var(--solid);border:1px solid var(--line);color:var(--ink)}
.mini {padding:8px 12px;font-size:14px;min-height:39px}
.circle-btn {width:42px;height:42px;min-height:42px;padding:0;border-radius:50%;flex:none}
.primary:hover,.chat-input button:hover {filter:brightness(1.06)}
.secondary:hover,.mini:hover,.circle-btn:hover {background:var(--soft)}
.page-lead {isolation:isolate;overflow:hidden;position:relative;display:flex;align-items:center;justify-content:space-between;gap:24px;background:var(--wash);border:1px solid var(--brightline);border-radius:var(--card-radius);box-shadow:var(--shell-shadow);padding:30px clamp(22px,4.2vw,54px);min-height:193px;margin-bottom:20px}
.page-lead-copy {max-width:75%;position:relative;z-index:1}
.section-mark {width:34px;height:34px;border-radius:12px;background:var(--panel);color:var(--accent);border:1px solid var(--brightline);margin-bottom:12px}
.page-lead h1,.profile-heading h1,.chat-intro h1 {font-family:var(--font-title);font-size:clamp(33px,4.4vw,58px);font-weight:650;line-height:1.025;letter-spacing:-.058em;text-wrap:balance}
.page-lead p,.chat-intro p {color:var(--muted);font-size:16px;line-height:1.42;margin-top:10px}
.banner-art {position:absolute;pointer-events:none;right:3%;height:100%;width:25%;min-width:165px;top:0}
.arcade-art .game-art {position:absolute;width:48%;height:auto}
.arcade-art .game-art:nth-child(1) {left:7%;top:36%;transform:rotate(-10deg)}
.arcade-art .game-art:nth-child(2) {right:17%;top:11%;transform:rotate(12deg)}
.arcade-art .game-art:nth-child(3) {right:-5%;top:44%;width:35%}
.game-art {overflow:visible;filter:drop-shadow(0 5px 5px #471e3815)}
:is(.game-art,.charm-art) :where(.soft,.warm,.bright) {stroke:var(--art-line);stroke-width:1.6;stroke-linejoin:round}
 :is(.game-art,.charm-art) .soft {fill:var(--light)}
 :is(.game-art,.charm-art) .bright {fill:var(--bright)}
 :is(.game-art,.charm-art) .warm {fill:var(--warm)}
:is(.game-art,.charm-art) :where(.thread,.mark,.loop,.shine) {fill:none;stroke-linecap:round;stroke-linejoin:round}
 :is(.game-art,.charm-art) .thread {stroke:var(--art-line);stroke-width:1.8}
 :is(.game-art,.charm-art) .mark {stroke:var(--accent);stroke-width:3}
 :is(.game-art,.charm-art) .loop {stroke:var(--art-line);stroke-width:2.6}
 :is(.game-art,.charm-art) .shine {stroke:#fff4de;stroke-width:2.8}
.journal-art {display:grid;place-items:center}
.journal-page {position:absolute;width:43%;height:62%;max-width:110px;max-height:145px;border-radius:4px;border:1.6px solid var(--art-line);box-shadow:4px 5px 0 #5430451d}
.page-back {transform:rotate(-13deg) translate(-8%,4%);background:var(--warm)}
.page-front {transform:rotate(9deg) translate(14%,0);background:var(--solid);padding:7%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5%}
.page-front svg {height:53%;width:auto}
.page-front span,.page-front b {width:100%;height:7%;display:block;background:var(--secondary);opacity:.65}
.page-front b {width:63%;align-self:flex-start}
.game-grid,.discover-grid {display:grid;gap:14px}
.game-grid {grid-template-columns:repeat(4,minmax(0,1fr))}
.game-card,.list-item,.box,.thread-shell,.chat-side {background:var(--panel);border:1px solid var(--line);border-radius:var(--card-radius);box-shadow:var(--shell-shadow)}
.game-card {min-width:0;overflow:hidden;text-align:left;padding:8px;display:flex;flex-direction:column;align-items:stretch}
.game-cover {position:relative;isolation:isolate;min-height:110px;display:grid;place-items:center;border-radius:calc(var(--card-radius) - 7px);background:radial-gradient(ellipse at 23% 0%,var(--panel),transparent 72%),var(--cover,var(--soft));overflow:hidden}
.game-cover::before,.game-cover::after {content:"";position:absolute;border:1px solid color-mix(in srgb,var(--accent) 15%,transparent);border-radius:50%;width:145px;height:145px;right:-73px;top:-55px}
.game-cover::after {width:112px;height:112px;right:-56px;top:-39px}
.game-cover .game-art {width:73px;height:73px;transform:rotate(-4deg);transition:transform .2s}
.game-card:nth-child(3n + 1) {--cover:color-mix(in srgb,var(--warm) 28%,var(--solid))}
.game-card:nth-child(3n + 2) {--cover:color-mix(in srgb,var(--bright) 21%,var(--solid))}
.game-card:nth-child(3n) {--cover:color-mix(in srgb,var(--light) 48%,var(--solid))}
.game-label {padding:12px 10px 9px;display:flex;flex-direction:column;gap:4px}
.game-label strong,.list-item h3 {font-family:var(--font-title);font-size:19px;line-height:1.15;letter-spacing:-.035em}
.game-label small,.list-item p {color:var(--muted);font-size:14px;line-height:1.32}
.game-card:hover,.list-item:hover {border-color:var(--accent)}
.game-card:hover .game-art {transform:rotate(3deg) scale(1.06)}
.resume {margin-bottom:16px}
.discover-grid {grid-template-columns:repeat(3,minmax(0,1fr))}
.list-item {display:flex;align-items:flex-start;flex-direction:column;gap:17px;padding:22px;text-align:left;min-height:143px;position:relative;overflow:hidden}
.tile-icon {width:44px;height:44px;display:grid;place-items:center;border-radius:15px;color:var(--accent);background:var(--soft);border:1px solid var(--line)}
.tile-icon .icon {width:24px;height:24px}
.list-item p {margin-top:5px}
.list-item:nth-child(3n+1) .tile-icon {background:color-mix(in srgb,var(--warm) 27%,var(--solid))}
.list-item:nth-child(3n+2) .tile-icon {background:color-mix(in srgb,var(--bright) 25%,var(--solid))}
.list-item:nth-child(3n) .tile-icon {background:color-mix(in srgb,var(--light) 38%,var(--solid))}
.chat-layout {display:grid;grid-template-columns:minmax(230px,.7fr) minmax(0,1.6fr);gap:17px;align-items:stretch}
.chat-side {position:relative;isolation:isolate;overflow:hidden;padding:0 0 22px;display:flex;flex-direction:column;background:var(--wash)}
.chat-character {position:relative;isolation:isolate;height:250px;flex:1;min-height:230px;max-height:330px;background:var(--portrait) var(--face-x) 45% / cover no-repeat}
.chat-character::after {content:"";position:absolute;inset:auto 0 0;height:35%;background:linear-gradient(to bottom,transparent,var(--soft));opacity:.8}
.chat-character .portrait {display:none}
.chat-intro {padding:22px 25px 12px}
.chat-intro h1 {font-size:clamp(32px,3.3vw,46px)}
.chat-intro p {font-size:14px;overflow-wrap:anywhere}
.chat-account {display:flex;align-items:center;gap:10px;margin:auto 24px 0;padding-top:22px}
.mini-portrait {width:40px;height:40px}
.chat-account b,.chat-account small {display:block;line-height:1.2}
.chat-account b {font-size:15px}
.chat-account small {margin-top:3px;color:var(--muted);font-size:13px}
.thread-shell {overflow:hidden;display:flex;flex-direction:column;min-width:0}
.thread-head {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 20px;border-bottom:1px solid var(--line)}
.thread-id {display:flex;align-items:center;gap:8px;font-weight:600}
.thread-icon {color:var(--accent)}
.chat-box {display:flex;flex-direction:column;align-items:flex-start;gap:10px;min-height:210px;height:clamp(270px,39vh,480px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;padding:20px;background:linear-gradient(152deg,color-mix(in srgb,var(--soft) 43%,transparent),transparent 66%);}
.chat-box .bubble {max-width:min(86%,52ch);padding:11px 15px;border:1px solid var(--line);border-radius:var(--small-radius) var(--small-radius) var(--small-radius) 4px;color:var(--ink);background:var(--solid);font-size:16px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-box .bubble.me {align-self:flex-end;color:var(--on-accent);border-color:transparent;background:var(--button);border-radius:var(--small-radius) var(--small-radius) 4px var(--small-radius)}
.chat-compose {padding:14px 18px;border-top:1px solid var(--line)}
.chips {display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.chips button {padding:6px 11px;min-height:34px;font-size:13px;line-height:1.2;color:var(--accent);background:var(--soft);border:1px solid transparent;border-radius:999px}
.chips button:hover {border-color:var(--accent)}
.chat-input {display:flex;align-items:stretch;gap:7px}
.field {color:var(--ink);background:var(--solid);border:1px solid var(--line);border-radius:calc(var(--small-radius) - 3px);width:100%;padding:9px 12px;min-width:0;min-height:43px;line-height:1.35;font-size:16px}
.field::placeholder {color:var(--muted);opacity:.8}
select.field {appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 17px) center,calc(100% - 12px) center;background-size:5px 5px;background-repeat:no-repeat;padding-right:30px;cursor:pointer}
.chat-input .field {min-height:45px}
.chat-input button {width:46px;flex:none;border-radius:var(--small-radius);display:grid;place-items:center}
.chat-input button .icon {width:20px;height:20px}
.muted-note,.caption {color:var(--muted);font-size:14px;line-height:1.45}
#chat-privacy {margin-top:8px;font-size:13px}
.profile-heading {padding:6px 0 21px}
.profile-grid {display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);gap:16px;align-items:start}
.profile-col {display:grid;gap:16px}
.box {padding:21px 23px;min-width:0;overflow:hidden}
.box>label,.form-pair label {display:block;font-size:14px;line-height:1.3;margin:13px 0 6px;color:var(--muted);font-weight:550}
.box-title {display:flex;align-items:center;gap:10px;margin-bottom:12px}
.box-title>i {width:32px;height:32px;flex:none;border-radius:10px;color:var(--accent);background:var(--soft)}
.box-title .icon {width:18px;height:18px}
.box-title h2,.profile-intro h2,.sheet-top h2 {font-family:var(--font-title);font-weight:650;letter-spacing:-.04em;line-height:1.12}
.box-title h2 {font-size:22px}
.identity-box {position:relative;padding-top:0}
.identity-cover {height:71px;margin:0 -23px;background:var(--wash);border-bottom:1px solid var(--line);position:relative;overflow:hidden}
.identity-cover::before,.identity-cover::after {content:"";position:absolute;inset:-175% -15% auto auto;width:88%;height:344%;border:1px solid var(--secondary);border-radius:50%;opacity:.34;transform:rotate(19deg)}
.identity-cover::after {right:-23%;top:-190%;opacity:.22}
.profile-intro {position:relative;display:flex;align-items:flex-end;gap:13px;margin:-25px 0 19px}
.profile-avatar {width:76px;height:76px;border:3px solid var(--solid);box-shadow:0 3px 12px #31213520}
.profile-intro h2 {font-size:26px;overflow-wrap:anywhere}
.profile-intro p {color:var(--muted);font-size:14px}
.segment,.wardrobe,.palette-list {display:grid;gap:6px}
.segment {grid-template-columns:1fr 1fr;padding:3px;border:1px solid var(--line);background:var(--soft);border-radius:var(--small-radius)}
.segment button {border-radius:calc(var(--small-radius) - 4px);padding:7px 8px;min-height:36px;color:var(--muted);font-size:14px;font-weight:600}
.segment button.active {background:var(--solid);color:var(--ink);box-shadow:0 2px 5px #44304418}
.wardrobe,.palette-list {grid-template-columns:repeat(4,minmax(0,1fr))}
.wardrobe button,.palette-choice {border:1px solid var(--line);border-radius:var(--small-radius);background:var(--solid);color:var(--muted);min-width:0;min-height:55px;padding:7px 3px}
.wardrobe button {display:grid;align-content:center;justify-items:center;gap:3px;font-size:12px;line-height:1.2}
.wardrobe button>span {font-size:24px}
.wardrobe button.active,.palette-choice.active {background:var(--soft);border-color:var(--accent);color:var(--ink)}
.palette-choice {flex-direction:column;min-height:67px;font-size:13px;gap:6px}
.palette-choice .sample {width:24px;height:24px}
.switch-row {display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0}
.switch-row + .switch-row,.palette-list + .switch-row {border-top:1px solid var(--line)}
.palette-list + .switch-row {margin-top:17px;padding-bottom:0}
.switch-row strong {display:block;font-size:15px;font-weight:620}
.switch-row p {font-size:13px;color:var(--muted);line-height:1.4;margin-top:3px}
.switch {display:block;width:47px;height:28px;padding:3px;flex:none;position:relative;border:1px solid color-mix(in srgb,var(--muted) 22%,var(--line));border-radius:99px;background:color-mix(in srgb,var(--muted) 20%,var(--solid));transition:background .2s}
.switch::after {content:"";display:block;width:20px;height:20px;border-radius:50%;background:var(--solid);box-shadow:0 1px 4px #2d19353b;transition:transform .2s}
.switch.on,.switch[aria-checked=true] {background:var(--button)}
.switch.on::after,.switch[aria-checked=true]::after {transform:translateX(18px);background:var(--on-accent)}
.form-pair {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.stats {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:16px}
.stats>* {display:flex;flex-direction:column;align-items:flex-start;padding:11px 13px;color:var(--ink);background:var(--soft);border-radius:var(--small-radius)}
.stats strong {font-size:25px;line-height:1.16;letter-spacing:-.05em}
.stats small {margin-top:2px;font-size:13px;color:var(--muted)}
.achievements {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.achievement {background:var(--solid);border:1px solid var(--line);border-radius:var(--small-radius);text-align:center;padding:9px 4px;min-height:63px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:1.22;color:var(--ink)}
.achievement span {font-size:19px}
.achievement.locked {color:var(--muted)}
.achievement.locked span {filter:grayscale(.78);opacity:.77}
#owner-panel .primary {margin-top:12px}
.profile-footer {display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:19px}
.profile-footer .muted-note {flex:1 1 260px;min-width:0}
.overlay {position:fixed;inset:0;z-index:16;display:none;align-items:center;justify-content:center;background:#25172c69;padding:max(16px,env(safe-area-inset-top)) 14px max(16px,env(safe-area-inset-bottom));-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}
.overlay.open {display:flex}
body:has(.overlay.open) {overflow:hidden}
.sheet {width:min(100%,580px);max-height:88vh;max-height:88dvh;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;color:var(--ink);border-radius:var(--card-radius);background:var(--solid);border:1px solid var(--line);box-shadow:0 25px 100px #1e112d55}
.sheet-top {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 22px;background:var(--wash);border-bottom:1px solid var(--line)}
.sheet-top h2 {font-size:clamp(21px,3vw,29px);min-width:0;overflow-wrap:anywhere}
#sheet-content {padding:20px 22px}
#sheet-content p {line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
#sheet-content>p+*,#sheet-content>*+p,#sheet-content>p+p,#sheet-content>.primary,#sheet-content>.field {margin-top:12px}
#sheet-content>*:first-child {margin-top:0}
.game-status {color:var(--ink);font-size:16px}
.notice {color:var(--muted);padding:11px 13px;background:var(--soft);border-radius:var(--small-radius)}
.reply-row {display:flex;gap:6px;margin-top:7px;width:100%}
.reply-row button {flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere;font-size:14px}
.reply-row.board3,.reply-row.board4,.reply-row.board8 {display:grid;gap:5px}
.reply-row.board3 {grid-template-columns:repeat(3,minmax(0,1fr))}
.reply-row.board4 {grid-template-columns:repeat(4,minmax(0,1fr))}
.reply-row.board8 {grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
.reply-row.board3 button,.reply-row.board4 button {padding:7px 3px;min-height:39px}
#sheet-content .reply-row.board8 button,.chat-box .reply-row.board8 button {padding:1px;min-height:30px;border-radius:5px;font-size:clamp(13px,3.9vw,22px);line-height:1.12}
.reply-row.board8 + .reply-row.board8 {margin-top:2px}
.admin-user {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
#sheet-content textarea {resize:vertical;min-height:72px}
/* The material and typography change together across the entire application. */
body[data-style="sunset"] .chat-intro h1,body[data-style="sunset"] .profile-heading h1,body[data-style="sunset"] .page-lead h1 {font-family:Georgia,"Times New Roman",serif;font-weight:600;letter-spacing:-.052em}
body[data-style="sunset"] .page-lead::before,body[data-style="sunset"] .identity-cover::before {content:"";position:absolute;inset:auto 10% -124px auto;width:280px;height:210px;border-radius:50%;background:radial-gradient(ellipse,#ffccae88,transparent 68%);pointer-events:none}
body[data-style="sunset"] .chat-box {background:radial-gradient(ellipse at 0 100%,#fae1d835,transparent 57%),linear-gradient(135deg,#fff3ed,#f9eaf23d)}
body[data-style="sunset"] .nav {border-color:#efd5d9;box-shadow:inset 0 1px 1px white,0 5px 25px #993c6726}
body[data-style="glass"] :where(.box,.list-item,.thread-shell,.theme-inline,.nav,.care-strip) {-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);border-color:#ffffffd4}
body[data-style="glass"] .page-lead::before {content:"";position:absolute;width:80%;height:230%;top:-150%;right:-14%;border-radius:50%;border:2px solid #ffffff70;box-shadow:0 5px 13px #d5baf659,inset 0 -3px 8px #ffffff91;transform:rotate(-14deg)}
body[data-style="paper"] .brand-mark,body[data-style="paper"] .section-mark,body[data-style="paper"] .tile-icon {border-radius:8px}
body[data-style="paper"] .brand {font-size:25px}
body[data-style="paper"] .page-lead {border:1px solid var(--line);border-top:3px double #504055;border-bottom:3px double #504055;box-shadow:none}
body[data-style="paper"] .page-lead h1,body[data-style="paper"] .chat-intro h1,body[data-style="paper"] .profile-heading h1 {letter-spacing:-.06em}
body[data-style="paper"] .section-mark {border:1px solid var(--line)}
body[data-style="paper"] .chat-box {background:repeating-linear-gradient(0deg,#0000 0 23px,#ad8a611c 23px 24px),#fff4d8}
body[data-style="paper"] .thread-head,body[data-style="paper"] .sheet-top {border-bottom:3px double var(--line)}
body[data-style="paper"] .care-copy h2,body[data-style="paper"] .game-label strong {font-family:var(--font-title)}
body[data-style="night"] .page-lead::before,body[data-style="night"] .identity-cover::before {content:"";position:absolute;inset:0;pointer-events:none;border:none;width:auto;height:auto;border-radius:0;transform:none;opacity:.66;background:radial-gradient(1px 1px at 71% 28%,#fff 50%,transparent),radial-gradient(1.5px 1.5px at 41% 19%,#fff 50%,transparent),radial-gradient(1px 1px at 53% 72%,#fff 50%,transparent),radial-gradient(1.5px 1.5px at 88% 64%,#fff 50%,transparent),radial-gradient(1px 1px at 22% 77%,#fff 50%,transparent),radial-gradient(1px 1px at 93% 23%,#fff 50%,transparent)}
body[data-style="night"] .brand-mark {border-radius:50%;box-shadow:inset 0 0 0 1px #6d7c9b80,0 2px 9px #02051080}
body[data-style="night"] .section-mark,body[data-style="night"] .tile-icon {border-radius:50%}
body[data-style="night"] .chat-box {background:radial-gradient(ellipse at 65% 26%,#232b4545,transparent 72%),#131d2e}
body[data-style="night"] .game-cover::before,body[data-style="night"] .game-cover::after {border-color:#d6c4ef2b;transform:rotate(-28deg) scaleY(.48)}
@media(max-width:900px) {
  .top-inner,#workspace {padding-inline:21px}
  .game-grid {grid-template-columns:repeat(3,minmax(0,1fr))}
  .game-cover {min-height:90px}
  .chat-layout {grid-template-columns:minmax(180px,.55fr) minmax(0,1.4fr);gap:12px}
  .chat-intro {padding:19px 17px 10px}
  .chat-account {margin-inline:17px}
  .care-strip {flex-wrap:wrap;gap:11px}
  .care-copy {flex:1 1 43%}
}
@media(max-width:700px) {
  .top-inner,#workspace {padding-inline:15px}
  .top-inner {min-height:68px;gap:8px}
  .brand-mark {width:37px;height:37px;border-radius:12px}
  .brand {font-size:18px;gap:8px}
  body[data-style="paper"] .brand {font-size:20px}
  .theme-inline {display:none}
  .theme-compact {display:block}
  .nav {width:min(455px,calc(100vw - 18px));display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px;bottom:max(7px,env(safe-area-inset-bottom));border-radius:22px;padding:4px}
  .nav button {min-width:0;flex-direction:column;gap:4px;padding:5px 2px;min-height:46px;border-radius:17px;font-size:11.5px;letter-spacing:-.015em}
  .nav .icon,.nav i {width:19px;height:19px}
  #workspace {padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  .care-strip {padding:14px 15px;margin-top:17px}
  .care-portrait {width:48px;height:48px}
  .care-copy {flex:1 1 calc(100% - 70px)}
  .care-copy h2 {font-size:18px}
  .care-actions {width:100%;margin-top:2px}
  .care-actions button {flex:1;padding:8px 6px}
  .page-lead {min-height:153px;margin-bottom:13px;padding:21px 18px;gap:10px}
  .page-lead-copy {max-width:75%}
  .page-lead h1,.profile-heading h1,.chat-intro h1 {font-size:clamp(28px,7vw,39px)}
  .page-lead p {font-size:14px;margin-top:7px;max-width:33ch}
  .section-mark {width:28px;height:28px;margin-bottom:8px;border-radius:9px}
  .section-mark .icon {width:17px;height:17px}
  .banner-art {min-width:88px;width:25%;right:1%;opacity:.88}
  .arcade-art .game-art:nth-child(1) {left:2%;top:44%;width:60%}
  .arcade-art .game-art:nth-child(2) {right:13%;top:23%;width:59%}
  .arcade-art .game-art:nth-child(3) {display:none}
  .journal-page {width:64%;height:48%}
  .game-grid,.discover-grid {gap:9px}
  .game-grid,.discover-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  .game-card {padding:6px}
  .game-cover {min-height:75px}
  .game-cover .game-art {width:57px;height:57px}
  .game-label {padding:8px 7px 7px;gap:3px}
  .game-label strong,.list-item h3 {font-size:17px}
  .game-label small,.list-item p {font-size:13px}
  .list-item {min-height:125px;padding:14px 13px;gap:10px}
  .tile-icon {width:34px;height:34px;border-radius:11px}
  .tile-icon .icon {width:21px;height:21px}
  .chat-layout {display:flex;flex-direction:column;gap:11px}
  .chat-side {min-height:102px;display:flex;flex-direction:row;align-items:center;padding:12px 14px;gap:13px}
  .chat-character {display:flex;align-items:center;justify-content:center;min-height:0;flex:none;height:auto;background:none}
  .chat-character::after {display:none}
  .chat-character .portrait {display:block;width:64px;height:64px;border:2px solid var(--brightline);box-shadow:var(--shell-shadow)}
  .chat-intro {padding:0;min-width:0}
  .chat-intro .section-mark,.chat-account {display:none}
  .chat-intro h1 {font-size:29px}
  .chat-intro p {margin-top:4px;font-size:13px}
  .thread-head {padding:8px 13px}
  .thread-head .mini {font-size:13px;min-height:34px}
  .chat-box {min-height:125px;height:clamp(145px,32dvh,400px);padding:13px}
  .chat-box .bubble {font-size:15px;padding:9px 12px;max-width:90%}
  .chat-compose {padding:10px 12px}
  .chips {gap:4px;margin-bottom:7px}
  .chips button {padding:5px 8px;font-size:12px;min-height:32px}
  .profile-grid {grid-template-columns:1fr;gap:12px}
  .profile-col {gap:12px}
  .profile-heading {padding:3px 0 15px}
  .box {padding:17px}
  .identity-box {padding-top:0}
  .identity-cover {margin:0 -17px;height:57px}
  .profile-avatar {width:68px;height:68px}
  .profile-intro h2 {font-size:24px}
  .box-title h2 {font-size:20px}
  .profile-footer {gap:8px}
  .profile-footer .secondary {font-size:14px}
  .profile-footer .muted-note {font-size:13px}
  .overlay {align-items:flex-end;padding:12px 0 0}
  .sheet {width:min(100%,580px);max-height:92vh;max-height:92dvh;border-radius:var(--card-radius) var(--card-radius) 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom)}
  .sheet-top {padding:13px 16px}
  #sheet-content {padding:15px 16px 20px}
}
@media(max-width:360px) {
  .top-inner,#workspace {padding-inline:10px}
  .brand {gap:5px;font-size:16px}
  .care-actions .mini {font-size:12px}
  .page-lead-copy {max-width:79%}
  .banner-art {right:-4%;opacity:.75}
  .game-label strong,.list-item h3 {font-size:16px}
  .wardrobe button {font-size:11.5px}
  .achievements {grid-template-columns:repeat(2,minmax(0,1fr))}
  .theme-compact #theme {padding:8px 9px}
}
@media(min-width:701px) and (max-width:780px) { .palette-choice {font-size:12px} .wardrobe {grid-template-columns:repeat(2,1fr)} .box {padding-inline:17px} }
@media(prefers-reduced-motion:reduce) {*,*::before,*::after {scroll-behavior:auto!important}}
/* The portrait identifies the chosen companion even when the room changes theme. */
body[data-persona="male"] {--companion-face:url("assets/welcome/male-face.webp")}
body[data-persona="female"] {--companion-face:url("assets/welcome/female-face.webp")}
body[data-persona] :is(.profile-avatar,.mini-portrait,.chat-character .portrait,.care-portrait) {background-image:var(--companion-face,var(--portrait));background-size:cover;background-position:center}
@media(min-width:701px) {
  body[data-persona] .chat-character {
    display:grid;place-items:center;overflow:hidden;isolation:isolate;
    background:var(--wash);
  }
  body[data-persona] .chat-character::before {
    content:"";position:absolute;z-index:-1;left:-35%;top:-60%;width:90%;height:145%;border-radius:50%;border:1px solid var(--brightline);box-shadow:9px 4px 0 color-mix(in srgb,var(--solid) 40%,transparent);transform:rotate(16deg);
  }
  body[data-persona] .chat-character::after {width:140%;height:80%;inset:auto -64% -56% auto;transform:rotate(-25deg);border-radius:50%;border:2px solid var(--brightline);background:none}
  body[data-persona] .chat-character .portrait {display:block;width:min(78%,205px);height:auto;aspect-ratio:1;border:4px solid var(--brightline);box-shadow:0 12px 28px color-mix(in srgb,var(--accent) 17%,transparent)}
  body[data-style="paper"][data-persona] .chat-character .portrait {border-radius:3px;transform:rotate(-4deg);border:6px solid #fffbdf;box-shadow:2px 4px 0 #4f3a4e3d}
  body[data-style="night"][data-persona] .chat-character .portrait {border:6px double #788698;box-shadow:0 0 0 5px #131a2b,0 8px 22px #02061378}
}
