/* つみき職人 — 木工房のデザイントークン */
:root {
  --kinari: #f4ead6;      /* 生成り */
  --kinari-2: #ebdcbd;
  --asa: #dcc8a0;         /* 麻 */
  --hinoki: #ecd3a3;      /* 檜 */
  --hinoki-d: #a77d47;
  --koge: #3b2618;        /* 焦茶 */
  --koge-2: #5b3b23;
  --koge-3: #2a1b10;
  --shu: #c03b26;         /* 朱 */
  --shu-d: #7f2414;
  --ink: #2a1b10;
  --paper: #fffaf0;

  --f-disp: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-body: "Kiwi Maru", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --f-num: "Bricolage Grotesque", "Kiwi Maru", sans-serif;

  --r-tag: 6px;
  --r-btn: 14px;
  --sh-wood: 0 5px 0 #a07a4a, 0 10px 18px rgba(42, 27, 16, .28);
  --sh-shu: 0 5px 0 var(--shu-d), 0 10px 18px rgba(42, 27, 16, .3);
  --t-press: 70ms;
  --t-scr: 280ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--koge-3);
  background-image: radial-gradient(circle at 50% 30%, #4a3020 0, var(--koge-3) 70%);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, a, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 1em; height: 1em; flex: none; }
.num { font-family: var(--f-num); font-feature-settings: "tnum"; font-weight: 800; letter-spacing: -.01em; }
h1, h2, h3 { font-feature-settings: "palt"; margin: 0; }
p { margin: 0; }

.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--kinari);
  isolation: isolate;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.about__p { user-select: text; -webkit-user-select: text; }
@media (min-width: 600px) {
  .app { box-shadow: 0 0 0 1px rgba(255, 240, 210, .08), 0 30px 80px rgba(0, 0, 0, .5); }
}

/* ---- 画面 ---- */
.scr {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  visibility: hidden; opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--t-scr) var(--ease-out), transform var(--t-scr) var(--ease-out), visibility 0s linear var(--t-scr);
}
.scr.is-active { visibility: visible; opacity: 1; transform: none; transition: opacity var(--t-scr) var(--ease-out), transform var(--t-scr) var(--ease-out); z-index: 2; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: var(--r-btn);
  font-family: var(--f-body); font-weight: 500; font-size: 16px; text-decoration: none;
  word-break: keep-all; white-space: nowrap;
  position: relative;
  transition: transform var(--t-press) ease-out, box-shadow var(--t-press) ease-out;
  user-select: none; -webkit-user-select: none;
}
.btn svg { font-size: 22px; }
.btn--shu { background: var(--shu); color: #fff8ee; box-shadow: var(--sh-shu); }
.btn--wood { background: var(--hinoki); color: var(--koge); box-shadow: var(--sh-wood); }
.btn--shu::after, .btn--wood::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: repeating-linear-gradient(92deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 9px, rgba(60, 30, 10, .05) 9px 10px, transparent 10px 17px);
  mix-blend-mode: multiply;
}
.btn--l { min-height: 56px; font-size: 17px; width: 100%; }
.btn--xl { min-height: 64px; font-size: 20px; width: 100%; font-family: var(--f-disp); font-weight: 400; letter-spacing: .04em; }
.btn--xl svg { font-size: 26px; }
.btn:active { transform: translateY(4px); }
.btn--shu:active { box-shadow: 0 1px 0 var(--shu-d), 0 3px 8px rgba(42, 27, 16, .25); }
.btn--wood:active { box-shadow: 0 1px 0 #a07a4a, 0 3px 8px rgba(42, 27, 16, .2); }
.btn--text { background: none; min-height: 44px; padding: 0 12px; color: var(--koge); text-decoration: underline; text-underline-offset: 4px; font-size: 15px; }
.btn:focus-visible, .ibtn:focus-visible, .pad__btn:focus-visible, .row:focus-within { outline: 3px solid var(--shu); outline-offset: 3px; }

.ibtn {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 12px;
  border: 0; background: var(--kinari); color: var(--koge);
  box-shadow: 0 4px 0 #b08d5c, 0 8px 14px rgba(42, 27, 16, .25);
  transition: transform var(--t-press);
}
.ibtn svg { font-size: 24px; }
.ibtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b08d5c; }
.ibtn--light { background: var(--paper); }

