/* かけざん探検隊 — 密林緑×バナナの黄×インコの赤。木の看板と、押しこめる厚いボタン */
:root {
  --jungle: #0d3b2a;
  --jungle2: #12513a;
  --leaf: #1f7a3f;
  --moss: #5aa14b;
  --banana: #ffd23f;
  --banana-deep: #e0a800;
  --macaw: #d7263d;
  --macaw-deep: #8e1222;
  --wood: #6b3f1d;
  --wood-deep: #47270f;
  --paper: #fff7dc;
  --ink: #1b1a12;
  --ink2: #4a4630;
  --f-pop: "Mochiy Pop One", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --f-body: "Kiwi Maru", "Hiragino Maru Gothic ProN", "Yu Gothic", serif;
  --r-btn: 22px;
  --r-card: 26px;
  --spring: cubic-bezier(.2, 1.5, .4, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--jungle);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px; line-height: 1.6;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.kp, .kid, .kid p, .kid li { word-break: keep-all; overflow-wrap: normal; }
.nw { white-space: nowrap; }
.pop { font-family: var(--f-pop); font-weight: 400; }
.noscript { color: #fff; padding: 40px 24px; }

.device { position: relative; height: 100dvh; max-width: 430px; margin: 0 auto; overflow: hidden; background: var(--jungle); }
@media (min-width: 600px) {
  body {
    background:
      radial-gradient(circle at 12% 20%, rgba(90, 161, 75, .35) 0 60px, transparent 61px),
      radial-gradient(circle at 88% 70%, rgba(90, 161, 75, .3) 0 90px, transparent 91px),
      radial-gradient(circle at 70% 8%, rgba(255, 210, 63, .18) 0 40px, transparent 41px),
      #0a2e21;
  }
  .device { box-shadow: 0 0 0 6px #08241a, 0 30px 80px rgba(0, 0, 0, .5); }
}
.stage { position: absolute; inset: 0; }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.scr.is-in { animation: scrIn .32s cubic-bezier(.2, .8, .2, 1) both; }
.scr.is-out { animation: scrOut .22s ease-in both; pointer-events: none; }
@keyframes scrIn { from { opacity: 0; transform: scale(1.04); } }
@keyframes scrOut { to { opacity: 0; transform: scale(.97); } }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }

/* ---------- 葉っぱの地紋 ---------- */
.leafy {
  background-color: var(--jungle);
  background-image:
    radial-gradient(ellipse 60px 26px at 20% 12%, rgba(90, 161, 75, .22) 98%, transparent 100%),
    radial-gradient(ellipse 70px 30px at 84% 30%, rgba(31, 122, 63, .45) 98%, transparent 100%),
    radial-gradient(ellipse 50px 22px at 10% 64%, rgba(31, 122, 63, .4) 98%, transparent 100%),
    radial-gradient(ellipse 80px 32px at 90% 86%, rgba(90, 161, 75, .2) 98%, transparent 100%);
  background-size: 260px 300px;
}

/* ---------- 厚いボタン ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 24px; border: 0; border-radius: var(--r-btn);
  font-family: var(--f-pop); font-size: 20px; letter-spacing: .04em; text-decoration: none;
  background: var(--banana); color: var(--ink);
  box-shadow: 0 6px 0 var(--banana-deep), 0 10px 18px rgba(0, 0, 0, .25);
  transition: transform 80ms, box-shadow 80ms;
  word-break: keep-all;
}
.btn:active, .btn.is-press { transform: translateY(5px); box-shadow: 0 1px 0 var(--banana-deep), 0 3px 8px rgba(0, 0, 0, .25); }
.btn svg { width: 24px; height: 24px; flex: none; }
.btn--block { width: 100%; }
.btn--green { background: var(--moss); color: #0b2418; box-shadow: 0 6px 0 #2f6b27, 0 10px 18px rgba(0, 0, 0, .25); }
.btn--green:active { box-shadow: 0 1px 0 #2f6b27; }
.btn--red { background: var(--macaw); color: #fff; box-shadow: 0 6px 0 var(--macaw-deep), 0 10px 18px rgba(0, 0, 0, .25); }
.btn--red:active { box-shadow: 0 1px 0 var(--macaw-deep); }
.btn--paper { background: var(--paper); color: var(--ink); box-shadow: 0 6px 0 #c9b98a, 0 10px 18px rgba(0, 0, 0, .2); }
.btn--paper:active { box-shadow: 0 1px 0 #c9b98a; }
.btn--sm { min-height: 50px; font-size: 17px; padding: 0 16px; }
.icon-btn {
  width: 48px; height: 48px; flex: none; border: 0; border-radius: 16px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  background: var(--paper); color: var(--wood-deep);
  box-shadow: 0 4px 0 #c9b98a, 0 6px 12px rgba(0, 0, 0, .25);
  transition: transform 80ms, box-shadow 80ms;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c9b98a; }
.icon-btn svg { width: 26px; height: 26px; }

/* ---------- 木の看板 ---------- */
.sign {
  position: relative; background: var(--wood); color: #fff;
  border-radius: 18px; border: 3px solid var(--wood-deep);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .12), inset 0 -4px 0 rgba(0, 0, 0, .2), 0 8px 18px rgba(0, 0, 0, .35);
  background-image: repeating-linear-gradient(176deg, rgba(0, 0, 0, .08) 0 3px, transparent 3px 14px);
}
.plate { background: var(--paper); color: var(--ink); border-radius: 20px; box-shadow: 0 6px 0 #c9b98a, 0 10px 20px rgba(0, 0, 0, .25); }

/* ---------- 上のバー（HUD） ---------- */
.hud {
  position: relative; z-index: 3; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 12px 10px;
}
.hud__title { flex: 1; margin: 0; font-family: var(--f-pop); font-size: 20px; color: #fff; text-align: center; word-break: keep-all; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 20px;
  background: rgba(0, 0, 0, .42); color: #fff; font-family: var(--f-pop); font-size: 16px; white-space: nowrap;
}
.pill svg { width: 22px; height: 22px; color: var(--banana); }

/* ---------- タイトル ---------- */
.scr--title { background-size: cover; background-position: 50% 30%; background-color: var(--leaf); }
.title-top { position: relative; padding: calc(14px + var(--safe-t)) 14px 0; display: flex; justify-content: flex-end; gap: 8px; }
.logo { margin: 12px auto 0; width: min(330px, 88%); text-align: center; padding: 14px 10px 16px; transform: rotate(-2deg); animation: logoIn .8s var(--spring) both; }
.logo::before, .logo::after { content: ""; position: absolute; top: -26px; width: 8px; height: 30px; background: #3a2410; border-radius: 3px; }
.logo::before { left: 26%; }
.logo::after { right: 26%; }
.logo__sub { display: block; font-family: var(--f-pop); font-size: 15px; color: var(--banana); letter-spacing: .3em; }
.logo__main { display: block; margin-top: 2px; font-family: var(--f-pop); font-size: clamp(30px, 10.4vw, 42px); white-space: nowrap; line-height: 1.1; color: #fff; letter-spacing: .02em; }
.logo__main b { font-weight: 400; color: var(--banana); }
@keyframes logoIn { from { transform: translateY(-80px) rotate(-8deg); opacity: 0; } }
.title-panel {
  margin-top: auto; padding: 20px 18px calc(18px + var(--safe-b)); border-radius: 32px 32px 0 0;
  background: var(--jungle); box-shadow: 0 -10px 30px rgba(0, 0, 0, .3);
  display: grid; gap: 14px;
}
.title-panel__stat { margin: 0; text-align: center; color: #fff; font-size: 15px; }
.title-panel__stat b { font-family: var(--f-pop); font-weight: 400; color: var(--banana); }
.title-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 74px; border: 0; border-radius: 20px; padding: 6px 4px; text-decoration: none;
  background: var(--jungle2); color: #fff; font-size: 14px; font-weight: 500; line-height: 1.3;
  box-shadow: 0 5px 0 #072117; transition: transform 80ms, box-shadow 80ms; word-break: keep-all; text-align: center;
}
.tbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 #072117; }
.tbtn svg { width: 28px; height: 28px; color: var(--banana); }

/* ---------- ぼうけん地図 ---------- */
.scr--map { background-color: var(--jungle); }
.map-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding-bottom: calc(96px + var(--safe-b)); display: flex; flex-direction: column; }
.map { flex: none; margin-top: auto; position: relative; left: 50%; transform: translateX(-50%); width: max(100%, calc((100dvh - 170px - var(--safe-t) - var(--safe-b)) / 1.5)); aspect-ratio: 780 / 1170; background-size: 100% 100%; background-color: var(--leaf); }
.map__trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.node {
  position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 0; border: 0; background: none;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.node__disc {
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--banana); color: var(--ink); border: 4px solid var(--wood-deep);
  font-family: var(--f-pop); font-size: 24px;
  box-shadow: 0 5px 0 var(--wood-deep), 0 8px 14px rgba(0, 0, 0, .35);
  transition: transform .12s;
}
.node:active .node__disc { transform: translateY(3px) scale(.96); }
.node.is-clear .node__disc { background: var(--paper); }
.node.is-lock .node__disc { background: #8b8f86; color: #2a2c27; border-color: #3d4039; box-shadow: 0 5px 0 #3d4039; }
.node.is-lock .node__disc svg { width: 26px; height: 26px; }
.node.is-cur .node__disc { animation: pulse 1.6s ease-in-out infinite; }
.node.is-final .node__disc { width: 66px; height: 66px; background: var(--macaw); color: #fff; }
@keyframes pulse { 0%, 100% { box-shadow: 0 5px 0 var(--wood-deep), 0 0 0 0 rgba(255, 210, 63, .9); } 50% { box-shadow: 0 5px 0 var(--wood-deep), 0 0 0 14px rgba(255, 210, 63, 0); } }
.node__label {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%);
  padding: 1px 9px 2px; border-radius: 10px; background: var(--wood-deep); color: #fff;
  font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 1.5;
}
.node__stars { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); display: flex; gap: 0; padding: 1px 5px; border-radius: 10px; background: var(--wood-deep); }
.node__stars svg { width: 15px; height: 15px; color: #6f6a55; }
.node__stars svg.on { color: var(--banana); }
.me {
  position: absolute; z-index: 3; width: 52px; height: 52px; margin: -104px 0 0 -26px; border-radius: 50%; overflow: hidden;
  border: 3px solid #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, .4); pointer-events: none;
  animation: bob 1.4s ease-in-out infinite;
}
.me img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.5); transform-origin: 50% 20%; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.dock {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 14px 14px calc(14px + var(--safe-b)); border-radius: 28px 28px 0 0;
  background: var(--jungle); box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center;
}
.dock .btn { min-height: 58px; font-size: 18px; padding: 0 12px; }
.dock .btn small { font-family: var(--f-body); font-size: 13px; display: block; line-height: 1.2; }

/* ---------- ステージのシート ---------- */
.layer { position: absolute; inset: 0; z-index: 50; }
.dim { position: absolute; inset: 0; background: rgba(3, 18, 12, .62); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.panel {
  position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b));
  max-height: calc(100% - 40px); overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 18px 20px; border-radius: 30px; background: var(--paper);
  box-shadow: 0 -4px 40px rgba(0, 0, 0, .4); animation: panelIn .42s var(--spring) both;
}
.panel.is-center { top: 50%; bottom: auto; transform: translateY(-50%); animation: popIn .38s var(--spring) both; }
@keyframes panelIn { from { transform: translateY(110%); } }
@keyframes popIn { from { opacity: 0; transform: translateY(-50%) scale(.85); } }
.panel__close { position: absolute; top: 12px; right: 12px; }
.st-head { display: flex; gap: 14px; align-items: center; padding-right: 46px; }
.st-pic { flex: none; width: 92px; height: 92px; border-radius: 22px; overflow: hidden; background: var(--leaf); box-shadow: inset 0 0 0 3px var(--wood-deep); }
.st-pic img { width: 100%; height: 100%; object-fit: cover; }
.st-pic.is-unknown { display: flex; align-items: center; justify-content: center; color: var(--moss); background: var(--jungle2); }
.st-pic.is-unknown svg { width: 54px; height: 54px; }
.st-kicker { margin: 0; font-size: 14px; color: var(--ink2); font-weight: 500; }
.st-name { margin: 0; font-family: var(--f-pop); font-size: 24px; line-height: 1.3; word-break: keep-all; }
.st-stars { display: flex; gap: 2px; margin-top: 4px; }
.st-stars svg { width: 26px; height: 26px; color: #cfc6a4; }
.st-stars svg.on { color: var(--banana); }
.st-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.st-info div { padding: 10px 12px; border-radius: 16px; background: #f3e8c2; }
.st-info dt { font-size: 13px; color: var(--ink2); font-weight: 500; }
.st-info dd { margin: 0; font-family: var(--f-pop); font-size: 20px; }
.st-note { margin: -4px 0 14px; font-size: 15px; color: var(--ink2); word-break: normal; }

/* ---------- プレイ ---------- */
.scr--play { background-size: cover; background-position: 50% 60%; background-color: var(--leaf); }
.scr--play::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(13, 59, 42, .82), rgba(13, 59, 42, .55) 40%, rgba(13, 59, 42, .9)); }
.scr--play > * { position: relative; }
.hud--play { gap: 8px; }
.hearts { display: flex; gap: 2px; padding: 4px 10px; border-radius: 20px; background: rgba(0, 0, 0, .42); }
.hearts svg { width: 28px; height: 28px; color: var(--macaw); transition: transform .3s var(--spring); }
.hearts svg.lost { color: #3b3f39; transform: scale(.8); }
.hearts svg.lost use { opacity: .7; }
.score { margin-left: auto; }
.timer { flex: none; margin: 2px 14px 0; height: 16px; border-radius: 8px; background: rgba(0, 0, 0, .45); overflow: hidden; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
.timer i { display: block; height: 100%; width: 100%; border-radius: 8px; background: var(--banana); transform-origin: 0 50%; }
.timer.is-low i { background: var(--macaw); }
.trail { flex: none; position: relative; margin: 14px 18px 0; height: 46px; }
.trail__line { position: absolute; left: 10px; right: 30px; top: 22px; height: 4px; border-radius: 2px; background: repeating-linear-gradient(90deg, rgba(255, 247, 220, .45) 0 8px, transparent 8px 14px); }
.trail__dot { position: absolute; top: 15px; width: 18px; height: 18px; margin-left: -9px; color: rgba(255, 247, 220, .35); }
.trail__dot svg { width: 18px; height: 18px; }
.trail__dot.is-ok { color: var(--banana); }
.trail__dot.is-ng { color: var(--macaw); }
.trail__me { position: absolute; top: -6px; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; transition: left .45s var(--spring); box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.trail__me img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.5); transform-origin: 50% 20%; }
.trail__goal { position: absolute; right: 0; top: 4px; width: 38px; height: 38px; }
.qwrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 16px; min-height: 0; }
.qmeta { margin: 0 0 10px; padding: 2px 14px; border-radius: 12px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 15px; font-weight: 500; white-space: nowrap; }
.qsign { width: 100%; max-width: 340px; padding: 18px 10px 20px; text-align: center; }
.qsign::before, .qsign::after { content: ""; position: absolute; bottom: -34px; width: 12px; height: 34px; background: var(--wood-deep); border-radius: 0 0 4px 4px; z-index: -1; }
.qsign::before { left: 22%; }
.qsign::after { right: 22%; }
.qtext { margin: 0; font-family: var(--f-pop); font-size: 62px; line-height: 1.05; color: #fff; white-space: nowrap; text-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.qtext .op { color: var(--banana); font-size: .8em; margin: 0 .12em; }
.qtext .ans { display: inline-block; min-width: 1.3em; color: var(--banana); }
.qsign.is-ok { animation: okPop .5s var(--spring); }
.qsign.is-ng { animation: shake .45s; }
@keyframes okPop { 40% { transform: scale(1.1) rotate(-2deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.yomi { margin: 26px 0 0; min-height: 50px; text-align: center; }
.yomi span { display: inline-block; padding: 6px 16px; border-radius: 16px; background: var(--paper); color: var(--ink); font-size: 19px; font-weight: 500; letter-spacing: .06em; animation: popIn2 .35s var(--spring) both; }
.yomi span.is-ng { background: #ffe0e3; color: var(--macaw-deep); }
@keyframes popIn2 { from { transform: scale(.6); opacity: 0; } }
.answers { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 10px 16px calc(18px + var(--safe-b)); }
.ans-btn {
  min-height: 82px; border: 0; border-radius: 24px; padding: 0;
  background: var(--paper); color: var(--ink); font-family: var(--f-pop); font-size: 40px;
  box-shadow: 0 7px 0 #c9b98a, 0 10px 18px rgba(0, 0, 0, .3);
  transition: transform 70ms, box-shadow 70ms, background-color .15s;
  touch-action: manipulation;
}
.ans-btn:active, .ans-btn.is-press { transform: translateY(6px); box-shadow: 0 1px 0 #c9b98a; }
.ans-btn.is-ok { background: var(--moss); color: #0b2418; box-shadow: 0 7px 0 #2f6b27; }
.ans-btn.is-ng { background: var(--macaw); color: #fff; box-shadow: 0 7px 0 var(--macaw-deep); }
.ans-btn.is-dim { opacity: .45; }
.ans-btn[disabled] { cursor: default; }
.burst { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.burst i { position: absolute; width: 14px; height: 14px; color: var(--banana); animation: burst .7s ease-out forwards; }
.burst i svg { width: 100%; height: 100%; }
@keyframes burst { from { transform: translate(0, 0) scale(.4); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(1.2) rotate(140deg); opacity: 0; } }
.combo { position: absolute; left: 50%; top: 36%; transform: translateX(-50%); z-index: 5; padding: 4px 16px; border-radius: 16px; background: var(--macaw); color: #fff; font-family: var(--f-pop); font-size: 22px; white-space: nowrap; animation: comboUp .9s ease-out forwards; pointer-events: none; }
@keyframes comboUp { from { transform: translate(-50%, 20px) scale(.6); opacity: 0; } 25% { transform: translate(-50%, 0) scale(1.1); opacity: 1; } to { transform: translate(-50%, -30px); opacity: 0; } }
.demo-band {
  position: absolute; left: 14px; right: 14px; bottom: calc(232px + var(--safe-b)); z-index: 6;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; border: 0; border-radius: 26px; background: var(--macaw); color: #fff;
  font-family: var(--f-pop); font-size: 17px; box-shadow: 0 6px 0 var(--macaw-deep), 0 10px 20px rgba(0, 0, 0, .35);
  animation: demoBlink 1.6s ease-in-out infinite;
}
.demo-band svg { width: 22px; height: 22px; }
@keyframes demoBlink { 50% { transform: scale(1.03); } }
.count { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(3, 18, 12, .55); }
.count span { font-family: var(--f-pop); font-size: 120px; color: var(--banana); text-shadow: 0 6px 0 rgba(0, 0, 0, .4); animation: countIn .6s var(--spring) both; }
@keyframes countIn { from { transform: scale(2.2); opacity: 0; } }

/* ポーズ */
.pause h2 { margin: 0 0 4px; font-family: var(--f-pop); font-size: 30px; text-align: center; }
.pause p { margin: 0 0 18px; text-align: center; color: var(--ink2); font-size: 15px; }
.pause .btns { display: grid; gap: 16px; }

/* ---------- リザルト ---------- */
.scr--result { background: radial-gradient(circle at 50% 18%, #2b8a4a, var(--jungle) 62%); }
.result-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: calc(12px + var(--safe-t)) 16px calc(22px + var(--safe-b)); }
.ribbon { position: relative; margin: 6px auto 0; width: fit-content; padding: 8px 34px; background: var(--macaw); color: #fff; font-family: var(--f-pop); font-size: 30px; border-radius: 10px; box-shadow: 0 6px 0 var(--macaw-deep); white-space: nowrap; animation: ribbonIn .6s var(--spring) both; }
.ribbon.is-fail { background: #5d6a5f; box-shadow: 0 6px 0 #353d37; }
@keyframes ribbonIn { from { transform: scale(.3) rotate(-10deg); opacity: 0; } }
.r-sub { margin: 10px 0 0; text-align: center; color: #fff; font-size: 16px; }
.r-stars { display: flex; justify-content: center; gap: 6px; margin: 12px 0 0; }
.r-stars svg { width: 58px; height: 58px; color: #305b45; animation: starIn .5s var(--spring) both; }
.r-stars svg.on { color: var(--banana); }
.r-stars svg:nth-child(2) { animation-delay: .15s; transform: translateY(-10px); }
.r-stars svg:nth-child(3) { animation-delay: .3s; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.r-hero { margin: 14px auto 0; width: 200px; height: 200px; border-radius: 34px; overflow: hidden; border: 5px solid var(--paper); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.r-hero img { width: 100%; height: 100%; object-fit: cover; }
.r-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 0; }
.r-grid div { padding: 10px 6px; border-radius: 18px; background: var(--paper); text-align: center; }
.r-grid dt { font-size: 13px; color: var(--ink2); font-weight: 500; }
.r-grid dd { margin: 0; font-family: var(--f-pop); font-size: 22px; white-space: nowrap; }
.r-best { display: block; margin: 2px auto 0; width: fit-content; padding: 0 8px; border-radius: 8px; background: var(--macaw); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; }
.r-box { margin: 16px 0 0; padding: 16px; border-radius: 24px; background: var(--paper); }
.r-box h3 { margin: 0 0 8px; font-family: var(--f-pop); font-size: 18px; font-weight: 400; word-break: keep-all; }
.miss { list-style: none; margin: 0; padding: 0; }
.miss li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 8px 0; }
.miss li + li { border-top: 2px dotted #e2d4a7; }
.miss__q { grid-row: 1 / 3; font-family: var(--f-pop); font-size: 24px; white-space: nowrap; }
.miss__y { font-size: 16px; font-weight: 500; color: var(--leaf); word-break: keep-all; }
.miss__g { font-size: 13px; color: var(--macaw-deep); white-space: nowrap; }
.newpal { display: flex; align-items: center; gap: 14px; }
.newpal img { width: 84px; height: 84px; border-radius: 20px; object-fit: cover; flex: none; animation: starIn .6s var(--spring) .4s both; }
.newpal p { margin: 0; font-size: 15px; color: var(--ink2); word-break: normal; }
.newpal b { display: block; font-family: var(--f-pop); font-weight: 400; font-size: 20px; color: var(--ink); }
.r-btns { display: grid; gap: 16px; margin: 20px 0 0; }
.r-btns .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sample-note { margin: 12px 0 0; text-align: center; font-size: 14px; color: #e9f5e7; }

/* ---------- ずかん ---------- */
.scr--zukan { background-color: var(--jungle); }
.z-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px calc(24px + var(--safe-b)); }
.z-count { margin: 0 0 12px; text-align: center; color: #fff; font-size: 15px; }
.z-count b { font-family: var(--f-pop); font-weight: 400; color: var(--banana); font-size: 22px; }
.z-bar { height: 12px; border-radius: 6px; background: rgba(0, 0, 0, .35); overflow: hidden; margin: 0 20px 16px; }
.z-bar i { display: block; height: 100%; background: var(--banana); border-radius: 6px; }
.z-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zcard { position: relative; padding: 0 0 10px; border: 0; border-radius: 24px; overflow: hidden; background: var(--paper); text-align: center; box-shadow: 0 5px 0 #c9b98a; transition: transform 80ms; }
.zcard:active { transform: translateY(3px); }
.zcard img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.zcard__no { position: absolute; left: 8px; top: 8px; padding: 0 8px; border-radius: 10px; background: var(--wood-deep); color: #fff; font-size: 13px; font-weight: 500; }
.zcard__name { display: block; margin-top: 8px; font-family: var(--f-pop); font-size: 16px; word-break: keep-all; }
.zcard__where { display: block; font-size: 13px; color: var(--ink2); }
.zcard.is-lock { background: var(--jungle2); box-shadow: 0 5px 0 #072117; }
.zcard.is-lock .zcard__name { color: #fff; }
.zcard.is-lock .zcard__where { color: #cfe5cf; }
.zlock { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: var(--moss); background: repeating-linear-gradient(45deg, #0f4733 0 12px, #11503a 12px 24px); }
.zlock svg { width: 60px; height: 60px; }
.zdetail img { width: 100%; height: auto; max-height: 52vh; border-radius: 22px; aspect-ratio: 1; object-fit: cover; }
.zdetail h2 { margin: 12px 0 2px; font-family: var(--f-pop); font-size: 26px; font-weight: 400; }
.zdetail p { margin: 0; font-size: 17px; line-height: 1.8; word-break: normal; }
.zdetail .where { font-size: 14px; color: var(--ink2); margin-bottom: 6px; }

/* ---------- おうちのかたへ（大人向け） ---------- */
.scr--parent { background: #f6f1df; color: var(--ink); }
.scr--parent .hud { background: var(--jungle); }
.p-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 calc(30px + var(--safe-b)); font-size: 15px; }
.p-hero { position: relative; height: 150px; background-size: cover; background-position: 50% 40%; }
.p-hero h2 { position: absolute; left: 16px; bottom: 12px; margin: 0; padding: 4px 12px; border-radius: 10px; background: var(--paper); font-family: var(--f-pop); font-weight: 400; font-size: 18px; }
.p-sec { margin: 18px 14px 0; padding: 16px; border-radius: 20px; background: #fff; box-shadow: 0 1px 0 #e5dcbd; }
.p-sec h3 { margin: 0 0 4px; font-size: 18px; font-weight: 500; font-feature-settings: "palt"; word-break: keep-all; }
.p-sec .lead { margin: 0 0 12px; color: var(--ink2); font-size: 14px; line-height: 1.7; word-break: normal; }
.p-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.p-kpi div { padding: 10px 8px; border-radius: 14px; background: #f6f1df; }
.p-kpi dt { font-size: 12px; color: var(--ink2); font-weight: 500; }
.p-kpi dd { margin: 0; font-family: var(--f-pop); font-size: 22px; white-space: nowrap; }
.p-kpi dd small { font-family: var(--f-body); font-size: 13px; }
.heat { display: grid; grid-template-columns: 26px repeat(9, 1fr); gap: 3px; }
.heat__h { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: var(--ink2); min-height: 20px; }
.heat__c { aspect-ratio: 1; border: 0; padding: 0; border-radius: 6px; background: #e6e2d3; transition: transform .1s; }
.heat__c:active { transform: scale(.9); }
.heat__c.l4 { background: #2e8a47; }
.heat__c.l3 { background: #8cc47a; }
.heat__c.l2 { background: #ffd23f; }
.heat__c.l1 { background: #e2533f; }
.heat__c.is-sel { box-shadow: 0 0 0 3px var(--ink); }
.heat-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--ink2); }
.heat-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; }
.cell-info { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #f6f1df; min-height: 70px; }
.cell-info b { font-family: var(--f-pop); font-weight: 400; font-size: 22px; margin-right: 8px; }
.cell-info .y { color: var(--leaf); font-weight: 500; }
.cell-info p { margin: 4px 0 0; font-size: 14px; color: var(--ink2); }
.weak { list-style: none; margin: 0; padding: 0; counter-reset: w; }
.weak li { display: grid; grid-template-columns: 28px auto 1fr auto; gap: 10px; align-items: center; padding: 9px 0; }
.weak li + li { border-top: 1px solid #eee5c8; }
.weak li::before { counter-increment: w; content: counter(w); width: 26px; height: 26px; border-radius: 50%; background: var(--macaw); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; font-weight: 500; }
.weak__q { font-family: var(--f-pop); font-size: 20px; white-space: nowrap; }
.weak__y { font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weak__v { text-align: right; font-size: 13px; white-space: nowrap; }
.weak__v b { display: block; font-size: 16px; }
.dan { list-style: none; margin: 0; padding: 0; }
.dan li { display: grid; grid-template-columns: 64px 1fr 92px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.dan__bar { height: 12px; border-radius: 6px; background: #eee6c9; overflow: hidden; }
.dan__bar i { display: block; height: 100%; border-radius: 6px; background: var(--leaf); }
.dan__v { text-align: right; white-space: nowrap; color: var(--ink2); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; padding-top: 18px; }
.week div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 12px; color: var(--ink2); }
.week i { display: block; width: 100%; max-width: 30px; border-radius: 8px 8px 3px 3px; background: var(--moss); min-height: 3px; }
.week b { font-weight: 500; color: var(--ink); font-size: 12px; }
.tips { margin: 0; padding-left: 1.2em; }
.tips li { margin: 0 0 8px; line-height: 1.7; word-break: normal; }
.p-actions { margin: 18px 14px 0; display: grid; gap: 14px; }

/* ---------- せってい ---------- */
.scr--settings { background-color: var(--jungle); }
.s-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px calc(26px + var(--safe-b)); }
.s-card { margin: 0 0 14px; padding: 16px; border-radius: 24px; background: var(--paper); }
.s-card h2 { margin: 0 0 10px; font-family: var(--f-pop); font-size: 18px; font-weight: 400; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg3 button { min-height: 58px; border: 0; border-radius: 16px; background: #f0e3b7; font-size: 15px; font-weight: 500; line-height: 1.3; }
.seg3 button small { display: block; font-size: 13px; color: var(--ink2); }
.seg3 button[aria-pressed="true"] { background: var(--leaf); color: #fff; box-shadow: 0 4px 0 #0f4a26; }
.seg3 button[aria-pressed="true"] small { color: #e4f6e4; }
.tgl { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-size: 16px; font-weight: 500; }
.tgl + .tgl { border-top: 2px dotted #e2d4a7; }
.sw { position: relative; width: 60px; height: 34px; flex: none; }
.sw input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.sw span { position: absolute; inset: 0; border-radius: 17px; background: #c9bd94; transition: background-color .2s; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .3s var(--spring); }
.sw input:checked + span { background: var(--leaf); }
.sw input:checked + span::after { transform: translateX(26px); }
.howto { margin: 0; padding: 0; list-style: none; counter-reset: h; }
.howto li { position: relative; padding: 0 0 10px 38px; font-size: 16px; line-height: 1.7; word-break: normal; }
.howto li::before { counter-increment: h; content: counter(h); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--banana); font-family: var(--f-pop); font-size: 15px; display: flex; align-items: center; justify-content: center; }
.about-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.about-head img { width: 72px; height: 72px; border-radius: 18px; }
.about-head h2 { margin: 0; }
.about-head p { margin: 0; font-size: 14px; color: var(--ink2); }
.note { margin: 0 0 10px; font-size: 15px; line-height: 1.75; word-break: normal; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tags span { padding: 4px 12px; border-radius: 12px; background: #f0e3b7; font-size: 14px; white-space: nowrap; }

/* ---------- 保護者のゲート・トースト・起動 ---------- */
.gate h2 { margin: 0 0 6px; font-size: 20px; text-align: center; font-weight: 500; }
.gate p { margin: 0 0 16px; text-align: center; color: var(--ink2); font-size: 15px; word-break: normal; }
.hold { position: relative; display: block; width: 132px; height: 132px; margin: 0 auto 10px; border: 0; border-radius: 50%; background: var(--jungle); color: #fff; font-size: 16px; font-weight: 500; touch-action: none; }
.hold svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hold svg.ring circle { fill: none; stroke-width: 8; }
.hold svg.ring .track { stroke: rgba(255, 255, 255, .18); }
.hold svg.ring .bar { stroke: var(--banana); stroke-linecap: round; stroke-dasharray: 380; stroke-dashoffset: 380; }
.blk { display: block; }
.hold span { position: relative; }
.toast {
  position: absolute; left: 50%; top: calc(76px + var(--safe-t)); z-index: 60; transform: translate(-50%, -20px);
  width: max-content; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 20px;
  background: var(--paper); color: var(--ink); font-size: 15px; font-weight: 500; text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity .2s, transform .35s var(--spring);
  word-break: keep-all;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.splash { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--jungle); transition: opacity .35s; }
.splash img { width: 116px; height: 116px; border-radius: 28px; animation: splash .7s var(--spring) both; box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.splash p { margin: 0; font-family: var(--f-pop); font-size: 24px; color: #fff; }
.splash.is-out { opacity: 0; }
@keyframes splash { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
.onb { text-align: center; }
.onb img { width: 180px; height: 180px; margin: 0 auto 10px; border-radius: 30px; object-fit: cover; }
.onb h2 { margin: 0 0 6px; font-family: var(--f-pop); font-weight: 400; font-size: 22px; line-height: 1.4; word-break: keep-all; }
.onb p { margin: 0 0 16px; font-size: 16px; line-height: 1.75; word-break: normal; }
.onb__dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.onb__dots i { width: 9px; height: 9px; border-radius: 5px; background: #d9cca0; }
.onb__dots i.on { width: 26px; background: var(--leaf); }
.onb__btns { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
.fail-boot { color: #fff; padding: 120px 28px; text-align: center; }
.webgl-none { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* 子ども向けの分かち書きは、空白でだけ改行する（後ろに置いて各部品の word-break に勝たせる） */
.kid.kid, .kid p, .kid li { word-break: keep-all; overflow-wrap: normal; }
