/* ================================================================
   もじのもり — デザインシステム
   絵本のようなトーン: クリーム地 + 行ごとのパステル + 教科書体の文字
   ================================================================ */

:root {
  --bg: #FBF3E4;
  --bg2: #F6E8CF;
  --ink: #453A2F;
  --ink-soft: #8A7B6C;
  --card: #FFFDF7;
  --accent: #FFC64D;
  --accent-deep: #E8A020;
  --coral: #FF8A70;
  --green: #7CC576;
  --sky: #CFEBFF;
  --line: #EADFC8;
  --radius: 26px;
  --shadow: 0 6px 0 rgba(69, 58, 47, .07), 0 14px 34px rgba(69, 58, 47, .10);
  --font-ui: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Zen Maru Gothic", -apple-system, "Segoe UI", sans-serif;
  --font-kana: "YuKyokasho", "YuKyokasho Yoko", "Klee", "Hiragino Maru Gothic ProN", "Zen Maru Gothic", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -10%, #FFF9EC 0%, transparent 60%),
    var(--bg);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

#app { position: relative; height: 100dvh; overflow: clip; }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
input, select {
  font-family: inherit;
  color: var(--ink);
}

/* ---------- 画面切替 ---------- */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity .35s ease, transform .35s ease;
  overflow: clip;
}
.screen.active { opacity: 1; pointer-events: auto; transform: none; }
#screen-zukan.active, #screen-parent.active { overflow-y: auto; }

