:root {
  --warm-white: #f8f3ea;
  --cream: #efe4d1;
  --soft-cream: #fbf7ef;
  --wood: #cdb38f;
  --wood-dark: #9f815d;
  --pale-gray: #d8d6cf;
  --ink: #544d43;
  --muted: #81786d;
  --light: #fff4cf;
  --bird-blue: #b9dcea;
  --bird-blue-deep: #7fb5ca;
  --bird-white: #f7f5ee;
  --bird-mark: #4c4f54;
  --bird-nose: #6da8d6;
  --scene-image: url("assets/room-corner.png");
  --scene-mobile-image: url("assets/room-corner-mobile.png");
  --scene-backdrop: url("assets/layers/room-corner-desktop-backdrop.png");
  --scene-mobile-backdrop: url("assets/layers/room-corner-mobile-backdrop.png");
  --xiaoq-main: url("assets/xiaoq-idle-original-art-safe.png");
  --xiaoq-walk-left-action: url("assets/xiaoq-walk-left-safe.png");
  --xiaoq-walk-right-action: url("assets/xiaoq-walk-right-safe.png");
  --xiaoq-curious-action: url("assets/xiaoq-action-curious-tilt-1x6-safe.png");
  --xiaoq-eat-action: url("assets/xiaoq-action-eat-1x6-safe.png");
  --xiaoq-eat-left-action: url("assets/xiaoq-action-eat-left-1x6-safe.png");
  --xiaoq-rest-action: url("assets/xiaoq-action-one-foot-rest-1x6-safe.png");
  --xiaoq-sing-action: url("assets/xiaoq-action-sing-1x6-safe.png");
  --xiaoq-home: url("assets/xiaoq-home.png");
  --xiaoq-home-sprite: url("assets/xiaoq-home-sprite.png");
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #efe4d3;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(180deg, #faf6ee 0%, #eee2d0 100%);
}

button {
  font: inherit;
}

.game-shell,
.opening-screen,
.room-screen {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.opening-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: clamp(28px, 6vw, 88px);
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(28px, 6vw, 72px);
  background:
    linear-gradient(90deg, rgba(248, 243, 234, 0.99) 0%, rgba(248, 243, 234, 0.94) 48%, rgba(248, 243, 234, 0.72) 100%),
    var(--scene-image) center / cover no-repeat;
}

.opening-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 26% 46%, rgba(255, 255, 255, 0.45), transparent 28%);
  pointer-events: none;
}

.opening-content {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  justify-items: start;
}

.opening-kicker {
  margin: 0 0 6px;
  color: rgba(84, 77, 67, 0.62);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.opening-title {
  margin: 0;
  max-width: none;
  height: clamp(5.25rem, 9.75vw, 8.5rem);
  color: rgba(74, 66, 55, 0.96);
  font-size: clamp(2.04rem, 4.35vw, 3.78rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
  white-space: nowrap;
}

html[lang="ja"] .opening-title {
  font-size: clamp(1.9rem, 4vw, 3.36rem);
}

.opening-text {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2px 0 0;
  color: rgba(84, 77, 67, 0.74);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.6;
  letter-spacing: 0;
  white-space: nowrap;
}

.opening-text::before {
  content: "";
  width: 42px;
  height: 1px;
  background: rgba(159, 129, 93, 0.38);
}

.opening-text span + span {
  position: relative;
}

.opening-text span + span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 14px 0 0;
  border-radius: 50%;
  vertical-align: middle;
  background: rgba(159, 129, 93, 0.46);
}

.opening-bird {
  position: relative;
  justify-self: center;
  align-self: center;
  width: min(33vw, 424px);
  min-width: 300px;
  aspect-ratio: 887 / 887;
  background-image: var(--xiaoq-home-sprite);
  background-repeat: no-repeat;
  background-size: 200% 100%;
  background-position: 0 0;
  filter: drop-shadow(0 18px 26px rgba(73, 54, 34, 0.13));
  animation: homeSpriteBlink 1.86s infinite;
  z-index: 1;
  pointer-events: none;
}

.home-audio-toggle {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  border: 1px solid rgba(84, 77, 67, 0.12);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 252, 245, 0.46);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.speaker-icon {
  display: block;
  width: 22px;
  height: 22px;
  background: url("assets/ui/volume_off_black_transparent.png") center / contain no-repeat;
  opacity: 0.62;
}

.home-audio-toggle.is-muted .speaker-icon {
  background-image: url("assets/ui/volume_mute_black_transparent.png");
  opacity: 0.72;
}

.home-audio-toggle:hover,
.home-audio-toggle:focus-visible {
  border-color: rgba(84, 77, 67, 0.28);
  background: rgba(255, 252, 245, 0.82);
  transform: translateY(-1px);
  outline: none;
}

.home-audio-toggle:hover .speaker-icon,
.home-audio-toggle:focus-visible .speaker-icon {
  opacity: 0.78;
}

.quiet-button,
.food-button {
  min-height: 44px;
  border: 1px solid rgba(84, 77, 67, 0.11);
  border-radius: 999px;
  padding: 10px 18px;
  color: rgba(84, 77, 67, 0.82);
  background: rgba(255, 252, 245, 0.5);
  box-shadow: 0 6px 14px rgba(102, 84, 58, 0.035);
  cursor: pointer;
  transition:
    transform 220ms ease,
    background 220ms ease,
    border-color 220ms ease;
}

.quiet-button:hover,
.food-button:hover,
.quiet-button:focus-visible,
.food-button:focus-visible {
  background: #fffaf0;
  border-color: rgba(84, 77, 67, 0.36);
  transform: translateY(-1px);
  outline: none;
}

.quiet-button:disabled,
.food-button:disabled {
  cursor: default;
  opacity: 0.46;
  transform: none;
}

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  overflow: visible;
  margin-top: 10px;
  justify-self: start;
  width: 226px;
  min-width: 226px;
  height: 134px;
  min-height: 134px;
  border: 0;
  border-radius: 0;
  padding: 0 32px;
  color: rgba(78, 70, 58, 0.74);
  font-weight: 450;
  line-height: 1.14;
  text-align: center;
  white-space: pre-line;
  background: transparent;
  box-shadow: none;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.64),
    0 0 8px rgba(248, 243, 234, 0.68);
  touch-action: manipulation;
  transition: transform 180ms ease;
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/ui/pillow-button.png") center / contain no-repeat;
  opacity: 0.78;
  filter: saturate(0.72) contrast(0.86) brightness(1.03);
  transform: scale(0.985);
  transform-origin: center;
  transition: transform 180ms ease;
}

