/* はたけ守り隊 — のどかな田園・木札と手描き文字 */
:root {
  --sky: #8fd0f0;
  --sky-l: #d4eefa;
  --sky-d: #24618c;
  --grass: #7cb342;
  --grass-l: #b9dd8a;
  --go: #3d7a1f;
  --go-d: #24500f;
  --soil: #8a5a33;
  --soil-d: #5b3a1f;
  --wood: #f3e3c3;
  --wood-2: #e6cc9c;
  --wood-line: #c9a46e;
  --ink: #2e2216;
  --ink-2: #5a4632;
  --red: #b8391f;
  --gold: #e8b33a;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 22px;
  --f-hand: "Yusei Magic", "M PLUS Rounded 1c", sans-serif;
  --f-ui: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  --f-num: "Fredoka", "M PLUS Rounded 1c", sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, .8, .3, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #7fb04a radial-gradient(circle at 20% 10%, #a5d06b 0, transparent 40%) fixed;
  color: var(--ink);
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.6;
  line-break: strict;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 600px) {
  body { background: #6e9f3e repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 60px, transparent 60px 120px); }
  .app { box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 30px 80px rgba(40,60,10,.35); }
}
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; flex: none; }
.nw { white-space: nowrap; }
.num { font-family: var(--f-num); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
h1, h2, h3, .plank__title { font-feature-settings: "palt"; word-break: keep-all; overflow-wrap: normal; }
p { word-break: normal; }

.app { position: relative; width: 100%; max-width: 430px; height: 100vh; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--sky-l); }

