/* cozy-city-3d: stage, HUD, palette and overlays. Everything is scoped under .cc-* so the site CSS is untouched. */
.cc-title-block{text-align:center;margin-bottom:.75rem}
.cc-stage{position:relative;width:100%;aspect-ratio:9/15;max-height:82vh;max-height:82dvh;min-height:420px;background:#a8dcec;border-radius:14px;overflow:hidden;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;color:#102a33;font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif}
.cc-stage canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;border-radius:0;outline:none}
.cc-stage [hidden]{display:none!important}
.cc-stage.cc-full,.cc-stage:fullscreen{position:fixed;inset:0;z-index:99999;width:100vw;height:100vh;height:100dvh;max-height:none;min-height:0;aspect-ratio:auto;border-radius:0}
.cc-stage:-webkit-full-screen{width:100vw;height:100vh;max-height:none;aspect-ratio:auto;border-radius:0}
body.cc-noscroll{overflow:hidden}
.cc-bigbar{display:flex;gap:.5rem;justify-content:center;margin:.6rem 0 0}
.cc-bigbar .btn{min-height:44px}

/* HUD */
.cc-hud,.cc-side,.cc-palette,.cc-tip,.cc-hint,.cc-inspect,.cc-toasts{display:none}
.cc-playing .cc-hud,.cc-playing .cc-side,.cc-playing .cc-palette,.cc-playing .cc-toasts{display:flex}
.cc-playing .cc-hud{display:block}
.cc-playing .cc-tip,.cc-playing .cc-hint,.cc-playing .cc-inspect{display:block}
.cc-playing .cc-hint{display:flex}
.cc-hud{position:absolute;left:0;right:0;top:0;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) 0 max(6px,env(safe-area-inset-left));pointer-events:none;z-index:5}
.cc-row{display:flex;gap:5px;align-items:stretch;margin-bottom:5px}
.cc-row>*{pointer-events:auto}
.cc-chip{background:rgba(255,255,255,.9);border-radius:12px;padding:3px 8px;min-height:44px;display:flex;flex-direction:column;justify-content:center;flex:1 1 0;min-width:0;line-height:1.15;box-shadow:0 1px 3px rgba(0,0,0,.15)}
.cc-chip b{font-size:15px;white-space:nowrap}
.cc-chip small{font-size:10.5px;color:#4a6670;text-transform:uppercase;letter-spacing:.04em}
.cc-cash{flex:1.5 1 0}
.cc-cash small{font-size:11px;text-transform:none}
.cc-cash small.neg{color:#c0392b}
.cc-day{flex:1.4 1 0}
.cc-chip.bad{background:#ffe1dc}.cc-chip.bad b{color:#b3261e}
.cc-chip.good b{color:#1e7a46}
.cc-bar{display:block;height:5px;border-radius:3px;background:rgba(16,42,51,.15);overflow:hidden;margin-top:3px}
.cc-bar u{display:block;height:100%;background:#2f9e8f;width:0;text-decoration:none}
.cc-btn{font:inherit;border:0;border-radius:12px;background:#fff;color:#102a33;font-weight:700;cursor:pointer;min-height:44px;padding:0 12px;box-shadow:0 1px 3px rgba(0,0,0,.2);touch-action:manipulation}
.cc-btn:active{transform:scale(.97)}
.cc-btn:disabled{opacity:.4}
.cc-btn:focus-visible,.cc-tool:focus-visible{outline:3px solid #ffb703;outline-offset:2px}
.cc-sq{min-width:46px;padding:0}
.cc-round{border-radius:50%;width:46px;height:46px;font-size:20px;line-height:1}
.cc-goalbtn{flex:1.1 1 0;font-size:13px}
.cc-small{min-height:44px;font-size:13px;padding:0 14px}
.cc-goals{pointer-events:auto;background:rgba(255,255,255,.95);border-radius:12px;padding:8px 10px;box-shadow:0 2px 6px rgba(0,0,0,.2);font-size:12.5px}
.cc-gt{font-weight:800;margin-bottom:4px}
.cc-goal{display:grid;grid-template-columns:1fr 70px auto;gap:8px;align-items:center;padding:2px 0}
.cc-goal.met{color:#1e7a46}
.cc-goal .cc-bar{margin:0}
.cc-hint{position:absolute;left:8px;right:8px;top:max(134px,calc(env(safe-area-inset-top) + 128px));z-index:4;background:#fff8dd;border:2px solid #ffb703;border-radius:12px;padding:6px 6px 6px 10px;font-size:13.5px;font-weight:600;align-items:center;gap:8px;justify-content:space-between}
.cc-toasts{position:absolute;left:10px;right:10px;top:150px;flex-direction:column;gap:6px;align-items:center;pointer-events:none;z-index:6}
.cc-toast{background:rgba(16,42,51,.92);color:#fff;border-radius:12px;padding:8px 12px;font-size:13.5px;font-weight:600;max-width:92%;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,.3);animation:ccin .22s ease-out;transition:opacity .4s,transform .4s}
.cc-toast.good{background:#1e7a46}.cc-toast.bad{background:#a8321f}.cc-toast.warn{background:#8a5a00}
.cc-toast.out{opacity:0;transform:translateY(-6px)}
@keyframes ccin{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.cc-side{position:absolute;right:max(8px,env(safe-area-inset-right));bottom:calc(86px + env(safe-area-inset-bottom));flex-direction:column;gap:8px;z-index:5}
.cc-tip,.cc-inspect{position:absolute;left:8px;right:64px;bottom:calc(86px + env(safe-area-inset-bottom));background:rgba(16,42,51,.9);color:#fff;border-radius:12px;padding:8px 11px;font-size:13px;line-height:1.3;z-index:4;pointer-events:none}
.cc-palette{position:absolute;left:0;right:0;bottom:0;gap:6px;padding:8px max(8px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));overflow-x:auto;overflow-y:hidden;background:linear-gradient(to top,rgba(16,42,51,.75),rgba(16,42,51,0));touch-action:pan-x;-webkit-overflow-scrolling:touch;scrollbar-width:none;z-index:5}
.cc-palette::-webkit-scrollbar{display:none}
.cc-tool{flex:0 0 auto;min-width:66px;height:68px;border:0;border-radius:14px;background:rgba(255,255,255,.93);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font:inherit;color:#102a33;cursor:pointer;padding:4px 6px;box-shadow:0 1px 4px rgba(0,0,0,.25);touch-action:manipulation}
.cc-tool .cc-sw{width:22px;height:22px;border-radius:7px;border:2px solid rgba(16,42,51,.25)}
.cc-tool .cc-tl{font-size:11.5px;font-weight:700;white-space:nowrap}
.cc-tool .cc-tc{font-size:10.5px;color:#4a6670;min-height:12px}
.cc-tool.sel{outline:3px solid #2f9e8f;transform:translateY(-4px);background:#fff}
.cc-tool.locked{opacity:.55}
.cc-tool.poor .cc-tc{color:#b3261e;font-weight:700}

/* overlays */
.cc-screen{position:absolute;inset:0;z-index:20;background:rgba(14,32,42,.9);color:#fff;overflow-y:auto;overflow-x:hidden;padding:max(14px,env(safe-area-inset-top)) 14px 18px;-webkit-overflow-scrolling:touch}
.cc-title{text-align:center;margin:10px 0 14px}
.cc-title h2{font-size:26px;margin:0 0 4px;letter-spacing:.01em}
.cc-title p{margin:4px 0;font-size:14px;color:#cfe3ea}
.cc-sh{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.cc-sh h2{font-size:20px;margin:0}
.cc-list{display:flex;flex-direction:column;gap:9px}
.cc-scroll{padding-bottom:10px}
.cc-big{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:52px;font-size:16px;flex-wrap:wrap;text-align:center}
.cc-big small{font-weight:500;font-size:12px;opacity:.75}
.cc-primary{background:#2f9e8f;color:#fff}
.cc-danger{background:#c0392b;color:#fff}
.cc-two{display:flex;gap:9px}.cc-half{flex:1}
.cc-card{background:rgba(255,255,255,.96);color:#102a33;border-radius:14px;padding:11px 12px;display:flex;flex-direction:column;gap:6px}
.cc-card.locked{opacity:.6}
.cc-card p{margin:0;font-size:13.5px;line-height:1.4}
.cc-ct{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:15px}
.cc-sm{font-size:12.5px!important;color:#4a6670}
.cc-sm.good,.cc-card .good{color:#1e7a46}
.cc-lock{color:#8a5a00}
.cc-stars{color:#f2b01e;letter-spacing:2px;font-size:17px}.cc-stars s{color:#c8d3d8;text-decoration:none}
.cc-bigstars .cc-stars{font-size:38px}
.cc-note{font-size:13.5px;color:#cfe3ea;margin-bottom:8px;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.cc-seg{display:inline-flex;border-radius:12px;overflow:hidden;background:rgba(255,255,255,.18)}
.cc-seg button{font:inherit;border:0;background:transparent;color:#fff;min-height:44px;min-width:64px;padding:0 10px;font-weight:700;cursor:pointer;touch-action:manipulation}
.cc-seg button.on{background:#2f9e8f}
.cc-row3{display:flex;justify-content:space-between;align-items:center;gap:10px;font-weight:700}
.cc-maps{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:6px 0}
.cc-map{font:inherit;min-height:48px;border-radius:12px;border:2px solid #cfdde2;background:#fff;color:#102a33;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px;touch-action:manipulation}
.cc-map small{font-size:10.5px;font-weight:500;color:#8a5a00}
.cc-map.on{border-color:#2f9e8f;background:#e4f5f2}.cc-map:disabled{opacity:.5}
.cc-check{display:flex;gap:10px;align-items:center;min-height:44px;font-size:14px}
.cc-check input{width:24px;height:24px}
.cc-pips{display:inline-flex;gap:4px}.cc-pips i{width:14px;height:14px;border-radius:50%;background:#c8d3d8}.cc-pips i.on{background:#2f9e8f}
.cc-ul{margin:4px 0 0 18px;font-size:13px}
.cc-ach.done{background:#e6f6ec}

/* how-to copy under the game */
.cc-guide{max-width:420px;margin:1.2rem auto;padding:0 1rem;line-height:1.55;color:#1e293b}
.cc-guide h2{font-size:1.25rem;margin-bottom:.5rem}
.cc-guide h3{font-size:1rem;margin:1rem 0 .3rem}
.cc-guide p,.cc-guide li{font-size:.95rem;margin-bottom:.5rem}
.cc-guide ul{padding-left:1.2rem}
@media (min-width:700px){.cc-stage{aspect-ratio:9/14}}
@media (max-height:520px) and (orientation:landscape){.cc-stage:not(.cc-full){aspect-ratio:16/10;max-height:none;min-height:300px}}
@media (prefers-reduced-motion:reduce){.cc-toast{animation:none}}

/* next-goal strip under the stat row */
.cc-next{pointer-events:none;display:grid;grid-template-columns:1fr 64px auto;gap:8px;align-items:center;background:rgba(255,255,255,.88);border-radius:10px;padding:3px 10px;margin-bottom:5px;font-size:12px;font-weight:700;color:#264653;min-height:24px}
.cc-next[hidden]{display:none}
.cc-next span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cc-next .cc-bar{margin:0}
.cc-next.met{color:#1e7a46}
@media (prefers-reduced-motion:reduce){.cc-next u{transition:none}}
/* shell full screen: the stage fills the area below the dock; the canvas follows PIPShell resize */
html.pip-immersive .game-wrap.pip-stage,.game-wrap.pip-stage:fullscreen{display:flex;flex-direction:column;overflow:hidden;padding:0}
html.pip-immersive .game-wrap .cc-stage,.game-wrap:fullscreen .cc-stage{flex:1 1 auto;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:auto;border-radius:0}
html.pip-immersive .cc-bigbar,html.pip-immersive .game-wrap>.game-title,.game-wrap:fullscreen .cc-bigbar{display:none}
html.pip-immersive .cc-palette button,html.pip-immersive .cc-palette .cc-tool{min-height:44px}
/* full screen landscape: the title menu fits without scrolling (two columns, tight title) */
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .cc-screen,html.pip-native .cc-screen{padding:max(8px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 10px max(14px,env(safe-area-inset-left))}
html.pip-immersive .cc-title,html.pip-native .cc-title{margin:2px 0 8px}
html.pip-immersive .cc-title h2,html.pip-native .cc-title h2{font-size:22px;margin:0}
html.pip-immersive .cc-title p,html.pip-native .cc-title p{margin:2px 0;font-size:13px}
html.pip-immersive .cc-title+.cc-list,html.pip-native .cc-title+.cc-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}
html.pip-immersive .cc-title+.cc-list .cc-big,html.pip-native .cc-title+.cc-list .cc-big{min-height:48px}
html.pip-immersive .cc-title+.cc-list .cc-two,html.pip-native .cc-title+.cc-list .cc-two{grid-column:1/-1}
}
