:root {
  color-scheme: light;

  --color-primary: #F28C28;
  --color-soft: #FFE3C2;
  --color-heart: #E5708F;
  --color-heart-line: #B23A5E;
  --color-deep: #B84F00;
  --color-bg: #FBF6EE;
  --color-ink: #3B2F28;
  --color-ok: #2F7D4F;
  --color-white: #FFFFFF;
  --color-transparent: transparent;
  --color-scrim: rgba(59, 47, 40, 0.56);
  --color-shadow: rgba(59, 47, 40, 0.14);
  --color-room-shadow: rgba(59, 47, 40, 0.10);
  --color-shadow-strong: rgba(59, 47, 40, 0.22);
  --color-quiz-glow: rgba(242, 140, 40, 0.45);
  --color-disabled: rgba(59, 47, 40, 0.52);
  --color-night: rgba(70, 80, 140, 0.26);
  --color-night-ink: #6F7BB8;
  /* 指示書10の承認見本の札の色。新しい用途に限り使う。 */
  --color-sent-bg: #FFF8EC;
  --color-sent-muted: #F4EEE6;
  --color-sent-stitch: #9C8676;

  --radius-control: 18px;
  --radius-card: 28px;
  --radius-round: 999px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;

  --page-max: 760px;
  --line: 2px;
  --focus-line: 4px;
  --z-base: 1;
  --z-raised: 10;
  --z-overlay: 100;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-inline-size: 320px;
  margin: 0;
  background: var(--color-bg);
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  min-inline-size: 320px;
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  font-size: 24px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.opening-active {
  min-block-size: 100svh;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button,
[role="button"],
input,
textarea,
a {
  -webkit-tap-highlight-color: var(--color-transparent);
}

button {
  appearance: none;
}

img,
svg,
canvas,
iframe {
  display: block;
  max-inline-size: 100%;
}

p {
  margin-block: 0;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

::selection {
  background: var(--color-soft);
  color: var(--color-ink);
}

#app {
  display: flex;
  inline-size: 100%;
  max-inline-size: var(--page-max);
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin-inline: auto;
  padding-block-start: calc(var(--space-2) + env(safe-area-inset-top));
  padding-inline-end: calc(var(--space-2) + env(safe-area-inset-right));
  padding-block-end: calc(var(--space-3) + env(safe-area-inset-bottom));
  padding-inline-start: calc(var(--space-2) + env(safe-area-inset-left));
}

body.opening-active #app {
  max-inline-size: none;
  padding: 0;
}

.screen {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-3);
  inline-size: 100%;
  min-inline-size: 0;
  margin-inline: auto;
}

.screen--center {
  justify-content: center;
  text-align: center;
}

.screen--with-back {
  position: relative;
  padding-block-start: 64px;
}

.screen--with-back > .text-link--back {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
}

.screen-title--center {
  text-align: center;
}

.screen-head {
  display: grid;
  gap: var(--space-1);
  inline-size: 100%;
  text-align: center;
}

h1,
h2 {
  margin: 0;
  color: var(--color-deep);
  font-size: clamp(32px, 28px + 1.2vw, 42px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.result-title--correct {
  color: var(--color-ok);
}

.ph {
  display: inline-block;
}

.ph--protected {
  max-inline-size: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.phrase {
  display: inline;
}

h1 > .phrase,
h2 > .phrase,
.lead > .phrase,
.bubble > .phrase,
.hint-card > .phrase,
.delivery-note > .phrase,
.select-card__label > .phrase {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
}

.lead {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  text-wrap: pretty;
}

.body-copy {
  margin: 0;
  font-size: 24px;
  line-height: 1.7;
  text-wrap: pretty;
}

.note {
  margin: 0;
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  text-wrap: pretty;
}

.error {
  margin: 0;
  color: var(--color-deep);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

.bubble {
  inline-size: min(100%, 620px);
  margin-inline: auto;
  padding: var(--space-2) var(--space-3);
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-soft);
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  text-wrap: balance;
}

.dog-stage-shell {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  inline-size: 100%;
  min-inline-size: 0;
}

.dog-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  inline-size: min(100%, 520px);
  aspect-ratio: 6 / 5;
  margin-inline: auto;
  touch-action: manipulation;
}

.dog-stage--compact {
  inline-size: min(82%, 360px);
  aspect-ratio: 1 / 1;
}

.dog-stage--mini {
  inline-size: min(62%, 280px);
  aspect-ratio: 1 / 1;
}

.dog-stage--overlay {
  inline-size: min(72%, 300px);
  aspect-ratio: 1 / 1;
}

.dog-stage--pet {
  inline-size: min(100%, 560px);
}

.dog-stage--ball {
  inline-size: min(58%, 260px);
  aspect-ratio: 1 / 1;
}

#nameDog,
#guideDog {
  inline-size: min(92%, 420px);
}

#welcomeDog,
#confirmDog,
#finishDog {
  inline-size: min(100%, 540px);
  aspect-ratio: 1 / 1;
}

#homeDog {
  inline-size: min(100%, 532px);
  aspect-ratio: 1 / 1;
}

#settingsDog {
  inline-size: min(76%, 340px);
}

.dog-stage > canvas {
  z-index: var(--z-base);
}

.dog-loading,
.dog-fallback {
  position: absolute;
  inset: 0;
  z-index: var(--z-raised);
  display: grid;
  place-items: center;
  inline-size: 100%;
  padding: var(--space-2);
  text-align: center;
}

.dog-loading {
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  animation: dog-loading-in .4s ease-out .6s both;   /* すぐ犬が出るときは何も見えない */
}
.dog-loading__paws { display: flex; gap: 12px; }
.dog-loading__paws svg { inline-size: 40px; block-size: 40px; fill: var(--color-heart); opacity: .25; animation: dog-loading-step 1.5s ease-in-out infinite; }
.dog-loading__paws svg:nth-child(2) { animation-delay: .3s; }
.dog-loading__paws svg:nth-child(3) { animation-delay: .6s; }
@keyframes dog-loading-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dog-loading-step { 0%, 100% { opacity: .25; transform: translateY(0) scale(.9); } 35% { opacity: 1; transform: translateY(-6px) scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .dog-loading__paws svg { animation: none; opacity: .6; } }

.dog-message {
  inline-size: min(100%, 620px);
  margin-inline: auto;
  padding: var(--space-2) var(--space-3);
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-soft);
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  text-wrap: balance;
}

.dog-fallback img,
img.dog-fallback {
  inline-size: auto;
  max-inline-size: 100%;
  max-block-size: 100%;
  margin: auto;
  object-fit: contain;
}

img.dog-fallback {
  position: relative;
  inset: auto;
  display: block;
  block-size: 100%;
  padding: 0;
  transform: scale(var(--dog-scale, 1));
  transform-origin: center bottom;
}

.dog-fallback.action-idle {
  animation: dog-idle 2.8s ease-in-out infinite;
}

.dog-fallback.action-wag,
.dog-fallback.is-happy {
  animation: dog-happy 1050ms ease-out 2;
}

.dog-fallback.action-tilt {
  animation: dog-tilt 1.4s ease-out 1;
}

.dog-fallback.action-bow {
  animation: dog-bow 1.8s ease-out 1;
}

.dog-fallback.action-otete {
  animation: dog-otete 1.4s ease-out 1;
}

.dog-fallback.action-turn {
  animation: dog-turn 1.8s ease-in-out 1;
  backface-visibility: visible;
}

.dog-fallback.action-paw,
.dog-fallback.action-kari {
  animation: dog-paw 1.2s ease-out 1;
}

.dog-fallback.action-sleep {
  animation: dog-sleep 3.6s ease-in-out infinite;
}

.pet-heart {
  position: absolute;
  z-index: var(--z-raised);
  color: var(--color-heart);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  animation: pet-heart-float 1.1s ease-out forwards;
}

@keyframes dog-idle {
  0%,
  100% { transform: scale(var(--dog-scale, 1)) translateY(0); }
  50% { transform: scale(var(--dog-scale, 1)) translateY(-1.5%); }
}

@keyframes dog-happy {
  0%,
  100% { transform: scale(var(--dog-scale, 1)) translateY(0) rotate(0); }
  50% { transform: scale(var(--dog-scale, 1)) translateY(-5%) rotate(1deg); }
}

@keyframes dog-tilt {
  0%,
  100% { transform: scale(var(--dog-scale, 1)) rotate(0); }
  45%,
  70% { transform: scale(var(--dog-scale, 1)) rotate(-5deg); }
}

@keyframes dog-bow {
  0%,
  100% { transform: scale(var(--dog-scale, 1)) translateY(0); }
  45%,
  70% { transform: scale(var(--dog-scale, 1)) translateY(3%); }
}

@keyframes dog-otete {
  0%,
  100% { transform: scale(var(--dog-scale, 1)) translateX(0); }
  45%,
  70% { transform: scale(var(--dog-scale, 1)) translateX(2%); }
}

@keyframes dog-turn {
  0% { transform: scale(var(--dog-scale, 1)) translateY(0) rotateY(0); }
  50% { transform: scale(var(--dog-scale, 1)) translateY(-6%) rotateY(180deg); }
  100% { transform: scale(var(--dog-scale, 1)) translateY(0) rotateY(360deg); }
}

@keyframes dog-paw {
  0%,
  100% { transform: scale(var(--dog-scale, 1)) rotate(0); }
  35% { transform: scale(var(--dog-scale, 1)) rotate(-2deg); }
  65% { transform: scale(var(--dog-scale, 1)) rotate(2deg); }
}

@keyframes dog-sleep {
  0%,
  100% { transform: scale(var(--dog-scale, 1)); }
  50% { transform: scale(var(--dog-scale, 1)) translateY(1%); }
}

@keyframes pet-heart-float {
  to {
    opacity: 0;
    transform: translateY(-110px);
  }
}

.dog-actions,
.dog-stage-actions,
.dog-action-list {
  display: grid;
  gap: var(--space-2);
  inline-size: 100%;
}

.dog-action,
.dog-stage-action {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
  min-block-size: 80px;
  padding: 12px var(--space-2);
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-control);
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
}

.dog-action--quiet {
  border-color: var(--color-soft);
  background: var(--color-white);
}

.mainichi-dog-heart {
  z-index: var(--z-raised);
  color: var(--color-heart);
  pointer-events: none;
}

.logo {
  inline-size: min(88%, 620px);
  block-size: auto;
  margin-inline: auto;
}

.actions,
.home-actions {
  display: grid;
  gap: var(--space-2);
  inline-size: min(100%, 680px);
  margin-inline: auto;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
  min-block-size: 80px;
  margin: 0;
  padding: 12px var(--space-2);
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-control);
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease-out;
}

.btn--primary {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-ink);
}

.btn--secondary,
.btn--quiet {
  border-color: var(--color-soft);
  background: var(--color-white);
  color: var(--color-ink);
}

.btn--quiet {
  text-decoration: underline;
  text-decoration-thickness: var(--line);
  text-underline-offset: 0.2em;
}

.btn:active,
.help-chip:active,
.dog-action:active,
.dog-stage-action:active,
.breed-card:active,
.choice-card:active,
.family-card:active {
  transform: scale(0.98);
}

.btn:disabled,
.dog-action:disabled,
.dog-stage-action:disabled,
.breed-card:disabled,
.choice-card:disabled,
.family-card:disabled {
  border-color: var(--color-primary);
  background: var(--color-soft);
  color: var(--color-ink);
  cursor: default;
  opacity: 1;
  transform: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 48px;
  min-block-size: 48px;
  padding: var(--space-1);
  border: 0;
  background: var(--color-transparent);
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: var(--line);
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.text-link--back {
  align-self: flex-start;
}

.field {
  display: grid;
  gap: var(--space-1);
  inline-size: 100%;
}

.field-label {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.5;
  text-align: start;
  text-wrap: pretty;
}

input,
textarea {
  inline-size: 100%;
  min-block-size: 80px;
  padding: 14px var(--space-2);
  border: var(--line) solid var(--color-ink);
  border-radius: var(--radius-control);
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 28px;
  line-height: 1.4;
  -webkit-user-select: text;
  user-select: text;
}

textarea {
  min-block-size: 160px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-ink);
  opacity: 0.72;
}

.progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-block-size: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-dots > * {
  inline-size: 16px;
  block-size: 16px;
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-round);
  background: var(--color-white);
}

.progress-dots > .is-active,
.progress-dots > .is-current,
.progress-dots > [aria-current="step"] {
  background: var(--color-primary);
}

.breed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(192px, 100%), 1fr));
  gap: var(--space-2);
  inline-size: 100%;
}

.breed-card,
.choice-card,
.family-card {
  inline-size: 100%;
  min-block-size: 80px;
  margin: 0;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-card);
  background: var(--color-white);
  color: var(--color-ink);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease-out;
}

.breed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-inline-size: 0;
  padding: var(--space-2);
  text-align: center;
}

.basket {
  display: grid;
  place-items: center;
  inline-size: 100%;
  min-inline-size: 0;
  padding: var(--space-2);
  border-radius: var(--radius-card);
  background: var(--color-soft);
}

.breed-img {
  inline-size: min(100%, 240px);
  block-size: auto;
  margin-inline: auto;
  object-fit: contain;
}

.breed-name {
  color: var(--color-ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  text-wrap: balance;
}

.choice-list,
.family-list,
.settings-list {
  display: grid;
  gap: var(--space-2);
  inline-size: 100%;
}

.choice-card,
.family-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 14px var(--space-2);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.45;
  text-align: start;
}

.select-card__label {
  flex: 1 1 auto;
  max-inline-size: 100%;
  min-inline-size: 0;
  overflow: hidden;
}

.select-card__state {
  flex: 0 0 auto;
  font-size: 28px;
}

.family-card--none {
  justify-content: flex-start;
}

@media (max-width: 480px) {
  .family-card:not(.family-card--none) {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    column-gap: var(--space-1);
  }

  .family-card:not(.family-card--none) .choice-mark {
    grid-column: 1;
  }

  .family-card:not(.family-card--none) .select-card__label {
    grid-column: 2;
    justify-self: stretch;
  }

  .family-card:not(.family-card--none) .select-card__state {
    grid-column: 3;
    justify-self: end;
  }
}

/* 答えを送っている間は全部押せなくなるが、選んでいないものは見た目を変えない（全部が選ばれたように見えた・2026-09-26 オーナー） */
.choice-card:disabled:not([aria-pressed="true"]):not(.is-selected),
.family-card:disabled:not([aria-pressed="true"]):not(.is-selected) {
  border-color: var(--color-soft);
  background: var(--color-white);
}

.breed-card.is-selected,
.choice-card.is-selected,
.family-card.is-selected,
.breed-card[aria-pressed="true"],
.choice-card[aria-pressed="true"],
.family-card[aria-pressed="true"] {
  border-color: var(--color-deep);
  background: var(--color-soft);
}

.choice-mark {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  border: var(--line) solid var(--color-deep);
  border-radius: var(--radius-round);
  background: var(--color-white);
  color: var(--color-transparent);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.is-selected > .choice-mark,
[aria-pressed="true"] > .choice-mark,
.choice-mark.is-selected {
  background: var(--color-primary);
  color: var(--color-ink);
}

.guide-card {
  display: grid;
  gap: var(--space-2);
  inline-size: 100%;
  padding: var(--space-3);
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-soft);
  text-align: center;
}

.home-header {
  display: grid;
  gap: var(--space-1);
  inline-size: 100%;
}

.home-utility {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 72px;
  align-items: center;
  gap: var(--space-2);
  inline-size: 100%;
}

.help-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-inline-size: 88px;   /* 「使い方」の3文字に合わせて小さく（140→88・2026-09-27 オーナー） */
  min-block-size: 48px;
  padding: 6px 14px;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-control);
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

.home-title {
  min-inline-size: 0;
  text-align: start;
}

.home-title h1,
h1.home-title {
  text-align: start;
}

.home-title h1 > .phrase,
.home-title .together > .phrase {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-title .together {
  text-align: start;
}

/* タイトルロゴ（ホームだけ・小さく・押せない飾り）。「つかいかた」とハートのあいだのまんなか */
.home-logo {
  justify-self: center;
  inline-size: auto;
  max-inline-size: 100%;
  block-size: 52px;   /* 「使い方」を短くしたぶん大きく（40→52・2026-09-27 オーナー） */
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.heart-slot {
  display: grid;
  place-items: center;
  inline-size: 72px;
  block-size: 72px;
  background: var(--color-transparent);
}

.happiness-heart {
  display: inline-grid;
  place-items: center;
  inline-size: 72px;
  block-size: 72px;
  pointer-events: none;
}

.happiness-heart__svg {
  inline-size: 72px;
  block-size: 72px;
  overflow: visible;
}

.happiness-heart__empty {
  fill: var(--color-soft);
}

.happiness-heart__fill {
  fill: var(--color-heart);
  transform: translateY(var(--heart-fill-y, 72px));
  transition: transform 1.8s ease-in-out;
}

/* ふちは、中のピンクを濃くしたローズ色（黒い線が気になる・2026-09-26 オーナー。背景とのちがい5.3倍） */
.happiness-heart__outline {
  fill: none;
  stroke: var(--color-heart-line);
  stroke-linejoin: round;
  stroke-width: 5px;
}

.reward-heart-target {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  z-index: var(--z-raised);
  inline-size: 72px;
  block-size: 72px;
}

.reward-flying-heart {
  position: fixed;
  z-index: var(--z-overlay);
  color: var(--color-heart);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  -webkit-text-stroke: 1px var(--color-ink);
  pointer-events: none;
  animation: reward-heart-flight 2s ease-in-out forwards;
}

@keyframes reward-heart-flight {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.55);
  }
  18% {
    opacity: 1;
    transform: translate(calc(var(--heart-drift) - 50%), -76px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--heart-dx) - 50%), calc(var(--heart-dy) - 50%)) scale(.45);
  }
}

.together {
  margin: 0;
  color: var(--color-deep);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}

.message-window {
  position: relative;
  display: grid;
  align-items: center;
  inline-size: min(100%, 680px);
  min-block-size: 148px;
  margin-inline: auto;
  padding: var(--space-2) 52px var(--space-2) var(--space-3);
  border: 4px solid var(--color-ink);
  border-radius: var(--radius-control);
  background: var(--color-bg);
  color: var(--color-ink);
  cursor: pointer;
  touch-action: manipulation;
}

.message-window__text {
  min-block-size: 1.5em;
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.45;
  text-align: start;
  white-space: pre-line;
  text-wrap: pretty;
}

.message-window__arrow {
  position: absolute;
  inset-inline-end: var(--space-2);
  inset-block-end: 10px;
  color: var(--color-deep);
  font-size: 24px;
  line-height: 1;
}

.happy-intro-screen,
.level-up-screen,
.level-unlock-screen,
.outing-invite-screen,
.outing-destination-screen,
.travel-screen {
  gap: var(--space-2);
}

.happy-intro-screen .dog-stage {
  inline-size: min(70%, 300px);
}

.level-up-screen,
.level-unlock-screen,
.outing-destination-screen,
.travel-screen {
  justify-content: center;
}

