/* MARKEYS storybook design system. Screen layouts share these tokens. */
:root{--ink:#29483e;--sage:#8fa781;--cream:#faf8f0;--surface:#fffdf8;--line:#e6e8dc;--gold:#efbc52;--pink:#e5a7b9;--radius:24px;--shadow:0 12px 36px #2c4a3512}
body,button{font-family:ui-rounded,'Apple SD Gothic Neo','Malgun Gothic',sans-serif;color:var(--ink)}body:not(.playing){background:var(--cream)}button{transition:background .16s,transform .16s;touch-action:manipulation}button:focus-visible{outline:3px solid var(--sage);outline-offset:4px}body:not(.playing) header{background:var(--cream);height:56px;padding:0 26px}.brand{letter-spacing:-.8px;color:var(--ink)}#sound{background:#e9eee5;border-radius:50%;color:var(--ink)}
body:not(.playing){grid-template-rows:56px minmax(0,1fr)}body:not(.playing) main{padding:0 20px 20px!important}body:not(.playing) .layout{gap:0;border:1px solid var(--line);border-radius:30px;overflow:hidden;background:var(--surface);grid-template-columns:minmax(0,1.45fr) minmax(330px,.9fr)}body:not(.playing) .world{border-radius:0;background:linear-gradient(#f7f4e5b3,#f1f1e9dd),url('storybook-forest.png') center/cover}body:not(.playing) .panel{padding:24px!important;gap:16px;background:var(--surface)}.world-label,.world-corner{display:none!important}.stage-caption{bottom:16px!important;color:#667860}.panel>h1{display:block!important;font-size:24px!important;letter-spacing:-.8px}.part-guide{border-bottom:1px solid var(--line);padding-bottom:10px;height:58px;min-height:58px}.part-guide svg{width:46px;height:46px}.part-guide b{font-size:17px}.part-guide>span{font-size:12px;color:#8b9685}.finish-options{padding:5px;background:#f0f2e9;border-radius:18px;gap:4px}.finish-options button{border:0;background:transparent;border-radius:13px;min-height:54px}.finish-options button[aria-pressed=true]{background:#fff;box-shadow:0 2px 8px #324c3610}.texture-demo{border:1px solid #73846620!important}.palette{gap:8px;max-height:220px}.palette .swatch{border:4px solid var(--surface);max-width:48px;box-shadow:inset 0 0 0 1px #33483310}.palette .swatch.selected{outline:2px solid var(--ink);outline-offset:2px;transform:scale(1)}.color-channels button{background:#f1f3ea;border:1px solid var(--line);border-radius:20px}.primary,.picture-button.primary{background:var(--ink);color:#fff;border:1px solid var(--ink)}.secondary{background:transparent;color:var(--ink);border:1px solid #bcc9b7}.picture-button{border-radius:30px!important;box-shadow:none;min-height:58px!important}.picture-button>span{font-size:17px}.ui-icon{width:24px;height:24px}
#welcomeScreen{background-position:center}.welcome-shade{background:linear-gradient(90deg,#f9f7ebc9,#f9f7eb55 50%,transparent),linear-gradient(0deg,#163e3b66,transparent 55%)}.welcome-brand{color:#29483e}.welcome-tag{background:transparent;border:0;letter-spacing:3px;font-size:14px;padding:0}.welcome-copy h1{font-size:clamp(44px,6vw,82px);font-weight:800;letter-spacing:-.055em}.welcome-friend img{filter:drop-shadow(0 18px 12px #29351e35)}.welcome-halo{background:radial-gradient(#fff9d488,transparent 65%)}#enterStudio{background:var(--ink);border:2px solid #fff;border-radius:40px;box-shadow:0 8px 25px #253d3029;font-size:23px;min-height:68px}#enterStudio:active{box-shadow:none;transform:scale(.98)}
body.playing #gameHud{top:max(18px,env(safe-area-inset-top));right:18px;gap:10px}.hud-pill{background:#fffdf4ed!important;color:var(--ink)!important;border:1px solid #fff!important;border-radius:18px!important;backdrop-filter:blur(12px);padding:9px 15px!important}.hud-stars{color:#a5751e!important}.hud-pill strong,.hud-pill b{font-size:23px!important}#journeyHud{top:max(22px,env(safe-area-inset-top));width:30%;background:#fffdf4e8!important;border:1px solid white;border-radius:22px;color:var(--ink)}#journeyHud .journey-meter{background:#d7e0d2}#journeyFill{background:#8aa578!important}#journeyHud .journey-meter>span{display:none}body.playing #finish{border-radius:50%!important;background:#fffdf4ed!important;color:var(--ink)!important;border:1px solid white!important;width:50px;min-width:50px;height:50px!important;padding:12px!important}body.playing #finish span{display:none}body.playing #finish svg{width:24px;height:24px}body.playing.stageclear .finish-actions .picture-button{border-radius:35px!important;box-shadow:0 8px 26px #10231b24!important;min-height:62px!important;height:62px;border:2px solid #fff!important;background:var(--ink);color:white}.finish-actions .picture-button .ui-icon{background:transparent!important}body.playing.stageclear .finish-actions .secondary{background:#fffdf2!important;color:var(--ink)!important}#finishCelebration{background:#29483ee8;color:white;border-radius:24px;border:1px solid #fff8}body[data-view=result] .qr-wrap{background:#f0f3e9;border-radius:24px;border:1px solid var(--line)}.result-tally{background:#f1f3e9;border-radius:20px;padding:14px;color:var(--ink)}
.practice-map-top b,.practice-map-top button{background:#fffdf4ed;color:var(--ink);border:1px solid white;border-radius:24px}#practicePrompt{border:1px solid white;background:#fffdf5f5;border-radius:28px;box-shadow:var(--shadow)}#practiceContinue{background:var(--ink);box-shadow:none;border-radius:26px}#pauseMenu{position:fixed;inset:0;z-index:115;background:#173b326b;backdrop-filter:blur(8px);display:grid;place-items:center}#pauseMenu>section{width:min(360px,88vw);padding:32px;background:var(--cream);border-radius:32px;display:flex;flex-direction:column;gap:14px;text-align:center}#pauseMenu h2{margin:0 0 12px}#pauseMenu button{min-height:58px;border-radius:30px;font-size:19px;font-weight:bold}
@media(orientation:portrait){body:not(.playing){grid-template-rows:50px minmax(0,1fr)}body:not(.playing) header{height:50px;padding:0 16px}body:not(.playing) main{padding:0 10px 10px!important}body:not(.playing) .layout{grid-template-columns:1fr;grid-template-rows:minmax(140px,1fr) minmax(0,320px);border-radius:24px}body:not(.playing) .panel{padding:12px 16px!important;gap:8px}.panel>h1{display:none!important}.part-guide{height:34px;min-height:34px;padding:0;border:0}.part-guide svg{height:32px}.finish-options button{height:42px;min-height:42px}.palette .swatch{max-width:40px}.palette{gap:4px}.picture-button{min-height:50px!important;height:50px}.welcome-copy{color:#fffdf1;text-shadow:0 2px 18px #1c3d3260}.welcome-shade{background:linear-gradient(#f9f7eb99,transparent 40%,#1e4039bb)}.welcome-copy h1{font-size:38px}.welcome-brand{justify-content:center}#enterStudio{background:#fffdf1;color:var(--ink);min-height:58px;font-size:21px}#journeyHud{top:80px;width:calc(100% - 36px);left:18px;transform:none}body[data-view=result] .layout{grid-template-rows:minmax(150px,1fr) minmax(0,285px)}}
@media(orientation:landscape) and (max-height:540px){body:not(.playing){grid-template-rows:38px minmax(0,1fr)}body:not(.playing) header{height:38px}body:not(.playing) main{padding:0 10px 8px!important}body:not(.playing) .panel{padding:10px 18px!important;gap:6px}.panel>h1{display:none!important}.part-guide{height:34px;min-height:34px;padding:0}.part-guide svg{height:32px}.finish-options button{height:40px;min-height:40px}.palette{gap:3px}.palette .swatch{max-width:34px}.picture-button{min-height:44px!important;height:44px}.color-channels,.color-channels button{min-height:30px;height:30px}.welcome-copy h1{font-size:42px}#enterStudio{min-height:54px}}
@media(orientation:portrait) and (max-height:700px){body:not(.playing) .layout{grid-template-rows:minmax(110px,1fr) minmax(0,280px)}body:not(.playing) .panel{gap:5px;padding:8px 12px!important}.finish-options button{height:36px;min-height:36px}.palette .swatch{max-width:34px}.picture-button{min-height:44px!important;height:44px}}

/* Main entry composition only: existing assets and event targets are preserved. */
#welcomeScreen{padding:32px 40px;color:#213b33}.welcome-brand{font-size:26px;letter-spacing:.4px;gap:20px;line-height:32px}.welcome-brand span{font-size:10px;letter-spacing:2.8px;padding:0 0 0 20px;line-height:26px;border-color:#728c7266}.welcome-shade{background:linear-gradient(90deg,rgba(250,248,237,.88) 0%,rgba(250,248,237,.68) 18%,rgba(250,248,237,.25) 34%,rgba(250,248,237,0) 48%);backdrop-filter:none}.welcome-content{position:relative;max-width:none;grid-template-columns:44% 56%;align-items:center}.welcome-copy{width:100%;max-width:440px;padding:0 0 0 clamp(16px,4vw,72px);text-align:left;color:#213b33;text-shadow:none}.welcome-tag{display:inline-flex;align-items:center;gap:8px;background:rgba(255,253,244,.82);border:0;border-radius:30px;padding:8px 14px;font-size:14px;letter-spacing:0;color:#617f60;line-height:24px;box-shadow:none}.welcome-tag svg{width:20px;height:20px;flex:none}.welcome-copy h1{font-size:clamp(44px,4.5vw,68px);line-height:1.08;letter-spacing:-.055em;font-weight:800;margin:24px 0 16px}.welcome-description{font-size:18px;line-height:1.6;font-weight:400;color:#5a7063;margin:0 0 32px}.welcome-copy #enterStudio{width:256px;min-width:0;min-height:66px;height:66px;margin:0;padding:0 28px;background:#284f42;border:0;border-radius:20px;color:#fff;font-size:22px;font-weight:700;gap:12px;box-shadow:0 5px 14px #173c3217;transition:transform .18s ease,box-shadow .18s ease,background .18s ease}.welcome-copy #enterStudio svg{width:23px;height:23px}.welcome-copy #enterStudio:hover{transform:translateY(-2px);box-shadow:0 9px 20px #173c3224;background:#173c32}.welcome-copy #enterStudio:active{transform:scale(.98);box-shadow:0 3px 8px #173c321a}.welcome-features{display:flex;gap:20px;align-items:center;list-style:none;padding:0;margin:24px 0 0;color:#657f69;font-size:13px;line-height:24px}.welcome-features li{display:flex;gap:7px;align-items:center;white-space:nowrap}.welcome-features svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.welcome-friend{position:absolute;right:1%;bottom:7%;width:45%;height:50vh;max-height:490px;pointer-events:none}.welcome-friend img{min-width:0;min-height:0;max-width:100%;max-height:100%;object-fit:contain;width:100%;height:100%;animation:none;filter:drop-shadow(0 8px 5px #3040201c)}.welcome-halo,.welcome-spark{display:none}.welcome-friend:after{content:'';position:absolute;bottom:8%;left:25%;width:56%;height:3%;border-radius:50%;background:#31432412;z-index:-1}
@media(min-aspect-ratio:17/10){.welcome-friend{bottom:4%;height:52vh;width:43%}.welcome-copy h1{font-size:clamp(44px,4.4vw,68px)}}
@media(max-width:1100px) and (orientation:landscape){#welcomeScreen{padding:24px 32px}.welcome-copy{padding-left:16px;max-width:380px}.welcome-copy h1{font-size:48px;margin-top:24px}.welcome-description{font-size:16px;margin-bottom:24px}.welcome-brand{font-size:23px}.welcome-friend{right:0;bottom:9%;width:46%;height:48vh}.welcome-features{gap:16px}}
@media(max-height:600px) and (orientation:landscape){#welcomeScreen{padding:20px 28px}.welcome-brand{font-size:21px;line-height:26px}.welcome-copy h1{font-size:40px;margin:16px 0 8px}.welcome-description{font-size:15px;line-height:1.5;margin-bottom:16px}.welcome-tag{padding:4px 12px;font-size:12px}.welcome-copy #enterStudio{height:56px;min-height:56px;width:220px;font-size:19px}.welcome-features{margin-top:16px;font-size:12px}.welcome-friend{height:55vh;bottom:4%}}
@media(orientation:portrait){#welcomeScreen{padding:24px}.welcome-brand{font-size:22px;justify-content:flex-start}.welcome-brand span{font-size:9px;letter-spacing:2px}.welcome-content{display:block;position:relative}.welcome-copy{position:relative;padding:0;max-width:360px;margin-top:40px;z-index:2}.welcome-copy h1{font-size:44px;margin:16px 0}.welcome-copy h1 br{display:block}.welcome-description{font-size:16px;margin-bottom:24px}.welcome-features{margin-top:20px;gap:16px}.welcome-friend{right:-8%;bottom:0;width:75%;height:32vh;max-height:330px}.welcome-shade{background:linear-gradient(110deg,#faf8edef 0%,#faf8edb0 36%,#faf8ed10 72%)}.welcome-copy #enterStudio{width:236px;height:62px;min-height:62px}}
@media(orientation:portrait) and (max-height:740px){.welcome-copy{margin-top:24px}.welcome-copy h1{font-size:36px;margin:12px 0}.welcome-description{font-size:14px;margin-bottom:16px}.welcome-features{margin-top:16px}.welcome-friend{height:26vh;width:64%;bottom:-2%}}

/* Reference-matched entry artwork and rounded forest control. */
.welcome-copy #enterStudio{width:288px;height:76px;min-height:76px;border-radius:44px;border:1px solid #f8f5e9b0;background:linear-gradient(145deg,#407763 0%,#284f42 45%,#1c392f 100%);box-shadow:inset 0 2px 2px #ffffff33,0 10px 24px #29442d26;font-size:25px}.welcome-copy #enterStudio:hover{background:linear-gradient(145deg,#4b846e,#284f42 65%,#1c392f);box-shadow:inset 0 2px 2px #ffffff33,0 14px 28px #29442d33;transform:translateY(-2px)}.welcome-copy #enterStudio:active{transform:scale(.98);box-shadow:inset 0 2px 5px #173c3260,0 4px 10px #29442d22}.welcome-friend img{filter:drop-shadow(0 12px 6px #30402025)}.welcome-features{gap:0;font-size:15px;font-weight:600;color:#36594b;margin-top:32px}.welcome-features li{padding:0 18px;gap:10px}.welcome-features li:first-child{padding-left:0}.welcome-features li+li{border-left:1px solid #728c7250}.welcome-features svg{width:24px;height:24px;fill:currentColor;stroke-width:1.2}.welcome-features li:first-child circle{fill:#f8f5e9;stroke:#f8f5e9}
@media(max-width:1100px){.welcome-features{font-size:13px}.welcome-features li{padding:0 12px}.welcome-copy #enterStudio{width:256px;height:68px;min-height:68px;font-size:23px}}
@media(max-height:600px) and (orientation:landscape){.welcome-copy #enterStudio{height:56px;min-height:56px;width:230px;font-size:21px}.welcome-features{margin-top:20px}}
/* Spacious landscape pony atelier. */
body[data-view=dress]:not(.waiting){background:#f8f7f1;grid-template-rows:72px minmax(0,1fr)}body[data-view=dress] header{height:72px;padding:0 26px;gap:24px}#editorBack{display:none;align-items:center;gap:10px;border:1px solid #dfe3d8;border-radius:28px;background:#faf9f4;padding:12px 24px;color:#213b33;font-weight:700}body[data-view=dress] #editorBack{display:flex}body[data-view=dress] header #sound{margin-left:auto}body[data-view=dress] main{padding:0 24px 24px!important}body[data-view=dress] .layout{grid-template-columns:58% 42%;gap:12px;background:none;border:0;box-shadow:none;overflow:visible}body[data-view=dress] .world{border-radius:30px;overflow:hidden;background:#eceee2}body[data-view=dress] .panel{padding:24px!important;border:1px solid #e8e9df;border-radius:30px;background:#fffdfa;display:flex;flex-direction:column;gap:12px;overflow:auto}body[data-view=dress] .panel>h1{display:block!important;font-size:30px;margin:0;line-height:1.2}body[data-view=dress] .world-label,body[data-view=dress] .stage-caption{display:none!important}.editor-subtitle{font-size:14px;color:#7e9087;margin-bottom:8px}.editor-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.editor-tabs button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;min-height:74px;border:1px solid #ebece3;border-radius:15px;color:#355b50;background:#fff;font-weight:700}.editor-tabs button[aria-pressed=true]{border-color:#95ae80;box-shadow:0 2px 5px #355b5014}.editor-tabs svg{width:27px;height:27px}.editor-extra:empty{display:none}body[data-view=dress] .part-steps{display:none!important}body[data-view=dress] .part-guide{min-height:30px;height:30px;background:none;border:0;margin:0;padding:0;justify-content:flex-start}body[data-view=dress] .part-guide svg{height:30px}body[data-view=dress] .palette-group{background:#f7f6f0;border-radius:20px;padding:16px;margin:0}.palette-group .group-label{font-size:16px;font-weight:700;margin-bottom:14px}body[data-view=dress] .palette{display:grid;grid-template-columns:repeat(8,1fr);gap:12px}body[data-view=dress] .palette .swatch{width:100%;max-width:48px;aspect-ratio:1;height:auto;border:1px solid #00000008;min-height:0}body[data-view=dress] .palette .swatch.selected{outline:2px solid #284f42;outline-offset:4px}.editor-section-title{font-size:16px;font-weight:700;margin-top:4px}body[data-view=dress] .finish-options{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;background:#f7f6f0;padding:12px;border-radius:18px}body[data-view=dress] .finish-options button{min-height:58px;height:64px;border-radius:15px;padding:6px;background:#fff;border:1px solid #e6e7de}body[data-view=dress] .finish-options .texture-demo{width:100%;height:100%;border-radius:11px}body[data-view=dress] .finish-options button span{display:none}.editor-settings{display:flex;align-items:center;justify-content:space-between;background:#f7f6f0;border-radius:18px;padding:16px;font-size:14px;margin-top:auto}.editor-settings label{display:flex;align-items:center;gap:14px}.editor-settings input{appearance:none;width:46px;height:27px;background:#a9b6ad;border-radius:20px;position:relative;cursor:pointer}.editor-settings input:before{content:'';position:absolute;width:21px;height:21px;left:3px;top:3px;background:#fff;border-radius:50%;transition:transform .18s}.editor-settings input:checked{background:#355b50}.editor-settings input:checked:before{transform:translateX(19px)}body[data-view=dress] .dress-actions{margin:0}body[data-view=dress] #next{height:64px!important;min-height:64px!important;border-radius:34px;background:linear-gradient(120deg,#345d50,#284c42);box-shadow:inset 0 1px 1px #ffffff20;color:white;border:0;font-size:21px}#editorTools,#editorWelcome{display:none}body[data-view=dress] #editorWelcome{display:flex;position:absolute;top:6%;left:4%;flex-direction:column;gap:8px;max-width:80%;background:#fffdf0e8;border-radius:24px;padding:20px 24px;color:#284f42;pointer-events:none}#editorWelcome b{font-size:20px}#editorWelcome span{font-size:12px}body[data-view=dress] #editorTools{display:flex;position:absolute;bottom:24px;left:24px;right:24px;justify-content:space-between;gap:12px;z-index:5}#editorTools>div{display:flex;gap:10px}#editorTools button{display:flex;align-items:center;justify-content:center;gap:8px;border:1px solid #fff;border-radius:22px;background:#fffef3ef;padding:14px 18px;color:#284f42;font-weight:700;box-shadow:0 3px 7px #29462c15}#editorTools svg{width:23px;height:23px}body[data-view=dress].preview-plain #backdrops{visibility:hidden}.editor-extra{display:flex;flex-wrap:wrap;gap:12px}.editor-extra h2{width:100%;font-size:18px}.editor-extra button{flex:1;background:#f6f5ec;border:1px solid #e1e5d8;border-radius:16px;padding:16px;color:#284f42}.editor-extra button[aria-pressed=true]{outline:2px solid #738f6e}.editor-extra img{display:block;width:100%;height:80px;object-fit:cover;border-radius:10px;margin-bottom:10px}#panel[data-editor-tab=accessory] .palette-group,#panel[data-editor-tab=accessory] .finish-options,#panel[data-editor-tab=accessory] .editor-section-title,#panel[data-editor-tab=accessory] .part-guide,#panel[data-editor-tab=background] .palette-group,#panel[data-editor-tab=background] .finish-options,#panel[data-editor-tab=background] .editor-section-title,#panel[data-editor-tab=background] .part-guide{display:none!important}
@media(orientation:landscape) and (max-height:800px){body[data-view=dress]:not(.waiting){grid-template-rows:56px minmax(0,1fr)}body[data-view=dress] header{height:56px}body[data-view=dress] .panel{gap:8px;padding:16px!important}.editor-tabs button{min-height:56px;gap:4px}.editor-subtitle{margin:0}.editor-tabs svg{height:22px}.editor-settings{padding:10px}.editor-settings b{font-size:12px}body[data-view=dress] .palette-group{padding:12px}body[data-view=dress] .palette{gap:9px}body[data-view=dress] .palette .swatch{max-width:38px}body[data-view=dress] .finish-options button{height:46px;min-height:46px}body[data-view=dress] #next{height:52px!important;min-height:52px!important}#editorWelcome b{font-size:17px}}
@media(orientation:portrait){body[data-view=dress]:not(.waiting){grid-template-rows:52px minmax(0,1fr)}body[data-view=dress] header{height:52px;padding:0 12px;gap:8px}#editorBack{padding:8px 12px;font-size:12px}body[data-view=dress] main{padding:0 8px 8px!important}body[data-view=dress] .layout{grid-template-columns:1fr;grid-template-rows:minmax(230px,43%) minmax(0,57%);gap:8px}body[data-view=dress] .panel{padding:12px!important;gap:8px;border-radius:22px}body[data-view=dress] .panel>h1{font-size:22px}.editor-subtitle{display:none}.editor-tabs button{min-height:48px;flex-direction:row;font-size:12px}.editor-tabs svg{width:18px;height:18px}body[data-view=dress] .palette{gap:10px}body[data-view=dress] .palette-group{padding:12px}body[data-view=dress] .palette .swatch{max-width:36px}body[data-view=dress] #editorWelcome{top:12px;padding:10px 14px}#editorWelcome b{font-size:13px}#editorWelcome span{display:none}body[data-view=dress] #editorTools{bottom:10px;left:10px;right:10px}#editorTools button{padding:9px 12px;font-size:11px;border-radius:16px}body[data-view=dress] .finish-options button{height:42px;min-height:42px}.editor-settings{padding:10px}body[data-view=dress] #next{height:50px!important;min-height:50px!important}}
body[data-view=dress] #backdrops{display:block}body[data-view=dress] .scenery-track{transform:none!important}body[data-view=dress] .brand span{display:inline;font-size:12px;font-weight:400;letter-spacing:1px}body[data-view=dress] .palette-group .group-label{display:flex!important}
body[data-view=dress] .palette-group{display:block!important}body[data-view=dress] .palette-group .group-label{width:100%;justify-content:space-between;line-height:22px}body[data-view=dress] .brand span{display:inline!important}#panel[data-editor-tab=pattern] .editor-section-title{color:#284f42}#panel[data-editor-tab=pattern] .finish-options{outline:1px solid #a7ba95}
.editor-extra:has([data-accessory]){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.editor-extra:has([data-accessory]) h2{grid-column:1/-1;margin:8px 0}.editor-extra [data-accessory]{min-height:76px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px}.editor-extra [data-accessory] span{font-weight:700}.editor-extra [data-accessory] small{font-size:11px;color:#7b8e80}@media(orientation:portrait){.editor-extra [data-accessory]{min-height:62px;padding:10px}}

body[data-view=dress] .dress-actions{display:grid;grid-template-columns:minmax(0,1fr) 108px;gap:12px;align-items:stretch}body[data-view=dress] #practiceStart{width:100%;min-width:0;min-height:50px;margin:0;padding:0 10px;border:1px solid #9fb397;border-radius:28px;background:#eff3e6;color:#355b50;font-size:16px;font-weight:700;box-shadow:none;transition:background .18s,transform .18s}body[data-view=dress] #practiceStart:hover{background:#e3ebd7}body[data-view=dress] #practiceStart:active{transform:scale(.98)}@media(max-width:600px){body[data-view=dress] .dress-actions{grid-template-columns:minmax(0,1fr) 88px;gap:8px}body[data-view=dress] #practiceStart{font-size:14px}}
/* Quiet scenery life: transform-only, intentionally sparse on handheld screens. */
#mapLife{display:none;position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2;contain:layout paint}body[data-view=game] #mapLife{display:block}.life{position:absolute;width:36px;opacity:.8}.life svg{width:100%;height:auto}.life-0{left:0;top:0;width:110px;transform-origin:0 0;animation:branchBreeze 7s ease-in-out infinite alternate}.life-1{right:0;top:0;width:90px;transform-origin:100% 0;animation:branchBreeze 9s ease-in-out infinite alternate-reverse}.life-2{left:58%;top:22%;width:28px;animation:birdDrift 18s ease-in-out infinite alternate}.life-3{left:72%;top:29%;width:20px;animation:birdDrift 23s ease-in-out infinite alternate-reverse}.life-4{left:82%;top:75%;width:26px;animation:flowerFlight 7s ease-in-out infinite alternate}.life-5{left:12%;top:79%;width:20px;animation:flowerFlight 9s ease-in-out infinite alternate-reverse}.life-butterfly svg{animation:wingFlutter 1.2s ease-in-out infinite alternate;transform-origin:center}.life-6{left:70%;top:86%;width:44px;animation:rabbitStroll 25s ease-in-out infinite alternate}.life-7{left:14%;top:16%;width:12px;animation:leafFall 16s linear infinite}.life-8{left:87%;top:8%;width:10px;animation:leafFall 21s linear infinite -8s}.life-9{left:42%;top:3%;width:9px;animation:leafFall 24s linear infinite -15s}.life-paused .life,.life-paused svg{animation-play-state:paused!important}@keyframes branchBreeze{from{transform:rotate(-2deg)}to{transform:rotate(3deg)}}@keyframes birdDrift{to{transform:translate(-90px,12px)}}@keyframes flowerFlight{to{transform:translate(30px,-24px) rotate(9deg)}}@keyframes wingFlutter{to{transform:scaleX(.45)}}@keyframes rabbitStroll{0%,30%{transform:translateX(0)}60%,100%{transform:translateX(70px)}}@keyframes leafFall{from{transform:translate(0,-40px) rotate(0);opacity:0}20%,70%{opacity:.6}to{transform:translate(45px,230px) rotate(100deg);opacity:0}}
body.playing.stageclear .panel .finish-choice{display:flex!important;flex-direction:column;gap:22px;top:50%;bottom:auto;left:50%;transform:translate(-50%,-50%);width:min(510px,calc(100% - 40px));max-width:510px;padding:28px;background:#faf8eef2;border:1px solid #ffffffc0;border-radius:28px;box-shadow:0 14px 40px #183b3220;backdrop-filter:none}.finish-choice .finish-summary{display:flex!important;flex-direction:column;align-items:center;gap:16px;color:#284f42;animation:none!important}.finish-summary>strong{font-size:25px;line-height:1.3}.finish-rewards{display:flex;gap:24px;align-items:center}.finish-rewards b{display:flex;align-items:center;gap:8px;font-size:19px;font-weight:600}.finish-rewards svg{width:23px;height:23px;color:#ac8841}.finish-choice .finish-actions{display:flex;width:100%;gap:12px}body.playing.stageclear .finish-actions .picture-button{flex:1;min-width:0;height:64px;min-height:64px!important;border-radius:36px!important;background:linear-gradient(145deg,#407763,#284f42 45%,#1c392f)!important;border:1px solid #f8f5e9b0!important;color:#fff!important;box-shadow:inset 0 2px 2px #ffffff33,0 7px 16px #29442d20!important;font-size:17px;transition:transform .18s,box-shadow .18s}body.playing.stageclear .finish-actions .secondary{background:#f6f5e9!important;color:#35594a!important;border-color:#c5d0be!important;box-shadow:none!important}body.playing.stageclear .finish-actions .picture-button:hover{transform:translateY(-2px)}body.playing.stageclear .finish-actions .picture-button:active{transform:scale(.98)}.finish-actions .ui-icon{width:21px;height:21px}
@media(max-width:700px),(pointer:coarse){.life-1,.life-3,.life-5,.life-8,.life-9{display:none}.life-0{width:74px}.life-6{width:32px;left:76%;top:88%}body.playing.stageclear .panel .finish-choice{padding:22px;gap:18px}.finish-summary>strong{font-size:22px}body.playing.stageclear .finish-actions .picture-button{font-size:15px;height:58px;min-height:58px!important;padding:8px 12px}.finish-actions{gap:8px!important}}
@media(prefers-reduced-motion:reduce){#mapLife .life,#mapLife svg{animation:none!important}.life-leaf{display:none}}
/* Shared translucent outcome / pause surfaces. */
body.playing.stageclear .panel .finish-choice,#pauseMenu>section{width:min(510px,calc(100% - 40px));max-width:510px;padding:28px;border:1px solid #ffffffa0;border-radius:28px;background:rgba(250,248,238,.64);backdrop-filter:none;box-shadow:0 12px 32px #183b321c;gap:22px;text-align:center;color:#284f42}#pauseMenu{background:#173b3210;backdrop-filter:none}#pauseMenu h2{font-size:25px;line-height:1.3;margin:0}#pauseMenu .pause-actions{display:flex;width:100%;gap:12px}#pauseMenu .pause-actions button{flex:1;min-width:0;height:64px;min-height:64px;padding:8px 12px;border-radius:36px;border:1px solid #f8f5e9b0;font-size:17px;margin:0;background:linear-gradient(145deg,#407763,#284f42 45%,#1c392f);color:#fff;box-shadow:inset 0 2px 2px #ffffff33,0 7px 16px #29442d20;transition:transform .18s}#pauseMenu .pause-actions .secondary{background:#f6f5e9e6;color:#35594a;border-color:#c5d0be;box-shadow:none}#pauseMenu .pause-actions button:hover{transform:translateY(-2px)}#pauseMenu .pause-actions button:active{transform:scale(.98)}
.life-bird,.life-butterfly{left:-10%;opacity:.9}.life-2{animation:crossSky 30s linear infinite;top:22%;width:35px}.life-3{animation:crossSky 37s linear infinite -19s;top:30%;width:26px}.life-4{animation:crossMeadow 24s linear infinite -7s;top:78%;width:31px}.life-5{animation:crossMeadow 31s linear infinite -21s;top:84%;width:24px}.life-butterfly svg{animation:none}.animal-wings{transform-origin:24px 25px;animation:wingFlutter .65s ease-in-out infinite alternate}.life-bird .animal-wings{animation-duration:.95s}.life-6{left:105%;top:86%;animation:rabbitCross 38s linear infinite;width:48px}.animal-hop{animation:rabbitHop 1.2s ease-in-out infinite;transform-origin:24px 40px}@keyframes crossSky{0%{transform:translateX(0) translateY(0);opacity:0}5%,95%{opacity:.9}50%{transform:translateX(60vw) translateY(-28px)}100%{transform:translateX(120vw) translateY(10px);opacity:0}}@keyframes crossMeadow{0%{transform:translateX(0) translateY(0);opacity:0}8%,92%{opacity:.9}25%{transform:translateX(30vw) translateY(-26px)}50%{transform:translateX(60vw) translateY(8px)}75%{transform:translateX(90vw) translateY(-20px)}100%{transform:translateX(120vw);opacity:0}}@keyframes rabbitCross{0%,15%{transform:translateX(0)}85%,100%{transform:translateX(-120vw)}}@keyframes rabbitHop{0%,65%,100%{transform:translateY(0)}30%{transform:translateY(-6px) rotate(-3deg)}}
@media(max-width:700px),(pointer:coarse){#pauseMenu>section{padding:22px;gap:18px}#pauseMenu h2{font-size:22px}#pauseMenu .pause-actions{gap:8px}#pauseMenu .pause-actions button{height:58px;min-height:58px;font-size:15px}.life-6{left:105%;width:34px}}
@media(prefers-reduced-motion:reduce){#mapLife .life,#mapLife svg,#mapLife .animal-wings,#mapLife .animal-hop{animation:none!important}.life-bird,.life-butterfly,.life-rabbit{display:none}}
.life-paused *{animation-play-state:paused!important}
/* Keep both dialog labels centered irrespective of global button alignment. */
#pauseMenu .pause-actions button,body.playing.stageclear .finish-actions .picture-button{display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;gap:9px;line-height:1.2;white-space:nowrap}#pauseMenu .pause-actions button{padding:10px 14px!important}#pauseMenu>section{background:rgba(250,248,238,.76)}#mapLife{display:none!important}
/* Centered game entry, with the character between title and primary action. */
#welcomeScreen{align-items:center;padding:24px 32px}.welcome-brand{justify-content:center;flex:none}.welcome-shade{background:linear-gradient(180deg,#faf8ed8f,transparent 30%,transparent 60%,#faf8ed70)}.welcome-content{display:block;position:relative;width:min(760px,100%);flex:1;min-height:0;margin:0 auto}.welcome-copy{position:static;display:contents;padding:0;margin:0;max-width:none;text-align:center}.welcome-tag{position:absolute;top:4%;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:13px;padding:5px 14px}.welcome-copy h1{position:absolute;top:13%;left:0;width:100%;font-size:clamp(32px,4vw,54px);line-height:1.08;margin:0;text-align:center}.welcome-copy h1 br{display:none}.welcome-description{display:none}.welcome-friend{position:absolute;left:50%;right:auto;transform:translateX(-50%);top:27%;bottom:auto;width:72%;height:49%;max-height:none;min-height:0}.welcome-friend img{height:100%;width:100%;object-fit:contain}.welcome-copy #enterStudio{position:absolute;left:50%;transform:translateX(-50%);bottom:9%;width:min(300px,80%);height:66px;min-height:66px;margin:0}.welcome-copy #enterStudio:hover{transform:translateX(-50%) translateY(-2px)}.welcome-copy #enterStudio:active{transform:translateX(-50%) scale(.98)}.welcome-features{position:absolute;bottom:1%;left:50%;transform:translateX(-50%);margin:0;white-space:nowrap;justify-content:center}.welcome-features li{font-size:13px}.welcome-features svg{width:20px;height:20px}
@media(orientation:portrait){#welcomeScreen{padding:22px 16px}.welcome-brand{font-size:23px}.welcome-tag{top:5%}.welcome-copy h1{top:14%;font-size:40px;line-height:1.1}.welcome-copy h1 br{display:block}.welcome-friend{top:32%;height:41%;width:100%;left:50%;right:auto;bottom:auto}.welcome-copy #enterStudio{bottom:12%;height:62px;min-height:62px}.welcome-features{bottom:5%}.welcome-shade{background:linear-gradient(180deg,#faf8edb0,transparent 38%,transparent 65%,#faf8ed80)}}
@media(orientation:landscape) and (max-height:600px){#welcomeScreen{padding:14px 24px}.welcome-brand{font-size:20px;line-height:24px}.welcome-tag{top:2%;font-size:11px;padding:2px 10px;line-height:20px}.welcome-copy h1{top:12%;font-size:32px}.welcome-friend{top:25%;height:45%;width:60%}.welcome-copy #enterStudio{height:50px;min-height:50px;bottom:12%;width:240px;font-size:21px}.welcome-features{bottom:1%;line-height:20px}.welcome-features li{font-size:11px}.welcome-features svg{width:16px;height:16px}}

/* Sculpted game controls: warm bevels, solid rims and recessed progress. */
body.playing #finish,body.playing .hud-pill,#journeyHud{
 background:linear-gradient(160deg,#fffef8 8%,#f7f3df 65%,#e8e4d1)!important;
 border:1px solid #fffcf1!important;
 box-shadow:inset 0 2px 2px #fff,inset 0 -2px 3px #b9bea044,0 4px 0 #abb69c,0 7px 12px #233c3324!important;
 backdrop-filter:none;text-shadow:0 1px 0 #fff;
}
body.playing #finish{transition:transform 160ms,box-shadow 160ms}
body.playing #finish:hover{transform:translateY(-2px)}
body.playing #finish:active{transform:translateY(3px);box-shadow:inset 0 2px 4px #78866b44,0 1px 0 #abb69c!important}
body.playing .hud-pill svg,body.playing #finish svg{filter:drop-shadow(0 1px 0 #fff) drop-shadow(0 1px 1px #213b332b)}
#journeyHud .journey-meter{background:#c6d0bb!important;box-shadow:inset 0 2px 3px #465c4b40,inset 0 -1px 0 #fff;border-radius:20px}
#journeyFill{background:linear-gradient(180deg,#b7ce96 0%,#8eac75 40%,#6b8b57 100%)!important;box-shadow:inset 0 1px 1px #e7f4ce,inset 0 -1px 1px #425f3944;border-radius:20px}
@media(prefers-reduced-motion:reduce){body.playing #finish{transition:none}}

/* Match the pause control's circular footprint for both counters. */
body.playing #gameHud .hud-pill{width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;flex:0 0 50px;aspect-ratio:1;border-radius:50%!important;padding:5px 2px!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px!important;line-height:1}
body.playing #gameHud .hud-pill svg{width:15px!important;height:15px!important}
body.playing #gameHud .hud-pill strong,body.playing #gameHud .hud-pill b,body.playing #timer,body.playing #score{font-size:16px!important;line-height:18px}
/* Collection actions use the same sculpted finish-screen buttons. */
body[data-view=result] .panel .picture-button{
 display:flex;align-items:center;justify-content:center;gap:9px;
 background:linear-gradient(145deg,#407763,#284f42 45%,#1c392f)!important;
 color:#fff!important;border:1px solid #f8f5e9b0!important;
 box-shadow:inset 0 2px 2px #ffffff33,0 7px 16px #29442d20!important;
 transition:transform .18s,box-shadow .18s;
}
body[data-view=result] .panel .picture-button.secondary{
 background:linear-gradient(145deg,#fffef7,#f6f5e9 55%,#e4e7d8)!important;
 color:#35594a!important;border-color:#c5d0be!important;
 box-shadow:inset 0 2px 2px #fff,0 3px 0 #bdc9b6,0 7px 16px #29442d15!important;
}
body[data-view=result] .panel .picture-button .ui-icon{background:transparent!important}
body[data-view=result] .panel .picture-button:hover{transform:translateY(-2px)}
body[data-view=result] .panel .picture-button:active{transform:scale(.98)}
body[data-view=result] .panel .picture-button:disabled{transform:none;opacity:.6;cursor:wait}
@media(prefers-reduced-motion:reduce){body[data-view=result] .panel .picture-button{transition:none}}

/* Reference composition: landscape, pony, dimensional title, single action. */
#welcomeScreen{padding:20px 24px 24px;align-items:center}
.welcome-brand{font-size:26px;line-height:32px;justify-content:center}
.welcome-content{width:100%;max-width:none;margin:0;position:relative}
.welcome-shade{background:linear-gradient(180deg,#faf8ed35,transparent 22%,transparent 68%,#faf8ed45)}
.welcome-tag{top:4%;font-size:13px;line-height:22px;padding:5px 15px;letter-spacing:0;background:#fffdf1dc}
.welcome-friend{top:23%;left:50%;right:auto;bottom:auto;width:52%;height:42%;transform:translateX(-50%)}
.welcome-friend img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 10px 6px #29351e25)}
.welcome-copy h1{top:69%;left:0;width:100%;margin:0;font-size:clamp(30px,5.2vw,76px);font-weight:900;line-height:1.2;letter-spacing:-.055em;color:#553c27;text-align:center;white-space:nowrap;-webkit-text-stroke:3px #fff9e9;paint-order:stroke fill;text-shadow:0 4px 0 #98612c,0 6px 0 #98612c;transform:rotate(-2deg)}
.welcome-copy #enterStudio{bottom:7%;width:clamp(230px,30vw,400px);height:clamp(56px,9vh,90px);min-height:0;padding:8px 24px;font-size:clamp(26px,3vw,42px);border-radius:40px;border:1px solid #245b48;background:linear-gradient(110deg,#226551,#153f33);color:white;box-shadow:0 6px 0 #299b78,inset 0 1px 0 #ffffff20}
@media(orientation:portrait){#welcomeScreen{padding:20px 14px}.welcome-brand{font-size:22px}.welcome-brand span{font-size:10px}.welcome-tag{top:5%}.welcome-friend{top:24%;height:39%;width:94%}.welcome-copy h1{top:68%;font-size:clamp(27px,7.4vw,56px);-webkit-text-stroke:2px #fff9e9;text-shadow:0 3px 0 #98612c}.welcome-copy #enterStudio{bottom:9%;width:72%;height:64px;font-size:30px}}
@media(orientation:landscape) and (max-height:600px){#welcomeScreen{padding:10px 20px 16px}.welcome-brand{font-size:20px;line-height:24px}.welcome-tag{top:3%;font-size:11px;line-height:18px;padding:3px 12px}.welcome-friend{top:20%;height:43%;width:48%}.welcome-copy h1{top:67%;font-size:clamp(28px,4.6vw,44px);-webkit-text-stroke:2px #fff9e9;text-shadow:0 3px 0 #98612c}.welcome-copy #enterStudio{bottom:3%;height:48px;width:240px;font-size:26px}}
@font-face{font-family:MarkeysJua;src:url('fonts/Jua-Regular.ttf') format('truetype');font-style:normal;font-weight:400;font-display:swap}
.welcome-copy h1{font-family:MarkeysJua,'Noto Sans KR',sans-serif;font-weight:400;letter-spacing:-.025em;color:#553c27;-webkit-text-fill-color:#553c27;background:none}
.welcome-copy #enterStudio{font-family:MarkeysJua,'Noto Sans KR',sans-serif;font-weight:400}
/* Stronger cream-white outline around the welcome title. */
.welcome-copy h1{-webkit-text-stroke:6px #fff9e9;paint-order:stroke fill}
@media(orientation:portrait),(orientation:landscape) and (max-height:600px){.welcome-copy h1{-webkit-text-stroke-width:4px}}

/* Fixed, gently undulating lettering like the supplied title reference. */
.welcome-copy h1{transform:rotate(-2deg)}
.welcome-copy h1>span{display:inline-block;transform:translateY(calc(var(--lift)*.035em)) rotate(calc(var(--tilt)*1deg));transform-origin:50% 80%}
@font-face{font-family:MarkeysJalnan;src:url('fonts/Jalnan2.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
.welcome-copy h1{font-family:MarkeysJalnan,sans-serif;font-weight:400;letter-spacing:-.045em;-webkit-text-stroke:3px #fff9e9;text-shadow:none;filter:drop-shadow(0 3px 0 #865322)}
.welcome-copy h1>span{text-shadow:none;-webkit-text-stroke:inherit;paint-order:stroke fill;transform:translateY(calc(var(--lift)*.02em)) rotate(calc(var(--tilt)*1deg))}
@media(orientation:portrait),(orientation:landscape) and (max-height:600px){.welcome-copy h1{-webkit-text-stroke-width:2px;filter:drop-shadow(0 2px 0 #865322)}}
/* Lock all HUD faces to equal dimensions; override inherited button minimums. */
body.playing #finish{box-sizing:border-box!important;width:50px!important;height:50px!important;min-width:50px!important;max-width:50px!important;min-height:50px!important;max-height:50px!important;aspect-ratio:1/1;border-radius:50%!important;padding:0!important;display:flex!important;align-items:center;justify-content:center;flex:none}
body.playing #finish svg{width:24px!important;height:24px!important;stroke-width:3.6}
body.playing #gameHud .hud-pill{box-sizing:border-box!important;max-width:50px!important;max-height:50px!important;display:grid!important;grid-template-columns:1fr;grid-template-rows:18px 18px;align-content:center;justify-items:center;align-items:center;gap:1px!important;padding:0!important;text-align:center}
body.playing #gameHud .hud-icon{display:block;width:22px;height:18px;min-height:0;margin:0!important;padding:0!important;font-size:21px!important;line-height:18px!important;text-align:center}
body.playing #gameHud .hud-pill strong,body.playing #gameHud .hud-pill b{display:block;margin:0!important;padding:0!important;height:18px;line-height:18px!important;text-align:center;align-self:center}
body.playing #gameHud .hud-unit{display:none!important}

/* Portrait-only welcome guidance; never blocks the start action. */
.rotate-hint{display:none}
@media(orientation:portrait){
 #welcomeScreen .rotate-hint{display:flex;position:absolute;z-index:2;top:19%;left:50%;transform:translateX(-50%);align-items:center;gap:8px;padding:7px 14px;border:1px solid #fff9e9c0;border-radius:18px;background:#fff9e9e8;color:#284f42;white-space:nowrap;pointer-events:none}
 .rotate-hint span{font-size:14px;font-weight:700}
 .rotate-phone{width:42px;height:42px;flex:none;animation:turn-phone 3.4s ease-in-out infinite;transform-origin:center}
}
@keyframes turn-phone{0%,15%{transform:rotate(0)}50%,80%{transform:rotate(-90deg)}100%{transform:rotate(0)}}
@media(orientation:portrait) and (max-height:620px){#welcomeScreen .rotate-hint{top:20%;padding:4px 10px}.rotate-phone{width:30px;height:30px}.rotate-hint span{font-size:12px}}
@media(prefers-reduced-motion:reduce){.rotate-phone{animation:none;transform:rotate(-90deg)}}
/* Fit the editor into Safari's visible viewport, including browser chrome. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body[data-view=dress]:not(.waiting){height:100dvh;min-height:0}
body[data-view=dress] .layout{grid-template-columns:minmax(0,58fr) minmax(0,42fr)}
body[data-view=dress] .panel{min-width:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
body[data-view=dress] .panel>*{flex-shrink:0}
.editor-tabs button,#editorTools button,#editorBack{white-space:nowrap}
@media(orientation:landscape) and (max-height:600px){
 body[data-view=dress]:not(.waiting){grid-template-rows:44px minmax(0,1fr)}
 body[data-view=dress] header{height:44px;padding:0 10px;gap:10px}
 body[data-view=dress] .brand{font-size:19px}
 body[data-view=dress] .brand img{width:26px;height:26px}
 body[data-view=dress] .brand span{display:none!important}
 body[data-view=dress] #sound{width:36px;height:36px;min-width:36px;min-height:36px;padding:7px}
 body[data-view=dress] #editorBack{padding:6px 12px;font-size:12px;min-height:36px;gap:5px}
 body[data-view=dress] main{padding:0 8px 8px!important}
 body[data-view=dress] .layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
 body[data-view=dress] .world,body[data-view=dress] .panel{border-radius:18px}
 body[data-view=dress] .panel{padding:8px!important;gap:8px}
 body[data-view=dress] .panel>h1,body[data-view=dress] .editor-subtitle,body[data-view=dress] #editorWelcome{display:none!important}
 .editor-tabs{gap:5px}
 .editor-tabs button{min-height:44px;padding:5px 2px;font-size:11px;gap:3px;flex-direction:row}
 .editor-tabs svg{width:18px;height:18px;flex-shrink:0}
 body[data-view=dress] .part-guide{height:26px;min-height:26px;gap:6px}
 body[data-view=dress] .part-guide svg{width:27px;height:26px}
 body[data-view=dress] .part-guide b{font-size:13px}
 body[data-view=dress] .part-guide>span{font-size:10px}
 body[data-view=dress] .palette-group{padding:9px;flex:none}
 body[data-view=dress] .palette-group .group-label{font-size:12px;line-height:16px;margin-bottom:8px}
 body[data-view=dress] .palette{height:auto;max-height:none;gap:9px}
 body[data-view=dress] .palette .swatch{width:100%;max-width:30px;min-height:0;aspect-ratio:1}
 body[data-view=dress] .finish-options{padding:6px;gap:6px}
 body[data-view=dress] .finish-options button{height:38px;min-height:38px;padding:3px}
 .editor-section-title{font-size:12px;margin:0}
 .editor-settings{padding:6px 8px;font-size:11px;gap:6px}
 .editor-settings label{gap:6px}
 body[data-view=dress] .dress-actions{position:sticky;bottom:-8px;background:#fffdfa;z-index:6;padding:6px 0;grid-template-columns:minmax(0,1fr) 80px;gap:6px;margin-top:auto}
 body[data-view=dress] #next,body[data-view=dress] #practiceStart{height:44px!important;min-height:44px!important;font-size:14px}
 body[data-view=dress] #editorTools{bottom:8px;left:8px;right:8px;gap:6px}
 #editorTools>div{gap:6px}
 #editorTools button{min-width:44px;height:44px;padding:7px 9px;font-size:11px;border-radius:15px;gap:4px}
 #editorTools #randomPony span{font-size:0}#editorTools #randomPony span:after{content:'랜덤';font-size:11px}
 .editor-extra:has([data-accessory]){gap:6px}.editor-extra [data-accessory]{min-height:52px;padding:8px;font-size:12px}.editor-extra [data-accessory] small{display:none}
}
@media(orientation:portrait){
 body[data-view=dress] .layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,40fr) minmax(0,60fr)}
 body[data-view=dress] .panel{overflow-y:auto}
 body[data-view=dress] .palette{height:auto}
}
@media(orientation:portrait){
 body[data-view=dress] .palette-group{flex:0 0 auto!important;height:auto!important;min-height:160px!important}
 body[data-view=dress] .palette{height:auto!important;min-height:108px;grid-template-rows:repeat(3,30px);row-gap:9px}
 body[data-view=dress] .palette .swatch{width:30px;height:30px}
 body[data-view=dress] .finish-options{flex:none!important;height:auto!important;min-height:60px}
 body[data-view=dress] .dress-actions{position:sticky;bottom:-12px;z-index:6;background:#fffdfa;padding:8px 0;flex:none!important}
}
/* Picture-first controls with retained screen-reader names. */
.picture-button>span,.editor-tabs button>span,#editorTools button>span,
.editor-extra [data-accessory]>span,.editor-extra [data-accessory]>small,.editor-extra [data-preview-map]>span{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}
body[data-view=dress] #editorWelcome,.editor-subtitle,body[data-view=dress] .panel>h1,.editor-extra h2,.editor-section-title,body[data-view=dress] .palette-group .group-label,body[data-view=dress] .part-guide b,body[data-view=dress] .part-guide>span{display:none!important}
body[data-view=dress] .editor-tabs svg{width:28px;height:28px}
body[data-view=dress] .part-guide svg{width:52px;height:36px}
.accessory-preview{width:54px;height:54px;display:block}
.editor-extra [data-accessory]{padding:8px!important}
body[data-view=dress] .editor-settings{justify-content:flex-end}
body[data-view=dress] .picture-button .ui-icon,body[data-view=result] .picture-button .ui-icon,#pauseMenu .pause-actions svg{width:30px;height:30px}
#practiceStart svg{width:28px;height:28px}
#practiceStart svg{width:34px;height:34px;stroke-width:2.2}
#rotatePony[aria-pressed=true]{color:#fff!important;background:linear-gradient(145deg,#407763,#284f42)!important;box-shadow:inset 0 2px 2px #ffffff33,0 5px 0 #173c32!important}
#rotatePony[aria-pressed=true] svg{animation:slowTurn 4s linear infinite}
@keyframes slowTurn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#rotatePony[aria-pressed=true] svg{animation:none}}
#editorTools button{min-width:44px}#editorTools button>span:after{content:none!important}
#pauseMenu h2{display:none}
body[data-view=dress] .palette-group{min-height:0!important}

body[data-view=result] .instructions{display:none!important}

/* Large, scannable keepsake QR with its short instruction underneath. */
body[data-view=result] .qr-wrap{flex-direction:column!important;gap:8px!important;padding:12px!important}
body[data-view=result] .qr-wrap canvas{width:min(280px,35vh,76%)!important;height:auto!important;max-height:none!important}
body[data-view=result] .qr-wrap p{display:block!important;margin:0!important;text-align:center;font-size:13px!important;line-height:1.35!important;color:#587064!important}
body[data-view=result] .qr-wrap p b{display:none}
body[data-view=result] .qr-wrap:after{display:none!important;content:none!important}

/* Picture-first leaderboard entry on the welcome screen. */
#rankingOpen{position:absolute;z-index:8;right:max(24px,env(safe-area-inset-right));top:max(20px,env(safe-area-inset-top));width:62px;height:62px;padding:14px;border:1px solid #fff9e9;border-radius:50%;background:linear-gradient(145deg,#fffdf5,#e8ead9);color:#284f42;box-shadow:0 6px 0 #b9c5a8,0 10px 24px #173c3222;cursor:pointer}
#rankingOpen svg{width:100%;height:100%}#rankingOpen:active{transform:translateY(4px);box-shadow:0 2px 0 #b9c5a8}
.trophy-back{fill:#d08a19}.trophy-cup{fill:#f2b92f;filter:drop-shadow(0 3px 0 #a96c12)}.trophy-shine{fill:#ffe792}.trophy-star{fill:#fff8d9}.trophy-base{fill:#8b5b20}
#rankingModal[hidden]{display:none}#rankingModal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));background:#173c3290}
#rankingModal section{position:relative;width:min(680px,92vw);height:min(720px,88vh);padding:30px 24px 22px;border:2px solid #fff;border-radius:34px;background:#f8f5e9;box-shadow:0 14px 0 #9caf8e,0 24px 50px #10271f45;overflow:hidden}
#rankingClose{position:absolute;right:18px;top:18px;width:54px;height:54px;border:0;border-radius:50%;background:#fff;color:#284f42;box-shadow:0 4px 0 #c7d0bc;padding:12px}#rankingClose svg{width:100%;height:100%}
.ranking-mark{width:76px;height:76px;margin:0 auto 18px;color:#b78522}.ranking-mark svg{width:100%;height:100%}
#rankingList{height:calc(100% - 96px);margin:0;padding:0 4px;overflow:auto;list-style:none;display:flex;flex-direction:column;gap:9px}
#rankingList li{display:grid;grid-template-columns:42px 76px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:78px;padding:8px 16px;border:1px solid #dce3d4;border-radius:18px;background:#fffdf8;color:#284f42}
#rankingList li:nth-child(1){background:#fff2bd;border-color:#e7ca68}#rankingList li:nth-child(2){background:#eef1ed}#rankingList li:nth-child(3){background:#f6dfc4}
#rankingList li.is-me{outline:4px solid #76a68b}#rankingList li>b{font-size:24px;text-align:center}.rank-name{font-size:16px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#rankingList li>strong{display:flex;align-items:center;gap:5px;font-size:20px;color:#a67518}#rankingList li>strong svg{width:24px;height:24px}
.rank-pony{position:relative;display:block;width:74px;height:60px;overflow:visible;filter:drop-shadow(0 3px 2px #173c3240)}.rank-pony:before{content:"";position:absolute;inset:0;background:linear-gradient(145deg,color-mix(in srgb,var(--pony) 72%,white),var(--pony) 45%,color-mix(in srgb,var(--pony) 70%,black));-webkit-mask:url('pony.svg') center/contain no-repeat;mask:url('pony.svg') center/contain no-repeat}.rank-pony i{position:absolute;left:35px;top:27px;width:22px;height:16px;border:2px solid #f6df9d;border-radius:45% 52% 42% 40%;background:#6a4936}.rank-pony[style*="--pattern:1"] i{background:radial-gradient(circle,#f6df9d 0 2px,transparent 2.5px) 0 0/7px 7px,#6a4936}.rank-pony[style*="--pattern:2"] i{background:repeating-linear-gradient(45deg,#f6df9d 0 4px,#6a4936 4px 8px)}.rank-pony[style*="--pattern:3"] i{background:conic-gradient(#f6df9d 25%,#6a4936 0 50%,#f6df9d 0 75%,#6a4936 0) 0 0/8px 8px}.rank-pony[style*="--pattern:4"] i{background:linear-gradient(#f6df9d,#6a4936)}.rank-pony[data-accessory]:after{content:"";position:absolute;display:none}.rank-pony[data-accessory="1"]:after,.rank-pony[data-accessory="6"]:after{display:block;width:12px;height:12px;border-radius:50% 0;transform:rotate(45deg);background:#d47698;left:20px;top:12px}.rank-pony[data-accessory="2"]:after{display:block;left:15px;top:5px;width:18px;height:12px;background:#e9b83e;clip-path:polygon(0 100%,0 20%,30% 58%,50% 0,70% 58%,100% 20%,100% 100%)}.rank-pony[data-accessory="3"]:after{display:block;left:19px;top:7px;width:13px;height:13px;border-radius:50%;background:#efc84f;box-shadow:7px 0 #fff7dc,-7px 0 #fff7dc,0 7px #fff7dc,0 -7px #fff7dc}.rank-pony[data-accessory="4"]:after{display:block;left:23px;top:20px;width:22px;height:7px;border-radius:7px;background:#6f9b78;transform:rotate(-18deg)}.rank-pony[data-accessory="5"]:after{display:block;left:43px;top:25px;width:11px;height:11px;background:#f0bd39;clip-path:polygon(50% 0,62% 35%,100% 38%,70% 60%,80% 100%,50% 75%,20% 100%,30% 60%,0 38%,38% 35%)}
#rankingList .ranking-empty{display:grid;place-items:center;grid-template-columns:1fr;height:100%;background:transparent;border:0}.ranking-empty svg{width:92px;color:#9aaa8e}
.ranking-loading span{height:13px;border-radius:10px;background:#dce3d4;animation:rankPulse 1s ease-in-out infinite}.ranking-loading span:nth-child(2){width:70%}.ranking-loading span:nth-child(3){width:50px}@keyframes rankPulse{50%{opacity:.35}}
@media(orientation:portrait){#rankingOpen{width:54px;height:54px;padding:12px;right:14px;top:max(14px,env(safe-area-inset-top))}#rankingModal section{height:min(680px,84vh);padding:24px 14px 16px}#rankingList li{grid-template-columns:30px 58px minmax(0,1fr) auto;gap:6px;padding:7px 8px;min-height:66px}.rank-pony{width:56px;height:48px}.rank-pony i{left:27px;top:22px;width:17px;height:12px}.rank-name{font-size:13px}#rankingList li>strong{font-size:16px;gap:2px}#rankingList li>strong svg{width:19px;height:19px}body[data-view=result] .qr-wrap canvas{width:min(240px,30vh,72%)!important}}
@media(orientation:landscape) and (max-height:600px){#rankingOpen{width:46px;height:46px;padding:10px;top:10px;right:16px;box-shadow:0 4px 0 #b9c5a8}#rankingModal section{height:92vh;width:min(760px,82vw);padding:14px 18px}.ranking-mark{width:48px;height:48px;margin-bottom:8px}#rankingList{height:calc(100% - 58px)}#rankingList li{min-height:43px;padding:4px 12px}body[data-view=result] .qr-wrap canvas{width:min(210px,34vh,70%)!important}}
#ponyNicknameHud[hidden]{display:none}#ponyNicknameHud{position:fixed;z-index:45;left:50%;bottom:max(18px,env(safe-area-inset-bottom));transform:translateX(-50%);max-width:min(78vw,560px);padding:10px 20px;border:1px solid #fff9e9;border-radius:24px;background:#173c32d9;color:#fffdf1;font-size:clamp(14px,1.7vw,20px);font-weight:800;line-height:1.2;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 5px 0 #0f2f27,0 10px 24px #10271f30;pointer-events:none}
@media(orientation:portrait){#ponyNicknameHud{bottom:max(12px,env(safe-area-inset-bottom));max-width:86vw;padding:8px 15px;font-size:13px}}
@media(orientation:landscape) and (max-height:600px){#ponyNicknameHud{bottom:max(8px,env(safe-area-inset-bottom));padding:7px 15px;font-size:13px}}