.primary-button::after {
  content: none;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.primary-button:hover::before,
.primary-button:focus-visible::before {
  content: "";
}

.primary-button:active {
  transform: translateY(1px) scale(0.997);
}

.primary-button:active::before {
  transform: scale(0.965);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 16px;
  margin-top: 10px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.language-button {
  position: relative;
  min-width: 0;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  color: rgba(84, 77, 67, 0.44);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  transition:
    color 180ms ease,
    opacity 180ms ease;
}

.language-button:hover,
.language-button:focus-visible {
  color: rgba(84, 77, 67, 0.76);
  background: transparent;
  outline: none;
}

.language-button.is-active {
  color: rgba(84, 77, 67, 0.82);
  background: transparent;
  box-shadow: none;
}

.language-button.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 9px;
  height: 1px;
  background: rgba(159, 129, 93, 0.4);
  transform: translateX(-50%);
}

.room-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 24px max(18px, env(safe-area-inset-bottom));
}

.room {
  position: relative;
  width: min(1180px, calc(100vw - 48px), calc((100dvh - 186px) * 1672 / 941));
  aspect-ratio: 1672 / 941;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(122, 111, 94, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 63% 43%, rgba(255, 250, 232, 0.16), rgba(255, 250, 232, 0) 36%),
    linear-gradient(180deg, rgba(255, 251, 242, 0.08), rgba(255, 251, 242, 0.12)),
    var(--scene-backdrop) center / contain no-repeat;
  background-color: #f6eddf;
  box-shadow: 0 24px 68px rgba(92, 76, 52, 0.095);
}

.room::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 64% 49%, rgba(255, 250, 232, 0.14), rgba(255, 250, 232, 0) 34%),
    linear-gradient(180deg, transparent 58%, rgba(58, 44, 29, 0.04));
  pointer-events: none;
  z-index: 1;
}

.scene-layer {
  position: absolute;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.window-sill-layer,
.basket-hoop {
  display: none;
}

.sunlight-layer {
  position: absolute;
  left: 24%;
  top: 12%;
  width: 48%;
  height: 44%;
  background:
    radial-gradient(ellipse at 18% 18%, rgba(255, 248, 222, 0.32), rgba(255, 248, 222, 0.15) 36%, rgba(255, 248, 222, 0) 74%),
    radial-gradient(ellipse at 54% 78%, rgba(255, 238, 190, 0.14), rgba(255, 238, 190, 0) 62%);
  mix-blend-mode: soft-light;
  opacity: 0.42;
  filter: blur(28px);
  pointer-events: none;
  z-index: 2;
}

.window-layer {
  left: 6.4%;
  top: 5.2%;
  width: 54%;
  height: 47.9%;
  background-image: url("assets/objects/window-sun.png");
  background-size: 100% 100%;
  filter: saturate(0.93) brightness(1.01) drop-shadow(0 12px 15px rgba(93, 65, 36, 0.09));
  pointer-events: none;
  z-index: 3;
}

.window-sill-layer {
  left: 19.44%;
  top: 37.19%;
  width: 80.56%;
  aspect-ratio: 1347 / 350;
  background-image: url("assets/layers/window_sill-desktop.png");
  z-index: 2;
}

.sofa-layer {
  left: -14.6%;
  top: 36.3%;
  width: 63%;
  aspect-ratio: 1448 / 1086;
  background-image: url("assets/objects/sofa-cute-v2.png");
  opacity: 0.92;
  filter: saturate(0.9) brightness(1.01) drop-shadow(0 9px 10px rgba(82, 55, 29, 0.075));
  pointer-events: none;
  z-index: 5;
}

.sofa-layer::after {
  content: "";
  position: absolute;
  left: 23%;
  bottom: 17%;
  width: 54%;
  height: 8%;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(95, 65, 34, 0.14), rgba(95, 65, 34, 0) 68%);
  transform: translateY(55%);
  z-index: -1;
}

.plant-layer {
  left: 84.6%;
  top: 34.6%;
  width: 12.8%;
  aspect-ratio: 726 / 902;
  background-image: url("assets/objects/plant-v2-cropped.png");
  opacity: 0.9;
  filter: saturate(0.92) drop-shadow(0 9px 8px rgba(73, 54, 34, 0.12));
  z-index: 5;
}

.ladder-layer {
  left: 56.2%;
  top: 42.5%;
  width: 16%;
  aspect-ratio: 1448 / 1086;
  background-image: url("assets/objects/ladder-v2.png");
  opacity: 0.9;
  filter: saturate(0.9) brightness(1.01) drop-shadow(0 8px 7px rgba(73, 54, 34, 0.11));
  z-index: 5;
}

.basket-hoop {
  display: block;
  left: 57.95%;
  top: 3.6%;
  width: 36%;
  aspect-ratio: 1536 / 1024;
  background-image: url("assets/basket-hoop.png");
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  opacity: 0.78;
  filter: saturate(0.82) contrast(0.93) drop-shadow(0 8px 9px rgba(73, 54, 34, 0.09));
  z-index: 6;
}

.basket-hoop:hover,
.basket-hoop:focus-visible {
  outline: none;
  opacity: 0.94;
  filter:
    saturate(0.92) contrast(0.98)
    drop-shadow(0 8px 9px rgba(73, 54, 34, 0.1))
    drop-shadow(0 0 10px rgba(255, 246, 218, 0.36));
}