/* ---- スプラッシュ ---- */
.splash {
  position: absolute; inset: 0; z-index: 50;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--koge);
}
.splash.is-on { display: flex; animation: splashOut .35s ease-in .75s forwards; }
.splash img { border-radius: 26px; box-shadow: 0 14px 30px rgba(0, 0, 0, .45); animation: splashPop .5s var(--spring); }
.splash__name { font-family: var(--f-disp); font-size: 26px; color: var(--kinari); letter-spacing: .12em; }
@keyframes splashPop { from { transform: scale(.7) rotate(-6deg); opacity: 0; } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

/* ======================= タイトル ======================= */
.scr--title {
  background-color: #e9dcc4;
  background-image: url(/app-development/apps/a003/img/title.webp);
  background-size: cover; background-position: center 70%;
  padding: calc(14px + var(--sat)) 20px calc(20px + var(--sab));
}
.title__top { display: flex; justify-content: flex-end; }
.sign {
  position: relative;
  margin: 14px auto 0;
  width: min(100%, 330px);
  padding: 20px 18px 18px;
  background: var(--hinoki);
  border-radius: 10px 12px 9px 11px;
  box-shadow: 0 6px 0 #9c7442, 0 18px 30px rgba(42, 27, 16, .35);
  text-align: center;
  transform: rotate(-1.2deg);
  transform-origin: 50% -40px;
  animation: signSway 5.5s ease-in-out infinite;
}
.sign::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image:
    radial-gradient(ellipse 30px 9px at 78% 72%, rgba(120, 72, 30, .22), transparent 70%),
    repeating-linear-gradient(178deg, rgba(150, 100, 50, .0) 0 5px, rgba(150, 100, 50, .16) 5px 6px, rgba(150, 100, 50, 0) 6px 13px, rgba(120, 75, 35, .1) 13px 15px);
}
/* 吊りひも（麻） */
.sign::after {
  content: ""; position: absolute; left: 18%; right: 18%; top: -60px; height: 62px; pointer-events: none;
  border-left: 3px dashed #b99a68; border-right: 3px dashed #b99a68;
}
@keyframes signSway { 0%, 100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1deg); } }
.sign__kicker { font-family: var(--f-num); font-weight: 600; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #6a4526; position: relative; }
.sign__logo {
  position: relative;
  font-family: var(--f-disp); font-weight: 400;
  font-size: clamp(46px, 14.5vw, 58px); line-height: 1.05; color: var(--koge);
  letter-spacing: .02em; margin-top: 6px;
  text-shadow: 0 1px 0 rgba(255, 240, 210, .6), 0 -1px 0 rgba(60, 30, 10, .35);
  display: flex; flex-direction: column; align-items: center;
}
.sign__logo span:last-child { font-size: 1.22em; letter-spacing: .14em; margin-left: .14em; }
.seal {
  position: absolute; right: 16px; bottom: 58px;
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 3px solid var(--shu); border-radius: 8px; color: var(--shu);
  font-family: var(--f-body); font-weight: 500; font-size: 28px; line-height: 1;
  transform: rotate(12deg); background: rgba(255, 250, 240, .55);
}
.sign__lead {
  position: relative; margin-top: 12px;
  font-size: 16px; font-weight: 500; color: var(--koge); word-break: keep-all;
}
.title__bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.best {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 8px 18px; border-radius: 999px;
  background: var(--paper); color: var(--koge);
  box-shadow: 0 6px 16px rgba(42, 27, 16, .25);
}
.best svg { font-size: 20px; color: var(--shu); align-self: center; }
.best__k { font-size: 14px; }
.best b { font-size: 26px; line-height: 1; }
.best__u { font-family: var(--f-num); font-weight: 600; font-size: 15px; }
.title__sub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }

