/* ピクセル暗号 — 方眼ノートと鉛筆のデザイントークン */
:root {
  --paper: #fbfcf8;
  --paper-2: #f2f6f8;
  --grid: #a9d0e8;
  --grid-faint: #e1edf5;
  --grid-major: #5e9ec8;
  --lead: #3c4249;       /* 鉛筆の灰 */
  --sub: #555d66;
  --done: #6a7279;
  --shu: #cf3f26;        /* 朱 */
  --shu-d: #a8301b;
  --ai: #1f4f78;         /* 藍インク */
  --tape: rgba(240, 214, 140, .82);
  --hi: rgba(94, 158, 200, .16);

  --f-dot: "DotGothic16", "Hiragino Sans", sans-serif;
  --f-hand: "Klee One", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;

  --r: 4px;
  --r-btn: 10px;
  --sh-ink: 3px 3px 0 var(--ai);
  --t-press: 60ms;
  --t-scr: 260ms;
  --ease: 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-color: #dfe9ef;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--lead);
  font-family: var(--f-hand);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.65;
  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-mono); font-weight: 600; font-feature-settings: "tnum"; }
h1, h2, h3 { margin: 0; font-feature-settings: "palt"; }
p { margin: 0; }

.app {
  position: relative; width: 100%; max-width: 430px; height: 100vh; height: 100dvh;
  margin: 0 auto; overflow: hidden; isolation: isolate;
  background-color: var(--paper);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
@media (min-width: 600px) { .app { box-shadow: 0 0 0 2px var(--ai), 10px 10px 0 rgba(31, 79, 120, .35); } }
.page-grid {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid-faint) 1px, transparent 1px), linear-gradient(90deg, var(--grid-faint) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ---- 画面 ---- */
.scr {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  visibility: hidden; opacity: 0; transform: translateX(18px);
  transition: opacity var(--t-scr) var(--ease), transform var(--t-scr) var(--ease), visibility 0s linear var(--t-scr);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid-faint) 1px, transparent 1px), linear-gradient(90deg, var(--grid-faint) 1px, transparent 1px);
  background-size: 16px 16px;
}
.scr.is-active { visibility: visible; opacity: 1; transform: none; z-index: 2; transition: opacity var(--t-scr) var(--ease), transform var(--t-scr) var(--ease); }
.scroll { flex: 1; min-height: 0; 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: 0 18px; border-radius: var(--r-btn);
  font-family: var(--f-hand); font-weight: 600; font-size: 16px; text-decoration: none;
  white-space: nowrap; word-break: keep-all;
  transition: transform var(--t-press), box-shadow var(--t-press);
}
.btn svg { font-size: 20px; }
.btn--shu { background: var(--shu); color: #fff; border: 2px solid var(--ai); box-shadow: var(--sh-ink); }
.btn--paper { background: #fff; color: var(--ai); border: 2px solid var(--ai); box-shadow: var(--sh-ink); }
.btn--shu:active, .btn--paper:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ai); }
.btn--l { width: 100%; min-height: 54px; font-size: 17px; }
.btn--xl { width: 100%; min-height: 62px; font-size: 19px; }
.btn--text { background: none; border: 0; min-height: 44px; padding: 0 10px; color: var(--ai); text-decoration: underline; text-underline-offset: 4px; }
.btn:focus-visible, .ibtn:focus-visible, .tool:focus-visible, .seg__b:focus-visible, .lcard:focus-visible, .frame:focus-visible { outline: 3px solid var(--shu); outline-offset: 2px; }
.ibtn {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--r-btn);
  background: #fff; color: var(--ai); border: 2px solid var(--ai); box-shadow: 2px 2px 0 var(--ai);
  transition: transform var(--t-press), box-shadow var(--t-press);
}
.ibtn svg { font-size: 22px; }
.ibtn:active { transform: translate(2px, 2px); box-shadow: none; }
.ibtn--flat { border-color: transparent; box-shadow: none; background: transparent; }
.ibtn--flat:active { background: var(--hi); transform: none; }

