/* 월드와 모든 월드 위 UI는 하나의 720:1280 프레임을 공유한다. */
:root{--ink:#fff0d5;--sub:#dcc6a5;--accent:#ffc45f}
html,body{height:100%;overflow:hidden;overscroll-behavior:none}body{background:#101925;color:var(--ink);font-family:"Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",system-ui,sans-serif}
#stage{max-width:600px;margin:auto;display:flex;flex-direction:column;background:#182231;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
header{display:flex;align-items:center;gap:7px;padding:5px 10px;flex-shrink:0;font-size:10px;min-height:42px}header a{text-decoration:none;color:#fff0d5;font-size:14px}header b{color:#ffc45f}header span{flex:1}header button{font-size:10px;min-height:32px;padding:4px 6px;border-color:#5e6271}
button{border:1px solid #927451;border-radius:12px;min-height:44px;padding:10px 12px;background:#3c3540;color:var(--ink);font:inherit;font-size:14px;touch-action:manipulation}button:focus-visible{outline:3px solid #ffdc83;outline-offset:2px}.primary{background:linear-gradient(#ffdb8b,#efb95b);color:#493020;border-color:#ffdc83;font-weight:800;box-shadow:0 4px 0 #9e6432}button:disabled{opacity:.45}.board{flex:1;min-height:0;position:relative;display:grid;place-items:center;overflow:hidden;background:#101925}#field{position:relative;flex-shrink:0;overflow:hidden;isolation:isolate}canvas{display:block;width:100%;height:100%;touch-action:none}#home{position:absolute;inset:0;text-align:center;pointer-events:none}.home-heading{position:absolute;inset:3% 4% auto;text-shadow:0 3px 9px #17212d}.eyebrow{font-size:11px;letter-spacing:.06em;color:#f8d496;margin:8px 0}h1,h2,p{margin-top:0}.home-heading h1{font-size:clamp(27px,8.5vw,44px);line-height:1.15;color:#ffedc3;margin:12px 0}.home-heading h1 strong{font-size:1.45em;color:#ffca70;text-shadow:0 4px 0 #6f3e2a,0 7px 15px #162131}.game-logo{max-height:23vh;width:90%;object-fit:contain}.home-note{font-size:12px;color:#fff2ce}.home-actions{position:absolute;left:7%;right:7%;bottom:4%;display:grid;gap:10px;pointer-events:auto}.home-actions>button{display:flex;align-items:center;justify-content:center;gap:8px;background:#292e3bee}.home-actions>button.primary{background:linear-gradient(#ffdb8b,#efb95b);font-size:20px;min-height:56px}.home-actions button img{width:30px;height:30px;object-fit:contain}.home-actions small{font-size:11px;font-weight:500}.menu{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.menu button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:11px;padding:8px 2px;background:#292e3bee}.menu button img{width:37px;height:37px}
#hud{position:absolute;left:3%;right:3%;top:2%;padding:10px 11px 8px;border-radius:16px;background:#172330ed;border:1px solid #a9936c66;box-shadow:0 4px 14px #0003}.hud-line{display:flex;align-items:center;justify-content:space-between;gap:7px;font-size:13px}.hud-line>strong{white-space:nowrap;color:#ffda95}.coins{display:flex;align-items:center;gap:3px}.coins img{width:24px;height:24px;object-fit:contain}#timer{font-size:17px;font-weight:800;font-variant-numeric:tabular-nums}#pause{min-height:32px;padding:3px 10px;font-size:15px}.goal{display:flex;align-items:center;gap:8px;margin-top:7px}.goal small{font-size:10px;white-space:nowrap}progress{height:8px;accent-color:#ffc65f;border:0;border-radius:10px;overflow:hidden;background:#3c4450}.goal progress{flex:1;width:0}progress::-webkit-progress-bar{background:#3c4450}progress::-webkit-progress-value{background:#ffc65f;border-radius:10px}.hurry #timer{color:#ff8c7f;animation:pulse .6s infinite alternate}@keyframes pulse{to{opacity:.55}}
.overlay{position:absolute;inset:0;display:grid;place-items:center;padding:20px;background:#101925b8;z-index:5;text-align:center}.panel{width:min(100%,340px);border:1px solid #9d8058;border-radius:22px;padding:25px 20px;background:#25303e;box-shadow:0 15px 45px #0005}.panel h2{font-size:22px;line-height:1.5;margin:8px 0 16px}.panel p{font-size:13px;line-height:1.7;color:#f3ddbb}.panel button{width:100%;margin-top:12px}.panel progress{display:block;width:100%;margin-top:18px}#loading{background:#182231;z-index:10}#intro{pointer-events:none;background:#10192580}#closing{background:#10192544;pointer-events:none}#closing h1{color:#ffdf98;text-shadow:0 4px 0 #5b3826;font-size:40px}.speech{background:#fff0cd;border:2px solid #b99461;color:#594031;border-radius:16px;padding:12px;font-size:14px;line-height:1.5}
.result{position:absolute;inset:42px 0 0;background:radial-gradient(ellipse at top,#38485b,#182231 75%);z-index:4;overflow-y:auto;padding:18px 22px max(24px,env(safe-area-inset-bottom));text-align:center}.result-inner{max-width:350px;margin:auto}.result h1{font-size:26px;margin:8px 0}.stars{display:flex;justify-content:center;gap:8px;margin:16px 0}.stars img{width:48px;height:48px;object-fit:contain}.stars img.empty{opacity:.19;filter:grayscale(1)}.result-coins{display:flex;justify-content:center;align-items:center;gap:8px;margin:14px 0 6px}.result-coins img{width:42px;height:42px;object-fit:contain}.result-coins strong{font-size:38px;color:#ffda89}.result>div>p{font-size:13px;color:#e6d3b4}.result dl{padding:10px 16px;border:1px solid #6d6d70;border-radius:16px;background:#111c2a70;margin:20px 0}.result dl>div{display:flex;justify-content:space-between;line-height:2.1;font-size:14px}.result dd{margin:0;color:#ffdc9c;font-weight:700}.result button{display:block;width:100%;margin-top:10px}.result #result-eater{color:#594031}#share-note{font-size:11px;min-height:0;margin:8px 0}#result-home{background:transparent;border-color:transparent;color:#e1ceb0}
@media(max-height:650px){header span{display:none}header a{margin-right:auto}.home-actions{gap:6px;bottom:2%}.home-actions>button.primary{min-height:44px;font-size:16px}.menu button{font-size:10px;padding:4px 2px}.menu button img{height:26px;width:26px}.home-heading h1{font-size:26px;margin:6px 0}.home-note,.home-heading .eyebrow{font-size:10px}.hud-line{font-size:11px}#hud{padding:5px 8px}.result{padding-top:12px}.result h1{font-size:22px}}
.board.playing{touch-action:none}
.board{background:linear-gradient(#10192545,#10192545),var(--scene,url('sprites/bg-title.webp')) center/cover no-repeat}
body{background:linear-gradient(#10192588,#10192588),var(--scene,url('sprites/bg-title.webp')) center/cover fixed}.result{top:calc(42px + env(safe-area-inset-top))}
.hub{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;background:linear-gradient(#1e2c38ed,#16212af7);padding:12px 12px max(10px,env(safe-area-inset-bottom));min-height:0;touch-action:pan-y}
.hub-head{display:flex;align-items:center;gap:8px;flex-shrink:0;margin-bottom:10px}.hub-head h2{flex:1;font-size:19px;margin:0}.hub-head button{font-size:12px;padding:6px 9px}.hub-head .coins{font-size:12px}.hub-head .coins img{width:23px;height:23px}
.hub-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;overflow-y:auto;min-height:0;padding:3px 2px 12px;align-content:start;scrollbar-width:thin;touch-action:pan-y}.picture-card{border:1px solid #ae8a59;border-radius:18px;background:radial-gradient(at top,#625448,#302f35);padding:14px 10px;text-align:center;box-shadow:0 4px 0 #101822}.picture-card h3{margin:6px 0;font-size:16px;color:#ffe0a0}.picture-card p{font-size:12px;line-height:1.65;color:#ecd9bb;margin:5px 0}.picture-card small{display:block;font-size:11px;color:#d9c9ae}.shop{grid-template-columns:1fr}.upgrade{display:flex;align-items:center;gap:16px;text-align:left;padding:15px}.card-art{width:86px;height:105px;object-fit:contain}.card-copy{flex:1}.card-copy h3{margin-top:0}.pips{color:#ffd47b;letter-spacing:5px;font-size:17px}.buy{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:9px;min-width:130px;background:#eab76d;color:#493020;font-weight:800}.buy img{width:23px;height:23px}.buy:disabled{opacity:.48}.portrait{height:140px;width:100%;object-fit:contain}.silhouette{filter:brightness(0);opacity:.6}.guest-rule{display:flex;align-items:center;gap:4px;font-size:11px;line-height:1.5;margin-top:8px;color:#ffe3ad}.guest-rule img{width:30px;height:35px;object-fit:contain}.cut{width:100%;height:110px;object-fit:contain}.filling-card>b{font-size:12px}.dex-totals{display:flex;justify-content:space-around;gap:8px;margin:0 0 12px;border:1px solid #8f754c;padding:8px 4px;border-radius:14px;background:#322e30}.dex-totals>span{display:grid;justify-items:center;gap:4px;font-size:11px}.dex-totals img{width:40px;height:32px;object-fit:contain}
.hub-caption{font-size:12px;text-align:center;color:#dcc6a5;margin:2px 0 12px}.calendar{grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}.day-card{position:relative;min-height:82px;padding:7px 1px 3px;border-radius:11px;border-top:5px solid #cf8c4e;background:#493d35;display:flex;align-items:center;flex-direction:column;gap:3px}.day-card.firstsnow{border-top-color:#a2c9d2}.day-card.xmas{border-top-color:#80b59b}.day-card.heavysnow{border-top-color:#c3cfe8}.day-card:disabled{opacity:.5}.day-card.selected{outline:3px solid #ffdc8b;outline-offset:-1px;background:#765236;box-shadow:0 0 12px #ffda6955}.day-number{font-size:16px;line-height:1}.day-stars{font-size:9px;color:#ffd574;white-space:nowrap}.day-portrait,.day-fish{width:100%;height:28px;object-fit:contain}#hub-footer{flex-shrink:0;padding:8px 2px 0}#calendar-play{width:100%}#hub-note{margin:6px 0 0;font-size:12px;color:#ffe2a0;text-align:center;min-height:0}
.star-rules{font-size:11px!important;line-height:1.5}.ranking{padding:8px;border:1px solid #a98c5d;border-radius:20px;color:#ffdb8e!important}.stars img.earned{animation:star-pop .4s ease-out}@keyframes star-pop{0%{transform:scale(.2) rotate(-20deg)}65%{transform:scale(1.25)}100%{transform:scale(1)}}
#share-preview{margin-top:14px;padding:10px;border:1px solid #9d8058;border-radius:18px;background:#101c29}#share-image{width:100%;height:auto;border-radius:12px}#share-download{display:block;margin-top:10px;padding:12px;border-radius:12px;background:#f0c679;color:#463020;font-weight:800;text-decoration:none}.result{--orak-next-bg:#303b49;--orak-next-ink:#ffedce;--orak-next-sub:#cfbfa6}
@media(max-width:370px){.hub-head h2{font-size:16px}.hub{padding-left:8px;padding-right:8px}.hub-cards{gap:7px}.calendar{gap:5px}.day-card{min-height:74px}.day-stars{font-size:8px}.card-art{width:70px}.portrait{height:120px}}
@media(prefers-reduced-motion:reduce){.hurry #timer{animation:none}}

/* 공통 홈 단추의 44px 터치 영역 아래에서 결과 덮개를 시작한다. */
.result { top: calc(54px + env(safe-area-inset-top, 0px)); }

/* Endless and shared record book. */
header button,#pause{min-height:44px;min-width:44px}
.home-actions{gap:8px}.menu{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.menu button img{width:27px;height:27px}.menu button{min-height:62px;font-size:10px}.home-actions>button{min-height:48px}.locked{opacity:.6}
#book-screen{position:absolute;inset:0;z-index:6;background:#182231}#book-screen .osc-book{height:100%;box-sizing:border-box}#book-screen .osc-back{min-width:44px;min-height:44px}
.strike-hearts{font-size:24px!important;color:#ff9e91;letter-spacing:8px}.endless-result{padding-top:8px}.endless-result .result-inner>p{margin:5px 0}.endless-result h1{font-size:23px;margin:4px 0}.endless-result .result-coins{margin:4px 0}.endless-result .result-coins strong{font-size:24px}.endless-result .result-coins img{width:28px;height:28px}.endless-result dl{display:grid;grid-template-columns:1fr 1fr;gap:0 14px;margin:8px 0;padding:8px}.endless-result dl>div{font-size:11px;line-height:1.8}.endless-result .speech{padding:6px}.endless-result .ranking{padding:5px}.endless-result .osc-breakdown{margin:5px 0;padding:10px}.endless-result .osc-row{font-size:12px;min-height:20px}.endless-result .osc-total{margin-top:4px;padding-top:4px}.endless-result #result-ad:empty{display:none}

#endless{background:#293b4bee;border-color:#d4ab70;color:#ffe1a2;font-size:18px;font-weight:800}

#weather-banner{position:absolute;top:15%;left:7%;right:7%;padding:7px 10px;border:1px solid #b6d7ec;border-radius:12px;background:#243e50ed;color:#fff2cf;text-align:center;font-size:clamp(11px,3.2vw,15px);pointer-events:none;z-index:2}#weather-banner[data-weather="rain"]{border-color:#a8c7d7}

/* 결과 화면의 도전 과제 알림은 상단 줄 단추를 가리지 않게 그 아래에 띄운다. */
body:has(#result:not([hidden])) .osc-toast{top:calc(env(safe-area-inset-top,0px) + 62px)}
/* 짧은 화면에서는 팥순이가 설 자리를 위해 한 줄 인사를 숨긴다. */
@media(max-height:700px){.home-note{display:none}}
/* 결과: 행동 버튼은 화면 아래에 붙여 접힌 선에서 반쯤 잘려 보이지 않게 */
.result-actions{position:sticky;bottom:calc(-1 * max(24px,env(safe-area-inset-bottom)));z-index:2;margin:10px -22px 0;padding:12px 22px max(24px,env(safe-area-inset-bottom));background:linear-gradient(#18223100,#182231 14px)}
.result-actions>button{margin-top:0}
.result-row{display:flex;gap:10px;margin-top:10px}
.result .result-row button{flex:1;margin-top:0;min-height:44px}
.result-row #result-home{background:#3c3540;border-color:#927451;color:#fff0d5}
