/* どぱたんpro：試作動画のUIを引き継ぐ（黒地・ライム・オレンジ・斜めのカード） */
:root {
  --bk: #0a0b0d; --bk2: #15171a; --line: #3a3d41; --wh: #f4f4f0; --gr: #a9ab9f;
  --lime: #d4ff1e; --or: #ff5a1f;
  --en: 'Anton', 'Arial Narrow', sans-serif; --dela: 'Dela Gothic One', 'Noto Sans JP', sans-serif;
  font-size: 16px;
}
html[data-font=s] { font-size: 14px; }
html[data-font=l] { font-size: 18.5px; }
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #050506; }
body { font-family: 'Noto Sans JP', sans-serif; color: var(--wh); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
#app { position: relative; max-width: 440px; height: 100dvh; margin: 0 auto; background: var(--bk); display: flex; flex-direction: column; overflow: hidden;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px); }
#main { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 24px; }
#tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: #000; border-top: 3px solid var(--lime); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
#tabs button { padding: 9px 0; font-size: .8rem; font-weight: 700; }
#tabs button.on { background: var(--lime); color: var(--bk); font-weight: 900; transform: skewX(-12deg); }

.pad { padding: 16px; }
.note { color: var(--gr); font-size: .82rem; line-height: 1.7; margin: 10px 16px; }
.pad .note { margin: 10px 0; }
.ttl { font-family: var(--en); font-size: 2.6rem; letter-spacing: 1px; margin: 18px 16px 10px; line-height: 1; display: flex; align-items: baseline; gap: 10px; }
.ttl small { font-family: 'Noto Sans JP'; font-size: .9rem; color: var(--lime); font-weight: 900; }
.sh { font-size: .8rem; color: var(--lime); letter-spacing: 2px; margin: 22px 16px 10px; font-weight: 900; }
.pad .sh { margin-left: 0; margin-right: 0; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; font-weight: 900; border: 3px solid #000; transform: skewX(-8deg); }
.btn.lime { background: var(--lime); color: var(--bk); box-shadow: 4px 4px 0 #000; }
.btn.ghost { background: var(--bk2); border-color: var(--line); }
.btn.danger { background: var(--or); color: var(--bk); }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.small { padding: 7px 12px; font-size: .82rem; }
.btn:disabled { opacity: .35; }

/* ---------- ホーム ---------- */
.home { position: relative; min-height: 100%; padding: 14px 14px 20px; }
.hbg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hbg .vtx { position: absolute; left: 4px; top: 150px; font-family: var(--en); font-size: 110px; line-height: .9; color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.14); writing-mode: vertical-rl; letter-spacing: 4px; }
.hbg .band { position: absolute; left: -40px; right: -40px; top: 230px; height: 230px; background: var(--lime); clip-path: polygon(0 35%, 100% 0, 100% 62%, 0 100%); opacity: .92; }
.hbg .dots { position: absolute; right: -30px; top: 420px; width: 240px; height: 240px; border-radius: 50%; background-image: radial-gradient(rgba(212,255,30,.35) 1.4px, transparent 1.6px); background-size: 9px 9px; }
.htop { position: relative; display: flex; align-items: center; gap: 10px; }
.rank { flex: 1; display: flex; align-items: center; gap: 10px; }
.rank > b { background: var(--wh); color: var(--bk); font-family: var(--en); font-size: 1.8rem; padding: 4px 12px; transform: skewX(-8deg); }
.rank small { display: block; font-family: var(--en); letter-spacing: 3px; color: var(--gr); font-size: .72rem; }
.rbar { display: block; width: 120px; height: 6px; background: #2a2c30; margin: 4px 0 2px; }
.rbar i { display: block; height: 100%; background: var(--lime); }
.rank em { font-style: normal; font-size: .68rem; color: var(--gr); }
.streak { background: var(--or); color: var(--bk); padding: 6px 12px; transform: skewX(-8deg); font-weight: 900; text-align: center; }
.streak b { font-family: var(--en); font-size: 1.4rem; margin-right: 2px; }
.streak small { font-size: .72rem; }
.gear { font-size: 1.5rem; width: 40px; height: 40px; border: 2px solid var(--line); background: var(--bk2); }
.date { position: relative; margin: 18px 0 0 4px; }
.date b { display: block; font-family: var(--en); font-size: 3.4rem; line-height: 1; }
.date span { font-family: var(--en); color: var(--lime); letter-spacing: 3px; font-size: 1.1rem; }
.partner { position: relative; margin: 14px 0 0 auto; width: 58%; height: 150px; border: 2px dashed var(--lime); background: rgba(10,11,13,.82); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--lime); transform: skewX(-6deg); }
.partner span { font-family: var(--en); letter-spacing: 4px; font-size: .8rem; }
.partner b { font-family: var(--en); font-size: 1.3rem; letter-spacing: 1px; }
.cont, .revn { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 12px 14px; text-align: left; background: var(--bk2); border: 2px solid var(--line); transform: skewX(-6deg); }
.cont small, .revn small { font-family: var(--en); letter-spacing: 2px; color: var(--lime); font-size: .72rem; min-width: 64px; }
.cont b, .revn b { flex: 1; font-size: .9rem; }
.cont i { font-style: normal; font-size: 1.4rem; color: var(--lime); }
.revn { border-color: var(--or); box-shadow: 4px 4px 0 var(--or); flex-wrap: wrap; }
.revn small { color: var(--or); }
.revn em { font-style: normal; font-size: .75rem; color: var(--gr); width: 100%; padding-left: 74px; }
.learn .revn { width: calc(100% - 32px); margin: 0 16px 12px; }
.subj { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.sj { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px 10px; text-align: left; border: 3px solid #000; box-shadow: 4px 4px 0 #000; transform: skewX(-8deg); color: var(--bk); }
.sj small { font-family: var(--en); letter-spacing: 2px; font-size: .72rem; }
.sj b { font-family: var(--dela); font-size: 1.45rem; line-height: 1.15; }
.sj em { font-style: normal; font-size: .66rem; font-weight: 700; }
.lime { background: var(--lime); color: var(--bk); } .white { background: var(--wh); color: var(--bk); } .orange { background: var(--or); color: var(--bk); }

/* ---------- 学習 ---------- */
.ltabs { display: flex; gap: 8px; margin: 0 16px 14px; }
.ltabs button { flex: 1; padding: 10px 0; background: var(--bk2); border: 2px solid var(--line); font-weight: 900; transform: skewX(-8deg); }
.ltabs button.on { background: var(--lime); color: var(--bk); border-color: #000; box-shadow: 3px 3px 0 #000; }
.lvs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 16px; }
.lvs button { padding: 8px 2px; background: var(--bk2); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; }
.lvs button b { font-family: var(--en); font-size: 1.05rem; letter-spacing: 1px; }
.lvs button small { font-size: .58rem; color: var(--gr); }
.lvs button.on { background: var(--wh); color: var(--bk); border-color: #000; }
.lvs button.on small { color: #444; }
.lvinfo { margin: 10px 16px; font-size: .78rem; color: var(--gr); }
.stgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 0 16px; }
.stg { aspect-ratio: 1; background: var(--bk2); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.stg b { font-family: var(--en); font-size: 1.25rem; }
.stg small { font-size: .55rem; color: var(--gr); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
.stg.cl { background: var(--lime); color: var(--bk); border-color: #000; }
.stg.cl small { color: #333; }
.units { display: flex; flex-direction: column; gap: 10px; margin: 0 16px; }
.unit { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 14px; background: var(--bk2); border: 2px solid var(--line); transform: skewX(-5deg); }
.unit .lvt { grid-row: span 2; }
.unit b { font-size: 1rem; } .unit small { color: var(--gr); font-size: .75rem; }
.unit.cl { border-color: var(--lime); box-shadow: 4px 4px 0 var(--lime); }
.unit.file2 { border-color: var(--or); }
.lvt { display: inline-block; background: #000; color: var(--lime); font-family: var(--en); letter-spacing: 2px; font-size: .8rem; padding: 3px 8px; }

/* ---------- 遊ぶ画面の共通 ---------- */
.phead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.back { width: 40px; height: 40px; border: 2px solid var(--line); background: var(--bk2); font-size: 1.6rem; line-height: 1; }
.phd-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.phd-t b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phd-t small { font-family: var(--en); letter-spacing: 3px; color: var(--lime); font-size: .7rem; }
.qn { font-family: var(--en); font-size: 1.1rem; letter-spacing: 1px; }
.pbar { height: 6px; background: #2a2c30; margin: 0 14px; }
.pbar i { display: block; height: 100%; background: var(--lime); transition: width .3s; }
.ql { font-size: .8rem; color: var(--gr); margin: 18px 16px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bk2); border: 1px solid var(--line); padding: 4px 9px; font-family: var(--en); letter-spacing: .5px; }
.types { display: flex; flex-direction: column; gap: 8px; }
.type { display: flex; align-items: baseline; gap: 12px; padding: 13px 14px; background: var(--bk2); border: 2px solid var(--line); text-align: left; transform: skewX(-6deg); }
.type:first-child { background: var(--lime); color: var(--bk); border-color: #000; box-shadow: 4px 4px 0 #000; }
.type b { font-size: 1rem; min-width: 76px; } .type small { font-size: .75rem; opacity: .75; }

/* ---------- 単語バトル ---------- */
.battle { padding-bottom: 10px; }
.qw { margin: 6px 16px 4px; font-family: var(--en); font-size: 3rem; line-height: 1.05; letter-spacing: 1px; word-break: break-word; }
.qw.ja { font-family: var(--dela); font-size: 1.7rem; line-height: 1.35; }
.qex { margin: 4px 16px 16px; color: var(--gr); font-size: .9rem; }
.listen { margin: 14px 16px 18px; display: flex; align-items: center; gap: 12px; padding: 18px 22px; background: var(--wh); color: var(--bk); border: 3px solid #000; box-shadow: 5px 5px 0 #000; transform: skewX(-8deg); font-size: 2rem; }
.listen span { font-size: .9rem; font-weight: 900; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px; }
.ch { min-height: 66px; padding: 8px 10px; background: var(--bk2); border: 2px solid var(--line); font-size: .92rem; font-weight: 900; transform: skewX(-8deg); line-height: 1.35; }
.ok { background: var(--lime) !important; color: var(--bk) !important; border-color: #000 !important; box-shadow: 4px 4px 0 #000; }
.ngx { background: var(--or) !important; color: var(--bk) !important; border-color: #000 !important; }
.ng { opacity: .35; }
.ex { margin: 16px 16px 0; padding: 14px; background: var(--wh); color: var(--bk); border: 3px solid #000; box-shadow: 5px 5px 0 #000; }
.exw { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.exw b { font-family: var(--en); font-size: 1.5rem; letter-spacing: .5px; }
.exw span { font-size: .7rem; background: #000; color: var(--lime); padding: 1px 6px; }
.exw em { font-style: normal; font-weight: 900; width: 100%; }
.exen { margin: 10px 0 2px; font-size: .95rem; line-height: 1.5; font-weight: 700; }
.exja { margin: 0; font-size: .82rem; color: #444; line-height: 1.6; }
.say { font-size: 1rem; padding: 0 4px; }
.spell { display: flex; gap: 8px; margin: 0 16px 12px; }
.spell input { flex: 1; min-width: 0; padding: 12px; font: 900 1.3rem var(--en); letter-spacing: 1px; background: var(--bk2); color: var(--wh); border: 2px solid var(--line); }
.spell input.ok, .spell input.ngx { box-shadow: none; }
.battle > .btn.ghost.small { margin-left: 16px; }

/* ---------- 文法 ---------- */
.rule { background: var(--wh); color: var(--bk); padding: 14px; border: 3px solid #000; box-shadow: 5px 5px 0 #000; }
.rule small { font-family: var(--en); letter-spacing: 3px; color: var(--or); }
.rule p { margin: 6px 0 0; font-weight: 700; line-height: 1.7; }
.gja { margin: 0 16px 14px; font-family: var(--dela); font-size: 1.25rem; line-height: 1.5; }
.gfill { margin: 0 16px 16px; font-family: var(--en); font-size: 1.3rem; line-height: 1.5; letter-spacing: .3px; }
.gfill .blank { display: inline-block; min-width: 3.2em; padding: 0 6px; border-bottom: 3px solid var(--lime); color: var(--lime); text-align: center; }
.ch.en { font-family: var(--en); font-size: 1.1rem; letter-spacing: .3px; }
.slots { margin: 0 16px; min-height: 64px; padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; border: 2px solid var(--lime); }
.slots.good { background: rgba(212,255,30,.12); } .slots.bad { border-color: var(--or); }
.slots .empty { color: #55585c; font-size: .8rem; align-self: center; }
.pool { margin: 16px 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tile { background: var(--bk2); color: var(--wh); border: 2px solid var(--line); padding: 9px 13px; font-family: var(--en); font-size: 1.15rem; letter-spacing: .5px; transform: skewX(-8deg); }
.tile.in { background: var(--wh); color: var(--bk); border-color: #000; padding: 6px 10px; font-size: 1.05rem; }
.tile.used { opacity: .15; pointer-events: none; }
.gbtn { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin: 18px 16px 0; }
.hint { margin: 12px 16px 0; padding: 10px 12px; background: var(--bk2); border-left: 4px solid var(--lime); font-size: .85rem; }

/* ---------- 読解 ---------- */
.file { display: flex; align-items: center; gap: 14px; }
.fno { font-family: var(--en); font-size: 4.4rem; color: var(--or); line-height: 1; }
.file small { font-family: var(--en); letter-spacing: 3px; color: var(--gr); display: block; }
.file b { font-family: var(--dela); font-size: 1.5rem; display: block; }
.file em { font-style: normal; color: var(--gr); font-size: .8rem; }
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.part { padding: 14px 6px; background: var(--bk2); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px; transform: skewX(-6deg); }
.part b { font-family: var(--en); letter-spacing: 1px; } .part small { font-size: .65rem; color: var(--gr); }
.part.cl { background: var(--lime); color: var(--bk); border-color: #000; } .part.cl small { color: #333; }
.paper { margin: 14px 16px 0; padding: 16px; background: #f1efe6; color: #16171a; border: 3px solid #000; box-shadow: 6px 6px 0 var(--or); }
.paper small { font-family: var(--en); letter-spacing: 2px; color: var(--or); }
.paper p { margin: 8px 0 12px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem; line-height: 1.85; }
.paper .btn.ghost { background: #16171a; color: var(--wh); }
.paper .w { cursor: pointer; border-radius: 2px; }
.paper .w.hl { background: var(--lime); }
.paper .w.gl { text-decoration: underline dotted #ff5a1f 2px; text-underline-offset: 4px; }
.qbox { margin: 16px 16px 0; }
.qq { margin: 0; font-weight: 900; } .qja { margin: 2px 0 10px; color: var(--gr); font-size: .8rem; }
.ans { display: flex; flex-direction: column; gap: 8px; }
.qb { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; background: var(--bk2); border: 2px solid var(--line); font-weight: 700; transform: skewX(-6deg); }
.qb i { font-style: normal; font-family: var(--en); color: var(--lime); }
.wcard { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); width: calc(100% - 40px); max-width: 380px; z-index: 30; padding: 14px; background: var(--bk2); border: 3px solid var(--lime); box-shadow: 6px 6px 0 #000; }
.wcard small { font-family: var(--en); letter-spacing: 3px; color: var(--lime); }
.wcard b { display: block; font-family: var(--en); font-size: 1.9rem; letter-spacing: .5px; }
.wcard em { font-style: normal; color: var(--gr); font-size: .8rem; }
.wcard p { margin: 6px 0 10px; font-weight: 700; }
.wbtn { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 結果・記録 ---------- */
.result { padding: 24px 16px; }
.rt { font-family: var(--en); font-size: 3.4rem; margin: 0; line-height: 1; }
.rsub { color: var(--gr); margin: 4px 0 16px; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin: 0 16px; }
.result .rgrid { margin: 0; }
.rc { padding: 10px 12px; border: 3px solid #000; box-shadow: 4px 4px 0 #000; transform: skewX(-8deg); }
.rc small { font-size: .7rem; font-weight: 900; display: block; }
.rc b { font-family: var(--en); font-size: 2rem; } .rc i { font-style: normal; font-size: .9rem; margin-left: 2px; }
.miss { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.miss li { background: var(--bk2); padding: 8px 10px; font-size: .85rem; border-left: 4px solid var(--or); }
.result .sh { margin-left: 0; }
.perfect { color: var(--lime); font-weight: 900; margin: 20px 0; }
.rbtn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.prog { margin: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.prog div { display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.prog span { grid-row: span 2; font-weight: 900; font-size: .85rem; }
.prog i { display: block; height: 10px; background: linear-gradient(90deg, var(--lime) calc(var(--p) * 100%), #2a2c30 0); }
.prog em { font-style: normal; font-size: .7rem; color: var(--gr); }
.cal { margin: 0 16px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal b { font-size: .7rem; color: var(--gr); }
.cal span { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: .78rem; background: var(--bk2); }
.cal span:empty { background: none; }
.cal .st { background: var(--lime); color: var(--bk); font-weight: 900; }
.cal .rs { background: transparent; border: 2px dashed var(--lime); }
.cal .td { outline: 2px solid var(--or); }
.calk { margin: 8px 16px; font-size: .72rem; color: var(--gr); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.calk span { display: inline-block; width: 12px; height: 12px; } .calk .st { background: var(--lime); } .calk .rs { border: 2px dashed var(--lime); margin-left: 8px; }
.list { list-style: none; margin: 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--bk2); padding: 8px 10px; font-size: .82rem; }
.list b { font-family: var(--en); letter-spacing: .5px; font-size: 1rem; } .list em { font-style: normal; color: var(--or); font-weight: 900; }
.cards { margin: 0 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wc { background: var(--wh); color: var(--bk); padding: 8px 10px; border: 2px solid #000; box-shadow: 3px 3px 0 var(--lime); }
.wc b { display: block; font-family: var(--en); font-size: 1.1rem; } .wc span { font-size: .72rem; }

/* ---------- 設定・準備中 ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { padding: 10px; background: var(--bk2); border: 2px solid var(--line); font-weight: 900; transform: skewX(-8deg); }
.seg button.on { background: var(--lime); color: var(--bk); border-color: #000; }
.sw { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: var(--bk2); padding: 12px; }
.sw input { width: 22px; height: 22px; accent-color: var(--lime); grid-row: span 2; }
.sw span { font-weight: 900; } .sw small { color: var(--gr); font-size: .75rem; }
.info { background: var(--bk2); padding: 4px 14px; font-size: .85rem; line-height: 1.75; }
.info.small { font-size: .75rem; color: var(--gr); }
.soonbox { margin: 30px 16px; padding: 30px 20px; border: 2px dashed var(--line); text-align: center; }
.soonbox b { font-family: var(--dela); font-size: 1.6rem; } .soonbox p { color: var(--gr); font-size: .85rem; }

/* ---------- 演出 ---------- */
.stamp { position: absolute; left: 50%; top: 38%; z-index: 40; pointer-events: none; font-family: var(--en); font-size: 4.2rem; letter-spacing: 2px; -webkit-text-stroke: 2px #000; text-shadow: 5px 5px 0 #000; animation: stp .8s ease-out forwards; }
.stamp.ok { color: var(--lime); } .stamp.ng { color: var(--or); }
@keyframes stp { 0% { transform: translate(-50%,-50%) scale(1.8) rotate(-8deg); opacity: 0; } 20% { transform: translate(-50%,-50%) scale(1) rotate(-8deg); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%,-60%) scale(1) rotate(-8deg); opacity: 0; } }
.toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 50; background: var(--lime); color: var(--bk); font-weight: 900; padding: 10px 16px; border: 3px solid #000; white-space: nowrap; }
.calm *, .calm *::before, .calm *::after { animation: none !important; transition: none !important; }
.calm .ch, .calm .tile, .calm .btn, .calm .sj, .calm .unit, .calm .type, .calm .qb { transform: none; }

/* ---------- ダイアログ・引き継ぎ ---------- */
.modal { position: absolute; inset: 0; z-index: 60; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 20px; }
.mbox { width: 100%; max-width: 380px; background: var(--bk2); border: 3px solid var(--lime); box-shadow: 6px 6px 0 #000; padding: 16px; }
.mt { font-family: var(--dela); font-size: 1.15rem; }
.mb { font-size: .86rem; line-height: 1.7; }
.ma { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.code { font-family: var(--en); font-size: 2rem; letter-spacing: 3px; color: var(--lime); text-align: center; margin: 10px 0; }
.codein { width: 100%; padding: 12px; font: 1.3rem var(--en); letter-spacing: 3px; text-transform: uppercase; background: #000; color: var(--wh); border: 2px solid var(--line); }
.msg { color: var(--or); min-height: 1.2em; }
.info.cl { padding: 12px 14px; }
.clst { margin: 0 0 10px; font-weight: 700; }
.pair { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pair .btn { flex: 1 1 140px; font-size: .82rem; padding: 10px 8px; }

/* v0.6：ホームの「おすすめ」・消音・音量・ガチャ石 */
.rec { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; width: 100%; margin-top: 12px; padding: 12px 14px; text-align: left; background: var(--bk); color: var(--wh); border: 3px solid var(--lime); box-shadow: 5px 5px 0 #000; transform: skewX(-6deg); }
.rec small { font-family: var(--en); letter-spacing: 2px; font-size: .72rem; min-width: 64px; color: var(--lime); }
.rec b { flex: 1; font-size: 1rem; font-weight: 900; }
.rec b span { display: block; font-size: .7rem; font-weight: 700; color: var(--lime); }
.rec em { font-style: normal; font-size: .75rem; color: var(--gr); width: 100%; padding-left: 74px; order: 3; }
.rec i { font-style: normal; font-size: 1.4rem; color: var(--lime); }
.rec.rv { border-color: var(--or); } .rec.rv small, .rec.rv b span, .rec.rv i { color: var(--or); }
.vols { display: grid; gap: 8px; margin-bottom: 8px; }
.vol { display: grid; grid-template-columns: 6.5em 1fr 2.5em; align-items: center; gap: 10px; background: var(--bk2); padding: 10px 12px; }
.vol span { font-weight: 900; font-size: .85rem; }
.vol input { width: 100%; accent-color: var(--lime); }
.vol em { font-style: normal; font-family: var(--en); text-align: right; color: var(--lime); }
.soonbox .stn { font-size: 1rem; } .soonbox .stn b { font-family: var(--en); font-size: 2rem; color: var(--or); margin: 0 4px; }

/* ---- キャラの立ち絵（仮。portrait.js。動く立ち絵ができたら差し替え） ---- */
.pt{position:relative;display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-end;--cc:#d4ff1e;user-select:none;-webkit-user-select:none}
.pt-fig{position:relative;width:100%;height:100%}
.pt-fig i{position:absolute;left:50%;transform:translateX(-50%);background:var(--cc);display:block}
.pt-head{top:0;width:38%;aspect-ratio:1;border-radius:50%;box-shadow:inset -6px -6px 0 rgba(0,0,0,.18)}
.pt-body{top:36%;width:62%;height:64%;border-radius:40% 40% 8% 8%;clip-path:polygon(18% 0,82% 0,100% 100%,0 100%);opacity:.92}
.pt-item{top:52%;left:68%!important;width:22%;height:16%;border-radius:3px;background:#fff!important;opacity:.8;transform:rotate(-12deg)!important}
.pt-full{width:150px;height:300px}.pt-bust{width:160px;height:200px}.pt-bust .pt-head{width:46%}.pt-bust .pt-body{top:40%;height:60%;width:80%}
.pt-bust .pt-item{display:none}.pt-face{width:56px;height:56px}.pt-face .pt-body,.pt-face .pt-item{display:none}.pt-face .pt-head{width:100%}
.pt-mark{position:absolute;top:2%;right:4%;font:700 18px/1 sans-serif;color:#fff;text-shadow:0 0 4px #000}
.pt-face .pt-mark{font-size:12px;top:-4px;right:-4px}
.pt-name{position:absolute;bottom:4px;left:0;right:0;text-align:center;font:700 12px/1.2 "Dela Gothic One",sans-serif;color:#000;mix-blend-mode:normal}
.pt-face .pt-name{display:none}
.pt[data-expr="しょんぼり"] .pt-fig,.pt[data-expr="ガーン"] .pt-fig{filter:saturate(.5) brightness(.85)}
.pt-jump{animation:ptj .5s ease-out}.pt-shy .pt-head{animation:pts .6s ease-in-out}
@keyframes ptj{0%,100%{transform:translateY(0)}30%{transform:translateY(-22px)}60%{transform:translateY(0) scaleY(.94)}}
@keyframes pts{0%,100%{filter:none}50%{filter:hue-rotate(-20deg) saturate(2) brightness(1.1)}}
html.calm .pt-jump,html.calm .pt-shy .pt-head{animation:none}
/* 仮の立ち絵の画像があるとき（当たり判定の枠は透明にして重ねる） */
.pt.has-img .pt-fig i{background:transparent!important;box-shadow:none;clip-path:none;opacity:1}
.pt.has-img .pt-head{top:2%;width:46%}.pt.has-img .pt-body{top:24%;height:76%;width:70%}.pt.has-img .pt-item{display:none}
.pt.has-img .pt-name{display:none}
.pt-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center bottom;pointer-events:none}
.pt-bust{overflow:hidden}.pt-bust .pt-img{height:260%;object-position:center top;inset:0 0 auto 0}
.pt-face{overflow:hidden;border-radius:50%;background:color-mix(in srgb,var(--cc) 35%,#111)}.pt-face .pt-img{height:520%;width:100%;object-position:center 3%;inset:0 0 auto 0}
.pt.has-img.pt-face .pt-head{width:100%;top:0;height:100%}
/* 切って大きく見せる立ち絵（ももから上・腰から上・胸から上）。絵は上をそろえ、横は真ん中 */
.pt-thigh{--fr:.62}.pt-waist{--fr:.45}.pt-bust{--fr:.3}
.pt-thigh,.pt-waist,.pt.pt-bust{overflow:hidden}
.pt-thigh .pt-img,.pt-waist .pt-img,.pt.has-img.pt-bust .pt-img{inset:auto;top:0;left:50%;width:auto;max-width:none;height:calc(100% / var(--fr));object-fit:fill;transform:translateX(-50%)}
.pt.has-img.pt-thigh .pt-head,.pt.has-img.pt-waist .pt-head,.pt.has-img.pt-bust .pt-head{top:0;height:calc(18% / var(--fr));width:50%;aspect-ratio:auto;border-radius:0}
.pt.has-img.pt-thigh .pt-body,.pt.has-img.pt-waist .pt-body,.pt.has-img.pt-bust .pt-body{top:calc(18% / var(--fr));height:100%;width:70%}
/* 切って見せる立ち絵は上下だけ切る（横は髪が広がっても枠で切らない） */
.pt-thigh,.pt-waist,.pt.pt-bust{overflow:visible;clip-path:inset(0 -200% 0 -200%)}
/* 自動で次へ（ui.js autoNext） */
.autonx{display:block;margin:8px auto 0;padding:2px 10px;background:none;border:0;color:var(--gr);font-size:.72rem;text-decoration:underline}
.btn.auto{position:relative;overflow:hidden}
.btn.auto::after{content:'';position:absolute;left:0;bottom:0;height:3px;background:rgba(0,0,0,.45);animation:anx var(--anx,1.8s) linear forwards}
@keyframes anx{from{width:0}to{width:100%}}
html.calm .btn.auto::after{animation:none}

/* ---- いつもスマホの比率（9:19.5）。PC では高さいっぱいの縦長の画面を真ん中に（上下に空白を出さない）（2026-11-20） ---- */
#app { max-width: none; width: min(100vw, calc(100dvh * 9 / 19.5)); height: 100dvh; }

/* ---- 読みやすさ：小さめの見出しは Dela Gothic One をやめて Noto Sans JP の極太に（Dela は小さいと塗りつぶしに見える） ---- */
.sj b, .qw.ja, .gja, .mt { font-family: 'Noto Sans JP', sans-serif; font-weight: 900; letter-spacing: .04em; }
.sj b { font-size: 1.3rem; }

/* ---- キャラの顔アイコン：顔をもっと大きく（全身の絵の上 約13%を見せる） ---- */
.pt.has-img.pt-face .pt-img { inset: auto; top: -2%; left: 50%; width: auto; max-width: none; height: 760%; object-fit: fill; transform: translateX(-50%); }
/* 顔アイコン：顔の中心を基準に、顔全体（顔の高さの約2倍）を見せる */
.pt.has-img.pt-face .pt-img.pt-fc { top: 50%; left: 50%; height: calc(100% / var(--fs)); width: auto; transform: translate(calc(var(--fx) * -100%), calc(var(--fy) * -100%)); }

/* 下のタブを大きく（押しやすく）（2026-11-20） */
#tabs { padding-top: 6px; }
#tabs button { min-height: 52px; font-size: .95rem; font-weight: 900; }
/* 下のタブを少し上へ（画面の下の端から余裕をとる） */
#tabs { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

/* ---- 動く背景（2026-11-20：ホーム以外が寂しいので。試作動画の黒地・ライムの帯・網点・大きな白抜き英字と、どぱたん＋の流れる光と斜線を合わせた） ---- */
#bgfx { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; --bc: var(--lime); }
#app > #main, #app > #tabs { position: relative; z-index: 1; }
#bgfx i, #bgfx b { position: absolute; display: block; }
#bgfx .bf-glow1 { left: -40%; top: -25%; width: 110%; height: 70%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--bc) 22%, transparent), transparent 62%); animation: bfg1 26s ease-in-out infinite alternate; }
#bgfx .bf-glow2 { right: -45%; bottom: -20%; width: 120%; height: 70%; border-radius: 50%; background: radial-gradient(circle, rgba(255,90,31,.16), transparent 62%); animation: bfg2 34s ease-in-out infinite alternate; }
#bgfx .bf-band { left: -30%; right: -30%; top: 38%; height: 26%; background: var(--bc); opacity: .10; clip-path: polygon(0 40%, 100% 0, 100% 60%, 0 100%); animation: bfband 18s ease-in-out infinite alternate; }
#bgfx .bf-dots { right: -60px; top: 14%; width: 260px; height: 260px; border-radius: 50%; background-image: radial-gradient(color-mix(in srgb, var(--bc) 40%, transparent) 1.4px, transparent 1.6px); background-size: 9px 9px; opacity: .55; animation: bfdots 40s linear infinite; }
#bgfx .bf-word { left: 0; top: 60%; white-space: nowrap; font-family: var(--en); font-size: 120px; line-height: 1; letter-spacing: 6px; color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.08); transform: rotate(-8deg); animation: bfword 60s linear infinite; }
#bgfx .bf-word2 { top: 8%; font-size: 70px; -webkit-text-stroke-color: color-mix(in srgb, var(--bc) 30%, transparent); animation-duration: 80s; animation-direction: reverse; }
#bgfx .bf-lines { inset: -50%; background: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 44px); animation: bflines 50s linear infinite; }
#bgfx[data-page=home] .bf-word, #bgfx[data-page=home] .bf-band, #bgfx[data-page=home] .bf-dots { display: none; }
#bgfx[data-page=gacha] { --bc: #ff5a1f; }
@keyframes bfg1 { to { transform: translate(30%, 40%) scale(1.15); } }
@keyframes bfg2 { to { transform: translate(-25%, -45%) scale(1.1); } }
@keyframes bfband { from { transform: translateY(-30px) skewY(-2deg); } to { transform: translateY(40px) skewY(2deg); } }
@keyframes bfdots { from { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(60px); } to { transform: rotate(360deg) translateY(0); } }
@keyframes bfword { from { transform: rotate(-8deg) translateX(0); } to { transform: rotate(-8deg) translateX(-50%); } }
@keyframes bflines { to { transform: translateX(88px); } }
html.calm #bgfx * { animation: none !important; }
/* 情報を減らす（2026-11-20）：学習のステージは4列、番号だけ大きく（最初の単語は出さない） */
.stgrid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stg { aspect-ratio: 1.15; }
.stg b { font-size: 1.6rem; }
.stg small { display: none; }
/* 背景を控えめに（2026-11-20「目立ちすぎ」） */
#bgfx .bf-word { -webkit-text-stroke-color: rgba(255,255,255,.045); }
#bgfx .bf-word2 { -webkit-text-stroke-color: color-mix(in srgb, var(--bc) 14%, transparent); }
#bgfx .bf-band { opacity: .05; }
#bgfx .bf-dots { opacity: .25; }
#bgfx .bf-glow1 { opacity: .55; } #bgfx .bf-glow2 { opacity: .5; }
/* 前のパーツの密度を上げる（すき間は少し残す） */
.stgrid { gap: 6px; margin: 0 12px; }
.stg { aspect-ratio: 1.05; background: #16181c; border-color: #2c3038; }
.lvs { gap: 5px; margin: 0 12px; }

/* 2026-11-21 問題箱の直し：仕組みの説明「？」（#17）・日ごとのグラフ（#18）・ホームの物語ボタン名（#52） */
.qhelp { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0 0 0 6px; padding: 0; border-radius: 50%; border: 1px solid currentColor; background: none; color: var(--gr); font: 900 .72rem/1 'Noto Sans JP', sans-serif; vertical-align: 1px; opacity: .85; }
.rc .qhelp, .lx-sum .qhelp { color: inherit; }
.lx-rvh { margin: 10px 16px -4px; text-align: right; font-size: .72rem; color: var(--gr); }
.dgraph { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 120px; margin: 8px 16px 0; padding: 8px 8px 0; background: var(--bk2); border: 1px solid var(--line); }
.dg { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.dg i { display: block; width: 100%; min-height: 2px; background: color-mix(in srgb, var(--lime) 70%, transparent); }
.dg.td i { background: var(--or); }
.dg em { font-style: normal; font: 700 .58rem var(--en); color: var(--gr); margin-bottom: 2px; }
.dg small { font: .58rem var(--en); color: var(--gr); padding: 3px 0 4px; }
.home .pa-home .pa-read b { -webkit-line-clamp: 2; }
/* 単語の一覧：終えたステージに「CLEAR」の札（問題箱 #43。文法の一覧の「8/10」と同じく終えたことが分かるように） */
.lx-tag.lx-cl { background: var(--lime); animation: none; }
/* 動く立ち絵（2026-11-21）：動き出したら静止画と表情の記号を隠す。タップの動きはエンジンのモーションで出すので、CSS の揺れは止める */
.pt-rig { opacity: 0; }
.pt.rig-on .pt-rig { opacity: 1; }
.pt.rig-on > img.pt-img, .pt.rig-on .pt-mark { visibility: hidden; }
.pt.rig-on .pt-rig { animation: none !important; }
/* ---- iPhone（2026-11-22）：上のステータスバー・ダイナミックアイランドの下から表示する。Android・PC は env() が 0 なので変わらない ---- */
#app { margin-top: env(safe-area-inset-top); height: calc(100dvh - env(safe-area-inset-top)); width: min(100vw, calc((100dvh - env(safe-area-inset-top)) * 9 / 19.5)); }
@media (max-width: 500px) { #app { width: 100vw; } }

/* 体験版（Web のアーリーアクセス版）の印。製品版では出ない（js/trial.js） */
.date .trial-chip { display: inline-block; margin-left: 8px; padding: 2px 8px; font-family: inherit; font-size: .72rem; letter-spacing: 1px; color: #000; background: var(--or); transform: skewX(-8deg); vertical-align: middle; }
