:root{color-scheme:only light}
:root{font-family:-apple-system,BlinkMacSystemFont,'Apple SD Gothic Neo','Noto Sans KR',sans-serif;color:#191f28;background:#b9c7bd;font-synthesis:none;--primary:#34734f;--muted:#646f7c;--surface:rgba(255,255,255,.96);--shadow:0 8px 32px #18263814}
*{box-sizing:border-box;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}html,body{margin:0;width:100%;height:100%;overflow:hidden}canvas{display:block;width:100%;height:100%;touch-action:none}[hidden]{display:none!important}
button,select{font:inherit;color:inherit}button{cursor:pointer;border:0;border-radius:14px;background:#f2f4f6;padding:14px 18px;min-height:48px;font-size:14px;font-weight:600;transition:background .15s,transform .15s}button:hover{background:#e5eaf0}button:active{transform:scale(.98)}button:disabled{background:#f2f4f6;color:#8b95a1;cursor:default;transform:none}button:focus-visible,select:focus-visible{outline:3px solid #34734f;outline-offset:3px}button[aria-pressed=true]{background:#eaf3ec;color:#285c3e}
header{position:fixed;top:max(24px,env(safe-area-inset-top));left:24px;right:24px;display:flex;justify-content:space-between;gap:12px;pointer-events:none}.pill{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid #ffffffa6;border-radius:22px;padding:8px 12px;box-shadow:var(--shadow);pointer-events:auto}.pill b{font-size:19px;font-weight:750;letter-spacing:-.6px;white-space:nowrap;padding:0 8px}.pill b:first-letter{color:var(--primary)}.pill button{font-size:13px;padding:10px 12px;min-height:44px;background:transparent}.pill button:hover{background:#f2f4f6}.pill button[aria-pressed=true]{background:#eaf3ec;color:#285c3e}select{min-height:44px;max-width:190px;border:0;border-left:1px solid #e5e8eb;padding:0 12px;background:transparent;font-size:14px;font-weight:600;cursor:pointer}option{background:#fff;color:#191f28}#online{font-size:13px;color:#4e5968;white-space:nowrap;padding-left:4px}
#hint{position:fixed;top:100px;left:28px;background:#ffffffed;border-radius:12px;padding:10px 14px;font-size:12px;color:#4e5968;box-shadow:var(--shadow)}kbd{font:inherit;font-weight:700;color:#333d4b}footer{position:fixed;bottom:max(24px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;gap:10px;align-items:center;background:var(--surface);border:1px solid #ffffffa6;border-radius:24px;padding:12px;box-shadow:var(--shadow);width:max-content;max-width:calc(100% - 48px)}#message{font-size:14px;line-height:1.5;padding:0 12px;color:#4e5968;max-width:330px}footer button{white-space:nowrap}#sit,#next{background:var(--primary);color:#fff}#sit:hover,#next:hover{background:#285c3e}#sit:disabled,#next:disabled{background:#eaf0eb;color:#748b79}
#panel{position:fixed;right:24px;bottom:114px;width:328px;max-height:calc(100dvh - 210px);overflow-y:auto;overscroll-behavior:contain;background:var(--surface);padding:24px;border-radius:28px;box-shadow:var(--shadow)}h1{font-size:25px;line-height:1.35;font-weight:750;letter-spacing:-1px;margin:10px 0}small{font-size:12px;color:var(--muted)}#stage{font-weight:700;color:var(--primary)}p{font-size:14px;line-height:1.65;color:var(--muted);margin:10px 0 20px;word-break:keep-all}#choices{gap:8px;margin-bottom:16px}#choices button{position:relative;text-align:left;padding:15px 36px 15px 16px;font-size:15px;background:#f2f4f6}#choices button:after{content:'›';position:absolute;right:16px;top:22px;color:#8b95a1;font-size:22px;font-weight:400}#choices button:hover{background:#eaf3ec}#choices small{display:block;margin-top:5px;font-weight:400}#next{margin-bottom:12px;width:100%}#snack{width:100%;margin-bottom:12px}#reset,#stand{background:transparent;font-size:13px;min-height:44px;padding:10px 12px;color:#4e5968}#stand{float:right}#reset:hover,#stand:hover{background:#f2f4f6}
nav{position:fixed;left:24px;bottom:124px;text-align:center}nav button{width:46px;height:46px;min-height:46px;padding:0;margin:3px;background:#fffffff0;box-shadow:0 2px 8px #18263810;font-size:18px;touch-action:none;user-select:none}
@media(max-width:600px){header{left:12px;right:12px;top:max(12px,env(safe-area-inset-top));flex-wrap:wrap;gap:8px}.pill{border-radius:18px;gap:4px;padding:5px 8px}.pill b{font-size:17px;padding:0 6px}select{font-size:13px;max-width:155px;padding:0 8px}.pill:last-child{margin-left:auto}.pill button{font-size:12px;padding:8px 10px}#online{font-size:12px}#hint{top:132px;left:14px;font-size:11px;padding:8px 10px}footer{bottom:max(12px,env(safe-area-inset-bottom));width:calc(100% - 24px);max-width:none;flex-wrap:wrap;gap:8px;border-radius:22px;padding:12px}#message{flex:1 0 100%;max-width:none;font-size:12px;padding:0 4px}footer button{flex:1;font-size:14px;min-height:48px}#panel{left:12px;right:12px;bottom:78px;width:auto;max-height:calc(100dvh - 216px);padding:20px;border-radius:24px}body:has(#panel:not([hidden])) footer{padding:12px}#choices{grid-template-columns:1fr 1fr}#choices button{font-size:14px;padding:13px 25px 13px 12px}#choices small{font-size:11px}#choices button:after{right:10px;top:18px}h1{font-size:23px}nav{left:12px;bottom:135px}nav button{width:44px;height:44px;min-height:44px}}
@media(max-height:500px){#hint{display:none}header{top:10px}#panel{left:auto;right:12px;top:80px;bottom:78px;width:310px;max-height:none;padding:16px}footer{bottom:10px;flex-wrap:nowrap;width:max-content;max-width:calc(100% - 24px)}#message{flex:initial;font-size:12px;max-width:260px}nav{left:12px;bottom:96px}#choices{grid-template-columns:1fr 1fr}}
@media(prefers-reduced-motion:reduce){button{transition:none}}
body:has(#panel:not([hidden])) #hint{display:none}
@media(max-width:600px) and (max-height:500px){.pill b{display:none}header{flex-wrap:nowrap}.pill{gap:2px}select{max-width:110px;border-left:0;padding:0 4px}.pill button{padding:8px}#panel{width:min(310px,calc(100% - 24px))}}

/* Desktop controls stay within the viewport, including smaller laptop windows. */
@media(min-width:601px){
  header{align-items:flex-start}
  .pill{min-width:0}
  #panel{top:112px;bottom:auto;width:360px;max-height:calc(100vh - 216px);max-height:calc(100dvh - 216px)}
  #choices{grid-template-columns:repeat(2,minmax(0,1fr))}
  #choices button{padding:16px 26px 16px 14px;font-size:14px}
  #choices button:after{right:10px}
  #choices small{font-size:11px}
  #message{min-width:0;overflow-wrap:anywhere}
  footer button{flex-shrink:0}
}
@media(min-width:601px) and (max-width:800px){
  header{left:16px;right:16px;gap:8px}
  .pill{gap:6px;padding:8px}
  .pill b{font-size:17px;padding:0 4px}
  .pill button{padding:10px 8px;font-size:12px}
  select{max-width:155px;padding:0 8px;font-size:13px}
  #online{font-size:12px}
  #panel{right:16px;width:328px}
  footer{max-width:calc(100% - 32px);gap:8px}
  #message{font-size:12px;padding:0 4px}
}
@media(min-width:601px) and (max-height:600px){
  header{top:12px}
  #hint{display:none}
  #panel{top:88px;max-height:calc(100vh - 178px);max-height:calc(100dvh - 178px);padding:18px}
  footer{bottom:12px}
}
@media(hover:hover) and (pointer:fine){
  nav{display:none}
}

/* Keep audio controls readable when the room chooser and controls wrap. */
header{flex-wrap:wrap}.pill:last-child{flex-wrap:wrap}
@media(max-width:600px){.pill:last-child{max-width:100%}.pill button{white-space:nowrap;padding:8px}#online{padding-left:0}}
@media(max-width:600px) and (max-height:500px){header{flex-wrap:wrap}#panel{top:132px}}

/* Compact scene-first HUD. Secondary controls are disclosed on demand. */
header{top:max(12px,env(safe-area-inset-top));left:12px;right:12px;gap:8px;flex-wrap:nowrap}
.pill,.pill:last-child{gap:6px;padding:4px 8px;border-radius:12px;flex-wrap:nowrap;box-shadow:0 2px 12px #1826380d}
.pill b{font-size:14px;padding:0 4px;letter-spacing:-.4px}
select{min-height:32px;max-width:170px;font-size:12px;padding:0 6px}
#online{font-size:11px;padding:0}
button{min-height:34px;padding:8px 12px;border-radius:9px;font-size:12px}
summary{cursor:pointer;list-style:none;font-size:11px;min-height:32px;display:flex;align-items:center;justify-content:center;padding:0 8px;border-radius:8px}
summary::-webkit-details-marker{display:none}
summary:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
#settings{position:relative}
.settings-body{position:absolute;right:-8px;top:40px;min-width:132px;padding:6px;background:var(--surface);border-radius:12px;box-shadow:var(--shadow);display:grid;gap:2px;z-index:2}
.pill .settings-body button{min-height:36px;font-size:12px;text-align:left;padding:8px 10px}
#hint{display:block;top:62px;left:12px;padding:0;border-radius:9px;font-size:11px;box-shadow:none}
#hint>div{padding:4px 10px 10px;max-width:240px;line-height:1.7}
footer,body:has(#panel:not([hidden])) footer{bottom:max(12px,env(safe-area-inset-bottom));width:max-content;max-width:calc(100% - 24px);padding:6px;gap:8px;border-radius:13px;flex-wrap:nowrap;box-shadow:0 2px 12px #1826380d}
#message{flex:initial;font-size:11px;line-height:1.4;padding:0 6px;max-width:260px}
footer button{flex:initial;min-height:34px;font-size:12px;padding:8px 12px}
#panel{left:auto;right:12px;top:66px;bottom:auto;width:260px;max-height:calc(100vh - 144px);max-height:calc(100dvh - 144px);padding:14px;border-radius:16px}
h1{font-size:18px;letter-spacing:-.6px;margin:6px 0;line-height:1.35}
#stage{font-size:10px}
#description{font-size:11px;line-height:1.5;margin:6px 0 12px}
#choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-bottom:8px}
#choices button{padding:10px;font-size:12px;min-height:52px}
#choices button:after{display:none}
#choices small{font-size:10px;line-height:1.4;margin-top:3px}
#next,#snack{margin-bottom:6px}
#reset,#stand{min-height:32px;font-size:11px;padding:7px 8px}
nav{left:12px;bottom:92px}
@media(max-width:600px){
 .pill b{display:none}select{max-width:156px;border-left:0}
 #panel{top:auto;bottom:94px;width:260px;max-width:calc(100% - 24px);max-height:calc(100dvh - 170px)}
 footer,body:has(#panel:not([hidden])) footer{flex-wrap:wrap;width:max-content;max-width:calc(100% - 24px)}
 #message{flex-basis:100%;max-width:100%;font-size:10px;text-align:center;padding:0 4px}
 footer button{flex:1}
}
@media(pointer:coarse){
 button,footer button,.pill .settings-body button,#reset,#stand,summary,select{min-height:44px}
 .settings-body{top:50px}
 #hint{top:74px}
 #panel{max-height:calc(100dvh - 190px)}
}
@media(max-height:500px){#hint{display:none}#panel{top:74px;bottom:auto;max-height:calc(100dvh - 164px)}}

/* Audio settings must remain above the seated ceremony panel. */
header{z-index:6}

#teaware-field{display:flex;align-items:center;gap:8px;margin:8px 0;font-size:12px;color:var(--muted,#65716b)}#teaware-field[hidden]{display:none}#teaware{min-width:0;flex:1;padding:7px;border:1px solid #dce3df;border-radius:8px;background:#fff;color:#263b31;font:inherit}

/* During personal tea, keep only a small status anchored above the visitor. */
#tea-hud{position:fixed;z-index:4;transform:translate(-50%,-100%);text-align:center;max-width:200px;padding:5px 9px;border-radius:10px;background:transparent;box-shadow:none;pointer-events:none;white-space:nowrap}
#tea-activity{display:block;font-size:12px;line-height:1.5;font-weight:600;color:#285c3e}
#tea-toggle{display:block;margin:0 auto;padding:3px 6px;min-height:26px;border-radius:6px;background:transparent;color:#646f7c;font-size:10px;font-weight:400;pointer-events:auto}
#tea-toggle:hover{background:#eaf3ec;color:#285c3e}
body.tea-active footer,body.tea-active #hint,body.tea-active nav{display:none}
body.tea-running header{display:none}
#close-tea-settings{width:100%;margin-top:8px}
@media(pointer:coarse){#tea-toggle{min-height:44px;font-size:11px}}

#start-shared{position:fixed;top:62px;left:132px;z-index:5;padding:6px 10px;font-size:11px;min-height:30px}
@media(pointer:coarse){#start-shared{top:74px;min-height:44px}}
@media(max-height:500px){#start-shared{top:74px;left:68px}}

#thank-host{pointer-events:auto;cursor:pointer;font-size:12px;padding:8px 12px;min-height:32px}#thanks-note{position:fixed;left:50%;top:100px;transform:translateX(-50%);padding:10px 16px;border-radius:20px;background:rgba(37,57,41,.88);color:#f6f3e7;font-size:13px;pointer-events:none;z-index:20;white-space:nowrap}

#visitor-stats{position:fixed;right:max(12px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));z-index:5;display:flex;gap:10px;padding:6px 9px;border-radius:8px;background:#ffffffe0;color:#56645c;font:11px/1.4 system-ui,sans-serif;pointer-events:auto}#visitor-stats b{font-weight:600;font-variant-numeric:tabular-nums;color:#344b3c}@media(max-width:600px){#visitor-stats{font-size:10px;gap:8px;bottom:max(5px,env(safe-area-inset-bottom))}}

#chawan-picker{box-sizing:border-box;width:min(440px,calc(100vw - 24px));max-height:85dvh;overflow:hidden;border:0;border-radius:16px;padding:16px;color:#344b3c;background:#fffdf7}
#chawan-picker[open]{display:flex;flex-direction:column}
#chawan-picker::backdrop{background:#17271d66}
#chawan-picker h2{font-size:18px;margin:0 0 6px}
#chawan-picker p{font-size:12px;margin:0 0 12px;color:#68736b}
#chawan-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:max-content;align-content:start;gap:10px;overflow-y:auto;min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable;padding:2px 4px 4px 2px}
#chawan-options .chawan-card{display:block;padding:0;min-height:0;background:#f0eee7;color:#344b3c;border:1px solid #e3e4dc;border-radius:10px;overflow:hidden}
.chawan-card img{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:contain}
.chawan-card span{display:block;padding:9px 4px;background:#fff;font-size:12px;font-weight:600}
#chawan-options .chawan-card:hover,#chawan-options .chawan-card:focus-visible{border-color:#34734f;outline:2px solid #34734f;outline-offset:-2px}
#close-chawan{flex-shrink:0;margin-top:12px;min-height:40px}
#chawan-field{display:flex;align-items:center;gap:8px;margin:8px 0;font-size:12px}#chawan-field[hidden]{display:none}#chawan{min-width:0;flex:1;padding:7px;border:1px solid #dce3df;border-radius:8px;background:white;font:inherit}

#drop-chawan{flex-shrink:0;margin-top:10px;min-height:40px;background:#eaf3ec;color:#285c3e}

#camera-zoom{position:fixed;right:12px;top:74px;z-index:5;display:flex;gap:4px}#camera-zoom button{width:32px;min-height:32px;padding:0;border-radius:8px;background:#ffffffe0;color:#385643;font-size:20px}#camera-zoom button:disabled{opacity:.4}@media(pointer:coarse){#camera-zoom button{width:42px;min-height:42px}}

#tea-emote{position:fixed;left:12px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:12;width:48px;height:48px;padding:0;border-radius:50%;font-size:26px;background:#fffffff0;box-shadow:0 2px 10px #2343}
#tea-emotes{position:fixed;inset:0;pointer-events:none;z-index:8}#tea-emotes span{position:absolute;font-size:36px;transform:translate(-50%,-100%);filter:drop-shadow(0 2px 3px #fff)}

/* Transparent tea controls preserve the view; shadows keep white type readable. */
#tea-activity,#tea-toggle,#tea-toggle:hover,#thank-host,#thank-host:hover,#start-shared,#start-shared:hover,#start-shared:disabled,#duel-status,#duel-detail,#duel-panel button,#duel-panel button:hover,#duel-invite-panel p,#duel-invite-panel button,#duel-invite-panel button:hover{background:transparent;color:#fff;box-shadow:none;text-shadow:0 1px 3px #000,0 0 6px #0009}
#start-shared:disabled{opacity:.55}
#tea-toggle:focus-visible,#thank-host:focus-visible,#start-shared:focus-visible,#duel-panel button:focus-visible,#duel-invite-panel button:focus-visible{outline-color:#fff}
@media(pointer:coarse){#thank-host{min-height:44px}}

#install-ios{max-width:210px;margin:6px;padding:4px;font-size:12px;line-height:1.6}
body:has(#settings[open]) #camera-zoom{visibility:hidden}

/* A quiet, always-available guide; the scene stays visible behind it. */
#info-button{position:fixed;top:max(10px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));z-index:7;width:44px;height:44px;padding:0;background:transparent;color:#fff;text-shadow:0 1px 3px #000,0 0 6px #0008;font-size:25px;font-weight:400}
#info-button:hover{background:#ffffff18}#info-button:focus-visible{outline-color:#fff}
header{left:60px}
#info-dialog{width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:22px;border:0;border-radius:16px;background:#fffffff5;color:#263b31;box-shadow:0 12px 48px #17271d20;overflow:auto;overscroll-behavior:contain}
#info-dialog::backdrop{background:#17271d30}
.info-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#68736b;font-size:11px}
#info-close{width:36px;min-height:36px;padding:0;background:transparent;font-size:22px;font-weight:400}
.info-nav{display:flex;gap:6px;margin:12px 0 20px}.info-nav button{background:transparent;color:#68736b;font-size:12px}.info-nav button[aria-pressed=true]{background:#eaf3ec;color:#285c3e}
#info-dialog h2{font-size:20px;letter-spacing:-.6px;margin:0 0 8px}#info-dialog small{font-size:11px}
#info-dialog ul{list-style:none;padding:0;margin:22px 0}#info-dialog li+li{margin-top:18px}#info-dialog strong,#info-dialog dt{display:block;font-size:13px;font-weight:600;margin-bottom:5px}
#info-dialog li span,#info-dialog dd{display:block;margin:0;color:#68736b;font-size:12px;line-height:1.65;word-break:keep-all}#info-dialog dl{margin:20px 0}#info-dialog dl>div+div{margin-top:16px}
#info-done{width:100%;min-height:44px;background:#34734f;color:white;margin-top:4px}
@media(max-width:380px){header .pill{padding:4px}header select{max-width:128px}header{gap:4px;right:8px}#info-dialog{padding:18px}}
.info-heading h1{font-size:11px;font-weight:500;letter-spacing:0;margin:0;color:#68736b}
#info-dialog .info-intro{font-size:12px;line-height:1.6;margin:0 0 18px;color:#68736b}
.info-about{display:block;font-size:12px;color:#285c3e;text-align:center;margin:18px 0 12px;text-underline-offset:3px}
.info-about:focus-visible{outline:2px solid #34734f;outline-offset:4px}
.no-script{position:fixed;inset:0;overflow:auto;padding:32px;background:#f8faf7;z-index:30}.no-script a{color:#285c3e}

/* Thumb movement is analog; the small center deadzone prevents accidental drift. */
#movement-pad{position:relative;width:116px;height:116px;border:1px solid #ffffff70;border-radius:50%;background:#ffffff26;box-shadow:inset 0 0 0 16px #ffffff0a;touch-action:none;user-select:none;-webkit-user-select:none;outline-offset:4px}
#movement-pad:before{content:'';position:absolute;inset:17px;border:1px solid #ffffff40;border-radius:50%;pointer-events:none}
#movement-pad span{position:absolute;left:calc(50% - 22px);top:calc(50% - 22px);width:44px;height:44px;border-radius:50%;background:#ffffffe0;box-shadow:0 2px 8px #17271d26;pointer-events:none}
#movement-pad.active{background:#ffffff38}#movement-pad:focus-visible{outline:2px solid white}
@media(max-height:500px){#movement-pad{width:96px;height:96px}}

#emote-actions{position:fixed;left:12px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:12;display:flex;gap:8px}
#emote-actions button{position:static;width:48px;height:48px;min-height:48px;padding:0;border-radius:50%;font-size:26px;background:#fffffff0;box-shadow:0 2px 10px #2343}
#sword-dance:disabled{opacity:.45;cursor:default}
@media(max-width:600px){#emote-actions{bottom:calc(224px + env(safe-area-inset-bottom))}}
@media(max-height:500px){#emote-actions{bottom:calc(200px + env(safe-area-inset-bottom))}}

#duel-panel{position:fixed;top:82px;left:50%;transform:translateX(-50%);width:min(420px,calc(100% - 32px));text-align:center;padding:12px 16px;background:transparent;color:#fff;border:0;box-shadow:none;z-index:4}#duel-panel strong{font-size:16px;font-weight:650;letter-spacing:-.3px}#duel-panel p{font-size:12px;line-height:1.6;margin:8px 0}#duel-panel button{margin:3px;min-height:44px;padding:10px 14px;font-size:13px}.duel-active footer,.duel-active #hint,.duel-active #tea-emote,.duel-active #camera-zoom,.duel-active #tea-hud,.duel-active #panel,.duel-active #start-shared{display:none!important}.duel-active #emote-actions{bottom:36px;left:auto;right:24px;transform:none}.duel-active #sword-dance{width:68px;height:68px;font-size:30px}@media(max-height:500px){#duel-panel{top:62px;padding:8px}#duel-panel p{margin:4px 0}.duel-active #emote-actions{bottom:16px;left:auto;right:32px;transform:none}}

.duel-active nav{bottom:36px;left:16px;display:block}.duel-active #duel-panel p{max-width:370px;margin:8px auto}@media(max-height:500px){.duel-active nav{bottom:16px}.duel-active #duel-panel{max-width:390px}.duel-active #duel-panel p{font-size:11px}}

#duel-invite-panel{position:fixed;top:90px;left:50%;transform:translateX(-50%);z-index:20;width:min(380px,calc(100% - 32px));background:transparent;border:0;padding:16px;text-align:center;box-shadow:none}#duel-invite-panel p{font-size:14px;margin:0 0 12px}#duel-invite-panel button{margin:0 4px}
#info-date-filter{display:flex;align-items:center;gap:10px;margin:12px 0;color:#68736b;font-size:12px}#info-date-filter[hidden]{display:none}#info-date{width:auto;max-width:180px;border:1px solid #d9e2d9;border-radius:8px;padding:8px;background:white;color:#263b31}#info-release-more{width:100%;margin:0 0 12px;background:#eaf3ec;color:#285c3e;font-size:12px}#info-release-empty{font-size:13px;color:#68736b}

#skin-picker{width:min(340px,calc(100% - 32px));max-height:85dvh;overflow:auto;border:0;border-radius:20px;padding:24px;background:#f4f7f1;color:#30483c}#skin-picker::backdrop{background:#172c2855}#skin-picker h2{margin-top:0}#skin-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0}#skin-options button[aria-pressed="true"]{background:#367852;color:white}#skin-close{width:100%}

#announcement-bar{position:fixed;top:max(8px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:100;display:flex;align-items:center;gap:12px;width:max-content;max-width:calc(100% - 24px);box-sizing:border-box;padding:12px 18px;border-radius:14px;background:#263c30;color:#fff;box-shadow:0 3px 15px #0003;font-size:13px;line-height:1.5}#announcement-bar[hidden]{display:none}#announcement-bar button{flex-shrink:0;min-height:44px;padding:8px 12px;background:#fff;color:#263c30}

/* Mobile: a quiet room picker and one menu leave the world and thumb controls clear. */
#mobile-tools{display:none}
body.mobile-compact header{display:flex;left:max(12px,env(safe-area-inset-left));right:88px;top:max(10px,env(safe-area-inset-top));height:44px;gap:0;z-index:6}
.mobile-compact header .pill:first-child{max-width:100%;padding:0 8px;border-radius:14px;background:#fffffff0}
.mobile-compact header .pill:first-child b,.mobile-compact header .pill:nth-child(2){display:none}
.mobile-compact #room{width:100%;max-width:240px;min-height:44px;font-size:12px;border:0}
.mobile-compact #mobile-tools{display:block;position:fixed;right:max(12px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));z-index:25}
.mobile-compact #mobile-tools>summary{height:44px;min-width:64px;padding:0 14px;border-radius:14px;background:#fffffff0;color:#30483c;font-size:13px;font-weight:600}
#mobile-tools-panel{position:absolute;right:0;top:52px;width:min(292px,calc(100vw - 24px));max-height:calc(100dvh - 80px - env(safe-area-inset-top));overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:18px;background:#fffffff5;box-shadow:0 8px 30px #14291d26;color:#30483c}
#mobile-tools-panel>strong{font-size:15px}
#mobile-tools-panel #online{position:absolute;right:16px;top:18px;font-size:12px}
#mobile-tools-panel #info-button{position:static;width:100%;min-height:44px;height:auto;padding:10px;color:#30483c;background:#edf3ed;text-shadow:none;font-size:0;text-align:left}
#mobile-tools-panel #info-button:after{content:'소식 · 이용 안내';font-size:13px;font-weight:600}
#mobile-tools-panel #watch-duel{min-height:44px;text-align:left;background:#edf3ed;font-size:13px}
#mobile-tools-panel #emote-actions{position:static;display:flex;flex-wrap:wrap;gap:8px}
#mobile-tools-panel #emote-actions button{flex:1;min-width:64px;width:auto;height:auto;min-height:60px;box-shadow:none;border-radius:12px;background:#f1f4ef;font-size:22px}
#mobile-tools-panel #tea-emote:after,#mobile-tools-panel #transform:after,#mobile-tools-panel #sword-dance:after{display:block;font-size:11px;margin-top:3px;line-height:1.4}
#mobile-tools-panel #tea-emote:after{content:'차 인사'}#mobile-tools-panel #transform:after{content:'변신'}#mobile-tools-panel #sword-dance:after{content:'칼춤'}
#mobile-tools-panel #camera-zoom{position:static;display:flex;visibility:visible;gap:8px}
#mobile-tools-panel #camera-zoom button{flex:1;width:auto;min-height:44px;border-radius:10px;background:#edf3ed}
#mobile-tools-panel #zoom-in:after{content:' 확대';font-size:12px}#mobile-tools-panel #zoom-out:after{content:' 축소';font-size:12px}
#mobile-tools-panel #settings{width:100%}
#mobile-tools-panel #settings>summary{justify-content:space-between;min-height:44px;background:#edf3ed;font-size:13px;padding:0 12px}
#mobile-tools-panel #settings>summary:after{content:'+'}#mobile-tools-panel #settings[open]>summary:after{content:'−'}
#mobile-tools-panel .settings-body{position:static;min-width:0;box-shadow:none;background:transparent;padding:6px 0 0;gap:6px}
#mobile-tools-panel .settings-body button{min-height:44px;text-align:left;font-size:12px}
#mobile-tools-panel #hint{display:block;position:static;font-size:12px;background:#edf3ed}
#mobile-tools-panel #hint summary{min-height:44px;justify-content:flex-start;padding:0 12px;font-size:13px}
#mobile-tools-panel #visitor-stats{position:static;display:flex;justify-content:space-between;background:none;padding:4px 0;font-size:11px}
.mobile-compact nav,.mobile-compact.duel-active nav{left:max(16px,env(safe-area-inset-left));bottom:max(22px,env(safe-area-inset-bottom));z-index:5}
.mobile-compact #movement-pad{width:100px;height:100px}
.mobile-compact footer,.mobile-compact:has(#panel:not([hidden])) footer{left:auto;right:max(16px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));transform:none;max-width:calc(100% - 140px);width:auto;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:0;border:0;background:transparent;box-shadow:none}
.mobile-compact footer #message{font-size:10px;max-width:180px;line-height:1.45;text-align:right;color:#fff;text-shadow:0 1px 4px #000;padding:0 3px;flex:initial}
.mobile-compact footer button{min-height:48px;padding:10px 14px;font-size:12px;border-radius:16px;white-space:normal;max-width:180px;flex:initial}
.mobile-compact #bell{display:none}
.mobile-compact #panel{top:auto;left:auto;right:12px;bottom:84px;width:280px;max-width:calc(100% - 24px);max-height:calc(100dvh - 160px);padding:14px}
.mobile-compact #start-shared{top:64px;left:12px;max-width:calc(100% - 24px);min-height:44px}
.mobile-compact #duel-panel{top:64px;padding:4px 12px}
.mobile-compact #duel-detail{font-size:11px;line-height:1.45;max-width:280px;margin:4px auto}
.mobile-compact.duel-active #emote-actions{right:max(16px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom))}
.mobile-compact #duel-invite-panel{top:68px;background:#263c30ed;border-radius:16px;padding:12px}
.mobile-compact #announcement-bar{top:max(64px,calc(env(safe-area-inset-top) + 54px));font-size:12px;padding:10px 14px}
@media(max-height:500px){.mobile-compact #duel-detail{display:none}.mobile-compact #panel{top:64px;bottom:auto;max-height:calc(100dvh - 84px)}.mobile-compact #movement-pad{width:88px;height:88px}.mobile-compact footer #message{max-width:200px}}

/* Frequent gestures stay visible; the extra action opens only when requested. */
.mobile-compact #emote-actions{left:auto;right:max(16px,env(safe-area-inset-right));bottom:calc(132px + env(safe-area-inset-bottom));gap:6px;align-items:center}
.mobile-compact #emote-actions>button{width:48px;height:48px;min-height:48px;border-radius:14px;font-size:24px;box-shadow:none}
#mobile-more-actions{position:relative}
#mobile-more-actions>summary{width:44px;height:44px;border-radius:14px;background:#fffffff0;color:#30483c;padding:0;justify-content:center;font-size:20px;list-style:none}
#mobile-more-actions>summary::-webkit-details-marker{display:none}
#mobile-more-actions[open]>summary{background:#dceadc}
#mobile-more-actions>div{position:absolute;bottom:54px;right:0;padding:6px;background:#fffffff5;border-radius:14px;box-shadow:0 4px 16px #14291d26}
#mobile-more-actions #transform{width:48px;height:48px;border-radius:10px;font-size:24px;box-shadow:none;background:#edf3ed}

#instagram-link{display:flex;align-items:center;min-height:44px;padding:8px 10px;border-top:1px solid #dce5df;color:#476153;font-size:12px;text-decoration:none;white-space:nowrap}#instagram-link:hover{text-decoration:underline}#instagram-link:focus-visible{outline:2px solid #34734f;outline-offset:2px}

#message:empty{display:none}
/* Compact layouts keep touch movement even with a mouse/trackpad attached. */
.mobile-compact:not(.tea-active) nav:not([hidden]){display:block}
