/* =========================================================
   あいぼうと せんかき（試作版）スタイル
   - スマホ縦画面を基準に作っています
   - 世界観は添付資料「ゆるキャラ進化図鑑」に合わせています
     （どうぶつ＝クリーム色と肉球、くるま＝空と雲と砂地、やさい＝ミント色と芽）
   ========================================================= */
:root {
  --bg: #FFF6E8;
  --ink: #5A4636;
  --ink-soft: #9A8473;
  --accent: #FF9F6B;
  --accent-dark: #E9824C;
  --road: #F3E2C9;
  --road-done: #FFD27A;
  --good: #7CC47F;
  --card: #FFFFFF;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  font-weight: 500;
  /* 長押しでの文字選択・メニュー表示・引っぱって更新を防ぐ */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  overflow: hidden;
}

#app {
  position: relative;
  background-color: #FBF5E9;
  /* 大きさ・拡大・まわす は app.js の fitTablet が きめる（横画面 に 統一） */
  width: 760px; height: 390px;
  transform-origin: 0 0;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.screen.active { display: flex; }

.hidden { display: none !important; }

/* ---------- 共通パーツ ---------- */
.title { font-size: 28px; font-weight: 800; text-align: center; margin: 24px 0 4px; letter-spacing: .02em; }
.title .t1 { color: #7A5236; }
.title .t2 { color: #EF8B6A; }
.topbar-spacer { width: 52px; }
.sub { text-align: center; margin: 0 0 16px; color: var(--ink-soft); }
.note { text-align: center; font-size: 12px; color: var(--ink-soft); margin-top: auto; }

.big-btn {
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  min-height: 64px;
  box-shadow: 0 5px 0 var(--accent-dark);
  touch-action: manipulation;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-dark); }

.icon-btn {
  font-size: 24px;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(90, 70, 54, .15);
  touch-action: manipulation;
}

.topbar { display: flex; align-items: center; gap: 12px; min-height: 56px; }

/* ---------- あいぼう選択 ---------- */
.select-list { display: flex; flex-direction: column; gap: 14px; }
.select-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border-radius: 24px;
  padding: 10px 16px;
  border: 3px solid transparent;
  box-shadow: 0 3px 0 rgba(90, 70, 54, .12);
  font: inherit; color: inherit; text-align: left;
}
.select-card:active { border-color: var(--accent); }
.select-card .pet-thumb { width: 92px; height: 92px; flex: none; }
.select-card .name { font-size: 22px; font-weight: 800; }
.select-card .desc { font-size: 14px; color: var(--ink-soft); }
.select-card .done-badge { margin-left: auto; font-size: 13px; color: var(--accent-dark); }

/* ---------- ホーム ---------- */
.stage-box { flex: 1; display: flex; align-items: center; gap: 10px; }
.stage-label {
  font-size: 20px; font-weight: 800;
  background: var(--card); border-radius: 999px;
  min-width: 52px; height: 52px; display: grid; place-items: center;
}
.stage-label { grid-auto-flow: row; line-height: 1; align-content: center; }
.stage-label::before { content: "レベル"; font-size: 10px; font-weight: 800; color: var(--ink-soft); margin-bottom: 2px; }
.gauge { flex: 1; height: 18px; background: #F1E3CF; border-radius: 999px; overflow: hidden; }
.gauge-fill { height: 100%; width: 0; background: linear-gradient(90deg, #FFC98B, var(--accent)); border-radius: 999px; transition: width .6s; }
/* きょう は もう おおきく なった（2026-11-24 代表：レベルアップ は 1日1かい） */
.gauge.full-today { position: relative; }
.gauge.full-today::after { content: "🌙 また あした"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #8A6A45; }

.pet-area { position: relative; flex: 1; display: grid; place-items: end center; padding-bottom: 18px; touch-action: none; }
.ground {
  position: absolute; left: -16px; right: -16px; bottom: 0; height: 64px;
  border-radius: 50% 50% 0 0 / 22px 22px 0 0;
  background: #F3E6CF;
}
.pet { position: relative; }
.pet { width: 340px; aspect-ratio: 1; touch-action: none; }
.effects { position: absolute; inset: 0; pointer-events: none; }

.bubble {
  position: absolute; top: 4px; left: 50%;
  transform: translateX(-50%) scale(.9);
  background: var(--card);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 17px; font-weight: 800;
  line-height: 1.45;
  text-align: center;
  width: max-content;
  max-width: 88%;
  border: 2px solid #EADBC6;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 3px 0 rgba(90, 70, 54, .12);
  z-index: 5;
  pointer-events: none;
}
.bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -9px;
  width: 14px; height: 14px; background: var(--card);
  border-right: 2px solid #EADBC6; border-bottom: 2px solid #EADBC6;
  transform: translateX(-50%) rotate(45deg);
}

.tray { display: flex; align-items: center; gap: 12px; }
.tray-item {
  position: relative;
  width: 76px; height: 76px;
  background: var(--card);
  border-radius: 22px;
  display: grid; place-items: center;
  box-shadow: 0 3px 0 rgba(90, 70, 54, .12);
  touch-action: none;
}
.tray-item.empty { opacity: .4; }
.tray-icon { width: 48px; height: 48px; pointer-events: none; }
.tray-count {
  position: absolute; right: -6px; top: -6px;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 15px;
  min-width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 6px;
}
.tray .big-btn { flex: 1; }

.drag-hint {
  position: absolute; left: 16px; bottom: 182px;
  background: var(--ink); color: #fff;
  padding: 6px 12px; border-radius: 12px; font-size: 14px;
  animation: hint 1.2s ease-in-out infinite;
}
@keyframes hint { 50% { transform: translateY(-6px); } }

/* ドラッグ中に指についてくるアイテム */
.dragging {
  position: fixed; width: 64px; height: 64px;
  pointer-events: none; z-index: 50;
  transform: translate(-50%, -70%) scale(1.15);
  filter: drop-shadow(0 6px 4px rgba(0,0,0,.15));
}

/* ---------- あいぼうの動き ---------- */
/* 絵の置き場所：正方形の枠の中で、足もとを下にそろえる */
.pet-art { position: relative; width: 100%; height: 100%; }
.pet-art img {
  position: absolute; left: 50%; bottom: 0;
  transform-origin: 50% 100%;
  translate: -50% 0;          /* 中央寄せ（アニメーションの transform とぶつからないよう translate を使う） */
  -webkit-user-drag: none;
  pointer-events: none;       /* 触った判定は外側の枠でとる */
}
/* 表情 を 重ねる とき（2026-11-20）：本体 と 顔 を ひとつ の 箱 に いれて、いっしょ に うごかす */
.pet-art .pet-body { position: absolute; left: 50%; bottom: 0; transform-origin: 50% 100%; translate: -50% 0; pointer-events: none; }
.pet-art .pet-body img { position: absolute; translate: none; bottom: auto; }
.pet-art .pet-body .pet-base { left: 0; top: 0; width: 100%; height: 100%; }
.pet .body-group { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.03, .97); } }

/* タップ：ぽよんと跳ねる */
.pet.bounce .body-group, .mini-pet.bounce .body-group { animation: bounce .6s cubic-bezier(.3,1.4,.6,1); }
@keyframes bounce {
  0% { transform: scale(1, 1); }
  20% { transform: scale(1.14, .82); }
  50% { transform: translateY(-14%) scale(.92, 1.1); }
  75% { transform: scale(1.06, .94); }
  100% { transform: scale(1, 1); }
}
/* なでなで：うれしくて左右にゆらゆら */
.pet.pet-happy .body-group { animation: wiggle .5s ease-in-out infinite; }
@keyframes wiggle {
  25% { transform: rotate(-5deg) scale(1.04, .96); }
  75% { transform: rotate(5deg) scale(1.04, .96); }
}
/* たべる：もぐもぐ ぷにぷに */
.pet.eating .body-group { animation: munch .28s ease-in-out 5; }
@keyframes munch { 50% { transform: scale(1.07, .9); } }
/* せいちょう：ぎゅっとちぢんで、ぽんっと大きく */
.pet.grow .body-group { animation: grow 1.2s ease-in-out; }
@keyframes grow {
  0% { transform: scale(1); } 30% { transform: scale(.8, 1.15); }
  60% { transform: scale(1.25); filter: brightness(1.25); } 100% { transform: scale(1); }
}

/* ハートやきらきら */
.fx {
  position: absolute; font-size: 28px;
  animation: float-up 1s ease-out forwards;
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(1); }
}

/* ---------- せんかき ---------- */
.level-label { flex: 1; text-align: center; font-size: 20px; font-weight: 800; }
.mini-pet { width: 56px; height: 56px; }
.mini-pet .pet-art { width: 100%; height: 100%; }
.trace-bubble { top: 76px; }
.trace-svg { flex: 1; width: 100%; min-height: 0; touch-action: none; }
.trace-tools { display: flex; justify-content: center; padding-top: 6px; }

/* ひかえめなボタン（けしゴム・保護者メニュー） */
.sub-btn {
  font: inherit; font-size: 18px; font-weight: 800;
  color: var(--ink);
  background: var(--card);
  border: 3px solid #EADBC6;
  border-radius: 999px;
  padding: 10px 22px;
  min-height: 54px;
  touch-action: manipulation;
}
.sub-btn:active { border-color: var(--accent); transform: translateY(2px); }

/* あいぼう選択の「もどる」 */
.select-back { position: absolute; left: 16px; top: max(12px, env(safe-area-inset-top)); z-index: 2; }
.select-card .done-badge { text-align: right; line-height: 1.5; }