.level-celebration {
  position: relative;
  isolation: isolate;
  inline-size: min(100%, 620px);
  block-size: clamp(280px, 42vh, 410px);
  margin-inline: auto;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.level-celebration .level-up-dog {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-end: 0;
  inline-size: min(58%, 280px);
  aspect-ratio: 1 / 1;
  margin: 0;
  transform: translateX(-50%);
}

.level-heart {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-start: calc(50% - 48px);
  inset-block-start: 12%;
  display: grid;
  place-items: center;
  inline-size: 96px;
  block-size: 96px;
  color: var(--color-heart);
  font-size: 96px;
  line-height: 1;
  -webkit-text-stroke: 3px var(--color-ink);
  transform-origin: center;
  pointer-events: none;
}

.level-heart.has-entered-jar {
  opacity: 0;
}

.happiness-jar {
  position: absolute;
  z-index: var(--z-raised);
  inset-block-start: 12px;
  inset-inline-end: 6px;
  display: grid;
  align-content: start;
  inline-size: 132px;
  block-size: 146px;
  padding: 18px 10px 42px;
  border: 4px solid var(--color-ink);
  border-radius: var(--radius-card);
  background: var(--color-white);
}

.happiness-jar__rim {
  position: absolute;
  inset-block-start: -13px;
  inset-inline-start: 15px;
  inline-size: calc(100% - 30px);
  block-size: 16px;
  border: 4px solid var(--color-ink);
  border-radius: var(--radius-control);
  background: var(--color-soft);
}

.happiness-jar__hearts {
  display: grid;
  grid-template-columns: repeat(var(--jar-columns, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--jar-rows, 1), minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  inline-size: 100%;
  block-size: 78px;
}

.happiness-jar__heart {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
}

.happiness-jar__heart svg {
  inline-size: var(--jar-heart-size, 21px);
  block-size: var(--jar-heart-size, 21px);
  overflow: visible;
}

.happiness-jar__heart path {
  fill: var(--color-heart);
  stroke: var(--color-ink);
  stroke-linejoin: round;
  stroke-width: 5px;
}

.happiness-jar__label {
  position: absolute;
  inset-inline: 4px;
  inset-block-end: 7px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.unlock-place {
  position: relative;
  inline-size: min(100%, 420px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  overflow: hidden;
}

.unlock-place img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  animation: unlock-place-reveal 1.6s ease-out both;
}

@keyframes unlock-place-reveal {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: scale(1); }
}

.level-unlock-screen .unlock-dog {
  inline-size: min(72%, 320px);
}

.letter-card {
  display: grid;
  place-items: center;
  inline-size: min(100%, 560px);
  min-block-size: 220px;
  margin-inline: auto;
  padding: var(--space-4) var(--space-3);
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-card);
  background-color: var(--color-white);
  background-image: repeating-linear-gradient(to bottom, transparent 0 46px, var(--color-soft) 46px 48px);
  box-shadow: 0 8px 24px var(--color-shadow);
  transform: rotate(-1deg);
}

.letter-card p {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.unlock-notice {
  margin: 0;
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.travel-view {
  position: relative;
  inline-size: min(100%, 760px);
  aspect-ratio: 3 / 2;
  margin-inline: auto;
  border: 4px solid var(--color-ink);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  overflow: hidden;
}

/* 景色は canvas に描く（奥・中・手前を別々の速さで流す・2026-09-26 Claude） */
.travel-view__landscape {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  background: var(--color-soft);
}

.travel-view__window {
  position: absolute;
  z-index: var(--z-base);
  inset: 5%;
  border: 14px solid var(--color-soft);
  border-radius: var(--radius-card);
  /* 窓の外（車の中）は景色を見せない: 窓わくの外を、車の中の色でおおう（2026-09-26 Claudeの検品） */
  box-shadow: 0 0 0 5px var(--color-ink), 0 0 0 999px var(--color-soft);
  pointer-events: none;
}

.travel-view__seat {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 27%;
  border-block-start: 5px solid var(--color-ink);
  background: var(--color-soft);
  pointer-events: none;
}

.travel-view .travel-dog {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-start: 30%;
  inset-block-end: 13%;
  inline-size: 40%;
  aspect-ratio: 1 / 1;
  margin: 0;
}

/* 犬が車にぴょんと乗る（1.1秒）→ 走っている間は小さくゆれる */
.travel-view .travel-dog.is-boarding {
  animation: travel-board 1.1s cubic-bezier(.3, .7, .4, 1) both;
}

@keyframes travel-board {
  0% { transform: translate(-80%, 40%) scale(.9); opacity: 0; }
  20% { opacity: 1; }
  55% { transform: translate(-30%, -22%) scale(1); }
  80% { transform: translate(0, 3%) scale(1.02, .97); }
  100% { transform: none; }
}

.travel-view .travel-dog.is-driving {
  animation: travel-bob .36s ease-in-out infinite alternate;
}

@keyframes travel-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-1.5%); }
}

/* 音を消す／出す（使い方の動画と同じ覚え方） */
.sound-toggle {
  position: absolute;
  z-index: var(--z-overlay);
  inset-inline-start: 18px;
  inset-block-start: 14px;
  display: grid;
  place-items: center;
  inline-size: 64px;
  block-size: 64px;
  padding: 0;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-control);
  background: var(--color-white);
  cursor: pointer;
}

.sound-toggle svg {
  inline-size: 34px;
  block-size: 34px;
  fill: var(--color-ink);
  stroke: var(--color-ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.sound-toggle svg path:first-child { stroke: none; }
.sound-toggle__wave { fill: none; }
.sound-toggle[aria-pressed="true"] .sound-toggle__wave,
.sound-toggle:not([aria-pressed="true"]) .sound-toggle__mute { display: none; }

/* 声の文の吹き出し（音を消していても分かる） */
.travel-say {
  min-block-size: 2.2em;
  text-align: center;
  opacity: 0;
  transition: opacity .3s;
}

.travel-say.is-on { opacity: 1; }

/* おさんぽで見つけたもの（転がる・落ちる・ぴょこんと出る）。犬の右前に止まる・2026-09-26 */
.find-item {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-start: 66%;
  inset-block-end: 6%;
  inline-size: 20%;
  aspect-ratio: 1 / 1;
  opacity: 0;
  pointer-events: none;
}

.find-item__img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 3px var(--color-shadow-strong));
}

.find-item.is-go { opacity: 1; }
.find-item--roll.is-go { animation: find-roll 1.9s cubic-bezier(.2, .65, .3, 1) both; }
.find-item--fall.is-go { animation: find-fall 2.8s ease-in-out both; }
.find-item--pop.is-go { animation: mf-light .5s linear both; }   /* 軽い（動きの決まり 2・2026-10-01） */
.find-item--pop.is-go .find-item__img {
  transform-origin: 50% 100%;
  animation: mf-swayout 1.1s linear .5s both;   /* ゆれ戻り2〜3回で止まる（前は ずっと ゆれていた） */
}

@keyframes find-roll {
  0% { transform: translate(320%, 0) rotate(0deg); }
  55% { transform: translate(40%, -10%) rotate(-560deg); }
  70% { transform: translate(-8%, 0) rotate(-700deg); }
  84% { transform: translate(5%, -3%) rotate(-735deg); }
  100% { transform: translate(0, 0) rotate(-720deg); }
}

@keyframes find-fall {
  0% { transform: translate(70%, -560%) rotate(25deg); opacity: 0; }
  8% { opacity: 1; }
  25% { transform: translate(-45%, -410%) rotate(-28deg); }
  50% { transform: translate(45%, -250%) rotate(22deg); }
  75% { transform: translate(-25%, -100%) rotate(-14deg); }
  100% { transform: translate(0, 0) rotate(6deg); }
}



/* 犬のいる部屋（オープニング動画と同じ羊毛フェルトの部屋） */
.home-room {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  inline-size: min(100%, 520px);
  aspect-ratio: 5 / 4;
  margin-inline: auto;
  border-radius: var(--radius-card);
  background: var(--color-bg);
  box-shadow: 0 8px 0 var(--color-soft), 0 14px 26px var(--color-room-shadow);
  overflow: hidden;
}

.home-room .outing-scene__background {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: 50% 70%;
  pointer-events: none;
}

.home-room .outing-scene__depth,
.home-room .outing-scene__fx {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.home-room__dust {
  position: absolute;
  inset: 0;
  z-index: var(--z-raised);
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.home-room #homeDog {
  position: absolute;
  inset-inline-start: 14%;
  inset-block-end: -6%;
  z-index: var(--z-raised);
  inline-size: 72% !important;
  aspect-ratio: 1 / 1;
  margin: 0;
}

.sleep-z {
  display: none;
  position: absolute;
  inset-block-start: 30%;
  inset-inline-start: 60%;
  pointer-events: none;
}

.home-room .sleep-z {
  z-index: var(--z-overlay);
  inset-block-start: 38%;
  inset-inline-start: 60%;
}

.home-room.is-night .sleep-z { display: block; }

.sleep-z span {
  position: absolute;
  color: var(--color-night-ink);
  font-size: 34px;
  font-weight: 800;
  opacity: 0;
  animation: sleep-z 4.2s ease-out infinite;
}

.sleep-z span:nth-child(2) { font-size: 28px; animation-delay: 1.4s; }
.sleep-z span:nth-child(3) { font-size: 22px; animation-delay: 2.8s; }

@keyframes sleep-z {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translate(46px, -90px); opacity: 0; }
}

/* その日の最初だけ、見本と同じ順でホームが登場する */
.home-screen.enter .home-logo { --mf-fall: -60%; animation: mf-settle 750ms linear 100ms both; }   /* ロゴは すっと落ちて ストン */
.home-screen.enter .help-chip { animation: home-rise 500ms ease-out 250ms both; }
.home-screen.enter .home-title { animation: mf-text 450ms linear 450ms both; }   /* 文字は ばねで ゆらさない */
.home-screen.enter #homeBubble { animation: mf-text 450ms linear 750ms both; }
.home-screen.enter .home-room { animation: mf-text 500ms linear 250ms both; }
.home-screen.enter .home-toy-status { animation: home-rise 500ms ease-out 1500ms both; }
.home-screen.enter #homeQuiz { animation: mf-text 450ms linear 1700ms both; }
.home-screen.enter #homePlay { animation: mf-text 450ms linear 1850ms both; }
.home-screen.enter .footer-links { animation: home-fade 600ms ease-out 2100ms both; }


@keyframes home-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}


@keyframes home-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 昼の「今日の1問」だけを、2.8秒ごとにやさしく呼ぶ */
#homeQuiz.home-quiz-call:not(:disabled) {
  animation: home-call 2.8s ease-in-out 3s infinite;
}

.home-screen.enter #homeQuiz.home-quiz-call:not(:disabled) {
  animation: mf-text 450ms linear 1700ms both,
    home-call 2.8s ease-in-out 3.2s infinite;
}

@keyframes home-call {
  0%, 100% { box-shadow: 0 0 0 0 var(--color-quiz-glow); }
  45% { box-shadow: 0 0 0 10px var(--color-transparent); }   /* 光の輪だけで呼ぶ（ボタンの文字は ゆらさない・2026-10-01） */
}

@media (prefers-reduced-motion: reduce) {
  .home-screen.enter .home-logo,
  .home-screen.enter .help-chip,
  .home-screen.enter .home-title,
  .home-screen.enter #homeBubble,
  .home-screen.enter .home-room,
  .home-screen.enter .home-toy-status,
  .home-screen.enter #homeQuiz,
  .home-screen.enter #homePlay,
  .home-screen.enter .footer-links,
  #homeQuiz.home-quiz-call {
    animation: none !important;
  }
}

.travel-skip {
  position: absolute;
  z-index: var(--z-overlay);
  inset-inline-end: 18px;
  inset-block-end: 12px;
  border-radius: var(--radius-control);
  background: var(--color-white);
}

.outing-scene {
  position: relative;
  inline-size: min(100%, 620px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  overflow: hidden;
}

.outing-scene__background {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* 背景に奥行き（A+・2026-09-26）: 絵の上に重ねる動く背景と、いちばん上の動くもの（落ち葉・花びらなど）。読みこめたら ふわっと出る */
.outing-scene__depth,
.outing-scene__fx {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  opacity: 0;
  transition: opacity 600ms ease-out;
  pointer-events: none;
}

.outing-scene__fx {
  z-index: calc(var(--z-raised) + 1);
}

.outing-scene__depth.is-ready,
.outing-scene__fx.is-ready {
  opacity: 1;
}

.outing-scene .outing-dog {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-start: 24%;
  inset-block-end: 5%;
  inline-size: 52%;
  aspect-ratio: 1 / 1;
  margin: 0;
}

.outing-scene .outing-dog.is-fallback {
  inset-inline-start: 35%;
  inset-block-end: 10%;
  inline-size: 30%;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  inline-size: 100%;
  margin-block-start: auto;
  padding-block-start: 0;
}

.home-screen {
  gap: var(--space-1);
}

.home-screen .bubble {
  padding-block: var(--space-1);
}

/* おもちゃと小物（画面18〜24） */
.home-toy-status,
.toy-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
  min-block-size: 48px;
  margin: 0;
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

button.home-toy-status {
  justify-self: center;
  inline-size: auto;
  max-inline-size: 100%;
}

.toy-reward-screen,
.shop-screen,
.wardrobe-screen,
.closet-screen,
.toybox-screen {
  gap: var(--space-2);
}

.toy-grid {
  display: grid;
  gap: var(--space-2);
  inline-size: min(100%, 560px);
  margin-inline: auto;
}

.toy-grid--reward {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.toy-grid--reward .toy-card {
  flex: 0 1 180px;
  inline-size: min(44%, 180px);
}

.toy-grid--reward .toy-placeholder {
  padding: 0;
}

.toy-grid--favorites {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  inline-size: min(100%, 384px);
}

.toy-grid--favorites .toy-placeholder {
  inset: 4px;
  inline-size: calc(100% - 8px);
  block-size: calc(100% - 8px);
  padding: 0;
  line-height: 1;
}

.toy-card {
  min-inline-size: 0;
  margin: 0;
}

.toy-picture {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 100%;
  aspect-ratio: 1 / 1;
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-soft);
  overflow: hidden;
}

.toy-placeholder,
.toy-image {
  position: absolute;
  inset: var(--space-1);
  inline-size: calc(100% - (var(--space-1) * 2));
  block-size: calc(100% - (var(--space-1) * 2));
  border-radius: var(--radius-control);
}

.toy-placeholder {
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: var(--space-1);
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.toy-placeholder__shape {
  position: absolute;
  z-index: var(--z-base);
  inline-size: 100%;
  aspect-ratio: 1 / 1;
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-round);
  background: var(--color-white);
}

.toy-placeholder__name {
  position: relative;
  z-index: var(--z-raised);
  max-inline-size: 100%;
}

.toy-placeholder__name .ph,
.toy-count-row > span .ph {
  white-space: nowrap;
}

.toy-placeholder__name .ph {
  letter-spacing: -0.1em;
  transform: scaleX(0.82);
  transform-origin: center;
}

.toy-image {
  padding: var(--space-1);
  background: var(--color-white);
  object-fit: contain;
  opacity: 0;
}

.toy-picture.is-loaded .toy-image {
  opacity: 1;
}

.toy-picture.is-loaded .toy-placeholder {
  display: none;
}

.shop-list,
.closet-list {
  inline-size: min(100%, 680px);
  margin-inline: auto;
}

.shop-slot {
  flex: 0 0 auto;
  padding: var(--space-1) 12px;
  border-radius: var(--radius-round);
  background: var(--color-soft);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.dog-stage--wardrobe-preview {
  inline-size: min(88%, 380px);
  aspect-ratio: 1 / 1;
}

.dog-stage--closet {
  inline-size: min(72%, 280px);
  aspect-ratio: 1 / 1;
}

.closet-item .select-card__state {
  font-size: 24px;
  white-space: nowrap;
}

.toy-favorites,
.toy-closet {
  display: grid;
  gap: var(--space-2);
  inline-size: 100%;
  text-align: center;
}

.toybox-screen.screen--with-back {
  padding-block-start: 48px;
}

.toy-favorites h2,
.toy-closet h2 {
  font-size: 32px;
}

.toy-count-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  inline-size: 100%;
}

.toy-count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-1);
  min-block-size: 80px;
  padding: var(--space-1) var(--space-2);
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-control);
  background: var(--color-white);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  text-align: start;
}

.toy-count-row > span {
  min-inline-size: 0;
}

.toy-count-row strong {
  font-size: 24px;
  white-space: nowrap;
}

.settings-screen {
  gap: var(--space-1);
}

.family-code-card {
  display: grid;
  gap: var(--space-1);
  inline-size: min(100%, 680px);
  margin-inline: auto;
  padding: var(--space-2) var(--space-3);
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-white);
  text-align: center;
}

.family-code-card h2 {
  font-size: 32px;
}

/* せってい の「わんこの声」（2026-10-11）: 出す／消す を 横に2つ（答えのボタンと同じ 肉球の印） */
.voice-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-block-start: var(--space-1);
}
.voice-choices .choice-card { justify-content: center; }
.voice-choices .select-card__label { white-space: nowrap; }
@media (max-width: 520px) { .voice-choices { grid-template-columns: minmax(0, 1fr); } }   /* スマホは たてに 2つ（1行で 読めるように） */

.family-code {
  color: var(--color-deep);
  font-size: clamp(40px, 34px + 2vw, 52px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
}

.family-code-copy {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.55;
  text-wrap: pretty;
}

/* 家族に教える番号を、そのままLINEで送る（2026-09-26） */
.btn--line {
  gap: 12px;
  flex-wrap: wrap;
}

.btn--line .line-icon {
  inline-size: 40px;
  block-size: 40px;
  flex: none;
}

.question-card,
.hint-card {
  inline-size: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-card);
  color: var(--color-ink);
  text-align: center;
}

.question-card {
  border: var(--line) solid var(--color-primary);
  background: var(--color-white);
  font-size: clamp(32px, 28px + 1.2vw, 40px);
  font-weight: 800;
  line-height: 1.45;
  text-wrap: balance;
}

.hint-card {
  border: var(--line) solid var(--color-primary);
  background: var(--color-soft);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.6;
  text-wrap: pretty;
}

.delivery-note,
.souvenir {
  inline-size: 100%;
  margin: 0;
  padding: var(--space-2);
  border-radius: var(--radius-control);
  background: var(--color-soft);
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  text-wrap: pretty;
}

.meter {
  inline-size: 100%;
  block-size: 32px;
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-round);
  background: var(--color-soft);
  overflow: clip;
}

.meter-fill {
  display: block;
  inline-size: 0;
  block-size: 100%;
  border-radius: var(--radius-round);
  background: var(--color-ok);
}

.playfield {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-white);
  touch-action: none;
}

.ball {
  position: absolute;
  display: grid;
  place-items: center;
  inline-size: 88px;
  block-size: 88px;
  padding: 0;
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-round);
  background: var(--color-primary);
  color: var(--color-ink);
  cursor: pointer;
  touch-action: manipulation;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding-block-start: calc(var(--space-2) + env(safe-area-inset-top));
  padding-inline-end: calc(var(--space-2) + env(safe-area-inset-right));
  padding-block-end: calc(var(--space-2) + env(safe-area-inset-bottom));
  padding-inline-start: calc(var(--space-2) + env(safe-area-inset-left));
  background: var(--color-scrim);
}

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  inline-size: min(100%, 640px);
  min-inline-size: 0;
  max-block-size: calc(100dvh - var(--space-4) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: var(--space-3);
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  color: var(--color-ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
}

.sheet > * {
  max-inline-size: 100%;
  min-inline-size: 0;
}

/* ごはん（案A・2026-09-26）: 犬の前にお皿、右に袋。袋を押すとカリカリが落ちて、犬が食べる */
.meal-scene {
  position: relative;
  inline-size: min(100%, 520px);
  margin-inline: auto;
}

.meal-scene .dog-stage { margin-block-end: 0; }

.meal-bowl {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-start: 50%;
  inset-block-end: 0;
  inline-size: 40%;
  aspect-ratio: 600 / 370;
  translate: -50% 0;
}

.meal-food-layer { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; pointer-events: none; }

.meal-bowl__img, .meal-bag__img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; }

.meal-bowl .meal-food {
  transform-origin: 300px 160px;
  transform: scaleY(0);
  opacity: 0;
  transition: transform .5s ease, opacity .5s ease;
}

.meal-scene.is-full .meal-bowl .meal-food { transform: scaleY(1); opacity: 1; }
.meal-scene[data-eaten="1"] .meal-bowl .meal-food { transform: scaleY(.7) scaleX(.9); }
.meal-scene[data-eaten="2"] .meal-bowl .meal-food { transform: scaleY(.4) scaleX(.75); }
.meal-scene[data-eaten="3"] .meal-bowl .meal-food { transform: scaleY(0) scaleX(.5); opacity: 0; }

.meal-kibbles { position: absolute; inset: 0; pointer-events: none; }

.meal-kibbles i {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  inline-size: 14px;
  block-size: 11px;
  border-radius: 50%;
  background: #A8672F;
  opacity: 0;
}

.meal-scene.is-pouring .meal-kibbles i { animation: meal-kibble .7s cubic-bezier(.4, 0, .9, .6) both; }

@keyframes meal-kibble {
  0% { transform: translate(var(--dx0), var(--dy0)); opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translate(var(--dx1), var(--dy1)); opacity: 0; }
}

.meal-bag {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-end: 2%;
  inset-block-start: 22%;
  inline-size: 22%;
  aspect-ratio: 360 / 448;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: 30% 20%;
  transition: transform .45s ease;
}

.meal-scene.is-pouring .meal-bag { transform: translate(-40%, -10%) rotate(-58deg); }
.meal-scene.is-done .meal-bag { opacity: .6; }

/* ごはんのトッピングとお皿をえらぶ（案C・2026-09-26） */
.meal-choose { display: grid; gap: 8px; justify-items: center; }
.meal-choose__label { margin: 0; font-size: 22px; font-weight: 700; color: var(--color-deep); }
.meal-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.meal-chip {
  min-block-size: 56px;
  padding: 6px 18px;
  border: var(--line) solid var(--color-soft);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-ink);
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

.meal-chip[aria-pressed="true"] { border-color: var(--color-deep); background: var(--color-soft); }
.meal-chip:disabled { opacity: .7; cursor: default; }
.meal-bowl-change { justify-self: center; inline-size: auto; }

.unlock-meal { display: grid; place-items: center; padding-block: var(--space-2); }
.meal-bowl--unlock { position: relative; inset: auto; translate: none; inline-size: min(70%, 320px); }

/* 家族から届いたおやつを、手であげる（2026-09-26） */
.treat-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding-block-end: 88px;
}

.treat-item {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-end: 8%;
  inset-block-end: 4px;
  display: grid;
  place-items: center;
  inline-size: 104px;
  block-size: 80px;
  padding: 6px;
  border: var(--line) dashed var(--color-primary);
  border-radius: var(--radius-control);
  background: var(--color-white);
  cursor: grab;
  touch-action: none;
  transition: transform .6s cubic-bezier(.3, .8, .3, 1), opacity .3s ease .45s;
  animation: mf-nudge 3.2s linear infinite;   /* ずっと ゆれず、数秒に1回だけ合図 */
}

.treat-item.is-dragging { transition: none; animation: none; cursor: grabbing; border-color: transparent; background: transparent; }
.treat-item.is-eaten { animation: none; border-color: transparent; background: transparent; opacity: 0; }
.treat-item__img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; pointer-events: none; }


.treat-hearts {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 18%;
  pointer-events: none;
}

