/* Chinese typeface; Latin letters and numerals retain the original UI font. */
@font-face{font-family:"Loopa Chinese";src:url("../assets/fonts/YouSheShaYuFeiTeJianKangTi.ttf") format("truetype");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+2000-206F,U+2E80-9FFF,U+F900-FAFF,U+FE10-FE1F,U+FE30-FE4F,U+FF00-FFEF,U+20000-323AF}
:root{--ink:#2c5650;--ink-strong:#234940;--muted:#65796e;--paper:#fffaf0;--surface:#fffdf5;--line:#2c565017;--coral:#d48c75;--shadow:0 8px 32px #274d4814,0 2px 5px #274d4808;--font:"Loopa Chinese",ui-rounded,"SF Pro Rounded",-apple-system,"PingFang SC","Microsoft YaHei",system-ui,sans-serif}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#aecbcb;color:var(--ink);font:400 14px/1.5 var(--font);-webkit-font-smoothing:antialiased}button,input,summary{-webkit-tap-highlight-color:transparent}button,summary{touch-action:manipulation}button{font:inherit}button,summary,input{outline-offset:4px}button:focus-visible,summary:focus-visible,input:focus-visible{outline:2px solid var(--ink);box-shadow:0 0 0 5px #fffdf5c9}button:disabled{opacity:.5;cursor:not-allowed}.icon-library{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}.ui-icon{display:block;width:24px;height:24px;flex:none;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}#app,#app canvas{position:fixed;inset:0;display:block;touch-action:none}#hud{position:fixed;inset:0;pointer-events:none;transition:opacity .25s;z-index:2}
.topbar{position:absolute;top:max(25px,env(safe-area-inset-top));left:30px;right:30px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;pointer-events:none}.brand img{display:block;width:120px;height:auto}.top-actions{display:flex;gap:10px;pointer-events:auto}.btn{appearance:none;border:0;background:none;color:var(--ink);display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 14px;border-radius:14px;font-weight:500;font-size:13px;white-space:nowrap;cursor:pointer;transition:background .18s,color .18s,transform .18s,box-shadow .18s}.btn:hover{background:#edf1e6}.btn:active{transform:translateY(1px);background:#e3e9dc}.btn.on,.btn[aria-pressed=true]:not(.sound-toggle){background:var(--ink);color:var(--paper)}.btn.dim{opacity:.45}.icon-button{width:46px;height:46px;padding:0;border-radius:50%;background:#fffaf0e8;border:1px solid #fffdf5a6;box-shadow:0 3px 14px #274d480c}.icon-button .ui-icon{width:21px;height:21px}.icon-button [data-label]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.icon-button:hover{background:var(--surface);transform:translateY(-2px)}.sound-toggle{position:relative}.sound-off{display:none}.sound-toggle.off .sound-on{display:none}.sound-toggle.off .sound-off{display:block}.sound-toggle.off{color:#9a6758}.sound-dot{position:absolute;right:7px;bottom:7px;width:6px;height:6px;border:1.5px solid var(--paper);border-radius:50%;background:#7eaa7c}.off .sound-dot{background:var(--coral)}
#bar{position:absolute;bottom:max(26px,env(safe-area-inset-bottom));left:0;right:0;width:max-content;max-width:calc(100% - 32px);margin:auto;display:flex;align-items:center;gap:12px;pointer-events:auto}#paints{display:flex;align-items:center;gap:3px;padding:13px 12px;border-radius:24px;background:#fffaf0ed;border:1px solid #fffdf5c7;box-shadow:var(--shadow);backdrop-filter:blur(18px)}.paint{appearance:none;display:grid;place-items:center;position:relative;width:38px;height:38px;flex:none;padding:0;border:0;border-radius:50%;color:var(--ink);background:transparent;cursor:pointer;transition:transform .18s,background .18s}.paint-dot{width:25px;height:25px;border-radius:50%;background:var(--swatch);box-shadow:inset 0 0 0 1px #2349401f,inset 0 2px 2px #ffffff42;transition:transform .18s}.paint:hover{background:#2c565009;transform:translateY(-2px)}.paint:hover .paint-dot{transform:scale(1.06)}.paint.on:not(.auto){box-shadow:inset 0 0 0 1.5px var(--ink);background:#fffdf5}.paint.on:not(.auto)::after{content:"";position:absolute;width:7px;height:4px;left:15px;top:16px;border-left:1.8px solid var(--ink-strong);border-bottom:1.8px solid var(--ink-strong);transform:rotate(-45deg)}.paint.auto{width:38px}.paint.auto .ui-icon{width:20px;height:20px}.paint.auto.on{background:var(--ink);color:var(--paper);box-shadow:0 2px 5px #2c565025}.paint-separator{height:21px;width:1px;background:var(--line);margin:0 4px}
.tool-tray{display:flex;align-items:center;gap:3px;padding:7px;border-radius:24px;background:#fffaf0f5;border:1px solid #fffdf5c7;box-shadow:var(--shadow)}.tool{display:flex;flex-direction:column;gap:4px;width:64px;height:57px;min-height:57px;padding:6px 3px;border-radius:17px;font-size:11px;letter-spacing:.02em;line-height:1.4}.tool .ui-icon{width:23px;height:23px}.tool:hover{background:#e9eee1;transform:translateY(-2px)}.tool:active{transform:translateY(1px)}.tool.on{box-shadow:0 3px 9px #2c56501c}.tool-separator{height:30px;width:1px;background:var(--line);margin:0 3px}details[data-popover]{position:relative}summary{list-style:none;cursor:pointer}summary::-webkit-details-marker{display:none}details[data-popover][open]>summary{background:#e6ecdf}details[data-popover][open]>summary .ui-icon{color:var(--ink-strong)}
.popover{position:absolute;bottom:88px;right:0;background:var(--surface);border:1px solid #ffffffb3;border-radius:26px;box-shadow:0 20px 65px #244c4721,0 4px 12px #244c470a;padding:23px;width:350px;max-height:min(650px,calc(100dvh - 155px));overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c7d1c2 transparent;animation:panel-in .2s ease-out;transform-origin:bottom right;cursor:default}.popover::after{content:"";position:absolute;bottom:0;left:25px;right:25px;height:1px;background:#ffffff80}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px}.eyebrow{display:block;font-size:9px;letter-spacing:.16em;font-weight:600;color:#738176;margin-bottom:5px}h2,h3,p{margin:0}h2{font-size:21px;font-weight:600;letter-spacing:-.04em;line-height:1.35}.close-button{padding:0;width:34px;height:34px;min-height:34px;border-radius:50%;color:#718174;background:#f0f2e9}.close-button .ui-icon{width:17px;height:17px}.panel-intro{font-size:12px;color:var(--muted);line-height:1.6;margin-bottom:18px}.setting-section{padding:17px 0;border-top:1px solid var(--line)}h3{font-size:12px;font-weight:600;letter-spacing:.015em;margin-bottom:11px}.section-heading{display:flex;justify-content:space-between;align-items:center}.section-heading output{font-size:11px;font-variant-numeric:tabular-nums;color:var(--muted);margin-bottom:11px}#eras{display:flex;align-items:center;gap:6px;background:#f0f2e9;border-radius:15px;padding:3px}#eras .nav{width:36px;min-width:36px;padding:0;border-radius:12px;height:38px;min-height:38px;background:#fffdf5}#eras .nav .ui-icon{width:16px;height:16px}#eras .nav [data-label]{display:none}#eraName{flex:1;white-space:normal;font-size:11px;line-height:1.4;text-align:center;padding:0 6px;font-weight:500}#styles{display:flex;gap:4px;padding:4px;border-radius:17px;background:#f0f2e9}#styles .btn{flex:1;padding:10px 5px;min-height:62px;flex-direction:column;gap:5px;border-radius:13px;font-size:12px;color:var(--muted)}#styles .ui-icon{width:21px;height:21px}#styles .btn.on{background:var(--surface);color:var(--ink-strong);box-shadow:0 2px 5px #2c56500b}.sound-controls{display:flex;align-items:center;gap:15px}.sound-controls input{appearance:none;-webkit-appearance:none;display:block;width:100%;min-width:45px;height:5px;margin:12px 0;border-radius:4px;background:linear-gradient(to right,var(--ink) 0 var(--volume,72%),#dce3d7 var(--volume,72%) 100%);cursor:pointer}.sound-controls input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:18px;height:18px;border:3px solid var(--surface);border-radius:50%;background:var(--ink);box-shadow:0 1px 5px #2c565030}.sound-controls input::-moz-range-thumb{width:14px;height:14px;border:3px solid var(--surface);border-radius:50%;background:var(--ink)}.sound-controls .listen{flex:none;min-height:36px;padding:8px 11px;font-size:11px;border-radius:11px;background:#e8eee1;gap:5px}.listen .ui-icon{width:13px;height:13px}.settings-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px}.settings-actions .btn{justify-content:flex-start;min-height:42px;padding:10px 8px;font-size:12px;border-radius:11px}.settings-actions .ui-icon{width:18px;height:18px}.advanced{border-top:1px solid var(--line);font-size:12px}.advanced>summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;color:var(--muted);font-weight:500}.advanced>summary .ui-icon{height:15px;width:15px;transition:transform .18s}.advanced[open]>summary .ui-icon{transform:rotate(180deg)}.advanced-content{padding:2px 0 16px}#mods{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}#mods .btn{font-size:11px;min-height:34px;padding:6px 10px;background:#f0f2e9;border-radius:9px}#mods .btn.on{background:var(--ink);color:var(--paper)}#btn-palette{font-size:12px;padding:8px 0;min-height:38px}#btn-palette .ui-icon{width:16px;height:16px}.experimental{display:flex;gap:8px;margin-top:9px}.experimental .btn{font-size:11px;padding:7px 12px;min-height:34px;background:#f0f2e9;border-radius:10px}.panel-footer{border-top:1px solid var(--line);padding-top:12px;display:flex;align-items:center;justify-content:space-between}.panel-footer img{opacity:.55}.danger{color:#9a5b4e;padding:8px 4px;font-size:11px;min-height:36px}.danger .ui-icon{width:15px;height:15px}.danger:hover{background:#f5e5dd;color:#874b3e}
.scene-panel{width:365px}.scene-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.scene-card{appearance:none;border:1px solid #2c565011;border-radius:17px;padding:10px 12px 13px;text-align:left;background:#f1f2e7;color:var(--ink);cursor:pointer;transition:transform .18s,box-shadow .18s,border-color .18s}.scene-card:nth-child(2){background:#f5e9dc}.scene-card:nth-child(3){background:#eeeaf1}.scene-card:nth-child(4){background:#e7efea}.scene-card:hover{transform:translateY(-3px);border-color:#2c56503d;box-shadow:0 6px 12px #2c56500c}.scene-card:active{transform:translateY(0)}.scene-art{display:block;width:100%;height:78px;color:#52665a;margin-bottom:4px}.scene-name{display:block;font-size:13px;font-weight:600;margin-bottom:3px}.scene-sub{display:block;font-size:10px;color:var(--muted);line-height:1.5}.scene-note{font-size:10px;color:var(--muted);text-align:center;margin-top:17px}
#loading{position:fixed;inset:0;z-index:10;background:#b3ceca;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;color:#45675c;transition:opacity .4s,visibility 0s .4s}#loading>span{font-size:11px;letter-spacing:.12em}#loading.gone{opacity:0;visibility:hidden;pointer-events:none}body.clean #hud{opacity:0;pointer-events:none}body.clean #hud *{pointer-events:none}#cleanHint{position:fixed;right:20px;bottom:16px;font-size:11px;color:#294b5899;pointer-events:none;opacity:0}body.clean #cleanHint{opacity:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes panel-in{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
@media(max-width:720px){.topbar{left:20px;right:20px;top:max(18px,env(safe-area-inset-top))}.brand img{width:112px;height:auto}.top-actions{gap:7px}.icon-button{width:42px;height:42px}#bar{gap:8px}#paints{padding:11px 9px}.paint,.paint.auto{width:34px;height:36px}.paint-dot{width:23px;height:23px}.paint.on:not(.auto)::after{left:13px;top:15px}.paint-separator{margin:0 2px}.tool{width:56px;font-size:10px}.tool-tray{padding:6px;gap:2px}}
@media(max-width:620px){.topbar{left:19px;right:19px;top:max(19px,env(safe-area-inset-top))}.brand img{width:105px}.icon-button{width:41px;height:41px}.icon-button .ui-icon{width:19px;height:19px}#bar{flex-direction:column;gap:8px;bottom:max(16px,env(safe-area-inset-bottom));max-width:calc(100% - 24px)}#paints{padding:7px 8px;border-radius:20px;gap:2px}.paint,.paint.auto{width:clamp(30px,8.7vw,38px);height:36px}.paint-dot{width:23px;height:23px}.paint.on:not(.auto)::after{left:calc(50% - 3.5px);top:15px}.tool-tray{width:100%;justify-content:space-around;border-radius:21px;padding:5px 8px;gap:2px}.tool{width:64px;height:57px;font-size:11px;border-radius:15px}.tool-separator{margin:0 1px}.popover,.scene-panel{position:fixed;left:14px;right:14px;bottom:165px;width:auto;max-height:calc(100dvh - 252px);border-radius:24px;padding:21px;transform-origin:bottom center}.scene-art{height:69px}.scene-panel{max-width:400px;margin:auto}.panel-heading{margin-bottom:12px}h2{font-size:20px}.setting-section{padding:15px 0}.eyebrow{font-size:8px}.scene-card{padding:9px 12px 11px}}
@media(max-height:520px){.topbar{top:12px;left:18px;right:18px}.brand img{width:100px}.icon-button{width:36px;height:36px}#bar{bottom:12px;flex-direction:row;gap:8px}#paints{padding:8px}.paint,.paint.auto{width:31px;height:34px}.paint-dot{width:22px;height:22px}.paint.on:not(.auto)::after{left:12px;top:14px}.tool-tray{padding:4px;gap:0;width:auto}.tool{width:51px;height:50px;min-height:50px;font-size:9px;gap:3px}.tool .ui-icon{width:20px;height:20px}.tool-separator{margin:0 2px}.popover,.scene-panel{position:fixed;left:auto;right:18px;bottom:85px;width:340px;max-width:calc(100vw - 36px);max-height:calc(100dvh - 112px);padding:18px}.scene-grid{gap:8px}.scene-art{height:48px}.scene-note{margin-top:10px}}
.advanced-subheading{margin-top:17px}.advanced-content>.settings-actions{margin-bottom:17px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}

/* Snapshot preview is a modal so opening/closing it cannot build a house. */
[hidden]{display:none!important}
.screenshot-button{background:var(--ink);color:var(--paper);border-color:#fffaf038}.screenshot-button:hover{background:#37635a;color:var(--paper)}.screenshot-button[aria-busy=true] .ui-icon{animation:shot-pulse .8s ease-in-out infinite alternate}
.share-dialog{width:min(760px,calc(100vw - 36px));max-height:calc(100dvh - 36px);padding:24px;border:1px solid #fffdf5bf;border-radius:28px;background:var(--surface);color:var(--ink);box-shadow:0 24px 90px #183c3545;overflow:hidden}
.share-dialog:not([open]){display:none}.share-dialog[open]{display:flex;flex-direction:column;gap:14px}.share-dialog::backdrop{background:#183c355c;backdrop-filter:blur(6px)}.shot-heading{flex:none;margin:0}.shot-heading h2{font-size:23px}.shot-body{min-height:0;overflow:auto;scrollbar-gutter:stable;overscroll-behavior:contain;display:flex;flex-direction:column;gap:13px;padding:2px 12px 2px 2px}.shot-intro{font-size:12px;color:var(--muted)}.shot-image-frame{display:grid;place-items:center;min-height:120px;flex:none;overflow:hidden;border-radius:18px;background:#d9e5df}.shot-image-frame img{display:block;width:100%;max-height:min(44dvh,420px);object-fit:contain}.shot-image-frame p{display:grid;place-items:center;min-height:160px;padding:26px;text-align:center;font-size:13px;color:var(--muted)}.shot-options{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:32px;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.shot-brand-check{display:inline-flex;align-items:center;gap:7px;min-height:36px;color:var(--ink);font-size:12px;cursor:pointer}.shot-brand-check input{accent-color:var(--ink);width:16px;height:16px;margin:0}.shot-actions{display:flex;gap:9px}.shot-actions .btn{flex:1;min-width:0;min-height:46px;text-decoration:none;font-size:13px}.shot-actions .ui-icon{width:18px;height:18px}.shot-primary{background:var(--ink);color:var(--paper)}.shot-primary:hover{background:#37635a;color:var(--paper)}.shot-secondary{background:#e8eee1;color:var(--ink)}.shot-game-link{padding-top:12px;border-top:1px solid var(--line)}.shot-game-link>label{display:block;margin-bottom:8px;font-size:11px;color:var(--muted)}.shot-link-row{display:flex;gap:7px;align-items:center}.shot-link-row input{min-width:0;flex:1;border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:#f1f3eb;color:var(--muted);font:11px/1.4 var(--font);text-overflow:ellipsis}.shot-link-row .btn{flex:none;padding:8px 10px;font-size:11px;gap:5px;min-height:40px;background:#edf1e6}.shot-link-row .ui-icon{width:15px;height:15px}.shot-status{min-height:18px;font-size:11px;color:var(--muted);text-align:center}
@keyframes shot-pulse{from{opacity:.45}to{opacity:1}}
@media(max-width:620px){.share-dialog{width:calc(100vw - 26px);max-height:calc(100dvh - 26px);padding:19px;border-radius:25px}.shot-heading h2{font-size:20px}.shot-image-frame img{max-height:38dvh}.shot-options{font-size:10px;gap:6px}.shot-brand-check{font-size:11px}.shot-actions .btn{font-size:12px;padding:9px 8px}.shot-body{gap:11px}.shot-link-row input{padding:10px 8px;font-size:10px}.shot-link-row .btn{padding:8px;font-size:10px}.top-actions{gap:7px}}
@media(max-height:520px){.share-dialog{max-height:calc(100dvh - 20px);padding:16px 19px}.shot-heading h2{font-size:18px}.shot-image-frame img{max-height:40dvh}.shot-heading .eyebrow{display:none}}
@media(prefers-reduced-motion:reduce){.screenshot-button[aria-busy=true] .ui-icon{animation:none}}

/* The preview sits on a desk; the exported bitmap contains only the paper. */
.shot-image-frame{padding:27px 24px 29px;overflow:hidden;border-radius:19px;background:radial-gradient(ellipse at 38% 18%,#dce6da,#c5d4c9)}
.shot-image-frame img{width:auto;max-width:calc(100% - 12px);max-height:min(38dvh,360px);object-fit:contain;transform:rotate(-2deg);box-shadow:0 16px 24px -12px #344b456b,0 2px 5px #344b4533;animation:photo-develop .48s ease-out}
.shot-image-frame p{min-height:180px}
@keyframes photo-develop{from{opacity:.25;transform:translateY(12px) rotate(-3deg)}to{opacity:1;transform:translateY(0) rotate(-2deg)}}
@media(max-width:620px){.shot-image-frame{padding:20px 17px 23px}.shot-image-frame img{max-height:37dvh;max-width:calc(100% - 10px)}}
@media(max-height:520px){.shot-image-frame{padding:14px}.shot-image-frame img{max-height:39dvh}}
@media(prefers-reduced-motion:reduce){.shot-image-frame img{animation:none}}

.scene-panel{width:430px}.neighborhood-card.canals{background:#eaf0e7}.neighborhood-card.hillside{background:#f1e7d7}.neighborhood-card.courtyard{background:#eee8db}.neighborhood-card.islands{background:#e4eef0}
.neighborhood-card .scene-art{height:83px}.scene-more{border-top:1px solid var(--line);margin-top:16px;padding-top:3px}.scene-more>summary{display:flex;justify-content:space-between;align-items:center;min-height:43px;font-size:12px;color:var(--muted)}.scene-more>summary span{font-family:system-ui;transition:transform .18s}.scene-more[open]>summary span{transform:rotate(180deg)}.scene-more .scene-art{height:60px}
@media(max-width:620px){.scene-panel{width:auto;max-width:400px}.neighborhood-card .scene-art{height:70px}.scene-more .scene-art{height:54px}}
@media(max-height:520px){.scene-panel{width:380px}.neighborhood-card .scene-art{height:55px}}

.secret-section{border-top:1px solid var(--line);margin-top:17px;padding-top:16px}.secret-section h3{font-size:12px;color:var(--muted);margin-bottom:10px}.secret-scenes{display:grid;gap:7px}.secret-card{display:flex;align-items:center;gap:12px;padding:12px 13px;background:#f0eee3!important;min-height:69px}.secret-card>.ui-icon{width:27px;height:27px;flex:none;color:#7e9481}.secret-card>span:nth-child(2){flex:1;min-width:0}.secret-card .scene-name{font-size:12px}.secret-card .scene-sub{font-size:10px}.secret-arrow{font-family:system-ui;font-size:18px;color:#7d8b7a}.secret-card:hover{transform:translateX(2px)}

.shot-image-help{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:11px;min-height:30px}.shot-image-help .btn{min-height:32px;font-size:11px;padding:4px 9px;background:#edf1e6}.shot-preview-note{font-size:11px;color:var(--muted)}.shot-image-frame img,.photo-viewer img{-webkit-touch-callout:default;user-select:auto;-webkit-user-select:auto}
.photo-viewer{width:min(860px,calc(100vw - 24px));max-height:calc(100dvh - 24px);border:0;border-radius:25px;background:#d8e2d7;color:var(--ink);padding:20px;overflow:auto;box-shadow:0 24px 80px #183c3540}.photo-viewer:not([open]){display:none}.photo-viewer[open]{display:flex;flex-direction:column;align-items:center;gap:16px}.photo-viewer::backdrop{background:#163a36b3;backdrop-filter:blur(8px)}.photo-viewer-toolbar{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;font-size:12px}.photo-viewer img{display:block;width:auto;max-width:100%;max-height:calc(100dvh - 160px);object-fit:contain;box-shadow:0 12px 28px #294a412b;touch-action:auto}.photo-viewer-note{font-size:11px;color:var(--muted)}
@media(max-width:620px){.photo-viewer{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:15px;border-radius:22px}.photo-viewer-toolbar{font-size:11px}.photo-viewer img{max-height:calc(100dvh - 138px)}.shot-image-help{font-size:10px}}
