:root {
  --bg: #fff4d6;
  --panel: #ffffff;
  --ink: #2b2a3a;
  --sub: #6b6a7c;
  --line: #2b2a3a;
  --primary: #ff7a3d;
  --primary-ink: #ffffff;
  --hp: #ee5a5a;
  --mp: #4c8dff;
  --sp: #2fbf71;
  --gold: #c58a00;
  --good: #1f8a4c;
  --bad: #d23b3b;
  --enemy: #8a3b1e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px; line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding: env(safe-area-inset-top) 14px calc(14px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 12px; min-height: 100dvh; padding: 14px 0; }
.screen[hidden] { display: none; }
h1, h2 { margin: 0; }

/* ---- ボタン ---- */
.btn {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--panel);
  border: 3px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-height: 52px;
  cursor: pointer; box-shadow: 0 3px 0 var(--line); touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.btn:focus-visible { outline: 4px solid #3b7bff; outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.big { font-size: 20px; min-height: 60px; }
.btn.ghost { background: transparent; border-style: dashed; box-shadow: none; font-weight: 500; color: var(--sub); border-color: var(--sub); min-height: 44px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---- タイトル ---- */
#screen-title { justify-content: center; text-align: center; }
#screen-title h1 { font-size: 40px; line-height: 1.15; letter-spacing: .02em; color: var(--primary); text-shadow: 3px 3px 0 var(--ink); }
.title-art { width: 180px; height: 180px; margin: 0 auto; }
.title-art svg { width: 100%; height: 100%; animation: bob 1.8s ease-in-out infinite; }
.lead { margin: 0; color: var(--ink); }
.note { margin: 6px 0 0; font-size: 12px; color: var(--sub); }

/* ---- バー / 共通 ---- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bar h2 { font-size: 22px; }
.gold { font-weight: 800; color: var(--gold); white-space: nowrap; }
.gold::before { content: "🪙 "; }

/* ---- 敵えらび ---- */
.enemy-list, .shop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.enemy-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 12px; min-height: 84px;
  box-shadow: 0 3px 0 var(--line); font: inherit; color: inherit; cursor: pointer;
}
.enemy-card:active { transform: translateY(3px); box-shadow: none; }
.enemy-card:focus-visible { outline: 4px solid #3b7bff; outline-offset: 2px; }
.enemy-card .thumb { width: 64px; height: 64px; flex: none; }
.enemy-card .thumb svg { width: 100%; height: 100%; }
.enemy-card .name { font-weight: 800; font-size: 18px; }
.enemy-card .blurb { font-size: 13px; color: var(--sub); }
.enemy-card .wins { font-size: 12px; color: var(--good); font-weight: 700; }

.cat-title { margin: 10px 2px 0; font-weight: 800; font-size: 15px; color: var(--enemy); border-bottom: 3px solid var(--line); padding-bottom: 2px; }
.enemy-card.locked { opacity: .6; cursor: not-allowed; box-shadow: none; }
.enemy-card.locked .name { color: var(--sub); }

/* ---- ダンジョン・クエスト・プロフィール ---- */
.dungeon-blurb { margin: 0; color: var(--sub); font-size: 14px; }
.rank-line { margin: 0; font-size: 14px; font-weight: 700; color: var(--enemy); }
.dungeon-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-height: 84px; box-shadow: 0 3px 0 var(--line); font: inherit; color: inherit; cursor: pointer; }
.dungeon-card:active { transform: translateY(3px); box-shadow: none; }
.dungeon-card:focus-visible { outline: 4px solid #3b7bff; outline-offset: 2px; }
.dungeon-card .dicon { font-size: 36px; width: 48px; text-align: center; flex: none; }
.dungeon-card .dname { font-weight: 800; font-size: 18px; }
.dungeon-card .dsub { font-size: 12px; color: var(--sub); }
.dungeon-card .dprog { font-size: 12px; font-weight: 700; color: var(--good); }
.dungeon-card.locked { opacity: .6; cursor: not-allowed; box-shadow: none; }
.enemy-card.boss { border-color: #b8860b; background: #fff8dc; }
.quest-list, .title-list, .stat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.quest-item { background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.quest-item .qn { font-weight: 800; }
.quest-item .qd { font-size: 12px; color: var(--sub); grid-column: 1; }
.quest-item .qr { font-size: 12px; color: var(--gold); font-weight: 700; grid-column: 1; }
.quest-item .qp { font-size: 12px; font-weight: 700; color: var(--good); grid-column: 1; }
.quest-item .btn { grid-column: 2; grid-row: 1 / span 4; min-height: 44px; padding: 6px 10px; font-size: 14px; }
.quest-item.done { opacity: .55; }
.quest-item.ready { border-color: #1f8a4c; background: #effaf0; }
.rank-card { background: #fff8dc; border: 3px solid #b8860b; border-radius: var(--radius); padding: 14px; text-align: center; }
.rank-card .rk { font-size: 22px; font-weight: 900; color: var(--enemy); }
.rank-card .rt { font-size: 15px; font-weight: 700; margin-top: 2px; }
.rank-card .rp { font-size: 13px; color: var(--sub); margin-top: 6px; }
.title-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--panel); border: 3px solid var(--line); border-radius: 12px; padding: 8px 12px; font: inherit; color: inherit; cursor: pointer; min-height: 48px; }
.title-item .tn { font-weight: 800; display: block; }
.title-item .td { font-size: 12px; color: var(--sub); display: block; }
.title-item.locked { opacity: .5; cursor: default; }
.title-item.on { border-color: #1f8a4c; background: #effaf0; }
.stat-list li { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px dashed #c9c2a8; padding: 3px 2px; }
.result-drop, .result-titles { text-align: center; margin: 0; font-weight: 800; }
.result-drop { color: var(--gold); }
.result-titles { color: var(--good); }

/* ---- ストーリー ---- */
.story { gap: 10px; }
.story-title { font-size: 15px; color: var(--enemy); text-align: center; padding-right: 46px; padding-left: 46px; }
.story-stage { display: flex; justify-content: center; align-items: center; min-height: 110px; }
.story-icon { font-size: 84px; line-height: 1; animation: bob 2s ease-in-out infinite; }
.story-box { background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-height: 150px; }
.story-name { font-weight: 800; color: var(--enemy); min-height: 1.5em; font-size: 15px; }
.story-text { font-size: 18px; line-height: 1.75; margin-top: 4px; }
.story-actions { display: flex; flex-direction: column; gap: 8px; }
.story-q { margin: 0; text-align: center; font-weight: 800; }
.hub-card { background: #fff8dc; border: 3px solid #b8860b; border-radius: var(--radius); padding: 10px 14px; }
.hub-card .hc-name { font-weight: 900; color: var(--enemy); }
.hub-card .hc-goal { font-size: 14px; margin-top: 2px; }
.hub-meters { display: grid; gap: 6px; }
.hub-meters .m { display: grid; grid-template-columns: 4.5em 1fr auto; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.hub-meters .bar2 { height: 14px; background: #e8e4d6; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.hub-meters .bar2 > div { height: 100%; }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-grid .btn { min-height: 56px; }
.hub-grid .btn.wide { grid-column: 1 / -1; }

/* ---- 職業・探索・図鑑・動画 ---- */
.job-title { font-size: 24px; text-align: center; padding: 0 46px; }
.job-list, .dex-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.job-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 12px; min-height: 64px; font: inherit; color: inherit; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.job-card .ji { font-size: 32px; width: 44px; text-align: center; flex: none; }
.job-card .jn { font-weight: 800; font-size: 17px; }
.job-card .jd { font-size: 12px; color: var(--sub); }
.job-card.on { border-color: #1f8a4c; background: #effaf0; }
.job-card:focus-visible { outline: 4px solid #3b7bff; outline-offset: 2px; }
.job-detail { background: #fff8dc; border: 3px solid #b8860b; border-radius: var(--radius); padding: 10px 14px; min-height: 8px; font-size: 14px; }
.job-detail:empty { display: none; }
.job-detail .jt { font-weight: 900; font-size: 17px; color: var(--enemy); }
.job-detail .js, .job-detail .jk, .job-detail .jl { margin-top: 4px; }
.path { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.path .pf { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--sub); }
.path .pf span { width: 2em; }
.path .pf i { width: 22px; height: 14px; border-radius: 6px; border: 2px solid var(--line); background: #e8e4d6; display: inline-block; }
.path .pf i.done { background: #5be08a; }
.path .pf i.next { background: #ffd35b; animation: bob 1s ease-in-out infinite; }
.path .pf.now { color: var(--ink); }
.path .pf.boss { font-size: 14px; justify-content: center; color: #b8860b; }
.path .pf.boss.now { color: var(--bad); animation: bob 1s ease-in-out infinite; }
.mini-status { margin: 0; text-align: center; font-weight: 800; font-size: 14px; }
.explore-log { background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 12px; min-height: 8.5em; }
.explore-log p { margin: 0 0 4px; font-size: 15px; color: var(--sub); }
.explore-log p.last { color: var(--ink); font-weight: 700; }
.dex-item { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.dex-item.unseen { opacity: .6; }
.dex-item .thumb { width: 56px; height: 56px; flex: none; }
.dex-item .thumb svg { width: 100%; height: 100%; }
.dex-item .name { font-weight: 800; }
.dex-item .blurb { font-size: 12px; color: var(--sub); }
.dex-item .wins { font-size: 12px; color: var(--good); font-weight: 700; }
.skill-list li.off { opacity: .45; }
.skill-list li small { display: block; font-weight: 500; color: var(--sub); font-size: 12px; }
.result-exp, .result-levelup, .result-unlock { text-align: center; margin: 0; font-weight: 800; }
.result-exp { color: #6b3fd0; }
.result-levelup { color: #d2336b; font-size: 17px; }
.result-unlock { color: #1b6bd0; }
.btn.tiktok { background: #111; color: #fff; border-color: #111; box-shadow: 0 3px 0 #ff2d6a, 0 6px 0 #25f4ee; margin-bottom: 6px; }
.btn.tiktok:disabled { opacity: .75; }
.video-box { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 3px solid var(--line); border-radius: var(--radius); padding: 10px; align-items: center; }
.video-box[hidden] { display: none; }
.video-box video { width: 100%; max-width: 240px; aspect-ratio: 9 / 16; background: #000; border-radius: 10px; }
.video-box .btn { width: 100%; }

body.recording #app { pointer-events: none; opacity: .85; }
body.recording .sound-btn { pointer-events: none; }

/* ---- ステータス・学生課・シェア ---- */
.hub-legend { margin: 0; font-size: 12px; color: var(--sub); line-height: 1.7; }
.stat-rows li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 4px; }
.stat-rows .sn { font-weight: 800; display: block; }
.stat-rows small { display: block; font-size: 12px; color: var(--sub); font-weight: 500; }
.stat-rows strong { font-size: 28px; color: var(--enemy); min-width: 2ch; text-align: right; }
.ep-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.ep-list li.ep-done { color: var(--good); }
.ep-list li.ep-now { font-weight: 800; }
.btn.locked { opacity: .55; }
.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.share-item { background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.share-item .si-title { font-weight: 900; font-size: 18px; align-self: flex-start; }
.share-item .si-desc { font-size: 13px; color: var(--sub); align-self: flex-start; }
.share-item video { width: 100%; max-width: 230px; aspect-ratio: 9 / 16; background: #000; border-radius: 10px; }
.share-item .si-state { font-size: 12px; color: var(--good); font-weight: 700; min-height: 1.4em; }
.share-item .si-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.share-item .si-btns .b-share { grid-column: 1 / -1; }
.howto { background: #fff8dc; border: 3px solid #b8860b; border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
.howto ol { margin: 6px 0; padding-left: 1.4em; }
.howto small { color: var(--sub); }
.caption-box { width: 100%; font: inherit; font-size: 14px; padding: 8px; border: 3px solid var(--line); border-radius: 12px; background: #fff; resize: none; }

/* ---- 戦闘 ---- */
#screen-battle { gap: 8px; height: 100dvh; min-height: 0; overflow: hidden; padding: 10px 0; }
.enemy-area { position: relative; display: flex; flex-direction: column; flex: 1 1 0; min-height: 110px; background: #ffe9b0; border: 3px solid var(--line); border-radius: var(--radius); padding: 10px 12px 6px; }
.enemy-name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.enemy-name-row strong { font-size: 18px; color: var(--enemy); }
.enemy-art { flex: 1 1 0; min-height: 0; display: flex; justify-content: center; margin-top: 6px; }
.enemy-art svg { height: 100%; width: auto; max-width: 100%; transition: transform .15s; }
.enemy-art.shake svg { animation: shake .35s; }
.enemy-art.zap svg { animation: zap .5s; }
.enemy-art.down svg { animation: down .7s forwards; }
.enemy-art.appear svg { animation: appear .5s; }
.fx-pop { position: absolute; left: 0; right: 0; top: 46%; text-align: center; font-size: 30px; font-weight: 900; pointer-events: none; opacity: 0; text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff; }
.fx-pop.show { animation: pop .8s; }

.log {
  background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius);
  padding: 8px 12px; height: 7.4em; flex: none; overflow-y: auto; font-size: 15px; line-height: 1.55; overscroll-behavior: contain;
}
.log p { margin: 0 0 3px; }
.log .talk { color: var(--enemy); font-weight: 700; }
.log .dmg { font-weight: 700; }
.log .good, .log .heal, .log .gold { color: var(--good); font-weight: 700; }
.log .bad { color: var(--bad); font-weight: 700; }
.log .miss { color: var(--sub); }
.log .system { color: var(--sub); }
.log .enemy { font-weight: 700; }

.status { background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.status-top { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.who { font-weight: 800; }
.status-top .gold { margin-left: auto; }
.meters { display: grid; gap: 5px; margin-top: 4px; }
.meter { position: relative; height: 22px; background: #e8e4d6; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter .fill { height: 100%; width: 100%; transition: width .35s; }
.meter .fill.hp { background: var(--hp); }
.meter .fill.mp { background: var(--mp); }
.meter .fill.sp { background: var(--sp); }
.meter-text { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 10px; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.enemy-meter { height: 18px; margin-top: 4px; }
.enemy-meter .meter-text { font-size: 12px; padding: 0 8px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; border: 2px solid var(--line); background: #ffe27a; white-space: nowrap; }
.chip.enemy { background: #d6c8ff; }

.menu { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.menu .btn { grid-column: span 2; padding: 8px 4px; font-size: 16px; }
.menu.sub { grid-template-columns: 1fr; }
.menu.sub { gap: 6px; }
.menu.sub .btn { grid-column: auto; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 4px 14px; font-size: 15px; line-height: 1.3; }
.menu.sub .btn small { font-weight: 500; color: var(--sub); font-size: 12px; display: block; }
.menu.sub .btn .cost { font-weight: 800; white-space: nowrap; }
.menu.sub .btn.back { justify-content: center; }
.menu.sub .scroll { display: contents; }

/* ---- 結果 ---- */
.big-title { font-size: 34px; text-align: center; margin-top: 16px; }
.big-title.good { color: var(--good); } .big-title.bad { color: var(--bad); }
.result-art { width: 150px; height: 150px; margin: 0 auto; }
.result-art svg { width: 100%; height: 100%; }
.result-art.sad svg { animation: down .8s forwards; }
.result-text, .result-rest { text-align: center; margin: 0; }
.result-gold { text-align: center; margin: 0; font-size: 24px; font-weight: 900; color: var(--gold); }
.lose-reason { text-align: center; font-size: 22px; font-weight: 900; margin: 20px 0; padding: 18px 12px; background: #fff; border: 3px solid var(--line); border-radius: var(--radius); }
.result-rest { color: var(--sub); font-size: 14px; }

.btn.share { background: #fff7c2; }
.share-msg { min-height: 1.4em; margin: 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--good); }

/* ---- ショップ ---- */
.shop-item { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.shop-item .icon { font-size: 28px; width: 36px; text-align: center; }
.shop-item .info { flex: 1; min-width: 0; }
.shop-item .nm { font-weight: 800; }
.shop-item .ds { font-size: 12px; color: var(--sub); }
.shop-item .own { font-size: 12px; color: var(--good); font-weight: 700; }
.shop-item .btn { min-height: 48px; min-width: 84px; padding: 6px 10px; }
.shop-msg { min-height: 1.5em; margin: 0; text-align: center; font-weight: 700; }

/* ---- はじめのタップ ---- */

/* ---- 音のON/OFF ---- */
.sound-btn { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: 8px; z-index: 10; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); background: var(--panel); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 0 var(--line); touch-action: manipulation; }
.sound-btn:focus-visible { outline: 4px solid #3b7bff; outline-offset: 2px; }
.sound-btn[aria-pressed="false"] { opacity: .7; }
.bar, .enemy-name-row { padding-right: 46px; }
#screen-title, #screen-result, #screen-lose { padding-top: 56px; }

/* ---- アニメ ---- */
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-12px) rotate(-3deg); } 60% { transform: translateX(12px) rotate(3deg); } }
@keyframes zap { 0%,100% { filter: none; } 25% { filter: brightness(2) saturate(2) hue-rotate(40deg); transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { filter: brightness(1.6); } }
@keyframes down { to { transform: translateY(40px) rotate(18deg) scale(.6); opacity: 0; } }
@keyframes appear { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: translateY(14px) scale(.7); } 25% { opacity: 1; transform: translateY(0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }
#screen-battle.hit-player { animation: shake .35s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .enemy-art.down svg { opacity: 0; }
}
@media (max-height: 700px) {
  .log { height: 5.6em; font-size: 14px; }
  .menu.sub .btn { min-height: 44px; padding-top: 3px; padding-bottom: 3px; }
}
.btn.dim { opacity: .65; }
.road-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.road { background: #fff; border: 3px solid #2b2a3a; border-radius: 14px; padding: 10px 12px; }
.road .rd-head { font-weight: 900; font-size: 17px; }
.road .rd-blurb { font-size: 14px; color: #6b6a7c; margin: 2px 0 4px; }
.road .rd-state { font-weight: 800; font-size: 14px; }
.road .rd-foes { font-size: 13px; color: #6b6a7c; margin-top: 2px; }
.road.soon { opacity: .6; background: #ecebf2; }
.road.now { border-color: #ff7a3d; background: #fff4e8; }
.road.done { border-color: #2fbf71; }
.road.goal { text-align: center; font-weight: 900; background: #ffe9a8; }
.hero-label { display: block; font-weight: 800; margin: 10px 0 4px; }
.hero-input { width: 100%; box-sizing: border-box; font-size: 20px; padding: 10px 12px; border: 3px solid #2b2a3a; border-radius: 12px; background: #fff; font-family: inherit; }
.result-bonus { text-align: center; font-weight: 900; color: #2f7d4f; margin: 4px 0; }
.hero-portrait { display: flex; justify-content: center; margin: 4px 0; }
.hero-portrait svg { width: 150px; height: 210px; }
.hero-chars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-ch { background: #fff; border: 3px solid #2b2a3a; border-radius: 12px; padding: 2px; cursor: pointer; }
.hero-ch svg { width: 100%; height: 80px; }
.hero-ch.on { background: #ffe0c8; border-color: #ff7a3d; }
.hero-outfits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.hero-of.on { background: #ffe0c8; border-color: #ff7a3d; }
.story-icon svg { width: 96px; height: 112px; }
.hub-card { position: relative; }
.hub-card .hc-face { position: absolute; right: 8px; top: 4px; }
.hub-card .hc-face svg { width: 54px; height: 62px; }
.hub-card .hc-name, .hub-card .hc-goal { margin-right: 60px; }

/* ときメモ風：日付パネル（縦）と、緑の枠の会話ウィンドウ */
.date-panel { position: absolute; right: 6px; top: 6px; width: 54px; background: #14532d; color: #fff; border: 3px solid #c8923a; border-radius: 8px; padding: 4px 2px; text-align: center; font-weight: 900; line-height: 1.35; box-shadow: 0 0 0 2px #3a2a12; }
.date-panel:empty { display: none; }
.date-panel[hidden] { display: none; }
.date-panel span { display: block; font-size: 15px; }
.date-panel .dp-y { font-size: 11px; color: #ffe27a; }
.date-panel .dp-w { color: #bfe3ff; }
.date-panel .dp-w.sat { color: #6ec1ff; }
.date-panel .dp-w.sun { color: #ff8a8a; }
.story-stage { position: relative; }
.story-stage .date-panel { right: 0; top: 0; }
.hub-card .date-panel { right: 8px; top: 8px; }
.hub-card .hc-face { right: 70px; }
.hub-card .hc-name, .hub-card .hc-goal { margin-right: 130px; }
.hub-card { min-height: 112px; }
.story-box { background: #0f5a2a; border: 4px solid #c8923a; box-shadow: inset 0 0 0 3px #3a2a12; color: #fff; }
.story-box .story-name { color: #ffe27a; }

/* ときメモ風：ステータス一覧（上部） */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #14532d; border: 3px solid #c8923a; border-radius: 10px; padding: 6px; box-shadow: 0 0 0 2px #3a2a12; margin-bottom: 4px; }
.stat-grid .sg-cell { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; background: #0b3a1f; border-radius: 6px; padding: 3px 7px; color: #fff; font-weight: 800; font-size: 13px; }
.stat-grid .sg-v { font-size: 15px; font-weight: 900; color: #fff; }
.stat-grid .sg-v.hi { color: #ff9ac6; }
.stat-grid .sg-v.lo { color: #7fb6ff; }
.stat-grid .sg-v.bad { color: #ff6a6a; }

.sound-gate { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 14px; overflow-y: auto; padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); text-align: center; }
.sound-gate[hidden] { display: none; }
.sound-gate .gate-icon { font-size: 56px; line-height: 1; }
.sound-gate h1 { font-size: 30px; line-height: 1.25; }
.sound-gate .gate-lead { margin: 0; color: var(--ink); }
.sound-gate .stack { width: 100%; max-width: 360px; }
.sound-gate .note { margin: 0; font-size: 13px; color: var(--sub); }
body.gated #app, body.gated .sound-btn { visibility: hidden; }

.stat-grid .sg-cell { flex-wrap: wrap; }
.stat-grid .sg-d { flex-basis: 100%; font-size: 10px; font-weight: 600; color: #bfe3c8; line-height: 1.3; }

#status-gear .btn { white-space: nowrap; min-width: 4.5em; }

.result-tip { margin: 6px 0; padding: 8px 10px; background: #e8f5e9; border: 2px solid #2e7d32; border-radius: 10px; color: #1b5e20; font-size: 14px; font-weight: 700; line-height: 1.6; }
.result-tip:empty { display: none; }
.dex-item .tip { font-size: 12px; color: #1b5e20; }

.tagline { margin: 0; text-align: center; font-weight: 900; font-size: 17px; color: var(--primary); text-shadow: 1px 1px 0 var(--ink); }