.treat-hearts span {
  position: absolute;
  color: var(--color-heart);
  font-size: 34px;
  opacity: 0;
}

.treat-stage.is-happy .treat-hearts span { animation: treat-heart 1.6s ease-out both; }
.treat-stage.is-happy .treat-hearts span:nth-child(1) { inset-inline-start: -60px; }
.treat-stage.is-happy .treat-hearts span:nth-child(2) { inset-inline-start: 0; animation-delay: .25s; }
.treat-stage.is-happy .treat-hearts span:nth-child(3) { inset-inline-start: 50px; animation-delay: .5s; }

@keyframes treat-heart {
  0% { transform: translateY(20px) scale(.5); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-50px) scale(1.15); opacity: 0; }
}

.treat-say { min-block-size: 3em; }
.treat-item.is-waiting { animation: none; opacity: .55; cursor: default; }
.trick-screen .treat-stage { padding-block-end: 70px; }

.gift-visual {
  display: grid;
  place-items: center;
  min-block-size: 96px;
  color: var(--color-deep);
  font-size: clamp(64px, 18vw, 96px);
  line-height: 1;
}

.photo {
  inline-size: 100%;
  block-size: auto;
  max-block-size: min(34dvh, 320px);
  margin-inline: auto;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-card);
  background: var(--color-white);
  object-fit: contain;
}

@media (max-height: 850px) {
  #app {
    padding-block-start: calc(var(--space-1) + env(safe-area-inset-top));
    padding-block-end: calc(var(--space-2) + env(safe-area-inset-bottom));
  }

  .screen {
    gap: var(--space-2);
  }

  .home-screen,
  .settings-screen {
    gap: var(--space-1);
  }

  .dog-stage--mini {
    inline-size: min(44%, 140px);
  }

  .dog-stage--overlay {
    inline-size: min(60%, 180px);
  }

  #nameDog,
  #guideDog {
    inline-size: min(76%, 300px);
  }

  #settingsDog {
    inline-size: min(48%, 152px);
  }

  #homeDog {
    inline-size: min(88%, 300px);
  }

  .level-celebration {
    block-size: 260px;
  }

  .unlock-place,
  .outing-scene {
    inline-size: min(100%, 310px);
  }

  .travel-view {
    inline-size: min(100%, 600px);
  }

  .happy-intro-screen .dog-stage {
    inline-size: min(46%, 170px);
  }

  textarea {
    min-block-size: 120px;
  }
}

@media (max-width: 480px) {
  .home-title h1 {
    font-size: 32px;
    line-height: 1.2;
  }

  .home-title .together {
    line-height: 1.35;
  }

  .home-screen .bubble {
    padding-block: 4px;
    line-height: 1.4;
  }
}

@media (max-width: 480px) and (max-height: 850px) {
  #app {
    padding-block-end: calc(var(--space-1) + env(safe-area-inset-bottom));
  }

  #homeDog {
    inline-size: min(86%, 292px);
  }

  .home-actions {
    gap: var(--space-2);
  }
}

.opening-frame {
  display: block;
  inline-size: 100%;
  min-block-size: 100vh;
  min-block-size: 100svh;
  border: 0;
  background: var(--color-bg);
}

.opening-screen {
  gap: 0;
}

.btn:focus-visible,
.help-chip:focus-visible,
.message-window:focus-visible,
.dog-action:focus-visible,
.dog-stage-action:focus-visible,
.breed-card:focus-visible,
.choice-card:focus-visible,
.family-card:focus-visible,
.dog-stage[role="button"]:focus-visible,
.text-link:focus-visible,
.ball:focus-visible,
.treat-item:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: var(--focus-line) solid var(--color-deep);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover,
  .help-chip:hover,
  .dog-action:hover,
  .dog-stage-action:hover,
  .breed-card:hover,
  .choice-card:hover,
  .family-card:hover {
    border-color: var(--color-deep);
  }

  .text-link:hover {
    color: var(--color-deep);
  }
}

@media (min-width: 640px) {
  #app {
    padding-block-start: calc(var(--space-3) + env(safe-area-inset-top));
    padding-inline-end: calc(var(--space-3) + env(safe-area-inset-right));
    padding-block-end: calc(var(--space-4) + env(safe-area-inset-bottom));
    padding-inline-start: calc(var(--space-3) + env(safe-area-inset-left));
  }

  body.opening-active #app {
    padding: 0;
  }

  .screen {
    gap: var(--space-4);
  }

  .home-screen,
  .settings-screen {
    gap: 12px;
  }

  .home-header {
    grid-template-columns: 140px minmax(0, 1fr) 140px;
    align-items: center;
    gap: var(--space-1);
  }

  .home-utility {
    display: contents;
  }

  .home-utility .help-chip {
    grid-column: 1;
    grid-row: 1;
  }

  .home-utility .heart-slot {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  /* iPad: 上の段は「つかいかた」・ロゴ・ハート。名前は その下の段のまんなか（ロゴと名前が重ならないように・2026-09-26） */
  .home-utility .home-logo {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    block-size: 44px;
  }

  .home-title {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-2);
    min-inline-size: 0;
  }

  .home-title h1,
  .home-title .together {
    text-align: center;
  }

  .home-title h1 {
    flex: 1 1 auto;
    min-inline-size: 0;
    overflow: hidden;
  }

  .home-title .together {
    flex: 0 0 auto;
    max-inline-size: 42%;
  }

  .breed-card {
    min-block-size: 280px;
  }

  .basket-screen {
    justify-content: center;
  }
}

@media (min-width: 900px) {
  :root {
    --page-max: 960px;
  }

  .screen {
    inline-size: min(100%, 900px);
  }
}

@media (min-width: 768px) and (max-height: 820px) and (orientation: landscape) {
  .screen {
    gap: var(--space-2);
  }

  .home-screen,
  .settings-screen {
    gap: var(--space-1);
  }

  .dog-stage {
    inline-size: min(62vw, 420px);
  }

  .dog-stage--compact {
    inline-size: min(44vw, 300px);
  }

  .dog-stage--mini {
    inline-size: min(44%, 140px);
  }

  .dog-stage--overlay {
    inline-size: min(60%, 180px);
  }

  #welcomeDog,
  #finishDog {
    inline-size: min(54vw, 420px);
  }

  #confirmDog,
  #homeDog {
    inline-size: min(42vw, 325px);
  }

  #nameDog,
  #guideDog {
    inline-size: min(38vw, 300px);
  }

  #settingsDog {
    inline-size: min(24vw, 165px);
  }

  .logo {
    inline-size: min(62%, 520px);
  }
}

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

/* iPhoneの幅では、移動の場面を縦長にして大きく見せる（2026-09-26 Claudeの検品） */
@media (max-width: 520px) {
  .travel-view {
    aspect-ratio: 4 / 5;
  }
  .travel-view .travel-dog {
    inset-inline-start: 22%;
    inline-size: 56%;
  }
}

/* 部屋の大きさだけを高さに合わせて変え、文字と押せる大きさは縮めない */
@media (max-height: 950px) {
  .home-room {
    inline-size: min(100%, 460px);
  }
}

@media (max-height: 850px) {
  .home-room {
    inline-size: min(100%, 360px);
  }
}

@media (max-height: 850px) {
  .dog-stage--wardrobe-preview {
    inline-size: min(72%, 240px);
  }

  .dog-stage--closet {
    inline-size: min(58%, 190px);
  }
}

@media (max-width: 480px) and (max-height: 850px) {
  .home-room {
    inline-size: min(100%, 250px);
  }

  .toy-grid--reward .toy-card {
    flex-basis: 132px;
    inline-size: min(42%, 132px);
  }
}

@media (max-width: 480px) {
  .toy-grid--favorites {
    gap: var(--space-1);
    inline-size: 100%;
  }

  .toy-grid--favorites .toy-placeholder__name .ph,
  .toy-count-row > span .ph {
    letter-spacing: -0.18em;
  }

  .toy-count-row {
    display: block;
    padding: var(--space-1) 0;
    line-height: 1.2;
    text-align: center;
  }

  .toy-count-row > span {
    display: inline;
  }

  .toy-count-row strong {
    display: inline-block;
  }
}

@media (min-width: 640px) {
  .closet-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .closet-list--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .toy-count-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-height: 820px) and (orientation: landscape) {
  .home-room {
    inline-size: min(100%, 250px);
  }

  .dog-stage--wardrobe-preview {
    inline-size: min(42vw, 300px);
  }
}

/* ブラッシング・写真館・しあわせ帳（指示書04） */
.happiness-heart--button {
  padding: 0;
  border: var(--line) solid var(--color-transparent);
  border-radius: var(--radius-round);
  background: var(--color-transparent);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 180ms ease-out, background-color 180ms ease-out;
}

.happiness-heart--button:active {
  transform: scale(.96);
}

.dog-stage.is-fluffy .dog-fallback {
  filter: brightness(1.08) drop-shadow(0 0 10px var(--color-soft));
}

.play-menu-screen--care {
  gap: var(--space-2);
}

.play-menu-screen--care .dog-stage--play-menu {
  inline-size: min(54%, 230px);
}

.care-screen,
.photo-studio-screen,
.photo-done-screen,
.happiness-book-screen,
.album-screen,
.album-photo-screen,
.garden-screen {
  gap: var(--space-2);
}

.care-screen {
  justify-content: center;
}

.care-screen > .text-link--back:disabled {
  cursor: default;
}

.care-brush-picker {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: var(--space-2);
  inline-size: 100%;
}

.care-brush-choice {
  display: grid;
  grid-template-columns: 68px auto;
  align-items: center;
  gap: var(--space-1);
  min-inline-size: 132px;
  min-block-size: 80px;
  padding: var(--space-1) var(--space-2);
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-control);
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}

.care-brush-choice[aria-pressed="true"] {
  border-color: var(--color-deep);
  background: var(--color-soft);
}

.care-brush-choice img {
  inline-size: 68px;
  block-size: 68px;
  object-fit: contain;
  pointer-events: none;
}

.care-scene {
  position: relative;
  isolation: isolate;
  inline-size: min(100%, 390px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-card);
  background: var(--color-white);
}

.care-dog {
  position: absolute;
  z-index: var(--z-base);
  inset: 0;
  inline-size: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
}

.care-brush-tool {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-end: 3%;
  inset-block-end: 2%;
  inline-size: 112px;
  block-size: 112px;
  cursor: grab;
  touch-action: none;
  transform: rotate(-16deg);
  transform-origin: center;
  user-select: none;
}

.care-brush-tool img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  pointer-events: none;
}

.care-brush-tool.is-dragging {
  cursor: grabbing;
}

.care-brush-tool.is-waiting {
  cursor: default;
  opacity: .62;
  pointer-events: none;
}

.care-brush-tool.is-brushing:not(.is-dragging) {
  animation: care-brush-pass 520ms ease-in-out;
}

.care-brush-tool.is-finished {
  pointer-events: none;
}

@keyframes care-brush-pass {
  0%, 100% { transform: rotate(-16deg) translate(0, 0); }
  50% { transform: rotate(-26deg) translate(-42px, -30px); }
}

.care-brush-hearts {
  position: absolute;
  z-index: var(--z-raised);
  inline-size: 1px;
  block-size: 1px;
  pointer-events: none;
}

.care-brush-hearts i {
  position: absolute;
  color: var(--color-heart);
  font-size: 30px;
  font-style: normal;
  font-weight: 800;
  opacity: 0;
}

.care-brush-hearts.is-showing i {
  animation: care-heart-rise 1.2s ease-out both;
}

.care-brush-hearts i:nth-child(1) { translate: -48px 0; }
.care-brush-hearts i:nth-child(2) { translate: -4px 0; animation-delay: 120ms; }
.care-brush-hearts i:nth-child(3) { translate: 38px 0; animation-delay: 240ms; }

@keyframes care-heart-rise {
  0% { opacity: 0; transform: translateY(18px) scale(.7); }
  28% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-58px) scale(1.08); }
}

.care-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-block-size: 26px;
}

.care-progress span {
  inline-size: 22px;
  block-size: 22px;
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-round);
  background: var(--color-white);
}

.care-progress span.is-done {
  background: var(--color-primary);
}

.care-message {
  min-block-size: 76px;
}

.shampoo-bubbles {
  position: absolute;
  z-index: var(--z-raised);
  inset: 0;
  pointer-events: none;
}

.shampoo-bubble {
  position: absolute;
  inset-inline-start: var(--bubble-x);
  inset-block-start: var(--bubble-y);
  display: block;
  inline-size: var(--bubble-size);
  block-size: var(--bubble-size);
  padding: 0;
  border: 3px solid var(--color-soft);
  border-radius: var(--radius-round);
  background: var(--color-white);
  box-shadow: inset -7px -8px 0 var(--color-soft), 0 4px 12px var(--color-shadow);
  cursor: pointer;
  opacity: .94;
  pointer-events: auto;
  touch-action: manipulation;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 260ms ease-out, transform 260ms ease-out;
}

.shampoo-bubble::after {
  content: "";
  position: absolute;
  inset-inline-start: 20%;
  inset-block-start: 16%;
  inline-size: 24%;
  block-size: 24%;
  border-radius: var(--radius-round);
  background: var(--color-white);
}

.shampoo-bubble.is-gone {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.35);
}

.photo-studio-scene {
  position: relative;
  isolation: isolate;
  inline-size: min(100%, 520px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  overflow: hidden;
}

.photo-studio-bg {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  pointer-events: none;
}

.photo-studio-dog {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-start: 19%;
  inset-block-end: 4%;
  inline-size: 62%;
  aspect-ratio: 1 / 1;
  margin: 0;
}

.photo-studio-dog.is-fallback {
  inset-inline-start: 31%;
  inset-block-end: 8%;
  inline-size: 38%;
}

.photo-flash {
  position: absolute;
  z-index: var(--z-overlay);
  inset: 0;
  background: var(--color-white);
  opacity: 0;
  pointer-events: none;
}

.photo-flash.is-active {
  animation: photo-flash 300ms ease-out both;
}

@keyframes photo-flash {
  0% { opacity: 0; }
  36% { opacity: 1; }
  100% { opacity: 0; }
}

.photo--result {
  inline-size: min(100%, 560px);
  max-block-size: min(55dvh, 560px);
  -webkit-touch-callout: default;
}

.book-jar {
  display: grid;
  place-items: center;
  min-block-size: 210px;
}

.book-jar .happiness-jar {
  position: relative;
  inset: auto;
  inline-size: 184px;
  block-size: 200px;
  padding: 20px 14px 64px;
}

.book-jar .happiness-jar__hearts {
  block-size: 108px;
}

.book-actions {
  display: grid;
  gap: var(--space-2);
  inline-size: min(100%, 680px);
  margin-inline: auto;
}

.book-action {
  display: grid;
  gap: var(--space-1);
  inline-size: 100%;
}

.book-lock {
  margin: 0;
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  inline-size: 100%;
}

.album-thumb {
  display: block;
  inline-size: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-control);
  background: var(--color-white);
  cursor: pointer;
  overflow: hidden;
}

.album-thumb img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  pointer-events: none;
}

.album-empty {
  display: grid;
  place-items: center;
  min-block-size: 260px;
}

.album-photo {
  inline-size: min(100%, 640px);
  max-block-size: min(62dvh, 640px);
  -webkit-user-select: auto;
  user-select: auto;
  -webkit-touch-callout: default;
}

.garden-scene {
  isolation: isolate;
}

.garden-flowers {
  position: absolute;
  z-index: var(--z-base);
  inset: 0;
  pointer-events: none;
}

.garden-scene > .outing-scene__depth {
  z-index: calc(var(--z-base) + 1);
}

.garden-flower {
  position: absolute;
  inset-inline-start: var(--flower-x);
  inset-block-start: var(--flower-y);
  inline-size: var(--flower-size);
  max-inline-size: none;
  block-size: auto;
  transform: translate(-50%, -100%);
  transform-origin: center bottom;
  pointer-events: none;
  user-select: none;
}

.garden-scene .garden-dog {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline-start: 24%;
  inset-block-end: 3%;
  inline-size: 52%;
  aspect-ratio: 1 / 1;
  margin: 0;
}

.garden-scene .garden-dog.is-fallback {
  inset-inline-start: 35%;
  inset-block-end: 8%;
  inline-size: 30%;
}

.unlock-care {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: min(100%, 360px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-card);
  background: var(--color-white);
  overflow: hidden;
}

.unlock-care__brush {
  inline-size: 78%;
  block-size: 78%;
  object-fit: contain;
  pointer-events: none;
}

.unlock-care--shampoo .unlock-dog {
  inline-size: 92%;
}

.unlock-care__bubbles {
  position: absolute;
  z-index: var(--z-raised);
  inset: 0;
  pointer-events: none;
}

.unlock-care__bubbles i {
  position: absolute;
  inline-size: 54px;
  block-size: 54px;
  border: 3px solid var(--color-soft);
  border-radius: var(--radius-round);
  background: var(--color-white);
  opacity: .9;
}

.unlock-care__bubbles i:nth-child(1) { inset-inline-start: 16%; inset-block-start: 30%; }
.unlock-care__bubbles i:nth-child(2) { inset-inline-start: 40%; inset-block-start: 17%; inline-size: 66px; block-size: 66px; }
.unlock-care__bubbles i:nth-child(3) { inset-inline-end: 14%; inset-block-start: 34%; }
.unlock-care__bubbles i:nth-child(4) { inset-inline-start: 25%; inset-block-end: 22%; inline-size: 62px; block-size: 62px; }
.unlock-care__bubbles i:nth-child(5) { inset-inline-end: 24%; inset-block-end: 17%; }

.happiness-heart--button:focus-visible,
.care-brush-choice:focus-visible,
.shampoo-bubble:focus-visible,
.album-thumb:focus-visible {
  outline: var(--focus-line) solid var(--color-deep);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .happiness-heart--button:hover {
    background: var(--color-soft);
  }

  .care-brush-choice:hover,
  .album-thumb:hover,
  .shampoo-bubble:hover {
    border-color: var(--color-deep);
  }
}

@media (max-width: 480px) {
  .care-brush-choice {
    grid-template-columns: 54px auto;
    min-inline-size: 0;
    padding-inline: var(--space-1);
  }

  .care-brush-choice img {
    inline-size: 54px;
    block-size: 54px;
  }

  .care-brush-tool {
    inline-size: 92px;
    block-size: 92px;
  }

  .album-grid {
    gap: var(--space-2);
  }
}

@media (max-height: 850px) {
  .play-menu-screen--care .dog-stage--play-menu {
    inline-size: min(42%, 150px);
  }

  .care-scene {
    inline-size: min(66vw, 250px);
  }

  .photo-studio-scene {
    inline-size: min(48vh, 390px);
  }

  .garden-screen .garden-scene {
    inline-size: min(100%, 58vh, 420px);
  }
}

@media (max-width: 480px) and (max-height: 850px) {
  .care-screen:not(.shampoo-screen) {
    justify-content: flex-start;
  }

  .care-brush-picker {
    gap: var(--space-2);
  }

  .care-scene {
    inline-size: min(64vw, 236px);
  }

  .care-message {
    min-block-size: 68px;
    padding-block: var(--space-1);
  }

  .photo-studio-scene {
    inline-size: min(86vw, 330px);
  }
}

@media (min-width: 768px) and (max-height: 820px) and (orientation: landscape) {
  .play-menu-screen--care .dog-stage--play-menu {
    inline-size: min(24vw, 138px);
  }

  .care-scene {
    inline-size: min(27vh, 210px);
  }

  .care-brush-tool {
    inline-size: 82px;
    block-size: 82px;
  }

  .care-brush-picker {
    min-block-size: 80px;
  }

  .photo-studio-scene {
    inline-size: min(48vh, 350px);
  }

  .photo--result {
    inline-size: min(100%, 48vh, 560px);
    max-block-size: none;
  }

  .garden-screen .garden-scene {
    inline-size: min(100%, 50vh, 360px);
  }
}

/* 演出の画面配置（動きそのものは effects.js が担当） */
.quiz-answer-area {
  display: grid;
  gap: var(--space-3);
  inline-size: 100%;
}

.answer-result-screen {
  justify-content: flex-start;
  gap: 12px;
}

.level-up-ribbon {
  position: relative;
  inline-size: 100%;
  block-size: clamp(112px, 15vw, 130px);
  overflow: visible;
}

.level-up-screen {
  overflow-x: clip;
}

.answer-result-screen .result-title,
.answer-result-screen .answer-result-copy {
  margin: 0;
}

.answer-result-copy {
  font-size: 24px;
  line-height: 1.4;
}

.answer-stamps {
  inline-size: 100%;
  min-inline-size: 0;
}

.answer-stamps .fx-card > .answer-stamp-hanamaru {
  z-index: var(--z-raised);
  inset-inline-start: 50% !important;
  inset-block-start: 50% !important;
  pointer-events: none;
}

.answer-result-screen #answerDog {
  inline-size: min(42%, 200px);
  aspect-ratio: 1 / 1;
  margin-block: -4px;
}

.answer-result-screen .bubble {
  padding-block: var(--space-1);
}

/* 指示書10: 札が出る分の場所は先に取り、つぎへを動かさない。 */
.sent-tags {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  inline-size: 100%;
  pointer-events: none;
}

.sent-tags:empty { display: none; }
.sent-tags.is-waiting,
.feel-row.is-waiting { visibility: hidden; }