/* 保護者メニュー */
.parent-card { display: flex; flex-direction: column; gap: 12px; }
.parent-title { font-size: 18px; font-weight: 800; margin: 0; }
.parent-info { font-size: 14px; color: var(--ink-soft); margin: 0 0 4px; }
.sub-btn.danger { color: #C0503A; font-size: 15px; }

/* ---------- モーダル ---------- */
.modal {
  position: absolute; inset: 0;
  background: rgba(90, 70, 54, .35);
  display: grid; place-items: center;
  padding: 16px;
  z-index: 40;
}
.modal-card {
  background: var(--card);
  border-radius: 28px;
  padding: 24px 20px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: pop .35s ease-out;
}
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.modal-art { display: flex; justify-content: center; gap: 12px; min-height: 80px; }
.modal-art svg { width: 80px; height: 80px; }
.modal-art .big-pet { width: 200px; height: 200px; }
.modal-art .big-pet svg { width: 100%; height: 100%; }
.modal-text { font-size: 20px; font-weight: 800; line-height: 1.5; margin: 12px 0 18px; }

/* 保護者メニュー の はぐるま（2びょう ながおし）：おしている あいだ、時計 の ように くるっと 色 が ついていく（2026-11-08 代表） */
@property --gate { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.parent-gate { position: relative; }
.parent-gate::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: conic-gradient(var(--accent) var(--gate), rgba(0,0,0,.08) var(--gate));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); }
.parent-gate.holding::after { opacity: 1; animation: gatefill 2s linear forwards; }
.parent-gate.holding > * { animation: gatespin 2s ease-in-out forwards; }   /* はぐるま も すこし まわる */
@keyframes gatefill { from { --gate: 0deg; } to { --gate: 360deg; } }
@keyframes gatespin { to { transform: rotate(180deg); } }
.select-tools { position: absolute; right: 16px; top: max(12px, env(safe-area-inset-top)); z-index: 2; display: flex; gap: 8px; }
.select-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px #FFD9B8, 0 4px 0 rgba(0,0,0,.06); }
/* ずかん：うえ に 3体 の きりかえ */
.zukan-tabs { display: flex; justify-content: center; gap: 8px; margin: 0 8px 0 auto; }
.zukan-tab { width: 46px; height: 46px; padding: 3px; border-radius: 14px; border: 3px solid transparent; background: #fff; opacity: .55; }
.zukan-tab.on { border-color: var(--accent); opacity: 1; }
.zukan-tab svg, .zukan-tab img { width: 100%; height: 100%; }
.gate-hint { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); background: rgba(90,70,54,.88); color: #fff;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; z-index: 60; white-space: nowrap; }

/* ---------- 世界観（テーマ）---------- */
/* どうぶつ：クリーム色の紙に、うすい肉球もよう */
#app.theme-animal, #app.theme-select {
  background-color: #FBF5E9;
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: left 6px top 64px, right 8px bottom 150px, 0 0;
  background-size: 84px auto, 64px auto, auto;
  background-image: url("img/deco-paw1.png"), url("img/deco-paw2.png"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cg fill='%23F2C9A0' opacity='.38'%3E%3Cellipse cx='32' cy='38' rx='8' ry='6.5'/%3E%3Ccircle cx='23' cy='27' r='3.4'/%3E%3Ccircle cx='32' cy='24' r='3.4'/%3E%3Ccircle cx='41' cy='27' r='3.4'/%3E%3C/g%3E%3Cg fill='%23F2C9A0' opacity='.25' transform='rotate(25 110 110)'%3E%3Cellipse cx='110' cy='116' rx='7' ry='5.5'/%3E%3Ccircle cx='102' cy='106' r='3'/%3E%3Ccircle cx='110' cy='103' r='3'/%3E%3Ccircle cx='118' cy='106' r='3'/%3E%3C/g%3E%3C/svg%3E");
}
#app.theme-animal .ground { background: #F3E6CF; }

/* くるま：空と雲、足もとは砂地 */
#app.theme-car {
  background-color: #E4F2FB;
  background-repeat: no-repeat;
  background-position: left 4% top 84px, right 4% top 34%, left 8% top 54%, 0 0;
  background-size: 120px auto, 104px auto, 64px auto, auto;
  background-image: url("img/deco-cloud1.png"), url("img/deco-cloud2.png"), url("img/deco-cloud3.png"),
    linear-gradient(#D6ECFA, #F3F9FD);
}
#app.theme-car .ground { background: #EDE0C6; }
#app.theme-car .select-card, #app.theme-car .tray-item { background: #FFFFFF; }

/* やさい：ミント色に、うすい芽のもよう。足もとは畑の土 */
#app.theme-veggie {
  background-color: #EEF6E6;
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: left 4px bottom 150px, right 6px top 30%, 0 0;
  background-size: 80px auto, 60px auto, auto;
  background-image: url("img/deco-leaf1.png"), url("img/deco-leaf2.png"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='%2399C98A' opacity='.35'%3E%3Cpath d='M30 50 C22 44 22 34 30 30 C38 34 38 44 30 50 Z' transform='rotate(-35 30 50)'/%3E%3Cpath d='M30 50 C22 44 22 34 30 30 C38 34 38 44 30 50 Z' transform='rotate(35 30 50)'/%3E%3Cpath d='M104 116 C98 112 98 104 104 101 C110 104 110 112 104 116 Z' transform='rotate(-30 104 116)'/%3E%3Cpath d='M104 116 C98 112 98 104 104 101 C110 104 110 112 104 116 Z' transform='rotate(30 104 116)'/%3E%3C/g%3E%3C/svg%3E");
}
#app.theme-veggie .ground { background: #E8D9BE; }

/* あいぼう選択カードは、それぞれの世界の色 */
.select-card[data-type="animal"] { background: #FFFBF3; }
.select-card[data-type="car"] { background: #F1F8FD; }
.select-card[data-type="veggie"] { background: #F4FAEE; }

/* ---------- しんか ずかん ---------- */
.zukan-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  overflow-y: auto; padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.zukan-cell {
  position: relative;
  background: rgba(255, 255, 255, .85);
  border: 2px solid #EADBC6;
  border-radius: 20px;
  padding: 8px 8px 10px;
  text-align: center;
}
.zukan-cell .pet-art { width: 100%; height: auto; aspect-ratio: 1; }
.zukan-cell.locked img { filter: brightness(0) opacity(.12); }
.zukan-no {
  position: absolute; left: 8px; top: 6px;
  font-size: 18px; font-weight: 800; color: #7A5236;
}
.zukan-cell.now { border-color: var(--accent); }
.zukan-cap { font-size: 12px; line-height: 1.4; min-height: 34px; }

/* ---------- あそぶ ---------- */
.play-row { display: flex; gap: 8px; margin: 4px 0 10px; }
.play-btn {
  flex: 1; font: inherit; font-size: 12px; font-weight: 800; color: var(--ink);
  background: var(--card); border: none; border-radius: 18px;
  padding: 6px 0 8px; min-height: 62px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 3px 0 rgba(90, 70, 54, .12);
  touch-action: manipulation;
}
.play-btn:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(90, 70, 54, .12); }
.play-icon { width: 34px; height: 34px; }
.play-icon svg, .btn-icon svg, .fx-icon svg, .ball-fx svg { width: 100%; height: 100%; display: block; }

/* ボールが とんでいく */
.ball-fx {
  position: absolute; font-size: 44px; left: 8%; top: 92%;
  animation: throw .65s ease-out forwards;
}
@keyframes throw {
  0%   { left: 8%;  top: 92%; transform: translate(-50%, -50%) rotate(0); }
  50%  { left: 30%; top: 30%; }
  100% { left: 50%; top: 52%; transform: translate(-50%, -50%) rotate(540deg) scale(.8); }
}

/* おふろ中は すこし 水色に ひかる */
.pet.bathing .pet-art > * { filter: drop-shadow(0 0 14px rgba(120, 190, 255, .9)); }

/* ダンス */
.pet.dance .body-group { animation: dance .45s ease-in-out infinite alternate; }
@keyframes dance {
  0%   { transform: rotate(-8deg) translateY(0) scale(1.03, .97); }
  100% { transform: rotate(8deg) translateY(-8%) scale(.97, 1.03); }
}

/* おはなし：こたえを えらぶ パネル */
.talk-panel {
  position: absolute; left: 12px; right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--card); border-radius: 26px;
  border: 3px solid #EADBC6;
  padding: 14px 12px 12px; z-index: 20;
  animation: pop .3s ease-out;
}
.talk-choices { display: flex; gap: 8px; }
.talk-choice {
  flex: 1; font: inherit; font-size: 14px; font-weight: 800; color: var(--ink);
  background: #FFF6E8; border: 3px solid transparent; border-radius: 20px;
  padding: 10px 4px; min-height: 100px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  touch-action: manipulation;
}
.talk-choice:active { border-color: var(--accent); }
.talk-icon { font-size: 40px; line-height: 1.1; }
.talk-close {
  position: absolute; right: -6px; top: -14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #EADBC6; background: var(--card); color: var(--ink-soft);
  font-size: 16px;
}

/* ---------- べんきょうを えらぶ ---------- */
.study-list { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.study-card {
  display: flex; align-items: center; gap: 16px;
  font: inherit; color: inherit; text-align: left;
  background: var(--card); border: 3px solid transparent; border-radius: 26px;
  padding: 16px 20px; min-height: 110px;
  box-shadow: 0 4px 0 rgba(90, 70, 54, .12);
  touch-action: manipulation;
}
.study-card:active { border-color: var(--accent); }
.study-icon {
  width: 76px; height: 76px; flex: none; border-radius: 20px;
  background: #FFF1DD; display: grid; place-items: center; font-size: 40px;
}
.study-icon-text { font-size: 48px; font-weight: 800; color: #E9824C; }
.study-name { display: block; font-size: 26px; font-weight: 800; }
.study-sub { display: block; font-size: 15px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- ひらがなの ことば ---------- */
.word-cards { display: flex; gap: 12px; justify-content: center; }
.word-card {
  font: inherit; color: var(--ink);
  background: #FFF6E8; border: 3px solid #EADBC6; border-radius: 22px;
  width: 130px; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  touch-action: manipulation;
}
.word-card.tapped { animation: pop .35s ease-out; border-color: var(--accent); }
.word-icon { font-size: 52px; line-height: 1.1; }
.word-icon.many { font-size: 30px; max-width: 200px; display: flex; flex-wrap: wrap; justify-content: center; }
.word-text { font-size: 20px; font-weight: 800; }
.word-text b { color: #E9824C; font-size: 24px; }
.modal-text small { font-size: 15px; color: var(--ink-soft); }

.parent-credit { font-size: 11px; line-height: 1.6; color: var(--ink-soft); margin: 4px 0 0; text-align: left; }
.parent-credit a { color: var(--accent-dark); }

.fx.fx-icon { width: 34px; height: 34px; }
.ball-fx { width: 52px; height: 52px; }
.erase-btn { display: inline-flex; align-items: center; gap: 6px; }
.btn-icon { width: 30px; height: 30px; }

/* 上のボタンの絵 */
.icon-btn[data-icon] svg, #btn-sound svg { width: 32px; height: 32px; display: block; margin: auto; }
.study-icon svg { width: 52px; height: 52px; display: block; }

/* ---------- いっしょに よもう ---------- */
.read-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding-top: 40px; }
.read-pic {
  width: 170px; height: 170px; border-radius: 40px;
  background: rgba(255, 255, 255, .85); border: 3px solid #EADBC6;
  display: grid; place-items: center; font-size: 104px; line-height: 1;
}
.read-pic.pop { animation: pop .5s ease-out; }
.read-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.read-tile {
  font: inherit; font-size: 46px; font-weight: 800; color: var(--ink);
  width: 74px; height: 84px; border-radius: 20px;
  background: var(--card); border: 3px solid #EADBC6;
  box-shadow: 0 4px 0 rgba(90, 70, 54, .12);
  touch-action: manipulation;
}
.read-tiles.long .read-tile { width: 62px; height: 74px; font-size: 40px; }
.read-tile.next { border-color: var(--accent); animation: hint 1.2s ease-in-out infinite; }
.read-tile.lit { background: #FFE3A6; border-color: #F2B84B; color: #7A5236; }
.read-tile.say { animation: pop .35s ease-out; background: #FFD27A; }
.read-tiles.wave .read-tile { animation: bounce-y .5s ease-in-out; }
.read-tiles.wave .read-tile:nth-child(2) { animation-delay: .08s; }
.read-tiles.wave .read-tile:nth-child(3) { animation-delay: .16s; }
.read-tiles.wave .read-tile:nth-child(4) { animation-delay: .24s; }
.read-tiles.wave .read-tile:nth-child(5) { animation-delay: .32s; }
@keyframes bounce-y { 50% { transform: translateY(-14px); } }

/* いっしょに よもう：ぶん のとき */
.read-tiles { gap: 18px; }
.read-word { display: flex; gap: 6px; }
.read-tiles.sentence .read-tile { width: 54px; height: 66px; font-size: 34px; border-radius: 16px; }
.study-hard .study-sub::before { content: "じょうきゅう ・ "; color: var(--accent-dark); font-weight: 800; }
.study-list { overflow-y: auto; padding-bottom: 12px; }

/* ---------- ものがたり（たてがき） ---------- */
.story-label { font-size: 15px; }
.story-page {
  flex: 1; min-height: 0; margin-top: 70px;
  display: flex; flex-direction: row-reverse; align-items: stretch; gap: 10px;
  background: rgba(255, 255, 255, .88); border: 3px solid #EADBC6; border-radius: 26px;
  padding: 16px 10px 16px 12px;
}
.story-text {
  display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 6px;
  touch-action: none;
}
.story-col { position: relative; display: flex; flex-direction: column; align-items: center; padding-right: 26px; }
.story-ch {
  width: 40px; height: 40px; display: grid; place-items: center;
  font-size: 34px; font-weight: 500; line-height: 1; color: var(--ink);
  writing-mode: vertical-rl; text-orientation: upright;  /* 、。「」を たてがき の むき に */
  border-radius: 8px;
}
.story-ch.space { height: 20px; }
.story-ch.read { color: #7A5236; }
.story-ch.next { background: #FFF1D6; }
.story-ch.help { animation: help-glow 1s ease-out; }
@keyframes help-glow { 0% { background: #FFD27A; transform: scale(1.18); } 100% { background: transparent; transform: scale(1); } }
/* もじ の みぎよこ に うすい 線（ここを ゆびで なぞる）。ことば の あいだ・、。 には ださない
   2026-11-22 代表：点線 では なく 実線 で → うすい 実線。なぞった ところ は こい オレンジ の 線 に なる */
.story-ch:not(.space):not(.mark)::before {
  content: ""; position: absolute; left: calc(100% + 11px); top: 0; bottom: 0; width: 6px;
  background: #EFE2CF; border-radius: 3px;
}
/* よんだ ところ は せん が オレンジ に なる */
.story-ch { position: relative; }
.story-ch.space.read::after, .story-ch.mark.read::after { display: none; }
.story-ch.read::after {
  content: ""; position: absolute; left: calc(100% + 10px); top: 0; bottom: 0; width: 8px;
  background: #FF9F6B; z-index: 1;
}
.story-pic { flex: 1; display: grid; place-items: center; font-size: 96px; line-height: 1; }
.story-pic { min-width: 0; min-height: 0; }
/* 絵 は わく の なか に ぴったり（2026-11-28：絵 が 下 に はみ出して いた）。正方形 の 絵 を そのまま 小さく して 入れる */
.story-pic { position: relative; container-type: size; }
.story-img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); object-fit: cover; border-radius: 18px; }
.story-pic.pop { animation: pop .5s ease-out; }
.story-tools { display: flex; gap: 10px; justify-content: center; align-items: center; padding-top: 10px; }
.story-tools .big-btn { flex: 1; min-height: 56px; font-size: 19px; }

/* ---------- べんきょう メニュー（セット・おけいこ） ---------- */
.study-list { gap: 12px; margin-top: 12px; }
.study-head { margin: 10px 4px 0; font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.study-group { display: flex; flex-direction: column; gap: 10px; }
.study-card { min-height: 92px; padding: 12px 16px; }
.study-icon { width: 64px; height: 64px; font-size: 34px; }
.study-icon-text { font-size: 40px; }
.study-name { font-size: 22px; }
.study-set { display: block; font-size: 12px; color: var(--accent-dark); margin-top: 2px; font-weight: 800; }
.course-card {
  font: inherit; color: #fff; text-align: left;
  background: linear-gradient(135deg, #FFB36B, #FF8A5B); border: none; border-radius: 26px;
  padding: 16px 18px; box-shadow: 0 5px 0 var(--accent-dark);
  display: flex; flex-direction: column; gap: 8px; touch-action: manipulation;
}
.course-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--accent-dark); }
.course-card.done { background: linear-gradient(135deg, #A9D98B, #7CC47F); box-shadow: 0 5px 0 #5E9E61; }
.course-title { font-size: 24px; font-weight: 800; }
.course-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.course-chip { background: rgba(255, 255, 255, .28); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 800; }
.course-chip.done { background: #fff; color: var(--accent-dark); }
.course-sub { font-size: 14px; font-weight: 800; opacity: .95; }
.modal-btn2 { margin-top: 10px; width: 100%; }
.modal-card .big-btn { width: 100%; }
.stars { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; font-size: 30px; color: #E8DCCB; }
.stars .on { color: #FFB938; }
.modal-art:has(.stars), .modal-art:has(.progress-bar) { flex-direction: column; align-items: center; min-height: 0; }
.progress-bar { width: 240px; height: 18px; background: #F1E3CF; border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, #FFC98B, var(--accent)); }
.progress-num { font-weight: 800; color: var(--ink-soft); margin-top: 4px; }

/* ---------- ためしの あそび 共通 ---------- */
.game-area { flex: 1; min-height: 0; margin-top: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.maze-svg { width: 100%; max-height: 100%; touch-action: none; }
/* かず */
.count-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 340px; }
.count-item {
  position: relative; width: 76px; height: 76px; border-radius: 20px;
  background: var(--card); border: 3px solid #EADBC6; font-size: 44px; touch-action: manipulation;
}
.count-item.on { border-color: #F2B84B; background: #FFF1D6; }
.count-num {
  position: absolute; right: -6px; top: -8px; min-width: 28px; height: 28px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 800; display: grid; place-items: center;
}
.count-num:empty { display: none; }
.count-choices { display: flex; gap: 14px; }
.dots-svg { width: 100%; max-width: 400px; touch-action: none; }
.dots-svg .dot.next .dot-ring { animation: dotpulse 1.1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.dots-svg .dot:not(.next) .dot-ring { display: none; }
@keyframes dotpulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
/* できあがり：え が じわっ と うかびあがる */
.dots-svg .dots-pic { opacity: 0; }
.dots-svg.complete .dots-pic { animation: emerge 2.4s ease-out forwards; }
@keyframes emerge { 0% { opacity: 0; filter: blur(8px); } 60% { opacity: .8; filter: blur(2px); } 100% { opacity: 1; filter: blur(0); } }
.dots-svg.complete > g:last-child { opacity: 0; transition: opacity 1.6s ease-out; }
.dots-svg.complete > polygon { opacity: 0; transition: opacity 1.6s; }
.balance-svg { width: 100%; max-width: 380px; touch-action: none; }
.balance-pan { cursor: pointer; }
.balance-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 330px; min-height: 104px; }
.balance-duck img, .balance-float img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.balance-duck { padding: 4px; width: 54px; height: 50px; border: 3px solid #F3E2C9; border-radius: 16px; background: #fff; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.balance-svg .balance-pan[data-side="right"] { touch-action: none; }
.balance-svg .balance-pan.hover path { fill: #FFE6B8; }
.balance-float { position: fixed; left: 0; top: 0; width: 56px; height: 56px; pointer-events: none; z-index: 50; filter: drop-shadow(0 4px 4px rgba(0,0,0,.2)); }
.balance-duck:active { transform: scale(.9); }
.count-choice {
  font: inherit; font-size: 40px; font-weight: 800; color: var(--ink);
  width: 84px; height: 84px; border-radius: 24px; background: #FFF6E8; border: 3px solid var(--accent);
  touch-action: manipulation;
}
/* みち つなぎ */
.road-wrap { display: grid; grid-template-columns: 62px 300px 62px; grid-template-rows: repeat(var(--n), 1fr); align-items: center; justify-content: center; }
/* いりぐち・でぐち：パズル に くっつく みじかい みち の うえ に あいぼう／おうち */
.road-end { position: relative; align-self: stretch; }
.road-stub { position: absolute; left: 0; right: 0; top: 50%; height: 34px; transform: translateY(-50%); background: #C9A98A;
  background-image: repeating-linear-gradient(90deg, #fff 0 8px, transparent 8px 16px); background-size: 100% 4px; background-position: center; background-repeat: no-repeat; }
.road-start .road-stub { left: 10px; border-radius: 17px 0 0 17px; }
.road-goal .road-stub { right: 10px; border-radius: 0 17px 17px 0; }
.road-icon { position: relative; z-index: 1; display: grid; place-items: center; }
.road-start .road-icon { margin-right: 6px; }
.road-goal .road-icon { margin-left: 6px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.road-board {
  grid-column: 2; grid-row: 1 / -1;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px;
  width: min(100%, 300px); aspect-ratio: 1; background: #EADBC6; padding: 4px; border-radius: 16px;
}
.road-board.solved { background: #A9D98B; }
.road-tile { background: #F7EBD8; border: none; border-radius: 10px; padding: 0; transition: transform .25s; touch-action: manipulation; }
.road-tile svg { width: 100%; height: 100%; display: block; }
.road-end { display: grid; place-items: center; font-size: 34px; }
.road-start { grid-column: 1; }
.road-start .pet-art { width: 50px; height: 50px; }
.road-goal { grid-column: 3; }
.road-wrap { position: relative; }
.road-walker { position: absolute; left: 0; top: 0; width: 46px; height: 46px; pointer-events: none; z-index: 3; }
.road-walker .pet-art, .road-walker svg { width: 46px; height: 46px; }
.road-walker-bob { animation: walkbob .45s ease-in-out infinite; }
@keyframes walkbob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
.road-goal.arrived { animation: pop .5s ease-out; }
/* とけい */
.clock-svg { width: 330px; max-height: 100%; touch-action: none; }
.clock-legend { display: flex; gap: 14px; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.clock-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 4px; margin-right: 4px; vertical-align: middle; }
.clock-legend .hh { background: #E9824C; }
.clock-legend .mh { background: #5FA8D3; }

/* ---------- がんばり カレンダー ---------- */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 10px; }
.cal-head .icon-btn { width: 44px; height: 44px; font-size: 18px; }
.cal-title { font-size: 24px; font-weight: 800; min-width: 90px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--card); border-radius: 18px; padding: 10px 8px; }
.cal-week { text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-soft); padding-bottom: 4px; }
.cal-week.sun { color: #E8604C; } .cal-week.sat { color: #5FA8D3; }
.cal-cell { position: relative; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; }
.cal-cell.today { background: #FFF1D6; }
.cal-day { font-size: 14px; font-weight: 800; color: var(--ink); position: relative; z-index: 1; }
.cal-cell .hanamaru { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); animation: pop .4s ease-out; }
.cal-star { color: #FFB938; font-size: 16px; }
.cal-cell .cal-star { position: absolute; right: 0; top: -3px; }
.cal-sum { text-align: center; font-weight: 800; margin: 14px 0 4px; }
.cal-legend { text-align: center; font-size: 12px; color: var(--ink-soft); }
.cal-legend-maru { display: inline-block; width: 12px; height: 12px; border: 2px solid #E8604C; border-radius: 50%; vertical-align: -2px; margin-right: 3px; }
#screen-home .topbar { gap: 8px; }
#screen-home .topbar .icon-btn { width: 48px; height: 48px; flex: none; }

/* ---------- 保護者メニュー：おなまえ・時間 ---------- */
.parent-card { max-height: calc(100% - 16px); overflow-y: auto; }
.parent-card > * { flex-shrink: 0; }   /* 中身が多くても ボタンを ちぢめない（スクロールで見る） */
.parent-field { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 14px; font-weight: 800; }
.parent-row { display: flex; gap: 6px; }
.parent-field input, .parent-field select { font: inherit; font-size: 16px; padding: 8px 10px; border: 2px solid #E6D3B8; border-radius: 12px; background: #fff; min-width: 0; }
.parent-field input { flex: 1; }
.parent-note { font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.sub-btn.small { padding: 6px 12px; min-height: 0; font-size: 14px; }
.big-pet.sleepy { filter: saturate(.85); animation: none; }
/* ねむい あいぼう（めやす の 2ばい）：ゆっくり いき を して、Zzz が うかぶ（2026-11-27） */
.big-pet.sleeping { position: relative; filter: saturate(.8) brightness(.96); }
.big-pet.sleeping .pet-art { animation: sleepBreath 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sleepBreath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
.zzz { position: absolute; right: 22%; top: 18%; pointer-events: none; font-weight: 900; color: #7C8FC9; }
.zzz i { position: absolute; font-style: normal; opacity: 0; animation: zzzUp 3s ease-out infinite; }
.zzz i:nth-child(1) { font-size: 18px; animation-delay: 0s; }
.zzz i:nth-child(2) { font-size: 24px; animation-delay: 1s; }
.zzz i:nth-child(3) { font-size: 30px; animation-delay: 2s; }
@keyframes zzzUp { 0% { opacity: 0; transform: translate(0, 30px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(22px, -34px); } }

/* まえより できるように なったこと */
.growth-line { display: block; margin-top: 10px; padding: 8px 12px; background: #FFF1D6; border-radius: 14px; font-size: 15px; color: #B8642C; }
.parent-growth { background: #FFF6E6; border-radius: 12px; padding: 8px 10px; text-align: left; line-height: 1.7; }

/* せんせい の ひとこと */
.sensei { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; text-align: left; }
.sensei-paper { position: relative; width: 104px; height: 124px; flex: none; background: #fff; border: 3px solid #F3E2C9; border-radius: 14px; }
.sensei-paper svg { width: 100%; height: 100%; }
.sensei-markbox { position: absolute; right: -14px; top: -14px; width: 54px; height: 54px; display: grid; place-items: center; }
.sensei-markbox .hanamaru { width: 54px; height: 54px; animation: stamp .5s ease-out; }
.sensei-mark { font-size: 40px; color: #E8604C; font-weight: 800; animation: stamp .5s ease-out; }
@keyframes stamp { 0% { transform: scale(2); opacity: 0; } 70% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1); } }
.sensei-talk { font-size: 15px; line-height: 1.6; background: #FFF6E6; border-radius: 14px; padding: 8px 12px; }
.sensei-talk b { color: #E8604C; font-size: 18px; }
.sensei-name { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 800; }
.sensei-tip { color: #5E7487; }
.modal-art:has(.sensei) { flex-direction: column; flex-wrap: wrap; }
.sensei { width: 100%; max-width: 320px; margin-left: auto; margin-right: auto; }
.sensei-talk { flex: 1; min-width: 0; }
#screen-select .title { margin-top: 56px; }

/* ---------- 週 の レポート ---------- */
.report-body { overflow-y: auto; flex: 1; padding-bottom: 20px; }
.rep-lead { text-align: center; font-weight: 800; margin: 6px 0 10px; }
.report-body, .parent-card { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }   /* jpBreaks の <wbr> の ところ だけ で 改行 */
.rep-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.rep-nums div { background: var(--card); border-radius: 16px; padding: 10px 4px; text-align: center; font-size: 13px; }
.rep-nums b { font-size: 28px; color: var(--accent-dark); margin-right: 2px; }
.rep-nums .rep-k { display: block; font-size: 11px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.rep-nums .rep-prev { display: block; font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.rep-card { background: var(--card); border-radius: 18px; padding: 10px 14px; margin-bottom: 10px; }
.rep-card h3 { font-size: 15px; margin: 2px 0 6px; }
.rep-card p { margin: 4px 0; font-size: 14px; line-height: 1.7; }
.rep-rows { margin: 0; }
.rep-rows > div { padding: 6px 0; border-top: 1px dashed #EADBC6; }
.rep-rows > div:first-child { border-top: none; }
.rep-rows dt { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.rep-rows dd { margin: 0; font-size: 15px; line-height: 1.6; }
.rep-rows dd b { color: var(--accent-dark); }
.rep-chars { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-right: 6px; }
.rep-chars i { font-style: normal; font-weight: 800; background: #fff; border-radius: 8px; padding: 0 6px; }
.rep-note { font-size: 11px !important; color: var(--ink-soft); }

/* ---------- おてほん なしで かく ---------- */
.free-model { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 4px 16px; }
.free-model-cap { font-size: 12px; color: var(--ink-soft); font-weight: 800; }
.free-model-char { font-size: 64px; line-height: 1.1; font-weight: 800; color: var(--ink); }
.free-svg { width: 100%; max-width: 320px; touch-action: none; }
.free-stamp { animation: stamp .5s ease-out; transform-box: fill-box; transform-origin: center; }
.sensei-ai { color: #4F8A4F; font-weight: 800; }

/* ---------- 2026-11-08 しんさく ---------- */
.study-card { position: relative; }
.new-badge { position: absolute; top: -6px; left: -6px; background: #E8604C; color: #fff; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.release-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: linear-gradient(90deg, #FFF0D9, #FFE3E0); border: 3px dashed #F2B07B; color: var(--ink); }
.release-banner b { font-size: 18px; }
.release-banner small { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.release-gift { font-size: 34px; }
.word-text.en { text-transform: none; letter-spacing: .02em; }
/* おえかき */
.draw-svg { width: 100%; max-width: 380px; max-height: 330px; touch-action: none; border-radius: 20px; box-shadow: 0 3px 0 #EADBC6; }
.draw-hint { fill: none; stroke: #E9DCC8; stroke-width: 3; stroke-dasharray: 8 10; }
.draw-svg.done .draw-hint { display: none; }
.draw-base, .draw-ink { transform-box: view-box; transform-origin: 50% 60%; }
.draw-base.cheer, .draw-ink.cheer { animation: drawcheer .9s ease-out 3; }   /* かいた 線 も いっしょ に うごく */
@keyframes drawcheer { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.06) rotate(-2deg); } 60% { transform: scale(.98) rotate(2deg); } }
.draw-palette { display: flex; gap: 14px; }
.draw-color { width: 50px; height: 50px; border-radius: 999px; border: 4px solid #fff; box-shadow: 0 0 0 3px #EADBC6; touch-action: manipulation; }
.draw-color.on { box-shadow: 0 0 0 4px var(--accent); transform: scale(1.1); }
.trace-tools { gap: 12px; align-items: center; }
/* たしざん・ひきざん */
.calc-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 360px; }
.calc-items.hint .calc-item:not(.eaten) { animation: pop .5s ease-out; }
.calc-item.fly-in { animation: flyin .6s ease-out; }
@keyframes flyin { 0% { transform: translate(140px, -60px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.calc-item.eaten { opacity: .25; transform: scale(.8); transition: all .5s; border-style: dashed; }
.calc-eq { font-size: 38px; font-weight: 800; color: var(--ink); background: #FFF6E8; padding: 6px 22px; border-radius: 18px; }
.calc-eq.solved { color: #E8604C; animation: pop .5s ease-out; }
/* プログラミング */
/* プログラミング（よこ画面）：マス目 ｜ ばんごう つき の プログラム ｜ ブロック と ごみばこ */
.part { display: inline-block; line-height: 1; }
img.part { width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.code-wrap { display: flex; align-items: stretch; justify-content: center; gap: 10px; width: 100%; height: 100%; max-height: 360px; touch-action: none; }
.code-board { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: 3px; height: 100%; aspect-ratio: 1; flex: none; background: #6FB24C; padding: 5px; border-radius: 14px; box-shadow: 0 4px 0 #4F8A35; }
.code-cell { background: #A8D97F; border-radius: 5px; display: grid; place-items: center; position: relative; }
.code-cell.alt { background: #9AD06F; }
.code-cell .part-emoji { font-size: 26px; }
.code-cell img.part { width: 82%; height: 82%; }
.code-cell.start::before { content: "スタート"; position: absolute; left: 0; right: 0; bottom: 1px; font-size: 8px; font-weight: 800; color: #3E6B2A; text-align: center; }
.code-cell.goal { background: #FFE7A8; }
.code-cell.goal.done { animation: pop .5s; }
.code-cell.item { background: #FFF1C9; }
.code-cell.item.taken .part { opacity: 0; }
.code-walker { position: absolute; width: calc((100% - 10px) / var(--n) * .86); aspect-ratio: 1; transform: translate(-50%, -50%); transition: left .45s ease-in-out, top .45s ease-in-out; pointer-events: none; z-index: 2; margin-left: 0; }
.code-walker .pet-art { width: 100%; height: 100%; }
.code-walker.happy > .pet-art { animation: walkbob .45s ease-in-out 4; }
.code-hold { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; font-size: 18px; display: none; }
.code-walker.holding .code-hold { display: block; }
.code-side { flex: 0 0 132px; display: flex; flex-direction: column; gap: 6px; background: #3B4B78; border-radius: 14px; padding: 6px; min-height: 0; }
.code-run { font: inherit; font-size: 15px; font-weight: 800; color: #fff; background: #E8604C; border: none; border-radius: 10px; padding: 8px 4px; box-shadow: 0 3px 0 #B8432F; touch-action: manipulation; flex: none; }
.code-run:disabled { opacity: .55; }
.code-run:active { transform: translateY(2px); box-shadow: 0 1px 0 #B8432F; }
.code-program { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; min-height: 0; }
.code-slot { flex: none; height: 38px; border-radius: 8px; background: rgba(255,255,255,.08); border: 2px dashed rgba(255,255,255,.25); display: flex; align-items: center; gap: 4px; padding: 0 4px; position: relative; }
.code-slot b { flex: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #3B4B78; font-size: 11px; display: grid; place-items: center; }
.code-slot.filled { border: none; background: transparent; }
.code-slot.drop-here::before { content: ""; position: absolute; left: 4px; right: 4px; top: -3px; height: 4px; border-radius: 2px; background: #FFD84D; box-shadow: 0 0 6px #FFD84D; }
.code-slot.loop-here .code-block { outline: 3px solid #FFD84D; }
.code-slot.now .code-block { outline: 3px solid #FFD84D; transform: scale(1.06); }
.code-slot.bad .code-block { outline: 3px solid #FF6B5A; animation: pop .4s; }
.code-block { flex: 1; height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; position: relative; color: #fff; font-size: 20px; background: #3C7FE0; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.code-block::before { content: ""; position: absolute; left: 12px; top: -4px; width: 14px; height: 6px; border-radius: 3px 3px 0 0; background: inherit; }   /* パズル の でっぱり */
.code-block.b-take { background: #2EA07A; }   /* 2026-11-14：手の絵（きいろ）と見分けやすい色に（きいろ×きいろ だったのを変更） */
.code-block.b-loop { background: #9B6BD3; }
.code-block img.part { height: 100%; width: auto; }
.code-block .code-icon-img { height: 60%; width: auto; display: block; }
.code-block small { position: absolute; right: 3px; bottom: 1px; font-size: 12px; font-weight: 800; color: #fff; }
.code-palette { flex: 0 0 64px; display: flex; flex-direction: column; gap: 6px; background: #CFE6F7; border-radius: 14px; padding: 6px; overflow-y: auto; }
.code-pal { flex: none; cursor: grab; touch-action: none; }
.code-pal .code-block { height: 40px; }
.code-pal:active .code-block { transform: scale(.94); }
.code-trash { margin-top: auto; flex: none; height: 46px; border-radius: 10px; border: 2px dashed #8FB3CF; display: grid; place-items: center; font-size: 24px; }
.code-trash .code-icon-img { width: 26px; height: 26px; }
.code-trash.over { background: #FFD9D3; border-color: #E8604C; transform: scale(1.08); }
.code-ghost { position: fixed; left: 0; top: 0; width: 80px; pointer-events: none; z-index: 60; filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); }
.code-ghost .code-block { height: 40px; }
/* えいご */
.eng-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(100%, 380px); }
.eng-cards.four { grid-template-columns: repeat(2, 1fr); width: min(100%, 300px); }
.eng-card { background: var(--card); border: 3px solid #EADBC6; border-radius: 22px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; touch-action: manipulation; }
.eng-card.tapped { animation: pop .35s ease-out; border-color: #F2B84B; }
.eng-card.right { border-color: #49B36A; background: #E8F7EA; }
.eng-card.wrong { animation: shake .4s; }
.eng-emoji { font-size: 52px; line-height: 1.1; }
.eng-color { width: 58px; height: 58px; border-radius: 999px; display: block; border: 3px solid rgba(0,0,0,.08); }
.eng-word { font-size: 20px; font-weight: 800; color: var(--ink); font-family: "Arial Rounded MT Bold", "Helvetica Rounded", system-ui, sans-serif; }
.eng-cards.quiz .eng-word { visibility: hidden; }
.eng-hear { font: inherit; font-size: 20px; font-weight: 800; padding: 12px 22px; border-radius: 999px; border: 3px solid var(--accent); background: #FFF6E8; color: var(--ink); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* 保護者のカギ（かけざん） */
.gate-card { display: flex; flex-direction: column; gap: 10px; }
.gate-question { font-size: 34px; font-weight: 800; margin: 4px 0 0; text-align: center; }
.gate-input { font-size: 30px; font-weight: 800; min-height: 44px; margin: 0; text-align: center;
  border-bottom: 3px dashed var(--ink-soft); letter-spacing: 6px; }
.gate-error { font-size: 14px; font-weight: 700; color: #C0503A; margin: 0; text-align: center; }
.gate-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gate-key { font-size: 22px; min-height: 52px; padding: 6px 0; }
#gate-del, .gate-ok { font-size: 15px; }
.gate-ok { border-color: var(--accent); font-weight: 800; }

/* ボタンの （ ）の中は つぎの行に 小さく */
.btn-note { display: block; font-size: .68em; font-weight: normal; opacity: .85; line-height: 1.2; margin-top: 0; }
button:has(.btn-note) { line-height: 1.2; padding-top: 8px; padding-bottom: 8px; }   /* 2行のボタンは 行間を つめる */


/* =========================================================
   よこ画面（2026-11-09 代表：スマホ も タブレット も 横 で 統一）
   ・#app は 横 760 × たて 390 を もと に 拡大（app.js の fitTablet）
   ・まなぶ／あそぶ 画面（side-layout）は、ひだり に 細い 列（もどる・あいぼう・ふきだし・ボタン）、
     のこり ぜんぶ を 大きな あそぶ ばしょ に する
   ========================================================= */
.screen { padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }

/* たて に もったら */
.rotate-hint { display: none; position: fixed; inset: 0; z-index: 100; background: var(--bg); flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-size: 24px; font-weight: 800; color: var(--ink); }
.rotate-phone { width: 70px; height: 116px; border: 6px solid var(--ink); border-radius: 16px; animation: rotatephone 2.4s ease-in-out infinite; }
@keyframes rotatephone { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
/* 2026-11-10：たて の とき は アプリ を まわして 横 に 出す ので、この おしらせ は つかわない */

/* ---- まなぶ／あそぶ 画面：ひだり の 列 ＋ 大きな ばしょ ---- */
.side-layout.active { display: grid; grid-template-columns: 178px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); column-gap: 12px; row-gap: 8px;
  grid-template-areas: "top main" "bubble main" "tools main"; }
.side-layout > .topbar { grid-area: top; flex-wrap: wrap; gap: 6px; min-height: 0; }
.side-layout > .topbar .level-label { order: 3; flex: 1 0 100%; font-size: 16px; text-align: left; line-height: 1.3; }
.side-layout > .topbar .mini-pet { margin-left: auto; width: 60px; height: 60px; }
.side-layout > .bubble { grid-area: bubble; position: relative; top: auto; left: auto; transform: none; width: auto; max-width: none; font-size: 18px; line-height: 1.4; padding: 8px 12px; opacity: 1; margin-top: 6px; word-break: keep-all; overflow-wrap: anywhere; }   /* 2026-11-20 代表：文字 を 大きく。しゃべった あと も うすく しない */
.side-layout > .bubble.show { opacity: 1; transform: none; }
.side-layout > .bubble::after { top: -9px; bottom: auto; left: auto; right: 22px; transform: rotate(225deg); }
.side-layout > .trace-tools, .side-layout > .story-tools { grid-area: tools; flex-direction: column; align-items: stretch; justify-content: flex-end; padding: 0; gap: 8px; }
.side-layout > .trace-tools .sub-btn, .side-layout > .story-tools .sub-btn { font-size: 15px; min-height: 46px; padding: 6px 10px; }
.side-layout > .trace-tools .big-btn, .side-layout > .story-tools .big-btn { font-size: 17px; min-height: 50px; padding: 8px 10px; }
.side-layout > .trace-svg, .side-layout > .read-stage, .side-layout > .story-page, .side-layout > .game-area { grid-area: main; min-height: 0; height: 100%; }
.side-layout > .story-page { margin-top: 0; }   /* 2026-11-22：たて 画面 の とき の 70px が のこって いて、下 が きれて いた */
.side-layout > .game-area { margin-top: 0; flex-direction: row; flex-wrap: wrap; align-content: center; gap: 14px; }

/* ---- ホーム：ひだり に あそぶ ボタン、まんなか に あいぼう、みぎ に みず・ごはん・べんきょう ---- */
#screen-home.active { display: grid; grid-template-columns: 110px minmax(0, 1fr) 150px; grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top top" "play pet tray"; column-gap: 12px; }
#screen-home > .topbar { grid-area: top; min-height: 0; }
#screen-home > .pet-area { grid-area: pet; padding-bottom: 8px; }
#screen-home .pet { width: auto; height: 100%; max-height: 290px; max-width: 100%; }
#screen-home .bubble { top: 0; }
#screen-home > .play-row { grid-area: play; flex-direction: column; justify-content: center; margin: 0; }
#screen-home .play-btn { flex: none; }
#screen-home > .tray { grid-area: tray; flex-direction: column; align-items: stretch; justify-content: center; }
#screen-home .tray-item { align-self: center; }
#screen-home .tray .big-btn { flex: none; font-size: 20px; padding: 12px 8px; }
/* 2026-11-12 代表：じめん が ボタン に かぶる → じめん は まんなか の ばしょ だけ、ボタン は いつも うえ に */
#screen-home .ground { left: 0; right: 0; z-index: 0; }
#screen-home .pet, #screen-home .bubble { z-index: 1; }
#screen-home > .play-row, #screen-home > .tray, #screen-home > .topbar { position: relative; z-index: 3; }

/* ---- あいぼう を えらぶ：3つ を 横 に ならべる ---- */
#screen-select .title { margin: 6px 0 0; font-size: 24px; }
#screen-select .sub { margin: 0 0 8px; }
.select-list { flex-direction: row; gap: 12px; }
.select-card { flex: 1; flex-direction: column; text-align: center; padding: 10px; }
.select-card .pet-thumb { width: 110px; height: 110px; }
.select-card .done-badge { margin: 0; text-align: center; }
#screen-select .note { margin-top: 8px; }

/* ---- べんきょう を えらぶ：カード を 横 に ならべる ---- */
.study-list { margin-top: 4px; }
.study-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.study-card { min-height: 78px; }

/* ---- ずかん・カレンダー・レポート ---- */
#screen-calendar.active { display: grid; grid-template-columns: minmax(0, 1fr) 220px; grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "top top" "head sum" "grid legend"; column-gap: 16px; }
#screen-calendar > .topbar { grid-area: top; }
#screen-calendar > .cal-head { grid-area: head; margin: 0 0 6px; }
#screen-calendar > .cal-grid { grid-area: grid; align-self: start; max-width: 430px; justify-self: center; width: 100%; }
#screen-calendar .cal-cell { aspect-ratio: auto; height: 34px; }
#screen-calendar > .cal-sum { grid-area: sum; align-self: end; }
#screen-calendar > .cal-legend { grid-area: legend; }
.report-body { columns: 2 320px; column-gap: 20px; }
.report-body > * { break-inside: avoid; }
.modal-card { max-height: calc(100% - 12px); overflow-y: auto; }
#screen-home .play-btn { min-height: 54px; padding: 4px 0 6px; }
#screen-home .play-row { gap: 6px; }
#screen-home .drag-hint { left: auto; right: max(176px, calc(env(safe-area-inset-right) + 162px)); bottom: auto; top: 120px; }

/* ---- よこ画面：ゲーム ごと の ちょうせい ---- */
.side-layout .balance-svg { width: auto; height: 100%; max-height: 380px; max-width: 62%; flex: 0 1 auto; }
.side-layout .balance-pool { max-width: 210px; align-content: center; }

/* かたち うつし（空間）：おてほん と ぬる マス目 */
.shape-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; height: 100%; max-height: 320px; width: 100%; }
.shape-cap { display: flex; flex-direction: column; align-items: center; gap: 4px; width: min(30%, 190px); font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.shape-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: 4px; aspect-ratio: 1; background: #E6D6BF; padding: 5px; border-radius: 12px; position: relative; }
.shape-model { width: 100%; }
.shape-play { width: min(100%, 320px); max-width: 56%; max-height: 100%; touch-action: none; box-shadow: 0 4px 0 #CDB89B; }
.shape-cell { background: #FFFBF3; border-radius: 6px; transition: background .12s; }
.shape-play .shape-cell { cursor: pointer; }
.shape-cell.given { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 4px, transparent 4px 8px); }
.shape-cell.given:not([data-c]), .shape-cell.given[data-c=""] { background-color: #F3EADB; }
.shape-mirror { position: absolute; top: -6px; bottom: -6px; left: 50%; width: 6px; margin-left: -3px; border-radius: 3px; background: linear-gradient(#9FD3F5, #5AA9E6); box-shadow: 0 0 8px rgba(90,169,230,.6); pointer-events: none; }
.shape-play.solved { animation: pop .5s; }
.shape-pal { display: flex; flex-direction: column; gap: 12px; }
.shape-color { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.15); touch-action: manipulation; }
.shape-color.on { outline: 4px solid var(--ink); }

.shape-wrap.mirror .shape-play { max-width: 70%; }
.zukan-grid { grid-template-columns: repeat(5, 1fr) !important; overflow-y: auto; }

/* たて に もって いて アプリ を まわして いる とき：ノッチ（上）は アプリ の ひだり、ホームバー（下）は みぎ */
#app.rot .screen { padding: 8px max(14px, env(safe-area-inset-bottom)) 8px max(14px, env(safe-area-inset-top)); }

/* ---- べんきょう を えらぶ（2026-11-10）：1画面 に ぜんぶ。ひだり に きょうの おけいこ、みぎ に アイコン の タイル ---- */
#screen-study.active { display: flex; }
.study-release { font-size: 12px; color: var(--accent-dark); margin-left: 6px; white-space: nowrap; }
.study-wrap { flex: 1; min-height: 0; display: flex; gap: 10px; margin-top: 4px; }
.study-wrap .course-card { flex: 0 0 168px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 12px; text-align: left; margin: 0; word-break: keep-all; overflow-wrap: anywhere; }   /* ことば の とちゅう で 折り返さない（2026-11-20） */
.study-wrap .course-title { font-size: 20px; }
.study-wrap .course-chip { font-size: 11px; padding: 2px 8px; }
.study-wrap .course-sub { font-size: 12px; }
.study-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 6px; }
.study-tile { position: relative; font: inherit; color: var(--ink); background: var(--card); border: 3px solid transparent; border-radius: 16px; box-shadow: 0 3px 0 rgba(90, 70, 54, .12);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px; min-height: 0; overflow: hidden; touch-action: manipulation; }
.study-tile.base { background: #FFF1DF; }
.study-tile:active { border-color: var(--accent); transform: translateY(2px); }
.study-tile .study-icon { width: auto; height: auto; font-size: 28px; line-height: 1.05; background: none; }
.study-tile .study-icon-text { font-size: 26px; font-weight: 800; color: #E9824C; }
.study-tile .study-icon svg { width: 30px; height: 30px; }
.study-tile .study-icon-img { width: 30px; height: 30px; display: block; }
.study-tile .study-name { font-size: 11px; font-weight: 800; line-height: 1.2; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.study-pips { font-size: 7px; letter-spacing: 1px; color: var(--accent); line-height: 1; }
/* NEW は 右うえ の 角 の タグ（2026-11-19 代表：絵 に かぶって 見づらい → A案） */
.study-tile .new-badge { left: auto; top: -1px; right: -1px; font-size: 8px; padding: 2px 6px 2px 8px; border-radius: 0 13px 0 10px; box-shadow: none; letter-spacing: .5px; }

/* ---- よこ画面 で スクロール しない（2026-11-10 代表：ボタン が 見えず 子ども が とまって しまう）---- */
/* ずかん：5れつ × 2だん を 1画面 に */
.zukan-grid { flex: 1; min-height: 0; grid-template-rows: repeat(2, minmax(0, 1fr)); overflow: hidden; padding-bottom: 0; gap: 8px; }
.zukan-cell { min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 4px; }
.zukan-cell .pet-art { flex: 1; min-height: 0; width: 100%; aspect-ratio: auto; }
.zukan-cap { min-height: 0; font-size: 10px; line-height: 1.3; }
.zukan-no { font-size: 14px; left: 6px; top: 2px; }
#zukan-catch { margin: 0 0 4px; }

/* ごほうび など の おしらせ：ひだり に 絵、みぎ に 文 と ボタン */
#modal .modal-card { max-width: 640px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "art text" "art btn" "art btn2"; column-gap: 18px; row-gap: 8px; align-items: center; text-align: center; }
#modal .modal-art { grid-area: art; min-height: 0; max-width: 300px; }
#modal .modal-art .big-pet { width: 170px; height: 170px; }
#modal .modal-text { grid-area: text; margin: 0; font-size: 18px; }
#modal #modal-btn { grid-area: btn; }
#modal .modal-btn2 { grid-area: btn2; }
#modal .modal-card:not(:has(.modal-art > *)) { grid-template-columns: 1fr; grid-template-areas: "text" "btn" "btn2"; max-width: 420px; }

/* ことばカード：ひだり に せんせい、みぎ に カード・文・ボタン（たて に つむと 画面 から はみだす） */
#modal .modal-card.has-words { grid-template-columns: minmax(0, 300px) auto; grid-template-areas: "sensei words" "sensei text" "sensei btn"; max-width: 660px; }
#modal .modal-card.has-words:not(:has(.sensei)) { grid-template-columns: auto; grid-template-areas: "words" "text" "btn"; max-width: 420px; }
#modal .modal-card.has-words .modal-art { display: contents; }
#modal .modal-card.has-words .sensei { grid-area: sensei; margin: 0; }
#modal .modal-card.has-words .word-cards { grid-area: words; }
.word-icon.many { font-size: 24px; max-width: 100%; display: block; word-break: break-all; line-height: 1.25; }
/* ことば は とちゅう で おりかえさない（「へりこぷた／ー」に ならない よう、ながい ことば は カード を すこし ひろげる） */
.word-card { width: auto; min-width: 130px; }
.word-text { white-space: nowrap; }

/* 保護者のカギ：ひだり に もんだい、みぎ に すうじ の キー */
.gate-card { max-width: 600px; display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "t k" "i k" "q k" "in k" "e k" "c k"; column-gap: 18px; row-gap: 6px; align-items: center; }
.gate-card .parent-title { grid-area: t; } .gate-card .parent-info { grid-area: i; font-size: 13px; }
.gate-question { grid-area: q; } .gate-input { grid-area: in; } .gate-error { grid-area: e; }
.gate-keys { grid-area: k; } #gate-close { grid-area: c; min-height: 50px; font-size: 18px; }
.gate-key { min-height: 46px; }

/* 保護者メニュー：ひだり に 記録、みぎ に 設定 と ボタン（おとな が 見る 画面） */
.parent-card { max-width: 780px; max-height: calc(100% - 8px); display: flex; flex-direction: column; overflow: hidden; padding: 14px 18px; gap: 8px; }
.parent-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; }
.parent-col { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.parent-col > * { flex-shrink: 0; margin: 0; }
.parent-col-read { overflow-y: auto; }   /* 記録 が ながい とき だけ ここ を スクロール（ボタン は みぎ に いつも 見える） */
.parent-col-set .parent-note { font-size: 11px; }
.parent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.parent-actions button { min-height: 46px; font-size: 13px; padding: 4px 6px; }
.parent-actions .big-btn { font-size: 15px; }
#parent-close { position: absolute; top: 8px; right: 12px; left: auto; width: auto; min-height: 38px; font-size: 15px; padding: 4px 16px; box-shadow: 0 3px 0 var(--accent-dark); }
.parent-card { position: relative; }
.parent-card .parent-title { margin: 2px 0 0; }
.parent-col-set .parent-field { gap: 3px; }
.side-layout > .game-area:has(.balance-svg) { flex-wrap: nowrap; }
.side-layout .balance-svg { min-width: 0; }
.side-layout .balance-pool { flex: 0 0 auto; max-width: 180px; }
.side-layout > .game-area:has(.draw-svg) { flex-wrap: nowrap; }
.side-layout .draw-svg { width: auto; height: 100%; max-height: 350px; min-width: 0; flex: 0 1 auto; }
.side-layout .draw-palette { flex-direction: column; flex: none; }

/* てんびん（2026-11-12 代表）：した に ならぶ あいぼう の わく を なくす */
.balance-duck { border: none; background: transparent; box-shadow: none; padding: 0; }
.side-layout .balance-svg { overflow: visible; }

/* 保護者メニュー：今日のおけいこ の 設定 と、中身 を かえる 画面（2026-11-12） */
.parent-course { background: #FFF6E8; border-radius: 12px; padding: 8px 10px; }
.parent-course select { font: inherit; font-size: 14px; padding: 4px; border-radius: 8px; border: 2px solid #EADBC6; background: #fff; min-width: 0; flex: 1; }
.course-edit-card { max-width: 760px; width: 100%; max-height: calc(100% - 8px); display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; text-align: left; }
.course-edit-card .parent-title { margin: 0; text-align: center; }
.course-edit-card .parent-info { margin: 0; font-size: 12px; }
.course-edit-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 5px; }
.course-edit-item { position: relative; border: 2px solid #EADBC6; border-radius: 10px; background: #fff; padding: 3px 5px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 0; }
.course-edit-item.on { border-color: var(--accent); background: #FFF1DF; }
.course-edit-order { position: absolute; top: -6px; left: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.course-edit-name { font-size: 11px; font-weight: 800; line-height: 1.2; display: flex; align-items: center; gap: 3px; white-space: nowrap; overflow: hidden; }
.course-edit-icon { font-size: 15px; }
.course-edit-icon.study-icon-img { width: 15px; height: 15px; flex: none; }
.course-edit-step { display: flex; align-items: center; justify-content: center; gap: 6px; }
.course-edit-step button { width: 30px; height: 26px; border-radius: 8px; border: 2px solid #EADBC6; background: #FFFBF3; font: inherit; font-weight: 800; font-size: 15px; padding: 0; touch-action: manipulation; }
.course-edit-step b { min-width: 18px; text-align: center; font-size: 15px; }
.course-edit-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.course-edit-fun { font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.course-edit-total { font-size: 13px; font-weight: 800; color: var(--accent-dark); margin-left: auto; }
.course-edit-foot .big-btn { min-height: 44px; font-size: 17px; padding: 6px 22px; }
.parent-card { gap: 4px; padding-top: 10px; padding-bottom: 10px; }
.parent-col { gap: 6px; }
.parent-actions button { min-height: 42px; }
.parent-col-set .parent-note { font-size: 10.5px; line-height: 1.35; }
.parent-actions button { min-height: 40px; }
.course-edit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.course-edit-item { flex-direction: row; align-items: center; justify-content: space-between; padding: 2px 4px 2px 6px; }
.course-edit-name { flex: 1; min-width: 0; white-space: normal; font-size: 11px; line-height: 1.15; }
.course-edit-step { gap: 3px; flex: none; }
.course-edit-step button { width: 28px; height: 28px; }
.course-edit-step b { min-width: 16px; font-size: 14px; }
.course-edit-name { overflow: visible; }
/* 2026-11-12 代表：保護者メニュー の 左 が すこし 切れる → つめる */
.parent-col-read { gap: 5px; }
.parent-col-read .parent-credit { font-size: 10px; line-height: 1.45; }
.parent-col-read .parent-growth { padding: 6px 10px; line-height: 1.6; }
/* 2026-11-12 代表：下 の 2つ の ボタン の 下 が 切れる → 上 を つめて 下 に よゆう */
.parent-col-set { padding-bottom: 8px; gap: 6px; }
.parent-col-set .parent-field input, .parent-col-set .parent-field select { padding: 5px 10px; }
.parent-col-set .parent-row button { padding-top: 4px; padding-bottom: 4px; }
.parent-actions button { min-height: 44px; line-height: 1.25; }

/* きょうだい（2026-11-14）：だれが あそぶ？ ／ ホーム の なまえ ／ 保護者メニュー の タブ */
.kid-picker { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 8px; }
.kid-picker.hidden { display: none; }
.kid-picker-label { font-weight: 800; font-size: 16px; }
.kid-chip { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 3px solid transparent; background: rgba(255,255,255,.85); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.kid-chip.current { border-color: #f59e0b; background: #fff7e0; }
.kid-face { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.kid-face svg, .kid-face img { width: 40px; height: 40px; }
.kid-face-empty { width: 36px; height: 36px; border-radius: 50%; background: #eee; display: inline-flex; align-items: center; justify-content: center; color: #999; }
#screen-select.has-kids .sub, #screen-select.has-kids .note { display: none; }
.kid-badge { border: 0; border-radius: 999px; padding: 6px 12px; background: #fff7e0; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; white-space: nowrap; }
.kid-badge.hidden { display: none; }
.kid-tabs { flex-wrap: wrap; gap: 6px; }
.kid-tab { border: 2px solid #ddd; border-radius: 999px; padding: 4px 12px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.kid-tab.current { border-color: #f59e0b; background: #fff7e0; font-weight: 700; }
.kid-tab.kid-add { border-style: dashed; color: #666; }
.parent-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-right: 96px; }
.parent-head .kid-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.parent-head .kid-tab { padding: 2px 10px; font-size: 13px; }
.kid-remove { border: 0; background: none; color: #c0392b; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; padding: 2px 4px; }
.kid-remove.hidden { display: none; }

/* 字 の 3かい（いま なんかいめ か）*/
.round-pips { font-size: 12px; letter-spacing: 2px; color: #E6CDB0; white-space: nowrap; }
.round-pips i { font-style: normal; color: var(--accent-dark); }
.round-pips b { color: var(--accent); font-weight: 400; }

/* ---------- しんか の けむり（2026-11-20 代表：絵 が きりかわる とき 自然 に）---------- */
.pet.evolve-shake .body-group { animation: evolveShake .65s ease-in; }
@keyframes evolveShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-3%) rotate(-3deg); } 30% { transform: translateX(3%) rotate(3deg); }
  45% { transform: translateX(-4%) rotate(-4deg); } 60% { transform: translateX(4%) rotate(4deg); filter: brightness(1.2); }
  80% { transform: scale(.92); filter: brightness(1.5); }
}
.smoke { position: absolute; width: 0; height: 0; z-index: 5; pointer-events: none; }
.smoke span {
  position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff 0 45%, #F4ECE2 75%, rgba(244,236,226,0) 100%);
  opacity: 0; transform: translate(0, 0) scale(.2);
  animation: smokePuff 1.4s ease-out forwards;
}
@keyframes smokePuff {
  0% { opacity: 0; transform: translate(0, 0) scale(.2); }
  18% { opacity: 1; transform: translate(calc(var(--x) * .6), calc(var(--y) * .6)) scale(1); }
  45% { opacity: 1; transform: translate(var(--x), var(--y)) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(var(--x) * 1.8), calc(var(--y) * 1.8 - 20px)) scale(1.35); }
}

/* ---------- ホーム の そら：あさ・ひる・よる（2026-11-20 代表）----------
   app.js の updateSky() が #sky に data-sky="morning／day／night" を つける（あいさつ と おなじ 時間 で：〜10時 あさ、〜17時 ひる、それ から よる） */
#app > .screen { z-index: 1; }
.sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; display: none; }
#app:has(#screen-home.active) > .sky { display: block; }
.sky[data-sky="morning"] {
  background:
    radial-gradient(circle at 24% 24%, rgba(255,214,120,.95) 0 26px, rgba(255,214,120,.35) 27px 44px, transparent 45px),
    linear-gradient(to bottom, rgba(255,190,150,.45), rgba(255,230,200,.15) 55%, transparent 80%);
}
.sky[data-sky="day"] {
  background:
    radial-gradient(circle at 84% 22%, rgba(255,226,110,1) 0 28px, rgba(255,226,110,.3) 29px 50px, transparent 51px),
    linear-gradient(to bottom, rgba(150,210,255,.4), rgba(200,235,255,.12) 55%, transparent 80%);
}
.sky[data-sky="night"] {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='160'%3E%3Cg fill='%23FFF6C8'%3E%3Ccircle cx='20' cy='30' r='1.8'/%3E%3Ccircle cx='70' cy='12' r='1.2'/%3E%3Ccircle cx='120' cy='48' r='2'/%3E%3Ccircle cx='175' cy='22' r='1.4'/%3E%3Ccircle cx='200' cy='90' r='1.6'/%3E%3Ccircle cx='45' cy='95' r='1.2'/%3E%3Ccircle cx='150' cy='120' r='1.3'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 220px 160px repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M38 6 A24 24 0 1 0 54 44 A20 20 0 1 1 38 6 Z' fill='%23FFF3B0'/%3E%3C/svg%3E") right 18% top 14% / 56px 56px no-repeat,
    radial-gradient(circle at 80% 26%, rgba(255,243,176,.22) 0 40px, transparent 60px),
    linear-gradient(to bottom, rgba(32,40,96,.78), rgba(60,64,130,.55) 60%, rgba(80,80,140,.4));
}
#app:has(.sky[data-sky="night"]) .ground { filter: brightness(.78) saturate(.9); }
/* 画面 の 外 の ふち（よこ・した の あまり）も そら の 色 に */
body[data-sky="morning"]:has(#screen-home.active) { background: #FBE9D8; }
body[data-sky="day"]:has(#screen-home.active) { background: #E3F1FB; }
body[data-sky="night"]:has(#screen-home.active) { background: #4B4F8E; }

/* ---------- あいぼう の うごき（2026-11-20 代表：A案）---------- */
.pet.m-jump .body-group { animation: mJump .9s cubic-bezier(.3,.9,.5,1); }
@keyframes mJump {
  0% { transform: none; } 18% { transform: scale(1.18, .78); }
  45% { transform: translateY(-38%) scale(.9, 1.12); } 62% { transform: translateY(-40%) scale(1); }
  82% { transform: scale(1.14, .84); } 100% { transform: none; }
}
.pet.m-hop2 .body-group { animation: mHop .5s ease-in-out 2; }
@keyframes mHop { 0%, 100% { transform: none; } 25% { transform: scale(1.08, .9); } 55% { transform: translateY(-14%) scale(.96, 1.05); } }
.pet.m-spin .body-group { animation: mSpin .9s ease-in-out; }
@keyframes mSpin {
  0% { transform: none; } 20% { transform: translateY(-10%) scale(.95, 1.05); }
  50% { transform: translateY(-14%) scaleX(-1); } 80% { transform: translateY(-4%) scaleX(1); } 100% { transform: none; }
}
.pet.m-laugh .body-group { animation: mLaugh .14s ease-in-out 8 alternate; }
@keyframes mLaugh { 0% { transform: rotate(-3deg) scale(1.03, .97); } 100% { transform: rotate(3deg) translateY(-3%) scale(.98, 1.02); } }
.pet.m-nod .body-group { animation: mNod .45s ease-in-out 2; }
@keyframes mNod { 50% { transform: rotate(4deg) scale(1.02, .95); } }
.pet.m-look .body-group { animation: mLook 1.5s ease-in-out; }
@keyframes mLook { 0%, 100% { transform: none; } 25%, 40% { transform: rotate(-7deg) translateX(-3%); } 60%, 75% { transform: rotate(7deg) translateX(3%); } }
/* まなぶ 画面 の ひだり の 列：ことば の とちゅう で 折り返さない（2026-11-20：「やりなお／す」「1 ／ 12」） */
.side-layout > .topbar .level-label, .side-layout .sub-btn, .side-layout .big-btn { word-break: keep-all; overflow-wrap: anywhere; }

/* 記録 の バックアップ（2026-11-21） */
.backup-card { max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; text-align: left; }
.backup-card .parent-title, .backup-card .parent-info, .backup-card .parent-note { margin: 0; }
.backup-card .parent-info { font-size: 13px; line-height: 1.5; }
.backup-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.backup-btns button { min-height: 48px; font-size: 14px; }
#backup-msg { min-height: 1.4em; font-weight: bold; }
#backup-close { align-self: center; }
/* ボタン が 5こ でも 2だん に おさめる（2026-11-21：「記録をとっておく」を 足して はみだした） */
.parent-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.parent-actions button { font-size: 12px; padding: 3px 4px; line-break: strict; }
.parent-actions .big-btn { font-size: 13px; }
.parent-actions .btn-note { font-size: 10px; }
/* 2026-11-21 代表：保護者メニュー の 下 が また 切れる（「感想を送る」が 出て 3だん の 字 に なった）
   → ボタン の 下 の 小さい 説明 は 出さない・ボタン を ひくく する。それでも 入らない 画面 は みぎ の 列 だけ スクロール */
.parent-actions .btn-note { display: none; }
.parent-actions button { min-height: 38px; line-height: 1.2; }
.parent-col-set { overflow-y: auto; }
.parent-col-set { padding-bottom: 3px; }
.parent-credits { font-size: 11px; color: var(--ink-soft); text-align: left; }
.parent-credits summary { cursor: pointer; font-weight: 700; padding: 2px 0; }

/* おと の ボタン（2026-11-21 代表：しらない うち に オフ に なって いた）
   ・もどる の すぐ よこ だと、もどる を おした つもり で おして しまう → あいぼう の みぎ に おく（app.js）
   ・オフ の とき は 赤い わく で めだたせる。かえた とき は 画面 の まんなか に しらせ */
.sound-btn.is-off { background: #FFE3E3; box-shadow: 0 0 0 3px #E65A5A inset; }
#sound-toast {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9);
  background: rgba(60, 45, 35, .88); color: #fff; font-size: 22px; font-weight: bold;
  padding: 12px 26px; border-radius: 999px; pointer-events: none; z-index: 9999;
  opacity: 0; transition: opacity .2s, transform .2s;
}
#sound-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* おおきく なった 日：おやつ の かわり に さそう あそび の ボタン（2026-11-24） */
.play-btn.invite { animation: invite .6s ease-in-out 4; background: #FFF1D6; }
@keyframes invite { 0%, 100% { transform: none; } 30% { transform: scale(1.1) rotate(-4deg); } 70% { transform: scale(1.1) rotate(4deg); } }

/* その日 はじめて の カレンダー（2026-11-24）：つづけた 日 を ひからせ、つぎへ で あいぼう を えらぶ */
.cal-cell.streak { background: #FFE3B0; box-shadow: inset 0 0 0 2px #F5B65A; }
#screen-calendar > .cal-go { grid-area: legend; align-self: end; justify-self: stretch; }
#screen-calendar.welcome > .cal-sum { font-size: 17px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
/* だれが あそぶ？ だけ（きょうだい の とき、ひらいて さいしょ） */
#screen-select.who-only .select-list, #screen-select.who-only .title, #screen-select.who-only .select-back { display: none; }
/* 2026-11-26 代表：3人 に すると たて に ならんで 画面 から 切れた → よこ に ならべる（かお の した に なまえ） */
#screen-select.who-only .kid-picker { flex-wrap: wrap; gap: 14px 16px; margin: 24px auto 0; max-width: 100%; }
#screen-select.who-only .kid-picker-label { font-size: 26px; flex-basis: 100%; text-align: center; margin-bottom: 4px; }
#screen-select.who-only .kid-chip { flex-direction: column; gap: 6px; font-size: 20px; padding: 12px 10px 10px; width: 170px; border-radius: 26px; }
#screen-select.who-only .kid-chip .kid-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#screen-select.who-only .kid-face, #screen-select.who-only .kid-face svg, #screen-select.who-only .kid-face img { width: 96px; height: 96px; }

/* =========================================================
   2026-11-24 無料プラン：カギ・ステージ一覧・ロック画面・プラン
   ========================================================= */
.select-card, .kid-chip { position: relative; }
.plan-locked { opacity: .55; }
.lock-badge { position: absolute; top: 4px; right: 6px; width: 40px; height: 40px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.15)); }
.study-tile .lock-badge { top: 2px; left: 3px; right: auto; width: 34px; height: 34px; }
.lock-inline { width: 1.9em; height: 1.9em; vertical-align: -.55em; }
/* 使えない タイル（無料 の にがて れんしゅう など）：色 を おとして、カギ だけ 色 を のこす */
.study-tile.plan-off { background: #F1ECE7; box-shadow: none; }
.study-tile.plan-off > :not(.lock-badge) { filter: grayscale(1); opacity: .45; }
.lock-art { position: relative; display: inline-block; }
.lock-art .lock-key { position: absolute; right: -16px; bottom: -4px; width: 68px; height: 68px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)); }
.stage-list { display: flex; flex-direction: column; gap: 8px; min-width: 260px; margin: 4px auto; }
.stage-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--card); font-size: 15px; text-align: left; }
.stage-row.open { border: 3px solid #F2B84B; }
.stage-row.locked { opacity: .6; border: 3px dashed #C9B8A8; }
.stage-row em { font-style: normal; font-size: 18px; display: flex; }
.plan-card { max-width: 820px; }
.plan-card .parent-col { gap: 8px; display: flex; flex-direction: column; overflow-y: auto; padding-bottom: 6px; }   /* 長い とき は 列 の 中 だけ スクロール */
.plan-head { padding-right: 0; flex-wrap: nowrap; }
.plan-close { width: auto !important; padding: 6px 22px; font-size: 16px; margin-left: auto; flex-shrink: 0; }
/* 2026-11-25 代表：料金 の 画面 が 保護者メニュー の うしろ に 出て いた → いつも いちばん 上 */
#plan-modal { z-index: 45; }
.plan-status { font-size: 13px; font-weight: 700; color: var(--ink-soft); background: #F6EFE8; border-radius: 999px; padding: 3px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.plan-reason { font-weight: 800; }
.plan-reason:empty { display: none; }
.plan-buy { display: flex; flex-direction: column; gap: 4px; }
.plan-buy .parent-row { display: flex; gap: 8px; }
.plan-buy .parent-row button { flex: 1; }
/* 購入済み の 方 へ の 入口（めだつ わく・つぎ の 画面 へ すすむ 形） */
.plan-verify-btn { margin-left: auto; flex-shrink: 0; padding: 6px 16px; border: 2px solid #E9A06B; border-radius: 999px; background: #FFF6EE; color: #B85E22; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.plan-verify-btn b { font-size: 17px; margin-left: 2px; }
.plan-verify-btn:not(.hidden) + .plan-close { margin-left: 0; }
#plan-modal[data-view="verify"] .plan-verify-btn { display: none; }
#plan-modal[data-view="verify"] .plan-close { margin-left: auto; }
#plan-verify .parent-note { text-align: left; }
.plan-card { width: 100%; }
/* 確認 の 画面 */
.verify-steps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 14px; line-height: 1.5; }
.verify-steps li { color: var(--ink-soft); }
.verify-steps li.now { color: var(--ink); font-weight: 700; }
.verify-steps li.now::marker { color: #E07A3A; }
.verify-box { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.verify-box label { font-weight: 800; font-size: 15px; }
.verify-box input { font-size: 18px; padding: 10px 14px; border: 2px solid #E2D5C8; border-radius: 14px; }
.verify-box input:focus { border-color: #E07A3A; outline: none; }
#verify-code { letter-spacing: .3em; font-size: 22px; }
.verify-msg { font-size: 13px; line-height: 1.5; margin: 0; text-align: left; }
.verify-msg:empty { display: none; }
.plan-card button:disabled { opacity: .45; }
.plan-safety ul { text-align: left; margin: 6px 0 0; padding-left: 1.2em; font-size: 13px; line-height: 1.55; }
.plan-safety summary { font-weight: 800; cursor: pointer; }
.parent-check { font-size: 13px; display: flex; gap: 6px; align-items: center; }
#parent-report.plan-locked::after, #parent-course-edit.plan-locked::after { content: ""; display: inline-block; width: 1.7em; height: 1.7em; margin-left: .3em; vertical-align: -.45em; background: url(img/ui/lock.svg) center / contain no-repeat; }
.cal-tap-hint { display: block; margin-top: 8px; font-size: 14px; color: #B0702A; animation: hint 1.2s ease-in-out infinite; }

/* 文字 を 入れる シート（たて の まま 出す。#app の 外 なので まわらない）2026-11-26 */
.type-sheet { position: fixed; inset: 0; z-index: 100; background: rgba(90, 70, 54, .45); display: flex; align-items: flex-start; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 14px 14px; }
.type-sheet.hidden { display: none; }
.type-card { width: 100%; max-width: 480px; background: var(--card, #fff); border-radius: 22px; padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; font-family: inherit; color: var(--ink, #5a4636); }
.type-card label { font-weight: 800; font-size: 16px; }
.type-card input { font-size: 18px; padding: 12px 14px; border: 2px solid #E07A3A; border-radius: 14px; width: 100%; box-sizing: border-box; font-family: inherit; }
.type-card input:focus { outline: none; }
.type-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft, #8a7563); }
.type-note:empty { display: none; }
.type-row { display: flex; gap: 10px; }
.type-row .sub-btn { flex: 0 0 auto; padding: 10px 18px; }
.type-row .big-btn { flex: 1; margin: 0; font-size: 17px; padding: 12px 10px; white-space: nowrap; }
.type-row .sub-btn { font-size: 15px; border-radius: 999px; }
#screen-select.who-only .kid-face-empty { width: 80px; height: 80px; font-size: 40px; }

/* ---- トライアル の まとめ「3日間のようす」（2026-11-26 代表）：ひだり に あいぼう と ボタン、みぎ に まとめ ---- */
#screen-trial.active { display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 14px; }
.trial-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.trial-pet-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, #FFF6D8 0, #FFF6D8 55%, transparent 72%); }
.trial-pet { width: 100%; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.trial-pet img, .trial-pet svg { max-width: 100%; max-height: 100%; animation: trialbob 2.4s ease-in-out infinite; }
@keyframes trialbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.trial-pet-note { margin: 0; font-size: 14px; font-weight: 800; text-align: center; white-space: nowrap; }
.trial-pet-note b { color: var(--accent-dark); font-size: 20px; }
.trial-side .big-btn { font-size: 18px; min-height: 52px; padding: 8px 6px; }
.trial-side .sub-btn { font-size: 15px; min-height: 44px; padding: 6px; }
.trial-main { display: flex; flex-direction: column; min-height: 0; }
.trial-lead { margin: 2px 0 8px; font-size: 17px; }
#trial-body { columns: auto; }
.trial-nums { margin-bottom: 10px; }
.trial-grow { background: #FFF3DC; }
.trial-next { border: 3px solid #F6B26B; }
.trial-next dd b { color: var(--accent-dark); }
.plan-card #plan-trial-summary { margin-bottom: 8px; }

/* ---- 買って くれた 人 へ の ありがとう（2026-11-26 代表） ---- */
#thanks-modal { z-index: 46; }
.thanks-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: center; width: 100%; max-width: 720px; text-align: left; }
.thanks-left { text-align: center; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.thanks-right { position: relative; z-index: 1; min-height: 0; overflow-y: auto; max-height: 100%; }
.thanks-pets { display: flex; justify-content: center; align-items: flex-end; }
.thanks-pet { width: 86px; height: 96px; margin: 0 -8px; display: flex; align-items: flex-end; justify-content: center; animation: thanksjump 1.4s ease-in-out infinite; }
.thanks-pet:nth-child(2) { width: 100px; height: 112px; animation-delay: .2s; z-index: 1; }
.thanks-pet:nth-child(3) { animation-delay: .4s; }
.thanks-pet img, .thanks-pet svg { max-width: 100%; max-height: 100%; }
@keyframes thanksjump { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-12px); } }
.thanks-title { font-size: 22px; font-weight: 900; color: var(--accent-dark); margin: 2px 0 4px; line-height: 1.3; word-break: keep-all; }
.thanks-left .big-btn { font-size: 18px; min-height: 50px; }
.thanks-left .sub-btn { min-height: 42px; }
.thanks-sub { font-weight: 800; margin: 0 0 6px; }
.thanks-list { margin: 0 0 8px; padding: 0; list-style: none; font-size: 15px; line-height: 1.7; font-weight: 700; }
.thanks-list li::before { content: "✓ "; color: #3BA55C; font-weight: 900; }
.thanks-letter { font-size: 13px; line-height: 1.65; background: #FFF6E5; border-radius: 14px; padding: 8px 12px; margin: 0 0 10px; }
.thanks-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.thanks-confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; opacity: .85; animation: thanksfall 3s linear 2 forwards; }
@keyframes thanksfall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(420px) rotate(540deg); opacity: 0; } }
.thanks-pets.kid .thanks-pet { width: 90px; height: 100px; }
.thanks-letter .nobr { white-space: nowrap; }

/* ---- アプリ の 中 の チャット（2026-11-26 代表） ---- */
#chat-modal { z-index: 47; }
.chat-card { width: 100%; max-width: 720px; height: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.chat-sub { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-left: 4px; }
.chat-card .parent-head .plan-close { margin-left: auto; }
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 4px; background: #FFF8EE; border-radius: 14px; }
.chat-msg { max-width: 80%; padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.chat-msg small { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.chat-msg.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.chat-msg.me { align-self: flex-end; background: #FFE2C7; border-bottom-right-radius: 4px; }
.chat-status { align-self: center; font-size: 12px; color: var(--ink-soft); margin: 0; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; font-size: 16px; padding: 10px 12px; border: 2px solid #EADBC6; border-radius: 14px; }
.chat-form .big-btn { flex: none; min-height: 46px; padding: 6px 22px; font-size: 17px; }
/* 運営 から お返事 が 来た とき：はぐるま に 赤い 点 */
.parent-gate { position: relative; }
/* お返事 が 来たら：はぐるま の 下 に 赤い「💬 お返事」の ふだ（2026-11-27 代表：赤い 点 だけ では 気づかない） */
.parent-gate.has-reply::before { content: "💬 お返事"; position: absolute; z-index: 3; top: calc(100% - 6px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-weight: 800; line-height: 1; color: #fff; background: #E5534B; border: 2px solid #fff;
  border-radius: 99px; padding: 3px 7px; box-shadow: 0 2px 4px #0003; pointer-events: none; animation: replyPulse 1.6s ease-in-out infinite; }
@keyframes replyPulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.1); } }
/* 保護者メニュー の チャット の ボタン：お返事 が ある あいだ は 赤く して「お返事が／届きました」（文字 は chat.js） */
#parent-chat.has-reply { background: #E5534B; box-shadow: 0 4px 0 #B83B34; animation: replyPulse2 1.6s ease-in-out infinite; }
@keyframes replyPulse2 { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
#parent-chat.has-reply .btn-note { color: #E5534B; font-weight: 800; }
.chat-form .big-btn { width: auto; margin: 0; }
.chat-form input { width: auto; flex: 1 1 auto; }
.chat-card .parent-head { display: flex; align-items: center; width: 100%; }
.chat-card .parent-head .parent-title { margin: 0; }

/* 保護者メニュー の ボタン：ことば の とちゅう で 切らない（2026-11-27 代表）。.nw の まとまり ごと に だけ 改行 */
.nw { display: inline-block; white-space: nowrap; }
.btn-ico { width: 1.25em; height: 1.25em; vertical-align: -0.25em; margin-right: 4px; flex: none; }
/* チャット の ボタン：吹き出し を 2行 ぶん の 高さ に（2026-11-27 代表） */
#parent-chat:not(.hidden) { display: flex; align-items: center; justify-content: center; gap: 6px; }
#parent-chat .btn-ico { width: 2.4em; height: 2.4em; margin: 0; vertical-align: 0; }
#parent-chat .btn-txt { text-align: center; }
#parent-chat .btn-txt .nw { display: block; }   /* 「チャットで／送る」の 2行 に して、吹き出し と 高さ を そろえる */
/* マーク と 文字 を ボタン の まんなか に よせる（2026-11-27 代表）：文字 を 少し 小さく・すきま を つめて、左右 に 余白 を とる */
#parent-chat:not(.hidden) { gap: 3px; padding-left: 8px; padding-right: 8px; }
#parent-chat .btn-txt { font-size: .9em; line-height: 1.2; }
#parent-chat .btn-ico { width: 2.2em; height: 2.2em; }

/* ===== 2026-11-28 代表 の 直し ===== */
/* ものがたり：おてほん の ボタン を 大きく */
.side-layout > .story-tools #btn-story-along { font-size: 20px; min-height: 64px; font-weight: 800; }
#btn-story-along .btn-icon { width: 28px; height: 28px; }
/* とけい：なんじ に すれば いい か を 大きく */
.clock-side { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.clock-goal { background: #fff; border: 4px solid #F08A4B; border-radius: 20px; padding: 8px 18px 10px; text-align: center; box-shadow: 0 4px 0 #F3C9A6; }
.clock-goal-cap { display: block; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.clock-goal b { display: block; font-size: 50px; line-height: 1.1; font-weight: 900; color: #E8604C; letter-spacing: 1px; }
.clock-goal.ok { border-color: #6CC28A; box-shadow: 0 4px 0 #BFE5CB; }
.clock-goal.ok b { color: #3E9E63; }
.clock-legend { flex-direction: column; gap: 4px; }
/* おてほん なしで かく：かけた 字 の カード */
.free-done { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; background: #fff; border: 4px solid #FFD27A;
  border-radius: 24px; padding: 10px 18px 12px; box-shadow: 0 8px 24px #0003; text-align: center; animation: freeDonePop .5s cubic-bezier(.2,1.5,.4,1) both; }
.free-done-ink { width: 190px; height: 190px; display: block; }
.free-done-cap { font-size: 20px; font-weight: 800; color: var(--ink); }
.free-done-cap b { font-size: 26px; color: #E8604C; }
.free-done-mark { position: absolute; right: -14px; top: -18px; width: 74px; height: 74px; font-size: 54px; font-weight: 900; color: #E8604C; line-height: 74px; }
.free-done-mark svg { width: 100%; height: 100%; }
@keyframes freeDonePop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.game-free { position: relative; }
/* せんかき：ゴール の 絵 が ぴょん */
.line-pics .line-goal { transform-box: fill-box; transform-origin: center; }
.line-pics .line-goal.arrived { animation: lineGoal .7s ease-out 2; }
@keyframes lineGoal { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.3); } }

/* ---------- ホーム画面に追加してね の 案内（2026-11-28 代表。install-guide.js） ---------- */
#install-modal { z-index: 45; padding: 6px; }
.install-card { max-width: 740px; max-height: calc(100% - 4px); display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; text-align: left; word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
.install-card p { margin: 0; }
.install-head { display: flex; align-items: center; gap: 10px; }
.install-tag { flex-shrink: 0; font-size: 11px; font-weight: 800; color: #fff; background: var(--accent-dark); border-radius: 999px; padding: 3px 10px; }
.install-head .parent-title { font-size: 17px; }
.install-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
.install-why { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; }
.install-point { font-size: 12px; line-height: 1.45; color: var(--ink-soft); padding-left: 22px; position: relative; }
.install-point::before { content: "✓"; position: absolute; left: 2px; top: -1px; font-size: 15px; font-weight: 800; color: #1E8E5A; }
.install-point b { display: block; font-size: 14px; color: var(--ink); }
.install-warn { font-size: 12px; line-height: 1.5; background: #FFF1E3; border: 2px solid #FFC79E; border-radius: 12px; padding: 7px 10px; color: var(--ink); }
.install-warn b { display: block; font-size: 13.5px; color: #C0503A; margin-bottom: 2px; }
.install-move { font-size: 11px; line-height: 1.45; color: var(--ink-soft); }
.install-how { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.install-tabs { display: flex; gap: 6px; }
.install-tabs button { flex: 1; font: inherit; font-size: 13px; font-weight: 800; color: var(--ink-soft); background: #F6F0E8; border: 2px solid transparent; border-radius: 999px; padding: 5px 8px; }
.install-tabs button.on { color: var(--ink); background: var(--card); border-color: var(--accent); }
.install-steps { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.install-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: #FBF7F1; border: 2px solid #EADBC6; border-radius: 14px; padding: 8px 6px 7px; text-align: center; }
.install-num { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.install-pic { width: 100%; height: 50px; display: grid; place-items: center; }
.install-pic svg { width: 48px; height: 48px; }
.install-pic img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }
.install-txt { font-size: 12px; line-height: 1.45; color: var(--ink); }
.install-txt b { color: var(--accent-dark); }
.install-txt small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--ink-soft); }
.install-steps:has(.install-one) { display: flex; flex: 1; }
.install-one { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #FBF7F1; border: 2px solid #EADBC6; border-radius: 14px; padding: 12px; text-align: center; font-size: 13px; line-height: 1.5; }
.install-one .big-btn { font-size: 18px; padding: 10px 28px; min-height: 52px; }
.install-extra:empty { display: none; }
.install-extra { display: flex; justify-content: center; }
.install-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 14px; padding: 20px 0; }
.install-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.install-foot .parent-note { flex: 1; font-size: 11px; color: var(--ink-soft); }
.install-foot .sub-btn { min-height: 42px; padding: 6px 28px; font-size: 15px; }
/* 保護者メニュー の ひだり うえ（ブラウザ で 開いて いる とき だけ） */
.parent-install-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: #C0503A; background: #FFF1E3; border-radius: 10px; padding: 4px 8px; }
.parent-install-row.hidden { display: none; }
.parent-install-row .sub-btn { min-height: 32px; padding: 3px 12px; font-size: 12px; }
.install-pic svg.wide { width: 80px; }