/* ===== 画面 ===== */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.is-on { display: flex; animation: scrIn .32s var(--ease) both; }
.screen--title.is-on, .screen--play.is-on { animation-name: scrFade; }
@keyframes scrIn { from { opacity: 0; transform: translateX(28px); } }
@keyframes scrFade { from { opacity: 0; } }
.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ===== ボタン ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border: 0; border-radius: 18px;
  font-family: var(--f-ui); font-weight: 800; font-size: 16px; line-height: 1.25; text-decoration: none;
  word-break: keep-all; transition: transform .12s var(--ease), box-shadow .12s var(--ease), filter .12s;
  user-select: none; -webkit-user-select: none;
}
.btn svg { width: 22px; height: 22px; }
.btn:active { transform: translateY(3px); }
.btn--go { background: var(--go); color: #fff; box-shadow: 0 4px 0 var(--go-d), 0 8px 18px rgba(36,80,15,.28); }
.btn--go:active { box-shadow: 0 1px 0 var(--go-d), 0 3px 8px rgba(36,80,15,.25); }
.btn--wood { background: var(--wood); color: var(--ink); box-shadow: 0 4px 0 var(--wood-line), 0 6px 14px rgba(70,45,15,.18); }
.btn--wood:active { box-shadow: 0 1px 0 var(--wood-line); }
.btn--danger { background: var(--red); color: #fff; box-shadow: 0 4px 0 #7c2412; }
.btn--text { background: transparent; color: var(--ink); min-height: 44px; padding: 8px 10px; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }
.btn--xl { min-height: 64px; font-size: 21px; border-radius: 22px; padding: 12px 26px; }
.btn--xl svg { width: 28px; height: 28px; }
.btn--l { min-height: 54px; font-size: 17px; width: 100%; }
.btn--m { min-height: 48px; font-size: 15px; padding: 8px 12px; flex: 1; }
.btn--square { width: 54px; min-height: 54px; padding: 0; flex: none; }
.btn[disabled], .btn.is-off { filter: grayscale(.8); opacity: .7; }

.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 14px;
  background: rgba(30,18,6,.22); color: #fff8ea; text-decoration: none; transition: transform .12s var(--ease);
}
.iconbtn svg { width: 24px; height: 24px; }
.iconbtn:active { transform: scale(.9); }
.iconbtn--sky { background: rgba(255,255,255,.88); color: var(--sky-d); box-shadow: 0 3px 0 rgba(36,97,140,.35); }
.iconbtn--small { width: 44px; height: 44px; background: var(--wood-2); color: var(--ink); }

/* ===== スプラッシュ ===== */
.splash { position: absolute; inset: 0; z-index: 50; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--sky); }
.splash img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 10px 30px rgba(36,97,140,.35); animation: pop .5s var(--spring) both; }
.splash p { margin: 0; font-family: var(--f-hand); font-size: 26px; color: var(--ink); }
.app.is-splash .splash { display: flex; animation: fadeout .3s .65s forwards; }
@keyframes fadeout { to { opacity: 0; visibility: hidden; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ===== タイトル ===== */
.screen--title { background: var(--sky) url(/app-development/apps/a006/img/title.webp) center bottom / cover no-repeat; }
.title__top { display: flex; justify-content: flex-end; padding: calc(var(--safe-t) + 12px) 14px 0; }
.sign { position: relative; margin: 2vh auto 0; width: min(84%, 330px); animation: swing 4s ease-in-out infinite; transform-origin: 50% -40px; }
.sign__rope { position: absolute; left: 14%; right: 14%; top: -46px; height: 52px; border: 3px solid #9b7442; border-bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.sign__board {
  position: relative; padding: 14px 18px 18px; text-align: center; border-radius: 14px;
  background: linear-gradient(180deg, #f6e6c6, #ead2a4); color: var(--ink);
  box-shadow: inset 0 0 0 3px #c79d63, inset 0 0 0 6px #f6e6c6, 0 6px 0 #a87b4f, 0 16px 28px rgba(60,40,10,.28);
}
.sign__board::before, .sign__board::after { content: ""; position: absolute; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: #8b6337; box-shadow: inset 0 -2px 0 #5b3a1f; }
.sign__board::before { left: 12px; } .sign__board::after { right: 12px; }
.sign__kicker { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .14em; color: var(--soil-d); }
.logo { margin: 0; line-height: 1.05; font-family: var(--f-hand); font-weight: 400; color: var(--ink); display: flex; justify-content: center; align-items: baseline; gap: 2px; }
.logo__a { font-size: 50px; color: var(--go-d); }
.logo__b { font-size: 46px; color: var(--soil-d); }
@keyframes swing { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
.title__bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 18px calc(var(--safe-b) + 18px); }
.title__lead { margin: 0 0 4px; padding: 6px 14px; border-radius: 999px; background: rgba(46,34,22,.86); color: #fff8ea; font-size: 14px; font-weight: 700; text-align: center; word-break: keep-all; }
.title__bottom .btn--xl { width: 100%; }
.title__row { display: flex; gap: 10px; width: 100%; }
.title__row .btn { flex: 1; padding: 10px 8px; font-size: 15px; }
.title__stars { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; padding: 4px 12px; border-radius: 999px; background: var(--wood); font-weight: 700; font-size: 14px; }
.title__stars svg { color: var(--gold); width: 18px; height: 18px; }
.title__stars b { font-size: 18px; }
.title__of { color: var(--ink-2); }

/* ===== 木の板のヘッダー ===== */
.plank {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 6px; padding: calc(var(--safe-t) + 8px) 8px 8px;
  background: linear-gradient(180deg, #84552e, #6c4321); color: #fff8ea; box-shadow: 0 3px 0 #5b3a1f, 0 8px 18px rgba(60,40,10,.2);
}
.plank::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 3px, transparent 3px 9px); }
.plank__title { flex: 1; margin: 0; text-align: center; font-family: var(--f-hand); font-weight: 400; font-size: 22px; line-height: 1.3; }
.plank__spacer { width: 44px; }
.plank--clear { background: linear-gradient(180deg, #84552e, #6c4321); }

/* ===== ステージ選択 ===== */
.screen--stages { background: linear-gradient(180deg, var(--sky-l) 0, #e8f4d4 30%, #cfe6a8 100%); }
.stages__scroll { padding: 14px 16px calc(var(--safe-b) + 24px); }
.stages__lead { margin: 2px 4px 14px; font-weight: 700; color: var(--ink-2); font-size: 14px; }
.fields { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.field {
  position: relative; display: block; width: 100%; padding: 0; border: 0; text-align: left; border-radius: var(--r-l); overflow: hidden;
  background: var(--wood); box-shadow: 0 5px 0 var(--wood-line), 0 12px 24px rgba(60,80,20,.18); transition: transform .14s var(--ease), box-shadow .14s var(--ease);
  animation: rise .5s var(--spring) both; animation-delay: calc(var(--i) * 70ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.field:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--wood-line); }
.field__pic { position: relative; height: 150px; background: center 60% / cover no-repeat; }
.field__no { position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--wood); color: var(--soil-d); font-size: 24px; box-shadow: 0 3px 0 var(--wood-line); }
.field__body { display: flex; align-items: center; gap: 10px; padding: 12px 14px 14px; }
.field__text { flex: 1; min-width: 0; }
.field__name { margin: 0; font-family: var(--f-hand); font-size: 23px; line-height: 1.25; color: var(--ink); }
.field__sub { margin: 2px 0 6px; font-size: 14px; color: var(--ink-2); font-weight: 700; word-break: keep-all; }
.field__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field__stars { display: inline-flex; gap: 2px; }
.field__stars svg { width: 20px; height: 20px; color: #d4c4a2; }
.field__stars svg.on { color: var(--gold); filter: drop-shadow(0 1px 0 #9c6b14); }
.field__go { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--go); color: #fff; box-shadow: 0 3px 0 var(--go-d); }
.field__go svg { width: 26px; height: 26px; }
.field.is-locked .field__pic { filter: grayscale(1) brightness(.8); }
.field.is-locked .field__go { background: #6b5b48; box-shadow: 0 3px 0 #3f3326; }
.field__lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgba(46,34,22,.88); color: #fff8ea; font-size: 14px; font-weight: 800; white-space: nowrap; }
.field__lock svg { width: 18px; height: 18px; }

/* ===== プレイ ===== */
.screen--play { background: #7cb342; touch-action: none; user-select: none; -webkit-user-select: none; }
.board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--safe-t) + 8px) 8px 8px; background: linear-gradient(180deg, #84552e, #6c4321); box-shadow: 0 3px 0 #5b3a1f, 0 6px 14px rgba(40,30,10,.25);
}
.hud__chips { display: flex; gap: 5px; flex: 1; min-width: 0; }
.chip { display: flex; align-items: center; gap: 3px; margin: 0; height: 40px; padding: 0 9px 0 6px; border-radius: 12px; background: var(--wood); color: var(--ink); box-shadow: inset 0 -3px 0 var(--wood-2); white-space: nowrap; }
.chip svg { width: 24px; height: 24px; }
.chip b { font-size: 20px; line-height: 1; }
.chip__of, .chip__unit { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.chip--wave svg { color: var(--red); width: 20px; height: 20px; }
.chip.is-bump { animation: bump .35s var(--spring); }
.chip.is-hurt { animation: hurt .45s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }
@keyframes hurt { 20%, 60% { transform: translateX(-4px); background: #ffd9cf; } 40%, 80% { transform: translateX(4px); } }
.hud__btns { display: flex; gap: 6px; }
.iconbtn--hud { width: 44px; height: 40px; border-radius: 12px; background: rgba(30,18,6,.28); }
.js-speed { width: auto; padding: 0 8px; display: inline-flex; gap: 2px; font-size: 15px; }
.js-speed svg { width: 20px; height: 20px; }
.js-speed[aria-pressed="true"] { background: var(--gold); color: var(--ink); box-shadow: inset 0 -3px 0 #b07f16; }

.shelf {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; gap: 8px; align-items: stretch;
  padding: 10px 8px calc(var(--safe-b) + 10px); background: linear-gradient(180deg, #9a6a3c, #7d4f2a); box-shadow: 0 -3px 0 #b98450, 0 -8px 18px rgba(40,30,10,.22);
  transition: transform .28s var(--ease);
}
.shelf.is-hidden { transform: translateY(110%); }
.shelf__tools { display: flex; gap: 6px; flex: 1.7; min-width: 0; }
.tool {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px;
  height: 92px; padding: 4px 2px 6px; border: 0; border-radius: 14px; background: var(--wood); color: var(--ink);
  box-shadow: inset 0 -4px 0 var(--wood-2), 0 3px 0 #5b3a1f; transition: transform .12s var(--ease), box-shadow .12s;
}
.tool img { height: 44px; width: auto; object-fit: contain; margin-bottom: 1px; filter: drop-shadow(0 2px 1px rgba(60,40,10,.3)); }
.tool__net { width: 40px; height: 38px; margin-bottom: 4px; border-left: 4px solid #7a5230; border-right: 4px solid #7a5230; background: repeating-linear-gradient(45deg, transparent 0 5px, #8a7a62 5px 6.5px), repeating-linear-gradient(-45deg, transparent 0 5px, #8a7a62 5px 6.5px); }
.tool__name { font-weight: 800; font-size: 14px; line-height: 1.1; }
.tool__cost { display: flex; align-items: center; gap: 2px; font-size: 14px; line-height: 1; }
.tool__cost svg { width: 15px; height: 15px; }
.tool:active { transform: translateY(2px) scale(.97); }
.tool[aria-pressed="true"] { background: #fff7d6; box-shadow: inset 0 0 0 3px var(--gold), inset 0 -4px 0 var(--wood-2), 0 3px 0 #5b3a1f; transform: translateY(-4px); }
.tool.is-poor .tool__cost { color: var(--red); }
.tool.is-poor img, .tool.is-poor .tool__net { opacity: .55; }
.tool.is-nudge { animation: nudge .5s var(--spring); }
@keyframes nudge { 30% { transform: translateY(-8px); } }
.call {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; border-radius: 16px; padding: 6px 6px 8px; background: var(--red); color: #fff;
  box-shadow: inset 0 -4px 0 #7c2412, 0 3px 0 #4a160a; transition: transform .12s var(--ease);
}
.call:active { transform: translateY(2px) scale(.97); }
.call__label { font-family: var(--f-hand); font-size: 19px; line-height: 1.15; word-break: keep-all; text-align: center; }
.call__sub { font-size: 12px; font-weight: 700; line-height: 1.3; text-align: center; word-break: keep-all; color: #fff3ea; }
.call__bar { width: 86%; height: 6px; border-radius: 3px; background: rgba(0,0,0,.25); overflow: hidden; }
.call__bar i { display: block; height: 100%; width: 0; background: #ffe082; border-radius: 3px; }
.call.is-busy { background: #6b5b48; box-shadow: inset 0 -4px 0 #3f3326, 0 3px 0 #2c231a; }
.call.is-ready { animation: callpulse 1.6s ease-in-out infinite; }
@keyframes callpulse { 50% { box-shadow: inset 0 -4px 0 #7c2412, 0 3px 0 #4a160a, 0 0 0 6px rgba(255,224,130,.55); } }

.hint {
  position: absolute; left: 50%; z-index: 5; bottom: calc(var(--safe-b) + 128px); transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  max-width: 88%; margin: 0; padding: 8px 14px; border-radius: 14px; background: rgba(46,34,22,.9); color: #fff8ea; font-weight: 700; font-size: 14px; text-align: center; word-break: keep-all;
  transition: opacity .2s, transform .25s var(--spring);
}
.hint.is-on { opacity: 1; transform: translate(-50%, 0); }
.hint::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -7px; width: 14px; height: 14px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }

.banner { position: absolute; left: 0; right: 0; top: 34%; z-index: 5; pointer-events: none; text-align: center; opacity: 0; transform: scale(.85); }
.banner p { margin: 0 auto; width: max-content; max-width: 90%; }
.banner__sub { padding: 2px 14px; border-radius: 999px; background: var(--ink); color: #fff8ea; font-weight: 800; font-size: 15px; }
.banner__main { margin-top: 6px !important; padding: 4px 22px 8px; border-radius: 16px; background: var(--wood); color: var(--red); font-family: var(--f-hand); font-size: 38px; line-height: 1.2; box-shadow: 0 5px 0 var(--wood-line), 0 12px 28px rgba(0,0,0,.25); }
.banner.is-on { animation: banner 1.9s var(--ease) forwards; }
@keyframes banner { 0% { opacity: 0; transform: scale(.7); } 14% { opacity: 1; transform: scale(1.06); } 22% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }

.panel {
  position: absolute; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px); z-index: 6; padding: 12px; border-radius: 20px; background: var(--wood);
  box-shadow: 0 5px 0 var(--wood-line), 0 16px 36px rgba(40,30,10,.35); transform: translateY(130%); transition: transform .3s var(--spring); visibility: hidden;
}
.panel.is-on { transform: none; visibility: visible; }
.panel__head { display: flex; gap: 10px; align-items: flex-start; }
.panel__img { width: 58px; height: 64px; object-fit: contain; flex: none; }
.panel__info { flex: 1; min-width: 0; }
.panel__name { margin: 0; display: flex; align-items: baseline; gap: 8px; font-family: var(--f-hand); font-size: 22px; line-height: 1.2; }
.panel__lv { font-size: 15px; padding: 1px 8px; border-radius: 8px; background: var(--red); color: #fff; }
.panel__desc { margin: 2px 0 4px; font-size: 14px; line-height: 1.5; color: var(--ink-2); font-weight: 700; }
.panel__stats { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; font-weight: 700; }
.panel__stats span { white-space: nowrap; }
.panel__stats b { font-family: var(--f-num); font-size: 15px; }
.panel__stats .up { color: var(--go); }
.panel__acts { display: flex; gap: 8px; margin-top: 10px; }

.demo { position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 70px); z-index: 7; display: none; flex-direction: column; align-items: center; gap: 10px; padding: 0 30px; }
.demo.is-on { display: flex; }
.demo__tag { display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 14px; border-radius: 999px; background: rgba(46,34,22,.9); color: #fff8ea; font-weight: 800; font-size: 14px; }
.demo__dot { width: 9px; height: 9px; border-radius: 50%; background: #ff7a5c; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.modal { position: absolute; inset: 0; z-index: 9; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(40,30,15,.55); }
.modal.is-on { display: flex; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } }
.modal__card { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; padding: 20px 18px 14px; border-radius: 24px; background: var(--wood); text-align: center; box-shadow: 0 6px 0 var(--wood-line), 0 24px 50px rgba(0,0,0,.35); animation: pop .35s var(--spring); }
.modal__eyebrow { margin: 0; font-weight: 800; font-size: 13px; letter-spacing: .14em; color: var(--soil-d); }
.modal__title { margin: 0; font-family: var(--f-hand); font-weight: 400; font-size: 30px; line-height: 1.2; }
.modal__meta { display: flex; justify-content: center; gap: 16px; margin: 0 0 6px; font-weight: 700; color: var(--ink-2); }
.modal__meta b { font-size: 18px; color: var(--ink); }
.modal__row { display: flex; justify-content: space-around; }

/* ===== リザルト ===== */
.screen--result { background: #e9f3d6; }
.result__scroll { padding-bottom: 96px; }
.result__pic { height: 210px; background: center / cover no-repeat; }
.result__card { position: relative; margin: -36px 14px 0; padding: 18px 16px 18px; border-radius: 24px; background: var(--wood); box-shadow: 0 5px 0 var(--wood-line), 0 14px 30px rgba(60,40,10,.2); text-align: center; }
.result__eyebrow { display: inline-block; margin: 0; padding: 2px 12px; border-radius: 999px; background: var(--ink); color: #fff8ea; font-size: 13px; font-weight: 800; }
.result__title { margin: 6px 0 2px; font-family: var(--f-hand); font-weight: 400; font-size: 32px; line-height: 1.25; color: var(--go-d); }
.result__title.is-lost { color: var(--red); }
.stars { display: flex; justify-content: center; gap: 4px; margin: 4px 0 6px; }
.stars svg { width: 46px; height: 46px; color: #d9c9a8; }
.stars svg.on { color: var(--gold); filter: drop-shadow(0 2px 0 #9c6b14); animation: starin .5s var(--spring) both; }
.stars svg.on:nth-child(2) { animation-delay: .18s; width: 56px; height: 56px; margin-top: -8px; }
.stars svg:nth-child(2) { width: 56px; height: 56px; margin-top: -8px; }
.stars svg.on:nth-child(3) { animation-delay: .36s; }
@keyframes starin { from { transform: scale(0) rotate(-60deg); opacity: 0; } }
.result__veg { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 0 0 10px; }
.result__veglabel { font-weight: 800; color: var(--ink-2); }
.result__veg b { font-size: 46px; line-height: 1; color: var(--ink); }
.result__vegmax { font-size: 20px; color: var(--ink-2); }
.tally { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.tally div { padding: 8px 10px; border-radius: 14px; background: #fbf3e1; box-shadow: inset 0 -3px 0 var(--wood-2); text-align: left; }
.tally dt { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.tally dd { margin: 0; font-weight: 700; white-space: nowrap; }
.tally dd b { font-size: 24px; margin-right: 2px; }
.kinds { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; }
.kinds li { display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 999px; background: #fbf3e1; font-weight: 700; font-size: 14px; white-space: nowrap; }
.kinds img { width: 30px; height: 30px; object-fit: contain; }
.sub-h { margin: 6px 0 8px; font-family: var(--f-hand); font-weight: 400; font-size: 20px; text-align: left; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.history li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #fbf3e1; }
.history__badge { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; font-family: var(--f-hand); font-size: 15px; line-height: 1.1; text-align: center; color: #fff; background: var(--go); }
.history__badge.is-lost { background: var(--red); }
.history__main { flex: 1; min-width: 0; }
.history__name { margin: 0; font-weight: 800; font-size: 15px; }
.history__meta { margin: 0; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.history__stars { display: flex; }
.history__stars svg { width: 16px; height: 16px; color: #d4c4a2; }
.history__stars svg.on { color: var(--gold); }
.empty { padding: 16px; border-radius: 14px; background: #fbf3e1; color: var(--ink-2); font-weight: 700; text-align: center; }
.result__acts { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 12px 14px calc(var(--safe-b) + 12px); background: linear-gradient(180deg, rgba(233,243,214,0), #e9f3d6 30%); }
.result__acts .btn--l { flex: 1; width: auto; }

/* ===== 遊び方・設定 ===== */
.screen--settings, .screen--about { background: #eef5e0; }
.settings__scroll, .about__scroll { padding: 6px 16px calc(var(--safe-b) + 28px); }
.sec-h { margin: 20px 4px 10px; font-family: var(--f-hand); font-weight: 400; font-size: 22px; color: var(--go-d); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-m); background: var(--wood); box-shadow: 0 3px 0 var(--wood-line); }
.step__no { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--go); color: #fff; font-size: 19px; }
.step__h { margin: 2px 0 4px; font-size: 17px; font-weight: 800; line-height: 1.35; }
.step p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.dex { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dex li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-m); background: #fff9ec; box-shadow: 0 2px 0 var(--wood-2); }
.dex__img { width: 60px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 14px; background: #dcebc2; }
.dex__img img { max-width: 52px; max-height: 50px; object-fit: contain; }
.dex__name { margin: 0; font-weight: 800; font-size: 16px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.dex__name small { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.dex__note { margin: 2px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.dex__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dex__tags span { padding: 1px 8px; border-radius: 6px; background: #efe3c8; font-size: 12px; font-weight: 800; color: var(--soil-d); white-space: nowrap; }
.foes-pic { margin: 0 0 10px; border-radius: var(--r-m); overflow: hidden; box-shadow: 0 3px 0 var(--wood-line); }
.group { margin-top: 10px; border-radius: var(--r-m); background: #fff9ec; box-shadow: 0 2px 0 var(--wood-2); overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 14px; border: 0; width: 100%; background: transparent; text-align: left; text-decoration: none; font-weight: 700; font-size: 16px; }
.row + .row { border-top: 1px solid #ecdcbc; }
.row__label { flex: 1; }
.row svg { width: 22px; height: 22px; color: var(--ink-2); }
.row--danger { color: var(--red); }
.row--danger svg { color: var(--red); }
.row--link:active { background: #f4e8cf; }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 54px; height: 32px; margin: 0; border-radius: 999px; background: #cbb998; transition: background .2s; flex: none; cursor: pointer; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .25s var(--spring); }
.switch:checked { background: var(--go); }
.switch:checked::after { transform: translateX(22px); }
.switch:focus-visible { outline: 3px solid var(--sky-d); outline-offset: 2px; }

.about__head { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.about__head img { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 4px 12px rgba(60,40,10,.2); }
.about__name { margin: 0; font-family: var(--f-hand); font-size: 26px; line-height: 1.2; }
.about__ver { margin: 0; color: var(--ink-2); }
.about__note { margin: 0; padding: 14px; border-radius: var(--r-m); background: var(--wood); font-size: 14px; line-height: 1.75; }
.tech { margin: 0; padding: 12px 14px 12px 32px; border-radius: var(--r-m); background: #fff9ec; font-size: 14px; line-height: 1.8; }
.about__cta { margin-top: 20px; }

/* ===== 確認・トースト ===== */
.sheet-backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(40,30,15,.5); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s; }
.sheet-backdrop.is-on { opacity: 1; visibility: visible; transition: opacity .2s; }
.confirm { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 21; display: flex; flex-direction: column; gap: 10px; padding: 20px 16px 14px; border-radius: 24px; background: var(--wood); box-shadow: 0 -10px 40px rgba(0,0,0,.3); transform: translateY(120%); visibility: hidden; transition: transform .3s var(--spring), visibility 0s .3s; }
.confirm.is-on { transform: none; visibility: visible; transition: transform .3s var(--spring); }
.confirm__title { margin: 0; font-size: 19px; font-weight: 800; text-align: center; }
.confirm__text { margin: 0 0 6px; font-size: 14px; line-height: 1.7; color: var(--ink-2); text-align: center; }
.toast { position: absolute; left: 50%; top: calc(var(--safe-t) + 66px); z-index: 30; margin: 0; max-width: 86%; padding: 9px 16px; border-radius: 14px; background: rgba(46,34,22,.94); color: #fff8ea; font-weight: 800; font-size: 14px; text-align: center; transform: translate(-50%, -12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--spring); word-break: keep-all; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.nojs { position: absolute; inset: 40% 20px auto; padding: 16px; border-radius: 16px; background: var(--wood); text-align: center; font-weight: 700; }
.boot-error { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: var(--sky-l); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .banner.is-on { animation: none; opacity: 1; transform: none; }
  .sign { animation: none; }
}
@media (max-height: 700px) {
  .logo__a { font-size: 42px; } .logo__b { font-size: 38px; }
  .tool { height: 84px; } .tool img { height: 38px; }
}
