/* どっちクエストの見た目。UI ルール kit v2 に沿う：極太ロゴ＋硬い影／厚みのあるメインボタン／素材の HUD カード。
   広告帯（#adbar）は画面の下に固定の高さで確保し、ゲームと重ねない。押せるものは広告から離す。 */
:root {
  --ink: #f7efdf;
  --paper: #f6eedd;
  --paper-ink: #2a1a10;
  --accent: #e9c74a;
  --accent-ink: #2a1405;
  --accent-shadow: #a8831a;
  --logo-shadow: #8a4b1b;
  --bg1: #0f1b33;
  --bg2: #22385c;
  --ok: #3fb37f;
  --ng: #e0705f;
  --font: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; flex-direction: column; min-height: 100dvh;
  background: linear-gradient(180deg, var(--bg1), var(--bg2)); color: var(--ink);
  font-family: var(--font); font-weight: 500; touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  /* 単語の途中で改行しない（日本語は文節の切れ目で折る） */
  word-break: keep-all; overflow-wrap: anywhere; line-break: strict;
}
#app { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); min-height: 0; } /* 広告なし（子ども向けのため）。下は安全域だけ空ける */
button { font-family: inherit; color: inherit; }
ruby rt { font-size: .5em; font-weight: 500; }

.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; animation: rise .4s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- タイトル・ホーム ---- */
.logo { font-weight: 700; font-size: 44px; line-height: 1.15; text-align: center; margin: 14px 0 4px; color: var(--accent); text-shadow: 0 6px 0 var(--logo-shadow); letter-spacing: .02em; }
.tag { text-align: center; font-size: 16px; opacity: .9; margin: 0 0 10px; }
.ver { text-align: center; font-size: 12px; opacity: .6; margin-top: 8px; }
.stage-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.chara { font-size: 112px; line-height: 1; filter: drop-shadow(0 10px 6px rgba(0,0,0,.35)); animation: bob 2.4s ease-in-out infinite; }
.chara.s1 { font-size: 128px; } .chara.s2 { font-size: 144px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.cname { margin-top: 8px; font-weight: 700; font-size: 22px; }
.cstage { font-size: 13px; opacity: .75; }

.card { background: var(--paper); color: var(--paper-ink); border-radius: 12px; padding: 12px 14px; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.statrow { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; }
.lv { font-size: 22px; }
.coins { font-size: 14px; }
.bar { height: 12px; border-radius: 6px; background: rgba(42,26,16,.18); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .5s ease-out; }
.sub { font-size: 13px; margin-top: 6px; opacity: .85; }
.goal { margin-top: 10px; }

.ctl { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.btn-main {
  width: 100%; min-height: 66px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 22px;
  box-shadow: 0 6px 0 var(--accent-shadow); transition: transform .08s, box-shadow .08s;
}
.btn-main:active, .btn-main.pressed { transform: translateY(5px); box-shadow: 0 1px 0 var(--accent-shadow); }
.btn-sub { width: 100%; min-height: 48px; border: 2px solid rgba(247,239,223,.5); border-radius: 14px; background: transparent; font-weight: 700; font-size: 16px; cursor: pointer; }

/* ---- 相棒えらび ---- */
.pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0; }
.pick button { background: var(--paper); color: var(--paper-ink); border: 3px solid transparent; border-radius: 12px; padding: 10px 4px; cursor: pointer; font-weight: 700; font-size: 14px; min-height: 84px; }
.pick button .em { display: block; font-size: 40px; line-height: 1.1; }
.pick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,199,74,.4); }
.namebox { width: 100%; font-size: 20px; padding: 12px; border-radius: 12px; border: 0; background: var(--paper); color: var(--paper-ink); text-align: center; font-family: inherit; font-weight: 700; }
.label { font-size: 14px; margin: 8px 0 2px; opacity: .9; }

