: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{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{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))}}
