:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --panel: #fffdf8;
  --ink: #24231f;
  --muted: #6d665d;
  --line: #e2d8cc;
  --green: #2f7f67;
  --green-dark: #205f4c;
  --coral: #db735a;
  --yellow: #f3c857;
  --blue: #73a8d6;
  --soft-green: #e6f3ec;
  --soft-blue: #e8f2fa;
  --soft-coral: #fae8e0;
  --shadow: 0 16px 32px rgba(73, 52, 33, 0.12);
}

/* LiNest v3: 絵本風の場面と画像サイズを保ち、外枠だけを統一 */
body.linest-themed {
  --bg: var(--linest-bg);
  --panel: var(--linest-surface);
  --ink: var(--linest-text);
  --muted: var(--linest-muted);
  --line: var(--linest-border);
  --green: var(--linest-green);
  --green-dark: var(--linest-green-dark);
  --soft-green: var(--linest-green-soft);
  --shadow: var(--linest-shadow);
}

body.linest-themed .app-shell,
body.linest-themed .top-bar > *,
body.linest-themed .avatar-zone > *,
body.linest-themed .settings-grid > * {
  min-width: 0;
}

body.linest-themed .app-shell {
  align-content: start;
}

body.linest-themed .top-bar,
body.linest-themed .stage,
body.linest-themed .guardian-panel {
  border-color: var(--linest-border);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--linest-shadow);
}

body.linest-themed .top-bar {
  padding: 14px 16px;
  border: 1px solid var(--linest-border);
  border-left: 6px solid var(--linest-green-bright);
  border-radius: 8px;
}

body.linest-themed .message-text {
  border-color: var(--linest-border);
  color: var(--linest-green-dark);
  background: var(--linest-green-soft);
}

body.linest-themed .avatar-choice,
body.linest-themed .food-choice,
body.linest-themed .setting-button,
body.linest-themed .step-button {
  min-width: 0;
  border-color: var(--linest-border);
  box-shadow: 0 5px 14px rgba(74, 55, 40, 0.06);
  line-height: 1.35;
  white-space: normal;
}

body.linest-themed .avatar-choice.selected,
body.linest-themed .setting-button.selected {
  border-color: var(--linest-green);
  color: var(--linest-green-dark);
  background: var(--linest-green-soft);
}

@media (max-width: 480px) {
  body.linest-themed .top-bar {
    padding: 12px;
  }

  body.linest-themed :where(.avatar-choice, .food-choice, .setting-button, .step-button) {
    font-size: 0.94rem;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(47, 127, 103, 0.16), transparent 38%),
    linear-gradient(325deg, rgba(219, 115, 90, 0.14), transparent 36%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  letter-spacing: 0;
}

button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(115, 168, 214, 0.72);
  outline-offset: 3px;
}

.app-shell {
  width: min(620px, calc(100% - 24px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 0 calc(16px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.85rem, 7vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  color: var(--green-dark);
  font-size: clamp(1.35rem, 5.6vw, 1.9rem);
  line-height: 1.18;
  letter-spacing: 0;
  text-align: center;
}

.icon-button {
  width: 58px;
  min-width: 58px;
  height: 58px;
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(73, 52, 33, 0.08);
  color: var(--green-dark);
  font-size: 1.35rem;
  font-weight: 900;
}

.icon-button.muted {
  color: var(--muted);
  background: #f0eee8;
}

.stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
}

.avatar-zone {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.avatar-wrap {
  width: 104px;
  aspect-ratio: 1;
  border: 2px solid #e6d9cb;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff9ef 0%, #f7efe4 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.avatar-art {
  width: 100%;
  height: 100%;
}

.food-art {
  display: grid;
  place-items: center;
}

.avatar-art svg,
.avatar-art img,
.food-art svg,
.food-art img {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-image,
.food-image {
  box-sizing: border-box;
  object-fit: contain;
  object-position: center center;
}

.avatar-image {
  padding: 10px;
}

.food-image {
  padding: 10px;
}

.meter-block {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.meter-row {
  display: grid;
  gap: 4px;
}

.meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--green-dark);
  font-size: 0.95rem;
  font-weight: 900;
}

.pain-header {
  color: #8a3c2d;
}

.belly-meter {
  height: 24px;
  border: 2px solid #cde0d2;
  border-radius: 8px;
  background: #f3f7ef;
  overflow: hidden;
}

.belly-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 260ms ease;
}

.pain-meter {
  border-color: #f1c3b7;
  background: #fff4f0;
}

.pain-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f4b29f, var(--coral));
  transition: width 260ms ease;
}

.belly-meter.meter-down {
  animation: meterPulse 340ms ease;
}

.message-text {
  min-height: 3.2rem;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--soft-blue);
  color: #224d70;
  font-size: clamp(1.22rem, 5vw, 1.55rem);
  line-height: 1.28;
  font-weight: 900;
  text-align: center;
  display: grid;
  place-items: center;
  gap: 2px;
}

.message-text.two-line {
  font-size: clamp(1.12rem, 4.7vw, 1.42rem);
  line-height: 1.2;
}

.message-text.toilet-alert {
  background: var(--soft-coral);
  color: #8a3c2d;
}

.message-line {
  display: block;
}

.screen {
  display: none;
  align-content: start;
  gap: 12px;
}

.screen.active {
  display: grid;
}