/* ---- 問題 ---- */
.hud { display: flex; align-items: center; gap: 10px; }
.stamp { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #b6452f; color: #b6452f; display: grid; place-items: center; font-weight: 700; font-size: 16px; transform: rotate(-6deg); }
.hud .meta { flex: 1; min-width: 0; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 8px; background: rgba(42,26,16,.12); }
.chip.review { background: #b6452f; color: #fff; }
.pips { display: flex; gap: 4px; margin-top: 6px; }
.pips i { flex: 1; height: 6px; border-radius: 3px; background: rgba(42,26,16,.18); }
.pips i.done { background: var(--accent-shadow); } .pips i.now { background: #b6452f; }
.qbox { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 10px 4px; }
.qtext { font-size: 24px; font-weight: 700; line-height: 1.9; text-align: center; max-width: 100%; }
.choices { display: grid; grid-template-columns: 1fr; gap: 12px; }
.choice { min-height: 72px; border: 0; border-radius: 16px; background: var(--paper); color: var(--paper-ink); font-weight: 700; font-size: 22px; cursor: pointer; box-shadow: 0 5px 0 #b9ad92; padding: 8px 12px; line-height: 1.7; }
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 #b9ad92; }
.choice.ok { background: var(--ok); color: #05261a; box-shadow: 0 5px 0 #20714f; }
.choice.ng { background: var(--ng); color: #3a0d06; box-shadow: 0 5px 0 #8f3a2c; }
.choice:disabled { cursor: default; }
.explain { margin-top: 10px; min-height: 0; }
.explain .judge { font-weight: 700; font-size: 18px; }
.explain .judge.ok { color: #1f7a55; } .explain .judge.ng { color: #a8412f; }
.explain p { margin: 4px 0 0; font-size: 16px; line-height: 1.9; }
.gain { float: right; font-weight: 700; font-size: 15px; }

/* ---- セット完了 ---- */
.result-big { text-align: center; font-weight: 700; font-size: 20px; margin: 10px 0 0; }
.chest { font-size: 72px; text-align: center; margin-top: 6px; }
.lines { text-align: center; font-size: 17px; line-height: 2; }
.lines b { color: var(--accent); }
.levelup { text-align: center; font-weight: 700; font-size: 26px; color: var(--accent); text-shadow: 0 4px 0 var(--logo-shadow); margin-top: 6px; }

.msg { text-align: center; padding: 30px 10px; line-height: 2; }
#app { overflow-y: auto; } /* 収まらないときは縦にスクロール（ボタンが隠れて押せなくならないように） */
@media (max-height: 640px) {
  .pick button { min-height: 68px; padding: 6px 2px; } .pick button .em { font-size: 32px; } .pick { gap: 8px; margin: 4px 0; }
  .tag { font-size: 14px; margin-bottom: 4px; } .label { margin: 4px 0 2px; } .namebox { padding: 8px; font-size: 18px; }
  .btn-main { min-height: 56px; font-size: 20px; } .ctl { margin-top: 8px; }
  .chara { font-size: 84px; } .chara.s1 { font-size: 96px; } .chara.s2 { font-size: 108px; }
  .logo { font-size: 36px; } .qtext { font-size: 21px; line-height: 1.8; } .choice { min-height: 60px; font-size: 20px; }
}
/* ---- 仲間・ぼうけん・戦い ---- */
.foes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.foe { background: var(--paper); color: var(--paper-ink); border: 0; border-radius: 12px; padding: 8px 4px; cursor: pointer; box-shadow: 0 3px 0 #b9ad92; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; line-height: 1.3; min-height: 118px; }
.foe .bicon { font-size: 30px; } .foe small { font-size: 11px; opacity: .8; } .foe .cost { font-weight: 700; margin-top: auto; }
.foe:disabled { opacity: .5; cursor: default; }
.chip { margin-left: 4px; background: var(--accent); color: var(--accent-ink); }
.chara.tiny { font-size: 36px; animation: none; filter: none; }
.party-row { display: flex; gap: 10px; margin-top: 6px; }
.mini { background: var(--paper); color: var(--paper-ink); border: 0; border-radius: 12px; padding: 4px 12px; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 44px; }
.h2 { margin: 6px 0 2px; text-align: center; font-size: 26px; font-weight: 700; color: var(--accent); text-shadow: 0 4px 0 var(--logo-shadow); }
.center { text-align: center; }
.bosslist { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bhead { display: flex; align-items: center; gap: 10px; }
.bicon { font-size: 40px; line-height: 1; } .bicon.big { font-size: 64px; } .bicon.hurt { animation: hurt .2s linear; }
@keyframes hurt { 0%, 100% { transform: none; } 50% { transform: translateX(6px); filter: brightness(1.8); } }
.boss.locked { opacity: .65; }
.stars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.star { min-height: 52px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 3px 0 var(--accent-shadow); line-height: 1.3; }
.star .sn { display: block; font-size: 18px; } .star .cost { display: block; font-size: 14px; } .star small { display: block; font-size: 11px; font-weight: 500; }
.star.lock { background: rgba(42,26,16,.15); } .tk { margin-top: 8px; text-align: center; }
.star:disabled { background: rgba(42,26,16,.2); color: rgba(42,26,16,.65); box-shadow: none; cursor: default; }
.moves { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mv { display: flex; flex-direction: column; align-items: center; min-width: 46px; padding: 2px 4px; border-radius: 8px; background: rgba(42,26,16,.1); font-size: 20px; }
.mv small { font-size: 10px; } .mv.strong { background: #e8b0a3; }
.order { display: flex; flex-direction: column; gap: 6px; }
.orow { display: flex; align-items: center; gap: 8px; background: var(--paper); color: var(--paper-ink); border-radius: 12px; padding: 4px 8px; }
.orow span { font-weight: 700; width: 16px; } .orow b { flex: 1; min-width: 0; } .orow small { font-size: 12px; }
.mv-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 18px; cursor: pointer; }
.mv-btn:disabled { opacity: .3; cursor: default; }
.skills { display: flex; flex-direction: column; gap: 6px; }
.skill { text-align: left; padding: 8px 12px; border-radius: 12px; border: 3px solid transparent; background: var(--paper); color: var(--paper-ink); cursor: pointer; min-height: 48px; }
.skill small { display: block; font-size: 12px; opacity: .8; } .skill[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,199,74,.4); }
.btop .grow { flex: 1; min-width: 0; }
.hp { height: 12px; border-radius: 6px; background: rgba(42,26,16,.2); overflow: hidden; margin-top: 4px; }
.hp i { display: block; height: 100%; background: #d9564a; transition: width .4s ease-out; }
.hp.small { height: 8px; } .hp.small i { background: var(--ok); }
.tele { margin-top: 10px; text-align: center; font-weight: 700; font-size: 18px; background: rgba(247,239,223,.12); border-radius: 12px; padding: 8px; min-height: 44px; }
.tele span { font-size: 12px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 1px 6px; margin-right: 6px; }
.msg2 { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 700; font-size: 20px; line-height: 1.7; padding: 6px; min-height: 0; }
.partybar { display: flex; gap: 8px; margin-bottom: 8px; }
.pm { flex: 1; min-width: 0; background: var(--paper); color: var(--paper-ink); border-radius: 12px; padding: 6px; text-align: center; font-size: 13px; }
.pm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pm.down { opacity: .45; } .pm .hpn { font-size: 12px; }
.choices.act { grid-template-columns: 1fr 1fr; }
@media (prefers-reduced-motion: reduce) { .screen, .chara, .bicon.hurt { animation: none; } .bar > i { transition: none; } }

/* =====================================================================
   ドット絵RPGの見た目（2026-11-17）。上の基本の見た目を、ここで上書きする。
   方針：ドット書体／角の立った独自の枠（金の二重線＋濃い縁）／押せる所は ▶ で示す（2ボタン操作のため）。
   既存のRPGの青いウィンドウは真似しない。
   ===================================================================== */
:root {
  --font: 'DotGothic16', 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', sans-serif;
  --night1: #120e26; --night2: #26214d;
  --win: rgba(28, 22, 58, .92);   /* ウィンドウの地（夜の藍） */
  --win-ink: #f6eedd;
  --frame: #e3c06a;               /* 枠の金 */
  --edge: #0d0a1c;                /* 枠の外側の濃い縁 */
  --paper: #2b2557; --paper-ink: #f6eedd;  /* 旧「紙」のカード類も夜のウィンドウに揃える */
  --accent: #f2c14e; --accent-ink: #2a1405; --accent-shadow: #8c5a12;
  --logo-shadow: #5a2a12;
}
body { background: linear-gradient(180deg, var(--night1), var(--night2)); font-weight: 400; letter-spacing: .02em; }
button, input { font-family: var(--font); }
b, .lv, .judge, .cname, .result-big { font-weight: 400; }

/* 枠：金の線を濃い縁ではさむ。角は丸めない（ドットの世界） */
.win, .card {
  background: var(--win); color: var(--win-ink); border-radius: 0;
  box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px var(--frame), 0 0 0 6px var(--edge), 0 8px 0 6px rgba(0,0,0,.35);
  margin: 6px;
}
.btn-main {
  border-radius: 0; background: var(--accent); color: var(--accent-ink); font-size: 22px; font-weight: 400;
  box-shadow: 0 0 0 3px var(--edge), 0 6px 0 3px var(--edge); margin: 4px 3px 10px; width: calc(100% - 6px);
}
.btn-main:active { transform: translateY(4px); box-shadow: 0 0 0 3px var(--edge), 0 2px 0 3px var(--edge); }
.btn-sub { border-radius: 0; border: 0; background: var(--win); color: var(--win-ink); box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #8d84b8, 0 0 0 6px var(--edge); margin: 6px; width: calc(100% - 12px); font-weight: 400; }

/* 選んでいる所（▶）。2ボタン端末では「つぎへ」で動き「きめる」で押す */
.sel { position: relative; outline: none; }
body.kbnav .sel::before { content: '▶'; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--frame); animation: blink 1s steps(2) infinite; font-size: 16px; }
body.kbnav .btn-main.sel::before { color: var(--accent-ink); }
@keyframes blink { 50% { opacity: 0; } }

/* ドット絵のキャラ（整数倍で拡大するので、ぼかさない） */
.sprite { image-rendering: pixelated; background-repeat: no-repeat; }
.sprite.idle { animation: hop 1.2s steps(2) infinite; }
@keyframes hop { 50% { transform: translateY(-3px); } }

/* ---- ホーム ---- */
.home {
  position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0;
  margin: calc(-10px - env(safe-area-inset-top, 0px)) -16px calc(-16px - env(safe-area-inset-bottom, 0px));
  background: #3f6b2a url(img/bg-home.png) 28% top / cover no-repeat; image-rendering: pixelated;
}
.scene { position: relative; flex: 1; min-height: 210px; }
.home { container-type: size; }
.hud-l { position: absolute; left: 10px; top: calc(10px + env(safe-area-inset-top, 0px)); padding: 6px 10px; min-width: 150px; font-size: 15px; }
.hud-l .lvl { margin-left: 8px; color: var(--frame); }
.xp { height: 6px; background: #0d0a1c; margin-top: 4px; } .xp i { display: block; height: 100%; background: #7fd36b; }
.hud-r { position: absolute; right: 10px; top: calc(10px + env(safe-area-inset-top, 0px)); padding: 6px 10px; display: flex; flex-direction: column; font-size: 14px; line-height: 1.5; }
/* 相棒は背景の地面（絵の高さの58.5%の所）を歩く。背景は cover なので、絵の高さ＝max(画面の高さ, 幅×1.5)。
   .actor は地面の上の「通り道」（左右に少し余白）。.walker がその中を行き来し、端で向きを変える */
.actor { position: absolute; left: 6%; right: 6%; top: min(calc(max(100cqh, 150cqw) * .585), calc(100% - 6px)); height: 0; z-index: 1; } /* 地面がパネルより下になる画面では、パネルのすぐ上に立つ */
.home-walk { position: absolute; bottom: 0; animation: stroll 24s linear infinite; }
.walker.paused { animation-play-state: paused; }
.pet { display: flex; flex-direction: column; align-items: center; background: transparent; border: 0; padding: 0; cursor: pointer; min-width: 44px; min-height: 44px; }
.pet .shadow { width: 70%; height: 8px; background: rgba(0,0,0,.28); margin-top: -4px; }
body.kbnav .pet.sel::before { display: none; }
body.kbnav .pet.sel .sprite { filter: drop-shadow(0 0 3px #fff7c2) drop-shadow(0 0 1px #e3c06a); } /* 2ボタン操作で選んでいるときは光る */
.pet.react-jump .sprite { animation: react-jump .5s steps(4) 2 !important; }
.pet.react-spin .sprite { animation: react-spin .8s steps(6) 1 !important; }
.pet.react-happy .sprite { animation: react-happy .25s steps(2) 4 !important; }
@keyframes react-jump { 50% { transform: translateY(-28px); } }
@keyframes react-spin { 0% { transform: scaleX(1); } 25% { transform: scaleX(0.2); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(0.2); } 100% { transform: scaleX(1); } }
@keyframes react-happy { 50% { transform: translateY(-8px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .home-walk, .pet .sprite { animation: none !important; } }
.panel { position: relative; z-index: 2; padding: 0 14px calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
.goal { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 15px; margin-top: 0; }
.goal .pips { display: flex; gap: 4px; } .goal .pips i { width: 18px; height: 10px; background: #0d0a1c; box-shadow: inset 0 0 0 1px #6b6294; } .goal .pips i.on { background: var(--accent); }
.goal .goal-t { margin-left: auto; color: var(--frame); }
.notice { position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(320px, calc(100% - 40px)); padding: 8px 12px; font-size: 14px; color: var(--frame); z-index: 2; animation: toast 4.5s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }
.menu { display: flex; flex-direction: column; padding: 4px 0; }
.mrow { display: flex; justify-content: space-between; align-items: center; background: transparent; border: 0; color: var(--win-ink); font-size: 19px; min-height: 52px; padding: 0 16px 0 34px; cursor: pointer; text-align: left; }
.mrow + .mrow { border-top: 2px dashed rgba(227,192,106,.25); }
.mrow small { font-size: 14px; color: var(--frame); }
.ver { color: rgba(246,238,221,.6); }

/* ---- なかま ---- */
.sub-note { padding: 8px 12px; font-size: 14px; }
.plist { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.prow { display: flex; align-items: center; gap: 12px; background: var(--win); color: var(--win-ink); border: 0; padding: 8px 12px 8px 30px; min-height: 64px; cursor: pointer; text-align: left;
  box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #6b6294, 0 0 0 6px var(--edge); margin: 6px; }
.prow.picked { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px var(--frame), 0 0 0 6px var(--edge); }
.prow .pn { flex: 1; display: flex; flex-direction: column; } .prow small { font-size: 13px; opacity: .85; }
.chip { border-radius: 0; background: var(--accent); color: var(--accent-ink); }

/* ほかの画面の部品も夜の色に揃える */
.choice, .pick button, .orow, .skill, .star, .foe, .pm, .mini { border-radius: 0; }
.choice { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #8d84b8, 0 0 0 6px var(--edge); margin: 6px; font-weight: 400; }
.choice:active { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #8d84b8, 0 0 0 6px var(--edge); }
.choice.ok { background: #2f8f5b; color: #f6eedd; box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #9ef0b8, 0 0 0 6px var(--edge); }
.choice.ng { background: #a23b2c; color: #f6eedd; box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #ffb09f, 0 0 0 6px var(--edge); }
.explain .judge.ok { color: #8fe3a8; } .explain .judge.ng { color: #ff9c86; }
.stamp { border-color: var(--frame); color: var(--frame); }
.chip.review { background: #b6452f; color: #fff; }
.pips i { background: rgba(255,255,255,.15); } .pips i.done { background: var(--frame); } .pips i.now { background: #ff7a5c; }
.h2 { font-weight: 400; color: var(--frame); text-shadow: 0 3px 0 var(--edge); }
.logo { font-weight: 400; color: var(--accent); text-shadow: 0 5px 0 var(--edge); }
.star { box-shadow: 0 0 0 2px var(--edge); } .star:disabled { background: rgba(255,255,255,.08); color: rgba(246,238,221,.55); }
.foe { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #6b6294, 0 0 0 6px var(--edge); margin: 6px; }
.mv { background: rgba(255,255,255,.08); } .mv.strong { background: #7a2f3a; }
.orow { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #6b6294, 0 0 0 6px var(--edge); margin: 6px; }
.skill { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #6b6294, 0 0 0 6px var(--edge); margin: 6px; border: 0; padding-left: 30px; }
.skill[aria-pressed="true"], .pick button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px var(--frame), 0 0 0 6px var(--edge); }
.pick button { border: 0; box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #6b6294, 0 0 0 6px var(--edge); margin: 6px; }
.namebox { border-radius: 0; background: var(--win); color: var(--win-ink); box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px var(--frame), 0 0 0 6px var(--edge); margin: 6px; width: calc(100% - 12px); font-family: var(--font); }
.mv-btn { border-radius: 0; }
.tele { border-radius: 0; background: var(--win); box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #a8455a, 0 0 0 6px var(--edge); margin: 6px; font-weight: 400; }
.hp { border-radius: 0; } .hp i { background: #e0573f; } .hp.small i { background: #7fd36b; }
.msg2 { font-weight: 400; }
.chara.tiny { font-size: 30px; }
@media (prefers-reduced-motion: reduce) { .sprite.idle, body.kbnav .sel::before { animation: none; } }

/* 相棒えらび：ドット絵を中央に */
.pick button { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 96px; }

/* ---- 背景つきの画面（問題・戦闘）。ホームと同じく画面いっぱいに背景を敷く ---- */
.stage {
  position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0;
  margin: calc(-10px - env(safe-area-inset-top, 0px)) -16px calc(-16px - env(safe-area-inset-bottom, 0px));
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #10101e var(--bgimg) center top / cover no-repeat; image-rendering: pixelated;
}
.bg-study { --bgimg: url(img/bg-study.png); }
.bg-battle { --bgimg: url(img/bg-battle.png); }
.px { display: inline-block; background-repeat: no-repeat; image-rendering: pixelated; vertical-align: middle; flex: none; }
.px.ico { margin: 0 2px; position: relative; top: -1px; }

/* 問題 */
.qwin { padding: 18px 14px; max-width: 100%; }
.qwin .qtext { font-size: 23px; line-height: 2; }
/* 問題を解いている間、相棒は足もとを左右にゆっくり歩く（端で向きを変える）。答えると立ち止まって反応する */
.buddy { align-self: stretch; margin: -8px 8px 0; height: 0; overflow: visible; position: relative; z-index: 1; }
.buddy .walker { position: absolute; bottom: -6px; left: 0; animation: stroll 14s linear infinite; }
.buddy .sprite.walk { animation: hop 0.6s steps(2) infinite; }
@keyframes stroll {
  0% { left: 0%; transform: translateX(0) scaleX(1); }
  46% { left: 100%; transform: translateX(-100%) scaleX(1); }
  50% { left: 100%; transform: translateX(-100%) scaleX(-1); }
  96% { left: 0%; transform: translateX(0) scaleX(-1); }
  100% { left: 0%; transform: translateX(0) scaleX(1); }
}
.buddy.cheer .walker, .buddy.sad .walker { animation-play-state: paused; }
.buddy.cheer .sprite { animation: cheer .5s steps(3) 2 !important; }
.buddy.sad .sprite { animation: sad .6s steps(4) 1 !important; }
@keyframes cheer { 50% { transform: translateY(-14px); } }
@keyframes sad { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.explain .card { padding: 10px 14px; }

/* 戦闘 */
.bhud { padding: 8px 12px; } .bhud .hp { height: 10px; }
.arena { flex: 1; display: flex; align-items: flex-end; justify-content: center; min-height: 120px; padding-bottom: 4px; overflow: hidden; }
.foe-art.hurt { animation: hurt .2s steps(2); }
.foe-art .px { filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
.msgwin { padding: 10px 14px; min-height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 18px; line-height: 1.6; }
.partybar { margin-top: 2px; }
.pm { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #6b6294, 0 0 0 6px var(--edge); margin: 6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 96px; }
.pm.hit { animation: sad .3s steps(4); }
.choices.act .choice { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ぼうけんの一覧の絵 */
.bart { display: inline-flex; align-items: flex-end; justify-content: center; min-width: 60px; }
.qmark { font-size: 36px; color: var(--frame); }
.fart { display: flex; align-items: flex-end; justify-content: center; height: 52px; }
/* ふつうの敵の特徴は、絵そのものを その色に染めて見分ける（もとの色に関係なく赤・青・金に見えるように）。
   sepia で一度色をそろえてから回すので、ドットの明るさの差（陰影）は残る。まわりの光も同じ色にする */
.aura-red { filter: sepia(1) saturate(5) hue-rotate(-45deg) brightness(.95) drop-shadow(0 0 2px #ff4a3a); }
.aura-blue { filter: sepia(1) saturate(4) hue-rotate(175deg) brightness(.95) drop-shadow(0 0 2px #4aa8ff); }
.aura-gold { filter: sepia(1) saturate(3.5) hue-rotate(5deg) brightness(1.15) drop-shadow(0 0 2px #ffd34a); }
.faded { filter: grayscale(.6) brightness(.7); }
.chest .px { display: block; margin: 0 auto; }
.pick.roles button .px { margin-bottom: 2px; }

/* はじめの画面を詰める（スマホの高さでも「はじめる」が見えるように） */
.pick button { min-height: 84px; padding: 6px 2px; }
.logo { font-size: 34px; margin: 4px 0 2px; }
.tag { margin-bottom: 4px; }
@media (max-height: 760px) {
  .logo { font-size: 28px; } .pick { gap: 6px; } .pick button { min-height: 72px; }
  .pick.roles button small { display: none; }
}
@media (prefers-reduced-motion: reduce) { .buddy .sprite, .buddy .walker, .foe-art.hurt, .pm.hit { animation: none !important; } }

/* 結果の画面は背景を暗くして文字を読みやすくする */
.stage.dim { background-image: linear-gradient(rgba(10,8,24,.55), rgba(10,8,24,.75)), var(--bgimg); }
.result-big { text-shadow: 0 3px 0 var(--edge); font-size: 22px; }
.lines { text-shadow: 0 2px 0 var(--edge); }

/* ---- おみせ・おへや ---- */
.shophead { display: flex; justify-content: space-between; gap: 10px; }
.shoplist { overflow-y: auto; flex: 1; min-height: 0; }
.fbox { width: 56px; display: flex; justify-content: center; align-items: center; }
.price { font-size: 14px; color: var(--frame); white-space: nowrap; }
.roombox { position: relative; height: min(46dvh, 360px); aspect-ratio: 195 / 292; margin: 6px auto; background: url(img/bg-room.png) center / 100% 100% no-repeat; image-rendering: pixelated;
  box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px var(--frame), 0 0 0 6px var(--edge); flex: none; }
.rp { position: absolute; display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.rp.idle-rp { animation: hop-rp 1.2s steps(2) infinite; }
@keyframes hop-rp { 50% { translate: 0 -1%; } } /* transform（位置合わせ）とぶつからないよう translate で跳ねる */
.rmark { position: absolute; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px dashed #fff; pointer-events: none; animation: blink 1s steps(2) infinite; }
.slots .mrow { min-height: 44px; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .rp.idle-rp, .rmark { animation: none; } }

/* 名前の欄：見本は灰色で出す（書いた文字と見分けられるように） */
.namebox::placeholder { color: #8a84a8; opacity: 1; }

/* ---- エフェクト（fx.js）。どれも押せない飾りで、すぐ消える ---- */
.fx { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -50%); }
.fx-float { font-family: var(--font); font-size: 22px; text-shadow: 0 2px 0 var(--edge), 2px 0 0 var(--edge), -2px 0 0 var(--edge), 0 -2px 0 var(--edge); animation: fx-up 1.1s ease-out forwards; }
.fx-exp { color: #9ff07a; } .fx-coin { color: #ffd34a; } .fx-dim { color: #c9c3e6; }
@keyframes fx-up { 0% { opacity: 0; transform: translate(-50%, -30%); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -260%); } }
.fx-fly, .fx-pop { animation: fx-fly .8s cubic-bezier(.3, .7, .5, 1) forwards; }
.fx-fly:empty, .fx-pop:empty { width: 6px; height: 6px; background: #fff7c2; box-shadow: 0 0 0 2px #e3c06a, 0 0 8px 2px rgba(255, 230, 140, .8); }
.fx-pop { animation-name: fx-pop; }
@keyframes fx-fly { 0% { transform: translate(-50%, -50%) scale(.6); } 40% { transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my))) scale(1.2); } 100% { transform: translate(calc(-50% + var(--ex)), calc(-50% + var(--ey))) scale(.7); opacity: .9; } }
@keyframes fx-pop { 0% { transform: translate(-50%, -50%) scale(.6); } 40% { transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my))) scale(1.2); } 100% { transform: translate(calc(-50% + var(--ex)), calc(-50% + var(--ey))); opacity: 0; } }
.fx-flash { left: 0 !important; top: 0 !important; transform: none; width: 100vw; height: 100dvh; background: var(--fc); animation: fx-flash .7s ease-out forwards; }
@keyframes fx-flash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.qxp { height: 5px; background: #0d0a1c; margin-top: 6px; } .qxp i { display: block; height: 100%; background: #7fd36b; transition: width .4s ease-out; }
.later { opacity: 0; } .later.shown { opacity: 1; animation: fx-in .4s ease-out; }
@keyframes fx-in { 0% { transform: scale(1.4); } 100% { transform: none; } }
.chest.open .px { animation: hop .3s steps(2) 2; }

/* やめる・にげる（小さめ。まちがえて押さないよう、大事なボタンから離す） */
.hud { position: relative; }
.quit { flex: none; align-self: flex-start; min-height: 44px; min-width: 64px; padding: 0 10px; border: 0; background: #3a3168; color: var(--win-ink); font-size: 14px; cursor: pointer;
  box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #8d84b8, 0 0 0 6px var(--edge); margin: 4px 4px 0 6px; }
.bhud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .bhud .quit { margin: 0 0 4px; min-height: 40px; }
.modal-bg { position: fixed; inset: 0; z-index: 40; background: rgba(8, 6, 20, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(340px, 100%); padding: 16px; text-align: center; font-size: 18px; line-height: 1.7; }
.modal .ctl { flex-direction: row; gap: 8px; } .modal .ctl > * { flex: 1; font-size: 18px; min-height: 56px; }
.foot { display: flex; justify-content: space-between; align-items: center; }
.sound { min-height: 44px; border: 0; background: transparent; color: rgba(246,238,221,.75); font-size: 13px; cursor: pointer; padding: 0 6px; }
@media (prefers-reduced-motion: reduce) { .later.shown, .chest.open .px { animation: none !important; } }
/* 動きを減らす設定：エフェクトは動かさず、その場でふっと出て消える */
.fx.still { animation: fx-fade .7s ease-out forwards !important; }
.fx.still i { animation: none !important; }
.fx-slash.still i { transform: translate(-50%, -50%) rotate(var(--r)) scaleX(1); }
.fx-orb.still { transform: translate(-50%, -50%) scale(3); }
.fx-ring.still { transform: translate(-50%, -50%) scale(2.5); }
.fx-float.still { transform: translate(-50%, -120%); }
.fx-wave.still { transform: translateY(-50%); width: var(--w); background: linear-gradient(90deg, transparent, var(--c), transparent); }
@keyframes fx-fade { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---- 戦闘の数字と要所（2026-11-17） ---- */
.hpnum { font-size: 13px; text-align: right; margin-top: 2px; font-variant-numeric: tabular-nums; }
.pm .hpnum { font-size: 12px; }
.fx-dmg { color: #ffdbd3; text-shadow: 0 2px 0 #7a1a10, 2px 0 0 #7a1a10, -2px 0 0 #7a1a10, 0 -2px 0 #7a1a10; font-size: 26px; }
/* 要所：画面を暗くし、予告と2つのボタンを真ん中に大きく出す */
.kmoment { position: absolute; inset: 0; z-index: 30; background: rgba(6, 4, 18, .62); display: flex; align-items: center; justify-content: center; padding: 16px; animation: k-in .25s ease-out; }
@keyframes k-in { from { opacity: 0; } to { opacity: 1; } }
.kwin { width: min(360px, 100%); padding: 16px 12px 12px; text-align: center;
  box-shadow: 0 0 0 2px var(--edge), 0 0 0 5px #ff6b4a, 0 0 0 7px var(--edge), 0 0 24px 8px rgba(255, 107, 74, .45); animation: k-pulse 1s steps(2) infinite; }
@keyframes k-pulse { 50% { box-shadow: 0 0 0 2px var(--edge), 0 0 0 5px #ffd34a, 0 0 0 7px var(--edge), 0 0 30px 10px rgba(255, 211, 74, .5); } }
.ktitle { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 16px; line-height: 1.6; text-align: left; }
.ktitle b { font-size: 22px; color: #ffd34a; }
.kq { font-size: 24px; margin: 10px 0 4px; }
.kwin .choices.act { grid-template-columns: 1fr 1fr; }
.kwin .choice { flex-direction: column; min-height: 96px; font-size: 20px; gap: 4px; }
.khint { font-size: 12px; opacity: .75; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .kmoment, .kwin { animation: none; } }

/* つぎのレベルまでの残り */
.xpnext { font-size: 12px; color: #b8e6a6; margin-top: 3px; font-variant-numeric: tabular-nums; }
.lines .xpnext { font-size: 14px; }
.qxprow { display: flex; align-items: center; gap: 8px; margin-top: 6px; } .qxprow .qxp { flex: 1; margin-top: 0; }
.qxpn { font-size: 12px; color: #b8e6a6; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ホームの仲間：JS（startHomeWalk）が横の位置を動かす。左へ歩くときは左を向く */
.walker.hw { position: absolute; bottom: 0; left: 0; will-change: transform; }
.walker.hw.left .pet { transform: scaleX(-1); }

/* 学年えらび・保護者の入口 */
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0; }
.gbtn { min-height: 76px; border: 0; background: var(--win); color: var(--win-ink); font-size: 16px; cursor: pointer; box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #6b6294, 0 0 0 6px var(--edge); margin: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.3; }
.gbtn b { font-size: 30px; color: var(--frame); font-weight: 400; }
.gbtn small { font-size: 11px; opacity: .7; }
.gbtn:disabled { opacity: .45; cursor: default; }
.gbtn.picked { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px var(--frame), 0 0 0 6px var(--edge); }
.grades.small .gbtn { min-height: 56px; } .grades.small .gbtn b { font-size: 22px; }
.gate { padding: 14px; text-align: center; } .gnum { font-size: 30px; color: var(--frame); margin-bottom: 8px; }
.stats { line-height: 2; font-size: 14px; } .stats b { color: var(--frame); font-weight: 400; }

/* がんばりカード・おうえん・なかよし */
.card-stamp { padding: 8px 12px; text-align: center; font-size: 14px; }
.card-stamp .slots { display: flex; justify-content: center; gap: 6px; margin: 6px 0; }
.card-stamp .slots i { width: 22px; height: 22px; background: #0d0a1c; box-shadow: inset 0 0 0 2px #6b6294; }
.card-stamp .slots i.last { box-shadow: inset 0 0 0 2px var(--frame); }
.card-stamp .slots i.on { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent-shadow); }
.card-stamp .slots i.new { animation: fx-in .5s ease-out; }
.card-stamp .sreward { color: var(--frame); }
.boosts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: 13px; }
.hrt { display: inline-flex; gap: 2px; vertical-align: middle; }
.hrt i { width: 9px; height: 8px; background: #4a3d6e; clip-path: polygon(0 25%, 25% 0, 50% 20%, 75% 0, 100% 25%, 100% 50%, 50% 100%, 0 50%); }
.hrt i.on { background: #ff6b8a; }
.hearts { margin-top: 2px; }

/* あいことば */
.passbox { display: flex; justify-content: center; gap: 6px; padding: 10px; }
.pslot { width: 38px; height: 38px; display: grid; place-items: center; font-size: 26px; background: #0d0a1c; box-shadow: inset 0 0 0 2px #6b6294; }
.emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 6px 4px; }
.emo { min-height: 44px; font-size: 24px; border: 0; background: var(--win); box-shadow: 0 0 0 2px var(--edge), 0 0 0 3px #6b6294; cursor: pointer; padding: 0; }
.emo:disabled { opacity: .4; cursor: default; }
.ctl.row { flex-direction: row; } .ctl.row > * { flex: 1; }
.passshow { font-size: 24px; letter-spacing: 1px; margin: 8px 0; text-align: center; white-space: nowrap; }
.sub-note .btn-sub { margin: 6px 0; width: 100%; }

/* ---- 戦闘のエフェクト（fx.js） ---- */
.fx-slash { width: 140px; height: 140px; }
.fx-slash.big { width: 210px; height: 210px; }
.fx-slash i { position: absolute; left: 50%; top: 50%; width: 140%; height: 9px; background: linear-gradient(90deg, transparent, var(--c) 20%, #fff 50%, var(--c) 80%, transparent); box-shadow: 0 0 12px 4px var(--c); transform-origin: center; transform: translate(-50%, -50%) rotate(-35deg) scaleX(0); animation: fx-slash .32s steps(4) forwards; }
.fx-slash i + i { transform: translate(-50%, -50%) rotate(35deg) scaleX(0); animation-delay: .1s; height: 6px; }
.fx-slash.flip i { transform: translate(-50%, -50%) rotate(35deg) scaleX(0); }
.fx-slash.flip i + i { transform: translate(-50%, -50%) rotate(-35deg) scaleX(0); }
@keyframes fx-slash { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r, -35deg)) scaleX(1); } }
.fx-slash i { --r: -35deg; } .fx-slash i + i { --r: 35deg; } .fx-slash.flip i { --r: 35deg; } .fx-slash.flip i + i { --r: -35deg; }
.fx-orb { width: 20px; height: 20px; background: radial-gradient(circle, #fff 0 30%, var(--c) 60%, transparent 72%); animation: fx-orb .5s ease-out forwards; }
@keyframes fx-orb { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(5); opacity: 0; } }
.fx-spark { width: 6px; height: 6px; background: var(--c); box-shadow: 0 0 6px 1px var(--c); animation: fx-spark .6s ease-out forwards; }
@keyframes fx-spark { 0% { transform: translate(-50%, -50%); opacity: 1; } 100% { transform: translate(calc(-50% + var(--ex)), calc(-50% + var(--ey))); opacity: 0; } }
.fx-ring { width: 40px; height: 40px; border: 4px solid var(--c); box-shadow: 0 0 10px var(--c), inset 0 0 10px var(--c); animation: fx-ring .7s ease-out forwards; }
@keyframes fx-ring { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(4); opacity: 0; } }
.fx-wave { transform: translateY(-50%); width: 40px; height: var(--h); background: linear-gradient(90deg, transparent, var(--c), #fff, var(--c), transparent); opacity: .85; animation: fx-wave .55s ease-in forwards; }
@keyframes fx-wave { 0% { transform: translate(-40px, -50%); } 100% { transform: translate(var(--w), -50%); opacity: .2; } }
.fx-shake-s { animation: fx-shake-s .3s steps(6); }
.fx-shake-l { animation: fx-shake-l .45s steps(9); }
@keyframes fx-shake-s { 0%, 100% { translate: 0 0; } 25% { translate: -3px 1px; } 50% { translate: 3px -1px; } 75% { translate: -2px 0; } }
@keyframes fx-shake-l { 0%, 100% { translate: 0 0; } 20% { translate: -8px 3px; } 40% { translate: 7px -3px; } 60% { translate: -6px 2px; } 80% { translate: 4px -1px; } }
.fx-big { color: #fff27a; font-size: 34px; text-shadow: 0 3px 0 #7a4a10, 3px 0 0 #7a4a10, -3px 0 0 #7a4a10, 0 -3px 0 #7a4a10; }
.pm.act { animation: pm-act .3s steps(3); }
@keyframes pm-act { 50% { translate: 0 -10px; } }
.foe-art.charge { animation: charge-glow .5s steps(2) infinite; } /* 光は外側の箱に掛ける（中の絵の色を消さないように） */
@keyframes charge-glow { 50% { filter: drop-shadow(0 0 10px #a04aff) drop-shadow(0 0 4px #a04aff) brightness(.8); } }
@media (prefers-reduced-motion: reduce) { .fx-shake-s, .fx-shake-l, .pm.act, .foe-art.charge { animation: none !important; } }

/* なかまのステータス */
.status { padding: 10px 12px; font-size: 14px; }
.st-head { display: flex; gap: 12px; align-items: flex-end; }
.st-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-name b { font-size: 18px; font-weight: 400; } .st-name small { font-size: 12px; opacity: .85; }
.st-lv { font-size: 18px; color: var(--frame); margin-top: 2px; } .st-lv span { font-size: 12px; color: #b8e6a6; margin-left: 8px; }
.st-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 4px; }
.st-grid div { background: #0d0a1c; box-shadow: inset 0 0 0 2px #3d3566; padding: 4px 6px; text-align: center; display: flex; flex-direction: column; }
.st-grid small { font-size: 11px; opacity: .8; } .st-grid b { font-weight: 400; font-size: 20px; color: var(--frame); font-variant-numeric: tabular-nums; }
.st-row { display: flex; gap: 10px; align-items: baseline; margin-top: 6px; } .st-row > small { width: 56px; flex: none; font-size: 12px; opacity: .8; }
.st-skills ul { margin: 0; padding: 0; list-style: none; flex: 1; }
.st-skills li { opacity: .5; display: flex; justify-content: space-between; gap: 8px; } .st-skills li.on { opacity: 1; }
.st-skills li span { font-size: 11px; opacity: .85; text-align: right; }

/* なかま：上は見出し（タブ）、選んでいる見出しと下の窓がつながって1枚の札に見える */
.ptabs { display: grid; gap: 6px; margin: 6px 6px 0; align-items: end; }
.ptab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; min-height: 92px; border: 0; cursor: pointer;
  background: #1a1536; color: rgba(246,238,221,.7); box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #4a4278; font-size: 13px; }
.ptab b { font-weight: 400; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptab small { font-size: 11px; color: var(--frame); }
.ptab.on { background: var(--win); color: var(--win-ink); min-height: 104px; z-index: 2;
  box-shadow: 0 -2px 0 2px var(--edge), 0 -4px 0 4px var(--frame), 2px 0 0 2px var(--edge), -2px 0 0 2px var(--edge), 4px 0 0 2px var(--frame), -4px 0 0 2px var(--frame); }
.ptab.on::after { content: ''; position: absolute; left: -4px; right: -4px; bottom: -8px; height: 10px; background: var(--win); } /* 下の窓との境目の線を消す */
.ptab .lead-mark { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 10px; background: var(--accent); color: var(--accent-ink); padding: 0 6px; white-space: nowrap; }
body.kbnav .ptab.sel::before { left: 4px; top: 12px; transform: none; font-size: 12px; }
.status.tabbed { margin-top: 0; }

/* 味方の体力ゲージ（太く・残りで色が変わる）と、ごほうびの表示 */
.pm .hp.small { height: 12px; width: 100%; background: #0d0a1c; box-shadow: inset 0 0 0 1px #4a4278; margin-top: 4px; }
.pm .hp.small i { background: #6fe07a; transition: width .35s ease-out; }
.pm .hp.small.mid i { background: #ffd34a; }
.pm .hp.small.low i { background: #ff5a4a; }
.pm .hpnum { font-size: 13px; }
.foe .reward { font-size: 11px; color: #b8e6a6; }
.reward-line { font-size: 14px; color: var(--frame); }
.levelup.small { display: inline-block; font-size: 16px; margin-left: 8px; }

/* ▶（選んでいる所）は、キーや2ボタンで操作しているときだけ出す。指でさわったら消す（body.kbnav は game.js が付け外しする） */

/* 装備：段階の色（どう・てつ・ぎん・きん・でんせつ）とアクセサリーの色。絵は灰色なので染める */
.px.eq.tier-1 { filter: sepia(1) saturate(2.2) hue-rotate(-18deg) brightness(.85); }
.px.eq.tier-2 { filter: brightness(.8) contrast(1.15); }
.px.eq.tier-3 { filter: brightness(1.2) contrast(1.05); }
.px.eq.tier-4 { filter: sepia(1) saturate(4) hue-rotate(8deg) brightness(1.12); }
.px.eq.tier-5 { filter: sepia(1) saturate(5) hue-rotate(225deg) brightness(1.1) drop-shadow(0 0 3px #c07aff); }
.px.eq.acc-ring { filter: sepia(1) saturate(3) hue-rotate(170deg); }
.px.eq.acc-band { filter: sepia(1) saturate(4) hue-rotate(-40deg) brightness(.95); }
.px.eq.acc-pendant { filter: sepia(1) saturate(3) hue-rotate(280deg) brightness(1.05); }
.px.eq.acc-charm { filter: sepia(1) saturate(4) hue-rotate(10deg) brightness(1.1); }
.px.eq.acc-brooch { filter: sepia(1) saturate(3.5) hue-rotate(-60deg) brightness(1.05); }
.st-eq ul { margin: 0; padding: 0; list-style: none; flex: 1; } .st-eq li { opacity: .55; display: flex; align-items: center; gap: 4px; } .st-eq li.on { opacity: 1; }
.st-eq .px.eq { transform: scale(.6); margin: -8px -6px; }
.hint { color: #ffd34a; font-size: 13px; }
.tabs { display: flex; gap: 6px; margin: 4px 6px 0; } .tab { flex: 1; min-height: 44px; border: 0; background: #1a1536; color: rgba(246,238,221,.7); font-size: 16px; cursor: pointer; box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #4a4278; margin: 4px; }
.tab.on { background: var(--win); color: var(--frame); box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px var(--frame); }
.prow em { font-style: normal; font-size: 12px; color: var(--frame); margin-left: 4px; }
.eqslots .mrow small { display: inline-flex; align-items: center; gap: 4px; } .eqslots .px.eq { transform: scale(.7); margin: -6px -4px; }
.drop { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; color: #fff27a; }
/* ホームの左上：学年（名前の左） */
.hud-l .grade { display: inline-block; font-size: 11px; background: var(--accent); color: var(--accent-ink); padding: 0 5px; margin-right: 6px; vertical-align: 2px; }
/* 装備で強さがどれだけ変わるか（上がる＝緑・下がる＝赤） */
.eqdiff .up, .st-grid .up { color: #7dff9a; } .eqdiff .down { color: #ff7a7a; } .eqdiff .same { opacity: .6; }
.eqdiff span { white-space: nowrap; margin-right: 6px; }
.st-grid em { font-style: normal; font-size: 12px; }
.st-eq li { flex-wrap: wrap; } .st-eq .eqfx { font-size: 11px; opacity: .75; margin-left: auto; white-space: nowrap; }
/* 勝ち負けをはっきり（2026-11-17）：戦いの最後に大きな文字、結果の画面では勝った方を元気に、負けた方を暗く */
.bend { position: fixed; left: 0; right: 0; top: 38%; text-align: center; font-size: 44px; z-index: 10000; pointer-events: none; animation: bend-in .35s ease-out both; }
.bend.is-win { color: #ffe27a; text-shadow: 0 4px 0 #6a3c00, 0 0 18px rgba(255, 210, 90, .8); background: rgba(40, 20, 0, .85); padding: 10px 0; }
.bend.is-lose { color: #b8c4ff; text-shadow: 0 4px 0 #1a1f4a; background: rgba(10, 10, 30, .85); padding: 10px 0; }
@keyframes bend-in { from { transform: scale(1.8); opacity: 0; } to { transform: none; opacity: 1; } }
.defeated { filter: grayscale(1) brightness(.6); transform: translateY(8px) rotate(8deg); opacity: .6; transition: all .6s ease-in; }
.pm.down { filter: grayscale(1) brightness(.55); }
.result-big.is-win { font-size: 36px; color: #ffe27a; text-shadow: 0 4px 0 #6a3c00, 0 0 14px rgba(255, 210, 90, .7); }
.result-big.is-lose { font-size: 30px; color: #b8c4ff; text-shadow: 0 3px 0 #1a1f4a; }
.stage-box.rs-win, .stage-box.rs-lose { gap: 6px; }
.stage-box.rs-lose { flex-direction: column-reverse; } /* 負けたときは相手を上に大きく、仲間を下に */
.rs-party { display: flex; gap: 10px; justify-content: center; align-items: flex-end; }
.rs-foe { display: flex; flex-direction: column; align-items: center; }
.cheer { animation: cheer .6s ease-in-out infinite; } .cheer:nth-child(2) { animation-delay: .15s; } .cheer:nth-child(3) { animation-delay: .3s; }
@keyframes cheer { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .cheer, .bend { animation: none; } .defeated { transition: none; } }
.rs-party .faded { filter: grayscale(1) brightness(.5); transform: translateY(6px); }
/* タイトルの画面（開いたとき毎回） */
.bg-title { --bgimg: url(img/bg-home.png); align-items: center; cursor: pointer; }
.title-card .logo { font-size: 56px; margin-top: 8vh; }
.title-copy { text-align: center; font-size: 17px; line-height: 1.7; padding: 10px 12px; margin-top: 10px; }
.title-party { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; align-items: end; gap: 4px 14px; margin-top: 18px; }
.title-party > span { animation: cheer 1.2s ease-in-out infinite; }
.title-card .ctl { width: 100%; }
@media (prefers-reduced-motion: reduce) { .title-party > span { animation: none; } }
/* 戦いのはじめ：相手が暗がりから出てくる（0.9秒） */
.foe-art.enter { animation: foe-enter .9s ease-out both; }
@keyframes foe-enter { from { opacity: 0; filter: brightness(0); transform: translateY(16px) scale(.85); } 60% { opacity: 1; filter: brightness(0); } to { filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) { .foe-art.enter { animation: none; } }
/* 敵の名前の窓は1行＋細いHPバーにして、絵の場所を広く（2026-11-17） */
.bhud { padding: 4px 10px 6px; } .bhud .hp { height: 8px; margin-top: 2px; }
.bhud-row b { font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bhud-row .hpnum { font-size: 12px; opacity: .85; white-space: nowrap; }
.bhud .quit { margin: 0; min-height: 34px; min-width: 56px; font-size: 13px; }
.foe-art { scale: var(--fit, 1); transform-origin: 50% 100%; }
/* 戦いの画面でも敵の色（あか・あお・きん）を出す。.foe-art .px の影の filter に上書きされて、元の色に戻っていたため */
.foe-art .px.aura-red { filter: sepia(1) saturate(5) hue-rotate(-45deg) brightness(.95) drop-shadow(0 0 2px #ff4a3a) drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
.foe-art .px.aura-blue { filter: sepia(1) saturate(4) hue-rotate(175deg) brightness(.95) drop-shadow(0 0 2px #4aa8ff) drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
.foe-art .px.aura-gold { filter: sepia(1) saturate(3.5) hue-rotate(5deg) brightness(1.15) drop-shadow(0 0 2px #ffd34a) drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
/* 戦いの準備：縦に収まるよう詰める（2026-11-17、iPhone でスクロールが要った） */
.orow { padding: 2px 8px; margin: 4px 6px; } .order { gap: 2px; }
.orow .mv-btn { width: 40px; height: 36px; }
.reward-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 6px 10px; }
.reward-line .boosts { font-size: 12px; opacity: .9; }
.skills.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.skills.tri .skill { padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-height: 0; }
.skills.tri .skill b { font-size: 13px; line-height: 1.3; }
.st-text { font-size: 13px; padding: 6px 10px; text-align: center; }
.prep-ctl .btn-sub { flex: 0 0 30%; } .prep-ctl .btn-main { flex: 1; }
/* なかま：タブとボタンを低く */
.ptab { min-height: 84px !important; } .ptab.on { min-height: 92px !important; }
.up-badge { display: inline-block; margin-left: 6px; font-size: 11px; padding: 0 5px; background: #2f8a4a; color: #fff; white-space: nowrap; vertical-align: 2px; }
.small-note { font-size: 12px; }
/* ホームの下の帯：ことばの途中で折り返さない */
.foot { gap: 6px; } .foot .sound { white-space: nowrap; font-size: 12px; padding: 0 6px; min-width: 0; }
.foot .ver { font-size: 10px; white-space: nowrap; }
/* 背の低い画面（iPhone の Safari・Chrome はバーで 650px 前後）：見出しと選ぶボタンを少し詰める */
@media (max-height: 760px) {
  .h2 { margin: 2px 0 4px; }
  .pick button { min-height: 64px; }
  .label { margin: 4px 0 2px; }
}
@media (max-height: 760px) {
  .card.boss { padding: 6px 10px; } .card.boss .moves { margin-top: 2px; } .card.boss .mv { min-width: 40px; padding: 1px 3px; }
  .skills.tri .skill { padding: 4px 4px; } .st-text { padding: 4px 8px; }
  .status .st-grid { margin: 4px 0 2px; } .status .st-grid b { font-size: 18px; } .status .st-row { margin: 1px 0; }
  .ptab { min-height: 76px !important; } .ptab.on { min-height: 84px !important; }
  .roombox { height: min(42dvh, 360px); }
  .pick button { min-height: 58px; padding: 4px 2px; }
}
@media (max-height: 700px) {
  .title-card .logo { margin-top: 3vh; font-size: 50px; }
  .ctl { margin-top: 6px; gap: 8px; }
  .status .st-skills li { line-height: 1.25; }
  .card.boss .bart { zoom: .8; }
}
.pass-view .passshow { font-size: 26px; } .pass-view p { font-size: 15px; margin: 6px 0; } .pass-view .label { margin: 0; }
/* 結果の画面：「かった！」「まけた」の文字はいつも絵より手前。絵が入りきらないときは、文字の上にはみ出さず、箱の中で切る */
.result-big { position: relative; z-index: 5; }
.stage-box.rs-win, .stage-box.rs-lose { overflow: hidden; min-height: 0; position: relative; z-index: 1; }
.idle-rp.d1 { animation-delay: .4s; } .idle-rp.d2 { animation-delay: .8s; }
/* 勉強中の宝箱：相棒のとなりで揺れて「さわって」と知らせる */
.qchest { position: absolute; right: 18px; bottom: -6px; border: 0; background: none; padding: 6px; cursor: pointer; animation: qchest-wobble 1s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(255, 220, 110, .9)); z-index: 3; }
.qchest.open { animation: hop .3s steps(2) 2; }
.qchest-got { position: absolute; right: 18px; bottom: 40px; color: var(--frame); font-size: 18px; z-index: 3; }
@keyframes qchest-wobble { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-8deg); } 80% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .qchest, .qchest.open { animation: none; } }
/* だれが あそぶ？ */
.who .prow { min-height: 64px; } .who .wpass { display: block; font-size: 14px; letter-spacing: 1px; margin-top: 2px; }
.pass-view .ctl .btn-sub { font-size: 14px; }
/* あそびかた */
.howto { padding: 14px 14px 10px; text-align: center; }
.howto .ht-art { display: flex; justify-content: center; align-items: flex-end; gap: 10px; min-height: 96px; margin-bottom: 6px; }
.howto .ht-title { font-size: 22px; color: var(--frame); margin: 4px 0 8px; }
.howto p { margin: 4px 0; font-size: 16px; line-height: 1.6; }
.ht-arrow { color: var(--frame); align-self: center; font-size: 14px; }
.ht-choices { display: flex; flex-direction: column; gap: 6px; width: 70%; }
.ht-choices span { background: var(--paper); color: var(--paper-ink); padding: 8px; box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #6b6294, 0 0 0 6px var(--edge); margin: 0 6px; font-size: 18px; }
.ht-dots { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.ht-dots i { width: 10px; height: 10px; background: #3d3566; } .ht-dots i.on { background: var(--frame); }
/* ホームの下の帯：4つ並べるので ver は右下に小さく重ねる */
.foot { position: relative; } .foot .ver { position: absolute; right: 0; bottom: -10px; font-size: 9px; margin: 0; }
.title-ctl .btn-sub { flex: 0 0 36%; font-size: 15px; } .title-ctl .btn-main { flex: 1; }
.rush-note { color: var(--frame); font-size: 14px; }
/* 広告の帯（タイトルの画面だけ。2026-11-17）：#app の下の専用の帯。被せない。ほかの画面では隠す。広告が出ないときは adbar.js が畳む */
#adbar { display: none; flex: none; width: 100%; min-height: 50px; padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)); justify-content: center; align-items: center; overflow: hidden; background: #070d18; }
@media (min-width: 768px) { #adbar { min-height: 90px; } }
body.ad-on #adbar { display: flex; }
#adbar.adbar-empty { display: none !important; }
body.ad-on #app { padding-bottom: 8px; } /* 帯が下の安全域を受け持つ */
/* 帯があるぶん、タイトルを詰める */
body.ad-on:not(:has(#adbar.adbar-empty)) .title-card .logo { margin-top: 2vh; font-size: 46px; }
body.ad-on:not(:has(#adbar.adbar-empty)) .title-party { margin-top: 8px; }
body.ad-on:not(:has(#adbar.adbar-empty)) .title-party .sprite { zoom: .85; }
body.ad-on { height: 100dvh; } body.ad-on #app { min-height: 0; }
body.ad-on:not(:has(#adbar.adbar-empty)) .title-party .sprite { zoom: .75; }
body.ad-on:not(:has(#adbar.adbar-empty)) .title-copy { font-size: 15px; padding: 6px 10px; margin-top: 6px; }
body.ad-on:not(:has(#adbar.adbar-empty)) .title-card .logo { font-size: 42px; margin-top: 1vh; }
body.ad-on:not(:has(#adbar.adbar-empty)) .title-card .ver { margin-top: 2px; }
body.ad-on #app .stage { margin-bottom: -8px; padding-bottom: 8px; } /* #app の下の余白を 8px にしたので、場面の背景の はみ出しも合わせる */
/* おうちの かたへ：見出しと説明を分ける（かっこ書きをやめた） */ .sub-note .ph { display: block; color: var(--frame); } .sub-note .pnote { display: block; font-size: 13px; opacity: .85; margin-top: 2px; }
.sub-note .pnone { font-size: 15px; opacity: 1; margin: 8px 0 4px; }
/* おうちの かたへ：数字は「見出し 左／値 右」に並べ、かっこ書きをやめた。教科は1つずつ切れずに折り返す */
.stats .srow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 2px 0; }
.stats .srow span { flex: none; opacity: .85; }
.stats .srow b { font-weight: 400; color: var(--frame); text-align: right; }
.stats .subs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 8px; }
.stats .subs i { font-style: normal; white-space: nowrap; }
.sub-note .pnote { word-break: keep-all; overflow-wrap: anywhere; }
/* あいことばの絵（Twemoji）：文字の大きさに合わせる */
img.emoji { width: 1.15em; height: 1.15em; vertical-align: -0.2em; display: inline-block; margin: 0 .08em; pointer-events: none; }
.passshow img.emoji { margin: 0 .12em; }
.emo img.emoji { width: 30px; height: 30px; }
.pslot img.emoji { width: 26px; height: 26px; }
.credit { font-size: 11px; opacity: .7; text-align: center; margin: 6px 0 0; } .credit a { color: inherit; }
/* 勉強中の宝箱は解説の窓の右に回り込ませる（文字に重ねない。2026-11-18） */
.explain .qchest { position: relative; right: auto; bottom: auto; float: right; clear: right; margin: 2px 0 4px 10px; padding: 0; }
.explain .qchest-got { position: static; float: right; clear: right; margin-left: 10px; }
/* ITパスポートのコース（2026-11-18）：問題文・選択肢が長いので文字を小さく */
.grades.course { grid-template-columns: 1fr; margin-top: 6px; }
.grades.course .gbtn small { display: block; font-size: 11px; opacity: .8; }
.qwin.subj-it .qtext, .qwin.subj-sg .qtext, .qwin.subj-fp .qtext, .qwin.subj-kmu .qtext { font-size: 17px; line-height: 1.6; }
.choices.subj-it .choice, .choices.subj-sg .choice, .choices.subj-fp .choice, .choices.subj-kmu .choice { font-size: 15px; line-height: 1.45; min-height: 64px; padding: 8px 12px; text-align: left; }
.qsource { font-size: 11px !important; opacity: .7; margin-top: 6px !important; line-height: 1.4 !important; }
.explain.subj-it p, .explain.subj-sg p, .explain.subj-fp p, .explain.subj-kmu p { font-size: 13.5px; line-height: 1.6; }
.explain.subj-it .judge, .explain.subj-sg .judge, .explain.subj-fp .judge, .explain.subj-kmu .judge { font-size: 16px; }
/* おことわり（2026-11-18） */
.course-note { font-size: 11px; opacity: .75; margin: 4px 6px 0; line-height: 1.5; }
.disclaimer .pnote { margin-top: 4px; }
.disclaimer .dlist { opacity: 1; color: var(--frame); }
.disclaimer .pnote, .disclaimer li, .course-note { word-break: keep-all; overflow-wrap: anywhere; } /* 区切りは phraseBreak（文節）で入れる */
.disclaimer .dlist { margin: 4px 0 0; padding-left: 1.2em; font-size: 13px; color: var(--frame); } .disclaimer .dlist li { margin: 2px 0; }
/* セットの結果：相棒と宝箱は横に並べ、潰れて字に重ならないよう高さを確保する（2026-11-19） */
.stage-box.rs-set { flex: 0 0 auto; min-height: 0; margin: 4px 0; }
.rs-set .rs-row { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.rs-set .chest { margin: 0; }
/* 資格のコースは2列（4つになったため。2026-11-19） */
.grades.course { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; }
.grades.course .gbtn { min-height: 52px; font-size: 14px; line-height: 1.35; padding: 6px 4px; }
.course-label { margin: 8px 4px 0; font-size: 12px; }
.grades.course .gbtn { word-break: keep-all; }
/* しんか（2026-11-19）：暗い中で光る → 前の姿と新しい姿の白い影が入れ替わる → はじけて新しい姿 */
.stage.evo { background: radial-gradient(circle at 50% 42%, #2a2150 0%, #0b0818 70%); align-items: center; cursor: pointer; overflow: hidden; }
.evo-rays { position: absolute; left: 50%; top: 40%; width: 900px; height: 900px; margin: -450px 0 0 -450px; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 226, 140, .35) 0%, rgba(255, 226, 140, 0) 45%), repeating-conic-gradient(rgba(255, 236, 160, .13) 0deg 6deg, transparent 6deg 18deg); border-radius: 50%; transition: opacity .8s;
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 62%); mask-image: radial-gradient(circle, #000 20%, transparent 62%); }
.evo.glow .evo-rays, .evo.morph .evo-rays { opacity: .6; animation: evo-spin 6s linear infinite; }
.evo.morph .evo-rays { opacity: 1; animation-duration: 2.2s; }
.evo.done .evo-rays { opacity: .5; animation: evo-spin 14s linear infinite; }
@keyframes evo-spin { to { transform: rotate(360deg); } }
.evo-stage { position: relative; flex: 1; width: 100%; display: grid; place-items: end center; padding-bottom: 20px; min-height: 0; }
.evo-stage > div { grid-area: 1 / 1; display: flex; justify-content: center; align-items: flex-end; }
.evo-new { opacity: 0; }
.evo.glow .evo-old .sprite { animation: evo-pulse .8s ease-in-out infinite; }
@keyframes evo-pulse { 50% { filter: brightness(1.8) drop-shadow(0 0 14px #fff3b0); } }
/* 入れ替わりのあいだは、どちらも白い影にする */
.evo.morph .sprite { filter: brightness(0) invert(1) drop-shadow(0 0 16px #fff3b0) drop-shadow(0 0 30px #ffd34a); }
.evo.morph .evo-new { opacity: 0; } .evo.morph.show-new .evo-new { opacity: 1; } .evo.morph.show-new .evo-old { opacity: 0; }
.evo.done .evo-old { opacity: 0; } .evo.done .evo-new { opacity: 1; animation: evo-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.evo.done .evo-new .sprite { filter: drop-shadow(0 0 12px rgba(255, 227, 122, .8)); }
@keyframes evo-pop { from { transform: scale(.6); } to { transform: scale(1); } }
.evo-msg { width: calc(100% - 12px); text-align: center; min-height: 64px; display: grid; place-items: center; font-size: 17px; z-index: 2; }
.evo .ctl { width: 100%; z-index: 2; }
@media (prefers-reduced-motion: reduce) { .evo-rays, .evo .sprite, .evo-new { animation: none !important; } }
.evo-msg .evo-sub { display: block; font-size: 13px; color: var(--frame); margin-top: 2px; }
/* セットの結果：ボタンは横に並べる。背の低い画面ではさらに詰める（2026-11-19） */
.rs-ctl .btn-sub { flex: 0 0 34%; } .rs-ctl .btn-main { flex: 1; }
@media (max-height: 620px) {
  .bg-study.dim .result-big { font-size: 18px; margin-top: 2px; } .bg-study.dim .levelup { font-size: 20px; margin: 0; }
  .bg-study.dim .lines { line-height: 1.55; font-size: 15px; }
  .card-stamp { padding: 4px 10px; } .card-stamp .slots { margin: 3px 0; } .card-stamp .slots i { width: 18px; height: 18px; }
  .rs-set .sprite { zoom: .8; } .rs-set .chest .px { zoom: .8; }
}
/* 戦いの結果（2026-11-19）：絵の場所は潰さない（切れていたため）。まだ出ていない「Lv N に なった」は場所を取らない（けいけんちの行が左にずれていたため） */
.stage-box.rs-win, .stage-box.rs-lose { flex: 0 0 auto; overflow: visible; }
.lines .later:not(.shown) { display: none; }
.lines .levelup.small.shown { display: block; margin: 0; }
.drop .px.eq { zoom: .75; }
@media (max-height: 640px) { .bg-battle.dim .result-big.is-win, .bg-battle.dim .result-big.is-lose { font-size: 28px; margin-top: 0; } .bg-battle.dim .lines { line-height: 1.6; font-size: 15px; } }
.rs-win .rs-party { margin-top: 10px; }

/* 資格のコース（大人向けの長い問題）：文字を小さく（2026-11-19 にコースが増えたので一覧で） */
.qwin.subj-it .qtext, .qwin.subj-sg .qtext, .qwin.subj-fp .qtext, .qwin.subj-kmu .qtext, .qwin.subj-eiyo .qtext, .qwin.subj-ama .qtext, .qwin.subj-hs .qtext, .qwin.subj-fe .qtext, .qwin.subj-ap .qtext { font-size: 17px; line-height: 1.6; }
.choices.subj-it .choice, .choices.subj-sg .choice, .choices.subj-fp .choice, .choices.subj-kmu .choice, .choices.subj-eiyo .choice, .choices.subj-ama .choice, .choices.subj-hs .choice, .choices.subj-fe .choice, .choices.subj-ap .choice { font-size: 15px; line-height: 1.45; min-height: 64px; padding: 8px 12px; text-align: left; }
.explain.subj-it p, .explain.subj-sg p, .explain.subj-fp p, .explain.subj-kmu p, .explain.subj-eiyo p, .explain.subj-ama p, .explain.subj-hs p, .explain.subj-fe p, .explain.subj-ap p { font-size: 13.5px; line-height: 1.6; }
.grades.course:not(.small) { grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.grades.course:not(.small) .gbtn { min-height: 44px; font-size: 13px; padding: 4px 2px; }
@media (max-height: 700px) { .grades:not(.course):not(.small) .gbtn { min-height: 70px; } }

/* コースが10になったので4列（2026-11-19） */
.grades.course:not(.small) { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.grades.course:not(.small) .gbtn { min-height: 42px; font-size: 12px; margin: 4px; }
.qwin.subj-kotoba .qtext { font-size: 17px; line-height: 1.6; } .choices.subj-kotoba .choice { font-size: 15px; line-height: 1.45; min-height: 60px; padding: 8px 12px; text-align: left; } .explain.subj-kotoba p { font-size: 13.5px; line-height: 1.6; }
/* 答えたあと：問題の窓は高さを決めて中でスクロール。解説と重ならないように（2026-11-19、長い資格の問題で重なっていた） */
.stage.answered .qbox { flex: 0 1 auto; min-height: 0; }
.stage.answered .qwin { max-height: 30dvh; overflow-y: auto; }
.stage.answered .qwin .qtext { font-size: 15px; line-height: 1.5; }
.stage.answered .buddy { display: none; }
/* 敵の窓（2026-11-19）：左に名前とHPのバー・数、右に「にげる」。名前やHPの数が長くても「にげる」に重ならない */
.bhud { display: flex; align-items: center; gap: 10px; }
.bhud-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bhud-main b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.bhud-hp { display: flex; align-items: center; gap: 8px; }
.bhud-hp .hp { flex: 1; margin: 0; height: 8px; }
.bhud-hp .hpnum { font-size: 12px; opacity: .85; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bhud .quit { flex: none; align-self: center; position: static; margin: 0; }
/* 長い文（2026-11-19）：文字数に合わせて字を小さく。入りきらなければ枠の中でスクロールし、「▼」で続きを知らせる */
.qwin.len-l .qtext { font-size: 16px !important; line-height: 1.55 !important; }
.qwin.len-xl .qtext { font-size: 14px !important; line-height: 1.5 !important; }
.choices.len-l .choice { font-size: 14px !important; line-height: 1.4 !important; min-height: 52px; }
.choices.len-xl .choice { font-size: 13px !important; line-height: 1.35 !important; min-height: 48px; padding: 6px 10px; }
.explain .card.len-l p { font-size: 13px !important; line-height: 1.55 !important; }
.explain .card.len-xl p { font-size: 12.5px !important; line-height: 1.5 !important; }
.qwin { max-height: 100%; overflow-y: auto; position: relative; }
.stage.answered .explain { flex: 0 1 auto; min-height: 0; display: flex; }
.explain .card { max-height: 44dvh; overflow-y: auto; position: relative; }
.qwin.has-more::after, .explain .card.has-more::after { content: '▼ つづき'; position: sticky; display: block; bottom: -1px; margin: 0 -14px -10px; padding: 14px 0 4px; text-align: center; color: var(--frame); font-size: 11px; background: linear-gradient(rgba(28, 22, 58, 0), #1c163a 60%); pointer-events: none; }
/* どうぐ（2026-11-19） */
.toolrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 6px 4px; }
.toolrow .tool { border: 0; background: var(--win); color: var(--win-ink); box-shadow: 0 0 0 2px var(--edge), 0 0 0 3px #6b6294; padding: 4px 8px; min-height: 38px; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.toolrow .tool.on { box-shadow: 0 0 0 2px var(--edge), 0 0 0 3px var(--frame); color: var(--frame); }
.toolrow .tool small { opacity: .8; }
.toolrow .tool { min-height: 32px; padding: 2px 6px; }
@media (max-height: 760px) {
  .card.boss .sub { font-size: 12px; } .card.boss .mv small { display: none; }
  .orow { margin: 3px 6px; } .orow .mv-btn { height: 32px; }
  .skills.tri .skill .px.ico { zoom: .8; }
  .st-text { font-size: 12px; padding: 3px 8px; }
}
/* なかまの わざ：覚えた技は名前だけ2列、つぎに覚える技を1行（技が6つに増えたため。2026-11-19） */
.st-skills .skw { flex: 1; min-width: 0; }
.st-skills ul.sk2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin: 0; padding: 0; list-style: none; }
.st-skills ul.sk2 li { white-space: nowrap; }
.st-skills .sknext { font-size: 11px; opacity: .7; margin-top: 2px; }
@media (max-height: 760px) { .status .st-row { line-height: 1.4; } .status .st-head .sprite { zoom: .85; } .status { padding-top: 6px; padding-bottom: 6px; } .small-note { margin: 0; } }
.qwin.subj-sc .qtext { font-size: 17px; line-height: 1.6; } .choices.subj-sc .choice { font-size: 15px; line-height: 1.45; min-height: 60px; padding: 8px 12px; text-align: left; } .explain.subj-sc p { font-size: 13.5px; line-height: 1.6; }
.qwin.subj-iryo .qtext { font-size: 17px; line-height: 1.6; } .choices.subj-iryo .choice { font-size: 15px; line-height: 1.45; min-height: 60px; padding: 8px 12px; text-align: left; } .explain.subj-iryo p { font-size: 13.5px; line-height: 1.6; }
.qwin.subj-koudo .qtext { font-size: 17px; line-height: 1.6; } .choices.subj-koudo .choice { font-size: 15px; line-height: 1.45; min-height: 60px; padding: 8px 12px; text-align: left; } .explain.subj-koudo p { font-size: 13.5px; line-height: 1.6; }
.qwin.subj-seibi .qtext { font-size: 17px; line-height: 1.6; } .choices.subj-seibi .choice { font-size: 15px; line-height: 1.45; min-height: 60px; padding: 8px 12px; text-align: left; } .explain.subj-seibi p { font-size: 13.5px; line-height: 1.6; }
.qwin.subj-eidiom .qtext { font-size: 17px; line-height: 1.6; } .choices.subj-eidiom .choice { font-size: 15px; line-height: 1.45; min-height: 60px; padding: 8px 12px; text-align: left; } .explain.subj-eidiom p { font-size: 13.5px; line-height: 1.6; }
.qwin.subj-zatsu .qtext { font-size: 17px; line-height: 1.6; } .choices.subj-zatsu .choice { font-size: 15px; line-height: 1.45; min-height: 60px; padding: 8px 12px; text-align: left; } .explain.subj-zatsu p { font-size: 13.5px; line-height: 1.6; }
.qwin.subj-denshi .qtext { font-size: 17px; line-height: 1.6; } .choices.subj-denshi .choice { font-size: 15px; line-height: 1.45; min-height: 60px; padding: 8px 12px; text-align: left; } .explain.subj-denshi p { font-size: 13.5px; line-height: 1.6; }
/* コースが14になったので5列（2026-11-19） */
.grades.course:not(.small) { grid-template-columns: repeat(5, 1fr); gap: 3px; }
.grades.course:not(.small) .gbtn { min-height: 40px; font-size: 11px; margin: 3px; padding: 2px 1px; line-height: 1.25; }