.sent-tag {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  max-inline-size: 100%;
  margin: 0;
  padding: 7px 16px 7px 9px;
  border-radius: var(--radius-round);
  background: var(--color-sent-bg);
  color: var(--color-ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 4px 10px var(--color-shadow-strong);
}

.sent-tag::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px dashed var(--color-primary);
  border-radius: inherit;
  opacity: .5;
  pointer-events: none;
}

.sent-tag__text { min-inline-size: 0; }
.sent-tag .ph { white-space: nowrap; }
.sent-tag__mark {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  border-radius: var(--radius-round);
  background: var(--color-ok);
  color: var(--color-white);
  font-size: 24px;
  line-height: 1;
}

.sent-tag__mark img { inline-size: 26px; block-size: auto; }
.sent-tag--wait .sent-tag__mark { background: var(--color-soft); }
.sent-tag--weekly .sent-tag__mark { background: var(--color-transparent); }
.sent-tag--fail { background: var(--color-sent-muted); }
.sent-tag--fail::after { border-color: var(--color-sent-stitch); opacity: .45; }
.sent-tag--fail .sent-tag__mark { background: var(--color-ink); }
.sent-dots { display: inline-flex; gap: 3px; }
.sent-dots i { inline-size: 5px; block-size: 5px; border-radius: var(--radius-round); background: var(--color-deep); animation: sent-dot 1.2s ease-in-out infinite; }
.sent-dots i:nth-child(2) { animation-delay: .2s; }
.sent-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes sent-dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.answer-room .sent-tags {
  position: absolute;
  z-index: var(--z-overlay);
  inset-block-start: 5%;
  inset-inline-start: 3%;
  inline-size: 31%;
  align-items: flex-start;
}

/* 補足札は承認見本の19px。本文と操作ボタンの大きさは変えない。 */
.answer-room .sent-tag { padding-inline-end: 12px; border-radius: var(--radius-card); text-align: start; }
.answer-result-screen .answer-room.is-compact > .dog-room__dog { inline-size: var(--answer-dog-size) !important; inset-inline-start: 50%; translate: -50% 0; }
.answer-result-screen .answer-stamps .fx-card { margin-block-start: 4px; }
.fly-letter { position: fixed; z-index: var(--z-overlay); left: 0; top: 0; pointer-events: none; transform: translate(-50%, -50%); }
.fly-letter img { display: block; inline-size: 100%; }
.feel-row { inline-size: min(100%, 520px); margin-inline: auto; }
.feel-row__btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.feel-btn {
  min-inline-size: 0;
  min-block-size: 48px;
  padding: 4px;
  border: var(--line) solid var(--color-soft);
  border-radius: var(--radius-control);
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}
.feel-btn .ph { white-space: nowrap; }
.feel-btn[aria-pressed="true"] { border-color: var(--color-primary); background: var(--color-soft); box-shadow: inset 0 -4px 0 var(--color-primary); }
.feel-btn:focus-visible { outline: var(--focus-line) solid var(--color-deep); outline-offset: 4px; }
.feel-btn:active { transform: scale(.98); }
.sent-tag--small { font-size: 16px; inline-size: fit-content; padding: 5px 14px 5px 7px; margin-inline: auto; }
.sent-tag--small .sent-tag__mark { inline-size: 24px; block-size: 24px; }

@media (max-height: 820px) and (min-aspect-ratio: 1/1) {
  .answer-result-screen .answer-stamps .fx-card { max-inline-size: 500px; margin: 0 auto; }
  .feel-btn { min-block-size: 44px; }
  #app[data-screen="answer-result"] { padding-block-end: calc(var(--space-3) + env(safe-area-inset-bottom)); }
}

/* ホームの札（2026-10-14 検品で直した）: 部屋を小さくしない。部屋が広い（iPad）ときは JS が 部屋の中に移すので 左上に重ねる。
   スマホは 部屋の下（下の リンクは 少し スクロール）。前は 札の日に 部屋を 幅200px まで 縮めていた */
.home-room .home-sent-tags {
  position: absolute;
  z-index: var(--z-overlay);
  inset-block-start: 5%;
  inset-inline-start: 3%;
  inline-size: 34%;
  align-items: flex-start;
}
.home-room .sent-tag--small { margin-inline: 0; border-radius: var(--radius-card); text-align: start; }

@media (prefers-reduced-motion: reduce) {
  .sent-dots i { animation: none; opacity: .8; }
}

.toy-reward-stage {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: min(100%, 560px);
  min-block-size: clamp(220px, 32vh, 320px);
  margin-inline: auto;
}

.toy-reward-stage .toy-grid--reward {
  position: relative;
  z-index: var(--z-base);
  inline-size: 100%;
}

@media (max-height: 850px) {
  .quiz-answer-area {
    gap: var(--space-2);
  }

  .answer-result-screen {
    gap: var(--space-1);
  }

  .answer-result-copy {
    font-size: 21px;
    line-height: 1.3;
  }

  .answer-result-screen #answerDog {
    inline-size: min(38%, 150px);
  }

  .answer-result-screen .bubble {
    font-size: 22px;
    line-height: 1.35;
  }

  .level-up-ribbon {
    block-size: 112px;
  }

  .level-up-screen .level-celebration {
    block-size: min(31vh, 260px);
  }

  .toy-reward-stage {
    min-block-size: 220px;
  }
}

@media (max-width: 480px) {
  .answer-result-screen .result-title {
    font-size: 32px;
  }

  .toy-reward-stage .toy-grid--reward {
    gap: var(--space-1);
  }
}

/* 家の中の場面（指示書07）: 11画面で同じ部屋・奥行き・光を使う */
.room-screen {
  gap: 12px;
}

/* 小物の名前を最後の1文字だけ次の行へ落とさない */
.closet-screen .closet-item {
  gap: var(--space-1);
}

.closet-screen .closet-item .select-card__label .ph {
  white-space: nowrap;
}

.dog-room {
  position: relative;
  isolation: isolate;
  display: block;
  flex: 0 0 auto;
  inline-size: min(100%, 680px);
  aspect-ratio: 3 / 2;
  margin-inline: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--color-bg);
  box-shadow: 0 8px 0 var(--color-soft), 0 14px 26px var(--color-room-shadow);
  overflow: hidden;
}

.dog-room > .outing-scene__background {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  pointer-events: none;
}

.dog-room .outing-scene__depth,
.dog-room .outing-scene__fx {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.dog-room__dust {
  position: absolute;
  inset: 0;
  z-index: var(--z-raised);
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

#app .dog-room > .dog-room__dog {
  position: absolute;
  inset: auto auto -8% 22%;
  z-index: var(--z-raised);
  inline-size: 56% !important;
  aspect-ratio: 1 / 1;
  margin: 0;
}

.dog-room .sleep-z,
.dog-room .ball,
.dog-room .treat-item,
.dog-room .treat-hearts,
.dog-room .meal-bag,
.dog-room .care-brush-tool,
.dog-room .care-brush-hearts,
.dog-room .shampoo-bubbles {
  z-index: var(--z-overlay);
}

/* 回転したブラシの四隅まで、丸い部屋の内側におさめる */
.dog-room .care-brush-tool {
  inset-inline-end: 5%;
  inset-block-end: 6%;
}

.dog-room.meal-scene,
.dog-room.treat-stage,
.dog-room.care-scene,
.dog-room.playfield {
  inline-size: min(100%, 680px);
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  background: var(--color-bg);
}

.trick-screen .dog-room.treat-stage {
  padding-block-end: 0;
}

.dog-room.playfield {
  touch-action: none;
}

@media (max-height: 1024px) {
  .dog-room,
  .dog-room.meal-scene,
  .dog-room.treat-stage,
  .dog-room.care-scene,
  .dog-room.playfield {
    inline-size: min(100%, 680px);
    aspect-ratio: 16 / 9;
  }
}

@media (min-width: 768px) and (max-height: 820px) and (orientation: landscape) {
  .dog-room,
  .dog-room.meal-scene,
  .dog-room.treat-stage,
  .dog-room.care-scene,
  .dog-room.playfield {
    inline-size: min(100%, 680px);
    aspect-ratio: 3 / 1;
  }

  #app .dog-room > .dog-room__dog {
    inset-inline-start: 33%;
    inline-size: 34% !important;
  }
}

/* ごはん（部屋の中）: 横長の部屋では、お皿が犬に重なって犬が隠れた（2026-09-29 Claude）。
   犬は左寄り、お皿は犬の右手前に小さめ、袋は右上のまま */
#app .dog-room.meal-scene > .dog-room__dog {
  inset-inline-start: 6%;
  inline-size: 50% !important;
}
.dog-room.meal-scene .meal-bowl {
  inset-inline-start: 58%;
  inset-block-end: 6%;
  inline-size: 30%;
  translate: 0 0;
}

/* ボール（部屋の中）: 羊毛フェルトの絵・ふちの線なし・ぽんっと出て少しはずむ（2026-09-29 オーナー「デカくて顔に重なる・デザインが低い」） */
.dog-room .ball {
  inline-size: 72px;
  block-size: 72px;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 5px 4px rgba(59, 47, 40, .28));
  animation: mf-light .5s linear both, mf-nudge 3.2s linear 1.4s infinite;   /* ぴょこっと出て、数秒に1回だけ合図 */
}
.dog-room .ball img { display: block; inline-size: 100%; block-size: 100%; pointer-events: none; }
.dog-room .ball:disabled { animation: none; cursor: default; }
@media (prefers-reduced-motion: reduce) { .dog-room .ball { animation: none; } }

/* 指示書11: ボールだけ床を広く見せる。ほかの部屋の切り取り・犬の位置は変えない。 */
.dog-room.ball-room > .outing-scene__background { object-position: 50% 50%; }
.ball-room > .dog-room__dog { pointer-events: none; }
.dog-room .ball.ball--new { animation: none; filter: none; }
.dog-room .ball.ball--new img { filter: drop-shadow(0 4px 3px var(--color-shadow-strong)); }
.dog-room .ball.ball--new.is-rest img { animation: mf-nudge 3.2s linear 1.2s infinite; }
.ball-shadow { position: absolute; z-index: 5; block-size: 12px; border-radius: var(--radius-round); background: radial-gradient(closest-side, var(--color-shadow-strong), var(--color-transparent)); pointer-events: none; }
.ball-pips { display: flex; justify-content: center; gap: 10px; margin: 2px 0 0; padding: 0; list-style: none; }
.ball-pip { inline-size: 38px; block-size: 38px; }
.ball-pip img { display: block; inline-size: 100%; block-size: 100%; opacity: .25; filter: grayscale(.85); transition: opacity .2s, filter .2s; }
.ball-pip.is-on img { opacity: 1; filter: drop-shadow(0 3px 2px var(--color-shadow-strong)); }
.ball-end { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.ball-end > .ball-note { grid-column: 1 / -1; }
.ball-note { margin: 0; text-align: center; color: var(--color-deep); font-size: 24px; font-weight: 700; line-height: 1.4; }
.ball-end .btn .ph { white-space: nowrap; }
/* 指示書14: とってこい。走るのは犬の入れ物だけ、ほこりは見本と同じ小さな2粒。 */
.fetch-dust { position: absolute; z-index: 11; border-radius: 50%; background: radial-gradient(closest-side, rgba(214, 186, 150, .75), rgba(214, 186, 150, 0)); pointer-events: none; }
.fetch-room > .ball-shadow { z-index: 2; }
.fetch-still-hearts { position: absolute; top: 12px; left: 0; right: 0; z-index: 11; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.fetch-still-hearts svg { inline-size: 26px; block-size: 26px; fill: var(--color-heart); stroke: var(--color-white); stroke-width: 2px; }
.guide-tip.is-fetch.is-on, .guide-tip.is-oto.is-on, .guide-tip.is-fureai.is-on { animation: none; } /* この5つの遊びの案内は文字を拡大せず、既存のopacity遷移だけ。 */
/* 指示書12: 承認見本の小さなおもちゃ札。主な操作・本文の大きさはそのまま。 */
.ball-under { display: grid; justify-items: center; gap: 8px; }
.toy-pick { margin: 0; text-align: center; }
.toy-pick__cap { margin: 0 0 4px; color: var(--color-deep); font-size: 17px; font-weight: 700; }
.toy-pick__row { display: flex; justify-content: center; gap: 6px; }
.toy-chip { position: relative; display: grid; justify-items: center; gap: 2px; inline-size: 82px; padding: 6px 1px 4px; border: var(--line) solid var(--color-soft); border-radius: 16px; background: var(--color-white); color: var(--color-ink); font: inherit; font-size: 16px; font-weight: 700; line-height: 1.2; cursor: pointer; touch-action: manipulation; }
.toy-chip img { inline-size: 46px; block-size: 46px; object-fit: contain; pointer-events: none; }
.toy-chip span { white-space: nowrap; }
.toy-chip[aria-pressed="true"] { border-color: var(--color-deep); background: var(--color-soft); }
.toy-chip__new { position: absolute; top: -8px; right: -4px; padding: 1px 6px; border-radius: var(--radius-round); background: var(--color-primary); color: var(--color-ink); font-size: 12px; font-style: normal; line-height: 1.5; }
@media (min-width: 768px) and (max-height: 820px) and (orientation: landscape) {
  .ball-under { grid-auto-flow: column; align-items: center; justify-content: center; gap: 28px; }
  .toy-pick { display: flex; align-items: center; gap: 10px; }
  .toy-pick__cap { margin: 0; writing-mode: horizontal-tb; }
}
@media (max-width: 767px) { .ball-under.is-end .toy-pick { display: none; } }
@media (max-height: 850px) { .ball-screen { gap: var(--space-1); } }
@media (prefers-reduced-motion: reduce) {
  .dog-room .ball.ball--new.is-rest img { animation: none; }
  .ball-pip img { transition: none; }
}

/* おやつポーチ・おもちゃ箱・押し入れ（指示書08） */
.treat-pouch {
  position: absolute;
  z-index: var(--z-overlay);
  inset-inline-end: 6%;
  inset-block-end: 6%;
  inline-size: 30%;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 6px 5px var(--color-shadow-strong));
  animation: mf-nudge 3.2s linear 1s infinite;   /* ずっと ゆれず、数秒に1回だけ合図 */
  pointer-events: none;
}

.treat-pouch__body {
  position: relative;
  z-index: var(--z-base);
  inline-size: 100%;
  block-size: auto;
  pointer-events: none;
}

.treat-pouch .treat-item {
  position: absolute;
  z-index: var(--z-raised);
  inset: auto;
  left: 50%;
  top: 44%;
  display: grid;
  place-items: center;
  inline-size: 62%;
  min-inline-size: 80px;
  block-size: 80px;
  padding: 6px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--color-transparent);
  translate: -50% -50%;
  cursor: grab;
  touch-action: none;
  transition: top .4s cubic-bezier(.2, 1.4, .4, 1), transform .6s cubic-bezier(.3, .8, .3, 1), opacity .3s ease .45s;
  animation: none;
  pointer-events: auto;
}

.treat-pouch__front {
  position: absolute;
  z-index: var(--z-overlay);
  inset: 0;
  background: url('../img/treat_pouch.png') center / contain no-repeat;
  clip-path: inset(56% 0 0 0);
  pointer-events: none;
}

.treat-pouch.is-ready .treat-item {
  top: 22%;
}

.treat-pouch .treat-item.is-waiting {
  cursor: default;
}

.treat-pouch .treat-item.is-dragging {
  cursor: grabbing;
  transition: none;
}


#app .toybox-room > .dog-room__dog {
  inset-inline-start: 2%;
  inline-size: 46% !important;
}

.dog-room.toybox-room {
  aspect-ratio: 3 / 2;
}

.toy-chest {
  position: absolute;
  z-index: var(--z-raised);
  left: 50%;
  bottom: 3%;
  inline-size: 34%;
  translate: -50% 0;
  filter: drop-shadow(0 6px 5px var(--color-shadow-strong));
  pointer-events: none;
}



.toy-favorite {
  position: absolute;
  z-index: var(--z-overlay);
  inline-size: 20%;
  filter: drop-shadow(0 4px 4px var(--color-shadow-strong));
  transform-origin: 50% 90%;
  animation: mf-sway 1.3s linear both;   /* 出て ゆれ戻りで止まる（3つが ずっと ゆれていた） */
  animation-delay: var(--toy-favorite-delay, 0s);
  pointer-events: none;
}

.toy-favorite--missing {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding: var(--space-1);
  border-radius: var(--radius-round);
  background: var(--color-soft);
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}


.toy-favorites {
  gap: var(--space-1);
}

.toy-favorites h2 {
  margin-block-start: 6px;
}

.toy-favorites .note {
  margin: 0;
}

.toycard-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  inline-size: 100%;
}

.toycard {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-1);
  min-inline-size: 0;
  min-block-size: 88px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--color-white);
  box-shadow: 0 5px 0 var(--color-soft);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  text-align: start;
  word-break: keep-all;
}

.toycard::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px dashed var(--color-soft);
  border-radius: var(--radius-control);
  pointer-events: none;
}

.toycard > img,
.toycard__missing {
  position: relative;
  z-index: var(--z-base);
  display: grid;
  place-items: center;
  inline-size: 56px;
  block-size: 56px;
  object-fit: contain;
}

.toycard__missing {
  color: var(--color-primary);
  font-size: 32px;
}

.toycard__copy {
  position: relative;
  z-index: var(--z-base);
  display: grid;
  align-content: center;
  min-inline-size: 0;
}

.toycard__name {
  display: block;
  min-inline-size: 0;
  letter-spacing: -.04em;
}

.toycard .ph {
  white-space: nowrap;
}

.toycard__phrase--medium,
.toycard__phrase--long {
  display: block;
  inline-size: 100%;
  transform-origin: left center;
}

.toycard__phrase--medium { transform: scaleX(.9); }
.toycard__phrase--long { transform: scaleX(.74); }

.toycard small {
  display: block;
  color: var(--color-deep);
  font-size: 24px;
}

.toy-closet.enter .toycard {
  animation: mf-text .45s linear both;
}

.toy-closet.enter .toycard:nth-child(2) { animation-delay: .08s; }
.toy-closet.enter .toycard:nth-child(3) { animation-delay: .16s; }
.toy-closet.enter .toycard:nth-child(4) { animation-delay: .24s; }
.toy-closet.enter .toycard:nth-child(5) { animation-delay: .32s; }
.toy-closet.enter .toycard:nth-child(6) { animation-delay: .40s; }


@media (prefers-reduced-motion: reduce) {
  .treat-pouch,
  .toy-favorite,
  .toy-closet.enter .toycard {
    animation: none;
  }

  .treat-pouch .treat-item {
    transition: none;
  }
}

/* 残りの画面を部屋と羊毛フェルトにそろえる（指示書09） */
.dog-room.room--band {
  aspect-ratio: auto;
  block-size: clamp(160px, 46vw, 230px);
}

.dog-room.room--band > .outing-scene__background {
  object-position: 50% 46%;
}

#app .dog-room.room--band > .dog-room__dog {
  inset: auto auto -20% 50%;
  inline-size: auto !important;
  block-size: 118%;
  margin: 0;
  translate: -50% 0;
}

.felt {
  position: relative;
}

.felt::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px dashed var(--color-primary);
  border-radius: calc(var(--radius-card) - 6px);
  opacity: .45;
  pointer-events: none;
}

.choice-card.felt::after,
.family-card.felt::after {
  inset: 5px;
  border-color: var(--color-soft);
  border-radius: calc(var(--radius-card) - 5px);
  opacity: 1;
}

.choice-card.felt[aria-pressed="true"]::after,
.family-card.felt[aria-pressed="true"]::after,
.choice-card.felt.is-selected::after,
.family-card.felt.is-selected::after {
  border-color: var(--color-deep);
  opacity: .35;
}

.question-card.felt,
.family-code-card.felt {
  box-shadow: 0 6px 0 var(--color-soft);
}

.hint-card.felt::after {
  opacity: .35;
}

.family-card.felt .select-card__label,
.family-card.felt .select-card__state {
  overflow: visible;
  white-space: nowrap;
}

.family-code-card.felt {
  background: var(--color-bg);
}

.code-tiles {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 2px 0 4px;
}

.code-tiles span {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 58px;
  block-size: 70px;
  border-radius: var(--radius-control);
  background: var(--color-primary);
  box-shadow: 0 5px 0 var(--color-deep);
  color: var(--color-ink);
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}

.code-tiles span::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px dashed var(--color-bg);
  border-radius: calc(var(--radius-control) - 5px);
  opacity: .72;
  pointer-events: none;
}

/* 羊毛フェルトのしあわせのびん。ハートはガラス画像の後ろに置く。 */
.jar {
  position: relative;
  isolation: isolate;
  aspect-ratio: 340 / 392;
  pointer-events: none;
}

.jar__hearts {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
}

.jar__heart {
  position: absolute;
  translate: -50% -50%;
  filter: drop-shadow(0 2px 1px var(--color-shadow));
  pointer-events: none;
}

