:root {
  --rpx: calc(min(100vw, 460px) / 750);
  color-scheme: light;
  background: #e8ddc3;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

body { margin: 0; min-width: 0; }
#preview { width: min(100%, 460px); margin: auto; min-height: 100vh; background: #f7e8cd; box-shadow: 0 8px 36px rgba(29, 28, 25, .18); }
@media (min-width: 600px) {
  :root { --frame-width: clamp(320px, 46.2vh, 460px); --rpx: calc(var(--frame-width) / 750); background: #e7e2d7; }
  #preview { width: var(--frame-width); }
}
#loading { margin: 0; padding: 64px 24px; color: #553c28; text-align: center; }
view, partner-game { display: block; }
text { display: inline; }
img[mode="aspectFit"] { object-fit: contain; }
img[mode="aspectFill"] { object-fit: cover; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button[disabled] { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent-deep, #0d656c); outline-offset: 3px; }
::selection { color: var(--paper-light, #fff9e9); background: var(--accent-deep, #084d55); }
.field::placeholder { color: #6d604e; }
button.record-press { touch-action: none; }
.home-message::-webkit-scrollbar { width: 4px; }
.home-message::-webkit-scrollbar-thumb { border-radius: 4px; background: var(--turn-self-ink); }
.home-message::-webkit-scrollbar-track { background: transparent; }
@supports not selector(::-webkit-scrollbar) {
  .home-message { scrollbar-width: thin; scrollbar-color: var(--turn-self-ink) transparent; }
}
[hidden] { display: none !important; }


scene-art { display: block; overflow: hidden; container-type: size; }
.scene-board {
  position: absolute;
  top: 0;
  left: 50%;
  width: max(100cqw, calc(100cqh * var(--scene-aspect)));
  height: max(100cqh, calc(100cqw / var(--scene-aspect)));
  transform: translateX(-50%);
}
.scene-layer { position: absolute; display: block; }
.scene-role-breathe { transform-origin: 50% 97%; animation: scene-breathe 3.8s ease-in-out infinite; }
@keyframes scene-breathe { 50% { transform: scale(1.006, 1.012); } }
@media (prefers-reduced-motion: reduce) { .scene-role-breathe { animation: none; } }

.story-window { position: absolute; inset: 0; }
.scene-idle-clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.scene-idle-clip[data-visible="true"] { opacity: 1; }
@supports (height: 100dvh) {
  .screen.home-experience { --home-canvas-height: var(--home-viewport-height, 100dvh); }
}
#preview[data-keyboard-open] .screen.home-experience { --home-canvas-height: var(--home-viewport-height); }
#preview[data-keyboard-open] .home-experience .home-scenery .scene-board { top: calc(-105 * var(--rpx)); }