.basketball-layer {
  left: 70.7%;
  top: 47.4%;
  width: 10.5%;
  aspect-ratio: 1;
  background-image: url("assets/objects/basketball-v2.png");
  opacity: 0.9;
  filter: saturate(0.88) contrast(0.94) drop-shadow(0 7px 7px rgba(73, 54, 34, 0.13));
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition:
    filter 220ms ease,
    transform 220ms ease;
  z-index: 7;
}

.basketball-layer::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
}

.basketball-layer::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 1%;
  height: 13%;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(84, 58, 30, 0.16), rgba(84, 58, 30, 0) 70%);
  transform: translateY(46%);
  pointer-events: none;
}

.basketball-hit-area {
  display: block;
  left: 67.4%;
  top: 43.7%;
  width: 17.2%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  z-index: 18;
}

.basketball-hit-area:focus-visible {
  outline: none;
}

.basketball-layer:hover,
.basketball-layer:focus-visible,
.basketball-layer.is-hovered,
.basketball-layer:has(+ .basketball-hit-area:hover),
.basketball-layer:has(+ .basketball-hit-area:focus-visible) {
  opacity: 1;
  filter:
    saturate(0.98) contrast(0.98)
    drop-shadow(0 7px 7px rgba(73, 54, 34, 0.15))
    drop-shadow(0 0 13px rgba(255, 232, 160, 0.58));
  transform: translateY(-2px);
}

.food-plate-layer {
  left: 43.44%;
  top: 56.1%;
  width: 12.9375%;
  aspect-ratio: 1113 / 517;
  background-image: url("assets/objects/empty-plate-v1-cropped.png");
  filter:
    brightness(1.035)
    saturate(1.02)
    drop-shadow(0 8px 8px rgba(73, 54, 34, 0.16))
    drop-shadow(0 0 13px rgba(255, 245, 220, 0.34));
  z-index: 6;
}

.food-plate-layer::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 6%;
  height: 20%;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(84, 58, 30, 0.13), rgba(84, 58, 30, 0) 72%);
  transform: translateY(56%);
  pointer-events: none;
}

.food-layer {
  opacity: 0;
  filter: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    filter 220ms ease;
  z-index: 7;
}

.food-layer.is-selected {
  opacity: 1;
  transform: translateY(-5%);
  filter: drop-shadow(0 4px 5px rgba(73, 54, 34, 0.17));
}

.sweet-potato-layer {
  left: 45.95%;
  top: 54.28%;
  width: 7.93125%;
  aspect-ratio: 754 / 556;
  background-image: url("assets/objects/sweet-potato-v1-cropped.png");
}

.egg-layer {
  left: 46.166%;
  top: 54.664%;
  width: 7.4925%;
  aspect-ratio: 564 / 496;
  background-image: url("assets/objects/egg-v1-cropped.png");
}

.corn-layer {
  left: 46.62%;
  top: 54.03%;
  width: 6.58125%;
  aspect-ratio: 601 / 571;
  background-image: url("assets/objects/corn-v1-cropped.png");
}

.bird-actor {
  left: 65.04%;
  bottom: 29.8%;
  --near-x: -18px;
  --feed-near-x: -72px;
  --feed-near-y: 3px;
  width: clamp(211px, 22.1vw, 269px);
  aspect-ratio: 1;
  transform-origin: 50% 92%;
  transition: transform 680ms ease;
  z-index: 8;
  pointer-events: none;
}

.bird {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  background-image: var(--xiaoq-main);
  background-repeat: no-repeat;
  background-size: 400% 100%;
  background-position: 0 0;
  overflow: hidden;
  filter: drop-shadow(0 10px 10px rgba(73, 54, 34, 0.17));
  animation: xiaoqIdleFrames 4.2s step-end infinite;
}

.bird-actor.is-tilting {
  transform: rotate(-7deg);
}

.bird-actor.is-near {
  transform: translateX(var(--near-x));
}

.bird-actor.is-walking {
  animation: xiaoqWalkCloser 920ms ease-out;
}

.bird-actor.is-walking::before,
.bird-actor.is-walking::after {
  content: none;
  display: none;
  position: absolute;
  bottom: 2.8%;
  width: 12%;
  height: 3.5%;
  border-radius: 999px;
  background: rgba(206, 142, 137, 0.9);
  box-shadow: 0 2px 3px rgba(73, 54, 34, 0.14);
  transform-origin: center;
}

.bird-actor.is-walking::before {
  left: 47%;
  animation: leftFootStep 460ms ease-in-out 2;
}

.bird-actor.is-walking::after {
  left: 60%;
  animation: rightFootStep 460ms ease-in-out 2;
}

.bird-actor.is-pecking {
  animation: peck 900ms ease;
}

.bird-actor.is-still {
  transform: translateY(1px);
}

.bird.is-playing-action {
  background-size: 600% 100%;
  background-position: 0 0;
}

.bird.action-curious-tilt {
  background-image: var(--xiaoq-curious-action);
  animation: xiaoqActionFrames 2600ms steps(5, end) both;
}

.bird.action-walk-left {
  background-image: var(--xiaoq-walk-left-action);
  animation: xiaoqActionFrames 1900ms steps(5, end) both;
}

.bird.action-walk-right {
  background-image: var(--xiaoq-walk-right-action);
  animation: xiaoqActionFrames 1900ms steps(5, end) both;
}

.bird.action-eat {
  background-image: var(--xiaoq-eat-action);
  animation: xiaoqActionFrames 3200ms steps(5, end) both;
}

.bird.action-eat-left {
  background-image: var(--xiaoq-eat-left-action);
  animation: xiaoqEatEntryFrames 3200ms step-end both;
}

.bird.action-one-foot-rest {
  background-image: var(--xiaoq-rest-action);
  animation: xiaoqRestFrames 15000ms step-end both;
  transform: scale(1.12);
  transform-origin: 50% 92%;
}