.jar__glass {
  position: absolute;
  inset: 0;
  z-index: var(--z-raised);
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.jar__label {
  position: absolute;
  z-index: var(--z-overlay);
  inset-inline-start: 50%;
  inset-block-start: 64%;
  display: grid;
  justify-items: center;
  color: var(--color-deep);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  translate: -50% -50%;
}

.jar__label small {
  font-size: 24px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.jar__label b {
  font-size: 1em;
}

.jar__label.is-bump b {
  animation: mf-number .5s linear;
}

.jar__heart.is-new {
  --mf-fall: -120%;
  animation: mf-settle .75s linear both;   /* びんに入って ストン */
}



.dog-room.book-room {
  aspect-ratio: 3 / 2;
}

#app .dog-room.book-room > .dog-room__dog {
  inset-inline-start: 2%;
  inset-block-end: -8%;
  inline-size: 54% !important;
}

.book-room .jar {
  position: absolute;
  z-index: var(--z-overlay);
  inset-inline-end: 5%;
  inset-block-end: 4%;
  inline-size: 38%;
  filter: drop-shadow(0 8px 6px var(--color-shadow-strong));
}

.book-lead,
.shop-lead {
  margin: 0;
  text-align: center;
}

.book-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  inline-size: 100%;
}

.book-card {
  display: grid;
  gap: 6px;
  min-inline-size: 0;
  min-block-size: 80px;
  padding: 10px 10px 12px;
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-white);
  box-shadow: 0 6px 0 var(--color-deep);
  color: var(--color-ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.book-card.felt::after,
.shop-card.felt::after {
  inset: 5px;
  border-radius: calc(var(--radius-card) - 5px);
}

.book-card img {
  inline-size: 100%;
  aspect-ratio: 16 / 10;
  border-radius: calc(var(--radius-control) - 4px);
  object-fit: cover;
  pointer-events: none;
}

.book-card b {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
}

.book-card small {
  color: var(--color-deep);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
}

.book-card:disabled {
  border-color: var(--color-soft);
  box-shadow: none;
  cursor: default;
}

.book-card:disabled img {
  filter: saturate(.35) brightness(1.08);
  opacity: .6;
}

.book-card:disabled b {
  color: var(--color-disabled);
}

/* レベルアップでは、犬とびんを横に並べる。 */
.level-up-screen .level-celebration.lv-scene {
  aspect-ratio: 4 / 3;
  block-size: auto;
  background: var(--color-bg);
  box-shadow: 0 8px 0 var(--color-soft);
}

.lv-scene .fx-rays {
  position: absolute;
  inset: -60%;
}

.level-celebration.lv-scene .level-up-dog {
  inset: auto auto -4% 1%;
  inline-size: 56%;
  margin: 0;
  transform: none;
}

.lv-scene .jar {
  position: absolute;
  z-index: var(--z-overlay);
  inset-inline-end: 5%;
  inset-block-end: 8%;
  inline-size: 36%;
  filter: drop-shadow(0 8px 6px var(--color-shadow-strong));
}

.lv-scene .jar__label {
  font-size: 38px;
}

.level-heart-flight {
  position: fixed;
  z-index: var(--z-overlay);
  block-size: auto;
  filter: drop-shadow(0 3px 2px var(--color-shadow-strong));
  pointer-events: none;
}

/* 洋服屋さん */
.dog-room.shop-room,
.dog-room.shop-confirm-room {
  aspect-ratio: 3 / 2;
}

#app .dog-room.shop-room > .dog-room__dog {
  inset-inline-start: 25%;
  inset-block-end: -10%;
  inline-size: 50% !important;
}

#app .dog-room.shop-confirm-room > .dog-room__dog {
  inset-inline-start: 18%;
  inset-block-end: -12%;
  inline-size: 64% !important;
}

.shop-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  inline-size: 100%;
}

.shop-card {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-inline-size: 0;
  min-block-size: 80px;
  padding: 8px 6px 12px;
  border: var(--line) solid var(--color-primary);
  border-radius: var(--radius-card);
  background: var(--color-white);
  box-shadow: 0 6px 0 var(--color-soft);
  color: var(--color-ink);
  font: inherit;
  cursor: pointer;
}

.shop-card__image {
  inline-size: 88%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px var(--color-shadow-strong));
  pointer-events: none;
}

.shop-card b {
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.shop-card b .accessory-name__phrase,
.item-tag .accessory-name__phrase {
  white-space: nowrap;
}

.shop-card .shop-slot {
  padding: 0;
  background: var(--color-transparent);
  font-size: 24px;
}

.enter .shop-card,
.enter .book-card {
  animation: mf-text .45s linear backwards;
}

.enter .shop-card:nth-child(2),
.enter .book-card:nth-child(2) {
  animation-delay: .1s;
}

.enter .shop-card:nth-child(3) {
  animation-delay: .2s;
}


@media (hover: hover) and (pointer: fine) {
  .shop-card:hover .shop-card__image {
    animation: accessory-sway 1.2s ease-in-out infinite;
  }
}

@keyframes accessory-sway {
  0%, 100% { rotate: -4deg; }
  50% { rotate: 4deg; }
}

.item-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}

.item-tag__image {
  flex: 0 0 auto;
  inline-size: 56px;
  block-size: 56px;
  object-fit: contain;
  pointer-events: none;
}

/* クローゼットの札に小物の絵を添える。 */
.closet-screen .closet-item {
  display: grid;
  grid-template-columns: 48px 36px minmax(0, 1fr);
  grid-template-areas:
    "image mark label"
    "image mark state";
  column-gap: var(--space-1);
  row-gap: 0;
}

.closet-screen .closet-item.has-missing-accessory {
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas:
    "mark label"
    "mark state";
}

.closet-item__image {
  grid-area: image;
  inline-size: 48px;
  block-size: 48px;
  object-fit: contain;
  pointer-events: none;
}

.closet-screen .closet-item .choice-mark {
  grid-area: mark;
}

.closet-screen .closet-item .select-card__label,
.closet-screen .closet-item .select-card__state {
  overflow: visible;
}

.closet-screen .closet-item .select-card__label {
  grid-area: label;
  overflow: visible;
  white-space: normal;
}

.closet-screen .closet-item .select-card__state {
  grid-area: state;
  justify-self: start;
}

.closet-screen .closet-item .accessory-name__phrase,
.closet-screen .closet-item .select-card__state {
  white-space: nowrap;
}

.book-card:focus-visible,
.shop-card:focus-visible {
  outline: var(--focus-line) solid var(--color-deep);
  outline-offset: 4px;
}

.book-card:active,
.shop-card:active {
  transform: scale(.98);
}

@media (max-width: 480px) {
  /* スマホの3列のカードは、字を横につぶさず、見本（proto/screens09.html）と同じ大きさに（2026-10-01 検品） */
  .shop-card b {
    font-size: 22px;
  }

  .shop-card .shop-slot {
    font-size: 18px;
  }

  .code-tiles {
    gap: var(--space-1);
  }

  .closet-screen .closet-item {
    padding-inline: 10px;
  }
}

/* 320pxの小さなiPhoneでも、4文字の名前（バンダナ・マフラー）がカードに おさまるように */
@media (max-width: 360px) {
  .shop-cards {
    gap: var(--space-1);
  }

  .shop-card {
    padding-inline: 4px;
  }

  .shop-card b {
    font-size: 19px;
  }
}

@media (max-width: 480px) and (max-height: 850px) {
  .dog-room.room--band {
    block-size: 160px;
  }

  .settings-screen.screen--with-back {
    padding-block-start: 0;
  }

  .settings-screen > h1 {
    min-block-size: 48px;
    padding-block-start: 2px;
  }

  .settings-screen .family-code-card {
    gap: 4px;
    padding-block: 10px;
    padding-inline: 12px;
  }

  .settings-screen .family-code-copy {
    line-height: 1.4;
  }

  .settings-screen .btn--line {
    flex-wrap: nowrap;
    gap: var(--space-1);
    min-block-size: 96px;
    padding-block: var(--space-1);
  }

  .settings-screen .btn--line .phrase {
    min-inline-size: 0;
  }

  [data-screen="family-settings"] .screen,
  [data-screen="notify-settings"] .notify-screen {
    gap: var(--space-1);
  }

  [data-screen="family-settings"] .screen--with-back {
    padding-block-start: 56px;
  }

  [data-screen="family-settings"] h1,
  [data-screen="notify-settings"] .notify-screen h1 {
    line-height: 1.2;
  }

  [data-screen="family-settings"] .lead {
    line-height: 1.35;
  }

  [data-screen="family-settings"] .note {
    line-height: 1.35;
  }

  [data-screen="family-settings"] .error:empty {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jar__label.is-bump b,
  .jar__heart.is-new,
  .enter .shop-card,
  .enter .book-card,
  .shop-card:hover .shop-card__image {
    animation: none;
  }
}

/* 読み直しのあいだの肉球のしるし（画面の下・0.35秒より長いときだけ見える・2026-10-02） */
.page-loading {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000;
  display: flex; align-items: center; padding: 12px 20px; border-radius: 999px;
  background: rgba(255, 250, 243, .94); box-shadow: 0 6px 20px var(--color-shadow); pointer-events: none;
  animation: dog-loading-in .3s ease-out .35s both;
}
.page-loading .dog-loading__paws svg { inline-size: 30px; block-size: 30px; }
/* クローゼット: 押した小物のカードは、返事を待つあいだ薄くする（2026-10-02） */
.choice-card.is-busy { opacity: .55; transform: scale(.97); transition: opacity .15s, transform .15s; }

/* ---------- 新しい答え方（2026-10-02・見本 proto/answers.html でオーナー了承） ---------- */
/* おぼえる: フェルトのお盆と ギンガムの布 */
.memo-area { display: grid; gap: var(--space-2); }
.memo-tray { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 18px 14px 14px;
  border-radius: var(--radius-card); background: #FBEBD3; box-shadow: 0 6px 0 var(--color-soft), inset 0 2px 0 rgba(255, 255, 255, .6); overflow: hidden; min-block-size: 150px; }
.memo-item { display: grid; justify-items: center; gap: 4px; }
.memo-item img { inline-size: min(100%, clamp(92px, 17vw, 150px)); aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 6px 4px rgba(59, 47, 40, .18)); }
.memo-item span { font-size: clamp(22px, 3vw, 28px); font-weight: 800; line-height: 1.2; }
.memo-cloth { position: absolute; inset: 0; z-index: 2; border-radius: var(--radius-card); pointer-events: none; transform: translateY(-110%);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0) 0 22px, rgba(255, 255, 255, .38) 22px 44px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 22px, rgba(255, 255, 255, .38) 22px 44px),
    #EE9A62;
  box-shadow: 0 10px 18px rgba(59, 47, 40, .18); }
