:root {
  color-scheme: light;
  --paper: #f7f1e7;
  --card: #fffdf8;
  --ink: #342c25;
  --muted: #665b4f;
  --line: #dbcfbd;
  --green: #3d6045;
  --green-soft: #e8eee2;
  --rust: #a33f27;
  /* 差し替えた画像の配置調整はここから。背景と猫は別レイヤーです。 */
  --cat-width: 42%;
  --cat-height: 94%;
  --cat-left: 51%;
  --cat-bottom: -1%;
  --room-position: center 62%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif; font-size: 17px; line-height: 1.65; }
button, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; transition: background-color .15s, border-color .15s, box-shadow .15s; }
button:disabled { cursor: default; }
button:focus-visible, summary:focus-visible { outline: 3px solid #9d4e24; outline-offset: 4px; }
h1, h2, p { margin: 0; }
.app { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
h1 { font-size: 24px; line-height: 1.5; letter-spacing: .04em; }
h1 > span { font-size: 24px; margin-right: 6px; }
.header-note { color: var(--muted); font-size: 15px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.motion-toggle { min-height: 44px; padding: 7px 12px; border: 1px solid #b6bba4; border-radius: 24px; background: #e9eedf; font-size: 14px; font-weight: 700; color: #3c5438; white-space: nowrap; }
.motion-toggle:hover { background: #dce5ce; }
body[data-motion="off"] .motion-toggle { background: #f5eee2; color: #63533e; border-color: #c5b59e; }
.hud { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; padding: 14px 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.timer-block { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; }
.timer-label { font-size: 14px; font-weight: 700; }
.timer { display: flex; align-items: baseline; gap: 4px; line-height: 1.2; }
.timer strong { font-size: 36px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.timer span { font-size: 14px; }
.time-track { grid-column: 1 / -1; height: 5px; margin-top: 9px; background: #e6dfd2; overflow: hidden; border-radius: 8px; }
.time-track > span { display: block; width: 100%; height: 100%; background: var(--green); }
.is-urgent .timer { color: var(--rust); }
.is-urgent .time-track > span { background: var(--rust); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0; margin: 0; }
.steps li { display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 52px; border-radius: 9px; background: #f3eee5; color: #65594a; font-size: 17px; position: relative; }
.step-number { font-size: 13px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #e3dacb; }
.step-check { display: none; }
.steps li.current { background: var(--green); color: white; font-weight: 700; }
.steps li.current .step-number { background: #ffffff26; }
.steps li.complete { background: var(--green-soft); color: #354e35; }
.steps li.complete .step-number { display: none; }
.steps li.complete .step-check { display: inline; order: -1; }
.task-banner { text-align: center; padding: 17px 0 18px; }
.eyebrow { color: #75523a; font-size: 14px; font-weight: 700; letter-spacing: .04em; }
#task-title { font-size: clamp(27px, 3.2vw, 36px); line-height: 1.45; margin-top: 3px; text-wrap: balance; }
.game-board { overflow: hidden; border-radius: 22px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 6px 24px #6f48250a; }
.room-card { width: 100%; }
.room { position: relative; height: clamp(300px, 39vw, 440px); max-height: 46svh; min-height: 280px; background: #e5d1ae; isolation: isolate; overflow: hidden; }
.room-image, .room-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.room-image { object-fit: cover; object-position: var(--room-position); opacity: 0; }
.room.has-room-image .room-image { opacity: 1; }
.room.has-room-image .room-fallback { visibility: hidden; }
.scene-label { position: absolute; z-index: 3; top: 19px; left: 21px; font-size: 14px; font-weight: 600; color: #473d2f; background: #fffaf0ee; border: 1px solid #e4d8c6; border-radius: 30px; padding: 6px 14px; }
.image-note { position: absolute; z-index: 4; bottom: 10px; left: 10px; right: 10px; width: fit-content; max-width: calc(100% - 20px); padding: 5px 9px; font-size: 13px; color: #4c3c27; border: 1px solid #d0b88e; border-radius: 5px; background: #fff4dcee; }
.cat-stage { position: absolute; z-index: 2; left: var(--cat-left); bottom: var(--cat-bottom); width: var(--cat-width); height: var(--cat-height); transform: translateX(-50%); }
.cat-actor { position: absolute; inset: 0; transform-origin: 52% 89%; }
.cat-image { width: 100%; height: 100%; object-fit: contain; object-position: bottom; position: absolute; inset: 0; opacity: 0; }
.room.has-cat-image .cat-image { opacity: 1; }
.room.has-cat-image .cat-fallback { visibility: hidden; }
.cat-shadow { position: absolute; width: 55%; height: 7%; bottom: 6%; left: 26%; background: #54361248; filter: blur(10px); border-radius: 50%; }
.cat-fallback { position: absolute; bottom: 4%; inset-inline: 0; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.cat-fallback > span { font-size: clamp(100px, 15vw, 165px); }
.cat-fallback small { margin-top: 8px; padding: 5px 8px; color: #55412d; font-size: 14px; background: #fff8e9; border-radius: 5px; }
.cat-speech { position: absolute; z-index: 3; left: 68%; top: 26%; max-width: 28%; padding: 14px 18px; font-size: 17px; font-weight: 700; line-height: 1.55; background: #fffcf5f5; border: 1px solid #d9c8ae; border-radius: 18px 18px 18px 3px; box-shadow: 0 4px 14px #6a48241a; }
.room[data-state="blocked"] .cat-speech { border-color: #b58556; background: #fff2d9; }
.room[data-state="responding"] .cat-speech { background: #edf3e2; border-color: #a2b78c; }
.control-card { padding: 24px 28px 20px; border-top: 1px solid var(--line); }
.title-panel { text-align: center; }
.intro { color: #5a4e40; font-size: 17px; line-height: 1.9; }
.intro strong { color: var(--ink); font-size: 19px; }
.button { display: flex; justify-content: center; align-items: center; gap: 25px; width: 100%; max-width: 650px; margin-inline: auto; min-height: 67px; padding: 14px 24px; font-size: 22px; font-weight: 700; border: 2px solid transparent; border-radius: 12px; line-height: 1.5; }
.button.primary { background: var(--green); color: white; box-shadow: 0 3px 0 #24402b; }
.button.primary:hover:not(:disabled) { background: #2c4d33; box-shadow: 0 4px 0 #24402b; }
.button.primary:active:not(:disabled) { box-shadow: none; }
.button.primary:disabled { background: #e4ebdc; color: #3f583c; border-color: #c2d1b7; box-shadow: none; }
#start-button { margin-top: 17px; max-width: 530px; }
.start-note { color: var(--muted); font-size: 14px; margin-top: 13px; }
#work-panel, #response-panel { max-width: 650px; margin: 0 auto; }
.work-overview { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 13px; font-size: 16px; }
.progress-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; margin: 15px 0 7px; color: #5e5346; }
.progress-heading strong { color: var(--green); font-variant-numeric: tabular-nums; }
.work-track, .mood-track { overflow: hidden; height: 8px; border-radius: 10px; background: #e9e1d4; }
.work-track > span, .mood-track > span { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; }
.panel-hint { margin-top: 12px; color: #655647; font-size: 14px; line-height: 1.7; text-align: center; }
.incident-description { text-align: center; font-size: 16px; margin-bottom: 16px; color: #5b4735; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.choice { display: flex; flex-direction: column; align-items: stretch; gap: 7px; text-align: left; padding: 17px 15px; min-height: 124px; width: 100%; border: 2px solid #cccfbb; background: #f5f8ee; border-radius: 12px; box-shadow: 0 2px 0 #d8decc; }
.choice:hover:not(:disabled) { background: #e8efdc; border-color: #768b5f; }
.choice-heading { display: flex; align-items: center; gap: 7px; line-height: 1.5; }
.choice-heading > span:first-child { font-size: 22px; }
.choice-heading > strong { font-size: 18px; }
.choice-time { margin-left: auto; white-space: nowrap; font-size: 19px; font-weight: 800; }
.choice-effect { font-size: 16px; font-weight: 700; color: #364d32; }
.choice-detail { color: #5f594c; font-size: 13px; }
.choice[data-action="pet"] { background: #fff0df; border-color: #dcb486; box-shadow: 0 2px 0 #e9c7a0; }
.choice[data-action="pet"]:hover:not(:disabled) { background: #ffe6c8; border-color: #b77b3d; }
.choice[data-action="ignore"] { background: #faf4ee; border-color: #d7c5b9; box-shadow: 0 2px 0 #e4d7ce; }
.choice[data-action="ignore"]:hover:not(:disabled) { background: #f4e7dc; border-color: #b39078; }
.choice[data-action="ignore"] .choice-effect { color: #943d29; }
.response-panel { min-height: 182px; padding-top: 10px; }
#response-description { text-align: center; font-size: 18px; }
.response-panel .progress-heading { margin-top: 24px; }
.cat-status { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 34px; padding: 18px 28px 20px; background: #f1eadc; border-top: 1px solid var(--line); }
.meter-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; margin-bottom: 7px; }
.meter-heading strong, .pet-block strong { font-size: 19px; }
#mood-label { font-weight: 700; color: #3e553a; }
.mood-track { background: #dccfbc; height: 6px; }
.mood-track > span { background: #b67332; }
#mood-detail { font-size: 13px; margin-top: 6px; color: #665440; }
.pet-block { padding-left: 28px; border-left: 1px solid #d6c7b1; font-size: 15px; }
#pets-hint { font-size: 13px; color: #665440; margin-top: 4px; }
.result-panel { text-align: center; max-width: 780px; margin-inline: auto; }
.result-title { font-size: clamp(25px, 3.2vw, 36px); line-height: 1.6; margin: 7px auto 10px; max-width: 690px; outline: none; text-wrap: balance; }
.result-description { color: #655342; font-size: 16px; margin-bottom: 22px; }
#retry-button { max-width: 530px; }
.result-stats { display: grid; grid-template-columns: .9fr 1.5fr .9fr; gap: 16px; max-width: 720px; border-top: 1px solid var(--line); margin: 24px auto 0; padding-top: 17px; }
.result-stats dt { font-size: 14px; color: #645746; }
.result-stats dd { font-size: 16px; margin: 5px 0 0; }
.result-stats strong { font-size: 22px; font-variant-numeric: tabular-nums; }
body[data-screen="result"] .room { height: 290px; min-height: 220px; max-height: 34svh; }
body[data-screen="result"] .cat-stage { width: 36%; height: 97%; }
.guide { margin-top: 19px; border: 1px solid var(--line); border-radius: 12px; background: #f9f5ec; font-size: 16px; color: #54483a; }
.guide summary { cursor: pointer; padding: 16px 21px; min-height: 56px; list-style: none; display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.guide summary::-webkit-details-marker { display: none; }
.guide[open] summary > span { transform: rotate(45deg); }
.guide-content { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 30px; padding: 0 21px 23px; font-size: 15px; line-height: 1.9; }
.guide-content strong { color: #3b4f33; }
.site-footer { text-align: center; color: #72614e; font-size: 14px; padding: 22px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.noscript { padding: 20px; color: var(--rust); }
/* 画像がない場合も遊べるCSS仮素材。実画像は独立レイヤーで重ねます。 */
.room-fallback { background: #e8dcc5; }
.fallback-floor { position: absolute; inset: 58% 0 0; border-top: 8px solid #b79b71; background: repeating-linear-gradient(0deg, transparent 0 51px, #ac7e4438 52px 53px), #cba778; }
.fallback-window { position: absolute; width: 22%; height: 41%; top: 8%; left: 7%; border: 12px solid #fffbec; background: #cdded5; box-shadow: 0 5px 0 #c6b89d; }
.fallback-window::before { content: ""; width: 9px; height: 100%; background: #fffbec; position: absolute; left: 47%; }
.fallback-window::after { content: ""; height: 8px; width: 100%; background: #fffbec; position: absolute; top: 52%; }
.fallback-window i { width: 39px; height: 39px; border-radius: 50%; position: absolute; top: 12%; right: 10%; background: #f7d593; }
.fallback-light { position: absolute; width: 26%; height: 110%; left: 12%; top: 20%; background: linear-gradient(#fff8d570, #ffedb92b); transform: skew(-35deg); }
.fallback-rug { position: absolute; left: 25%; top: 66%; width: 53%; height: 25%; border-radius: 50%; border: 8px solid #cbb997; background: #ddcdad; }
.fallback-door { position: absolute; top: 13%; right: 8%; height: 58%; width: 13%; background: #bfa079; border: 8px solid #967d5f; border-bottom: 0; border-radius: 3px 3px 0 0; }
.fallback-door i { position: absolute; width: 17px; height: 8px; border-radius: 5px; background: #655b40; right: 6px; top: 55%; }
.fallback-rack { position: absolute; top: 41%; left: 7%; border: 6px solid #a18463; border-bottom: 0; width: 14%; height: 32%; text-align: center; font-size: 53px; }
.fallback-bench { position: absolute; right: 24%; top: 45%; width: 12%; height: 23%; text-align: center; font-size: 45px; border-bottom: 26px solid #a18463; }
.fallback-plant { position: absolute; top: 35%; left: 34%; height: 25%; width: 7%; }
.fallback-plant span { position: absolute; bottom: 0; left: 13%; width: 60%; height: 40%; background: #b88662; border-radius: 3px 3px 16px 16px; }
.fallback-plant i { width: 35%; height: 60%; border-radius: 90% 10%; position: absolute; left: 15%; top: 5%; background: #849269; transform: rotate(-28deg); }
.fallback-plant i:nth-child(2) { left: 47%; top: 14%; transform: rotate(30deg); background: #6e8458; }
@media (max-width: 900px) {
  .app { width: min(800px, calc(100% - 32px)); }
  .header-note { font-size: 13px; }
  .choices { gap: 10px; }
  .choice { padding: 15px 12px; }
  .choice-heading { flex-wrap: wrap; }
  .choice-heading > strong { font-size: 17px; }
  .choice-time { font-size: 18px; }
  .choice-effect { font-size: 15px; }
  .control-card { padding-inline: 22px; }
  .cat-speech { font-size: 16px; padding: 11px 14px; }
}
@media (max-width: 640px) {
  :root { --cat-width: 62%; --cat-height: 94%; --cat-left: 47%; --room-position: 48% 60%; }
  .app { width: min(520px, calc(100% - 24px)); }
  .site-header { padding: 15px 1px; }
  h1 { font-size: 21px; }
  h1 > span { font-size: 21px; margin-right: 2px; }
  .header-note { display: none; }
  .header-actions { gap: 0; }
  .site-header h1 { font-size: 19px; letter-spacing: 0; }
  .motion-toggle { font-size: 13px; padding-inline: 10px; }
  .hud { position: sticky; top: 6px; z-index: 5; grid-template-columns: 1fr; gap: 9px; padding: 9px 11px 11px; border-radius: 12px; box-shadow: 0 3px 12px #5b422510; }
  .timer-block { display: flex; justify-content: center; gap: 10px; }
  .timer strong { font-size: 30px; }
  .timer-label { font-size: 15px; }
  .time-track { display: none; }
  .steps { gap: 5px; }
  .steps li { min-height: 38px; gap: 5px; font-size: 14px; border-radius: 6px; }
  .step-number { width: 18px; height: 18px; font-size: 11px; }
  .task-banner { padding: 14px 0; }
  .eyebrow { font-size: 13px; }
  #task-title { font-size: 27px; }
  body[data-screen="title"] #task-title { font-size: 26px; }
  .game-board { border-radius: 15px; }
  .room { height: 265px; min-height: 220px; max-height: 35svh; }
  .scene-label { top: 11px; left: 11px; font-size: 12px; padding: 4px 9px; }
  .cat-speech { left: auto; right: 3%; top: 24%; max-width: 39%; font-size: 14px; padding: 10px 12px; border-radius: 13px 13px 13px 2px; }
  .cat-shadow { width: 60%; left: 20%; }
  .image-note { font-size: 12px; }
  .control-card { padding: 18px 16px; }
  .intro { font-size: 16px; line-height: 1.8; }
  .intro strong { font-size: 17px; }
  .button { min-height: 64px; font-size: 21px; padding: 12px 16px; }
  .start-note { font-size: 13px; }
  .work-overview { gap: 4px; flex-direction: column; font-size: 15px; margin-bottom: 12px; }
  .panel-hint { font-size: 14px; margin-top: 10px; }
  .choices { grid-template-columns: 1fr; gap: 10px; }
  .choice { min-height: 99px; padding: 11px 14px; gap: 3px; }
  .choice-heading { flex-wrap: nowrap; }
  .choice-heading > strong { font-size: 19px; }
  .choice-heading > span:first-child { font-size: 23px; }
  .choice-time { font-size: 20px; }
  .choice-effect { font-size: 16px; }
  .choice-detail { font-size: 13px; }
  .incident-description { font-size: 15px; margin-bottom: 12px; text-align: left; }
  #response-description { font-size: 17px; }
  .response-panel { min-height: 185px; padding-top: 0; }
  .progress-heading { font-size: 14px; gap: 7px; }
  .cat-status { grid-template-columns: 1fr; gap: 14px; padding: 17px 16px; }
  .pet-block { padding: 12px 0 0; border-left: 0; border-top: 1px solid #d6c7b1; }
  .meter-heading { font-size: 15px; }
  .result-title { font-size: 27px; line-height: 1.6; }
  .result-description { font-size: 15px; }
  .result-stats { grid-template-columns: 1fr; gap: 10px; text-align: left; margin-top: 22px; }
  .result-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
  .result-stats dd { margin: 0; text-align: right; }
  body[data-screen="result"] .room { height: 230px; min-height: 180px; max-height: 30svh; }
  body[data-screen="result"] .cat-stage { width: 62%; height: 96%; }
  .guide-content { grid-template-columns: 1fr; font-size: 15px; padding-inline: 17px; }
  .guide summary { padding-inline: 17px; }
  .site-footer { font-size: 13px; padding-block: 18px; }
  .fallback-window { border-width: 6px; }
  .fallback-rack { border-width: 4px; font-size: 30px; }
  .fallback-bench { font-size: 29px; border-bottom-width: 17px; }
  .fallback-door { border-width: 5px; }
}
/* 演出はCSSだけで描画。ゲームの時計や入力待ちには使いません。 */
.sunbeams, .sun-dust, .affection, .result-confetti { position: absolute; inset: 0; pointer-events: none; }
.sunbeams { z-index: 1; inset: -10%; background: linear-gradient(117deg, transparent 9%, #fff5be38 17%, transparent 26%, #ffefb529 34%, transparent 43%); transform-origin: 0 0; }
.sun-dust { z-index: 1; overflow: hidden; }
.sun-dust i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fffbe6; box-shadow: 0 0 9px 2px #fff4d173; opacity: 0; left: 15%; top: 68%; }
.sun-dust i:nth-child(2) { left: 24%; top: 79%; animation-delay: -3s; }
.sun-dust i:nth-child(3) { left: 39%; top: 45%; animation-delay: -6s; width: 3px; height: 3px; }
.sun-dust i:nth-child(4) { left: 9%; top: 39%; animation-delay: -9s; }
.sun-dust i:nth-child(5) { left: 62%; top: 74%; animation-delay: -4s; width: 3px; height: 3px; }
.sun-dust i:nth-child(6) { left: 73%; top: 51%; animation-delay: -7s; }
.sun-dust i:nth-child(7) { left: 48%; top: 85%; animation-delay: -1s; width: 4px; height: 4px; }
.scene-preparation { display: none; position: absolute; z-index: 3; left: 20%; bottom: 16%; align-items: center; gap: 11px; border: 1px solid #ebd7b7; border-radius: 18px; padding: 11px 14px; background: #fffaf0eb; box-shadow: 0 6px 16px #76562314; pointer-events: none; }
#preparation-icon { font-size: 34px; line-height: 1.25; display: inline-block; }
.preparation-dots { display: flex; gap: 4px; }
.preparation-dots i { width: 5px; height: 5px; background: #526344; border-radius: 50%; }
.preparation-dots i:nth-child(2) { animation-delay: .16s; }
.preparation-dots i:nth-child(3) { animation-delay: .32s; }
.room[data-state="working"] .scene-preparation { display: flex; }
.attention-mark { display: none; position: absolute; z-index: 3; left: 34%; top: 15%; color: #96541f; font-size: 31px; font-weight: 800; text-shadow: 0 2px 0 #fff7e1; pointer-events: none; transform: rotate(-12deg); }
.room[data-state="blocked"] .attention-mark { display: block; }
.affection { display: none; z-index: 3; }
.affection span { position: absolute; left: 40%; top: 45%; color: #c96d59; font-size: 31px; opacity: 0; text-shadow: 0 2px 3px #fff4e3; }
.affection span:nth-child(2) { left: 59%; top: 57%; font-size: 24px; animation-delay: .55s; }
.affection span:nth-child(3) { left: 46%; top: 62%; font-size: 21px; animation-delay: 1.1s; }
.affection span:nth-child(4) { left: 55%; top: 35%; font-size: 28px; animation-delay: 1.65s; }
.room[data-action="pet"] .affection, .room[data-outcome="staff"] .affection { display: block; }
.toy-play { display: none; position: absolute; z-index: 3; left: 67%; top: 58%; pointer-events: none; transform-origin: 50% -80px; }
.toy-play::before { content: ""; position: absolute; width: 2px; height: 80px; background: #7359329e; left: 50%; bottom: 92%; }
.toy-play span { font-size: 46px; display: block; filter: drop-shadow(0 4px 2px #71482130); }
.room[data-action="toy"] .toy-play { display: block; }
.huff-mark { display: none; position: absolute; z-index: 3; left: 29%; top: 42%; font-size: 18px; color: #755338; font-weight: 700; pointer-events: none; }
.room[data-action="ignore"] .huff-mark { display: block; }
.result-confetti { display: none; z-index: 3; overflow: hidden; }
.room[data-outcome="success"] .result-confetti { display: block; }
.result-confetti i { position: absolute; width: 9px; height: 17px; top: -8%; left: 11%; background: #c2944b; opacity: 0; }
.result-confetti i:nth-child(2) { left: 20%; background: #7f9365; animation-delay: .15s; }
.result-confetti i:nth-child(3) { left: 29%; background: #d6976e; animation-delay: .45s; }
.result-confetti i:nth-child(4) { left: 38%; background: #e3c98a; animation-delay: .1s; }
.result-confetti i:nth-child(5) { left: 46%; background: #90a07d; animation-delay: .65s; }
.result-confetti i:nth-child(6) { left: 57%; background: #bd785e; animation-delay: .35s; }
.result-confetti i:nth-child(7) { left: 65%; background: #c6a565; animation-delay: .7s; }
.result-confetti i:nth-child(8) { left: 74%; background: #879469; animation-delay: .25s; }
.result-confetti i:nth-child(9) { left: 83%; background: #d6976e; animation-delay: .55s; }
.result-confetti i:nth-child(10) { left: 91%; background: #e3c98a; animation-delay: .85s; }
.staff-seal { display: none; position: absolute; z-index: 3; right: 20%; bottom: 13%; width: 93px; height: 93px; border: 3px double #a6662b; border-radius: 50%; color: #78441b; font-size: 16px; line-height: 1.5; font-weight: 800; background: #fff4ddeb; align-items: center; justify-content: center; text-align: center; transform: rotate(9deg); pointer-events: none; }
.room[data-outcome="staff"] .staff-seal { display: flex; }
.sleepy-mark { display: none; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.sleepy-mark span { position: absolute; left: 38%; top: 39%; font-size: 25px; color: #5c6655; font-weight: 700; opacity: 0; }
.sleepy-mark span:nth-child(2) { left: 35%; top: 27%; animation-delay: .6s; }
.sleepy-mark span:nth-child(3) { left: 32%; top: 12%; animation-delay: 1.2s; }
.room[data-outcome="timeout"] .sleepy-mark { display: block; }
.work-track { position: relative; }
.work-track::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, #fff9 48%, transparent 62%); opacity: 0; pointer-events: none; }
body[data-motion="on"] .room-image { animation: morning-pan 24s ease-in-out infinite alternate; }
body[data-motion="on"] .sunbeams { animation: morning-rays 13s ease-in-out infinite alternate; }
body[data-motion="on"] .sun-dust i { animation-name: dust-drift; animation-duration: 12s; animation-timing-function: linear; animation-iteration-count: infinite; }
body[data-motion="on"] .cat-actor { animation: cat-breathe 4s ease-in-out infinite; }
body[data-motion="on"] .cat-shadow { animation: shadow-breathe 4s ease-in-out infinite; }
body[data-motion="on"] .room[data-state="working"] .cat-actor { animation: cat-watch 3.5s ease-in-out infinite; }
body[data-motion="on"] .room[data-state="blocked"][data-incident="ankles"] .cat-actor { animation: cat-nuzzle 2s ease-in-out infinite; }
body[data-motion="on"] .room[data-state="blocked"][data-incident="belly"] .cat-actor { animation: cat-lean 2.8s ease-in-out infinite; }
body[data-motion="on"] .room[data-state="blocked"][data-incident="voice"] .cat-actor { animation: cat-call 1.6s ease-in-out infinite; }
body[data-motion="on"] .room[data-state="blocked"][data-incident="paw"] .cat-actor { animation: cat-ask 1.9s ease-in-out infinite; }
body[data-motion="on"] .room[data-state="blocked"][data-incident="gaze"] .cat-actor { animation: cat-curious 3s ease-in-out infinite; }
body[data-motion="on"] .room[data-action="pet"] .cat-actor { animation: cat-purr 1.3s ease-in-out infinite; }
body[data-motion="on"] .room[data-action="toy"] .cat-actor { animation: cat-follow 2s ease-in-out infinite; }
body[data-motion="on"] .room[data-action="ignore"] .cat-actor { animation: cat-huff .7s ease-in-out 1; }
body[data-motion="on"] .room[data-outcome="success"] .cat-actor { animation: cat-goodbye 1.4s ease-in-out 1; }
body[data-motion="on"] .room[data-outcome="timeout"] .cat-actor { animation: cat-settle 1.5s ease-out both; }
body[data-motion="on"] .room[data-outcome="staff"] .cat-actor { animation: cat-purr 1.3s ease-in-out 3; }
body[data-motion="on"] .attention-mark { animation: attention-pop .5s ease-out 2; }
body[data-motion="on"] #preparation-icon { animation: prop-float 1.8s ease-in-out infinite; }
body[data-motion="on"] .room[data-step="1"] #preparation-icon { animation-name: prop-swing; }
body[data-motion="on"] .room[data-step="2"] #preparation-icon { animation-name: prop-step; }
body[data-motion="on"] .room[data-step="3"] #preparation-icon { animation-name: prop-open; }
body[data-motion="on"] .preparation-dots i { animation-name: dot-breathe; animation-duration: 1.2s; animation-iteration-count: infinite; }
body[data-motion="on"] .affection span { animation-name: heart-rise; animation-duration: 2.2s; animation-timing-function: ease-out; animation-iteration-count: infinite; }
body[data-motion="on"] .room[data-outcome="staff"] .affection span { animation-iteration-count: 2; animation-fill-mode: both; }
body[data-motion="on"] .toy-play { animation: toy-swing 2s ease-in-out infinite; }
body[data-motion="on"] .huff-mark { animation: huff-rise 1s ease-out both; }
body[data-motion="on"] .result-confetti i { animation-name: confetti-fall; animation-duration: 3s; animation-timing-function: ease-out; animation-fill-mode: both; }
body[data-motion="on"] .staff-seal { animation: seal-stamp .6s cubic-bezier(.2,.7,.2,1.2) both; }
body[data-motion="on"] .sleepy-mark span { animation-name: sleepy-rise; animation-duration: 2.2s; animation-timing-function: ease-out; animation-iteration-count: 2; animation-fill-mode: both; }
body[data-motion="on"][data-mode="working"] .work-track::after,
body[data-motion="on"][data-mode="responding"] .work-track::after { animation: progress-glint 2.5s linear infinite; }
/* a/bを切り替えて、状態が変わったときだけフェードを再生します。 */
body[data-motion="on"][data-transition="a"] #task-title,
body[data-motion="on"][data-transition="a"] .cat-speech { animation: scene-enter-a .32s ease-out both; }
body[data-motion="on"][data-transition="b"] #task-title,
body[data-motion="on"][data-transition="b"] .cat-speech { animation: scene-enter-b .32s ease-out both; }
body[data-motion="on"][data-transition="a"] .control-card > div:not([hidden]),
body[data-motion="on"][data-transition="a"] #play-panel > div:not([hidden]) { animation: panel-enter-a .22s ease-out both; }
body[data-motion="on"][data-transition="b"] .control-card > div:not([hidden]),
body[data-motion="on"][data-transition="b"] #play-panel > div:not([hidden]) { animation: panel-enter-b .22s ease-out both; }
body[data-motion="on"] .steps li.complete .step-check { animation: check-pop .4s ease-out both; }
body[data-screen="result"] .room-image,
body[data-screen="result"] .sunbeams,
body[data-screen="result"] .sun-dust i,
body[data-screen="result"] .cat-shadow { animation-play-state: paused; }
body[data-visibility="hidden"] *, body[data-visibility="hidden"] *::after { animation-play-state: paused !important; }
body[data-motion="off"] *, body[data-motion="off"] *::before, body[data-motion="off"] *::after { animation: none !important; transition: none !important; }
body[data-motion="off"] .sun-dust, body[data-motion="off"] .affection, body[data-motion="off"] .result-confetti, body[data-motion="off"] .sleepy-mark { display: none; }
@keyframes morning-pan { from { transform: scale(1.025) translateX(-.35%); } to { transform: scale(1.04) translateX(.35%); } }
@keyframes morning-rays { from { opacity: .42; transform: translateX(-2%) rotate(-2deg); } to { opacity: .8; transform: translateX(2%) rotate(2deg); } }
@keyframes dust-drift { 0% { opacity: 0; transform: translate(0, 20px); } 20%, 75% { opacity: .65; } 100% { opacity: 0; transform: translate(45px, -95px); } }
@keyframes cat-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.013, 1.019); } }
@keyframes shadow-breathe { 0%, 100% { opacity: .8; transform: scaleX(1); } 50% { opacity: .68; transform: scaleX(.96); } }
@keyframes cat-watch { 0%, 100% { transform: rotate(0); } 35%, 60% { transform: rotate(-2deg) translateY(-2px); } }
@keyframes cat-nuzzle { 0%, 100% { transform: translateX(-7px) rotate(-2deg); } 50% { transform: translateX(9px) rotate(2deg); } }
@keyframes cat-lean { 0%, 100% { transform: rotate(0); } 38%, 65% { transform: rotate(-6deg) translateY(3px); } }
@keyframes cat-call { 0%, 60%, 100% { transform: translateY(0); } 24% { transform: translateY(-8px) scaleY(1.025); } 40% { transform: scaleY(.985); } }
@keyframes cat-ask { 0%, 65%, 100% { transform: rotate(0); } 25% { transform: rotate(3deg) translateY(-4px); } 42% { transform: rotate(-1deg); } }
@keyframes cat-curious { 0%, 100% { transform: rotate(0); } 35%, 70% { transform: rotate(-4deg) scale(1.025); } }
@keyframes cat-purr { 0%, 100% { transform: rotate(-1deg) scaleY(1); } 50% { transform: rotate(1deg) scaleY(.985); } }
@keyframes cat-follow { 0%, 100% { transform: translateX(-9px) rotate(-2deg); } 50% { transform: translateX(17px) rotate(3deg); } }
@keyframes cat-huff { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-2deg); } }
@keyframes cat-goodbye { 0%, 100% { transform: rotate(0); } 30%, 65% { transform: rotate(4deg) translateY(-4px); } }
@keyframes cat-settle { from { transform: scaleY(1); } to { transform: scaleY(.97) rotate(-2deg); } }
@keyframes attention-pop { 0% { opacity: 0; transform: translateY(8px) rotate(-12deg) scale(.8); } 55% { opacity: 1; transform: translateY(-3px) rotate(-12deg) scale(1.12); } 100% { opacity: 1; transform: rotate(-12deg) scale(1); } }
@keyframes prop-float { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-5px); } }
@keyframes prop-swing { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes prop-step { 0%, 100% { transform: translateX(-3px) rotate(-6deg); } 50% { transform: translateX(3px) rotate(4deg); } }
@keyframes prop-open { 0%, 100% { transform: perspective(120px) rotateY(0); } 50% { transform: perspective(120px) rotateY(-22deg); } }
@keyframes dot-breathe { 0%, 80%, 100% { opacity: .35; } 35% { opacity: 1; } }
@keyframes heart-rise { 0% { opacity: 0; transform: translateY(15px) scale(.7) rotate(-7deg); } 22% { opacity: .9; } 100% { opacity: 0; transform: translateY(-65px) scale(1.13) rotate(8deg); } }
@keyframes toy-swing { 0%, 100% { transform: rotate(-19deg); } 50% { transform: rotate(19deg); } }
@keyframes huff-rise { 0% { opacity: 0; transform: translateY(8px); } 30%, 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes confetti-fall { 0% { opacity: 0; transform: translateY(-15px) rotate(0); } 10%, 70% { opacity: .85; } 100% { opacity: 0; transform: translate(32px, 310px) rotate(310deg); } }
@keyframes seal-stamp { 0% { opacity: 0; transform: scale(1.55) rotate(-12deg); } 75% { opacity: 1; transform: scale(.94) rotate(11deg); } 100% { opacity: 1; transform: scale(1) rotate(9deg); } }
@keyframes sleepy-rise { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 35%, 65% { opacity: .85; } 100% { opacity: 0; transform: translateY(-15px) scale(1.1); } }
@keyframes progress-glint { 0% { opacity: .5; transform: translateX(-100%); } 100% { opacity: .5; transform: translateX(100%); } }
@keyframes scene-enter-a { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scene-enter-b { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes panel-enter-a { from { opacity: .5; } to { opacity: 1; } }
@keyframes panel-enter-b { from { opacity: .5; } to { opacity: 1; } }
@keyframes check-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (max-width: 640px) {
  .scene-preparation { left: 8%; bottom: 13%; padding: 8px 10px; gap: 8px; border-radius: 12px; }
  #preparation-icon { font-size: 26px; }
  .attention-mark { left: 22%; top: 20%; font-size: 25px; }
  .affection span { font-size: 24px; }
  .toy-play { left: 70%; top: 65%; }
  .toy-play span { font-size: 34px; }
  .huff-mark { left: 16%; font-size: 15px; }
  .staff-seal { width: 73px; height: 73px; right: 8%; bottom: 10%; font-size: 13px; }
  .sleepy-mark span { left: 26%; }
  .sleepy-mark span:nth-child(2) { left: 22%; }
  .sleepy-mark span:nth-child(3) { left: 18%; }
}
/* フル画面の舞台。操作部分だけを、読みやすい半透明のパネルとして重ねます。 */
:root {
  --cat-width: 48%;
  --cat-height: 69svh;
  --cat-bottom: 18svh;
  --cat-left: 50%;
  --room-position: center center;
  --cat-travel: clamp(26px, 4.5vw, 70px);
  --cat-hop: clamp(20px, 3.5vh, 38px);
}
html { min-height: 100%; background: #cfab7d; }
body { min-height: 100vh; min-height: 100svh; background: transparent; }
.app { position: relative; isolation: isolate; display: flex; flex-direction: column; width: 100%; min-height: 100vh; min-height: 100svh; margin: 0; padding: 16px max(24px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.site-header { position: relative; z-index: 6; flex-shrink: 0; padding: 0 0 14px; gap: 14px; }
.site-header h1 { padding: 8px 16px; border: 1px solid #fff9; border-radius: 30px; background: #fff8e9df; box-shadow: 0 3px 18px #56301114; }
.header-note { color: #483521; padding: 6px 12px; background: #fff8e9d9; border-radius: 20px; }
.motion-toggle { background: #eef2e5f2; min-height: 44px; }
main { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hud { position: relative; z-index: 5; align-self: center; width: min(1020px, 100%); background: #fffaf0eb; backdrop-filter: blur(14px); box-shadow: 0 4px 24px #4e32181a; border-color: #fff9; }
.task-banner { position: relative; z-index: 4; align-self: center; margin-top: 13px; padding: 10px 27px 12px; max-width: calc(100% - 16px); background: #fff9e9e8; border: 1px solid #fff8; border-radius: 18px; box-shadow: 0 4px 22px #65422012; }
#task-title { font-size: clamp(28px, 3vw, 39px); }
.game-board { position: static; align-self: center; width: min(1120px, 100%); margin-top: auto; padding-top: clamp(115px, 17svh, 215px); overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.room-card { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: -1; pointer-events: none; }
.room, body[data-screen="result"] .room { width: 100%; height: 100%; min-height: 0; max-height: none; border-radius: 0; }
.room::after { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, #fef7e529 0%, transparent 35%, transparent 62%, #6e452522 100%); pointer-events: none; }
.room-image { object-position: var(--room-position); }
.room .cat-stage, body[data-screen="result"] .room .cat-stage { width: var(--cat-width); height: var(--cat-height); bottom: var(--cat-bottom); left: var(--cat-left); }
.cat-stage { transition: width .55s ease, height .55s ease, bottom .55s ease, left .55s ease; }
.cat-speech { left: 65%; top: 33%; max-width: 26%; padding: 15px 20px; font-size: clamp(17px, 1.7vw, 23px); border-radius: 24px 24px 24px 4px; box-shadow: 0 7px 24px #603a2529; }
.scene-label { display: none; }
.image-note { bottom: 50%; left: 18px; right: auto; max-width: 260px; }
.control-card { position: relative; z-index: 4; border: 1px solid #ffffffb3; border-radius: 22px 22px 0 0; padding: 21px 26px 17px; background: #fffcf2ed; backdrop-filter: blur(18px); box-shadow: 0 5px 32px #4e2c231c; }
.cat-status { position: relative; z-index: 4; gap: 26px; padding: 10px 24px 12px; border: 1px solid #fff9; border-top: 1px solid #d8c6a3; border-radius: 0 0 20px 20px; background: #f3ead8ef; backdrop-filter: blur(18px); }
#mood-detail, #pets-hint { display: none; }
.meter-heading { margin-bottom: 4px; }
.pet-block { padding-left: 24px; }
body[data-screen="title"] .control-card, body[data-screen="result"] .control-card { border-radius: 22px; max-width: 740px; margin-inline: auto; }
body[data-screen="title"] .control-card { max-width: 680px; padding-block: 20px 18px; }
body[data-screen="title"] .intro { font-size: 16px; }
body[data-screen="title"] .start-note { margin-top: 10px; }
body[data-screen="result"] { --cat-height: 64svh; --cat-bottom: 29svh; }
body[data-screen="result"] .game-board { padding-top: 160px; }
.result-title { font-size: clamp(25px, 2.5vw, 33px); }
.result-stats { padding-top: 13px; margin-top: 18px; }
.guide { position: relative; z-index: 4; align-self: center; width: min(1120px, 100%); margin-top: 10px; background: #fffaf0e8; backdrop-filter: blur(14px); border-color: #fff9; }
.guide summary { padding: 10px 19px; min-height: 43px; font-size: 14px; }
.guide[open] { max-height: min(340px, 48svh); overflow-y: auto; }
.site-footer { display: none; }
.scene-preparation { left: 23%; bottom: 33%; transform: scale(1.1); }
.attention-mark { left: 33%; top: 29%; font-size: 48px; }
.affection span { left: 37%; top: 50%; font-size: 45px; }
.affection span:nth-child(2) { left: 62%; top: 53%; font-size: 34px; }
.affection span:nth-child(3) { left: 43%; top: 63%; font-size: 30px; }
.affection span:nth-child(4) { left: 57%; top: 36%; font-size: 42px; }
.toy-play { left: 66%; top: 44%; transform-origin: 50% -125px; }
.toy-play::before { height: 125px; }
.toy-play span { font-size: 65px; }
.huff-mark { left: 30%; top: 38%; font-size: 27px; }
.staff-seal { right: 25%; bottom: 44%; width: 115px; height: 115px; font-size: 20px; }
.sleepy-mark span { left: 33%; top: 39%; font-size: 39px; }
.sleepy-mark span:nth-child(2) { left: 29%; top: 31%; }
.sleepy-mark span:nth-child(3) { left: 25%; top: 21%; }
.scene-glints { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.scene-glints span { position: absolute; left: 13%; top: 44%; font-size: 27px; color: #fff5d6; opacity: 0; text-shadow: 0 0 16px #fff6de; }
.scene-glints span:nth-child(2) { left: 77%; top: 26%; font-size: 18px; animation-delay: -1.7s; }
.scene-glints span:nth-child(3) { left: 66%; top: 64%; font-size: 23px; animation-delay: -3.1s; }
.scene-glints span:nth-child(4) { left: 28%; top: 72%; font-size: 19px; animation-delay: -4.6s; }
.pet-hand { display: none; position: absolute; z-index: 3; left: 49%; top: 31%; font-size: clamp(38px, 4vw, 60px); filter: drop-shadow(0 5px 3px #59341d30); pointer-events: none; }
.room[data-action="pet"] .pet-hand { display: block; }
.floor-pawprints { display: none; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.floor-pawprints span { position: absolute; bottom: 26%; left: 25%; opacity: 0; font-size: 27px; transform: rotate(-25deg); filter: sepia(1); }
.floor-pawprints span:nth-child(2) { left: 32%; bottom: 31%; animation-delay: .25s; }
.floor-pawprints span:nth-child(3) { left: 39%; bottom: 35%; animation-delay: .5s; }
.floor-pawprints span:nth-child(4) { left: 46%; bottom: 38%; animation-delay: .75s; }
.room[data-state="working"] .floor-pawprints { display: block; }
body[data-motion="on"] .room-image { animation-duration: 14s; }
body[data-motion="on"] .sunbeams { animation-duration: 7s; }
body[data-motion="on"] .sun-dust i { animation-duration: 8s; width: 7px; height: 7px; }
body[data-motion="on"] .scene-glints span { animation-name: glint-bloom; animation-duration: 6s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
body[data-motion="on"] .room[data-state="title"] .cat-actor { animation: cat-welcome 5s ease-in-out infinite; }
body[data-motion="on"] .room[data-state="idle"] .cat-actor { animation: cat-curious 3.5s ease-in-out infinite; }
body[data-motion="on"] .room[data-state="working"] .cat-actor { animation-duration: 2.5s; }
body[data-motion="on"] .affection span { animation-duration: 1.8s; }
body[data-motion="on"] .pet-hand { animation: hand-stroke 1.25s ease-in-out infinite; }
body[data-motion="on"] .floor-pawprints span { animation-name: paw-trail; animation-duration: 2.6s; animation-timing-function: ease-out; animation-iteration-count: infinite; }
body[data-motion="on"] .toy-play { animation-duration: 1.65s; }
body[data-motion="on"] .result-confetti i { width: 13px; height: 24px; animation-duration: 3.5s; }
body[data-motion="on"] .staff-seal { animation-duration: .8s; }
body[data-screen="result"] .scene-glints span { animation-play-state: paused; }
body[data-motion="off"] .scene-glints, body[data-motion="off"] .floor-pawprints { display: none; }
@keyframes cat-welcome { 0%, 100% { transform: translateX(-10px) rotate(-3deg); } 18% { transform: translate(10px, -12px) rotate(4deg); } 32% { transform: translateX(18px) rotate(2deg) scaleY(.98); } 50%, 64% { transform: translateX(5px) rotate(-7deg) scale(1.04); } 80% { transform: translate(-13px, -5px) rotate(2deg); } }
@keyframes cat-watch { 0%, 100% { transform: translateX(0) rotate(0); } 22% { transform: translateX(calc(var(--cat-travel) * -.45)) rotate(-6deg); } 48% { transform: translate(8px, -8px) rotate(2deg); } 73% { transform: translateX(calc(var(--cat-travel) * .4)) rotate(5deg); } }
@keyframes cat-nuzzle { 0%, 100% { transform: translateX(calc(var(--cat-travel) * -.6)) rotate(-7deg) scaleY(.98); } 25% { transform: translateY(-8px) rotate(0); } 50% { transform: translateX(var(--cat-travel)) rotate(8deg) scaleY(1.02); } 75% { transform: translateY(-8px) rotate(0); } }
@keyframes cat-lean { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(5deg) translateX(8px); } 45%, 65% { transform: rotate(-13deg) translate(-20px, 10px) scaleY(.98); } 82% { transform: rotate(4deg); } }
@keyframes cat-call { 0%, 65%, 100% { transform: translateY(0) scaleY(1); } 14% { transform: scale(1.025, .95); } 29% { transform: translateY(calc(var(--cat-hop) * -1)) scale(.99, 1.06); } 43% { transform: translateY(0) scale(1.03, .96); } 53% { transform: translateY(-7px); } }
@keyframes cat-ask { 0%, 80%, 100% { transform: rotate(0); } 18% { transform: rotate(8deg) translate(17px, -12px); } 37% { transform: rotate(-4deg) translate(-8px, 0); } 56% { transform: rotate(7deg) translate(12px, -9px); } }
@keyframes cat-curious { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(5deg) translateX(6px); } 45%, 68% { transform: rotate(-9deg) translate(-9px, -5px) scale(1.05); } 86% { transform: rotate(2deg); } }
@keyframes cat-purr { 0%, 100% { transform: rotate(-4deg) scale(1.01, 1); } 25% { transform: translateY(3px) rotate(0) scaleY(.965); } 50% { transform: rotate(4deg) scaleY(1.02); } 75% { transform: translateY(2px) rotate(0) scaleY(.975); } }
@keyframes cat-follow { 0%, 100% { transform: translateX(calc(var(--cat-travel) * -.7)) rotate(-8deg); } 20% { transform: translate(-8px, -12px) rotate(-3deg); } 45% { transform: translateX(var(--cat-travel)) rotate(9deg); } 58% { transform: translate(var(--cat-travel), -17px) rotate(6deg) scaleY(1.035); } 75% { transform: translateX(6px) rotate(-2deg); } }
@keyframes cat-huff { 0%, 100% { transform: rotate(0); } 18% { transform: rotate(-10deg) translateX(-15px); } 37% { transform: rotate(8deg) translateX(13px); } 57% { transform: rotate(-6deg); } 78% { transform: rotate(3deg); } }
@keyframes cat-goodbye { 0%, 100% { transform: rotate(0); } 22% { transform: rotate(9deg) translate(22px, -10px); } 45% { transform: rotate(-4deg) translateY(-20px); } 70% { transform: rotate(7deg) translateX(10px); } }
@keyframes morning-pan { from { transform: scale(1.055) translate(-.8%, -.3%); } to { transform: scale(1.085) translate(.8%, .4%); } }
@keyframes morning-rays { from { opacity: .35; transform: translateX(-5%) rotate(-5deg); } to { opacity: .88; transform: translateX(5%) rotate(5deg); } }
@keyframes dust-drift { 0% { opacity: 0; transform: translate(-10px, 40px) scale(.7); } 20%, 65% { opacity: .8; } 100% { opacity: 0; transform: translate(110px, -170px) scale(1.25); } }
@keyframes heart-rise { 0% { opacity: 0; transform: translate(-10px, 25px) scale(.45) rotate(-16deg); } 20% { opacity: 1; transform: translate(8px, -10px) scale(1.15); } 55% { opacity: .9; transform: translate(-10px, -70px) scale(1.05) rotate(-8deg); } 100% { opacity: 0; transform: translate(18px, -145px) scale(1.4) rotate(18deg); } }
@keyframes toy-swing { 0%, 100% { transform: rotate(-32deg) translateY(-10px); } 25% { transform: rotate(-6deg) translateY(12px); } 50% { transform: rotate(32deg) translateY(-16px); } 75% { transform: rotate(6deg) translateY(8px); } }
@keyframes confetti-fall { 0% { opacity: 0; transform: translateY(-15px) rotate(0); } 8%, 65% { opacity: .95; } 100% { opacity: 0; transform: translate(90px, 100svh) rotate(540deg); } }
@keyframes hand-stroke { 0%, 100% { transform: translate(-8px, -12px) rotate(-16deg); } 45% { transform: translate(18px, 17px) rotate(10deg); } 70% { transform: translate(10px, -2px) rotate(-3deg); } }
@keyframes paw-trail { 0%, 75%, 100% { opacity: 0; transform: rotate(-25deg) scale(.7); } 15%, 50% { opacity: .5; transform: rotate(-25deg) scale(1); } }
@keyframes glint-bloom { 0%, 55%, 100% { opacity: 0; transform: scale(.5) rotate(-20deg); } 20% { opacity: .8; transform: scale(1.25) rotate(10deg); } 35% { opacity: .4; transform: scale(.85) rotate(25deg); } }
@media (min-width: 1400px) { :root { --cat-width: 42%; } .game-board { width: min(1200px, 100%); } }
@media (max-width: 900px) { .header-note { display: none; } .choices { gap: 10px; } }
@media (max-width: 640px) {
  :root { --cat-width: 94%; --cat-height: 55svh; --cat-bottom: 29svh; --cat-left: 47%; --room-position: 46% center; --cat-travel: 29px; --cat-hop: 25px; }
  .app { width: 100%; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  .site-header { gap: 6px; padding-bottom: 10px; }
  .site-header h1 { font-size: 18px; padding: 6px 10px; }
  h1 > span { font-size: 18px; margin: 0; }
  .motion-toggle { font-size: 12px; padding: 7px 10px; }
  .hud { padding: 8px 9px 10px; gap: 7px; position: sticky; top: 6px; }
  .timer strong { font-size: 29px; }
  .steps li { min-height: 34px; font-size: 14px; }
  .task-banner { margin-top: 9px; padding: 8px 17px 9px; max-width: 100%; border-radius: 14px; }
  #task-title, body[data-screen="title"] #task-title { font-size: 25px; }
  .eyebrow { font-size: 12px; }
  .game-board { width: 100%; padding-top: clamp(135px, 23svh, 210px); }
  .control-card { padding: 15px 13px 13px; border-radius: 17px 17px 0 0; }
  .cat-status { grid-template-columns: 1.1fr 1fr; gap: 10px; padding: 9px 13px 10px; border-radius: 0 0 16px 16px; }
  .meter-heading { font-size: 12px; gap: 4px; }
  .meter-heading strong, .pet-block strong { font-size: 16px; }
  #mood-label { font-size: 11px; }
  .pet-block { font-size: 12px; padding: 0 0 0 10px; border: 0; border-left: 1px solid #c9b796; }
  .button { min-height: 62px; font-size: 21px; }
  .work-overview { font-size: 14px; margin-bottom: 9px; }
  .progress-heading { margin-top: 11px; }
  .panel-hint { font-size: 13px; margin-top: 8px; }
  .choices { gap: 8px; }
  .choice { min-height: 89px; padding: 9px 12px; gap: 2px; }
  .choice-heading > strong { font-size: 18px; }
  .choice-effect { font-size: 15px; }
  .choice-detail { font-size: 12px; }
  .incident-description { font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
  .response-panel { min-height: 157px; }
  body[data-mode="blocked"] { --cat-height: 39svh; --cat-bottom: 43svh; }
  body[data-screen="title"] { --cat-height: 58svh; --cat-bottom: 27svh; }
  body[data-screen="title"] .control-card { padding: 16px 14px 14px; }
  body[data-screen="title"] .intro { font-size: 15px; }
  body[data-screen="title"] .intro strong { font-size: 16px; }
  body[data-screen="title"] .game-board { padding-top: clamp(200px, 35svh, 360px); }
  body[data-screen="result"] { --cat-height: 49svh; --cat-bottom: 46svh; }
  body[data-screen="result"] .game-board { padding-top: clamp(190px, 31svh, 300px); }
  body[data-screen="result"] .control-card { border-radius: 18px; }
  .result-title { font-size: 25px; }
  .result-description { margin-bottom: 15px; }
  .result-stats { margin-top: 16px; gap: 6px; padding-top: 12px; }
  .result-stats strong { font-size: 19px; }
  .guide { margin-top: 8px; }
  .guide summary { min-height: 41px; padding: 8px 14px; }
  .cat-speech { left: auto; right: 4%; top: 30%; max-width: 39%; font-size: 15px; padding: 11px 13px; border-radius: 18px 18px 18px 3px; }
  .room[data-state="blocked"] .cat-speech { top: 27%; }
  body[data-screen="result"] .cat-speech { top: 21%; }
  .scene-preparation { left: 10%; bottom: 48%; padding: 9px 11px; transform: scale(1); }
  .attention-mark { left: 20%; top: 30%; font-size: 35px; }
  .affection span { left: 24%; top: 43%; font-size: 35px; }
  .affection span:nth-child(2) { left: 68%; top: 48%; font-size: 28px; }
  .affection span:nth-child(3) { left: 39%; top: 51%; }
  .affection span:nth-child(4) { left: 59%; top: 32%; font-size: 31px; }
  .pet-hand { left: 45%; top: 29%; font-size: 43px; }
  .toy-play { left: 73%; top: 41%; transform-origin: 50% -80px; }
  .toy-play::before { height: 80px; }
  .toy-play span { font-size: 46px; }
  .huff-mark { left: 13%; top: 36%; font-size: 20px; }
  .staff-seal { right: 8%; bottom: 52%; width: 85px; height: 85px; font-size: 14px; }
  .sleepy-mark span { left: 24%; top: 34%; font-size: 30px; }
  .sleepy-mark span:nth-child(2) { left: 18%; top: 26%; }
  .sleepy-mark span:nth-child(3) { left: 13%; top: 16%; }
  .image-note { top: 39%; bottom: auto; font-size: 12px; max-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  /* OS設定は初期値に反映。本人がオンに切り替えた場合だけ再生します。 */
  body:not([data-motion="on"]) *, body:not([data-motion="on"]) *::before, body:not([data-motion="on"]) *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