.bird.action-sing {
  background-image: var(--xiaoq-sing-action);
  animation: xiaoqActionFrames 3200ms steps(5, end) both;
}

.bird-actor.is-looking-food {
  transform: translateX(-8px) rotate(-2deg);
  transition: transform 1000ms ease-in-out;
}

.bird-actor.is-near-food {
  transform: translateX(var(--feed-near-x)) translateY(var(--feed-near-y));
  transition: transform 950ms linear;
}

.bird-actor.is-returning-food {
  animation: xiaoqReturnFromFood 950ms steps(5, end) both;
  transition: none;
}

.bird-actor.is-resting-softly {
  transform: translateY(2px) rotate(-1deg);
  transition: transform 1600ms ease-in-out;
}

.bird-actor.is-listening-softly {
  transform: translateY(-5px) rotate(-2deg);
  transition: transform 1300ms ease-in-out;
}

.bird-actor.is-looking-ball {
  transform: translateX(10px) rotate(3deg);
  transition: transform 1100ms ease-in-out;
}

.anchor-marker {
  position: absolute;
  display: none;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 30;
}

.anchor-marker.is-visible {
  display: block;
}

.anchor-marker-bird {
  background: rgba(210, 74, 58, 0.86);
  box-shadow: 0 0 0 2px rgba(210, 74, 58, 0.28);
}

.anchor-marker-target {
  background: rgba(55, 122, 196, 0.86);
  box-shadow: 0 0 0 2px rgba(55, 122, 196, 0.28);
}

.basketball-layer.is-gently-rolling {
  animation: basketballGentleNudge 1400ms ease-in-out;
}

.message-panel {
  height: 84px;
  display: flex;
  align-items: center;
  padding: 18px 22px;
}

.message-panel p {
  margin: 0;
  max-width: 620px;
  white-space: pre-line;
  font-size: 1rem;
  line-height: 1.9;
  color: rgba(84, 77, 67, 0.9);
}

.conversation-box {
  width: min(1180px, calc(100vw - 48px), calc((100dvh - 186px) * 1672 / 941));
  height: 136px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(122, 111, 94, 0.1);
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.76);
  box-shadow: 0 16px 42px rgba(92, 76, 52, 0.075);
  backdrop-filter: blur(12px);
}

.controls {
  display: grid;
  gap: 12px;
  justify-items: end;
  padding: 18px 22px 18px 0;
  min-width: 360px;
}

.main-actions,
.food-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 360px;
}

.food-actions.is-hidden {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.food-button {
  min-width: 72px;
  padding-inline: 16px;
  background: rgba(244, 235, 216, 0.72);
}

.is-hidden {
  display: none !important;
}

.sprite-warmup {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.sprite-warmup-frame {
  display: block;
  width: 96px;
  height: 96px;
  background-repeat: no-repeat;
  background-position: 0 0;
  contain: strict;
}

.debug-placement-panel {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 100;
  display: none;
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}

body.has-debug-placement-entry .debug-placement-panel {
  display: grid;
}

.debug-toggle-button,
.debug-output-button {
  pointer-events: auto;
  border: 1px solid rgba(84, 77, 67, 0.16);
  border-radius: 999px;
  padding: 7px 12px;
  color: rgba(84, 77, 67, 0.76);
  background: rgba(255, 252, 245, 0.82);
  box-shadow: 0 8px 24px rgba(92, 76, 52, 0.1);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

.debug-tools {
  display: none;
  width: min(360px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid rgba(122, 111, 94, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 245, 0.92);
  box-shadow: 0 18px 48px rgba(92, 76, 52, 0.14);
  pointer-events: auto;
}

.debug-mode-label {
  margin: 0 0 8px;
  color: rgba(84, 77, 67, 0.82);
  font-size: 0.86rem;
}

.debug-output-button {
  margin-bottom: 8px;
}

.debug-output {
  display: block;
  width: 100%;
  min-height: 148px;
  resize: vertical;
  border: 1px solid rgba(122, 111, 94, 0.14);
  border-radius: 6px;
  padding: 10px;
  color: rgba(84, 77, 67, 0.86);
  background: rgba(255, 250, 240, 0.84);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

body.is-debug-placement .debug-tools {
  display: block;
}

body.is-debug-placement [data-debug-draggable="true"] {
  outline: 1px dashed rgba(84, 77, 67, 0.34);
  outline-offset: 3px;
  cursor: grab;
  pointer-events: auto;
}

body.is-debug-placement [data-debug-draggable="true"].is-debug-dragging {
  cursor: grabbing;
  outline-color: rgba(55, 122, 196, 0.65);
  z-index: 40;
}

@media (min-width: 721px) and (max-height: 760px) {
  .room-screen {
    gap: 10px;
    padding-block: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-bottom));
  }

  .room,
  .conversation-box {
    width: min(1040px, calc(100vw - 40px), calc((100dvh - 146px) * 1672 / 941));
  }

  .conversation-box {
    height: 112px;
    min-height: 0;
  }

  .message-panel {
    height: 70px;
    padding: 14px 18px;
  }

  .controls {
    padding: 14px 18px 14px 0;
  }

  .quiet-button,
  .food-button {
    min-height: 40px;
    padding-block: 8px;
  }
}

@media (min-width: 721px) and (max-height: 660px) {
  .room,
  .conversation-box {
    width: min(920px, calc(100vw - 36px), calc((100dvh - 138px) * 1672 / 941));
  }

  .conversation-box {
    height: 104px;
    min-height: 0;
  }

  .message-panel {
    min-height: 58px;
    padding: 12px 16px;
  }

  .message-panel p {
    font-size: 0.94rem;
    line-height: 1.7;
  }

  .controls {
    gap: 8px;
    padding: 12px 16px 12px 0;
  }
}

@media (min-width: 721px) and (max-width: 900px) and (max-height: 500px) {
  .opening-screen {
    gap: 28px;
    min-height: 100dvh;
    padding: 18px 28px;
  }

  .opening-content {
    gap: 12px;
  }

  .opening-bird {
    width: min(30vw, 260px);
    min-width: 220px;
  }

  .opening-title {
    font-size: clamp(2.2rem, 5vw, 3.1rem);
  }

  .room-screen {
    gap: 10px;
    padding: max(10px, env(safe-area-inset-top)) 18px max(10px, env(safe-area-inset-bottom));
  }

  .bird-actor {
    width: clamp(130px, 18vw, 150px);
  }

  .quiet-button,
  .food-button {
    min-height: 40px;
    padding-inline: 12px;
    font-size: 0.9rem;
  }
}

@media (min-width: 721px) and (max-height: 500px) {
  body:not(.is-mobile-landscape) .room-screen {
    justify-content: flex-start;
    overflow-y: auto;
    padding-block: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-bottom));
  }

  body:not(.is-mobile-landscape) .room,
  body:not(.is-mobile-landscape) .conversation-box {
    width: min(920px, calc(100vw - 36px));
  }

  body:not(.is-mobile-landscape) .conversation-box {
    height: 132px;
    min-height: 132px;
  }

  body:not(.is-mobile-landscape) .message-panel {
    height: 82px;
    min-height: 82px;
    padding: 14px 18px;
  }

  body:not(.is-mobile-landscape) .message-panel p {
    font-size: 0.96rem;
    line-height: 1.68;
  }

  body:not(.is-mobile-landscape) .controls {
    gap: 10px;
    padding: 14px 18px 14px 0;
  }
}

@keyframes blink {
  0%,
  46%,
  50%,
  100% {
    transform: scaleY(1);
  }
  48% {
    transform: scaleY(0.15);
  }
}

@keyframes homeSpriteBlink {
  0%,
  87.99% {
    background-position: 0 0;
  }
  88%,
  93.99% {
    background-position: 100% 0;
  }
  94%,
  100% {
    background-position: 0 0;
  }
}

@keyframes xiaoqIdleFrames {
  0%,
  9.52% {
    background-position: 0 0;
  }

  9.53%,
  19.04% {
    background-position: 33.333% 0;
  }

  19.05%,
  66.66% {
    background-position: 66.666% 0;
  }

  66.67%,
  100% {
    background-position: 100% 0;
  }
}

@keyframes xiaoqActionFrames {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 100% 0;
  }
}