.memo-cloth::after { content: ""; position: absolute; inset: 8px; border: 3px dashed rgba(255, 248, 238, .85); border-radius: calc(var(--radius-card) - 8px); }
.memo-cloth .paw { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; inline-size: 64px; fill: #FFF8EE; opacity: .9; }
.memo-peek-row { margin: 0; text-align: center; }
.pic-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pic-choices[hidden] { display: none; }
.pic-choices:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* ヒントで2つのとき */
.pic-choice { display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border: var(--line) solid var(--color-soft); border-radius: var(--radius-card);
  background: var(--color-white); font: inherit; color: var(--color-ink); cursor: pointer; }
.pic-choice img { inline-size: min(100%, clamp(90px, 15vw, 140px)); aspect-ratio: 1; object-fit: contain; }
.pic-choice span { font-size: 22px; font-weight: 800; }
.pic-choice.felt::after { inset: 5px; border-radius: calc(var(--radius-card) - 5px); }
.pic-choice.fx-dim { opacity: .45; }
.pic-choice.fx-right { border-color: var(--color-ok) !important; background: #E7F5EC !important; box-shadow: 0 0 0 4px rgba(47, 125, 79, .22); }
.pic-choice.fx-gold { background: #FFC94D !important; border-color: var(--color-deep) !important; }
.pic-choice .fx-answer-tag { margin: 2px 0 0; font-size: 16px; }

/* ならべる: わく と フェルトの札 */
.order-area { display: grid; gap: var(--space-2); }
.order-slots, .order-tiles { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.order-tiles { min-block-size: 92px; }
.order-slot { position: relative; display: grid; place-items: center; inline-size: 76px; block-size: 86px; border-radius: 20px;
  background: rgba(255, 227, 194, .55); border: 3px dashed rgba(242, 140, 40, .55); }
.order-slot small { position: absolute; inset: auto auto 4px 50%; translate: -50% 0; font-size: 14px; font-weight: 800; color: rgba(184, 79, 0, .55); }
.order-tile { position: relative; display: grid; place-items: center; inline-size: 76px; block-size: 86px; padding: 0; border: 0; border-radius: 20px; cursor: pointer;
  background: #FFF8EE; color: var(--color-ink); font: inherit; font-size: 40px; font-weight: 900; line-height: 1; box-shadow: 0 6px 0 #F2C79A; touch-action: manipulation; }
.order-slot .order-tile { position: absolute; inset: -3px; inline-size: auto; block-size: auto; }
.order-tile::after { content: ""; position: absolute; inset: 5px; border: 2px dashed rgba(242, 140, 40, .55); border-radius: 15px; pointer-events: none; }
.order-tile.is-right { background: #EAF6EE; box-shadow: 0 6px 0 #B9DFC6; }
.order-tile.is-right::after { border-color: rgba(47, 125, 79, .45); }
.order-tile:disabled { cursor: default; }
.order-note, .tap-note { margin: 0; text-align: center; }

/* じゅんばんに: 部屋の床の フェルトのボール（部屋は少し高く・犬は小さめで まんなか） */
.dog-room.room--floor { aspect-ratio: 3 / 2.2; }
.dog-room.room--floor > .outing-scene__background { object-position: 50% 40%; }
#app .dog-room.room--floor > .dog-room__dog { inset: auto auto 2% 50% !important; inline-size: 36% !important; translate: -50% 0; }
.num-ball { position: absolute; z-index: 5; inline-size: 16%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; translate: -50% -50%; touch-action: manipulation; }
.num-ball img { inline-size: 100%; block-size: 100%; filter: drop-shadow(0 6px 4px rgba(59, 47, 40, .25)); pointer-events: none; }
.num-ball b { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; display: grid; place-items: center; inline-size: 52%; aspect-ratio: 1; border-radius: 50%;
  background: #FFF8EE; color: var(--color-deep); font-size: clamp(22px, 6vw, 34px); font-weight: 900; box-shadow: 0 2px 0 rgba(184, 79, 0, .25); }
.num-ball b::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 2px dashed rgba(242, 140, 40, .5); }
.num-ball.is-done { pointer-events: none; }

/* おと（あそぶ）: ハートの道と、大きな「ぽん」 */
.oto-song-label { display: grid; justify-items: center; gap: 8px; min-inline-size: 0; }
.oto-song-label #otoCard { margin: 0; padding: var(--space-2); font-size: clamp(22px, 6.4vw, 30px); }
.oto-song-label #otoCard .ph { white-space: nowrap; }
.oto-season { position: relative; margin: 0; padding: 5px 16px; border: 3px solid var(--color-primary); border-radius: var(--radius-control); background: var(--color-soft); color: var(--color-ink); font-size: 22px; font-weight: 800; box-shadow: 0 3px 0 var(--color-soft); }
.oto-season::after { content: ""; position: absolute; inset: 3px; border: 1px dashed rgba(184, 79, 0, .4); border-radius: 12px; pointer-events: none; }
.oto-lane { position: relative; block-size: 120px; border-radius: 60px; background: #FBEBD3; box-shadow: 0 6px 0 var(--color-soft), inset 0 3px 0 rgba(255, 255, 255, .6); overflow: hidden; }
.oto-lane::before { content: ""; position: absolute; inset: 50% 24px auto 24px; border-top: 3px dashed rgba(242, 140, 40, .45); }
.oto-target { position: absolute; inset: 50% auto auto 70px; translate: -50% -50%; inline-size: 92px; aspect-ratio: 1; border-radius: 50%; border: 4px dashed var(--color-primary); background: rgba(255, 248, 238, .8); }
.oto-target .paw { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; inline-size: 44px; fill: rgba(242, 140, 40, .45); }
.oto-note { position: absolute; inset: 50% auto auto 0; inline-size: 64px; aspect-ratio: 1; translate: -50% -50%; will-change: transform; pointer-events: none; }
.oto-note img { inline-size: 100%; block-size: 100%; }
.oto-pad { display: grid; place-items: center; gap: 4px; inline-size: 100%; min-block-size: 150px; border: 0; border-radius: var(--radius-card); cursor: pointer;
  background: var(--color-primary); color: var(--color-ink); font: inherit; font-size: 34px; font-weight: 900; box-shadow: 0 8px 0 var(--color-deep); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.oto-pad small { font-size: 18px; font-weight: 700; }
.oto-pad:active, .oto-pad.is-hit { transform: translateY(4px); box-shadow: 0 4px 0 var(--color-deep); }
.oto-count { margin: 0; text-align: center; font-size: 22px; font-weight: 800; color: var(--color-deep); min-block-size: 1.4em; }

/* ---------- レベルアップ（箱庭・2026-10-02 見本 proto/levelup-hako.html でオーナー了承） ---------- */
.level-up-screen.hk-level { justify-content: flex-start; align-items: center; }
.hk-level .hk-ribbon { block-size: 92px; flex: 0 0 92px; }
.hk-stage { position: relative; inline-size: min(100%, 460px); aspect-ratio: 1 / 1; margin-inline: auto; flex: 0 0 auto; }
.hk-rays { position: absolute; inset: -10%; border-radius: 50%; overflow: hidden; opacity: .55; pointer-events: none;
  -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%); mask: radial-gradient(circle, #000 35%, transparent 70%); }
.hk-rays .fx-rays { position: absolute; inset: -40%; }
.hk-hako { position: absolute; inset: 0; pointer-events: none; }
.hk-part { position: absolute; block-size: auto; opacity: 0; transform-origin: 50% 100%; -webkit-user-drag: none; filter: drop-shadow(0 3px 2px rgba(59, 47, 40, .18)); }
.hk-part.in { opacity: 1; }
.hk-part.is-new { filter: drop-shadow(0 0 10px rgba(255, 236, 170, .95)) drop-shadow(0 3px 2px rgba(59, 47, 40, .18)); }
.hk-puff { position: absolute; inline-size: 5%; aspect-ratio: 1; border-radius: 50%; background: #fff; opacity: 0; box-shadow: inset -2px -3px 0 rgba(200, 190, 175, .6); pointer-events: none; }
.hk-dust .hk-puff { animation: hk-dust .7s ease-out both; }
@keyframes hk-dust { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: translate(var(--dx), -40%) scale(1.6); } }
.hk-dogbox { position: absolute; left: 25%; top: 31%; inline-size: 50%; block-size: 50%; opacity: 0; z-index: 3; }
.hk-dogbox .dog-stage { inline-size: 100% !important; block-size: 100%; margin: 0; }
.hk-dogbox.in { animation: hk-dog 2.2s ease-out both; }
@keyframes hk-dog { 0% { opacity: 0; transform: translateY(6%) scale(.9); filter: brightness(2.4) drop-shadow(0 0 18px #fff6d0); }
  45% { opacity: 1; transform: translateY(-2%) scale(1.02); filter: brightness(1.8) drop-shadow(0 0 22px #fff3c4); }
  100% { opacity: 1; transform: none; filter: none; } }
.hk-glow { position: absolute; inline-size: 60%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: 0; z-index: 4; translate: -50% -50%;
  background: radial-gradient(circle, rgba(255, 250, 225, .95) 0 28%, rgba(255, 226, 150, .5) 46%, rgba(255, 226, 150, 0) 70%); }
.hk-glow.on { animation: hk-glow 2.6s ease-out both; }
@keyframes hk-glow { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
.hk-twk { position: absolute; inline-size: 7%; aspect-ratio: 1; z-index: 5; pointer-events: none; opacity: 0; color: #FFC94D; font-size: clamp(16px, 6vw, 28px); line-height: 1; text-align: center;
  -webkit-text-stroke: 1px #E3A21C; animation: hk-twk 1.4s ease-in-out both; }
@keyframes hk-twk { 0% { opacity: 0; transform: scale(0) rotate(0); } 40% { opacity: 1; transform: scale(1.2) rotate(20deg); } 100% { opacity: 0; transform: scale(.4) rotate(60deg); } }
.hk-new-tag { position: absolute; z-index: 6; translate: -50% -100%; padding: 2px 10px; border-radius: 999px; background: #FFC94D; color: var(--color-deep);
  font-size: 15px; font-weight: 900; white-space: nowrap; box-shadow: 0 3px 0 #E3A21C; opacity: 0; pointer-events: none; }
.hk-new-tag.in { animation: hk-tag-in .5s ease-out both; }
@keyframes hk-tag-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hk-gift { top: 30% !important; inline-size: 40% !important; margin-left: -20% !important; z-index: 8; cursor: pointer; pointer-events: auto; }
.hk-gift-act { inline-size: 100%; margin-top: -8px; }
.hk-jar-spot { position: absolute; right: -1%; bottom: -3%; inline-size: 25%; z-index: 7; filter: drop-shadow(0 6px 6px rgba(59, 47, 40, .18)); }
.hk-level .jar { inline-size: 100%; }
.hk-level .jar__label { font-size: clamp(20px, 5vw, 30px); }
.hk-level .jar__label small { font-size: clamp(11px, 2.8vw, 18px); }
.hk-after { display: grid; gap: var(--space-3); inline-size: 100%; opacity: 0; pointer-events: none; }
.hk-after.in { opacity: 1; pointer-events: auto; transition: opacity .4s; }
@media (prefers-reduced-motion: reduce) { .hk-glow, .hk-twk { display: none; } .hk-part.in, .hk-dogbox.in { animation: none !important; opacity: 1; } }

/* ---------- 車で移動（箱庭・2026-10-02 見本 proto/travel-hako.html） ---------- */
.tv-screen { gap: 14px; align-items: center; }
.tv-top { order: -1; display: flex; justify-content: space-between; align-items: center; inline-size: 100%; }
.tv-top .sound-toggle, .tv-top .travel-skip { position: static; }
.tv-intro, .tv-main { display: flex; flex-direction: column; align-items: center; gap: 14px; inline-size: 100%; }
.tv-intro[hidden], .tv-main[hidden], .tv-intro-act[hidden] { display: none; }
.tv-intro-card { inline-size: 100%; margin: 0; }
.tv-intro-scene { position: relative; inline-size: min(100%, 520px); aspect-ratio: 4 / 3.3; }
.tv-dest { position: absolute; left: 6%; top: 0; inline-size: 88%; aspect-ratio: 3 / 2; border-radius: var(--radius-card); overflow: hidden; background: var(--color-cream, #FFF6E8);
  border: 6px solid #FFF8EE; box-shadow: 0 6px 0 var(--color-soft), 0 10px 18px rgba(59, 47, 40, .14); }
.tv-dest img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.tv-dest.felt::after { inset: 4px; border-radius: calc(var(--radius-card) - 8px); }
.tv-dest-name { position: absolute; left: 50%; top: 10px; translate: -50% 0; padding: 4px 14px; border-radius: 12px; background: #FFF8EE; color: var(--color-deep);
  font-weight: 900; font-size: clamp(16px, 4.4vw, 22px); box-shadow: 0 3px 0 #D9B48A; white-space: nowrap; }
.tv-intro-car { position: absolute; left: 50%; bottom: 0; inline-size: 52%; translate: -50% 0; z-index: 4; cursor: pointer; filter: drop-shadow(0 6px 4px rgba(59, 47, 40, .2)); }
.tv-intro-car.is-wiggle { animation: tv-wiggle .6s ease-in-out 2; }
@keyframes tv-wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -4deg; translate: -50% -3%; } 75% { rotate: 4deg; translate: -50% 0; } }
.tv-intro-car.is-go { animation: tv-go .5s ease-in both; }
@keyframes tv-go { to { transform: translate(-30%, -60%) scale(.5); opacity: 0; } }   /* 行き先の写真へ 走っていく */
.tv-intro-act { inline-size: 100%; }
.tv-ribbon { position: relative; inline-size: 100%; block-size: 92px; flex: 0 0 92px; }
.tv-stage { position: relative; inline-size: min(100%, 620px); aspect-ratio: 4 / 3; margin-inline: auto; }
.tv-sky { position: absolute; inset: 0 0 35% 0; border-radius: 40% 40% 0 0 / 30% 30% 0 0; background: radial-gradient(ellipse at 50% 70%, rgba(255, 244, 222, .9), rgba(255, 244, 222, 0) 70%); pointer-events: none; }
.tv-part { position: absolute; block-size: auto; opacity: 0; transform-origin: 50% 100%; filter: drop-shadow(0 3px 2px rgba(59, 47, 40, .18)); -webkit-user-drag: none; }
.tv-part.in { opacity: 1; }
.tv-cloud.in { animation: tv-drift 14s ease-in-out infinite alternate; }
@keyframes tv-drift { from { translate: 0 0; } to { translate: 6% 0; } }
.tv-signname { position: absolute; z-index: 30; translate: -50% -100%; padding: 3px 12px 4px; border-radius: 12px; background: #FFF8EE; color: var(--color-deep);
  font-weight: 900; font-size: clamp(13px, 3.4vw, 19px); white-space: nowrap; opacity: 0; box-shadow: 0 3px 0 #D9B48A; pointer-events: none; }
.tv-signname::after { content: ""; position: absolute; inset: 3px; border: 2px dashed rgba(242, 140, 40, .55); border-radius: 9px; }
.tv-signname.in { opacity: 1; transition: opacity .4s; }
.tv-rig { position: absolute; inline-size: 38%; aspect-ratio: 420 / 314; translate: -50% -100%; transform-origin: 50% 100%; z-index: 20; opacity: 0; }
.tv-rig.in { opacity: 1; }
.tv-rig .tv-dog { position: absolute; left: 22%; bottom: 39%; inline-size: 52%; aspect-ratio: 1; opacity: 0; z-index: 2; }
.tv-rig .tv-dog .dog-stage { inline-size: 100%; block-size: 100%; margin: 0; }
/* 車の前半分（ドア・ボンネット）だけを、わんこの前にもう一度かさねる → わんこが座席に座って見える。運転席の前のふち（ななめ）に沿って切る */
.tv-rig .tv-car-front { position: absolute; left: 0; bottom: 0; inline-size: 100%; z-index: 3; pointer-events: none;
  clip-path: polygon(0 36%, 24% 26%, 36% 30%, 56% 43%, 64% 43%, 74% 35%, 100% 30%, 100% 100%, 0 100%); }
.tv-rig .tv-car { position: absolute; left: 0; bottom: 0; inline-size: 100%; z-index: 1; filter: drop-shadow(0 4px 3px rgba(59, 47, 40, .22)); }
.tv-rig.is-driving .tv-car, .tv-rig.is-driving .tv-car-front { animation: tv-bob .32s ease-in-out infinite; }
@keyframes tv-bob { 50% { transform: translateY(-2.5%) rotate(-.6deg); } }
.tv-rig .tv-dog.in { animation: tv-dog 2s ease-out both; }
@keyframes tv-dog { 0% { opacity: 0; transform: translateY(8%) scale(.9); filter: brightness(2.4) drop-shadow(0 0 14px #fff6d0); } 45% { opacity: 1; filter: brightness(1.8) drop-shadow(0 0 18px #fff3c4); } 100% { opacity: 1; transform: none; filter: none; } }
.tv-glow { position: absolute; inline-size: 30%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: 0; z-index: 25; translate: -50% -50%;
  background: radial-gradient(circle, rgba(255, 250, 225, .95) 0 28%, rgba(255, 226, 150, .5) 46%, rgba(255, 226, 150, 0) 70%); }
.tv-glow.on { animation: tv-glow 2.4s ease-out both; }
@keyframes tv-glow { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
.tv-twk { position: absolute; z-index: 26; pointer-events: none; opacity: 0; color: #FFC94D; font-size: clamp(14px, 4vw, 24px); line-height: 1; -webkit-text-stroke: 1px #E3A21C; animation: tv-twk 1.4s ease-in-out both; }
@keyframes tv-twk { 0% { opacity: 0; transform: scale(0) rotate(0); } 40% { opacity: 1; transform: scale(1.2) rotate(20deg); } 100% { opacity: 0; transform: scale(.4) rotate(60deg); } }
.tv-dust { position: absolute; inline-size: 3%; aspect-ratio: 1; border-radius: 50%; background: #fff; opacity: 0; pointer-events: none; z-index: 19; animation: tv-dust .6s ease-out both; }
@keyframes tv-dust { 0% { opacity: .85; transform: scale(.4); } 100% { opacity: 0; transform: translate(var(--dx), -40%) scale(1.6); } }
.tv-say { min-block-size: 3.2em; inline-size: 100%; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tv-glow, .tv-twk, .tv-dust { display: none; } .tv-part.in, .tv-rig .tv-dog.in, .tv-intro-car { animation: none !important; opacity: 1; } }

/* ---------- おでかけ先の箱庭（2026-10-02 まず ドッグラン・見本 proto/dogrun-hako.html） ---------- */
.dr-screen { gap: 12px; align-items: center; }
.dr-ribbon { position: relative; inline-size: 100%; block-size: 92px; flex: 0 0 92px; }
.dr-stage { position: relative; inline-size: min(calc(100% + 28px), 640px); aspect-ratio: 4 / 3; margin-block: -6% -4%; }   /* スマホでは 画面のはしまで広げる（島とわんこを大きく見せる）。左右の margin:auto は使わない（はみ出すと右だけに出る）→ 親の align-items:center で両はしに同じだけ */
.dr-sky { position: absolute; inset: 0 0 35% 0; border-radius: 40% 40% 0 0 / 30% 30% 0 0; background: radial-gradient(ellipse at 50% 70%, rgba(255, 244, 222, .9), rgba(255, 244, 222, 0) 70%); pointer-events: none; }
.dr-part { position: absolute; block-size: auto; opacity: 0; transform-origin: 50% 100%; filter: drop-shadow(0 3px 2px rgba(59, 47, 40, .18)); -webkit-user-drag: none; }
.dr-part.in { opacity: 1; }
.dr-cloud.in { animation: dr-drift 14s ease-in-out infinite alternate; }
@keyframes dr-drift { from { translate: 0 0; } to { translate: 6% 0; } }
.dr-signname { position: absolute; z-index: 30; translate: -50% -50%; padding: 3px 10px 4px; border-radius: 10px; background: #FFF8EE; color: var(--color-deep);
  font-weight: 900; font-size: clamp(11px, 3vw, 17px); white-space: nowrap; opacity: 0; box-shadow: 0 2px 0 #D9B48A; pointer-events: none; rotate: -3deg; }
.dr-signname::after { content: ""; position: absolute; inset: 3px; border: 2px dashed rgba(242, 140, 40, .55); border-radius: 7px; }
.dr-signname.in { opacity: 1; transition: opacity .4s; }
.dr-dogbox { position: absolute; left: 50%; top: 62%; inline-size: 42%; aspect-ratio: 1; translate: -50% -86%; z-index: 12; opacity: 0; transform-origin: 50% 100%; }
.dr-dogbox .dog-stage { inline-size: 100%; block-size: 100%; margin: 0; }
.dr-dogbox.in { animation: dr-dog 2s ease-out both; }
@keyframes dr-dog { 0% { opacity: 0; transform: translateY(8%) scale(.9); filter: brightness(2.4) drop-shadow(0 0 14px #fff6d0); } 45% { opacity: 1; filter: brightness(1.8) drop-shadow(0 0 18px #fff3c4); } 100% { opacity: 1; transform: none; filter: none; } }
.dr-dogbox.is-hop { animation: dr-hop .62s cubic-bezier(.3, 0, .4, 1) both; opacity: 1; }
@keyframes dr-hop { 0% { transform: scale(1.04, .94); } 18% { transform: translateY(0) scale(.96, 1.06); } 50% { transform: translateY(-34%); } 82% { transform: translateY(0) scale(1.05, .93); } 100% { transform: none; } }
.dr-shadow { position: absolute; left: 50%; top: 61%; inline-size: 22%; aspect-ratio: 3 / 1; translate: -50% -50%; border-radius: 50%; background: rgba(59, 47, 40, .16); z-index: 11; opacity: 0; transition: opacity .6s; }
.dr-shadow.in { opacity: 1; }
.dr-frisbee { position: absolute; inline-size: 12%; z-index: 40; opacity: 0; pointer-events: none; translate: -50% -50%; filter: drop-shadow(0 4px 3px rgba(59, 47, 40, .2)); }
.dr-glow { position: absolute; inline-size: 40%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: 0; z-index: 25; translate: -50% -50%;
  background: radial-gradient(circle, rgba(255, 250, 225, .95) 0 28%, rgba(255, 226, 150, .5) 46%, rgba(255, 226, 150, 0) 70%); }
.dr-glow.on { animation: dr-glow 2.4s ease-out both; }
@keyframes dr-glow { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
.dr-twk { position: absolute; z-index: 26; pointer-events: none; opacity: 0; color: #FFC94D; font-size: clamp(14px, 4vw, 24px); line-height: 1; -webkit-text-stroke: 1px #E3A21C; animation: dr-twk 1.4s ease-in-out both; }
@keyframes dr-twk { 0% { opacity: 0; transform: scale(0) rotate(0); } 40% { opacity: 1; transform: scale(1.2) rotate(20deg); } 100% { opacity: 0; transform: scale(.4) rotate(60deg); } }
.dr-dust { position: absolute; inline-size: 4%; aspect-ratio: 1; border-radius: 50%; background: #fff; opacity: 0; pointer-events: none; z-index: 13; animation: dr-dust .6s ease-out both; }
@keyframes dr-dust { 0% { opacity: .85; transform: scale(.4); } 100% { opacity: 0; transform: translate(var(--dx), -40%) scale(1.6); } }
.dr-catch { position: absolute; z-index: 45; left: 50%; top: 12%; translate: -50% 0; padding: 4px 14px; border-radius: 14px; background: #FFF8EE; color: var(--color-deep); font-weight: 900;
  font-size: clamp(18px, 5vw, 26px); box-shadow: 0 3px 0 #D9B48A; white-space: nowrap; pointer-events: none; animation: mf-number .5s linear both; }   /* 「キャッチ！」は 小さな名札で（大きな文字だと 島にかぶった） */
.dr-after { inline-size: 100%; display: flex; flex-direction: column; gap: 12px; opacity: 0; transition: opacity .5s; }
.dr-after.in { opacity: 1; }
.dr-after:not(.in) { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .dr-glow, .dr-twk, .dr-dust, .dr-frisbee { display: none; } .dr-part.in, .dr-dogbox.in { animation: none !important; opacity: 1; } }
/* 帯（120%の幅で傾いている）が画面の横にはみ出して、ページが横にずれた → 帯の入れ物を画面のはしまで広げて、その外は切る（移動・おでかけ先） */
.tv-ribbon, .dr-ribbon { inline-size: calc(100% + 32px); overflow-x: clip; }
/* おさんぽで見つけたもの（箱庭の中・わんこの右前に止まる） */
.dr-find { position: absolute; inline-size: 13%; aspect-ratio: 1; translate: -50% -100%; z-index: 14; pointer-events: none; }
.dr-find img { inline-size: 100%; block-size: 100%; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(59, 47, 40, .22)); }

/* おでかけ先の箱庭のうしろに、行き先の写真を やわらかく敷く（2026-10-02 オーナー決定・案A）。下にいくほど消えて、文とボタンは読みやすいまま */
.dr-screen.has-bg { position: relative; }
.dr-backdrop { position: absolute; z-index: 0; inset: 0 -16px auto; block-size: 78%; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%); }
.dr-backdrop img { inline-size: 100%; block-size: 100%; object-fit: cover; filter: blur(3px) saturate(.9); opacity: .55; scale: 1.06; }
.dr-backdrop::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 58%, rgba(251, 246, 238, .55), rgba(251, 246, 238, 0) 70%); }
.dr-screen.has-bg > .dr-ribbon, .dr-screen.has-bg > .dr-stage, .dr-screen.has-bg > .dr-after { position: relative; z-index: 1; }   /* 全部の子にかけると 右上のハート（絶対位置）が 下に押し出された */

/* ---------- おでかけの絵はがき（2026-10-02・しあわせ帳） ---------- */
.book-card--wide { grid-column: 1 / -1; }
.pc-stack { position: relative; display: block; inline-size: 100%; aspect-ratio: 16 / 7; }
.pc-stack img { position: absolute; top: 8%; inline-size: 44%; aspect-ratio: 3 / 2 !important; object-fit: cover; border: 4px solid #FFF8EE; border-radius: 10px; box-shadow: 0 4px 8px rgba(59, 47, 40, .18); }
.pc-stack img:nth-child(1) { left: 4%; rotate: -7deg; }
.pc-stack img:nth-child(2) { left: 28%; rotate: 4deg; z-index: 1; }
.pc-stack img:nth-child(3) { left: 52%; rotate: -2deg; }
.pc-lead { text-align: center; }
.pc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; inline-size: 100%; }
.pc-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 10px 12px; border: 3px solid var(--color-primary); border-radius: var(--radius-card);
  background: var(--color-white); box-shadow: 0 5px 0 var(--color-deep); color: var(--color-ink); font: inherit; text-align: center; cursor: pointer; }
.pc-card b { font-size: clamp(18px, 4.6vw, 24px); line-height: 1.3; }
.pc-card small { font-size: clamp(15px, 3.8vw, 19px); color: var(--color-deep); font-weight: 700; }
.pc-photo { position: relative; display: block; inline-size: 100%; aspect-ratio: 3 / 2; border: 5px solid #FFF8EE; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 6px rgba(59, 47, 40, .16); background: var(--color-soft); }
.pc-photo img { inline-size: 100%; block-size: 100%; object-fit: cover; }
/* 切手のような 肉球のスタンプ */
.pc-stamp { position: absolute; right: 5%; top: 6%; inline-size: 24%; aspect-ratio: 1; border-radius: 50%; border: 3px dashed rgba(224, 72, 62, .75); background: rgba(255, 248, 238, .78);
  rotate: 12deg; box-shadow: 0 2px 4px rgba(59, 47, 40, .15); }
.pc-stamp svg { position: absolute; inset: 18%; inline-size: 64%; block-size: 64%; opacity: .85; }
.pc-card.is-locked { border-color: var(--color-soft); box-shadow: none; cursor: default; }
.pc-card.is-locked .pc-photo img { filter: blur(6px) saturate(.3) brightness(1.1); opacity: .55; }
.pc-card.is-locked .pc-photo i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: clamp(30px, 9vw, 46px); color: var(--color-deep); opacity: .7; }
.pc-card.is-locked b { color: var(--color-disabled); }
.postcards-screen.enter .pc-card { animation: mf-text .45s linear both; }
.postcards-screen.enter .pc-card:nth-child(2) { animation-delay: .05s; } .postcards-screen.enter .pc-card:nth-child(3) { animation-delay: .1s; }
.postcards-screen.enter .pc-card:nth-child(4) { animation-delay: .15s; } .postcards-screen.enter .pc-card:nth-child(n+5) { animation-delay: .2s; }
.pc-big { position: relative; inline-size: min(100%, 560px); aspect-ratio: 3 / 2; border: 10px solid #FFF8EE; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 0 var(--color-soft), 0 12px 24px rgba(59, 47, 40, .16); rotate: -1.5deg; }
.pc-big img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.pc-big .pc-stamp { inline-size: 18%; }
.pc-big__name { position: absolute; left: 50%; bottom: 8%; translate: -50% 0; padding: 4px 16px; border-radius: 12px; background: #FFF8EE; color: var(--color-deep); font-weight: 900; font-size: clamp(18px, 5vw, 26px); box-shadow: 0 3px 0 #D9B48A; white-space: nowrap; }
/* はじめての場所:「絵はがきを もらったよ！」 */
.pc-toast { position: absolute; z-index: 60; left: 50%; top: 4%; translate: -50% 0; inline-size: max-content; max-inline-size: 96%; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 16px; background: #FFF8EE;
  box-shadow: 0 5px 0 #D9B48A, 0 10px 18px rgba(59, 47, 40, .18); color: var(--color-deep); white-space: nowrap; animation: mf-light .5s linear both; transition: opacity .5s, translate .5s; }
.pc-toast img { inline-size: 64px; aspect-ratio: 3 / 2; object-fit: cover; border: 3px solid #fff; border-radius: 6px; rotate: -6deg; }
.pc-toast b { font-size: clamp(16px, 4.4vw, 22px); line-height: 1.25; }
.pc-toast.is-out { opacity: 0; translate: -50% -30%; }
@media (prefers-reduced-motion: reduce) { .postcards-screen.enter .pc-card, .pc-toast { animation: none; } }
.pc-big__line { margin: 0; } .postcard-screen .pc-big { margin-block-end: 6px; }

/* ---------- 運営からの おてがみ（お知らせ・アンケート・2026-10-02） ---------- */
.notice-sheet { gap: 12px; }
.notice-arrive { margin: 0; text-align: center; color: var(--color-deep); font-weight: 900; font-size: clamp(22px, 6vw, 28px); animation: mf-text .45s linear both; }
.notice-letter { position: relative; text-align: left; padding: 18px 18px 20px; border-radius: 18px; background: #FFFDF8; border: 3px solid #EAD9C3; box-shadow: 0 5px 0 #E3CDB0;
  background-image: repeating-linear-gradient(to bottom, transparent 0 38px, rgba(217, 180, 138, .25) 38px 40px); animation: notice-open .6s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes notice-open { from { opacity: 0; transform: translateY(14%) scale(.94) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
.notice-from { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--color-deep); font-weight: 800; font-size: clamp(16px, 4.2vw, 20px); }
.notice-seal { display: inline-grid; place-items: center; inline-size: 38px; block-size: 38px; border-radius: 50%; border: 3px dashed rgba(224, 72, 62, .7); background: #FFF3EC; rotate: -8deg; }
.notice-seal svg { inline-size: 24px; block-size: 24px; }
.notice-title { margin: 4px 0 8px; font-size: clamp(22px, 6vw, 28px); line-height: 1.4; color: var(--color-ink); }
.notice-body { margin: 0; font-size: clamp(19px, 5vw, 23px); line-height: 1.8; color: var(--color-ink); }
/* おてがみの絵（2026-10-11）: 本文の下に まんなか。横は おてがみの はばまで・縦長の絵でも 画面の6わりまで（ふちは 絵に ぴったり） */
.notice-image { display: block; inline-size: auto; block-size: auto; max-inline-size: 100%; max-block-size: 60vh; margin: 14px auto 0; border-radius: 14px; border: 3px solid #EAD9C3; background: #FFFFFF; }
.notice-hearts { margin: 12px 0 0; color: var(--color-heart); font-weight: 800; font-size: clamp(17px, 4.4vw, 21px); }
.notice-choices { display: grid; gap: 10px; }
.notice-text { inline-size: 100%; min-block-size: 96px; padding: 12px; border: var(--line) solid var(--color-soft); border-radius: 14px; font: inherit; font-size: 20px; background: var(--color-white); color: var(--color-ink); }
.notice-done, .notice-thanks { margin: 6px 0 0; text-align: center; color: var(--color-deep); font-weight: 900; font-size: clamp(22px, 6vw, 28px); }
.notice-done small { font-size: .75em; color: var(--color-ink); }
.notice-thanks { animation: mf-number .5s linear both; }
.notice-badge { display: inline-grid; place-items: center; min-inline-size: 30px; block-size: 30px; margin-inline-start: 8px; padding: 0 8px; border-radius: 999px; background: var(--color-heart); color: #fff; font-size: 18px; font-weight: 900; vertical-align: middle; }
.notice-list { display: grid; gap: 12px; }
.notice-item { position: relative; display: grid; gap: 4px; justify-items: start; padding: 14px 16px; border: 3px solid var(--color-primary); border-radius: var(--radius-card); background: var(--color-white);
  box-shadow: 0 5px 0 var(--color-deep); color: var(--color-ink); font: inherit; text-align: left; cursor: pointer; }
.notice-item b { font-size: clamp(19px, 5vw, 23px); line-height: 1.4; }
.notice-item small { font-size: 16px; color: var(--color-deep); }
.notice-item__tag { padding: 2px 10px; border-radius: 999px; background: var(--color-soft); color: var(--color-deep); font-size: 15px; font-weight: 800; }
.notice-item__tag.is-open { background: var(--color-heart); color: #fff; }
.notice-one-screen { gap: 14px; }
@media (prefers-reduced-motion: reduce) { .notice-letter, .notice-arrive, .notice-thanks { animation: none; } }

/* 箱が届く部屋（おもちゃを もらったよ・家族からの おやつ・2026-10-04 オーナー了承・見本 proto/toy-reward.html）
   わんこを左に寄せて、右の床に 箱が落ちる。主役（箱と おもちゃ）が見えるよう、いつもの部屋より少し縦長。
   家族からの おやつは 重ねた画面（#app の外）に出るので、わんこの置き場所も ここで決める */
#app .dog-room.gift-room,
.overlay .dog-room.gift-room { aspect-ratio: 4 / 3; }
#app .dog-room.gift-room > .dog-room__dog,
.overlay .dog-room.gift-room > .dog-room__dog {
  position: absolute; inset: auto auto -8% 2% !important; z-index: var(--z-raised);
  inline-size: 52% !important; aspect-ratio: 1 / 1; margin: 0; translate: none;
}
.dog-room.gift-room .fx-gift.room-gift { left: 72%; top: 46%; inline-size: 27%; margin-left: -13.5%; z-index: 6; }
.dog-room.gift-room .room-toy { position: absolute; z-index: 7; inline-size: 21%; aspect-ratio: 1; translate: -50% -50%; pointer-events: none; filter: drop-shadow(0 5px 4px rgba(59, 47, 40, .28)); }
.dog-room.gift-room .room-toy img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; }
.dog-room.gift-room .room-toy.is-missing { display: grid; place-items: center; border-radius: 50%; background: var(--color-white); box-shadow: 0 4px 0 var(--color-soft); }
.dog-room.gift-room .room-toy__name { font-size: 14px; font-weight: 800; color: var(--color-deep); text-align: center; line-height: 1.2; }
.dog-room.gift-room .room-toy.is-rest img { animation: mf-nudge 3.2s linear infinite; animation-delay: var(--toy-delay, 0s); }   /* ゆらすのは中の絵（外側の まんなか寄せと ぶつからない） */
.overlay .dog-room.gift-room { inline-size: 100%; border-radius: var(--radius-card); overflow: hidden; }
.dog-room.gift-room .room-thing { position: absolute; z-index: 7; inline-size: 24%; translate: -50% -50%; pointer-events: none; filter: drop-shadow(0 6px 5px rgba(59, 47, 40, .25)); }
.dog-room.gift-room .room-thing img { display: block; inline-size: 100%; }
.dog-room.gift-room .room-find { position: absolute; z-index: 7; inline-size: 17%; translate: -50% -50%; pointer-events: none; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 5px 4px rgba(59, 47, 40, .35)); }
.dog-room.gift-room .room-find img { display: block; inline-size: 100%; }
.gift-say { min-block-size: 3.4em; }
.gift-note { margin: 0; min-block-size: 1.4em; color: var(--color-deep); font-size: 18px; font-weight: 700; }
@media (min-width: 768px) and (max-height: 820px) and (orientation: landscape) {
  #app .dog-room.gift-room,
  .overlay .dog-room.gift-room { aspect-ratio: 2 / 1; }
  #app .dog-room.gift-room > .dog-room__dog,
  .overlay .dog-room.gift-room > .dog-room__dog { inset-inline-start: 14% !important; inline-size: 40% !important; }
}
@media (prefers-reduced-motion: reduce) { .dog-room.gift-room .room-toy.is-rest img { animation: none; } }

/* 家族からの写真（2026-10-04 オーナー了承・見本 proto/family-photo.html）: 写真が主役（切らずに そのままの形）。絵はがき（pc-big）と同じ ふち・影・傾き */
.fam-photo { position: relative; display: block; inline-size: fit-content; max-inline-size: 100%; align-self: center; justify-self: center; margin-inline: auto;
  border: 10px solid #FFF8EE; border-radius: 16px; overflow: hidden; rotate: -1.5deg; box-shadow: 0 8px 0 var(--color-soft), 0 12px 24px rgba(59, 47, 40, .16); --mf-fall: -60%; }
.fam-photo img { display: block; max-inline-size: 100%; max-block-size: min(38vh, 460px); inline-size: auto; block-size: auto; }
.fam-photo .pc-stamp { inline-size: clamp(54px, 16%, 76px); right: 4%; top: 5%; }
.fam-photo.is-in { animation: mf-settle .98s linear both; }
.fam-photo .pc-stamp.is-in { animation: mf-light .65s linear both; }
.dog-room.fam-room { inline-size: 100%; aspect-ratio: auto; block-size: clamp(130px, 34vw, 200px); }
.dog-room.fam-room > .outing-scene__background { object-position: 50% 50%; }
#app .dog-room.fam-room > .dog-room__dog,
.overlay .dog-room.fam-room > .dog-room__dog { position: absolute; inset: auto auto -22% 50% !important; inline-size: auto !important; block-size: 120%; aspect-ratio: 1; margin: 0; translate: -50% 0; z-index: 3; }
@media (prefers-reduced-motion: reduce) { .fam-photo.is-in, .fam-photo .pc-stamp.is-in { animation: none; } }
/* 重ねた画面（ふちと余白がある）では 少し小さく。スマホで タイトルから ボタンまで 1画面に収める */
.overlay .fam-photo img { max-block-size: min(30vh, 420px); }
.overlay .dog-room.fam-room { block-size: clamp(110px, 28vw, 190px); }
.overlay .sheet .gift-say { min-block-size: 0; }
@media (max-height: 740px) {
  .overlay .fam-photo img { max-block-size: 26vh; }
  .overlay .dog-room.fam-room { block-size: 96px; }
  .overlay .sheet:has(.fam-room) { gap: 6px; }
}

/* レベルで ひらいたもの（2026-10-05 オーナー了承・見本 proto/level-unlock.html）: わんこと道具は 部屋の中・場所は 絵はがきのカード */
#app .dog-room.unlock-room { aspect-ratio: 4 / 3; }
#app .dog-room.unlock-room > .dog-room__dog { inset: auto auto -8% 50% !important; inline-size: 60% !important; translate: -50% 0; }
#app .dog-room.unlock-room.has-thing > .dog-room__dog { inset: auto auto -8% 2% !important; inline-size: 54% !important; translate: none; }
.unlock-room .room-thing { position: absolute; z-index: 7; inline-size: 30%; translate: -50% -50%; pointer-events: none; filter: drop-shadow(0 6px 5px rgba(59, 47, 40, .28)); }
.unlock-room .room-thing img { display: block; inline-size: 100%; }
.unlock-room .room-thing.is-in { animation: mf-light .6s linear both; }
/* お皿: 落ちる動き（mf-settle）が translate を使うので、まんなか寄せの translate は使わない（2026-10-05 オーナー「お皿がはみ出す」） */
.unlock-room .meal-bowl.unlock-bowl { inset-inline-start: 54%; inset-block-end: 10%; inline-size: 40%; translate: none; --mf-fall: -160%; }
.unlock-room .meal-bowl.unlock-bowl.is-in { animation: mf-settle .98s linear both; }
.unlock-room .meal-bowl.unlock-bowl .meal-food { transform: none; opacity: 1; }
/* ふわふわの泡（線の丸をやめた） */
.felt-bubble { position: absolute; z-index: 8; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.95) 0 14%, rgba(255,255,255,.35) 22%, rgba(214,236,255,.45) 55%, rgba(190,220,250,.6) 100%);
  box-shadow: inset -3px -4px 8px rgba(150,190,230,.35), 0 3px 6px rgba(59,47,40,.12); animation: felt-bubble-up 3.2s ease-in-out infinite; }
@keyframes felt-bubble-up { 0% { translate: 0 10px; opacity: 0; scale: .6; } 15% { opacity: 1; scale: 1; } 85% { opacity: 1; } 100% { translate: 0 -46px; opacity: 0; scale: 1.05; } }
.collar-glow { position: absolute; z-index: 8; inline-size: 18%; aspect-ratio: 1; left: 50%; top: 58%; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,244,200,.95) 0 25%, rgba(255,214,140,.4) 50%, rgba(255,214,140,0) 72%); animation: fx-glow 1.8s ease-out both; }
.level-unlock-screen .unlock-card { justify-self: center; align-self: center; inline-size: min(100%, 560px); margin-inline: auto; --mf-fall: -60%; }
.level-unlock-screen .unlock-card.is-in { animation: mf-settle .98s linear both; }
.level-unlock-screen .unlock-card .pc-stamp.is-in { animation: mf-light .65s linear both; }
.level-unlock-screen .unlock-card .pc-big__name.is-in { animation: mf-text .45s linear both; }
@media (prefers-reduced-motion: reduce) { .felt-bubble, .collar-glow { animation: none; } }

/* ③ なでる・クローゼット・おもちゃ箱（2026-10-05 オーナー了承・見本 proto/care-screens.html） */
/* なでる: 縫い目つきの フェルトの よろこびの帯と ハートの目印 */
.joy-meter { position: relative; inline-size: 100%; padding-block-start: 14px; }
.joy-meter .meter { position: relative; block-size: 34px; border: 0; border-radius: 999px; background: #FFF4E6; box-shadow: inset 0 2px 0 rgba(59,47,40,.08), 0 4px 0 var(--color-soft); overflow: visible; }
.joy-meter .meter::after { content: ""; position: absolute; inset: 4px; border: 2px dashed #E9C9A6; border-radius: 999px; pointer-events: none; }
.joy-meter .meter-fill { position: relative; border-radius: 999px; transition: width .35s ease;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.35) 0 2px, transparent 3px) 0 0 / 10px 10px, linear-gradient(#F7A0B4, #EE7F99); }
.joy-marks { position: absolute; inset: 0 0 auto 0; block-size: 34px; margin-block-start: 14px; pointer-events: none; }
.joy-mark { position: absolute; top: 50%; inline-size: 34px; block-size: 34px; translate: -50% -50%; display: grid; place-items: center; }
.joy-mark svg { inline-size: 30px; block-size: 30px; fill: #F3DCCB; stroke: #fff; stroke-width: 3; paint-order: stroke; filter: drop-shadow(0 2px 1px rgba(59,47,40,.18)); transition: fill .2s; }
.joy-mark.is-on svg { fill: #E5708F; }
.joy-mark.is-on { animation: mf-light .5s linear both; }
.joy-label { margin: 4px 0 0; text-align: center; color: var(--color-deep); font-weight: 800; }
/* クローゼット: 押し入れと同じ 縫い目つきの フェルトのカード */
.closet-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; inline-size: 100%; }
.closet-cards .closet-card { grid-template-columns: 52px minmax(0, 1fr); min-block-size: 92px; padding: 10px 8px 10px 10px; border: 0; cursor: pointer; font: inherit; font-size: clamp(16px, 4.6vw, 22px); font-weight: 800; color: var(--color-ink); }
.closet-cards .closet-card__image { position: relative; z-index: 1; inline-size: 52px; block-size: 52px; object-fit: contain; }
.closet-cards .closet-card__text { position: relative; z-index: 1; min-inline-size: 0; }
.closet-cards .closet-card small { display: block; margin-block-start: 2px; font-size: 16px; color: var(--color-deep); }
.closet-cards .closet-card.is-on { background: #FFF1DE; box-shadow: 0 0 0 3px var(--color-primary), 0 5px 0 var(--color-primary); }
.closet-cards .closet-card.is-on::after { border-color: #F2B36B; }
.closet-cards .closet-card.is-busy { opacity: .55; }
.closet-cards .wear-tag { position: absolute; z-index: 2; right: -6px; top: -10px; padding: 2px 10px; border-radius: 999px; background: var(--color-primary); color: #fff; font-size: 14px; font-weight: 900; box-shadow: 0 3px 0 #B84F00; rotate: 4deg; animation: mf-light .5s linear both; }
/* おもちゃ箱の読みこみ中: 部屋と箱と肉球 */
.toybox-room .toybox-wait { position: absolute; z-index: 7; inset: auto; left: 50%; top: 22%; translate: -50% 0; animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { .joy-mark.is-on, .closet-cards .wear-tag { animation: none; } }

/* ④ 記念日・成長・しあわせのはじまり（2026-10-05 オーナー了承・見本 proto/moments.html）: 部屋の中で */
#app .dog-room.moment-room,
.overlay .dog-room.moment-room { inline-size: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-card); overflow: hidden; }
#app .dog-room.moment-room > .dog-room__dog,
.overlay .dog-room.moment-room > .dog-room__dog { position: absolute; inset: auto auto -8% 50% !important; inline-size: 60% !important; aspect-ratio: 1; margin: 0; translate: -50% 0; z-index: 3; }
#app .dog-room.moment-room.has-jar > .dog-room__dog { inset: auto auto -8% 6% !important; inline-size: 56% !important; translate: none; }
.moment-room .bunting { position: absolute; z-index: 6; left: 4%; right: 4%; top: 4%; block-size: 22%; pointer-events: none; transform-origin: 50% 0; }
.moment-room .bunting svg { inline-size: 100%; block-size: 100%; overflow: visible; }
.moment-room .bunting.is-in { animation: mf-sway 1.3s linear both; }
/* 名札（落ちる動き mf-settle が translate を使うので、translate を使わない まんなか寄せ） */
.moment-room .name-tag { position: absolute; z-index: 7; left: 0; right: 0; margin-inline: auto; inline-size: fit-content; top: 6%; padding: 6px 18px 8px; border-radius: 14px; background: #FFF8EE; color: var(--color-deep);
  font-weight: 900; font-size: clamp(20px, 5.6vw, 28px); box-shadow: 0 4px 0 #D9B48A, 0 8px 14px rgba(59,47,40,.16); white-space: nowrap; --mf-fall: -160%; }
.moment-room .name-tag::before { content: ""; position: absolute; inset: 4px; border: 2px dashed #E9C9A6; border-radius: 10px; }
.moment-room .name-tag.is-in { animation: mf-settle .98s linear both; }
.moment-room .moment-jar { position: absolute; z-index: 6; right: 6%; bottom: 6%; inline-size: 26%; filter: drop-shadow(0 6px 5px rgba(59,47,40,.25)); }
.moment-room .moment-jar img { display: block; inline-size: 100%; }
.moment-room .moment-jar-heart { position: absolute; z-index: 7; inline-size: 9%; right: 14.5%; bottom: 14%; --mf-fall: -420%; }
.moment-room .moment-jar-heart.is-in { animation: mf-settle .98s linear both; }
@media (max-height: 740px) { .overlay .dog-room.moment-room { aspect-ratio: 16 / 10; } }
@media (prefers-reduced-motion: reduce) { .moment-room .bunting.is-in, .moment-room .name-tag.is-in, .moment-room .moment-jar-heart.is-in { animation: none; } }

/* ⑤ はじめての設定（2026-10-05 オーナー了承・見本 proto/onboarding.html）: どの画面も 部屋の中で */
.onb-screen { gap: 12px; }
.onb-screen .onb-logo { display: block; margin: 4px auto 0; inline-size: min(64%, 320px); animation: mf-light .6s linear both; }
#app .dog-room.onb-room:not(.room--band) { aspect-ratio: 4 / 3; }
#app .dog-room.onb-room:not(.room--band) > .dog-room__dog { inset: auto auto -8% 50% !important; inline-size: 62% !important; translate: -50% 0; }
/* フェルトの入力の枠 */
.felt-field { position: relative; }
.felt-field input { min-block-size: 64px; padding: 10px 18px; border: 0 !important; border-radius: 18px; background: #FFFDF8; font-size: 26px; box-shadow: 0 0 0 3px #F2C9A0, 0 5px 0 var(--color-soft); outline: none; }
.felt-field input:focus { box-shadow: 0 0 0 3px var(--color-primary), 0 5px 0 var(--color-soft); }
.felt-field::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 6px; block-size: 52px; border: 2px dashed #F0D2B2; border-radius: 14px; pointer-events: none; }
/* 名札（打つと出る・落ちる動きと ぶつからないよう translate を使わない） */
.onb-room .onb-tag { position: absolute; z-index: 7; left: 0; right: 0; margin-inline: auto; inline-size: fit-content; max-inline-size: 80%; top: 7%; padding: 6px 18px 8px; border-radius: 14px; background: #FFF8EE; color: var(--color-deep);
  font-weight: 900; font-size: clamp(20px, 5.6vw, 28px); box-shadow: 0 4px 0 #D9B48A, 0 8px 14px rgba(59,47,40,.16); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; --mf-fall: -160%; animation: mf-settle .98s linear both; }
.onb-room .onb-tag::before { content: ""; position: absolute; inset: 4px; border: 2px dashed #E9C9A6; border-radius: 10px; }
.onb-room .onb-tag.is-empty { opacity: .45; }
/* わんこえらび: フェルトのカード */
.breed-felt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; inline-size: 100%; }
.breed-felt { position: relative; isolation: isolate; display: grid; justify-items: center; gap: 4px; padding: 12px 8px 14px; border: 0; border-radius: 22px; background: #FFFDF8; box-shadow: 0 5px 0 var(--color-soft);
  font: inherit; font-size: clamp(18px, 5vw, 24px); font-weight: 800; color: var(--color-ink); cursor: pointer; animation: mf-light .5s linear both; }
.breed-felt:nth-child(2) { animation-delay: .12s; } .breed-felt:nth-child(3) { animation-delay: .24s; } .breed-felt:nth-child(4) { animation-delay: .36s; }
.breed-felt::after { content: ""; position: absolute; inset: 6px; border: 2px dashed var(--color-soft); border-radius: 18px; pointer-events: none; }
.breed-felt .breed-img { position: relative; z-index: 1; inline-size: 92%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 6px 4px rgba(59,47,40,.18)); }
.breed-felt .breed-name { position: relative; z-index: 1; }
.breed-felt__cushion { position: absolute; z-index: 0; left: 14%; right: 14%; top: 66%; block-size: 16%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #F7C9A8, #E8A57E); }
/* そだてかた */
.paw-steps { display: flex; justify-content: center; gap: 10px; }
.paw-steps svg { inline-size: 28px; block-size: 28px; fill: #EBD7C4; }
.paw-steps svg.is-on { fill: var(--color-primary); }
.guide-say { position: relative; margin: 0; padding: 14px 18px; border-radius: 22px; background: #FFF4E6; box-shadow: 0 0 0 3px #F2C9A0, 0 5px 0 var(--color-soft); color: var(--color-ink); font-size: clamp(22px, 6vw, 28px); font-weight: 800; text-align: center; }
.guide-say::after { content: ""; position: absolute; left: 50%; top: -14px; translate: -50% 0; border: 10px solid transparent; border-bottom: 14px solid #FFF4E6; }
/* 知らせる人: 印は 肉球 */
.family-felt .choice-mark { display: grid; place-items: center; inline-size: 40px; block-size: 40px; border: 0 !important; border-radius: 50%; background: #F6E8DA; color: transparent; }
.family-felt .choice-mark svg { inline-size: 26px; block-size: 26px; fill: #fff; }
.family-felt[aria-pressed="true"] { background: #FFF1DE; box-shadow: 0 0 0 3px var(--color-primary), 0 5px 0 var(--color-primary); }
.family-felt[aria-pressed="true"] .choice-mark { background: var(--color-primary); animation: mf-light .45s linear both; }
/* お知らせ: ベルの絵の フェルトのカード */
.bell-card { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; inline-size: 100%; padding: 14px 16px; border-radius: 22px; background: #FFF4E6; box-shadow: 0 0 0 3px #F2C9A0, 0 5px 0 var(--color-soft); text-align: start; font-size: 18px; font-weight: 700; color: var(--color-ink); }
.bell-card::after { content: ""; position: absolute; inset: 6px; border: 2px dashed #F0D2B2; border-radius: 17px; pointer-events: none; }
.bell-card svg { inline-size: 56px; block-size: 56px; }
@media (prefers-reduced-motion: reduce) { .onb-screen .onb-logo, .breed-felt, .onb-room .onb-tag, .family-felt[aria-pressed="true"] .choice-mark { animation: none; } }
/* わんこえらび: もとの絵と名前の指定に負けないよう 強める（2026-10-05 点検） */
.breed-felt .breed-img { inline-size: 92% !important; block-size: auto !important; max-inline-size: none !important; max-block-size: none !important; margin: 0 !important; }
.breed-felt .breed-name { display: block; font-size: clamp(16px, 4.4vw, 22px) !important; white-space: nowrap; line-height: 1.3; }
.breed-felt__cushion { top: 58%; }
/* 知らせる人・お知らせ: 部屋の帯を少し低く（スマホで「きめる」が画面の外に出ないように） */
#app .dog-room.family-room.room--band,
#app .dog-room.notify-room.room--band { block-size: clamp(110px, 28vw, 190px); }
#app .dog-room.family-room.room--band { block-size: clamp(84px, 22vw, 170px); }
#app .family-felt { min-block-size: 64px; padding-block: 6px; }

/* のこりの小さな画面（2026-10-05 オーナー了承・見本 proto/small-screens.html） */
#app .dog-room.sm-room, .overlay .dog-room.sm-room { inline-size: 100%; aspect-ratio: auto; block-size: clamp(120px, 34vw, 200px); border-radius: var(--radius-card); overflow: hidden; }
#app .dog-room.sm-room > .dog-room__dog, .overlay .dog-room.sm-room > .dog-room__dog { position: absolute; inset: auto auto -24% 50% !important; inline-size: auto !important; block-size: 120%; aspect-ratio: 1; margin: 0; translate: -50% 0; z-index: 3; }
#app .dog-room.sm-room.has-thing > .dog-room__dog, .overlay .dog-room.sm-room.has-thing > .dog-room__dog { inset: auto auto -24% 34% !important; }
.sm-room .sm-thing { position: absolute; z-index: 6; right: 10%; bottom: 10%; inline-size: 22%; filter: drop-shadow(0 6px 5px rgba(59,47,40,.25)); --mf-fall: -200%; }
.sm-room .sm-thing.is-in { animation: mf-settle .98s linear both; }
.sm-room .sm-thing svg { display: block; inline-size: 100%; block-size: auto; }
/* アンケート: 印は 肉球・ひとことは フェルトの枠 */
.notice-choice .choice-mark { display: grid; place-items: center; inline-size: 40px; block-size: 40px; border: 0 !important; border-radius: 50%; background: #F6E8DA; color: transparent; }
.notice-choice .choice-mark svg { inline-size: 26px; block-size: 26px; fill: #fff; }
.notice-choice:active .choice-mark { background: var(--color-primary); }
.felt-area { position: relative; }
.felt-area textarea { inline-size: 100%; border: 0 !important; border-radius: 18px; background: #FFFDF8; box-shadow: 0 0 0 3px #F2C9A0, 0 5px 0 var(--color-soft); outline: none; }
.felt-area textarea:focus { box-shadow: 0 0 0 3px var(--color-primary), 0 5px 0 var(--color-soft); }
.felt-area::after { content: ""; position: absolute; inset: 6px; border: 2px dashed #F0D2B2; border-radius: 14px; pointer-events: none; }
/* つながりませんでした: タイトルロゴだけ（犬は出さない・オーナー） */
.err-logo { display: block; inline-size: min(72%, 360px); margin: 0 auto 8px; }
@media (prefers-reduced-motion: reduce) { .sm-room .sm-thing.is-in { animation: none; } }
/* レベルでひらいた場所のカードの 名前の札: 出てくる動き（mf-text）が translate を使うので、まんなか寄せは translate を使わない（2026-10-05 点検で 札が右にずれていた） */
.level-unlock-screen .unlock-card .pc-big__name { left: 0; right: 0; margin-inline: auto; inline-size: fit-content; translate: none; }
/* ハートのびんの ハート: 入ってくる動き（mf-settle）が translate を使うので、まんなか寄せは transform で（2026-10-05 点検） */
.jar__heart { translate: none; transform: translate(-50%, -50%); }

/* ---------- iPad を横に置いて 1人で遊ぶための 案内（2026-10-09 オーナー: お母さんに iPad で見せて） ---------- */
/* お友達に見せる: 指示書19・承認見本の2つの帯と、お友達のスマホへ渡すQRの札。 */
.friend-view { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: var(--color-bg); }
.friend-view__bar { flex: 0 0 auto; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: var(--color-bg); box-shadow: 0 4px 12px rgba(59, 47, 40, .12); }
.friend-view__back, .friend-view__qr { flex: 0 0 auto; inline-size: min(100%, 440px); min-block-size: 68px; margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(22px, 3.1vw, 28px); }
.friend-view__back > span[aria-hidden] { font-size: 1.2em; line-height: 1; }
.friend-view__qr svg { flex: none; inline-size: 1.2em; block-size: 1.2em; }
.friend-view__page { flex: 1 1 auto; min-block-size: 0; inline-size: 100%; border: 0; background: var(--color-bg); }

/* 犬は札の外、読んだりスクロールする中身は内側の1枚。QRの白い余白には重ねない。 */
.qr-sheet { position: fixed; inset: 0; z-index: 450; display: grid; place-items: center; padding: 76px max(48px, env(safe-area-inset-right)) 20px max(48px, env(safe-area-inset-left)); padding-block-start: max(76px, calc(env(safe-area-inset-top) + 20px)); padding-block-end: max(20px, env(safe-area-inset-bottom)); background: rgba(59, 47, 40, .42); }
.qr-sheet[hidden] { display: none; }
.friend-qr-open .scroll-hint { visibility: hidden; } /* 背景の「したにも…」は札を閉じてから戻す。 */
.qr-card { position: relative; inline-size: min(100%, 860px); min-inline-size: 0; border-radius: 32px; background: var(--color-bg); box-shadow: 0 18px 40px rgba(59, 47, 40, .28), inset 0 0 0 6px #fff, inset 0 0 0 8px var(--color-soft); animation: friend-qr-open .32s cubic-bezier(.22, .75, .25, 1); }
.qr-card__scroll { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 32px; align-items: center; max-block-size: calc(100vh - 96px); max-block-size: calc(100dvh - max(76px, calc(env(safe-area-inset-top) + 20px)) - max(20px, env(safe-area-inset-bottom))); overflow-y: auto; overscroll-behavior: contain; border-radius: inherit; padding: 28px 32px 24px; }
.qr-card__scroll:focus-visible { outline: var(--focus-line) solid var(--color-deep); outline-offset: -10px; }
.qr-card h2 { grid-column: 1 / -1; min-inline-size: 0; margin: 0; padding-inline: 64px; font-size: clamp(26px, 3.6vw, 34px); text-align: center; color: var(--color-ink); line-height: 1.35; }
.qr-box { position: relative; justify-self: center; margin-inline-start: 68px; background: #fff; border-radius: 24px; padding: 18px; box-shadow: 0 0 0 4px var(--color-primary); }
.qr-box .friend-qr-image { display: block; inline-size: clamp(220px, 30vw, 300px); block-size: auto; }
.qr-card > .qr-dog { position: absolute; z-index: 1; inline-size: 118px; block-size: auto; left: -34px; top: -58px; border-radius: 50%; box-shadow: 0 0 0 5px #fff, 0 8px 16px rgba(59, 47, 40, .22); pointer-events: none; animation: friend-qr-peek 2.6s ease-in-out infinite; }
.friend-qr-steps { list-style: none; min-inline-size: 0; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: friend-qr-step; }
.friend-qr-steps li { word-break: keep-all; overflow-wrap: anywhere; counter-increment: friend-qr-step; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; font-size: clamp(20px, 2.6vw, 25px); line-height: 1.45; color: var(--color-ink); font-weight: 700; }
.friend-qr-steps li::before { content: counter(friend-qr-step); inline-size: 52px; block-size: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--color-soft); color: var(--color-deep); font-size: 26px; font-weight: 800; box-shadow: inset 0 0 0 3px #fff; }
.friend-qr-steps small { display: block; font-size: .78em; font-weight: 400; color: #7a6a5e; }
/* 「または」の線で QR の所と 分ける（11/6 オーナー「目立たない」） */
.friend-qr-or { grid-column: 1 / -1; justify-self: center; inline-size: min(100%, 560px); margin: 4px 0 0; display: flex; align-items: center; gap: 14px; color: var(--color-deep); font-size: clamp(18px, 2.2vw, 21px); font-weight: 800; }
.friend-qr-or::before, .friend-qr-or::after { content: ""; flex: 1; border-block-start: 3px dashed #EAD9C3; }
.friend-qr-share { grid-column: 1 / -1; justify-self: center; inline-size: min(100%, 560px); min-inline-size: 0; display: grid; gap: 14px; padding: 18px 20px 20px; border-radius: 24px; background: #EEF8F0; box-shadow: inset 0 0 0 3px #BFE6C8; text-align: center; }
.friend-qr-share p { margin: 0; font-size: clamp(22px, 2.8vw, 27px); font-weight: 800; line-height: 1.45; color: var(--color-ink); word-break: keep-all; overflow-wrap: anywhere; }
.friend-qr-share .btn { inline-size: 100%; min-inline-size: 0; min-block-size: 84px; flex-wrap: nowrap; gap: 16px; font-size: clamp(24px, 3vw, 28px); }
.friend-qr-share .btn--line .line-icon { inline-size: 64px; block-size: 64px; }
.qr-close { grid-column: 1 / -1; justify-self: center; inline-size: min(100%, 420px); min-block-size: 64px; font-size: 24px; }
@keyframes friend-qr-open { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes friend-qr-peek { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-4px); } }
@media (max-width: 700px) {
  .qr-sheet { padding: 56px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); padding-block-start: max(56px, calc(env(safe-area-inset-top) + 12px)); padding-block-end: max(16px, env(safe-area-inset-bottom)); }
  .qr-card__scroll { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 22px 17px; max-block-size: calc(100vh - 72px); max-block-size: calc(100dvh - max(56px, calc(env(safe-area-inset-top) + 12px)) - max(16px, env(safe-area-inset-bottom))); }
  .qr-card h2 { padding: 28px 0 0; }
  .qr-box { margin-inline-start: 0; } /* 1列のときは犬が見出しの上なので、QRは まんなかに（検品 10/30） */
  .qr-card > .qr-dog { inline-size: 80px; left: -4px; top: -40px; }
}
@media (prefers-reduced-motion: reduce) {
  .qr-card, .qr-card > .qr-dog { animation: none; }
}

/* したにも つづきが あるよ */
.scroll-hint { position: fixed; z-index: 420; left: 0; right: 0; margin-inline: auto; inline-size: fit-content; bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 10px 22px 10px 26px; border: 0; border-radius: 999px; background: var(--color-primary); color: #3B2F28;
  font: inherit; font-size: clamp(20px, 2.6vw, 26px); font-weight: 900; box-shadow: 0 6px 0 #B84F00, 0 12px 24px rgba(59, 47, 40, .25); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.scroll-hint.is-on { opacity: 1; pointer-events: auto; }
.scroll-hint__arrow { display: grid; place-items: center; inline-size: 44px; block-size: 44px; border-radius: 50%; background: #FFF8EE; }
.scroll-hint__arrow svg { inline-size: 30px; block-size: 30px; fill: #B84F00; }
.scroll-hint.is-on .scroll-hint__arrow svg { animation: scroll-hint-bob 1.2s ease-in-out infinite; }
@keyframes scroll-hint-bob { 0%, 100% { translate: 0 -4px; } 50% { translate: 0 5px; } }

/* つぎは ここ！ */
.guide-tip { position: fixed; z-index: 370; top: 0; left: 0; display: flex; align-items: center; gap: 10px; max-inline-size: min(92vw, 460px); padding: 12px 20px 12px 14px; border-radius: 22px;
  background: #FFF8EE; color: var(--color-deep); font-size: clamp(22px, 3vw, 30px); font-weight: 900; line-height: 1.25;
  box-shadow: 0 0 0 3px var(--color-primary), 0 6px 0 #B84F00, 0 14px 24px rgba(59, 47, 40, .2); pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.guide-tip.is-on { opacity: 1; animation: mf-light .5s linear both; }
.guide-tip::after { content: ""; position: absolute; left: 50%; bottom: -15px; margin-left: -12px; border: 12px solid transparent; border-top: 15px solid var(--color-primary); border-bottom: 0; }
.guide-tip.is-below::after { bottom: auto; top: -15px; border-top: 0; border-bottom: 15px solid var(--color-primary); }
.guide-tip__hand { display: grid; place-items: center; flex: 0 0 auto; inline-size: 46px; block-size: 46px; border-radius: 50%; background: var(--color-primary); }
.guide-tip__hand svg { inline-size: 30px; block-size: 30px; fill: #FFF8EE; }
.guide-tip.is-on .guide-tip__hand { animation: mf-nudge 2.4s linear .6s infinite; }
.guide-ring { outline: 4px solid rgba(242, 140, 40, .55); outline-offset: 5px; animation: guide-ring 1.6s ease-in-out infinite; }
@keyframes guide-ring { 0%, 100% { outline-color: rgba(242, 140, 40, .25); } 50% { outline-color: rgba(242, 140, 40, .75); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint.is-on .scroll-hint__arrow svg, .guide-tip.is-on, .guide-tip.is-on .guide-tip__hand, .guide-ring { animation: none; } }
.guide-tip.is-inside::after { display: none; }

/* はじめての設定の見直し（2026-10-10 オーナー「名前が2回で戸惑った」「LINEの招待が分からない」「犬の性別も」） */
/* あなたの名前: お友達や家族の LINE に こう届く、の見本（打つと 名前が そのまま入る） */
.onb-preview { position: relative; inline-size: 100%; padding: 12px 16px 14px; border-radius: 22px; background: #FFF4E6; box-shadow: 0 0 0 3px #F2C9A0, 0 5px 0 var(--color-soft); text-align: left; }
.onb-preview::after { content: ""; position: absolute; inset: 6px; border: 2px dashed #F0D2B2; border-radius: 17px; pointer-events: none; }
.onb-preview__lead { position: relative; z-index: 1; margin: 0 0 8px; font-size: clamp(15px, 4vw, 19px); font-weight: 700; color: var(--color-ink); }
.onb-preview__msg { position: relative; z-index: 1; margin: 0; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: var(--color-white); box-shadow: 0 2px 0 #EBD7C4; font-size: clamp(17px, 4.6vw, 21px); font-weight: 700; color: var(--color-ink); }
.onb-preview__msg #userNamePreview { color: var(--color-deep); }
/* わんこえらび: 性別の札 */
.breed-felt .breed-sex { position: relative; z-index: 1; display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: clamp(14px, 3.8vw, 18px); font-weight: 800; line-height: 1.4; }
.breed-sex--female { background: #FDE3EA; color: #A8385A; }
.breed-sex--male { background: #DDEBFA; color: #2D5F9E; }
/* お友達や家族と つなぐ: すること3つ・番号・緑の LINE のボタン */
.connect-steps { position: relative; list-style: none; margin: 0; padding: 14px 16px; inline-size: 100%; display: grid; gap: 10px; border-radius: 22px; background: #FFFDF8; box-shadow: 0 5px 0 var(--color-soft); text-align: left; font-size: clamp(17px, 4.6vw, 21px); font-weight: 700; line-height: 1.4; }
.connect-steps::after { content: ""; position: absolute; inset: 6px; border: 2px dashed var(--color-soft); border-radius: 17px; pointer-events: none; }
.connect-steps li { position: relative; z-index: 1; display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; }
.connect-steps__n { display: grid; place-items: center; inline-size: 38px; block-size: 38px; border-radius: 50%; background: var(--color-primary); color: var(--color-ink); font-weight: 900; }
.connect-code { margin: 2px 0; }
.connect-code span { inline-size: 54px; block-size: 64px; font-size: 40px; }
#app .dog-room.connect-room.room--band { block-size: clamp(84px, 22vw, 170px); }
/* LINE のボタンは LINE の緑（「LINE＝緑」が お年寄りに分かりやすい・せっていの ボタンも同じ） */
.btn--line { border-color: #06C755; background: #06C755; color: var(--color-white); box-shadow: 0 5px 0 #048A3B; }
/* わんこえらび: iPad の横向きなど 広い画面では 3匹を横に並べる（2列だと 3匹めが画面の下に かくれた・2026-10-10） */
@media (min-width: 700px) {
  .breed-felt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-inline-size: 960px; margin-inline: auto; }
}
/* わんこえらび: 性格（2026-10-10 オーナー「性別のところに 性格も」・声の話し方と同じ言葉） */
.breed-felt .breed-trait { position: relative; z-index: 1; display: block; margin-top: 2px; font-size: clamp(14px, 3.8vw, 18px); font-weight: 700; color: var(--color-deep); line-height: 1.35; }
.breed-trait--lead { margin: -4px 0 0; font-size: clamp(18px, 4.8vw, 22px); font-weight: 800; color: var(--color-deep); text-align: center; }
.breed-trait .ph + .ph { margin-inline-start: .35em; }   /* ひらがなの言葉の間を 少しあける（「やさしい あまえんぼう」） */
/* わんこの あいさつ（2026-10-10）: いつもの言葉の吹き出しに出し、読みあげたら ふわっと いつもの言葉へ（文字は ばねで ゆらさない） */
#homeBubble { transition: opacity .25s linear; }
#homeBubble.is-swap { opacity: 0; }
@media (prefers-reduced-motion: reduce) { #homeBubble { transition: none; } }
#homeBubble.is-greet .ph + .ph { margin-inline-start: .3em; }   /* あいさつは ひらがなばかりなので 言葉の間を 少しあける */

/* 指示書17: 承認見本のふれあい。既存の遊びのボタン・部屋の切り取りは変えない。 */
.play-fureai-title { margin: 8px 0 0; font-size: clamp(22px, 3.6vw, 28px); font-weight: 800; }
.play-fureai { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; inline-size: min(100%, 680px); margin-inline: auto; }
.play-fureai > .btn { min-inline-size: 0; padding-inline: 0; font-size: clamp(18px, 4.6vw, 24px); white-space: nowrap; }
.play-fureai .phrase, .play-fureai .ph { white-space: nowrap; }
.fu-room { position: relative; }
.fu-dog { transform-origin: 50% 90%; will-change: transform; }
/* 前足の先に出す肉球。人の手・縫い目は出さない。 */
.fu-paw { position: absolute; z-index: 13; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(120, 60, 60, .28)); }
.fu-paw svg { display: block; inline-size: 100%; block-size: 100%; }
.fu-ring { position: absolute; z-index: 13; border: 4px solid #F28C28; border-radius: 50%; pointer-events: none; }
.fu-rope { position: absolute; inset: 0; z-index: 11; pointer-events: none; overflow: visible; }
.fu-ropetoy { position: absolute; z-index: 12; pointer-events: none; transform-origin: 50% 50%; filter: drop-shadow(0 3px 2px rgba(59, 47, 40, .25)); }
.fu-bang { position: absolute; z-index: 14; pointer-events: none; display: grid; place-items: center; inline-size: 150px; block-size: 104px; }
.fu-bang svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; }
.fu-bang b { position: relative; font-size: 1em; font-weight: 900; color: #fff; letter-spacing: .04em; text-shadow: 0 2px 0 #B8402F; }
.fu-pad { display: grid; place-items: center; gap: 4px; inline-size: 100%; min-block-size: 132px; border: 0; border-radius: var(--radius-card); cursor: pointer; background: var(--color-primary); color: var(--color-ink); font: inherit; font-size: 32px; font-weight: 900; box-shadow: 0 8px 0 var(--color-deep); touch-action: none; -webkit-user-select: none; user-select: none; }
.fu-pad small { font-size: 18px; font-weight: 700; }
.fu-pad:active, .fu-pad.is-down { transform: translateY(4px); box-shadow: 0 4px 0 var(--color-deep); }
.fu-pad[disabled] { opacity: .55; }
.fu-pips { display: flex; justify-content: center; gap: 12px; margin: 2px 0 0; padding: 0; list-style: none; }
.fu-pips li { inline-size: 30px; block-size: 30px; border-radius: 50%; background: #F3E2CC; box-shadow: inset 0 2px 0 rgba(0, 0, 0, .06); }
.fu-pips li.is-on { background: #E8604C; box-shadow: 0 3px 0 #B8402F; }
.fu-end { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.fu-end .ph { white-space: nowrap; }

/* 指示書21: おぼえたことばは、いつもの部屋の犬と吹き出しで見せる。 */
.word-screen { gap: 12px; }
.word-screen h1 { margin: 0; }
.word-screen .word-bubble { min-block-size: 3.4em; display: grid; align-content: center; transition: opacity .25s linear; }
.word-screen .word-bubble.is-swap { opacity: 0; }
#app .dog-room.word-room { inline-size: min(100%, 600px, 60svh); flex: none; margin-inline: auto; }
#homeBubble.is-talk, #homeBubble.is-koyomi { min-block-size: 3.4em; }
@media (prefers-reduced-motion: reduce) { .word-screen .word-bubble { transition: none; } }