/* ======================= プレイ ======================= */
.scr--play { background-color: var(--koge-3); touch-action: none; user-select: none; -webkit-user-select: none; }
.stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud {
  position: absolute; left: 0; right: 0; top: 0;
  padding: calc(10px + var(--sat)) 12px 0;
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: start;
  pointer-events: none;
}
.hud__tag, .hud__next {
  background: var(--kinari); color: var(--koge);
  border-radius: var(--r-tag);
  box-shadow: 0 4px 0 #a88555, 0 8px 14px rgba(42, 27, 16, .22);
  padding: 6px 10px 5px;
  display: flex; flex-direction: column; line-height: 1.1;
}
.hud__k { font-size: 11px; font-weight: 500; letter-spacing: .06em; color: #5b3b23; white-space: nowrap; }
.hud__tag--h { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 3px; width: 112px; }
.hud__tag--h .hud__k { width: 100%; }
.hud__tag--h b { font-size: 30px; line-height: 1.05; }
.hud__u { font-family: var(--f-num); font-weight: 600; font-size: 14px; }
.hud__tag--n b { font-size: 22px; line-height: 1.25; }
.hud__next { width: 58px; align-items: center; padding: 5px 4px 4px; justify-self: start; }
.hud__next canvas { width: 44px; height: 44px; }
.hud__btns { display: flex; gap: 8px; pointer-events: auto; }
.hud__btns .ibtn { width: 46px; height: 46px; }

.combo {
  position: absolute; top: calc(92px + var(--sat)); left: 12px;
  opacity: 0; transform: translateX(-10px); transition: opacity .2s, transform .2s var(--spring);
  pointer-events: none;
}
.combo.is-on { opacity: 1; transform: none; }
.combo__in { display: inline-block; padding: 4px 10px; border-radius: 4px; background: var(--shu); color: #fff8ee; font-size: 14px; font-weight: 500; }
.combo__in b { font-size: 18px; margin: 0 2px; }

.glue, .wind {
  position: absolute; left: 50%; top: calc(140px + var(--sat));
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease-out);
  max-width: calc(100% - 32px); width: max-content;
  padding: 8px 14px; border-radius: 10px;
  background: var(--koge); color: var(--kinari);
  font-size: 14px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .3);
  word-break: keep-all;
}
.glue.is-on, .wind.is-on { opacity: 1; transform: translate(-50%, 0); }
.glue__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--shu); flex: none; box-shadow: 0 0 0 3px rgba(192, 59, 38, .35); }
.wind { top: calc(186px + var(--sat)); font-family: var(--f-disp); font-size: 16px; letter-spacing: .1em; }
.wind svg { font-size: 22px; color: #f0b9a8; }
.wind.is-left svg { transform: scaleX(-1); }

.stamp {
  position: absolute; left: 0; top: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: 0; transform: translate(-50%, -50%) scale(1.8) rotate(-18deg);
}
.stamp.is-on { animation: stamp .9s var(--ease-out) forwards; }
.stamp__seal {
  width: 58px; height: 58px; display: grid; place-items: center;
  background: var(--shu); color: #fff8ee; border-radius: 10px;
  font-family: var(--f-body); font-weight: 500; font-size: 36px; line-height: 1;
  box-shadow: 0 0 0 3px #fff8ee, 0 0 0 5px var(--shu), 0 10px 20px rgba(0, 0, 0, .3);
}
.stamp__t { font-family: var(--f-disp); font-size: 18px; color: #fff8ee; background: var(--koge); padding: 2px 10px; border-radius: 4px; letter-spacing: .1em; }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.9) rotate(-22deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(.92) rotate(-8deg); }
  30% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
  75% { opacity: 1; transform: translate(-50%, -62%) scale(1) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(.96) rotate(-8deg); }
}

.pad {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 16px calc(16px + var(--sab));
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  pointer-events: none;
}
.pad.is-swap { flex-direction: row-reverse; }
.pad__btn {
  pointer-events: auto;
  width: 84px; height: 84px; border-radius: 50%; border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 14px; font-weight: 500; line-height: 1.1;
  transition: transform var(--t-press), box-shadow var(--t-press);
  position: relative;
}
.pad__btn svg { font-size: 30px; }
.pad__btn--rot { background: var(--hinoki); color: var(--koge); box-shadow: 0 6px 0 #9c7442, 0 12px 20px rgba(0, 0, 0, .35); }
.pad__btn--drop { background: var(--shu); color: #fff8ee; box-shadow: 0 6px 0 var(--shu-d), 0 12px 20px rgba(0, 0, 0, .35); }
.pad__btn:active, .pad__btn.is-press { transform: translateY(5px); box-shadow: 0 1px 0 rgba(60, 30, 10, .8), 0 4px 8px rgba(0, 0, 0, .3); }
.pad__btn:disabled { opacity: .55; }
.pad__hint {
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(42, 27, 16, .9); color: #fff3df;
  font-size: 14px; word-break: keep-all;
}
.pad__hint svg { font-size: 18px; color: #f0b9a8; }
.pad__hint { transition: opacity .4s; }
.pad__hint.is-off { opacity: 0; }

.demo {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 20px calc(20px + var(--sab));
  display: none; flex-direction: column; align-items: center; gap: 12px;
}
.demo__tag {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(-60vh); display: none;
}
.is-demo .demo { display: flex; }
.is-demo .pad { display: none; }
.demo__tag {
  position: static; transform: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; background: var(--koge); color: var(--kinari); font-size: 14px;
}
.demo__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--shu); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }

.coach {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(42, 27, 16, .55); padding: 24px;
}
.coach.is-on { display: flex; }
.coach__card { background: var(--kinari); border-radius: 16px; padding: 18px 18px 16px; width: min(100%, 300px); text-align: center; box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.coach__fig { width: 160px; height: 90px; }
.coach__hand { animation: coachHand 1.6s ease-in-out infinite; }
@keyframes coachHand { 0%, 100% { transform: translateX(-24px); } 50% { transform: translateX(24px); } }
.coach__h { font-family: var(--f-disp); font-size: 20px; color: var(--koge); margin-bottom: 4px; }
.coach__list { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; display: grid; gap: 6px; }
.coach__list li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: baseline; font-size: 15px; color: var(--koge); }
.coach__list b { font-weight: 500; background: var(--koge); color: var(--kinari); border-radius: 4px; text-align: center; font-size: 14px; padding: 1px 0; }
.coach__list span { word-break: keep-all; }
.coach__go { margin-top: 14px; font-size: 14px; color: #a3301d; font-weight: 500; }
.banner {
  position: absolute; left: 0; right: 0; top: 38%;
  display: flex; justify-content: center; pointer-events: none;
  opacity: 0;
}
.banner.is-on { animation: banner 1.6s var(--ease-out) forwards; }
.banner__in {
  font-family: var(--f-disp); font-size: 44px; color: #fff8ee; letter-spacing: .1em;
  background: var(--shu); padding: 6px 26px 8px; border-radius: 6px;
  box-shadow: 0 0 0 4px #fff8ee, 0 16px 30px rgba(0, 0, 0, .4);
  transform: rotate(-4deg);
}
@keyframes banner { 0% { opacity: 0; transform: scale(1.6); } 15% { opacity: 1; transform: scale(.95); } 25% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 1; } }

.sheet-bg {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(30, 18, 10, .62);
  opacity: 0; visibility: hidden; transition: opacity .22s, visibility 0s linear .22s;
}
.sheet-bg.is-on { opacity: 1; visibility: visible; transition: opacity .22s; }
.pausecard, .sheet {
  width: 100%; background: var(--kinari); border-radius: 22px 22px 0 0;
  padding: 18px 20px calc(22px + var(--sab));
  display: flex; flex-direction: column; gap: 12px;
  transform: translateY(40px); transition: transform .32s var(--spring);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .3);
}
.sheet-bg.is-on .pausecard, .sheet-bg.is-on .sheet { transform: none; }
.pausecard__eyebrow { font-size: 14px; color: #6a4526; text-align: center; }
.pausecard__title { font-family: var(--f-disp); font-weight: 400; font-size: 30px; text-align: center; color: var(--koge); }
.pausecard__stat { display: flex; justify-content: center; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.pausecard__stat b { font-size: 30px; }
.pausecard__row { display: flex; justify-content: center; gap: 8px; }
.sheet__grip { width: 40px; height: 5px; border-radius: 3px; background: #c4ab80; align-self: center; }
.sheet__t { font-family: var(--f-disp); font-weight: 400; font-size: 22px; color: var(--koge); }
.sheet__d { font-size: 15px; color: var(--koge-2); }

.fail {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--kinari); padding: 24px; text-align: center;
}
.fail.is-on { display: flex; }
.fail__t { font-family: var(--f-disp); font-size: 22px; word-break: keep-all; }

/* ======================= リザルト ======================= */
.scr--result { background: var(--kinari); }
.res__head {
  flex: none; height: calc(200px + var(--sat));
  padding: calc(12px + var(--sat)) 14px 0;
  background-color: #c9ab82;
  background-image: linear-gradient(180deg, rgba(42, 27, 16, .1), rgba(42, 27, 16, 0) 60%, var(--kinari) 100%), url(/app-development/apps/a003/img/collapse.webp);
  background-size: cover; background-position: center 45%;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.res__chip { background: var(--koge); color: var(--kinari); padding: 6px 14px; border-radius: 999px; font-size: 14px; margin-top: 8px; }
.res__body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 18px calc(18px + var(--sab));
  margin-top: -64px;
  display: flex; flex-direction: column; gap: 16px;
}
.res__card {
  background: var(--paper); border-radius: 16px; padding: 16px 16px 14px;
  box-shadow: 0 2px 0 #e2d0ac, 0 14px 30px rgba(42, 27, 16, .18);
  position: relative;
}
.res__eyebrow { font-size: 14px; color: #6a4526; }
.res__h { display: flex; align-items: baseline; gap: 6px; color: var(--koge); line-height: 1; margin-top: 2px; }
.res__h b { font-size: 64px; letter-spacing: -.03em; }
.res__h span { font-family: var(--f-num); font-weight: 600; font-size: 22px; }
.res__new {
  position: absolute; right: 16px; top: 18px;
  display: none; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  border: 3px solid var(--shu); color: var(--shu); font-family: var(--f-disp); font-size: 15px; line-height: 1.2; text-align: center;
  padding: 0 8px; transform: rotate(14deg); word-break: keep-all; background: var(--paper);
}
.res__new.is-on { display: grid; animation: newIn .5s var(--spring); }
@keyframes newIn { from { transform: scale(1.8) rotate(-10deg); opacity: 0; } }
.res__grid { display: grid; grid-template-columns: 128px 1fr; gap: 14px; margin-top: 12px; }
.res__sketch { background: #efe2c6; border-radius: 10px; padding: 6px 6px 4px; text-align: center; }
.res__sketch canvas { width: 100%; height: auto; aspect-ratio: 300 / 420; display: block; }
.res__cap { font-size: 11px; color: #5b3b23; margin-top: 2px; }
.res__stats { margin: 0; display: grid; gap: 8px; align-content: start; }
.res__stats div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed #d2bd94; padding-bottom: 6px; }
.res__stats dt { font-size: 14px; color: var(--koge-2); }
.res__stats dd { margin: 0; display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.res__stats b { font-size: 26px; color: var(--koge); line-height: 1.1; }
.res__stats span { font-size: 14px; }
.res__note { margin-top: 12px; font-size: 15px; color: var(--koge); background: #f3e7cd; border-radius: 10px; padding: 10px 12px; border-left: 4px solid var(--shu); }
.res__btns { display: flex; flex-direction: column; gap: 14px; }
.res__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ======================= 共通バー ======================= */
.bar {
  flex: none; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  padding: calc(10px + var(--sat)) 12px 10px;
  background: var(--koge); color: var(--kinari);
  position: relative; z-index: 2;
  box-shadow: 0 4px 0 #1d120a;
}
.bar__t { text-align: center; font-family: var(--f-disp); font-weight: 400; font-size: 21px; letter-spacing: .08em; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ======================= 番付 ======================= */
.scr--rank { background: var(--kinari); }
.shelf {
  position: relative;
  padding: 18px 14px 52px;
  background-color: #e6d6b8;
  overflow: hidden;
}
.shelf::before {
  content: ""; position: absolute; inset: -12px; pointer-events: none;
  background: url(/app-development/apps/a003/img/shelf.webp) center 30% / cover no-repeat;
  filter: blur(7px) saturate(.85);
  opacity: .5;
}
.shelf > * { position: relative; }
.shelf__k {
  display: inline-block; background: var(--paper); color: var(--koge); padding: 4px 12px; border-radius: 4px;
  font-size: 14px; word-break: keep-all; box-shadow: 0 3px 8px rgba(42, 27, 16, .2);
}
.shelf__row {
  margin-top: 10px; height: 246px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end;
  padding: 0 4px;
  border-bottom: 14px solid #5b3b23;
  box-shadow: 0 6px 0 #3b2618;
}
.pillar { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.pillar__v {
  background: var(--paper); color: var(--koge); border-radius: 4px; padding: 1px 5px; margin-bottom: 4px;
  font-family: var(--f-num); font-weight: 800; font-size: 14px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(42, 27, 16, .2);
}
.pillar__v small { font-weight: 600; font-size: 11px; }
.pillar__cv { display: block; transform-origin: bottom; animation: rise .7s var(--spring) backwards; }
.pillar__col { width: 70%; display: flex; flex-direction: column-reverse; gap: 2px; transform-origin: bottom; animation: rise .7s var(--spring) backwards; }
.pillar__col i { display: block; border-radius: 3px; box-shadow: inset 0 -2px 0 rgba(42, 27, 16, .25), inset 0 1px 0 rgba(255, 255, 255, .25); }
.pillar__rank {
  position: absolute; left: 50%; bottom: -46px; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-num); font-weight: 800; font-size: 14px; color: #fff8ee; background: #5b3b23;
  box-shadow: 0 2px 0 #2a1b10;
}
.pillar:first-child .pillar__rank { background: var(--shu); }
@keyframes rise { from { transform: scaleY(0); } }
.ledger { padding: 22px 16px calc(24px + var(--sab)); }
.ledger__t { font-family: var(--f-disp); font-weight: 400; font-size: 20px; color: var(--koge); margin-bottom: 10px; }
.ledger__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lrow {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  background: var(--paper); border-radius: 8px; padding: 10px 12px;
  box-shadow: 0 2px 0 #e0cda7;
  animation: rowIn .35s var(--ease-out) backwards;
}
@keyframes rowIn { from { opacity: 0; transform: translateX(-12px); } }
.lrow__no { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; font-family: var(--f-num); font-weight: 800; font-size: 18px; background: #efe2c6; color: var(--koge); }
.lrow:nth-child(1) .lrow__no { background: var(--shu); color: #fff8ee; }
.lrow:nth-child(2) .lrow__no, .lrow:nth-child(3) .lrow__no { background: var(--koge-2); color: #fff8ee; }
.lrow__h { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.lrow__h b { font-size: 24px; color: var(--koge); }
.lrow__h span { font-size: 14px; font-family: var(--f-num); font-weight: 600; }
.lrow__meta { text-align: right; font-size: 14px; color: var(--koge-2); line-height: 1.35; white-space: nowrap; }
.lrow.is-latest { box-shadow: 0 0 0 2px var(--shu), 0 2px 0 #e0cda7; }
.lrow__tag { display: inline-block; font-size: 11px; background: var(--shu); color: #fff8ee; border-radius: 3px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }
.ledger__empty { display: none; padding: 20px; text-align: center; color: var(--koge-2); word-break: keep-all; }
.ledger__empty.is-on { display: block; }
.ledger__note { margin-top: 14px; font-size: 14px; color: var(--koge-2); }

/* ======================= 遊び方・設定 ======================= */
.scr--set { background: var(--kinari); }
.scr--set .scroll {
  background-color: var(--kinari);
  background-image: linear-gradient(180deg, rgba(244, 234, 214, 0) 0, var(--kinari) 190px), url(/app-development/apps/a003/img/tools.webp);
  background-size: 100% auto, 160% auto; background-position: 0 0, 22% 0; background-repeat: no-repeat;
  padding: 120px 16px calc(28px + var(--sab));
}
.sec__t { font-family: var(--f-disp); font-weight: 400; font-size: 20px; color: var(--koge); margin: 0 0 10px; }
.howto, .setgroup, .about { background: var(--paper); border-radius: 16px; padding: 16px; box-shadow: 0 2px 0 #e0cda7, 0 10px 24px rgba(42, 27, 16, .1); margin-bottom: 16px; }
.howto__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.howto__item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.howto__fig { width: 96px; height: 64px; background: #f1e5cb; border-radius: 10px; }
.howto__h { font-weight: 500; font-size: 16px; color: var(--koge); word-break: keep-all; }
.howto__d { font-size: 14px; color: var(--koge-2); margin-top: 2px; }
.howto__rule { margin-top: 14px; padding: 10px 12px; background: #f3e7cd; border-radius: 10px; border-left: 4px solid var(--shu); font-size: 15px; color: var(--koge); word-break: keep-all; }
.howto__keys { margin-top: 10px; font-size: 14px; color: var(--koge-2); }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 0 2px; border-bottom: 1px dashed #d8c39b; cursor: pointer;
  position: relative; width: 100%; background: none; border-top: 0; border-left: 0; border-right: 0; text-align: left;
}
.row:last-child { border-bottom: 0; }
.row__l { font-size: 15px; color: var(--koge); }
.row__l--shu { color: #a3301d; font-weight: 500; }
.row--btn svg { font-size: 22px; color: #a3301d; }
.tg { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tg__ui { width: 52px; height: 32px; border-radius: 999px; background: #c9b590; position: relative; flex: none; transition: background .2s; }
.tg__ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fffaf0; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .25s var(--spring); }
.tg:checked + .tg__ui { background: var(--shu); }
.tg:checked + .tg__ui::after { transform: translateX(20px); }
.about__p { font-size: 15px; color: var(--koge); margin-bottom: 10px; }
.about__tech { list-style: none; margin: 4px 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.about__tech li { font-family: var(--f-num); font-weight: 600; font-size: 13px; background: #efe2c6; color: var(--koge); padding: 4px 10px; border-radius: 999px; }
.about__cta svg { font-size: 20px; }
.about__ver { margin-top: 12px; font-size: 14px; color: var(--koge-2); text-align: center; }

/* ---- トースト ---- */
.toast {
  position: absolute; left: 50%; bottom: calc(24px + var(--sab)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--koge); color: var(--kinari); padding: 10px 18px; border-radius: 10px; font-size: 15px;
  transition: opacity .2s, transform .25s var(--ease-out); max-width: calc(100% - 32px); width: max-content;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.nojs { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--kinari); z-index: 99; }

@media (prefers-reduced-motion: reduce) {
  .sign, .coach__hand, .demo__dot { animation: none; }
  .scr, .scr.is-active { transition: none; transform: none; }
  .pillar__col, .lrow, .splash img { animation: none; }
}