@keyframes xiaoqHoldFirstFrame {
  from,
  to {
    background-position: 0 0;
  }
}

@keyframes xiaoqEatEntryFrames {
  0%,
  10.99% {
    background-position: 0 0;
  }

  11%,
  27.99% {
    background-position: 20% 0;
  }

  28%,
  48.99% {
    background-position: 40% 0;
  }

  49%,
  69.99% {
    background-position: 80% 0;
  }

  70%,
  100% {
    background-position: 60% 0;
  }
}

@keyframes xiaoqEatLoopFrames {
  0%,
  24.99% {
    background-position: 20% 0;
  }

  25%,
  49.99% {
    background-position: 40% 0;
  }

  50%,
  74.99% {
    background-position: 80% 0;
  }

  75%,
  100% {
    background-position: 60% 0;
  }
}

@keyframes xiaoqRestFrames {
  0%,
  3.32% {
    background-position: 0 0;
  }

  3.33%,
  6.66% {
    background-position: 20% 0;
  }

  6.67%,
  20% {
    background-position: 40% 0;
  }

  20.01%,
  46.66% {
    background-position: 60% 0;
  }

  46.67%,
  93.33% {
    background-position: 80% 0;
  }

  93.34%,
  100% {
    background-position: 100% 0;
  }
}

@keyframes xiaoqWalkBob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes xiaoqReturnFromFood {
  from {
    transform: translateX(var(--feed-near-x)) translateY(var(--feed-near-y));
  }

  to {
    transform: translateX(0) translateY(0);
  }
}

@keyframes basketballGentleNudge {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  42% {
    transform: translateX(10px) rotate(7deg);
  }
  72% {
    transform: translateX(4px) rotate(3deg);
  }
}

@keyframes xiaoqActionSprite6 {
  0%,
  16.66% {
    background-position: 0 0;
  }
  16.67%,
  33.32% {
    background-position: 20% 0;
  }
  33.33%,
  49.99% {
    background-position: 40% 0;
  }
  50%,
  66.65% {
    background-position: 60% 0;
  }
  66.66%,
  83.32% {
    background-position: 80% 0;
  }
  83.33%,
  100% {
    background-position: 100% 0;
  }
}

@keyframes peck {
  0%,
  100% {
    transform: rotate(0deg);
  }
  42% {
    transform: rotate(4deg) translateY(8px);
  }
  68% {
    transform: rotate(1deg) translateY(2px);
  }
}

@keyframes xiaoqWalkCloser {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  20% {
    transform: translateX(calc(var(--near-x) * 0.22)) translateY(-3px) rotate(-1deg);
  }
  40% {
    transform: translateX(calc(var(--near-x) * 0.45)) translateY(0) rotate(1deg);
  }
  64% {
    transform: translateX(calc(var(--near-x) * 0.72)) translateY(-2px) rotate(-0.6deg);
  }
  100% {
    transform: translateX(var(--near-x)) translateY(0) rotate(0deg);
  }
}

@keyframes leftFootStep {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 0.62;
  }
  45% {
    transform: translateX(-7px) translateY(-2px) rotate(-14deg);
    opacity: 1;
  }
}

@keyframes rightFootStep {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 0.62;
  }
  45% {
    transform: translateX(7px) translateY(-2px) rotate(14deg);
    opacity: 1;
  }
}