.avatar-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.avatar-choice {
  min-height: 172px;
  padding: 12px 8px;
  border: 2px solid #dfd4c8;
  background: #ffffff;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  color: var(--ink);
  font-size: 1.07rem;
  font-weight: 900;
}

.avatar-choice.selected {
  border-color: var(--green);
  background: var(--soft-green);
  color: var(--green-dark);
}

.mini-avatar {
  width: min(34vw, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, #f5caa6 0 28%, transparent 29%),
    radial-gradient(circle at 39% 34%, #24231f 0 3%, transparent 4%),
    radial-gradient(circle at 61% 34%, #24231f 0 3%, transparent 4%),
    radial-gradient(ellipse at 50% 52%, #ffffff 0 13%, transparent 14%),
    linear-gradient(180deg, #72503d 0 36%, transparent 37%),
    linear-gradient(180deg, var(--blue) 57%, #f0f5f8 58%);
  border: 5px solid #ffffff;
  box-shadow: 0 6px 16px rgba(73, 52, 33, 0.12);
}

.mini-avatar.girl {
  background:
    radial-gradient(circle at 50% 36%, #f5caa6 0 28%, transparent 29%),
    radial-gradient(circle at 39% 34%, #24231f 0 3%, transparent 4%),
    radial-gradient(circle at 61% 34%, #24231f 0 3%, transparent 4%),
    radial-gradient(ellipse at 50% 52%, #ffffff 0 13%, transparent 14%),
    linear-gradient(110deg, transparent 0 26%, #4d382f 27% 45%, transparent 46%),
    linear-gradient(250deg, transparent 0 26%, #4d382f 27% 45%, transparent 46%),
    linear-gradient(180deg, #4d382f 0 42%, transparent 43%),
    linear-gradient(180deg, var(--coral) 57%, #fff0eb 58%);
}

.mini-avatar-image {
  border-radius: 8px;
  background: #fff8ee;
  overflow: hidden;
}

.mini-avatar-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.primary-action {
  width: 100%;
  min-height: 66px;
  margin-top: 2px;
  background: var(--green);
  color: #ffffff;
  font-size: clamp(1.25rem, 5.2vw, 1.55rem);
  font-weight: 900;
  box-shadow: 0 9px 18px rgba(47, 127, 103, 0.22);
}

.primary-action.ready-toilet {
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  animation: buttonPop 420ms ease;
}

.primary-action:active,
.food-choice:active,
.step-button:active {
  transform: translateY(1px);
}

.meal-rule {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meal-rule-pill {
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid #cde0d2;
  border-radius: 8px;
  background: #f4fbf6;
  color: var(--green-dark);
  font-size: clamp(0.95rem, 4vw, 1.12rem);
  line-height: 1.15;
  font-weight: 900;
  text-align: center;
  display: grid;
  place-items: center;
  overflow-wrap: anywhere;
}

.meal-rule-pill.pain {
  border-color: #f1c3b7;
  background: #fff4f0;
  color: #8a3c2d;
}

.target-food {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.food-art.large {
  width: min(54vw, 220px);
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff8ee;
  padding: 8px;
  display: grid;
  place-items: center;
}

.food-art.large .food-image {
  padding: 16px;
}

.target-name {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
}

.food-reaction {
  min-height: 82px;
  padding: 12px;
  border: 2px solid #cde0d2;
  border-radius: 8px;
  background: linear-gradient(180deg, #f2fbf5, #fff8ee);
  color: var(--green-dark);
  display: grid;
  grid-template-columns: auto 58px minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  box-shadow: inset 0 -6px 0 rgba(47, 127, 103, 0.06);
}

.food-reaction.show {
  animation: cardPop 340ms ease;
}

.food-reaction.pain-reaction {
  position: fixed;
  left: 50%;
  top: 54%;
  z-index: 30;
  width: min(90vw, 390px);
  min-height: 112px;
  padding: 16px;
  grid-template-columns: auto 78px minmax(0, 1fr);
  gap: 6px 12px;
  border-color: #f1c3b7;
  background: linear-gradient(180deg, #fff1ec, #fff8ee);
  color: #8a3c2d;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow:
    inset 0 -6px 0 rgba(219, 115, 90, 0.08),
    0 18px 34px rgba(73, 52, 33, 0.24);
}

.food-reaction.pain-reaction.show {
  animation: painPop 340ms ease;
}

.food-reaction.pain-level-2 {
  width: min(92vw, 430px);
  min-height: 132px;
}

.food-reaction.pain-level-3 {
  width: min(94vw, 500px);
  min-height: 172px;
}

.food-reaction.pain-level-4 {
  width: min(96vw, 560px);
  min-height: 240px;
}

.food-reaction.pain-level-5 {
  top: 50%;
  width: calc(100vw - 24px);
  max-width: 760px;
  min-height: calc(100vh - 36px);
  min-height: calc(100dvh - 36px);
  align-content: center;
  border-width: 4px;
}

.reaction-badge {
  grid-row: span 2;
  min-width: 54px;
  min-height: 54px;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 8px 14px rgba(47, 127, 103, 0.18);
}

.food-reaction.pain-reaction .reaction-badge {
  min-width: 64px;
  min-height: 64px;
  font-size: 1.08rem;
  background: var(--coral);
  box-shadow: 0 8px 14px rgba(219, 115, 90, 0.18);
}

.reaction-friend-image {
  grid-row: span 2;
  width: 58px;
  height: 58px;
  padding: 7px;
  border: 2px solid #dfeadf;
  border-radius: 8px;
  background: #fff8ee;
  object-fit: contain;
  box-shadow: 0 7px 12px rgba(73, 52, 33, 0.1);
}

.food-reaction.pain-reaction .reaction-friend-image {
  width: 76px;
  height: 76px;
  padding: 8px;
  border-color: #f1c3b7;
  background: #fff7f3;
}

.food-reaction.pain-level-3 .reaction-badge,
.food-reaction.pain-level-4 .reaction-badge {
  min-width: 76px;
  min-height: 76px;
  font-size: 1.2rem;
}

.food-reaction.pain-level-3 .reaction-friend-image,
.food-reaction.pain-level-4 .reaction-friend-image {
  width: 96px;
  height: 96px;
}

.food-reaction.pain-level-5 .reaction-badge {
  min-width: 90px;
  min-height: 90px;
  font-size: 1.35rem;
}

.food-reaction.pain-level-5 .reaction-friend-image {
  width: 122px;
  height: 122px;
  padding: 10px;
}

.food-reaction strong {
  font-size: clamp(1.06rem, 4.25vw, 1.36rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.food-reaction span:last-child {
  color: #7b4e2e;
  font-size: clamp(0.96rem, 3.95vw, 1.14rem);
  line-height: 1.2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.food-reaction.pain-reaction span:last-child {
  font-size: clamp(1.03rem, 4.2vw, 1.2rem);
  line-height: 1.24;
  color: #8a3c2d;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.food-grid.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.food-choice {
  min-height: 116px;
  padding: 8px;
  border: 2px solid #e0d3c4;
  background: #ffffff;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
}

.food-choice.correct {
  border-color: var(--green);
  background: var(--soft-green);
}

.food-choice.miss {
  border-color: #e6ad61;
  background: #fff3de;
}

.food-choice .food-art {
  width: 58px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #fff8ee;
  overflow: hidden;
}

.food-choice .food-image {
  padding: 7px;
}

.food-choice span:last-child {
  color: var(--ink);
  font-size: clamp(1.1rem, 4.7vw, 1.35rem);
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.meal-toilet-action {
  background: linear-gradient(180deg, var(--coral), #b95743);
}

.toilet-road {
  position: relative;
  min-height: 232px;
  border: 2px solid #dfd4c8;
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 16%, rgba(243, 200, 87, 0.34) 0 11%, transparent 12%),
    linear-gradient(180deg, #eaf8ff 0 51%, #bfe9d0 52% 68%, #f2d6ad 69% 100%);
  overflow: hidden;
}

.toilet-road::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 74px;
  bottom: 43px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff 0 35%, #fff5c8 36% 68%, #ffffff 69% 100%);
  box-shadow:
    inset 0 -7px 0 rgba(115, 88, 55, 0.08),
    0 8px 0 rgba(115, 88, 55, 0.08);
}

.toilet-road.story-stage {
  aspect-ratio: 16 / 9;
  min-height: 248px;
  padding: 10px;
  background:
    radial-gradient(circle at 18% 10%, rgba(243, 200, 87, 0.3) 0 11%, transparent 12%),
    linear-gradient(180deg, #f6efe1 0%, #f3dfbd 100%);
}

.toilet-road.story-stage::before {
  content: none;
}

.story-card {
  position: absolute;
  inset: 10px;
  border: 3px solid rgba(255, 253, 248, 0.96);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(232, 248, 255, 0.96) 0 54%, rgba(200, 235, 206, 0.96) 55% 72%, #f4d9b4 73% 100%);
  box-shadow:
    inset 0 -9px 0 rgba(115, 88, 55, 0.06),
    0 12px 22px rgba(73, 52, 33, 0.12);
  overflow: hidden;
}

.story-card.show {
  animation: cardPop 340ms ease;
}

.toilet-going-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
}

.toilet-picture-card {
  background: #fff9ef;
}

.toilet-picture-card .sky-cloud,
.toilet-picture-card .story-friend,
.toilet-picture-card .story-runner,
.toilet-picture-card .story-ground,
.toilet-picture-card .story-door,
.toilet-picture-card .story-sparkle {
  display: none;
}

.story-number {
  position: absolute;
  left: 12px;
  top: 12px;
  min-width: 76px;
  padding: 7px 10px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--green-dark);
  font-size: 0.9rem;
  line-height: 1;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 5px 10px rgba(73, 52, 33, 0.08);
  z-index: 5;
}

.story-bubble {
  position: absolute;
  left: 55%;
  top: 14px;
  width: min(48%, 210px);
  min-height: 48px;
  padding: 9px 12px;
  border: 2px solid #eadbc9;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.98);
  color: #7b4e2e;
  font-size: clamp(1rem, 4vw, 1.25rem);
  line-height: 1.18;
  font-weight: 900;
  text-align: center;
  display: grid;
  place-items: center;
  overflow-wrap: anywhere;
  box-shadow: 0 7px 14px rgba(73, 52, 33, 0.12);
  transform: translateX(-50%);
  z-index: 5;
}

.story-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 2px solid #eadbc9;
  border-bottom: 2px solid #eadbc9;
  background: rgba(255, 253, 248, 0.98);
  transform: translateX(-50%) rotate(45deg);
}

.story-friend {
  position: absolute;
  left: 58%;
  top: 78px;
  width: 92px;
  height: 92px;
  transform: translateX(-50%);
  transition:
    opacity 180ms ease,
    transform 220ms ease;
  z-index: 4;
}

.story-friend-image {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 12px;
  border-radius: 18px;
  background: #fff8ee;
  display: block;
  object-fit: contain;
  box-shadow: 0 8px 16px rgba(73, 52, 33, 0.12);
}

.story-friend.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(12px) scale(0.82);
}

.story-card.scene-1 .story-friend {
  left: 56%;
}

.story-card.scene-2 .story-friend {
  left: 60%;
  top: 82px;
}

.story-card.scene-3 .story-friend {
  left: 54%;
  top: 80px;
}

.story-card.scene-4 .story-friend {
  left: 60%;
  top: 82px;
}

.story-card.scene-5 .story-friend {
  left: 56%;
  top: 78px;
}

.story-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0 48px, transparent 48px 62px) 0 14px / 84px 12px repeat-x,
    linear-gradient(180deg, rgba(255, 244, 209, 0.92), #f2d2a7);
  box-shadow: inset 0 9px 0 rgba(115, 88, 55, 0.05);
  z-index: 1;
}

.story-door {
  position: absolute;
  right: 16px;
  bottom: 22px;
  width: 62px;
  height: 78px;
  border: 4px solid rgba(255, 255, 255, 0.94);
  border-radius: 32px 32px 10px 10px;
  background: linear-gradient(180deg, #fffdf8 0%, #e8f2fa 100%);
  box-shadow:
    0 10px 18px rgba(73, 52, 33, 0.12),
    inset 0 -5px 0 rgba(115, 88, 55, 0.08);
  z-index: 3;
}

.story-door::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 17px;
  width: 34px;
  height: 42px;
  border-radius: 20px 20px 6px 6px;
  background: #d6ecf7;
  box-shadow: inset 0 -5px 0 rgba(115, 168, 214, 0.2);
}

.story-door span::after {
  content: "★";
  position: absolute;
  left: 50%;
  top: 29px;
  color: var(--yellow);
  font-size: 1.25rem;
  font-weight: 900;
  text-shadow: 0 2px 0 #ffffff;
  transform: translateX(-50%);
}

.story-sparkle {
  position: absolute;
  color: var(--yellow);
  font-size: 2rem;
  font-weight: 900;
  opacity: 0.42;
  text-shadow: 0 2px 0 #ffffff;
  transition:
    opacity 180ms ease,
    transform 220ms ease;
  z-index: 2;
}

.sparkle-one {
  left: 28%;
  top: 58px;
}

.sparkle-two {
  right: 28%;
  top: 60px;
  color: #8cc7ac;
}

.sparkle-three {
  right: 92px;
  bottom: 96px;
  color: #f29d82;
}

.sparkle-four {
  left: 35%;
  bottom: 82px;
  color: #73a8d6;
}

.sparkle-five {
  right: 24%;
  bottom: 86px;
  color: #f4c65b;
}

.story-stage.step-1 .sparkle-one,
.story-stage.step-2 .sparkle-two,
.story-stage.step-3 .sparkle-three,
.story-stage.step-4 .sparkle-four,
.story-stage.step-5 .sparkle-five {
  opacity: 1;
  transform: translateY(-8px) scale(1.18) rotate(10deg);
}

.sky-cloud {
  position: absolute;
  width: 58px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    14px -9px 0 2px rgba(255, 255, 255, 0.92),
    30px -2px 0 rgba(255, 255, 255, 0.92);
}

.cloud-one {
  top: 24px;
  left: 18px;
}

.cloud-two {
  top: 42px;
  right: 96px;
  transform: scale(0.82);
}

.friend-slot {
  position: absolute;
  width: 46px;
  height: 46px;
  z-index: 2;
  opacity: 0.72;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.friend-slot.met {
  opacity: 1;
  transform: translateY(-4px) scale(1.04);
}

.friend-one {
  left: 18%;
  bottom: 108px;
}

.friend-two {
  left: 45%;
  bottom: 110px;
}

.friend-three {
  right: 86px;
  bottom: 104px;
}

.friend-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  min-width: 46px;
  max-width: 104px;
  padding: 5px 8px;
  border: 2px solid #eadbc9;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  color: #7b4e2e;
  font-size: 0.72rem;
  line-height: 1.08;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 5px 10px rgba(73, 52, 33, 0.1);
  transform: translateX(-50%);
}

.friend-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 2px solid #eadbc9;
  border-bottom: 2px solid #eadbc9;
  background: rgba(255, 253, 248, 0.96);
  transform: translateX(-50%) rotate(45deg);
}

.friend-shape {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 42%, #333029 0 5%, transparent 6%),
    radial-gradient(circle at 64% 42%, #333029 0 5%, transparent 6%),
    radial-gradient(ellipse at 50% 62%, #ffffff 0 11%, transparent 12%),
    #8cc7ac;
  box-shadow: 0 7px 0 rgba(73, 52, 33, 0.09);
}

.friend-shape::before,
.friend-shape::after {
  content: "";
  position: absolute;
}

.friend-bug .friend-shape {
  height: 34px;
  top: 8px;
  background:
    radial-gradient(circle at 32% 44%, #ffffff 0 8%, transparent 9%),
    radial-gradient(circle at 68% 44%, #ffffff 0 8%, transparent 9%),
    #8cc7ac;
  box-shadow:
    -13px 6px 0 -3px #f29d82,
    13px 6px 0 -3px #f29d82,
    0 7px 0 rgba(73, 52, 33, 0.09);
}

.friend-bug .friend-shape::before,
.friend-bug .friend-shape::after {
  top: -8px;
  width: 14px;
  height: 14px;
  border-top: 3px solid #5f9e68;
  border-radius: 50%;
}

.friend-bug .friend-shape::before {
  left: 8px;
  transform: rotate(-28deg);
}

.friend-bug .friend-shape::after {
  right: 8px;
  transform: rotate(28deg);
}

.friend-bee .friend-shape {
  height: 34px;
  top: 8px;
  background:
    radial-gradient(circle at 33% 44%, #333029 0 5%, transparent 6%),
    radial-gradient(circle at 64% 44%, #333029 0 5%, transparent 6%),
    repeating-linear-gradient(90deg, #f4c65b 0 10px, #7b4e2e 10px 15px);
  box-shadow:
    -14px -2px 0 -4px rgba(255, 255, 255, 0.86),
    14px -2px 0 -4px rgba(255, 255, 255, 0.86),
    0 7px 0 rgba(73, 52, 33, 0.09);
}

.friend-butterfly .friend-shape {
  background:
    radial-gradient(circle at 50% 52%, #7b4e2e 0 10%, transparent 11%),
    radial-gradient(circle at 24% 42%, #f29d82 0 24%, transparent 25%),
    radial-gradient(circle at 76% 42%, #73a8d6 0 24%, transparent 25%),
    radial-gradient(circle at 30% 70%, #f3c857 0 20%, transparent 21%),
    radial-gradient(circle at 70% 70%, #8cc7ac 0 20%, transparent 21%);
}

.friend-rabbit .friend-shape {
  background:
    radial-gradient(circle at 36% 43%, #333029 0 5%, transparent 6%),
    radial-gradient(circle at 64% 43%, #333029 0 5%, transparent 6%),
    radial-gradient(ellipse at 50% 60%, #ef9a86 0 10%, transparent 11%),
    #ffffff;
}

.friend-rabbit .friend-shape::before,
.friend-rabbit .friend-shape::after {
  top: -23px;
  width: 14px;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 -10px 0 #f8d6ca;
}

.friend-rabbit .friend-shape::before {
  left: 9px;
  transform: rotate(-12deg);
}

.friend-rabbit .friend-shape::after {
  right: 9px;
  transform: rotate(12deg);
}

.friend-cat .friend-shape {
  background:
    radial-gradient(circle at 36% 43%, #333029 0 5%, transparent 6%),
    radial-gradient(circle at 64% 43%, #333029 0 5%, transparent 6%),
    radial-gradient(ellipse at 50% 62%, #ffffff 0 10%, transparent 11%),
    #ee8b43;
}

.friend-cat .friend-shape::before,
.friend-cat .friend-shape::after {
  top: -9px;
  width: 18px;
  height: 18px;
  background: #ee8b43;
  transform: rotate(45deg);
}

.friend-cat .friend-shape::before {
  left: 4px;
}

.friend-cat .friend-shape::after {
  right: 4px;
}

.friend-dog .friend-shape {
  background:
    radial-gradient(circle at 36% 43%, #333029 0 5%, transparent 6%),
    radial-gradient(circle at 64% 43%, #333029 0 5%, transparent 6%),
    radial-gradient(ellipse at 50% 62%, #f5caa6 0 14%, transparent 15%),
    #a77842;
}

.friend-dog .friend-shape::before,
.friend-dog .friend-shape::after {
  top: 3px;
  width: 16px;
  height: 28px;
  border-radius: 999px;
  background: #7b4e2e;
}

.friend-dog .friend-shape::before {
  left: -8px;
  transform: rotate(18deg);
}

.friend-dog .friend-shape::after {
  right: -8px;
  transform: rotate(-18deg);
}

.friend-bird .friend-shape {
  background:
    radial-gradient(circle at 38% 42%, #333029 0 5%, transparent 6%),
    radial-gradient(circle at 62% 42%, #333029 0 5%, transparent 6%),
    #73a8d6;
}

.friend-bird .friend-shape::before {
  left: 18px;
  top: 22px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #f3c857;
}

.friend-flower .friend-shape {
  background:
    radial-gradient(circle at 50% 50%, #f3c857 0 16%, transparent 17%),
    radial-gradient(circle at 50% 18%, #f29d82 0 18%, transparent 19%),
    radial-gradient(circle at 50% 82%, #f29d82 0 18%, transparent 19%),
    radial-gradient(circle at 18% 50%, #f29d82 0 18%, transparent 19%),
    radial-gradient(circle at 82% 50%, #f29d82 0 18%, transparent 19%);
  box-shadow: 0 9px 0 -5px #5f9e68;
}

.friend-star .friend-shape {
  background: transparent;
  box-shadow: none;
}

.friend-star .friend-shape::after {
  content: "★";
  inset: -4px;
  color: var(--yellow);
  display: grid;
  place-items: center;
  font-size: 3.1rem;
  text-shadow: 0 3px 0 #ffffff;
}

.friend-mama .friend-shape,
.friend-papa .friend-shape,
.friend-grandma .friend-shape,
.friend-grandpa .friend-shape {
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #f4c65b 0 34%, #db735a 35% 100%);
}

.friend-papa .friend-shape,
.friend-grandpa .friend-shape {
  background: linear-gradient(180deg, #73a8d6 0 34%, #2f7f67 35% 100%);
}

.friend-grandma .friend-shape {
  background: linear-gradient(180deg, #f8d6ca 0 34%, #db735a 35% 100%);
}

.friend-mama .friend-shape::before,
.friend-papa .friend-shape::before,
.friend-grandma .friend-shape::before,
.friend-grandpa .friend-shape::before {
  left: 50%;
  top: -18px;
  width: 42px;
  height: 42px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 44%, #333029 0 5%, transparent 6%),
    radial-gradient(circle at 64% 44%, #333029 0 5%, transparent 6%),
    radial-gradient(ellipse at 50% 63%, #ffffff 0 12%, transparent 13%),
    linear-gradient(180deg, #684833 0 27%, transparent 28%),
    #f3c09a;
  transform: translateX(-50%);
}

.friend-grandma .friend-shape::before,
.friend-grandpa .friend-shape::before {
  background:
    radial-gradient(circle at 36% 44%, #333029 0 5%, transparent 6%),
    radial-gradient(circle at 64% 44%, #333029 0 5%, transparent 6%),
    radial-gradient(ellipse at 50% 63%, #ffffff 0 12%, transparent 13%),
    linear-gradient(180deg, #ddd6ca 0 32%, transparent 33%),
    #f3c09a;
}

.runner {
  position: absolute;
  left: 16px;
  bottom: 54px;
  width: 74px;
  height: 102px;
  transition: left 280ms ease;
  z-index: 3;
}

.story-runner {
  bottom: 22px;
  width: 68px;
  height: 88px;
  z-index: 4;
}

.runner.jumping {
  animation: smallJump 320ms ease;
}

.runner svg,
.runner img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.road-line {
  position: absolute;
  left: 28px;
  right: 86px;
  bottom: 68px;
  height: 7px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #66b89a 0 18px, transparent 18px 30px);
}

.road-star {
  position: absolute;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--yellow);
  font-size: 2.35rem;
  font-weight: 900;
  text-shadow: 0 2px 0 #ffffff;
  transition:
    transform 220ms ease,
    opacity 220ms ease;
  z-index: 2;
}

.road-star.collected {
  opacity: 0.35;
  transform: translateY(-12px) scale(1.22) rotate(14deg);
}

.star-one {
  left: 24%;
  top: 58px;
}

.star-two {
  left: 51%;
  top: 48px;
}

.star-three {
  right: 80px;
  top: 48px;
}

.jump-pad {
  position: absolute;
  bottom: 50px;
  width: 46px;
  height: 46px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.8) 0 10%, transparent 11%),
    #f4c65b;
  box-shadow: 0 8px 0 rgba(113, 82, 52, 0.14);
  color: #7d452d;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 900;
  transition:
    transform 220ms ease,
    background 220ms ease,
    color 220ms ease;
  z-index: 1;
}

.jump-pad.cleared {
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.8) 0 10%, transparent 11%),
    var(--green);
  color: #ffffff;
  transform: translateY(-6px) scale(1.06);
}

.pad-one {
  left: 27%;
}

.pad-two {
  left: 49%;
}

.pad-three {
  right: 84px;
}

.finish-ring {
  position: absolute;
  right: 24px;
  bottom: 118px;
  width: 48px;
  height: 48px;
  border: 5px solid rgba(243, 200, 87, 0.82);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.74);
  box-shadow:
    0 0 0 9px rgba(243, 200, 87, 0.22),
    0 8px 18px rgba(73, 52, 33, 0.12);
  animation: targetPulse 1200ms ease-in-out infinite;
}

.finish-ring::after {
  content: "★";
  position: absolute;
  inset: 0;
  color: var(--yellow);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  text-shadow: 0 2px 0 #ffffff;
}

.door-destination {
  position: absolute;
  right: 14px;
  bottom: 40px;
  width: 64px;
  height: 78px;
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 32px 32px 10px 10px;
  background:
    linear-gradient(180deg, #fffdf8 0%, #e8f2fa 100%);
  box-shadow:
    0 10px 18px rgba(73, 52, 33, 0.1),
    inset 0 -5px 0 rgba(115, 88, 55, 0.08);
}

.door-destination::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 17px;
  width: 34px;
  height: 42px;
  border-radius: 20px 20px 6px 6px;
  background: #d6ecf7;
  box-shadow: inset 0 -5px 0 rgba(115, 168, 214, 0.2);
}

.door-destination span::after {
  content: "★";
  position: absolute;
  left: 50%;
  top: 28px;
  color: var(--yellow);
  font-size: 1.25rem;
  font-weight: 900;
  text-shadow: 0 2px 0 #ffffff;
  transform: translateX(-50%);
}

.step-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.step-hint {
  margin: 0;
  padding: 8px 10px;
  border: 2px solid #eadbc9;
  border-radius: 8px;
  background: #fff7dc;
  color: var(--green-dark);
  text-align: center;
  font-size: clamp(1rem, 4.2vw, 1.16rem);
  font-weight: 900;
  line-height: 1.35;
}

.step-button {
  min-height: 64px;
  padding: 4px 3px;
  background: linear-gradient(180deg, #fff7dc, #fae8e0);
  color: #7b4e2e;
  font-size: clamp(0.84rem, 3.45vw, 1.08rem);
  line-height: 1.12;
  font-weight: 900;
  box-shadow: inset 0 -5px 0 rgba(123, 78, 46, 0.08);
  overflow-wrap: anywhere;
}

.step-button.done {
  background: var(--green);
  color: #ffffff;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.1);
}

.done-scene {
  position: relative;
  height: clamp(218px, 58vw, 360px);
  border: 2px solid #dfd4c8;
  border-radius: 8px;
  background: #fff9ef;
  overflow: hidden;
  box-shadow: inset 0 -10px 0 rgba(115, 88, 55, 0.05);
}

.success-illustration {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
}

.success-illustration.show {
  animation: successArrive 520ms ease;
}

.done-confetti {
  position: absolute;
  display: grid;
  place-items: center;
  color: var(--yellow);
  font-weight: 900;
  text-shadow: 0 2px 0 #ffffff;
  pointer-events: none;
  animation: sparklePop 980ms ease-in-out infinite;
}

.confetti-one {
  left: 18px;
  top: 14px;
  font-size: 2.1rem;
}

.confetti-two {
  right: 18px;
  top: 20px;
  color: #8cc7ac;
  font-size: 1.7rem;
  animation-delay: 160ms;
}

.confetti-three {
  right: 24px;
  bottom: 16px;
  color: #f29d82;
  font-size: 1.35rem;
  animation-delay: 260ms;
}

.done-copy {
  color: var(--green-dark);
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}

.done-subcopy {
  color: #7b4e2e;
  font-size: clamp(1.08rem, 4.4vw, 1.32rem);
  line-height: 1.32;
  font-weight: 900;
  text-align: center;
}

.secondary-action {
  width: 100%;
  min-height: 60px;
  border: 2px solid var(--green);
  background: #ffffff;
  color: var(--green-dark);
  font-size: clamp(1.08rem, 4.7vw, 1.32rem);
  font-weight: 900;
  box-shadow: 0 7px 16px rgba(47, 127, 103, 0.1);
}

.intro-copy,
.feeling-reply,
.exercise-guide,
.safety-copy {
  line-height: 1.55;
  text-align: center;
}

.intro-copy {
  color: #493e35;
  font-size: clamp(1.08rem, 4.4vw, 1.3rem);
  font-weight: 800;
}

.intro-copy.soft {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff6dc;
  color: #78572c;
}

.onaka-letter-art {
  width: min(76vw, 360px);
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  border: 2px solid #d7e8dc;
  border-radius: 8px;
  background: #fff8e8;
  overflow: hidden;
}

.support-illustration {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.feeling-buttons,
.finish-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.feeling-buttons button,
.finish-buttons button {
  min-width: 0;
  padding: 8px;
  border: 2px solid #d9cec1;
  background: #ffffff;
  color: #51483f;
  font-size: clamp(0.92rem, 3.8vw, 1.05rem);
  line-height: 1.3;
  font-weight: 900;
}

.feeling-buttons button.selected,
.finish-buttons button.selected {
  border-color: var(--green);
  background: var(--soft-green);
  color: var(--green-dark);
}

.feeling-reply {
  min-height: 3.2em;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: #285574;
  font-size: 1rem;
  font-weight: 800;
}

.intro-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.meal-rule-pill.neutral {
  border-color: #dbd4e8;
  background: #f6f2fb;
  color: #67527c;
}

.exercise-progress {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
}

.exercise-art {
  --exercise-duration: 3000ms;
  width: min(76vw, 380px);
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  border: 2px solid #d4e6dc;
  border-radius: 8px;
  background: #fff8e8;
  overflow: hidden;
}

.exercise-art.moving .support-illustration {
  transform-origin: center center;
}

.exercise-art.is-balloon.moving .support-illustration {
  animation: illustrationBreath var(--exercise-duration) ease-in-out;
}

.exercise-art.is-boat.moving .support-illustration {
  animation: illustrationRock var(--exercise-duration) ease-in-out;
}

.exercise-art.is-wind.moving .support-illustration {
  animation: illustrationWind var(--exercise-duration) ease-out;
}

.exercise-guide {
  color: #403932;
  font-size: clamp(1.08rem, 4.5vw, 1.28rem);
  font-weight: 800;
}

.safety-copy {
  padding: 8px 10px;
  border: 1px solid #edc5b8;
  border-radius: 8px;
  background: #fff6f2;
  color: #814b3d;
  font-size: 0.95rem;
  font-weight: 800;
}

.exercise-count {
  color: var(--green-dark);
  font-size: 1.3rem;
  font-weight: 900;
  text-align: center;
}

.posture-art {
  width: min(76vw, 380px);
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  border: 2px solid #d4e6dc;
  border-radius: 8px;
  background: #fff8e8;
  overflow: hidden;
}

.posture-list {
  margin: 0;
  padding: 12px 14px 12px 36px;
  border-radius: 8px;
  background: #f3f8f5;
  color: #35483d;
  font-size: clamp(1rem, 4.2vw, 1.18rem);
  line-height: 1.65;
  font-weight: 800;
}

.guardian-safety {
  margin: 0 12px 12px;
  padding: 11px 12px;
  border: 1px solid #e3d4c5;
  border-radius: 8px;
  background: #fffaf2;
  color: #51483f;
  font-size: 0.9rem;
  line-height: 1.55;
}

.guardian-safety p + p {
  margin-top: 7px;
}

@keyframes illustrationBreath {
  0%, 100% {
    transform: scale(1);
  }

  52% {
    transform: scale(1.035);
  }
}

@keyframes illustrationRock {
  0%, 100% {
    transform: rotate(-1.2deg) scale(1.015);
  }

  50% {
    transform: rotate(1.2deg) scale(1.015);
  }
}

@keyframes illustrationWind {
  from {
    transform: translateX(-4px) scale(1.015);
  }

  to {
    transform: translateX(4px) scale(1.015);
  }
}

.guardian-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 8px 18px rgba(73, 52, 33, 0.08);
}

summary {
  min-height: 50px;
  padding: 13px 14px;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.settings-grid {
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented.phrase {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.setting-button {
  min-height: 50px;
  border: 1px solid #d9cec1;
  background: #f5f1ea;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
}

.setting-button.selected {
  border-color: var(--green);
  background: var(--soft-green);
  color: var(--green-dark);
}

.avatar-eating {
  animation: nod 320ms ease 2;
}

.avatar-alert {
  animation: bounce 420ms ease 2;
}

@keyframes nod {
  50% {
    transform: translateY(4px) rotate(1deg);
  }
}

@keyframes bounce {
  40% {
    transform: translateY(-8px);
  }
}

@keyframes meterPulse {
  35% {
    transform: scaleX(0.97);
    border-color: #e6ad61;
  }
}

@keyframes cardPop {
  0% {
    opacity: 0.45;
    transform: translateY(8px) scale(0.97);
  }

  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes painPop {
  0% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.9);
  }

  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.03);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes buttonPop {
  0% {
    transform: translateY(8px) scale(0.98);
  }

  70% {
    transform: translateY(-2px) scale(1.01);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes smallJump {
  45% {
    transform: translateY(-18px);
  }
}

@keyframes sparklePop {
  45% {
    transform: translateY(-8px) scale(1.25);
  }
}

@keyframes successArrive {
  0% {
    opacity: 0.2;
    transform: scale(0.94);
  }

  70% {
    opacity: 1;
    transform: scale(1.02);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes targetPulse {
  45% {
    transform: scale(1.08);
    box-shadow:
      0 0 0 13px rgba(243, 200, 87, 0.16),
      0 8px 18px rgba(73, 52, 33, 0.12);
  }
}

@media (min-width: 760px) {
  .app-shell {
    width: min(820px, calc(100% - 40px));
    padding-top: 22px;
    gap: 14px;
  }

  .stage {
    padding: 18px;
    gap: 14px;
  }

  .avatar-zone {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .avatar-wrap {
    width: 132px;
  }

  .food-choice {
    min-height: 130px;
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .food-choice .food-art {
    width: 76px;
  }

  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .stage {
    gap: 8px;
    padding: 10px;
  }

  .avatar-zone {
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 8px;
  }

  .avatar-wrap {
    width: 94px;
  }

  .message-text {
    min-height: 2.9rem;
    padding: 8px 10px;
  }

  .screen {
    gap: 10px;
  }

  .food-art.large {
    width: min(46vw, 180px);
  }

  .food-choice {
    min-height: 104px;
  }

  .food-reaction {
    grid-template-columns: auto 50px minmax(0, 1fr);
    gap: 4px 8px;
  }

  .reaction-friend-image {
    width: 50px;
    height: 50px;
    padding: 5px;
  }

  .meal-rule {
    gap: 6px;
  }

  .meal-rule-pill {
    min-height: 42px;
    padding: 7px 8px;
  }

  .toilet-road.story-stage {
    min-height: 226px;
  }

  .story-card {
    inset: 8px;
  }

  .story-number {
    left: 9px;
    top: 9px;
    min-width: 68px;
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .story-bubble {
    top: 10px;
    left: 58%;
    width: min(52%, 178px);
    min-height: 44px;
    padding: 8px 10px;
  }

  .story-friend {
    top: 78px;
    width: 76px;
    height: 76px;
  }

  .story-friend-image {
    padding: 10px;
  }

  .story-runner {
    width: 60px;
    height: 78px;
  }

  .story-door {
    right: 10px;
    width: 56px;
    height: 72px;
  }

  .done-scene {
    height: clamp(206px, 60vw, 260px);
  }

  .feeling-buttons,
  .finish-buttons,
  .intro-actions {
    grid-template-columns: 1fr;
  }

  .feeling-buttons button,
  .finish-buttons button {
    min-height: 50px;
  }

  .onaka-letter-art,
  .exercise-art,
  .posture-art {
    width: min(84vw, 360px);
  }
}

@media (max-width: 370px) {
  .app-shell {
    width: min(620px, calc(100% - 16px));
  }

  .avatar-zone {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .avatar-wrap {
    width: 88px;
  }

  .food-choice {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .food-choice .food-art {
    width: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
