:root { color-scheme: light; --paper:#f2f5f1; --ink:#3d4c44; --ring:#465c4d; --surface:rgba(247,250,246,.95); --track:#cbd5ce; --accent:#6f8c75; --edge:8px; }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none; }
body { background:var(--paper);color:var(--ink);font-family:system-ui,sans-serif;transition:background .65s,color .65s; }
button,input { font:inherit; }
button { color:inherit; }
button,svg,img { -webkit-user-select:none;user-select:none; }
button { touch-action:manipulation; }
svg { width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;pointer-events:none; }
.svg-definitions { position:absolute;width:0;height:0;overflow:hidden; }
.app { height:100%;height:100dvh;display:flex;flex-direction:column;gap:5px;padding:max(var(--edge),env(safe-area-inset-top)) max(var(--edge),env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(var(--edge),env(safe-area-inset-left)); }
.scene { position:relative;flex:1;min-height:0;border-radius:18px;isolation:isolate;overflow:hidden;outline:none;touch-action:auto;cursor:none;background:#c8af8c; }
.scene:focus-visible { outline:2px solid var(--ring);outline-offset:-3px; }
.world { position:absolute;inset:0;overflow:hidden;transition:filter .8s;z-index:0;touch-action:none;-webkit-touch-callout:none;user-select:none; }
.room { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center center;pointer-events:none;transition:opacity .38s; }
.room-next { opacity:0; }
.ground-shadow { position:absolute;background:#221a13;border-radius:50%;filter:blur(15px);opacity:0;pointer-events:none;transition:opacity .38s;z-index:2; }
.scene[data-background="wood"] .ground-shadow { opacity:.10; }
.scene[data-background="glass"] .ground-shadow { opacity:.075;filter:blur(20px); }
#dog-canvas { position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3; }
#hand-canvas { position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4; }
#fur-canvas { position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4; }
.scene[data-background="sage"] .ground-shadow,.scene[data-background="tatami"] .ground-shadow,.scene[data-background="indigo"] .ground-shadow { opacity:.12;filter:blur(19px); }
.dog-fallback { position:absolute;object-fit:contain;pointer-events:none;z-index:3; }
.hand { position:absolute;top:0;left:0;pointer-events:none;will-change:transform;opacity:0;transition:opacity .5s;transform-origin:42.5% 32.6%;max-width:none;mask-image:linear-gradient(to bottom,#000 70%,transparent 91%); }
.hand.ready { opacity:1;z-index:4; }
.moonlight { position:absolute;inset:0;background:#7392c3;mix-blend-mode:multiply;opacity:0;transition:opacity .8s;pointer-events:none;z-index:5; }
.icon-button { display:grid;place-items:center;width:42px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;cursor:pointer;transition:background .2s,color .2s,transform .2s;flex:0 0 auto; }
.icon-button:hover { background:rgba(107,88,62,.09); }
.icon-button:active { transform:scale(.93); }
.icon-button:focus-visible,.dog-choice:focus-visible { outline:2px solid var(--ring);outline-offset:3px; }
.interaction-controls { position:absolute;left:13px;bottom:13px;z-index:3;display:flex;align-items:center;gap:10px;padding:7px;border-radius:17px;background:var(--surface);box-shadow:0 2px 16px #283b2312;cursor:default; }
.pose-picker,.action-picker { display:flex;align-items:center;gap:7px; }
.pose-choice { width:66px;height:44px;padding:0;border:0;border-radius:11px;background-color:#d7dfd2;background-size:contain;background-repeat:no-repeat;background-position:center;cursor:pointer;transition:background-color .2s,box-shadow .2s; }
.pose-choice[aria-checked="true"] { box-shadow:inset 0 0 0 2px var(--ring);background-color:#becdb9; }
.pose-choice[aria-busy="true"] { opacity:.55; }
.pose-choice:focus-visible,.action-choice:focus-visible { outline:2px solid var(--ring);outline-offset:2px; }
.interaction-divider { height:25px;width:1px;background:currentColor;opacity:.13; }
.action-picker { gap:2px; }
.action-choice { border-radius:11px;width:42px;height:44px; }
.action-choice svg { width:25px;height:25px; }
.action-choice[aria-checked="true"] { background:#78917624;box-shadow:inset 0 0 0 1px #6f866a34; }
.pat-target { position:absolute;z-index:2;width:46px;height:46px;border:1.5px dashed #42554099;border-radius:50%;box-shadow:0 0 0 1px #fff7;transform:translate(-50%,-50%);pointer-events:none;transition:opacity .2s; }
.night .pose-choice { background-color:#435043; }
.night .pose-choice[aria-checked="true"] { background-color:#576655; }
.toolbar { min-height:64px;display:flex;align-items:center;gap:20px;padding:0 3px; }
.dog-picker { display:flex;gap:15px;align-items:center;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;flex:1;padding:5px 2px 5px 3px;scroll-behavior:smooth;mask-image:linear-gradient(to right,#000 calc(100% - 12px),transparent); }
.dog-picker::-webkit-scrollbar { display:none; }
.dog-choice { position:relative;flex:0 0 49px;width:49px;height:49px;padding:0;border:0;border-radius:50%;background-color:#d3c9b9;background-size:360% auto;background-position:49% 48%;box-shadow:inset 0 0 0 1px #4c41312b;cursor:pointer;transition:transform .2s,box-shadow .2s;outline-offset:3px; }
.dog-choice:hover { transform:scale(1.055); }
.dog-choice[aria-checked="true"] { outline:2px solid var(--ring);outline-offset:3px; }
.selected-mark { display:none;position:absolute;bottom:-1px;right:-1px;width:15px;height:15px;border:2px solid var(--paper);border-radius:50%;background:var(--ring);color:var(--paper);align-items:center;justify-content:center; }
.selected-mark svg { width:11px;height:11px;stroke-width:2; }
.dog-choice[aria-checked="true"] .selected-mark { display:flex; }
.utilities { display:flex;align-items:center;gap:5px;flex-shrink:0; }
.adjustments { position:absolute;right:8px;bottom:8px;width:260px;max-height:calc(100% - 16px);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;scrollbar-width:none;z-index:4;padding:14px 15px;border-radius:18px;background:var(--surface);box-shadow:0 4px 24px #3b30252b;cursor:default; }
.adjustments[hidden] { display:none; }
.appearance-divider { height:1px;background:currentColor;opacity:.1;margin:10px 0 8px; }
.appearance-row { display:flex;gap:14px;align-items:center;min-height:49px; }
.appearance-row>svg { flex:0 0 21px;opacity:.7; }
.hand-style-picker,.skin-picker,.surface-picker,.scene-picker { display:flex;align-items:center;justify-content:space-between;flex:1;gap:12px;padding:5px 2px; }
.surface-picker { display:grid;grid-template-columns:repeat(3,48px);gap:12px;justify-content:space-between; }
.hand-choice,.skin-choice,.surface-choice,.scene-choice { border:0;padding:0;cursor:pointer;position:relative;box-shadow:inset 0 0 0 1px #4c413126;transition:transform .18s;flex:0 0 auto; }
.scene-picker { gap:8px; }
.scene-choice { width:54px;height:43px;border-radius:9px;background-size:cover;background-position:center; }
.hand-choice { width:48px;height:62px;border-radius:11px;background-color:#eee8df;background-size:142% auto;background-position:26% 0;background-repeat:no-repeat; }
.hand-style-row { margin-bottom:5px; }
.skin-choice { width:34px;height:34px;border-radius:50%; }
.surface-choice { width:48px;height:36px;border-radius:9px;background-size:cover;background-position:center; }
.hand-choice:hover,.skin-choice:hover,.surface-choice:hover,.scene-choice:hover { transform:scale(1.055); }
.hand-choice[aria-checked="true"],.skin-choice[aria-checked="true"],.surface-choice[aria-checked="true"],.scene-choice[aria-checked="true"] { outline:2px solid var(--ring);outline-offset:3px; }
.hand-choice:focus-visible,.skin-choice:focus-visible,.surface-choice:focus-visible,.scene-choice:focus-visible { outline:2px solid var(--ring);outline-offset:3px; }
.landscape-toggle[aria-pressed="true"] { background:var(--surface);box-shadow:inset 0 0 0 1px #6c5a432b; }
.slider-row { display:flex;gap:12px;align-items:center;height:35px; }
.slider-row svg { flex-shrink:0; }
.dog-small { width:17px;height:17px; }
.dog-large { width:25px;height:25px; }
.dog-slim { width:17px;height:24px; }
.dog-wide { width:25px;height:25px;transform:scaleX(1.12); }
input[type="range"] { appearance:none;-webkit-appearance:none;display:block;min-width:0;flex:1;height:24px;cursor:pointer;background:transparent;margin:0;touch-action:pan-x; }
input[type="range"]::-webkit-slider-runnable-track { height:5px;border-radius:8px;background:linear-gradient(to right,var(--accent) var(--fill,50%),var(--track) var(--fill,50%)); }
input[type="range"]::-webkit-slider-thumb { appearance:none;-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:var(--accent);margin-top:-4.5px;border:0; }
input[type="range"]::-moz-range-track { height:5px;border-radius:8px;background:var(--track); }
input[type="range"]::-moz-range-progress { height:5px;background:var(--accent); }
input[type="range"]::-moz-range-thumb { width:14px;height:14px;border-radius:50%;background:var(--accent);border:0; }
input[type="range"]:focus-visible { outline:2px solid var(--ring);outline-offset:3px;border-radius:4px; }
.night { color-scheme:dark;--paper:#111823;--ink:#c2cbd7;--ring:#bfccdf;--surface:rgba(28,39,55,.96);--track:#657183;--accent:#b9c9de; }
.night .world { filter:brightness(.58) saturate(.72); }
.night .moonlight { opacity:.5; }
.night .icon-button:hover { background:rgba(210,223,246,.09); }
.night .hand-choice { background-color:#3d4652; }
.expanded { --edge:0px; }
.expanded .scene { border-radius:0 0 12px 12px; }
.expanded .toolbar { padding-inline:12px; }
.sr-only { position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.usage-settings { margin-left:auto; }
.usage-choice[hidden] { display:none; }
.usage-choice { position:fixed;z-index:20;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:16px;width:min(540px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:14px 16px;border:1px solid #72847738;border-radius:15px;background:var(--surface);color:var(--ink);box-shadow:0 5px 24px #283b2326;font-size:14px;line-height:1.5; }
.usage-choice p { flex:1;margin:0; }
.usage-choice a { color:inherit;text-underline-offset:2px; }
.usage-choice-actions { display:flex;gap:8px;flex-shrink:0; }
.usage-choice-actions button { min-width:62px;min-height:44px;padding:8px 12px;border:1px solid #72847766;border-radius:10px;background:transparent;cursor:pointer; }
.usage-choice-actions button:last-child { background:var(--ring);color:var(--paper);border-color:var(--ring); }
.usage-choice-actions button:focus-visible,.usage-choice a:focus-visible { outline:2px solid var(--ring);outline-offset:2px; }
@media (max-width:500px) { .usage-choice { align-items:stretch;flex-direction:column;gap:10px; } .usage-choice-actions button { flex:1; } }
@media (max-width:900px) { .toolbar{gap:10px;} .dog-picker{gap:13px;} .dog-choice{flex-basis:44px;width:44px;height:44px;} .utilities{gap:1px;} }
@media (max-width:600px) { :root{--edge:6px;} .app{gap:3px;padding-bottom:max(5px,env(safe-area-inset-bottom));} .scene{border-radius:14px;} .toolbar{min-height:58px;gap:8px;padding:0 1px;} .dog-picker{gap:11px;padding-left:4px;} .dog-choice{width:39px;height:39px;flex-basis:39px;} .icon-button{width:38px;height:42px;} .utilities{gap:0;} .adjustments{width:238px;right:8px;bottom:8px;} }
@media (max-width:600px) { .interaction-controls{left:10px;bottom:10px;gap:8px;padding:6px;border-radius:15px;} .pose-choice{width:57px;height:44px;} .action-choice{width:40px;height:44px;} }
@media (max-height:500px) and (orientation:landscape) { .toolbar{min-height:49px;} .dog-choice{width:36px;height:36px;flex-basis:36px;} .dog-picker{gap:13px;padding-block:4px;} .icon-button{height:38px;} .scene{border-radius:12px;} }
@media (orientation:landscape) { .landscape-toggle { display:none; } }
@media (orientation:portrait) {
  .landscape-layout .app { position:fixed;left:50%;top:50%;width:100vh;width:100dvh;height:100vw;height:100dvw;transform:translate(-50%,-50%) rotate(90deg);padding:6px;gap:3px; }
  .landscape-layout .usage-choice { width:min(540px,calc(100dvh - 24px));max-height:calc(100dvw - 24px);flex-direction:row;align-items:center; }
  .landscape-layout .toolbar { min-height:46px;gap:12px; }
  .landscape-layout .dog-choice { width:35px;height:35px;flex-basis:35px; }
  .landscape-layout .icon-button { width:36px;height:38px; }
  .landscape-layout .scene { border-radius:12px; }
  .landscape-layout .adjustments { width:248px;padding:10px 14px;bottom:6px; }
  .landscape-layout .slider-row { height:29px; }
  .landscape-layout .appearance-row { min-height:41px; }
  .landscape-layout .appearance-divider { margin:6px 0; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after{transition:none!important;scroll-behavior:auto!important;} }

.hand-style-picker { overflow-x:auto;scrollbar-width:none;justify-content:flex-start;gap:12px;min-width:0;padding:5px;touch-action:pan-x; }
.hand-style-picker::-webkit-scrollbar { display:none; }
.scene-choice { background-size:92% auto,cover;background-position:center 55%,center;background-repeat:no-repeat; }