@media (max-width: 720px), (min-width: 721px) and (max-width: 900px) and (orientation: portrait) and (pointer: coarse) {
  .opening-screen {
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    gap: 10px;
    padding: max(18px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, rgba(248, 243, 234, 0.72), rgba(248, 243, 234, 0.98)),
      var(--scene-image) center top / auto 46% no-repeat,
      #f6eddf;
  }

  .opening-content {
    width: min(100%, 390px);
    gap: 10px;
    order: 2;
    justify-self: center;
  }

  .opening-title {
    max-width: 8.8em;
    height: clamp(5.05rem, 16.2vw, 6.15rem);
    font-size: clamp(1.6rem, 7.65vw, 2.36rem);
    line-height: 1.18;
    white-space: nowrap;
  }

  html[lang="ja"] .opening-title {
    max-width: 10.2em;
    font-size: clamp(1.42rem, 6.85vw, 2.04rem);
    line-height: 1.22;
  }

  .opening-text {
    justify-content: center;
    gap: 10px;
    margin-top: 2px;
    font-size: clamp(0.94rem, 4.1vw, 1.04rem);
    line-height: 1.55;
    text-align: center;
  }

  .opening-text::before {
    display: none;
  }

  .opening-text span + span::before {
    width: 3px;
    height: 3px;
    margin-right: 10px;
  }

  .opening-bird {
    order: 1;
    justify-self: center;
    width: clamp(150px, 48vw, 220px);
    min-width: 0;
  }

  .primary-button {
    width: 190px;
    min-width: 190px;
    height: 112px;
    min-height: 112px;
    padding: 0 30px;
  }

  .language-switcher {
    justify-self: center;
    gap: 17px;
    margin-top: 8px;
  }

  .room-screen {
    position: relative;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
    padding: max(10px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .room {
    width: min(100%, 430px);
    height: auto;
    min-height: 0;
    aspect-ratio: 941 / 1672;
    border-radius: 8px;
    background:
      radial-gradient(ellipse at 53% 40%, rgba(255, 250, 232, 0.13), rgba(255, 250, 232, 0) 38%),
      linear-gradient(180deg, rgba(255, 251, 242, 0.07), rgba(255, 251, 242, 0.1)),
      var(--scene-mobile-backdrop) center / contain no-repeat;
    background-color: #f6eddf;
  }

  .sunlight-layer {
    left: -4%;
    top: 6%;
    width: 70%;
    height: 32%;
    opacity: 0.32;
  }

  .window-layer {
    left: -30%;
    top: 1.5%;
    width: 116%;
    height: auto;
    aspect-ratio: 1448 / 1086;
    background-image: url("assets/objects/window-sun.png");
    background-size: contain;
  }

  .window-sill-layer {
    left: 15.41%;
    top: 47.85%;
    width: 84.59%;
    aspect-ratio: 796 / 260;
    background-image: url("assets/layers/window_sill-mobile.png");
  }

  .sofa-layer {
    left: -49%;
    top: 47.6%;
    width: 160%;
    aspect-ratio: 1448 / 1086;
    background-image: url("assets/objects/sofa-cute-v2.png");
    transform: scaleY(1.1);
    transform-origin: center bottom;
  }

  .plant-layer {
    left: 8%;
    top: 35%;
    width: 28%;
    aspect-ratio: 726 / 902;
    background-image: url("assets/objects/plant-v2-cropped.png");
    display: none;
  }

  .ladder-layer {
    left: 36%;
    top: 36%;
    width: 28%;
    aspect-ratio: 1448 / 1086;
    background-image: url("assets/objects/ladder-v2.png");
  }

  .basket-hoop {
    display: block;
    left: 56%;
    top: 16.5%;
    width: 48%;
    aspect-ratio: 1536 / 1024;
    background-image: url("assets/basket-hoop.png");
    filter: saturate(0.84) contrast(0.94);
    opacity: 0.82;
  }

  .basketball-layer {
    left: 77.64%;
    top: 41.93%;
    width: 22.464%;
    aspect-ratio: 1;
    background-image: url("assets/objects/basketball-v2.png");
    pointer-events: auto;
    touch-action: manipulation;
    opacity: 0.92;
    filter: saturate(0.88) contrast(0.94);
  }

  .basketball-layer::after {
    inset: -28px;
  }

  .basketball-hit-area {
    display: none;
  }

  .food-plate-layer {
    left: 12.526%;
    top: 48.012%;
    width: 20.088%;
    aspect-ratio: 1113 / 517;
    background-image: url("assets/objects/empty-plate-v1-cropped.png");
  }

  .sweet-potato-layer {
    left: 15.222%;
    top: 46.11%;
    width: 14.69664%;
    aspect-ratio: 754 / 556;
    background-image: url("assets/objects/sweet-potato-v1-cropped.png");
  }

  .egg-layer {
    left: 15.766%;
    top: 45.79%;
    width: 13.608%;
    aspect-ratio: 564 / 496;
    background-image: url("assets/objects/egg-v1-cropped.png");
  }

  .corn-layer {
    left: 15.358%;
    top: 45.3%;
    width: 14.42448%;
    aspect-ratio: 601 / 571;
    background-image: url("assets/objects/corn-v1-cropped.png");
  }

  .main-actions,
  .food-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .quiet-button,
  .food-button {
    padding-inline: 14px;
  }

  .bird-actor {
    left: 46%;
    bottom: 44.7%;
    --near-x: -14px;
    --feed-near-x: -92px;
    --feed-near-y: 2px;
    width: clamp(161px, 46.08vw, 211px);
  }

  .bird-actor.is-tilting {
    transform: rotate(-7deg);
  }

  .bird-actor.is-near {
    transform: translateX(var(--near-x));
  }

  .bird-actor.is-still {
    transform: translateY(1px);
  }

  .bird-actor.is-looking-food {
    transform: translateX(-7px) rotate(-2deg);
  }

  .bird-actor.is-near-food {
    transform: translateX(var(--feed-near-x)) translateY(var(--feed-near-y));
  }

  .conversation-box {
    position: absolute;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 8;
    width: min(100%, 430px);
    grid-template-columns: 1fr;
    gap: 0;
    height: 198px;
    min-height: 0;
    margin-top: 0;
    border-color: rgba(122, 111, 94, 0.14);
    background: rgba(255, 252, 245, 0.82);
    box-shadow: 0 -8px 24px rgba(94, 74, 48, 0.06), 0 16px 34px rgba(94, 74, 48, 0.09);
    backdrop-filter: blur(10px);
  }

  .message-panel {
    height: 86px;
    min-height: 0;
    padding: 16px 18px 10px;
  }

  .controls {
    justify-items: stretch;
    padding: 0 18px 16px;
    min-width: 0;
  }
}

@media (max-width: 720px) and (max-height: 820px) {
  .opening-screen {
    gap: 8px;
  }

  .opening-content {
    gap: 10px;
  }

  .opening-title {
    height: clamp(4.75rem, 15.5vw, 5.65rem);
    font-size: clamp(1.5rem, 7.15vw, 2.14rem);
  }

  html[lang="ja"] .opening-title {
    font-size: clamp(1.32rem, 6.25vw, 1.86rem);
  }

  .opening-text {
    font-size: clamp(0.9rem, 3.8vw, 1rem);
  }

  .room {
    width: min(100%, 390px);
  }

  .conversation-box {
    width: min(100%, 390px);
    height: 198px;
    min-height: 0;
    margin-top: 0;
  }

  .message-panel {
    height: 86px;
    min-height: 0;
    padding: 12px 16px 6px;
  }

  .controls {
    gap: 8px;
    padding: 0 16px 12px;
  }
}

@media (min-width: 721px) and (max-width: 900px) and (orientation: portrait) and (pointer: coarse) {
  .opening-screen {
    gap: 18px;
  }

  .opening-bird {
    width: clamp(220px, 38vw, 300px);
  }

  .opening-content {
    justify-items: center;
  }

  .room {
    width: min(520px, calc(100dvh * 0.58));
  }

  .conversation-box {
    width: min(520px, calc(100dvh * 0.58));
    height: auto;
    min-height: 218px;
    margin-top: -64px;
  }

  .message-panel {
    height: auto;
    min-height: 92px;
    padding: 18px 22px 10px;
  }

  .controls {
    padding: 0 22px 18px;
  }

  .quiet-button,
  .food-button {
    min-height: 46px;
    font-size: 1rem;
  }
}

@media (max-width: 720px) and (max-height: 740px) {
  .opening-bird {
    width: clamp(138px, 43vw, 190px);
  }

  .opening-title {
    height: clamp(4.35rem, 14.6vw, 5.2rem);
    font-size: clamp(1.4rem, 6.7vw, 1.96rem);
  }

  html[lang="ja"] .opening-title {
    font-size: clamp(1.24rem, 5.85vw, 1.72rem);
  }

  .opening-content {
    gap: 9px;
  }

  .primary-button {
    width: 178px;
    min-width: 178px;
    height: 104px;
    min-height: 104px;
    padding: 0 28px;
  }

  .room-screen {
    gap: 0;
    padding-inline: 10px;
  }

  .room {
    width: min(100%, 350px);
  }

  .conversation-box {
    width: min(100%, 350px);
    height: 176px;
    min-height: 0;
    margin-top: 0;
  }

  .message-panel {
    height: 72px;
    min-height: 0;
    padding: 12px 14px 6px;
  }

  .message-panel p {
    font-size: 0.94rem;
    line-height: 1.65;
  }

  .controls {
    gap: 8px;
    padding: 0 14px 12px;
  }

  .main-actions,
  .food-actions {
    gap: 8px;
  }

  .quiet-button,
  .food-button {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.94rem;
  }
}

@media (max-width: 720px) and (max-height: 660px) {
  .opening-title {
    font-size: clamp(1.38rem, 6.6vw, 1.92rem);
  }

  .opening-text {
    font-size: clamp(0.84rem, 3.5vw, 0.94rem);
  }

  .room {
    width: min(100%, 315px);
  }

  .conversation-box {
    width: min(100%, 315px);
    height: 160px;
    min-height: 0;
    margin-top: 0;
  }

  .message-panel {
    height: 64px;
    min-height: 0;
    padding: 10px 12px 4px;
  }

  .message-panel p {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .controls {
    padding: 0 12px 10px;
  }

  .quiet-button,
  .food-button {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.9rem;
  }
}

@media (max-width: 720px) and (max-height: 600px) {
  .room-screen {
    gap: 0;
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .room {
    width: min(100%, 286px);
  }

  .conversation-box {
    width: min(100%, 286px);
    height: 150px;
    min-height: 0;
    margin-top: 0;
  }

  .message-panel {
    height: 56px;
    min-height: 0;
    padding: 8px 10px 2px;
  }

  .message-panel p {
    font-size: 0.84rem;
    line-height: 1.48;
  }

  .controls {
    gap: 6px;
    padding: 0 10px 8px;
  }

  .main-actions,
  .food-actions {
    gap: 6px;
  }

  .quiet-button,
  .food-button {
    min-height: 38px;
    padding: 6px 9px;
    font-size: 0.84rem;
  }
}

body.is-mobile-landscape .opening-screen {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 8px;
  min-height: 100dvh;
  overflow: hidden;
  padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(248, 243, 234, 0.72), rgba(248, 243, 234, 0.98)),
    var(--scene-image) center top / auto 46% no-repeat,
    #f6eddf;
}

body.is-mobile-landscape .opening-content {
  order: 2;
  width: 100%;
  gap: 8px;
}

body.is-mobile-landscape .opening-title {
  max-width: none;
  font-size: clamp(1.8rem, 7dvh, 2.55rem);
}

body.is-mobile-landscape .opening-text {
  justify-content: center;
  margin-top: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

body.is-mobile-landscape .opening-text::before {
  display: none;
}

body.is-mobile-landscape .opening-bird {
  order: 1;
  justify-self: center;
  width: min(150px, 34dvh);
  min-width: 0;
}

body.is-mobile-landscape .primary-button {
  margin-top: 2px;
}

body.is-mobile-landscape .room-screen {
  position: relative;
  justify-content: center;
  align-items: center;
  gap: 0;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  padding: max(6px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
}

body.is-mobile-landscape .room {
  width: min(286px, calc((100dvh - 14px) * 941 / 1672));
  height: auto;
  min-height: 0;
  aspect-ratio: 941 / 1672;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 251, 242, 0.05), rgba(255, 251, 242, 0.09)),
    var(--scene-mobile-backdrop) center / contain no-repeat;
  background-color: #f6eddf;
}

body.is-mobile-landscape .sunlight-layer {
  left: -4%;
  top: 6%;
  width: 70%;
  height: 32%;
  opacity: 0.32;
}

body.is-mobile-landscape .window-layer {
  left: -30%;
  top: 1.5%;
  width: 116%;
  height: auto;
  aspect-ratio: 1448 / 1086;
  background-image: url("assets/objects/window-sun.png");
  background-size: contain;
}

body.is-mobile-landscape .window-sill-layer {
  left: 15.41%;
  top: 47.85%;
  width: 84.59%;
  aspect-ratio: 796 / 260;
  background-image: url("assets/layers/window_sill-mobile.png");
}

body.is-mobile-landscape .sofa-layer {
  left: -49%;
  top: 47.6%;
  width: 160%;
  aspect-ratio: 1448 / 1086;
  background-image: url("assets/objects/sofa-cute-v2.png");
  transform: scaleY(1.1);
  transform-origin: center bottom;
}

body.is-mobile-landscape .plant-layer {
  left: 8%;
  top: 35%;
  width: 28%;
  aspect-ratio: 726 / 902;
  background-image: url("assets/objects/plant-v2-cropped.png");
  display: none;
}

body.is-mobile-landscape .ladder-layer {
  left: 36%;
  top: 36%;
  width: 28%;
  aspect-ratio: 1448 / 1086;
  background-image: url("assets/objects/ladder-v2.png");
}

body.is-mobile-landscape .basket-hoop {
  display: block;
  left: 56%;
  top: 16.5%;
  width: 48%;
  aspect-ratio: 1536 / 1024;
  background-image: url("assets/basket-hoop.png");
  filter: saturate(0.84) contrast(0.94);
  opacity: 0.82;
}

body.is-mobile-landscape .basketball-layer {
  left: 77.64%;
  top: 41.93%;
  width: 22.464%;
  aspect-ratio: 1;
  background-image: url("assets/objects/basketball-v2.png");
  pointer-events: auto;
  touch-action: manipulation;
  opacity: 0.92;
  filter: saturate(0.88) contrast(0.94);
}

body.is-mobile-landscape .basketball-layer::after {
  inset: -28px;
}

body.is-mobile-landscape .basketball-hit-area {
  display: none;
}

body.is-mobile-landscape .food-plate-layer {
  left: 12.526%;
  top: 48.012%;
  width: 20.088%;
  aspect-ratio: 1113 / 517;
  background-image: url("assets/objects/empty-plate-v1-cropped.png");
}

body.is-mobile-landscape .sweet-potato-layer {
  left: 15.222%;
  top: 46.11%;
  width: 14.69664%;
  aspect-ratio: 754 / 556;
  background-image: url("assets/objects/sweet-potato-v1-cropped.png");
}

body.is-mobile-landscape .egg-layer {
  left: 15.766%;
  top: 45.79%;
  width: 13.608%;
  aspect-ratio: 564 / 496;
  background-image: url("assets/objects/egg-v1-cropped.png");
}

body.is-mobile-landscape .corn-layer {
  left: 15.358%;
  top: 45.3%;
  width: 14.42448%;
  aspect-ratio: 601 / 571;
  background-image: url("assets/objects/corn-v1-cropped.png");
}

body.is-mobile-landscape .bird-actor {
  left: 46%;
  bottom: 44.7%;
  --near-x: -14px;
  --feed-near-x: -92px;
  --feed-near-y: 2px;
  width: min(125px, 32dvh);
}

body.is-mobile-landscape .bird-actor.is-tilting {
  transform: rotate(-7deg);
}

body.is-mobile-landscape .bird-actor.is-near {
  transform: translateX(var(--near-x));
}

body.is-mobile-landscape .bird-actor.is-still {
  transform: translateY(1px);
}

body.is-mobile-landscape .bird-actor.is-looking-food {
  transform: translateX(-7px) rotate(-2deg);
}

body.is-mobile-landscape .bird-actor.is-near-food {
  transform: translateX(var(--feed-near-x)) translateY(var(--feed-near-y));
}

body.is-mobile-landscape .conversation-box {
  position: absolute;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 8;
  width: min(360px, calc(100vw - 24px));
  grid-template-columns: 1fr;
  gap: 0;
  height: min(150px, 39dvh);
  min-height: 0;
  margin-top: 0;
  border-color: rgba(122, 111, 94, 0.14);
  background: rgba(255, 252, 245, 0.82);
  box-shadow: 0 -8px 24px rgba(94, 74, 48, 0.06), 0 16px 34px rgba(94, 74, 48, 0.09);
  backdrop-filter: blur(10px);
}

body.is-mobile-landscape .message-panel {
  height: min(56px, 14dvh);
  padding: 8px 10px 2px;
}

body.is-mobile-landscape .message-panel p {
  font-size: 0.8rem;
  line-height: 1.42;
}

body.is-mobile-landscape .controls {
  justify-items: stretch;
  gap: 5px;
  min-width: 0;
  padding: 0 8px 7px;
}

body.is-mobile-landscape .main-actions,
body.is-mobile-landscape .food-actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 5px;
  max-width: none;
}

body.is-mobile-landscape .quiet-button,
body.is-mobile-landscape .food-button {
  flex: 1 1 0;
  min-height: 32px;
  padding: 5px 7px;
  font-size: 0.8rem;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .room-screen {
    padding-inline: 8px;
  }

  .main-actions,
  .food-actions {
    gap: 7px;
  }

  .quiet-button,
  .food-button {
    padding-inline: 10px;
  }
}