/* ---------- 共通ボタン ---------- */
.btn-big {
  background: var(--accent);
  border-radius: 999px;
  padding: 16px 40px;
  font-size: 22px; font-weight: 700; color: #5A4318;
  box-shadow: 0 5px 0 var(--accent-deep), 0 10px 24px rgba(232, 160, 32, .3);
  transition: transform .12s, box-shadow .12s;
}
.btn-big:active { transform: translateY(4px) scale(.98); box-shadow: 0 1px 0 var(--accent-deep); }
.btn-soft { background: #EFE6D2; color: var(--ink); box-shadow: 0 5px 0 #D8CBAE; }
.btn-soft:active { box-shadow: 0 1px 0 #D8CBAE; }
.btn-link { font-size: 15px; color: var(--ink-soft); text-decoration: underline; padding: 10px; }
.btn-back {
  font-size: 17px; font-weight: 700; color: var(--ink-soft);
  background: var(--card); border-radius: 999px; padding: 10px 18px;
  box-shadow: var(--shadow);
}
.btn-back:active { transform: scale(.95); }
.btn-danger {
  background: #FFF0EC; color: #C0442A; font-weight: 700;
  border: 2px solid #F3C4B8; border-radius: 14px; padding: 12px 20px;
}
.btn-round {
  background: var(--card); border-radius: 999px;
  padding: 12px 20px; font-size: 17px; font-weight: 700;
  box-shadow: var(--shadow);
}
.btn-round:active { transform: scale(.94); }

/* ================================================================
   ホーム
   ================================================================ */
#screen-home { align-items: center; justify-content: center; gap: 14px; }

.sky { position: absolute; inset: 0 0 auto 0; height: 46%; pointer-events: none; overflow: hidden;
  background: linear-gradient(var(--sky) 0%, rgba(207, 235, 255, 0) 90%);
  border-radius: 0 0 50% 50% / 0 0 8% 8%;
}
.sun {
  position: absolute; top: 26px; right: 7%;
  width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFE59A, #FFC64D);
  box-shadow: 0 0 0 14px rgba(255, 198, 77, .25), 0 0 0 28px rgba(255, 198, 77, .12);
  animation: breathe 5s ease-in-out infinite;
}
.sun-face {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle 4.5px at 34% 46%, #8A5A18 98%, transparent),
    radial-gradient(circle 4.5px at 66% 46%, #8A5A18 98%, transparent),
    radial-gradient(circle 6px at 26% 60%, rgba(255, 138, 112, .55) 98%, transparent),
    radial-gradient(circle 6px at 74% 60%, rgba(255, 138, 112, .55) 98%, transparent),
    radial-gradient(circle 3.5px at 50% 62%, #8A5A18 98%, transparent);
  border-radius: 50%;
}
.cloud {
  position: absolute; background: #fff; opacity: .9; border-radius: 999px;
  animation: drift 46s linear infinite;
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.c1 { width: 110px; height: 34px; top: 60px; left: -130px; }
.c1::before { width: 46px; height: 46px; top: -22px; left: 18px; }
.c1::after { width: 34px; height: 34px; top: -14px; left: 56px; }
.c2 { width: 80px; height: 26px; top: 130px; left: -90px; animation-delay: -18s; animation-duration: 60s; }
.c2::before { width: 34px; height: 34px; top: -16px; left: 14px; }
.c2::after { width: 24px; height: 24px; top: -10px; left: 42px; }
.c3 { width: 130px; height: 38px; top: 28px; left: -150px; animation-delay: -34s; animation-duration: 74s; opacity: .7; }
.c3::before { width: 52px; height: 52px; top: -26px; left: 22px; }
.c3::after { width: 38px; height: 38px; top: -16px; left: 68px; }
@keyframes drift { to { transform: translateX(calc(100vw + 180px)); } }

.title-row { display: flex; align-items: flex-end; gap: 4px; z-index: 2; margin-top: -4vh; }
.title-blob { display: inline-block; animation: bob 2.6s ease-in-out infinite; }

.greet {
  z-index: 2;
  background: var(--card); border-radius: 999px; padding: 10px 24px;
  font-size: 17px; font-weight: 700; color: var(--ink);
  box-shadow: var(--shadow);
}

.btn-play {
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 158px; height: 158px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFDE8F, var(--accent) 70%);
  box-shadow: 0 8px 0 var(--accent-deep), 0 18px 40px rgba(232, 160, 32, .38);
  animation: pulse 2.2s ease-in-out infinite;
  transition: transform .12s, box-shadow .12s;
}
.btn-play:active { transform: translateY(6px) scale(.97); box-shadow: 0 2px 0 var(--accent-deep); animation: none; }
.play-icon { font-size: 44px; color: #7A5A14; line-height: 1; }
.play-label { font-size: 24px; font-weight: 800; color: #5A4318; }

.forest {
  position: absolute; left: 0; right: 0; bottom: 0; height: 190px;
  pointer-events: none;
}
.ground {
  position: absolute; left: -6%; right: -6%; bottom: -70px; height: 130px;
  background: linear-gradient(#A8D89B, #8CC482);
  border-radius: 50% 50% 0 0 / 70% 70% 0 0;
}
.forest-deco {
  position: absolute; left: 0; right: 0; bottom: 58px;
  display: flex; justify-content: space-around; align-items: flex-end;
  z-index: 1;
}
.tree { opacity: .9; }
.forest-friends { position: absolute; inset: 0; z-index: 2; pointer-events: auto; }
.forest-friend {
  position: absolute;
  animation: bob 3s ease-in-out infinite;
  transition: transform .15s;
}
.forest-friend:active { transform: scale(1.15); }
.forest-empty {
  position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%);
  width: max-content; max-width: 86vw;
  background: rgba(255, 253, 247, .92); border-radius: 999px; padding: 10px 20px;
  font-size: 14.5px; font-weight: 700; color: var(--ink-soft);
  box-shadow: var(--shadow); z-index: 3;
}

.btn-nav {
  position: absolute; bottom: 18px; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 999px; padding: 12px 20px;
  font-size: 16px; font-weight: 800; color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s;
}
.btn-nav:active { transform: scale(.94); }
.btn-zukan { left: 16px; }
.btn-parent { right: 16px; color: var(--ink-soft); font-size: 13.5px; font-weight: 700; padding: 10px 16px; }
.nav-ico { font-size: 20px; }
.badge {
  background: var(--green); color: #fff; border-radius: 999px;
  padding: 3px 10px; font-size: 14px;
}
.badge small { font-size: 11px; opacity: .85; }

/* ================================================================
   セッション（きょうのぼうけん）
   ================================================================ */
#screen-session { background: linear-gradient(#FFF9EC, var(--bg) 30%); }

.ses-head {
  display: flex; align-items: center; gap: 14px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 4px;
}
.btn-quit {
  width: 44px; height: 44px; border-radius: 50%;
  background: #EFE6D2; color: var(--ink-soft);
  font-size: 19px; font-weight: 700; flex: none;
}
.btn-quit:active { transform: scale(.9); }
.ses-spacer { width: 44px; flex: none; }
.dots { flex: 1; display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
.dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: #E7DCC4; transition: .25s;
}
.dot.now { background: var(--accent); transform: scale(1.35); box-shadow: 0 0 0 5px rgba(255, 198, 77, .3); }
.dot.done { background: var(--green); }

.stage {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  overflow: clip;
}
.stage.enter > * { animation: rise .4s ease both; }

/* ---------- ふくせんせいの ふきだし ---------- */
.bubble {
  display: flex; align-items: center; gap: 10px;
  max-width: 92vw;
  text-align: left;
}
.owl { width: 74px; height: 74px; flex: none; }
.bub-balloon {
  position: relative;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border-radius: 22px; padding: 14px 20px;
  box-shadow: var(--shadow);
}
.bub-balloon::before {
  content: ''; position: absolute; left: -9px; top: 50%;
  width: 18px; height: 18px; background: var(--card);
  transform: translateY(-50%) rotate(45deg); border-radius: 4px;
}
.bub-text { font-size: 21px; font-weight: 800; }
.bub-sound { font-size: 18px; opacity: .55; }
.hint-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg2); border-radius: 999px; padding: 6px 14px;
  font-size: 17px; font-weight: 700; color: var(--ink);
  font-family: var(--font-kana);
}

/* ---------- みつけて ---------- */
.cards-row {
  flex: 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(12px, 3vw, 30px); flex-wrap: wrap;
  align-content: center;
}
.kana-card {
  background: var(--card); border-radius: var(--radius);
  padding: clamp(8px, 1.6vw, 18px);
  box-shadow: var(--shadow);
  transition: transform .15s, opacity .3s, box-shadow .15s;
}
.kana-card svg { display: block; width: clamp(104px, 21vmin, 160px); height: auto; }
.kana-card:active { transform: scale(.93); }
.kana-card.win { transform: scale(1.12); box-shadow: 0 0 0 6px var(--green), var(--shadow); animation: winJump .6s ease; }
.kana-card.lose { opacity: .25; }
.kana-card.wob { animation: wobble .5s ease; opacity: .35; }
.kana-card.glow { animation: glowPulse 1s ease-in-out infinite; }
.kana-card:disabled { cursor: default; }

/* ---------- であう ---------- */
.meet-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 4vw, 46px); flex-wrap: wrap;
}
.meet-friend { transition: transform .15s; }
.meet-friend svg { width: clamp(180px, 34vmin, 250px); height: auto; }
.meet-friend.sleeping { animation: sleepBreathe 2.8s ease-in-out infinite; }
.meet-friend.sleeping:active { transform: scale(.94); }
.meet-friend.wake { animation: wakeJump .7s cubic-bezier(.34, 1.56, .64, 1); }
.word-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border-radius: var(--radius);
  padding: 20px 30px; box-shadow: var(--shadow);
}
.word-emoji { font-size: clamp(56px, 11vmin, 84px); line-height: 1.15; }
.word-text { font-family: var(--font-kana); font-size: clamp(26px, 5vmin, 36px); letter-spacing: .06em; }
.word-text .hl { color: #E8632C; font-weight: 700; border-bottom: 4px solid var(--accent); }
.pop-in { animation: popIn .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.btn-next {
  position: absolute; right: 22px; bottom: calc(20px + env(safe-area-inset-bottom));
  background: var(--coral); color: #fff;
  border-radius: 999px; padding: 14px 30px;
  font-size: 21px; font-weight: 800;
  box-shadow: 0 5px 0 #D5654C, 0 12px 26px rgba(255, 138, 112, .4);
}
.btn-next:active { transform: translateY(4px); box-shadow: 0 1px 0 #D5654C; }

/* ---------- なぞって ---------- */
.trace-layout {
  flex: 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 3vw, 36px);
}
.trace-side {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.trace-word {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 999px; padding: 8px 18px;
  font-family: var(--font-kana); font-size: 19px; font-weight: 700;
  box-shadow: var(--shadow);
}
.trace-wrap {
  position: relative;
  width: min(62vmin, 430px); height: min(62vmin, 430px);
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
  outline: 3px dashed var(--line); outline-offset: -12px;
}
.trace-wrap canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: var(--radius);
}
.trace-draw { touch-action: none; }
.btn-skip {
  position: absolute; right: 18px; bottom: calc(14px + env(safe-area-inset-bottom));
  font-size: 15px; font-weight: 700; color: var(--ink-soft);
  background: #EFE6D2; border-radius: 999px; padding: 9px 18px;
}

/* ---------- ことば ---------- */
.word-big-emoji {
  font-size: clamp(64px, 13vmin, 100px); line-height: 1.15;
  background: var(--card); border-radius: var(--radius);
  padding: 10px 34px; box-shadow: var(--shadow);
  transition: transform .12s;
}
.word-big-emoji:active { transform: scale(.94); }
.slots { display: flex; gap: 12px; }
.slot {
  width: clamp(66px, 13vmin, 92px); height: clamp(66px, 13vmin, 92px);
  border-radius: 20px; border: 3px dashed #D8CBAE;
  background: rgba(255, 253, 247, .6);
  font-family: var(--font-kana); font-size: clamp(38px, 8vmin, 56px);
  color: var(--ink); position: relative;
  transition: .15s;
}
.slot.filled { border-style: solid; border-color: var(--accent); background: var(--card); box-shadow: var(--shadow); }
.slot.ghost::before {
  content: attr(data-hint);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); opacity: .22;
}
.slot.filled.ghost::before { content: none; }
.slots.shake { animation: shake .5s ease; }
.chips { display: flex; gap: clamp(8px, 2vw, 18px); flex-wrap: wrap; justify-content: center; }
.chip { transition: transform .15s, opacity .25s; }
.chip svg { width: clamp(70px, 13vmin, 96px); height: auto; }
.chip:active { transform: scale(.92); }
.chip.used { opacity: .15; pointer-events: none; transform: scale(.85); }

/* ================================================================
   おいわい・かくにん（オーバーレイ）
   ================================================================ */
#overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(69, 58, 47, .35);
  backdrop-filter: blur(3px);
}
#overlay[hidden] { display: none; }
.cele, .confirm {
  background: var(--card); border-radius: 34px;
  padding: 36px 44px; text-align: center;
  box-shadow: 0 24px 60px rgba(69, 58, 47, .35);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  max-width: 88vw;
  animation: popIn .45s cubic-bezier(.34, 1.56, .64, 1) both;
}
.cele-title { font-size: 27px; font-weight: 800; }
.cele-stars { font-size: 30px; letter-spacing: 3px; }
.cele-new-label { font-size: 17px; font-weight: 700; color: var(--ink-soft); }
.cele-new { display: flex; gap: 12px; }
.cele-new svg { animation: bob 2s ease-in-out infinite; }
.confirm-text { font-size: 24px; font-weight: 800; }
.confirm-btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* ================================================================
   ずかん
   ================================================================ */
.page-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
  background: linear-gradient(var(--bg) 75%, transparent);
}
.page-title { flex: 1; font-size: 22px; font-weight: 800; }
.page-count {
  background: var(--green); color: #fff; border-radius: 999px;
  padding: 6px 16px; font-size: 16px; font-weight: 800;
}
.zukan-list { padding: 6px 18px 40px; display: flex; flex-direction: column; gap: 22px; }
.zukan-row-label {
  display: inline-block; border-radius: 999px;
  padding: 5px 18px; font-size: 15px; font-weight: 800;
  margin-bottom: 10px;
}
.zukan-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.zukan-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card); border-radius: 22px; padding: 12px 14px 10px;
  box-shadow: var(--shadow);
  transition: transform .12s;
}
.zukan-cell:active { transform: scale(.93); }
.zukan-cell.asleep { background: #F2EBDD; box-shadow: none; }
.zukan-word { font-size: 13px; font-weight: 700; color: var(--ink-soft); font-family: var(--font-kana); }

/* ================================================================
   おうちのかたへ
   ================================================================ */
.gate {
  margin: auto; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 30px;
}
.gate-title { font-size: 24px; font-weight: 800; }
.gate-note { font-size: 15.5px; color: var(--ink-soft); line-height: 1.9; }
.gate-hold {
  --p: 0;
  width: 230px; padding: 20px;
  border-radius: 999px; font-size: 18px; font-weight: 800; color: var(--ink);
  background: linear-gradient(90deg, var(--accent) calc(var(--p) * 100%), #EFE6D2 calc(var(--p) * 100%));
  box-shadow: var(--shadow);
  transition: none;
}
.gate-hold.holding { transform: scale(.97); }

.p-head { max-width: 780px; width: 100%; margin: 0 auto; }
.p-wrap {
  width: 100%; max-width: 780px; margin: 0 auto;
  padding: 4px 18px 60px;
  display: flex; flex-direction: column; gap: 18px;
}
.p-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.p-card {
  background: var(--card); border-radius: 20px; padding: 16px;
  box-shadow: var(--shadow); text-align: center;
}
.p-num { font-size: 30px; font-weight: 800; }
.p-num small { font-size: 15px; color: var(--ink-soft); font-weight: 700; }
.p-cap { font-size: 13px; color: var(--ink-soft); font-weight: 700; margin-top: 2px; }
.p-section {
  background: var(--card); border-radius: 20px; padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.p-section h3 { font-size: 17px; }
.p-text { font-size: 15px; line-height: 1.8; }
.p-note { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }

.heatmap { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.heat-col { display: flex; flex-direction: column; gap: 6px; }
.heat-cell {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-kana); font-size: 21px;
}
.heat-legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 12.5px; color: var(--ink-soft); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-item i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.set-row { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.set-row label { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.set-row input[type="text"] {
  font-size: 19px; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: 14px;
  background: #fff; max-width: 300px;
}
.set-row select {
  font-size: 16px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 12px;
  background: #fff; max-width: 140px;
}
.voice-body { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.voice-status { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.voice-status.on { color: #3F8A48; }
.voice-select {
  font-size: 15px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 12px;
  background: #fff; max-width: 320px;
}
.btn-small { font-size: 14.5px; padding: 9px 16px; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-btn {
  padding: 10px 20px; border-radius: 999px;
  background: #EFE6D2; font-size: 15px; font-weight: 700; color: var(--ink-soft);
  transition: .15s;
}
.seg-btn.on { background: var(--accent); color: #5A4318; box-shadow: 0 3px 0 var(--accent-deep); }

/* ================================================================
   初回設定
   ================================================================ */
.ob {
  margin: auto; max-width: 480px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 30px; text-align: center;
}
.ob-tagline { font-size: 18px; font-weight: 800; line-height: 1.9; }
.ob-note { font-size: 14px; color: var(--ink-soft); line-height: 1.9; }
.ob-h { font-size: 22px; }
.ob-input {
  font-size: 26px; text-align: center;
  font-family: var(--font-kana);
  padding: 14px 18px; width: 100%; max-width: 320px;
  border: 3px solid var(--line); border-radius: 18px; background: #fff;
}
.ob-input:focus { outline: none; border-color: var(--accent); }
.ob-warn {
  font-size: 13.5px; color: #B25E2A; background: #FFF4E3;
  border-radius: 12px; padding: 10px 16px; line-height: 1.7;
}

/* ================================================================
   共通アニメーション
   ================================================================ */
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

.friend-svg .eye { animation: blink 4.6s infinite; transform-box: fill-box; transform-origin: center; }
.friend-svg .zzz { animation: zzz 2.2s ease-in-out infinite; }
.friend-svg .zzz2 { animation-delay: .5s; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes blink { 0%, 91%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes zzz { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes sleepBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03) translateY(2px); } }
@keyframes wakeJump {
  0% { transform: scale(.9); }
  40% { transform: scale(1.15) translateY(-26px); }
  70% { transform: scale(.97) translateY(0); }
  100% { transform: scale(1); }
}
@keyframes winJump {
  0% { transform: scale(1); }
  40% { transform: scale(1.2) translateY(-14px); }
  100% { transform: scale(1.12); }
}
@keyframes wobble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-9px) rotate(-3deg); }
  75% { transform: translateX(9px) rotate(3deg); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 198, 77, .9), var(--shadow); transform: scale(1); }
  50% { box-shadow: 0 0 0 12px rgba(255, 198, 77, .35), var(--shadow); transform: scale(1.06); }
}
@keyframes popIn { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* ================================================================
   レスポンシブ
   ================================================================ */
@media (max-width: 740px) {
  .trace-layout { flex-direction: column; gap: 10px; }
  .trace-side { flex-direction: row; gap: 10px; }
  .trace-side .trace-friend svg { width: 64px; height: 64px; }
  .trace-wrap { width: min(78vmin, 340px); height: min(78vmin, 340px); }
  .bub-text { font-size: 18px; }
  .owl { width: 58px; height: 58px; }
  .btn-play { width: 132px; height: 132px; }
  .play-icon { font-size: 36px; }
  .play-label { font-size: 20px; }
  .btn-parent .nav-label { display: none; }
  .meet-area { gap: 10px; }
  .meet-friend svg { width: clamp(150px, 40vmin, 210px); }
  .word-card { padding: 14px 22px; }
  .forest { height: 150px; }
  .cele, .confirm { padding: 28px 26px; }
}
@media (max-height: 460px) {
  .title-row { margin-top: 0; }
  .title-blob svg { width: 44px; height: 44px; }
  .btn-play { width: 108px; height: 108px; }
  .forest { height: 100px; }
  .forest-deco .tree { height: 60px !important; }
  .stage { gap: 8px; }
  .owl { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
