:root {
  color-scheme: light;
  --paper: #faf6ea;
  --paper-glass: rgba(250, 246, 234, .94);
  --ink: #394432;
  --moss: #536446;
  --edge: #70765a40;
  --gutter: clamp(14px, 2.8vw, 42px);
  --top: max(var(--gutter), env(safe-area-inset-top));
  --bottom: max(var(--gutter), env(safe-area-inset-bottom));
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
}
#identity{width:min(22rem,calc(100% - 2rem));border:1px solid #c4c8aa;border-radius:1.4rem;background:#faf6ea;color:#394432;padding:1.35rem;box-sizing:border-box}
#identity::backdrop{background:#39443255}
#identity form{display:grid;gap:.7rem}
#identity h2{margin:0 0 .5rem}
#identity form div{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
#identity output{font-weight:700}
.guest-note{margin:.1rem 0;color:#596452;font-size:12px;line-height:1.55;word-break:keep-all}
#identity #google-entry:empty,#profile-message:empty{display:none}
#identity button,#identity select{min-height:44px;border:1px solid #b7c19e;border-radius:.7rem;background:#eff0df;color:inherit;padding:.45rem .7rem;font:inherit}
#identity button[type=submit]{background:#526646;color:#fff;margin-top:.4rem}
* { box-sizing: border-box; }
html, body { width:100%; height:100%; margin:0; overflow:hidden; overscroll-behavior:none; background:#c4cda5; }
#world { display:block; width:100%; height:100%; touch-action:none; outline:none; }
#hud { position:fixed; inset:0; pointer-events:none; transition:opacity .6s ease; user-select:none; -webkit-user-select:none; }
#hud.quiet { opacity:0; visibility:hidden; transition:opacity .6s ease, visibility 0s .6s; }
#hud.quiet * { pointer-events:none; }
button { font:inherit; color:inherit; cursor:pointer; touch-action:manipulation; border:0; background:none; -webkit-tap-highlight-color:transparent; }
button:focus-visible { outline:2px solid #48683c; outline-offset:2px; }
[hidden] { display:none !important; }
i[data-icon], i[data-icon] canvas { display:block; width:24px; height:24px; flex:none; }
.masthead { position:absolute; left:max(var(--gutter),env(safe-area-inset-left)); top:var(--top); }
.brand { display:flex; align-items:center; gap:9px; filter:drop-shadow(0 1px 2px #fff5dcbb); }
.brand i[data-icon], .brand canvas { width:38px; height:38px; }
h1 { margin:0; font:italic bold clamp(25px,3vw,37px)/1.12 Georgia, "Times New Roman", serif; letter-spacing:-.075em; }
.presence { margin:5px 0 0 3px; display:inline-flex; align-items:center; gap:7px; padding:4px 9px; border-radius:20px; background:#f9f6e5d9; }
.presence span { width:6px; height:6px; background:#698457; border-radius:50%; }
.presence b { font-size:11px; font-weight:600; letter-spacing:.01em; }
.wallet { margin:5px 0 0 4px; display:inline-flex; align-items:center; gap:5px; background:#f8edd5ed; border-radius:16px; padding:4px 9px; font-size:11px; font-weight:700; }
.wallet span { color:#a77e39; }
.utilities { position:absolute; right:max(var(--gutter),env(safe-area-inset-right)); top:var(--top); display:flex; gap:7px; }
.menu-tools{display:grid;justify-items:end;gap:8px;position:absolute;top:50px;right:0}
.tool-buttons{display:flex;gap:6px}
#place-menu{width:min(242px,calc(100vw - 28px));display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:8px}
#place-menu button { min-height:44px; padding:4px; border-radius:12px; background:#e8ecd7; font-size:12px; }
#place-menu button:hover,#place-menu [aria-current=true] { background:#dce6cb; }
.carry { pointer-events:auto; background:var(--paper-glass); border:1px solid #fffcf299; border-radius:16px; display:flex; align-items:center; gap:5px; padding:3px 6px 3px 12px; font-size:12px; }
.carry button { min-height:44px; min-width:46px; border-radius:11px; background:#e8ecd8; }
#menu-toggle{font-size:24px;font-weight:650;padding:0 0 5px}
.round, .dock, .paper { background:var(--paper-glass); box-shadow:0 3px 12px #37442c18; border:1px solid #fffcf299; }
.round { pointer-events:auto; width:44px; height:44px; display:grid; place-items:center; border-radius:50%; }
.round[aria-expanded=true], .round:hover { background:#e9ecd9; }
.where { position:absolute; bottom:var(--bottom); left:max(var(--gutter),env(safe-area-inset-left)); margin:0; display:flex; align-items:center; gap:6px; padding:7px 12px 7px 8px; border-radius:16px; background:var(--paper-glass); font-size:12px; font-weight:650; }
.where i[data-icon], .where canvas { width:18px; height:18px; }
.places { position:absolute; left:max(var(--gutter),env(safe-area-inset-left)); top:calc(var(--top) + 78px); display:flex; flex-wrap:wrap; max-width:calc(100vw - 2 * var(--gutter)); gap:5px; pointer-events:auto; }
.places button { min-height:44px; background:var(--paper-glass); border:1px solid #fffcf299; border-radius:16px; padding:0 10px; font-weight:650; font-size:12px; }
.places button:hover,.places button[aria-current="true"] { background:#e4ebd1; }
.places span { display:inline-grid; place-items:center; min-width:19px; min-height:19px; margin-left:2px; border-radius:10px; background:#dce7cc; font-variant-numeric:tabular-nums; }
#station { position:absolute; right:max(var(--gutter),env(safe-area-inset-right)); top:calc(var(--top) + 60px); max-height:min(55dvh,370px); z-index:2; width:min(260px,calc(100vw - 28px)); }
#station .station-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; padding-top:9px; }
#station .station-buttons button { min-height:44px; background:#e9ebd6; border-radius:11px; padding:5px; font-size:12px; }
#station .station-buttons button:hover { background:#dbe4c8; }
#place-transition { position:fixed; inset:0; z-index:5; display:grid; place-items:center; background:#f5efdd; opacity:0; pointer-events:none; transition:opacity .32s ease; }
#place-transition.cover { opacity:1; pointer-events:auto; }
#place-transition span { padding:.55rem 1.3rem; border-top:1px solid #a7ad85; border-bottom:1px solid #a7ad85; font-weight:700; letter-spacing:.12em; }
.bottom { position:absolute; left:50%; bottom:var(--bottom); transform:translateX(-50%); display:grid; justify-items:center; gap:10px; width:max-content; max-width:calc(100vw - 22px); }
.dock { pointer-events:auto; display:flex; align-items:center; gap:2px; border-radius:25px; padding:5px 7px; }
.dock button { min-width:62px; height:59px; border-radius:18px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font-size:12px; font-weight:650; }
.dock i[data-icon], .dock canvas { width:27px; height:27px; }
.dock button:hover, .dock button[aria-expanded=true], .dock button.active { background:#e3e8d6; }
.dock button:active, .round:active { transform:translateY(1px); }
.divider { height:27px; width:1px; background:var(--edge); margin:0 4px; }
.message { max-width:min(90vw,440px); text-align:center; background:var(--paper-glass); color:var(--ink); padding:8px 14px; border-radius:15px; font-size:12px; line-height:1.5; white-space:pre-line; word-break:keep-all; min-height:0; opacity:0; transition:opacity .35s; }
.message.show { opacity:1; }
.message:empty { display:none; }
.message.welcome { padding:12px 17px; }
.message.welcome::first-line { font-family:"Malgun Gothic", sans-serif; font-weight:bold; font-size:14px; }
.paper { pointer-events:auto; border-radius:21px; width:min(314px, calc(100vw - 28px)); padding:12px 15px 16px; max-height:calc(100dvh - 145px); overflow:auto; overscroll-behavior:contain; }
.paper header { display:flex; align-items:center; justify-content:space-between; }
h2 { margin:0; font-size:16px; letter-spacing:-.045em; }
.close { display:grid; place-items:center; min-width:44px; height:44px; border-radius:50%; }
.close:hover { background:#e5e9d9; }
.close i[data-icon], .close canvas { width:19px; height:19px; }
.settings { position:absolute; top:calc(var(--top) + 103px); right:max(var(--gutter),env(safe-area-inset-right)); }
.option { display:flex; align-items:center; gap:10px; width:100%; padding:5px 8px; min-height:44px; text-align:left; font-size:13px; border-radius:11px; }
.option:hover { background:#e5e9d9; }
.option .switch { margin-left:auto; height:18px; width:33px; background:#b9b8aa; border-radius:12px; padding:3px; }
.switch::before { content:""; display:block; background:#fff9e9; width:12px; height:12px; border-radius:50%; transition:transform .2s; }
.option[aria-pressed=true] .switch { background:#657c50; }
.option[aria-pressed=true] .switch::before { transform:translateX(15px); }
.help { margin:10px 3px 0; border-top:1px solid var(--edge); padding-top:12px; color:#5c6554; line-height:1.65; font-size:12px; word-break:keep-all; }
.dresser { padding:4px 10px 10px; }
.dresser header { padding-left:6px; }
.dresser fieldset { border:0; padding:0; margin:6px 0 0; min-width:0; }
.dresser legend { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.categories { display:flex; gap:3px; border-bottom:1px solid var(--edge); }
.categories button { flex:1; min-height:44px; font-size:12px; }
.categories [aria-pressed=true] { font-weight:bold; box-shadow:inset 0 -2px var(--moss); }
.choices { display:flex; gap:3px; }
.choices button { flex:1; border-radius:12px; min-height:44px; padding:4px 2px; font-size:12px; }
.choices button[aria-pressed=true] { background:#e1e7d2; font-weight:700; }
.colors { gap:0; flex-wrap:wrap; }
.colors button { min-width:44px; display:grid; place-items:center; }
.colors button::after { content:""; background:var(--swatch); width:23px; height:23px; border-radius:45% 55% 49% 42%; transform:rotate(-12deg); }
.colors [aria-pressed=true]::after { outline:1.5px solid var(--moss); outline-offset:3px; }
@media(max-width:660px) {
  .where { top:calc(var(--top) + 73px); bottom:auto; padding:4px 9px 4px 6px; font-size:11px; }
  .places { top:calc(var(--top) + 106px); bottom:auto; }
  .places button { padding:0 7px; }
  #station { top:auto; bottom:calc(var(--bottom) + 70px); max-height:46dvh; }
  .bottom { bottom:max(14px, env(safe-area-inset-bottom)); }
  .brand i[data-icon], .brand canvas { width:31px; height:31px; }
  .brand { gap:6px; }
  .dock { padding:4px 6px; }
  .dock button { min-width:58px; height:55px; }
}
@media(max-height:540px) {
  .paper { max-height:calc(100dvh - 92px); }
  .settings { max-height:calc(100dvh - var(--top) - 115px); }
  .dock button { height:47px; }
}
@media(min-width:940px) {
  .dresser { position:absolute; bottom:0; left:calc(100% + 16px); }
}
@media(min-width:580px) and (max-width:939px) and (max-height:540px) {
  .dresser { position:fixed; right:calc(50% + 22px); bottom:calc(100% + 8px); width:min(290px,calc(50vw - 36px)); }
}
@media(prefers-reduced-motion:reduce) { *, *::before { transition:none !important; } }