/* ---- スプラッシュ ---- */
.splash { position: absolute; inset: 0; z-index: 80; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--paper); }
.splash.is-on { display: flex; animation: fadeOut .3s ease-in .7s forwards; }
.splash img { border: 2px solid var(--ai); box-shadow: 4px 4px 0 var(--ai); border-radius: 22px; animation: pop .45s var(--spring); }
.splash__name { font-family: var(--f-dot); font-size: 26px; color: var(--ai); letter-spacing: .1em; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

/* ======================= タイトル ======================= */
.scr--title {
  background-color: #eef4f8;
  background-image: url(/app-development/apps/a013/img/title.webp);
  background-size: cover; background-position: center bottom;
  padding: calc(12px + var(--sat)) 20px calc(18px + var(--sab));
}
.title__top { display: flex; justify-content: flex-end; }
.title__head { margin-top: 2vh; text-align: center; }
.title__kicker { display: inline-block; font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: .18em; color: #fff; background: var(--ai); padding: 2px 10px; }
.logo { margin-top: 12px; font-family: var(--f-dot); font-weight: 400; color: var(--ai); line-height: 1.05; display: flex; flex-direction: column; align-items: center; }
.logo__a { font-size: clamp(40px, 12.5vw, 52px); letter-spacing: .06em; background: var(--paper); padding: 0 8px; }
.logo__b { font-size: clamp(64px, 21vw, 86px); letter-spacing: .12em; color: var(--shu); background: var(--paper); padding: 0 6px 0 16px; margin-top: 2px; }
.title__lead {
  position: relative; margin: 16px auto 0; width: min(100%, 300px);
  background: #fff; padding: 12px 14px; font-size: 15px; color: var(--lead); text-align: left;
  box-shadow: 0 1px 0 #d4e2ea, 0 8px 18px rgba(31, 79, 120, .12); transform: rotate(-1deg);
  word-break: keep-all;
}
.title__lead::before, .title__lead::after { content: ""; position: absolute; top: -9px; width: 54px; height: 18px; background: var(--tape); }
.title__lead::before { left: 10px; transform: rotate(-6deg); }
.title__lead::after { right: 10px; transform: rotate(5deg); }
.title__bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.progress { display: flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--ai); padding: 6px 12px; box-shadow: 2px 2px 0 var(--ai); }
.progress__k { font-size: 14px; color: var(--ai); }
.progress b { font-size: 22px; color: var(--shu); line-height: 1; }
.progress__of { font-family: var(--f-mono); font-size: 14px; color: var(--ai); }
.progress__dots { display: grid; grid-template-columns: repeat(6, 9px); gap: 2px; margin-left: 6px; }
.progress__dots i { width: 9px; height: 9px; border: 1px solid var(--grid-major); background: #fff; }
.progress__dots i.is-on { background: var(--lead); border-color: var(--lead); }
.title__sub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.title__link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; color: var(--ai); background: #fff; text-decoration: underline; text-underline-offset: 4px; font-size: 15px; }
.title__link svg { font-size: 18px; }

/* ======================= バー ======================= */
.bar {
  flex: none; display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 8px;
  padding: calc(10px + var(--sat)) 12px 10px; background: var(--paper);
  border-bottom: 2px solid var(--ai);
}
.bar__t { text-align: center; font-family: var(--f-hand); font-weight: 600; font-size: 20px; color: var(--ai); }
.bar__r { font-size: 14px; color: var(--ai); text-align: right; white-space: nowrap; }

/* ======================= 一覧 ======================= */
.list__hero {
  height: 150px; position: relative; display: flex; align-items: flex-end; padding: 0 14px 12px;
  background-color: #8a5a35;
  background-image: url(/app-development/apps/a013/img/desk.webp); background-size: cover; background-position: center 40%;
  image-rendering: pixelated;
}
.list__note { background: #fff; padding: 6px 12px; font-size: 14px; color: var(--lead); box-shadow: 2px 2px 0 rgba(31, 79, 120, .5); word-break: keep-all; }
.chap { padding: 18px 14px 4px; }
.chap__h { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px dashed var(--grid-major); padding-bottom: 6px; margin-bottom: 12px; }
.chap__no { font-family: var(--f-dot); font-size: 15px; color: #fff; background: var(--ai); padding: 1px 8px; white-space: nowrap; }
.chap__t { font-size: 18px; color: var(--ai); }
.chap__size { margin-left: auto; font-family: var(--f-mono); font-size: 14px; color: var(--sub); white-space: nowrap; }
.chap__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lcard {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; text-decoration: none;
  background: #fff; border: 2px solid var(--ai); padding: 8px; color: var(--lead); min-height: 84px;
  box-shadow: 2px 2px 0 var(--ai); transition: transform var(--t-press), box-shadow var(--t-press);
  animation: cardIn .3s var(--ease) backwards;
}
.lcard:active { transform: translate(2px, 2px); box-shadow: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }
.lcard canvas { width: 56px; height: 56px; image-rendering: pixelated; background: var(--paper); }
.lcard__no { font-family: var(--f-mono); font-size: 13px; color: var(--ai); display: flex; justify-content: space-between; gap: 4px; }
.lcard__no .num { color: var(--sub); font-weight: 500; }
.lcard__t { font-size: 16px; color: var(--lead); line-height: 1.3; }
.lcard__s { font-size: 13px; color: var(--sub); line-height: 1.3; margin-top: 2px; white-space: nowrap; }
.lcard__s .stars { font-size: 13px; }
.lcard.is-done { border-color: var(--lead); }
.lcard.is-going .lcard__s { color: var(--shu-d); }
.list__end { padding: 18px 14px calc(26px + var(--sab)); font-size: 14px; color: var(--sub); text-align: center; }

.stars { display: inline-flex; gap: 1px; color: var(--shu); vertical-align: -2px; }
.stars svg { font-size: 1.05em; }
.stars .is-off { color: #c3ced6; }

/* ======================= プレイ ======================= */
.scr--play { background-color: var(--paper); }
.pbar { flex: none; display: grid; grid-template-columns: 46px 1fr auto 46px; align-items: center; gap: 6px; padding: calc(8px + var(--sat)) 8px 4px; }
.pbar__mid { min-width: 0; }
.pbar__no { display: flex; align-items: baseline; gap: 8px; font-family: var(--f-dot); font-size: 19px; color: var(--ai); line-height: 1.2; }
.pbar__size { font-family: var(--f-mono); font-size: 13px; color: var(--sub); }
.pbar__chap { font-size: 13px; color: var(--sub); line-height: 1.3; white-space: nowrap; }
.pbar__time { font-size: 18px; color: var(--ai); background: #fff; border: 2px solid var(--ai); padding: 2px 8px; min-width: 64px; text-align: center; }
.pbar__time.is-hidden { visibility: hidden; }
.pinfo { flex: none; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; margin: 2px 14px 6px; padding: 8px 10px; background: #fff; border: 2px solid var(--ai); box-shadow: 2px 2px 0 rgba(31, 79, 120, .35); }
.pinfo__mini { width: 64px; height: 64px; image-rendering: pixelated; border: 1px solid var(--grid); }
.pinfo__body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pinfo__story { font-size: 14px; line-height: 1.45; color: var(--lead); }
.pinfo__prog { display: flex; align-items: center; gap: 8px; }
.pinfo__prog .num { font-size: 13px; color: var(--ai); min-width: 38px; text-align: right; }
.pinfo__bar { flex: 1; height: 8px; border: 1.5px solid var(--ai); background: #fff; position: relative; overflow: hidden; }
.pinfo__bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--lead); transition: width .3s var(--ease); }
.leads { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.leads__k { font-size: 14px; color: var(--sub); }
.leads__row { display: flex; gap: 4px; }
.leads__row svg { width: 10px; height: 20px; color: var(--lead); transition: transform .2s; }
.leads__row svg.is-broken { color: var(--shu); opacity: .45; transform: rotate(-24deg) translateY(3px); }
.leads__row svg.is-snap { animation: snap .5s var(--ease); }
@keyframes snap { 0% { transform: none; } 30% { transform: rotate(-40deg) translate(-2px, -4px) scale(1.3); } 100% { transform: rotate(-24deg) translateY(3px); } }
.leads__msg { margin-left: auto; font-size: 14px; color: var(--shu-d); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.leads__msg.is-on { opacity: 1; }

.boardwrap { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 0 10px; }
.board { display: grid; position: relative; background: #fff; border: 2px solid var(--ai); box-shadow: 4px 4px 0 rgba(31, 79, 120, .35); }
.board.is-shake { animation: shake .32s; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.board__corner { grid-area: 1 / 1; background: var(--paper-2); border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.board__cols { grid-area: 1 / 2; display: flex; border-bottom: 2px solid var(--ai); }
.board__rows { grid-area: 2 / 1; display: flex; flex-direction: column; border-right: 2px solid var(--ai); }
.board__cv { grid-area: 2 / 2; display: block; touch-action: none; cursor: crosshair; }
.ccol { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 0; padding-bottom: 4px; border-right: 1px solid var(--grid); line-height: 1.12; transition: background .15s; }
.crow { display: flex; justify-content: flex-end; align-items: center; gap: 5px; padding-right: 5px; border-bottom: 1px solid var(--grid); transition: background .15s; }
.ccol:nth-child(5n), .crow:nth-child(5n) { border-color: var(--grid-major); }
.ccol:last-child { border-right: 0; }
.crow:last-child { border-bottom: 0; }
.ccol span, .crow span { font-family: var(--f-mono); font-weight: 600; color: var(--ai); }
.ccol.is-done span, .crow.is-done span { color: var(--done); text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: rgba(207, 63, 38, .7); }
.ccol.is-hot, .crow.is-hot { background: var(--hi); }
.ccol.is-flash, .crow.is-flash { animation: lineFlash .5s; }
@keyframes lineFlash { 0% { background: rgba(207, 63, 38, .22); } 100% { background: transparent; } }

.loupe {
  position: absolute; width: 120px; height: 120px; border-radius: 50%; pointer-events: none;
  border: 3px solid var(--ai); box-shadow: 3px 3px 0 rgba(31, 79, 120, .45); background: #fff;
  opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; left: 0; top: 0; z-index: 5;
}
.loupe.is-on { opacity: 1; transform: scale(1); }

.tools { flex: none; display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 10px; align-items: center; padding: 8px 12px calc(14px + var(--sab)); }
.tool {
  min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #fff; border: 2px solid var(--ai); color: var(--ai); border-radius: var(--r-btn); font-size: 14px; line-height: 1.2;
  box-shadow: 2px 2px 0 var(--ai); transition: transform var(--t-press), box-shadow var(--t-press);
}
.tool svg { font-size: 22px; }
.tool b { margin-left: 3px; font-size: 14px; color: var(--shu); }
.tool:active { transform: translate(2px, 2px); box-shadow: none; }
.tool:disabled { color: #8c969e; border-color: #b5c3cc; box-shadow: none; }
.tool:disabled b { color: #8c969e; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ai); border-radius: var(--r-btn); overflow: hidden; box-shadow: 2px 2px 0 var(--ai); background: #fff; }
.seg__b { min-height: 58px; border: 0; background: #fff; color: var(--ai); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 14px; line-height: 1.2; transition: background .15s, color .15s; }
.seg__b + .seg__b { border-left: 2px solid var(--ai); }
.seg__b svg { font-size: 24px; }
.seg__b.is-on { background: var(--ai); color: #fff; }
.seg__b[data-tool="x"].is-on { background: var(--shu); }

.sheet-bg { position: absolute; inset: 0; z-index: 40; display: flex; align-items: flex-end; background: rgba(31, 52, 70, .55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s linear .2s; }
.sheet-bg.is-on { opacity: 1; visibility: visible; transition: opacity .2s; }
.sheet {
  width: 100%; background: var(--paper); border-top: 2px solid var(--ai); padding: 14px 18px calc(20px + var(--sab));
  display: flex; flex-direction: column; gap: 12px; transform: translateY(30px); transition: transform .3s var(--spring);
}
.sheet-bg.is-on .sheet { transform: none; }
.sheet__grip { width: 40px; height: 5px; background: var(--grid-major); align-self: center; }
.sheet__t { font-size: 21px; color: var(--ai); }
.sheet__d { font-size: 15px; color: var(--lead); }
.sheet__row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.sheet--over { align-items: stretch; }
.over__fig { width: 150px; height: 50px; align-self: center; }
.is-paused .board__cv, .is-paused .board__cols, .is-paused .board__rows { filter: blur(8px); }

.clear { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; pointer-events: none; visibility: hidden; transition: visibility 0s linear .45s; }
.clear.is-on { visibility: visible; transition: none; }
.clear__card {
  pointer-events: auto; width: 100%; background: #fff; border-top: 2px solid var(--ai);
  padding: 22px 18px calc(18px + var(--sab)); position: relative;
  transform: translateY(105%); transition: transform .45s var(--spring);
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -10px 30px rgba(31, 79, 120, .2);
}
.clear.is-on .clear__card { transform: none; }
.clear__seal {
  position: absolute; right: 18px; top: -26px; width: 62px; height: 62px; display: grid; place-items: center;
  background: var(--shu); color: #fff; font-family: var(--f-hand); font-size: 34px; border: 3px double #fff; outline: 2px solid var(--shu);
  transform: rotate(10deg);
}
.clear.is-on .clear__seal { animation: seal .6s var(--spring) .25s backwards; }
@keyframes seal { from { transform: scale(2) rotate(-20deg); opacity: 0; } }
.clear__head { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.clear__art { width: 96px; height: 96px; image-rendering: pixelated; border: 2px solid var(--ai); background: var(--paper); box-shadow: 3px 3px 0 rgba(31, 79, 120, .35); }
.clear.is-on .clear__art { animation: artIn .5s var(--spring) .15s backwards; }
@keyframes artIn { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.clear__t { flex-direction: column; gap: 0 !important; }
.clear__eyebrow { font-family: var(--f-dot); font-size: 15px; color: var(--shu-d); letter-spacing: .1em; }
.clear__t { display: flex; align-items: baseline; gap: 10px; font-size: 26px; color: var(--ai); }
.clear__t .js-cno { font-family: var(--f-mono); font-size: 16px; color: var(--sub); }
.clear__msg { font-size: 17px; color: var(--lead); border-left: 3px solid var(--shu); padding: 2px 0 2px 12px; }
.clear__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.clear__stats > div { background: var(--paper-2); padding: 6px 8px; display: flex; flex-direction: column; }
.clear__k { font-size: 13px; color: var(--sub); }
.clear__stats b { font-size: 20px; color: var(--ai); line-height: 1.3; }
.clear__stats .stars { font-size: 18px; margin-top: 3px; }
.clear__best { font-size: 14px; color: var(--sub); }
.clear__best.is-new { color: var(--shu-d); }
.clear__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ======================= ギャラリー ======================= */
.gal__hero {
  height: 130px; display: flex; align-items: flex-end; padding: 0 14px 10px;
  background-color: #dcecf6; background-image: url(/app-development/apps/a013/img/journey.webp); background-size: cover; background-position: center 72%;
}
.gal__lead { background: #fff; padding: 4px 12px; font-size: 14px; color: var(--lead); box-shadow: 2px 2px 0 rgba(31, 79, 120, .5); word-break: keep-all; }
.gal { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; padding: 24px 18px calc(28px + var(--sab)); }
.frame {
  position: relative; background: #fff; padding: 10px 10px 8px; border: 0; text-align: left; color: var(--lead);
  box-shadow: 0 1px 0 #d0dde6, 0 10px 18px rgba(31, 79, 120, .14); transform: rotate(var(--rot, 0deg));
  transition: transform .2s var(--spring); animation: cardIn .35s var(--ease) backwards;
}
.frame:active { transform: rotate(0) scale(.97); }
.frame::before { content: ""; position: absolute; left: 50%; top: -9px; width: 56px; height: 18px; background: var(--tape); transform: translateX(-50%) rotate(-3deg); }
.frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; background: var(--paper); }
.frame__t { margin-top: 6px; font-size: 15px; line-height: 1.3; display: flex; justify-content: space-between; gap: 6px; }
.frame__t .num { font-size: 12px; color: var(--sub); }
.frame__s { font-size: 13px; color: var(--sub); line-height: 1.3; }
.frame.is-locked { background: var(--paper-2); box-shadow: none; border: 2px dashed var(--grid-major); }
.frame.is-locked::before { display: none; }
.frame__q { aspect-ratio: 1; display: grid; place-items: center; font-family: var(--f-dot); font-size: 44px; color: var(--ai); background-image: linear-gradient(var(--grid-faint) 1px, transparent 1px), linear-gradient(90deg, var(--grid-faint) 1px, transparent 1px); background-size: 12px 12px; background-color: #fff; }
.gal__empty { display: none; padding: 0 24px 30px; text-align: center; color: var(--sub); word-break: keep-all; }
.gal__empty.is-on { display: block; }
.sheet--art { align-items: center; text-align: center; }
.art__cv { width: min(64vw, 240px); height: auto; aspect-ratio: 1; image-rendering: pixelated; border: 2px solid var(--ai); box-shadow: 4px 4px 0 rgba(31, 79, 120, .35); background: var(--paper); }
.art__msg { font-size: 16px; color: var(--lead); }
.art__rec { font-size: 14px; color: var(--sub); }

/* ======================= 設定 ======================= */
.scr--set .scroll { padding: 16px 14px calc(26px + var(--sab)); }
.card { background: #fff; border: 2px solid var(--ai); box-shadow: 3px 3px 0 rgba(31, 79, 120, .4); padding: 14px 14px 16px; margin-bottom: 18px; }
.sec__t { font-size: 19px; color: var(--ai); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sec__t::before { content: ""; width: 10px; height: 10px; background: var(--shu); }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rule { display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: start; }
.rule__fig { width: 104px; height: 52px; background: var(--paper-2); }
.rule__h { font-size: 16px; color: var(--ai); line-height: 1.4; word-break: keep-all; }
.rule__d { font-size: 14px; color: var(--lead); margin-top: 2px; }
.rules__tip { margin-top: 14px; padding: 8px 12px; background: var(--paper-2); border-left: 3px solid var(--shu); font-size: 14px; word-break: keep-all; }
.rules__keys { margin-top: 10px; font-size: 14px; color: var(--sub); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; border-bottom: 1px dashed var(--grid); position: relative; width: 100%; background: none; border-top: 0; border-left: 0; border-right: 0; padding: 0 2px; text-align: left; cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row__l { font-size: 15px; color: var(--lead); }
.row__l--shu { color: var(--shu-d); }
.row--btn svg { font-size: 22px; color: var(--shu-d); }
.tg { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tg__ui { width: 50px; height: 28px; border: 2px solid var(--ai); background: #fff; position: relative; flex: none; transition: background .15s; }
.tg__ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: var(--ai); transition: transform .2s var(--spring), background .15s; }
.tg:checked + .tg__ui { background: var(--ai); }
.tg:checked + .tg__ui::after { transform: translateX(22px); background: #fff; }
.row:focus-within .tg__ui { outline: 3px solid var(--shu); outline-offset: 2px; }
.about__p { font-size: 15px; color: var(--lead); margin-bottom: 10px; user-select: text; -webkit-user-select: text; }
.about__tech { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.about__tech li { font-family: var(--f-mono); font-size: 13px; border: 1px solid var(--grid-major); color: var(--ai); padding: 2px 8px; background: var(--paper); }
.about__ver { margin-top: 12px; text-align: center; font-size: 14px; color: var(--sub); }

/* ======================= オンボーディング ======================= */
.onb { position: absolute; inset: 0; z-index: 70; background: var(--paper); display: none; flex-direction: column; }
.onb.is-on { display: flex; }
.onb__track { flex: 1; min-height: 0; display: flex; transition: transform .4s var(--ease); }
.onb__page { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(30px + var(--sat)) 26px 10px; text-align: center; }
.onb__img { width: min(78vw, 300px); height: auto; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--ai); box-shadow: 4px 4px 0 rgba(31, 79, 120, .35); image-rendering: pixelated; }
.onb__t { margin-top: 22px; font-size: 22px; color: var(--ai); }
.onb__d { margin-top: 8px; font-size: 15px; color: var(--lead); word-break: keep-all; }
.onb__foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 16px calc(18px + var(--sab)); }
.onb__dots { display: flex; gap: 6px; }
.onb__dots i { width: 10px; height: 10px; border: 2px solid var(--ai); }
.onb__dots i.is-on { background: var(--ai); }
.onb__foot .js-onbnext { justify-self: end; min-width: 110px; }

.toast { position: absolute; left: 50%; bottom: calc(96px + var(--sab)); z-index: 90; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--ai); color: #fff; padding: 8px 16px; font-size: 15px; transition: opacity .2s, transform .25s var(--ease); 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(--paper); z-index: 99; }

@media (prefers-reduced-motion: reduce) {
  .scr, .scr.is-active { transition: none; transform: none; }
  .lcard, .frame, .splash img, .clear__seal { animation: none !important; }
  .onb__track { transition: none; }
}
.vh { color: var(--lead); position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
