:root {
  --fs: 1; /* 文字の大きさ（メニューで 1 / 1.15 / 1.3） */
  --bg: #0d1224;
  --panel: #182040;
  --panel-2: #212b52;
  --line: #3a4680;
  --text: #eef1ff;
  --muted: #9aa3c7;
  --gold: #f5c542;
  --good: #6be58f;
  --bad: #ff6b6b;
  --warn: #ffb347;
  --info: #7cc7ff;
  --radius: 10px;
  --font: 'DotGothic16', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(circle at 50% 0%, #1d2750, var(--bg) 70%) fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: calc(15px * var(--fs, 1));
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; }
img.sprite, .item-icon, .hud-row img { image-rendering: pixelated; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; }
.screen[hidden] { display: none !important; }

/* ---------- ボタン ---------- */
.btn {
  background: var(--panel-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s;
}
.btn:hover:not(:disabled) { background: #2c3970; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: #fff3; color: #221a00; font-weight: bold; }
.btn.primary:hover:not(:disabled) { background: #ffd666; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: calc(13px * var(--fs, 1)); }
.btn.big { padding: 12px 20px; font-size: calc(18px * var(--fs, 1)); }
.btn.on { background: var(--info); color: #06243a; border-color: var(--info); }
.btn.buy { background: #2d6a45; border-color: #49a36b; padding: 6px 10px; }
.btn.buy.card { background: #2d4d6a; border-color: #4a86b5; }

/* ---------- タイトル ---------- */
#title-screen { position: relative; min-height: 100dvh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.title-bg { position: absolute; inset: 0; background: url('../assets/backgrounds/title.jpg') center / cover; filter: brightness(0.45) saturate(1.2); }
.title-inner { position: relative; text-align: center; padding: 24px 16px; }
.kicker { color: var(--gold); letter-spacing: 0.2em; font-size: calc(12px * var(--fs, 1)); margin: 0; }
h1 { font-size: clamp(34px, 11vw, 52px); margin: 6px 0 4px; color: #fff; text-shadow: 3px 3px 0 #c0392b, 6px 6px 0 #0006; }
h1 small { display: block; font-size: calc(16px * var(--fs, 1)); text-shadow: none; color: var(--gold); margin-top: 6px; }
.title-cast { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin: 18px 0 8px; height: 190px; }
.title-cast .sprite { position: static; height: 180px; }
.title-cast .mine { height: 160px; }
.title-cast .maycri { height: 84px; }
.lead { color: #dde; margin: 8px 0 18px; }
.title-buttons { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 12px; }
.title-buttons .btn { min-width: 220px; }

/* ---------- HUD ---------- */
#hud { padding: 6px 10px 5px; background: #0a0f1f; border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 5; }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hud-row + .hud-row { margin-top: 3px; }
.date b { color: var(--gold); font-size: calc(17px * var(--fs, 1)); }
.date small { color: var(--muted); }
.mood { font-size: calc(13px * var(--fs, 1)); padding: 1px 8px; border-radius: 99px; background: var(--panel-2); }
.mood.m0 { color: #fff; background: #6b2330; }
.mood.m1 { color: #ffd2d2; background: #4a2a40; }
.mood.m3 { color: #0c2; background: #1d3a2a; }
.mood.m4 { color: #fff; background: #d0701a; }
.hud-row.money { flex-wrap: nowrap; align-items: stretch; }
.hud-row.money .cash { flex: 0 0 auto; justify-content: center; }
.hud-row.top { flex-wrap: nowrap; }
.mood { white-space: nowrap; }

.cash { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; font-size: calc(20px * var(--fs, 1)); color: var(--gold); }
.cash-main { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.cash img { width: 22px; height: 22px; }
.cash .neg { color: var(--bad); }
.debt { color: #ffc4c4; font-size: calc(13px * var(--fs, 1)); }
.debt b { font-size: calc(16px * var(--fs, 1)); }
.stamina { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.stamina img { width: 18px; height: 18px; }
.stamina span { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.bar { flex: 1; height: 10px; background: #0005; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #3fcf7a, #b7f05a); }
.bar.low i { background: linear-gradient(90deg, #d33, #f96); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: calc(11px * var(--fs, 1)); background: var(--panel-2); padding: 1px 7px; border-radius: 99px; color: var(--muted); white-space: nowrap; }
.chip.warn { background: #5a1f28; color: #ffc0c0; }
.hud-alert { margin-top: 3px; background: #5a1f28; color: #ffd9d9; font-size: calc(12px * var(--fs, 1)); padding: 2px 8px; border-radius: 6px; text-align: center; }

/* ---------- ステージ ---------- */
/* 縦長のスマホでは、ステージを画面の高さに合わせて大きくし（選択肢が出ても高さは変えない）、行動カードを画面の下（親指の届く場所）に置く */
#game-screen:not([hidden]) { display: flex; flex-direction: column; min-height: 100dvh; }
/* 演出の列・操作の列の入れ物（index.html）。スマホでは入れ物をなくして、いまの順に縦に並べる（PC は末尾の body.pc） */
.col-stage, .col-ops { display: contents; }
#hud { order: 0; } #stage { order: 1; } #message { order: 2; } #commands { order: 3; }
#ops-foot { display: none; }
#stage { position: relative; flex: none; height: clamp(204px, calc(34dvh + 34px), 340px); overflow: hidden; background: #000; } /* 実際の高さは ui/layout.js が測って決める */
#stage-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.62); }
#news-ticker { position: absolute; top: 0; left: 0; right: 0; padding: 4px 8px; background: #000b; font-size: calc(12px * var(--fs, 1)); z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#news-ticker:empty { display: none; }
#news-ticker small { color: var(--muted); }
.sprite { position: absolute; bottom: 0; image-rendering: pixelated; filter: drop-shadow(0 4px 0 #0007); }
#sprite-left { left: 8%; height: min(88%, 230px); }
#sprite-right { right: 8%; height: min(70%, 183px); bottom: 6%; } /* 右の人物もクリス（88%・最大230px）と同じ縮尺で頭打ち */
#sprite-right.hero { height: min(62%, 162px); bottom: 10%; }
#sprite-right.enemy { height: min(64%, 167px); bottom: 10%; }
#sprite-right.orig.mine { height: min(80%, 209px); bottom: 0; }
#sprite-right.orig.maycri { height: min(42%, 110px); bottom: 8%; }
.sprite[hidden] { display: none; }

/* ---------- メッセージ ---------- */
#message { position: relative; flex: none; min-height: clamp(128px, calc(100dvh - 674px), 180px); margin: 6px 8px 0; padding: 8px 12px 10px; background: #0b1020ee; border: 2px solid #c8cff5; border-radius: var(--radius); cursor: pointer; user-select: none; }
#speaker { color: var(--gold); font-size: calc(13px * var(--fs, 1)); min-height: 18px; }
#text { white-space: pre-wrap; min-height: 48px; }
#message.narr #text { color: #cfd6ff; font-style: italic; }
#message.info { border-color: var(--info); }
#message.info.good { border-color: var(--good); }
#message.info.good #speaker { color: var(--good); }
#message.info.bad { border-color: var(--bad); }
#message.info.bad #speaker { color: var(--bad); }
#next-mark { position: absolute; right: 10px; bottom: 4px; color: var(--gold); font-size: calc(12px * var(--fs, 1)); opacity: 0; }
#message.waiting #next-mark { opacity: 1; animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
#choices { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
#choices:empty { display: none; }
.choice { text-align: left; background: var(--panel-2); border: 2px solid var(--gold); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.choice:hover { background: #33407a; }
.choice small { margin-left: 8px; color: var(--warn); font-size: calc(12px * var(--fs, 1)); }

/* ---------- コマンド ---------- */
#commands { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: min-content; align-content: start; gap: 6px; padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); }
#commands.groups { grid-template-columns: repeat(4, 1fr); }
/* 出品枠のあきの知らせ（行動カードの上の帯） */
.cmd-idle { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px; border: 1px solid #ffd76a66; border-radius: 8px; background: #ffd76a14; color: #ffe9a8; font: inherit; font-size: calc(12px * var(--fs, 1)); cursor: pointer; }
.cmd-idle b { color: var(--gold); white-space: nowrap; }
#commands:empty { display: none; }
.cmd { position: relative; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--panel); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; text-align: left; min-height: 54px; color: var(--text); font: inherit; }
.cmd:hover { border-color: #6c7bd0; }
.cmd .cmd-ic { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; flex: none; }
.cmd b { font-size: calc(13px * var(--fs, 1)); line-height: 1.25; }
.cmd:not(.grp) { flex-direction: column; justify-content: center; gap: 3px; min-height: 70px; text-align: center; }
.cmd:not(.grp) b { font-size: calc(12px * var(--fs, 1)); }
.cmd.grp { flex-direction: column; justify-content: center; gap: 4px; min-height: 78px; text-align: center; }
.cmd.grp .cmd-ic { width: 38px; height: 38px; }
.cmd.grp b { font-size: calc(15px * var(--fs, 1)); }
.cmd.grp.off { opacity: 0.35; cursor: default; }
/* チュートリアル中、矢印の指していない分類・行動（押すと「矢印のボタンを押してね」） */
.cmd.tut-lock, .cmd-tab.tut-lock { opacity: 0.35; filter: grayscale(0.7); cursor: not-allowed; }
.cmd .n { position: absolute; top: 4px; right: 6px; font-size: calc(10px * var(--fs, 1)); color: var(--muted); }
.cmd.sel { border-color: var(--gold); background: #2a2f55; box-shadow: 0 0 0 2px #f5c54255; }
.cmd .go { position: absolute; top: -8px; right: -4px; font-size: calc(11px * var(--fs, 1)); background: var(--gold); color: #221a00; padding: 0 6px; border-radius: 99px; animation: go-pulse 0.9s ease-in-out infinite; }
@keyframes go-pulse { 50% { transform: scale(1.12); } }
.cmd .risk { position: absolute; bottom: 3px; right: 5px; font-size: calc(12px * var(--fs, 1)); color: var(--warn); }
.cmd.danger { border-color: #8a2b35; }
.cmd.danger .risk { color: var(--bad); }
.cmd.free { border-style: dashed; }
.cmd .free-tag { width: 100%; font-size: calc(10px * var(--fs, 1)); color: var(--muted); }
.cmd-back, .cmd-auto { font: inherit; font-size: calc(12px * var(--fs, 1)); background: none; border: 1px solid var(--line); color: var(--gold); border-radius: 99px; padding: 2px 10px; cursor: pointer; }
.cmd-auto { color: var(--info); border-color: var(--info); }
.x.info, .pr.info { --c: #7cc7ff; } .x.act, .pr.act { --c: #ff9f6b; } .x.tech, .pr.tech { --c: #c9a6ff; } .x.social, .pr.social { --c: #6be58f; } .x.mind, .pr.mind { --c: #ffe066; }

/* 経験点パネル（ステージの右側。行動を選ぶ間と獲得時だけ出る） */
#side { position: absolute; right: 6px; top: 32px; z-index: 3; width: 118px; display: flex; flex-direction: column; gap: 5px; }
#params { display: flex; flex-direction: column; gap: 2px; padding: 5px 6px; background: #080c1acc; border: 1px solid var(--line); border-radius: 8px; }
/* 演出中（会話の相手が右に立つ）は隠す。経験点の獲得時だけパネルを出す */
body.busy #side { display: none; }
body.busy.gain-flash #side { display: flex; }
body.busy.gain-flash #side-btns { display: none; }
#side-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.side-btn { position: relative; font: inherit; font-size: calc(12px * var(--fs, 1)); padding: 6px 2px; border-radius: 8px; border: 1px solid var(--line); background: #1a2350e6; color: var(--text); cursor: pointer; }
.side-btn:hover { background: #26307a; }
.side-btn.tree { grid-column: 1 / -1; font-size: calc(13px * var(--fs, 1)); font-weight: bold; padding: 8px 4px; color: #1b1300; border: 1px solid #fff6; background: linear-gradient(135deg, #ffe066, #f5a524); box-shadow: 0 0 12px #f5c54277, inset 0 -2px 0 #0002; animation: tree-glow 2.4s ease-in-out infinite; }
.side-btn.tree.locked { animation: none; background: #3a3a48; color: #aaa; box-shadow: none; }
@keyframes tree-glow { 50% { box-shadow: 0 0 20px #f5c542bb, inset 0 -2px 0 #0002; } }
.side-btn.locked { opacity: 0.7; }
.menu-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.menu-main .btn { position: relative; padding: 14px 8px; font-size: calc(16px * var(--fs, 1)); }
.menu-main .btn.locked { opacity: 0.55; }
.pr { display: grid; grid-template-columns: 30px 1fr 34px; align-items: baseline; gap: 4px; font-size: calc(12px * var(--fs, 1)); }
/* 基礎能力と経験点の切り替え */
.pr-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-bottom: 1px; }
.pr-tabs button { padding: 1px 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: inherit; font-size: calc(10px * var(--fs, 1)); cursor: pointer; white-space: nowrap; }
.pr-tabs button.on { background: #ffffff1c; color: var(--text); font-weight: bold; }
.pr.ab { grid-template-columns: 1fr 14px 22px 10px; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: calc(12px * var(--fs, 1)); text-align: left; cursor: pointer; }
.pr.ab .pn { color: var(--text); white-space: nowrap; }
.pr.ab .rk { font: 700 11px/1 'Orbitron', sans-serif; text-align: center; }
.pr.ab .rk.rS { color: #ff5bd0; } .pr.ab .rk.rA { color: #ff6b6b; } .pr.ab .rk.rB { color: #ff9f40; } .pr.ab .rk.rC { color: #ffe066; }
.pr.ab .rk.rD { color: #b7f05a; } .pr.ab .rk.rE { color: #6be58f; } .pr.ab .rk.rF { color: #7cc7ff; } .pr.ab .rk.rG { color: #9aa3c7; }
.pr.ab i { font-size: calc(9px * var(--fs, 1)); color: var(--gold); text-shadow: none; }
.pr .pn { color: var(--c); }
.pr b { text-align: right; font-weight: normal; }
.pr i { font-style: normal; font-size: calc(12px * var(--fs, 1)); font-weight: bold; color: #8dffb0; text-shadow: 0 0 6px #6be58f88; }
.pr.pre i { animation: soft-blink 1s ease-in-out infinite; }
.pr.pre b, .pr.up b { color: var(--c); }
.pr.up i { animation: float-up 1s ease-out both; }
@keyframes float-up { from { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(0); opacity: 1; } }

/* 体力・所持金の予告 */
.bar { position: relative; }
.bar i.ghost { position: absolute; top: 0; animation: soft-blink 1s ease-in-out infinite; }
@keyframes soft-blink { 50% { opacity: 0.3; } }
.bar i.ghost.lose { background: repeating-linear-gradient(135deg, #ff6b6b 0 4px, #a8323e 4px 8px); }
.bar i.ghost.gain { background: repeating-linear-gradient(135deg, #b7f05a 0 4px, #3fcf7a 4px 8px); }
.stamina .st-num.lose { color: #ffb0b0; }
.stamina .st-num.gain { color: var(--good); }
.stamina .risk { color: var(--warn); font-weight: normal; }
.stamina .risk.high { color: var(--bad); }
.cash-d { font-size: calc(13px * var(--fs, 1)); line-height: 1.1; animation: soft-blink 1s ease-in-out infinite; }
.cash-d.lose { color: var(--bad); }
.cash-d.gain { color: var(--good); }
body.busy #commands { opacity: 0.45; pointer-events: none; }
#message { position: relative; }

/* ---------- タブ ---------- */
.badge { position: absolute; top: -6px; right: -4px; background: var(--bad); color: #fff; border-radius: 99px; font-size: calc(10px * var(--fs, 1)); padding: 0 5px; }

/* ---------- モーダル ---------- */
.modal-backdrop { position: fixed; inset: 0; background: #000a; display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { width: 100%; max-width: 520px; max-height: 92dvh; background: var(--bg); border: 2px solid var(--line); border-bottom: none; border-radius: 14px 14px 0 0; display: flex; flex-direction: column; }
.modal-title { padding: 10px 14px; font-size: calc(17px * var(--fs, 1)); color: var(--gold); border-bottom: 1px solid var(--line); }
.modal-body { padding: 10px 12px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; }
.modal-footer { gap: 8px; flex-wrap: wrap; } /* ボタンが多いときは2段に */
.modal-footer .btn { flex: 1; min-height: 46px; }
.modal-footer .btn:not(.primary) { flex: 0 0 34%; background: #2a3150; color: var(--muted); }
@media (min-width: 560px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 14px; border-bottom: 2px solid var(--line); }
}
.wallet { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); margin-bottom: 6px; }
.note { font-size: calc(12px * var(--fs, 1)); color: var(--muted); margin: 4px 0 8px; }
.empty { color: var(--muted); text-align: center; padding: 20px 0; }
.sub { color: var(--gold); margin: 14px 0 6px; font-size: calc(14px * var(--fs, 1)); border-bottom: 1px dashed var(--line); padding-bottom: 2px; }
.card { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; }
.card.row { align-items: center; }
.card.listed { border-color: #4a86b5; }
.card.done { opacity: 0.55; }
.card.muted { color: var(--muted); }
.card .grow { flex: 1; min-width: 0; }
.item-icon { width: 48px; height: 48px; flex: none; background: #0004; border-radius: 8px; }
.name { font-size: calc(15px * var(--fs, 1)); }
.name small { color: var(--muted); font-size: calc(12px * var(--fs, 1)); }
.name .held { color: var(--info); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
.tag { font-size: calc(11px * var(--fs, 1)); background: #0006; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: #cdd3f5; }
.tag.src { border-color: var(--gold); color: var(--gold); }
.tag.good { border-color: var(--good); color: var(--good); }
.tag.bad { border-color: var(--bad); color: var(--bad); }
.nums { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: calc(13px * var(--fs, 1)); }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.warn { color: var(--warn); font-size: calc(12px * var(--fs, 1)); margin-top: 3px; }
.done-label { color: var(--muted); font-size: calc(12px * var(--fs, 1)); margin-top: 4px; }
.buy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.qty1 { font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.editor { margin-top: 8px; padding: 8px; background: #0005; border-radius: 8px; border: 1px dashed var(--line); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0; }
.price-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.price-row input { width: 140px; font: inherit; font-size: calc(16px * var(--fs, 1)); padding: 6px 8px; background: #0b1020; color: var(--text); border: 2px solid var(--line); border-radius: 6px; }
.summary { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px; border-top: 1px solid var(--line); font-size: calc(14px * var(--fs, 1)); }
.spark { width: 96px; height: 28px; flex: none; }
.spark polyline { fill: none; stroke: var(--info); stroke-width: 2; }
.news-list .news { font-size: calc(13px * var(--fs, 1)); padding: 4px 8px; border-left: 3px solid var(--info); background: #0004; margin-bottom: 4px; }
.news.up { border-color: var(--good) !important; }
.news.down { border-color: var(--bad) !important; }
.news.event { border-color: var(--gold) !important; }

/* 能力 */
.exp-pool { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.exp { background: var(--panel); border-radius: 8px; text-align: center; padding: 4px 0; }
.exp small { display: block; font-size: calc(11px * var(--fs, 1)); }
.exp b { font-size: calc(18px * var(--fs, 1)); }
.exp.info small { color: #7cc7ff; } .exp.act small { color: #ff9f6b; } .exp.tech small { color: #c9a6ff; } .exp.social small { color: #6be58f; } .exp.mind small { color: #ffe066; }
.ability { align-items: center; }
.ability .bar { height: 8px; margin: 4px 0; }
.ability .bar i { background: linear-gradient(90deg, #4a86ff, #7cc7ff); }
.desc { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.col small { font-size: calc(10px * var(--fs, 1)); color: var(--muted); white-space: nowrap; }
.rank { width: 38px; height: 38px; flex: none; display: grid; place-items: center; font-size: calc(24px * var(--fs, 1)); border-radius: 8px; background: #0006; }
.rank.rS { color: #ff5bd0; } .rank.rA { color: #ff6b6b; } .rank.rB { color: #ff9f40; } .rank.rC { color: #ffe066; }
.rank.rD { color: #b7f05a; } .rank.rE { color: #6be58f; } .rank.rF { color: #7cc7ff; } .rank.rG { color: #9aa3c7; }
.skills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.skill { font-size: calc(12px * var(--fs, 1)); padding: 2px 8px; border-radius: 4px; }
.skill.blue { background: #1d4f91; }
.skill.gold { background: linear-gradient(135deg, #b8860b, #ffd700); color: #2a1d00; }
.skill-row.gold { border-color: #d4a017; }
.skill-row.red { border-color: var(--bad); }

/* 家計 */
.ledger-grid { display: grid; gap: 2px; }
.lg-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 4px; border-bottom: 1px dotted #ffffff14; font-size: calc(13px * var(--fs, 1)); }
.lg-row b { text-align: right; }
.ledger { max-height: 260px; overflow-y: auto; }
.ledger-row { display: grid; grid-template-columns: 88px 1fr auto; gap: 6px; font-size: calc(12px * var(--fs, 1)); padding: 2px 0; border-bottom: 1px dotted #ffffff10; }
.ledger-row small { color: var(--muted); }
.menu-list { display: flex; flex-direction: column; gap: 10px; }

/* トースト */
.toast-stack { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 6px; width: max-content; max-width: 92vw; pointer-events: none; }
.toast { background: #000e; border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; opacity: 0; transform: translateY(-10px); transition: 0.25s; font-size: calc(14px * var(--fs, 1)); max-width: 92vw; box-shadow: 0 4px 14px #0008; }
.toast.show { opacity: 1; transform: none; }
.toast.good { border-color: var(--good); }
.toast.bad { border-color: var(--bad); }

/* ---------- エンディング ---------- */
#ending-screen { padding: 20px 16px 40px; }
.ending { text-align: center; }
.ending h2 { font-size: calc(30px * var(--fs, 1)); color: var(--gold); margin: 6px 0 10px; }
.ending .sprite.big { position: static; height: 180px; margin: 6px auto; display: block; }
.ending-line { margin: 6px 0; }
.result { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 18px 0; }
.rank.huge { width: 88px; height: 88px; font-size: calc(64px * var(--fs, 1)); border: 3px solid currentColor; }
.rank-label { font-size: calc(20px * var(--fs, 1)); color: var(--gold); }
.ending .ledger-grid, .ending .ledger-row { text-align: left; }

/* ---------- v2: 10年キャリア・スキルツリー・KPI ---------- */
.hud-mission { margin-top: 3px; line-height: 1.3; background: #1d3a2a; border: 1px solid #3d7a55; color: #d9ffe6; font-size: calc(12px * var(--fs, 1)); padding: 2px 8px; border-radius: 6px; display: flex; flex-direction: column; }
.hud-mission b { color: #8bf0b0; }
.chip.stage { background: #3a2f10; color: var(--gold); }
.debt.clear { color: var(--good); }
.cmd-header { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-size: calc(12px * var(--fs, 1)); color: var(--gold); min-height: 22px; }
.cmd.sleep { border-style: dashed; }
body.auto #message { border-color: var(--info); }
body.auto #message::after { content: 'オート進行中'; position: absolute; top: 4px; right: 10px; font-size: calc(11px * var(--fs, 1)); color: var(--info); }
.muted { color: var(--muted); }
.sub.small { font-size: calc(12px * var(--fs, 1)); margin-top: 4px; }

.branch-tabs { position: sticky; top: -10px; background: var(--bg); padding: 6px 0; z-index: 1; }
.card.root { border-color: var(--gold); }
.card.node { position: relative; align-items: center; }
.card.node.owned { border-color: #3d7a55; background: #16261d; }
.card.node.locked { opacity: 0.6; }
.card.node.gold { border-color: #d4a017; }
.card.node.red { border-color: var(--bad); }
.branch-line { position: absolute; left: -12px; top: 10px; color: var(--muted); }
.badge-kind { color: var(--info); }
.owned-mark { color: var(--good); font-size: calc(18px * var(--fs, 1)); padding: 0 6px; }

.stage-box { background: var(--panel); border: 1px solid var(--gold); border-radius: var(--radius); padding: 8px 10px; }
.stage-steps { display: flex; gap: 4px; margin-bottom: 6px; }
.stage-steps .st { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #0006; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.stage-steps .st.done { background: #3d7a55; color: #fff; }
.stage-steps .st.on { background: var(--gold); color: #221a00; font-weight: bold; }
.kpi-table { display: grid; gap: 2px; }
.kpi-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; font-size: calc(13px * var(--fs, 1)); padding: 3px 4px; border-bottom: 1px dotted #ffffff14; }
.kpi-row b { text-align: right; }
.kpi-row.head { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.kpi-row.head span:not(:first-child) { text-align: right; }
.kpi-row.locked { grid-template-columns: 1fr 2fr; color: var(--muted); }

/* ---------- スキルツリー（v3：放射状のルート） ---------- */
.tree-screen {
  --t-bg: #0A0C10; --t-surface: #14181F; --t-raised: #1B202A; --t-line: #2D3441; --t-strong: #3D4656;
  --t-ink: #E5E7EB; --t-ink2: #9CA3AF; --t-ink3: #6B7280; --t-ok: #22C55E; --t-ng: #EF4444; --t-gold: #F5C542;
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; color: var(--t-ink);
  font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', system-ui, sans-serif;
  background: linear-gradient(rgba(6, 12, 16, 0.86), rgba(6, 10, 14, 0.94)), url('../assets/backgrounds/online.jpg') center / cover;
}
.tree-head { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 6px; align-items: center; padding: 8px 12px; background: rgba(10, 12, 16, 0.85); border-bottom: 1px solid var(--t-line); }
.tree-head .tree-back { grid-row: span 2; }
.tree-back { width: 40px; height: 40px; border-radius: 10px; background: var(--t-raised); border: 1px solid var(--t-strong); color: var(--t-ink); font-size: calc(20px * var(--fs, 1)); cursor: pointer; }
.tree-title { display: flex; align-items: baseline; gap: 8px; line-height: 1.1; }
.tree-title b { font-size: calc(18px * var(--fs, 1)); }
.tree-title small { font-family: 'Orbitron', monospace; font-size: calc(9px * var(--fs, 1)); letter-spacing: 0.22em; color: #38BDF8; }
.tree-exp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tree-exp span { font-family: 'Orbitron', monospace; font-size: calc(11px * var(--fs, 1)); background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 6px; padding: 2px 4px; display: flex; gap: 3px; align-items: center; justify-content: center; white-space: nowrap; }
.tree-exp i { font-style: normal; font-family: 'Zen Kaku Gothic New', sans-serif; font-size: calc(10px * var(--fs, 1)); opacity: 0.9; }

.tree-routebar { padding: 6px 12px 8px; background: rgba(10, 12, 16, 0.7); border-bottom: 1px solid var(--t-line); }
.route-goal { font-size: calc(13px * var(--fs, 1)); }
.route-goal small { color: var(--t-ink3); margin-right: 6px; font-size: calc(11px * var(--fs, 1)); }
.route-goal b { font-size: calc(15px * var(--fs, 1)); }
.route-pips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 5px; }
.route-pip { position: relative; height: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; border-radius: 6px; background: var(--t-surface); border: 1px solid var(--t-line); color: var(--t-ink2); font-size: calc(11px * var(--fs, 1)); overflow: hidden; cursor: pointer; padding: 0; }
.route-pip i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); opacity: 0.28; }
.route-pip span { position: relative; }
.route-pip em { position: relative; font-style: normal; font-family: 'Orbitron', monospace; font-size: calc(8px * var(--fs, 1)); color: var(--c); }
.route-pip.main { border-color: var(--c); color: var(--t-ink); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 45%, transparent); }

.tree-viewport { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; }
.tree-viewport:active { cursor: grabbing; }
.tree-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.tree-world.glide { transition: transform 0.42s cubic-bezier(0.2, 0, 0.2, 1); }
.tree-links { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.tree-links .link { fill: none; stroke-width: 2.5; opacity: 0.28; }
.tree-links .link.on { opacity: 0.9; stroke-width: 3; }
.tree-links .link-flow { fill: none; stroke-width: 3; stroke-dasharray: 3 22; stroke-linecap: round; animation: flow 1.6s linear infinite; opacity: 0.95; }
.tree-links .link.grow { animation: grow 0.52s cubic-bezier(0.2, 0, 0.2, 1) forwards; }
.tree-links .route-label { font: 700 22px 'Zen Kaku Gothic New', sans-serif; opacity: 0.55; letter-spacing: 0.1em; }
@keyframes flow { to { stroke-dashoffset: -25; } }
@keyframes grow { to { stroke-dashoffset: 0; } }

.tnode { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; padding: 0; color: var(--t-ink); cursor: pointer; width: 96px; }
.tnode-panel { position: relative; width: 58px; height: 58px; border-radius: 13px; display: grid; place-items: center; background: var(--t-surface); border: 2px solid var(--t-strong); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); transition: transform 0.12s; }
.tnode:hover .tnode-panel { transform: scale(1.06); }
.tnode-panel img { width: 42px; height: 42px; image-rendering: pixelated; pointer-events: none; }
.tnode-q { font-size: calc(26px * var(--fs, 1)); color: var(--t-ink3); }
.tnode-lv { font-family: 'Orbitron', monospace; font-size: calc(10px * var(--fs, 1)); font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--t-raised); border: 1px solid var(--t-strong); margin-top: -10px; position: relative; }
.tnode-name { font-size: calc(11px * var(--fs, 1)); line-height: 1.2; text-align: center; text-shadow: 0 1px 3px #000; max-width: 96px; }
.tnode-stage { position: absolute; top: -9px; z-index: 2; font-family: 'Orbitron', monospace; font-size: calc(9px * var(--fs, 1)); font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #38BDF8; color: #0A0C10; }

.tnode.owned .tnode-panel { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, var(--t-surface)); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
.tnode.owned .tnode-lv { border-color: var(--c); color: var(--c); }
.tnode.max .tnode-panel { border-color: color-mix(in srgb, var(--c) 55%, transparent); border-width: 1px; background: color-mix(in srgb, var(--c) 10%, var(--t-surface)); }
.tnode.max .tnode-panel img { opacity: 0.6; }
.tnode.max .tnode-lv { color: var(--t-ink3); }
.tnode.can .tnode-panel { border-color: var(--t-ok); animation: pulse 1.4s ease-in-out infinite; }
.tnode.can .tnode-lv { border-color: var(--t-ok); color: var(--t-ok); }
.tnode.short .tnode-panel { border-color: var(--t-ng); }
.tnode.locked .tnode-panel { border-style: dashed; opacity: 0.7; }
.tnode.locked .tnode-panel img { filter: grayscale(1) brightness(0.6); }
.tnode.sel .tnode-panel { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); } 50% { box-shadow: 0 0 18px rgba(34, 197, 94, 0.95); } }

.tnode.k-root .tnode-panel { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--t-gold); background: radial-gradient(circle, #3a2f10, var(--t-surface)); box-shadow: 0 0 22px rgba(245, 197, 66, 0.55); }
.tnode.k-root .tnode-panel img { width: 50px; height: 50px; }
.tnode.k-record .tnode-panel { border-radius: 50%; border-width: 1px; }
.tnode.k-record .rec-ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); }
.rec-ring .rec-bg { fill: none; stroke: #ffffff18; stroke-width: 3; }
.rec-ring .rec-arc { fill: none; stroke: var(--t-gold); stroke-width: 3; stroke-linecap: round; }
.tnode.k-gold .tnode-panel { border-color: #D4A017; box-shadow: inset 0 0 0 2px #0A0C10, inset 0 0 0 3px #D4A01766; }
.tnode.k-gold.can .tnode-panel, .tnode.k-gold.owned .tnode-panel { border-color: var(--t-gold); }
.tnode.k-capstone .tnode-panel { width: 70px; height: 70px; border-radius: 16px; transform: rotate(45deg); }
.tnode.k-capstone .tnode-panel img { transform: rotate(-45deg); width: 46px; height: 46px; }
.tnode.k-capstone:hover .tnode-panel { transform: rotate(45deg) scale(1.06); }
.tnode.k-capstone .tnode-lv { margin-top: -4px; }
.tnode.k-capstone .tnode-name { font-weight: 700; color: var(--c); }
.tnode.pop { animation: popin 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes popin { from { opacity: 0; transform: translate(-50%, -50%) scale(0.3); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.tree-sheet { background: rgba(12, 14, 19, 0.96); border-top: 1px solid var(--t-line); padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); max-height: 46dvh; overflow-y: auto; }
.sheet-top { display: flex; align-items: flex-start; gap: 8px; }
.sheet-top > div:first-child { flex: 1; }
.sheet-name { font-size: calc(17px * var(--fs, 1)); font-weight: 700; }
.sheet-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: calc(11px * var(--fs, 1)); color: var(--t-ink2); margin-top: 2px; }
.route-tag { color: var(--c); border: 1px solid var(--c); border-radius: 4px; padding: 0 5px; }
.warn-t { color: #F59E0B; }
.sheet-lv { font-family: 'Orbitron', monospace; color: var(--t-gold); font-size: calc(14px * var(--fs, 1)); white-space: nowrap; }
.sheet-x { background: none; border: 0; color: var(--t-ink2); font-size: calc(22px * var(--fs, 1)); cursor: pointer; line-height: 1; }
.sheet-desc { margin: 6px 0; font-size: calc(14px * var(--fs, 1)); line-height: 1.55; }
.sheet-rec { display: flex; justify-content: space-between; font-size: calc(13px * var(--fs, 1)); background: var(--t-surface); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.sheet-rec b { font-family: 'Orbitron', monospace; color: var(--t-gold); }
.sheet-block { color: #F87171; font-size: calc(12px * var(--fs, 1)); margin: 4px 0; }
.sheet-note { color: var(--t-ink2); font-size: calc(12px * var(--fs, 1)); margin: 4px 0; }
.sheet-hint { color: var(--t-ink2); font-size: calc(12px * var(--fs, 1)); margin: 0 0 6px; }
.sheet-go { width: 100%; text-align: left; background: var(--t-surface); border: 1px solid var(--t-line); color: var(--t-ink2); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: calc(13px * var(--fs, 1)); cursor: pointer; margin-bottom: 6px; }
.sheet-go.ok { color: var(--t-ok); border-color: #22C55E66; }
.sheet-perks { display: flex; flex-direction: column; gap: 2px; font-size: calc(12px * var(--fs, 1)); color: var(--t-ink3); margin-bottom: 8px; }
.sheet-perks small { color: var(--t-ink2); }
.sheet-perks .on { color: var(--t-ok); }
.sheet-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tree-btn { width: 100%; min-height: 48px; border-radius: 10px; border: 1px solid var(--t-strong); background: var(--t-raised); color: var(--t-ink); font: inherit; font-size: calc(16px * var(--fs, 1)); font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; margin-top: 6px; }
.tree-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tree-btn.gold { background: linear-gradient(180deg, #FACC4F, #E3A81F); color: #221a00; border-color: #fff4; }
.tree-btn.gold.free { background: linear-gradient(180deg, #34D57A, #16A34A); color: #04140a; }
.tree-btn.sub { min-height: 40px; font-size: calc(13px * var(--fs, 1)); margin-top: 0; }
.tree-btn.mini { min-height: 30px; font-size: calc(13px * var(--fs, 1)); padding: 0 12px; margin: 0; width: auto; }
.cost-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; font-size: calc(11px * var(--fs, 1)); font-weight: 500; }
.cost-chip { font-style: normal; background: #0006; border-radius: 4px; padding: 0 5px; }
.tree-btn.gold .cost-chip { background: #0000001f; color: #221a00; }
.ab-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--t-line); }
.ab-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ab-main small { color: var(--t-ink3); font-size: calc(11px * var(--fs, 1)); }
.ab-main .bar { height: 6px; }
.ab-main .bar i { background: linear-gradient(90deg, #0EA5E9, #38BDF8); }
.ab-btns { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; max-width: 150px; }
@media (min-width: 900px) { .tree-sheet { max-height: 34dvh; } }
/* パネルの詳細（マウスを乗せたとき・タップしたとき） */
.tnode-tip { position: absolute; z-index: 6; width: 280px; max-width: calc(100% - 16px); padding: 10px 12px; border: 1px solid var(--t-strong); border-radius: 10px; background: rgba(20, 24, 31, 0.97); box-shadow: 0 8px 24px #000a; color: var(--t-ink); font-size: calc(12px * var(--fs, 1)); line-height: 1.5; pointer-events: none; }
.tnode-tip[hidden] { display: none; }
.tt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tt-nm { font-size: calc(15px * var(--fs, 1)); }
.tt-lv { color: var(--t-ink2); font-family: 'Orbitron', monospace; font-size: calc(11px * var(--fs, 1)); white-space: nowrap; }
.tt-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 2px 0 4px; color: var(--t-ink3); font-size: calc(11px * var(--fs, 1)); }
.tt-ds { margin: 0 0 6px; color: var(--t-ink); }
.tt-cost { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.tt-cost .cost-chip.ok { color: var(--t-ok); }
.tt-cost .cost-chip.ng { color: var(--t-ng); }
.tt-note { margin: 0 0 4px; color: var(--warn); font-size: calc(11px * var(--fs, 1)); }
.tt-st { margin: 0; font-weight: bold; font-size: calc(12px * var(--fs, 1)); }
.tt-st.ok { color: var(--t-ok); }
.tt-st.ng { color: var(--t-ng); }
/* いま解放できるパネルと「安い順にまとめて解放」（MyCryptoWorkshop にならう） */
.tb-bulk { margin-bottom: 10px; padding: 8px 10px; border: 1px solid #22C55E55; border-radius: 10px; background: #22C55E0d; }
.tb-bulk-h { display: flex; justify-content: space-between; align-items: baseline; color: var(--t-ok); font-weight: bold; font-size: calc(13px * var(--fs, 1)); margin-bottom: 6px; }
.tb-bulk-h small { color: var(--t-ink3); font-weight: normal; }
.tb-bulk-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; }
.tb-bulk-item { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 104px; padding: 6px 4px; border: 1px solid var(--c); border-radius: 8px; background: var(--t-surface); color: var(--t-ink); font: inherit; font-size: calc(11px * var(--fs, 1)); cursor: pointer; }
.tb-bulk-item img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.tb-bulk-nm { text-align: center; line-height: 1.25; }
.tb-bulk-item .cost-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; font-size: calc(10px * var(--fs, 1)); }
.tb-bulk-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; font-size: calc(12px * var(--fs, 1)); color: var(--t-ink2); }
.tb-bulk-x { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.tb-bulk-x .pn { color: var(--c); }
.tb-bulk-go { min-height: 42px; margin-top: 0; }
.tb-bulk-note { margin: 4px 0 0; color: var(--t-ink3); font-size: calc(11px * var(--fs, 1)); }
.tree-btn.tb-bulk-lv { margin-top: 6px; }

/* ---------- 仕入れ画面（EC サイト風） ---------- */
.shop { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; background: #f5f5f5; color: #222; font-family: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', system-ui, sans-serif; box-shadow: 0 0 0 100vmax #000a; }
.shop-head { --site: #1b8de0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--site); color: #fff; flex: none; }
.shop-x { width: 32px; height: 32px; border-radius: 99px; border: none; background: #fff3; color: #fff; font-size: calc(22px * var(--fs, 1)); line-height: 1; cursor: pointer; }
.shop-logo { font-size: calc(18px * var(--fs, 1)); letter-spacing: 0.04em; }
.shop-sub { font-size: calc(12px * var(--fs, 1)); opacity: 0.85; margin-left: auto; }
.shop-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }
.shop-body.item { padding-bottom: 90px; background: #fff; }
.shop-wallet { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; font-size: calc(12px * var(--fs, 1)); color: #555; background: #fff; border-bottom: 1px solid #e5e5e5; }
.shop-wallet .neg { color: #d33; }
.shop-tabs { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; background: #fff; border-bottom: 1px solid #e5e5e5; }
.shop-tabs button { --site: #555; flex: none; font: inherit; font-size: calc(12px * var(--fs, 1)); padding: 4px 12px; border-radius: 99px; border: 1px solid #ccc; background: #fff; color: #444; cursor: pointer; }
.shop-tabs button.on { background: var(--site); border-color: var(--site); color: #fff; }
.shop-auto { margin: 8px 10px 0; padding: 8px 10px; background: #e9f7ee; border-radius: 8px; font-size: calc(12px * var(--fs, 1)); }
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; padding: 2px; }
@media (min-width: 480px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
.sh-item { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0 0 8px; border: none; background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.sh-img { position: relative; aspect-ratio: 1; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff, #e8e8ee); }
.sh-item.store .sh-img { background: radial-gradient(circle at 50% 40%, #fffaf0, #f0e6d2); }
.ph { position: relative; width: 100%; height: 100%; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff, #e6e6ec); }
.ph img { width: 100%; height: 100%; object-fit: contain; padding: 14%; image-rendering: pixelated; }
.ph-stock { position: absolute; inset: 0; display: grid; place-items: center; font: 700 22px/1 'Orbitron', sans-serif; color: #0002; transform: rotate(-24deg); letter-spacing: 0.2em; pointer-events: none; }
.ph.big .ph-stock { font-size: calc(48px * var(--fs, 1)); }
.ph-label { position: absolute; left: 10px; top: 10px; font-size: calc(11px * var(--fs, 1)); padding: 2px 8px; border-radius: 99px; background: #0007; color: #fff; }
.sh-price { position: absolute; left: 0; bottom: 10px; padding: 3px 10px 3px 8px; border-radius: 0 99px 99px 0; background: #000a; color: #fff; font-weight: 700; font-size: calc(14px * var(--fs, 1)); }
.sh-tag { position: absolute; right: 6px; bottom: 6px; display: flex; flex-direction: column; align-items: center; padding: 3px 8px; background: #ffe24a; color: #c00; font-weight: 700; font-size: calc(15px * var(--fs, 1)); border-radius: 3px; box-shadow: 0 1px 2px #0003; transform: rotate(-3deg); }
.sh-tag small { font-size: calc(9px * var(--fs, 1)); color: #333; font-weight: 500; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-badge { position: absolute; left: 6px; top: 6px; font-size: calc(10px * var(--fs, 1)); padding: 1px 6px; border-radius: 3px; background: #2d4fa8; color: #fff; }
.sh-badge.pt { background: #d33; }
.sh-badge.rep { left: auto; right: 6px; background: #6b4fa8; }
.sh-sold { position: absolute; left: -28px; top: 12px; transform: rotate(-45deg); background: #d33; color: #fff; font: 700 11px/1 'Orbitron', sans-serif; padding: 4px 32px; }
.sh-item.sold .sh-img img { opacity: 0.5; }
.sh-name { padding: 0 8px; font-size: calc(13px * var(--fs, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-meta { display: flex; gap: 6px; padding: 0 8px; font-size: calc(11px * var(--fs, 1)); color: #888; }
.sh-site { --site: #888; color: var(--site); font-weight: 700; }
.sh-memo { margin: 2px 8px 0; padding: 2px 6px; font-size: calc(11px * var(--fs, 1)); color: #5a4a00; background: #fff6c8; border-radius: 3px; align-self: flex-start; }
.sh-memo .pos, .mm-row .pos { color: #0a8a3a; }
.sh-memo .neg, .mm-row .neg { color: #d33; }
.shop-footer { flex: none; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #ddd; }
.shop-done { display: block; width: 100%; min-height: 48px; font-size: calc(16px * var(--fs, 1)); }

.gallery { background: #eee; }
.gallery .ph.big { aspect-ratio: 1; max-height: 58vh; margin: 0 auto; }
.thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: #fff; }
.thumbs button { flex: none; width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button.on { border-color: #1b8de0; }
.it-sec { padding: 12px 14px; border-bottom: 8px solid #f2f2f2; }
.it-sec h3 { font-size: calc(14px * var(--fs, 1)); margin: 0 0 8px; color: #333; }
.it-title { font-size: calc(16px * var(--fs, 1)); margin: 0 0 6px; }
.it-price { font-size: calc(26px * var(--fs, 1)); font-weight: 700; color: #222; }
.it-price small { font-size: calc(12px * var(--fs, 1)); font-weight: 400; color: #666; margin-left: 4px; }
.it-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: calc(13px * var(--fs, 1)); color: #666; align-items: center; }
.it-deal { background: #ffe24a; color: #c00; padding: 1px 8px; border-radius: 3px; font-weight: 700; }
.it-pt { color: #d33; font-weight: 700; }
.it-desc { white-space: pre-wrap; margin: 0; font-size: calc(14px * var(--fs, 1)); line-height: 1.7; }
.it-info { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--fs, 1)); }
.it-info th { text-align: left; color: #666; font-weight: 400; width: 38%; padding: 6px 0; border-bottom: 1px solid #eee; }
.it-info td { padding: 6px 0; border-bottom: 1px solid #eee; }
.seller { display: flex; gap: 12px; align-items: flex-start; }
.seller > img { width: 52px; height: 52px; border-radius: 99px; object-fit: cover; object-position: top; background: #e8e8ee; image-rendering: pixelated; flex: none; }
.seller b { font-size: calc(15px * var(--fs, 1)); }
.sl-rate { font-size: calc(13px * var(--fs, 1)); color: #e8a400; margin-top: 2px; }
.sl-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: calc(12px * var(--fs, 1)); color: #777; margin-top: 4px; }
.sl-meta .ok { color: #0a8a3a; }
.sl-review { margin-top: 6px; font-size: calc(12px * var(--fs, 1)); color: #555; background: #f6f6f6; padding: 4px 8px; border-radius: 6px; }
.qa-ask { width: 100%; text-align: left; font: inherit; font-size: calc(13px * var(--fs, 1)); padding: 10px 12px; border: 1px solid #1b8de0; color: #1b8de0; background: #fff; border-radius: 8px; cursor: pointer; }
.qa .q, .qa .a { font-size: calc(13px * var(--fs, 1)); padding: 8px 10px; border-radius: 10px; margin-bottom: 6px; max-width: 88%; }
.qa .q { background: #eef6ff; margin-left: auto; }
.qa .a { background: #f3f3f3; }
.qa b { display: block; font-size: calc(11px * var(--fs, 1)); color: #888; }
.it-sec.memo { background: #fffbe6; border-bottom-color: #f2f2f2; }
.it-sec.memo h3 { color: #7a6200; }
.mm-row { display: flex; align-items: baseline; gap: 8px; font-size: calc(13px * var(--fs, 1)); padding: 2px 0; }
.mm-row span { width: 7em; color: #7a6a30; }
.mm-row small { color: #998; font-size: calc(11px * var(--fs, 1)); }
.mm-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.mm-tags span { font-size: calc(11px * var(--fs, 1)); padding: 1px 6px; border: 1px solid #d8c98a; border-radius: 3px; color: #7a6a30; }
.mm-tags .bad { border-color: #d33; color: #d33; }
.mm-checks { margin-top: 8px; }
.mm-h { font-size: calc(12px * var(--fs, 1)); color: #7a6a30; margin-bottom: 4px; }
.ck { display: flex; gap: 6px; font-size: calc(13px * var(--fs, 1)); padding: 2px 0; }
.ck i { font-style: normal; width: 1em; text-align: center; }
.ck.ok i { color: #0a8a3a; }
.ck.ng { color: #c22; }
.ck.unk { color: #aaa; }
.mm-verdict { margin-top: 8px; font-weight: 700; padding: 6px 10px; border-radius: 6px; }
.mm-verdict.ok { background: #e3f6ea; color: #0a7a33; }
.mm-verdict.ng { background: #fde8e8; color: #c22; }
.buy-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #ddd; }
.shop { position: fixed; }
.buy-bar .stepper { display: flex; align-items: center; gap: 6px; color: #222; }
.buy-bar .btn { color: #222; background: #f0f0f0; border-color: #ccc; }
.buy-bar .bb-cash { flex: 1; background: #e8413c; border-color: #e8413c; color: #fff; font-weight: 700; padding: 12px; }
.buy-bar .bb-card { background: #fff; }
.sold-out { flex: 1; text-align: center; padding: 12px; background: #bbb; color: #fff; border-radius: 8px; font-weight: 700; }

/* チュートリアルの誘導：目標のパネルの上で指さしが跳ねる */
.tnode.guide::after { content: '▼'; position: absolute; left: 50%; top: -30px; transform: translateX(-50%); color: #facc15; font-size: calc(20px * var(--fs, 1)); text-shadow: 0 0 8px #facc15aa; animation: guide-bounce 0.8s ease-in-out infinite; pointer-events: none; }
@keyframes guide-bounce { 50% { transform: translate(-50%, -6px); } }

/* HUD：ステージは残り週の右。体力ゲージは2/3、右に評価・炎上 */
.date { display: flex; align-items: baseline; gap: 6px; flex-wrap: nowrap; white-space: nowrap; min-width: 0; }
.date .chip.stage { align-self: center; font-family: 'Orbitron', var(--font); font-size: calc(10px * var(--fs, 1)); letter-spacing: 0.04em; }
.hud-row.bars { flex-wrap: nowrap; }
.hud-row.bars .chips { flex: 0 0 auto; justify-content: flex-end; flex-wrap: nowrap; }
.hud-row.warn-row { justify-content: flex-start; }

/* ニュース：はみ出すときは横スクロール */
#news-ticker .ticker-inner { display: inline-block; white-space: nowrap; }
#news-ticker.scroll { text-overflow: clip; }
#news-ticker.scroll .ticker-inner { animation: ticker var(--dur, 10s) linear infinite; }
@keyframes ticker { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(var(--dist)); } }

/* 手に入れた商品（クリスの右側。表示中は経験点パネルを隠す） */
#loot { position: absolute; right: 6px; top: 26px; z-index: 4; width: 164px; max-height: calc(100% - 32px); overflow: hidden; display: none; flex-direction: column; align-items: center; gap: 1px; padding: 6px 9px 8px; background: #0a0f1fee; border: 2px solid var(--gold); border-radius: 10px; box-shadow: 0 0 16px #f5c54255; }
body.loot-show #loot { display: flex; animation: loot-in 0.25s ease-out; }
body.loot-show #side { display: none !important; }
/* 相手の立ち絵（右側）が出ている間は、パラメータ欄を隠して重ならないようにする */
body.partner-on #side { display: none !important; }
@keyframes loot-in { from { transform: translateY(8px) scale(0.96); opacity: 0; } }
.loot-head { width: 100%; display: flex; justify-content: space-between; align-items: center; min-height: 24px; }
.loot-head b { color: var(--gold); font-family: 'Orbitron', var(--font); font-size: calc(13px * var(--fs, 1)); letter-spacing: 0.08em; }
.loot-ic { width: 52px; height: 52px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #0008); }
.loot-name { font-size: calc(14px * var(--fs, 1)); font-weight: bold; text-align: center; }
.loot-name small { color: var(--gold); }
.loot-genre { font-size: calc(11px * var(--fs, 1)); color: var(--info); }
.loot-desc { margin: 2px 0 3px; font-size: calc(11px * var(--fs, 1)); line-height: 1.4; color: #cfd6ff; }
.loot-price { width: 100%; display: flex; justify-content: space-between; align-items: baseline; font-size: calc(11px * var(--fs, 1)); color: var(--muted); border-top: 1px dashed var(--line); padding-top: 4px; }
.loot-price b { color: var(--gold); font-size: calc(14px * var(--fs, 1)); white-space: nowrap; }
.loot-pager { display: flex; align-items: center; gap: 4px; font-size: calc(11px * var(--fs, 1)); color: var(--muted); }
.loot-pager button { font: inherit; font-size: calc(11px * var(--fs, 1)); width: 30px; height: 24px; border-radius: 99px; border: 1px solid var(--gold); background: #1a2350; color: var(--gold); cursor: pointer; }

/* 在庫・出品：売り先タブ＋商品ごとのスライダー＋即ボタン */
.mk-tabs { position: sticky; top: -12px; z-index: 2; display: flex; gap: 4px; align-items: stretch; flex-wrap: wrap; margin: -4px 0 8px; padding: 4px 0; background: var(--bg); }
.mk-tab { flex: 1 0 auto; display: flex; white-space: nowrap; flex-direction: column; align-items: center; font: inherit; font-size: calc(13px * var(--fs, 1)); padding: 8px 6px; border-radius: 8px; border: 2px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.mk-tab.on { border-color: var(--info); background: #16304a; color: #fff; }
.mk-tab.ban { opacity: 0.6; }
.mk-tab small { font-size: calc(10px * var(--fs, 1)); color: var(--bad); }
.mk-info-btn { flex: none; font: inherit; font-size: calc(11px * var(--fs, 1)); padding: 4px 8px; border-radius: 8px; border: 1px dashed var(--line); background: none; color: var(--muted); cursor: pointer; }
.mk-info-btn.on { color: var(--info); border-color: var(--info); }
.mk-info { background: #0e1a2e; border: 1px solid var(--info); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: calc(13px * var(--fs, 1)); }
.mk-info b { color: var(--info); }
.mk-info p { margin: 4px 0; color: #cfd6ff; }
.card.inv .nums { font-size: calc(13px * var(--fs, 1)); }
.inv-ctl { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.inv-line { display: grid; grid-template-columns: 3.6em 1fr 6.5em; align-items: center; gap: 6px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.inv-line b { color: var(--gold); text-align: right; font-size: calc(14px * var(--fs, 1)); white-space: nowrap; }
.inv-sub { display: flex; justify-content: space-between; gap: 8px; padding-left: 3.4em; font-size: calc(11px * var(--fs, 1)); }
.inv-sub .feel { color: var(--muted); }
.inv-range { width: 100%; accent-color: var(--gold); height: 28px; }
.card.inv .buy-row { margin-top: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.card.inv .buy-row .btn { min-width: 0; padding: 8px 2px; font-size: calc(12px * var(--fs, 1)); line-height: 1.25; overflow-wrap: anywhere; }
.card.inv .buy-row .btn.small { grid-column: 1 / -1; }
.card.inv .btn:disabled { opacity: 0.45; cursor: default; }

/* 確認ダイアログ */
.confirm-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: #000b; padding: 16px; }
.confirm { width: min(360px, 100%); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.confirm-title { color: var(--gold); font-size: calc(16px * var(--fs, 1)); margin-bottom: 6px; }
.confirm p { margin: 4px 0; font-size: calc(14px * var(--fs, 1)); }
.confirm-skip { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); cursor: pointer; }
.confirm-skip input, .inv-opt input { width: 18px; height: 18px; accent-color: var(--gold); }
.confirm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn.danger-fill { background: #b8323b; border-color: #e35a63; color: #fff; font-weight: bold; }

/* 一括操作（写真アプリの複数選択風） */
.inv-opts { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.inv-opt { display: flex; align-items: center; gap: 6px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); cursor: pointer; }
.inv-sel-btn { font: inherit; font-size: calc(12px * var(--fs, 1)); padding: 4px 12px; border-radius: 99px; border: 1px solid var(--info); background: none; color: var(--info); cursor: pointer; }
.inv-sel-btn.on { background: var(--info); color: #06243a; }
.inv-icon { position: relative; flex: none; }
.sel-dot { position: absolute; left: -6px; top: -6px; width: 24px; height: 24px; border-radius: 99px; border: 2px solid #fffc; background: #0008; color: transparent; font-size: calc(13px * var(--fs, 1)); line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.card.inv:not(.selecting) .sel-dot { opacity: 0.55; }
.sel-dot.on { background: #3b82f6; border-color: #fff; color: #fff; }
.card.inv { user-select: none; -webkit-user-select: none; transition: transform 0.12s, border-color 0.12s; }
.card.inv.selecting { cursor: pointer; }
.card.inv.selected { border-color: #3b82f6; background: #172a52; transform: scale(0.98); }
.bulk-bar { position: sticky; bottom: -10px; z-index: 3; margin: 8px -12px -10px; padding: 10px 12px 12px; background: #0b1224f5; border-top: 2px solid #3b82f6; }
.bulk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bulk-head b { flex: 1; }
.bulk-x { width: 30px; height: 30px; border-radius: 99px; border: none; background: #fff2; color: #fff; font-size: calc(18px * var(--fs, 1)); cursor: pointer; }
.bulk-all { font: inherit; font-size: calc(12px * var(--fs, 1)); background: none; border: 1px solid var(--line); color: var(--text); border-radius: 99px; padding: 4px 10px; cursor: pointer; }
.bulk-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bulk-btns .btn { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; font-size: calc(13px * var(--fs, 1)); white-space: nowrap; }
.bulk-btns .btn small { font-size: calc(12px * var(--fs, 1)); opacity: 0.9; }
.bulk-btns .btn:disabled { opacity: 0.45; }

/* ---- スキルツリー：見出しを1行に。経験点は右側に縦並び、ルートの数は細い帯に ---- */
.tree-head { grid-template-rows: auto; padding: 6px 12px; }
.tree-head .tree-back { grid-row: auto; width: 36px; height: 36px; }
.tree-routebar { display: flex; align-items: center; gap: 8px; padding: 4px 10px; }
.tree-routebar .route-goal { flex: none; font-size: calc(12px * var(--fs, 1)); white-space: nowrap; }
.tree-routebar .route-goal b { font-size: calc(13px * var(--fs, 1)); }
.tree-routebar .route-pips { flex: 1; margin-top: 0; gap: 3px; }
.tree-routebar .route-pip { height: 22px; flex-direction: row; gap: 3px; font-size: calc(10px * var(--fs, 1)); }
.tree-routebar .route-pip em { font-size: calc(9px * var(--fs, 1)); }
.tree-expside { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 3; min-width: 118px; display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; background: rgba(10, 12, 16, 0.86); border: 1px solid var(--t-line); border-radius: 10px; pointer-events: none; }
.tes-h { font-size: calc(10px * var(--fs, 1)); color: var(--t-ink3); letter-spacing: 0.1em; }
.tes-row { display: grid; grid-template-columns: 30px 1fr 34px; align-items: baseline; gap: 4px; font-size: calc(12px * var(--fs, 1)); }
.tes-row .pn { color: var(--c); }
.tes-row b { text-align: right; font-family: 'Orbitron', monospace; font-weight: 500; font-size: calc(12px * var(--fs, 1)); }
.tes-row i { font-style: normal; font-size: calc(11px * var(--fs, 1)); font-weight: bold; }
.tes-row.ok i { color: var(--t-ok); }
.tes-row.ng i, .tes-row.ng b { color: var(--t-ng); }
.x.info { --c: #7cc7ff; } .x.act { --c: #ff9f6b; } .x.tech { --c: #c9a6ff; } .x.social { --c: #6be58f; } .x.mind { --c: #ffe066; }

/* 取れる＝緑枠、条件はそろっているが経験点が足りない＝赤枠、その先＝灰色の？ */
.tnode.can .tnode-panel { border-color: var(--t-ok); box-shadow: 0 0 14px rgba(34, 197, 94, 0.45); }
.tnode.short .tnode-panel { border-color: var(--t-ng); box-shadow: 0 0 10px rgba(239, 68, 68, 0.35); }
.tnode.short .tnode-panel img { opacity: 0.75; }
.tnode.short .tnode-lv { border-color: var(--t-ng); color: var(--t-ng); }
.tnode.teaser .tnode-panel { border: 2px dashed #3D4656; background: #11151c; box-shadow: none; }
.tnode.teaser .tnode-q { color: #4B5563; font-size: calc(24px * var(--fs, 1)); font-weight: bold; }
.tnode.teaser .tnode-name { color: #4B5563; }
.tree-links .link.teaser { stroke-dasharray: 4 6; opacity: 0.5; }
.tnode.k-root.can .tnode-panel { border-color: var(--t-ok); box-shadow: 0 0 26px rgba(34, 197, 94, 0.6); animation: pulse 1.4s ease-in-out infinite; }
.tnode.k-root.locked .tnode-panel { border-style: solid; opacity: 0.8; }

/* 「押し入れの宝の山」を解放したとき、中心から枝が飛び出して広がる */
.tnode.burst { animation: burst-out 0.7s cubic-bezier(0.18, 1.3, 0.4, 1) both; }
@keyframes burst-out {
  from { opacity: 0; transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(0.2); }
  60% { opacity: 1; }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.tree-shock { position: absolute; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; border: 3px solid #F5C542; box-shadow: 0 0 24px #F5C542, inset 0 0 24px #F5C54288; pointer-events: none; animation: shock 1.4s ease-out both; }
@keyframes shock { from { transform: scale(0.4); opacity: 1; } to { transform: scale(9); opacity: 0; } }

/* スキルツリー：経験点の下に「トップに戻る」 */
.tes-back { pointer-events: auto; margin-top: 6px; font: inherit; font-size: calc(12px * var(--fs, 1)); font-weight: bold; padding: 8px 6px; border-radius: 8px; border: 1px solid #F5C542; background: linear-gradient(135deg, #3a2f10, #1B202A); color: #F5C542; cursor: pointer; }
.tes-back:hover { background: #3a2f10; }

/* 新しく増えた行動カード */
.cmd .new-tag { position: absolute; top: -8px; right: -4px; z-index: 1; font-family: 'Orbitron', var(--font); font-size: calc(10px * var(--fs, 1)); font-weight: 700; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 99px; background: linear-gradient(135deg, #ff4d6d, #ff8a3d); color: #fff; box-shadow: 0 0 10px #ff4d6d99; animation: new-pulse 1.2s ease-in-out infinite; }
@keyframes new-pulse { 50% { transform: scale(1.12); box-shadow: 0 0 16px #ff4d6dcc; } }

/* 解放済みのパネルは白枠（取れる＝緑、経験点不足＝赤と区別する） */
.tnode.owned .tnode-panel, .tnode.max .tnode-panel { border-color: #fff; border-width: 2px; box-shadow: 0 0 12px rgba(255, 255, 255, 0.35); }
.tnode.owned .tnode-lv, .tnode.max .tnode-lv { border-color: #fff; color: #fff; }
.tnode.k-root.owned .tnode-panel { border-color: #fff; }
/* 強化の途中（Lv1以上で上限未満）は、白枠のまま取れる／足りないを縁の色で示す */
.tnode.k-repeat.lvup .tnode-panel { border-color: #fff; }

/* 経営画面：昇格条件の進み具合 */
.stage-prog { margin-top: 6px; padding: 6px 8px; background: #0005; border-radius: 8px; }
.stage-prog small { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.stage-prog .bar { margin: 4px 0; }
.stage-prog .sp-row { display: flex; justify-content: space-between; gap: 8px; font-size: calc(13px * var(--fs, 1)); }

/* 会話ログ */
.side-btn.log { grid-column: auto; }
.side-btn.ab { color: #ffe9a8; border-color: #f5c54288; }
.log-tabs { position: sticky; top: -10px; z-index: 1; display: flex; gap: 6px; padding: 4px 0 8px; background: var(--bg); }
.log-tabs button { font: inherit; font-size: calc(12px * var(--fs, 1)); padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.log-tabs button.on { background: var(--info); border-color: var(--info); color: #06243a; }
.log-week { position: sticky; top: 26px; display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; padding: 3px 8px; font-size: calc(12px * var(--fs, 1)); color: var(--gold); background: #182040f2; border-radius: 6px; }
.log-auto { font-family: 'Orbitron', var(--font); font-size: calc(9px * var(--fs, 1)); padding: 1px 6px; border-radius: 4px; background: var(--info); color: #06243a; }
.log-row { display: flex; flex-direction: column; gap: 1px; padding: 4px 8px; font-size: calc(13px * var(--fs, 1)); border-left: 2px solid transparent; white-space: pre-wrap; }
.log-row b { font-size: calc(11px * var(--fs, 1)); color: var(--gold); font-weight: normal; }
.log-row.k-narr span { color: #cfd6ff; font-style: italic; }
.log-row.k-choice span { color: var(--info); }
.log-row.k-info { border-left-color: var(--info); background: #0003; }
.log-row.k-info.good { border-left-color: var(--good); }
.log-row.k-info.bad { border-left-color: var(--bad); }

/* HUD：ステージの目標（借金欄の位置） */
.goal { flex: 1 1 auto; min-width: 0; max-width: 230px; display: flex; flex-direction: column; gap: 2px; padding: 3px 8px; border: 1px solid #f5c54266; border-radius: 8px; background: #2a210855; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.goal-top small { font-size: calc(10px * var(--fs, 1)); color: var(--gold); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.goal-top b { flex: 0 0 auto; }
.goal-top b { font-size: calc(12px * var(--fs, 1)); white-space: nowrap; }
.goal-bar { height: 6px; background: #0007; border-radius: 99px; overflow: hidden; }
.goal-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f5a524, #ffe066); }
.goal-note { font-size: calc(10px * var(--fs, 1)); color: var(--muted); text-align: right; }
.goal.done { border-color: var(--good); }
.goal.done .goal-bar i { background: linear-gradient(90deg, #3fcf7a, #b7f05a); }
.goal.warn .goal-note { color: var(--bad); font-weight: bold; }
.cash-sub { display: flex; align-items: baseline; gap: 6px; margin-left: 26px; line-height: 1.2; white-space: nowrap; }
.debt-line { font-size: calc(11px * var(--fs, 1)); color: #ffc4c4; }
.debt-line b { font-size: calc(12px * var(--fs, 1)); }

/* 達成の帯 */
.celebrate { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, #f5c54233, transparent 60%); animation: cel-in 0.3s ease-out; }
.celebrate.out { animation: cel-out 0.3s ease-in forwards; }
.cel-band { width: 100%; padding: 18px 0; text-align: center; background: linear-gradient(90deg, transparent, #b8860bdd 15%, #f5c542f0 50%, #b8860bdd 85%, transparent); box-shadow: 0 0 40px #f5c542aa; transform: skewY(-4deg); }
.cel-band small { display: block; font-family: 'Orbitron', var(--font); font-size: calc(12px * var(--fs, 1)); letter-spacing: 0.4em; color: #3a2a00; }
.cel-band b { display: block; font-size: clamp(26px, 8vw, 44px); color: #fff; text-shadow: 0 3px 0 #7a5200, 0 0 18px #fff8; animation: cel-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes cel-in { from { opacity: 0; } }
@keyframes cel-out { to { opacity: 0; transform: scale(1.05); } }
@keyframes cel-pop { from { transform: scale(0.4); opacity: 0; } }

/* 新しい目標のポップアップ */
.goal-pop { position: fixed; inset: 0; z-index: 94; display: grid; place-items: center; padding: 16px; background: #000c; animation: cel-in 0.25s ease-out; }
.gp-card { width: min(380px, 100%); text-align: center; padding: 18px 16px 16px; border-radius: 16px; border: 2px solid var(--gold); background: radial-gradient(circle at 50% 0%, #3a2f10, var(--bg) 70%); box-shadow: 0 0 30px #f5c54255; animation: cel-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.gp-kicker { font-family: 'Orbitron', var(--font); font-size: calc(12px * var(--fs, 1)); letter-spacing: 0.3em; color: var(--gold); }
.gp-title { margin-top: 8px; font-size: calc(15px * var(--fs, 1)); color: var(--muted); }
.gp-amount { display: block; margin: 2px 0 6px; font-size: clamp(36px, 12vw, 54px); color: #ffe066; text-shadow: 0 0 20px #f5c54288; font-variant-numeric: tabular-nums; }
.gp-cond { margin: 0 0 10px; font-size: calc(14px * var(--fs, 1)); }
.gp-mine { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px; margin-bottom: 12px; background: #0006; border-radius: 10px; font-size: calc(13px * var(--fs, 1)); }
.gp-mine img { width: 44px; height: 44px; object-fit: cover; object-position: top; image-rendering: pixelated; }
.gp-go { width: 100%; }

/* 基礎能力：効果の予告とランクアップ */
.ab-fx { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; font-size: calc(11px * var(--fs, 1)); color: var(--t-ink2); }
.ab-fx b { color: var(--t-ink); font-weight: normal; }
.ab-fx em { font-style: normal; color: var(--t-ok); }
.rank-up { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(circle, #f5c54244, transparent 60%); animation: rank-in 1.5s ease-out forwards; }
.rank-up small { font-family: 'Orbitron', monospace; letter-spacing: 0.3em; color: #F5C542; font-size: calc(14px * var(--fs, 1)); }
.rank-up b { font-family: 'Orbitron', monospace; font-size: calc(120px * var(--fs, 1)); line-height: 1; color: #fff; text-shadow: 0 0 30px #F5C542, 0 0 60px #F5C54288; animation: cel-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes rank-in { 0% { opacity: 0; } 10%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ルーティン設定 */
.rt-seg { flex-wrap: wrap; margin: 4px 0 6px; }
.rt-l { display: block; color: var(--muted); font-size: calc(11px * var(--fs, 1)); margin-top: 4px; }
.rt-line { display: grid; grid-template-columns: 1fr 5em; align-items: center; gap: 8px; }
.rt-line input { width: 100%; accent-color: var(--gold); }
.rt-line b { text-align: right; color: var(--gold); }
.rt-btns { display: flex; justify-content: flex-end; margin-top: 14px; }

.sh-item.unknown .sh-img { background: repeating-linear-gradient(45deg, #e6e6ec 0 10px, #dcdce4 10px 20px); display: grid; place-items: center; }
.sh-q { font: 700 64px/1 'Orbitron', sans-serif; color: #b0b0bc; }

/* TOKU（徳） */
.chip.toku { font-family: 'Orbitron', var(--font); font-size: calc(10px * var(--fs, 1)); }
.chip.toku.high { background: #1f3a2a; color: #b7f5c9; }
.chip.toku.low { background: #3a1f24; color: #ffb3b3; }
.chip.toku.dark { background: #2a0a0a; color: #ff4d4d; border: 1px solid #b91c1c; }

.menu-main .shop-btn { grid-column: 1 / -1; border-color: var(--gold); }

/* 経験点の振り替え */
.convert { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; }
.convert .sub { font-weight: bold; color: var(--gold); }
.cv-seg { flex-wrap: wrap; gap: 4px; }
.cv-seg .btn { padding: 4px 6px; font-size: calc(11px * var(--fs, 1)); }
.cv-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* 仕入れ先と番付 */
.sat-row { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.sat-row.spot { padding-left: 12px; }
.sat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sat-top small { color: var(--muted); }
.sat-bar { height: 7px; background: #0007; border-radius: 99px; overflow: hidden; }
.sat-bar i { display: block; height: 100%; background: #3fcf7a; }
.sat-bar.mid i { background: #f5a524; }
.sat-bar.hi i { background: var(--bad); }
.sat-row .btn.small { align-self: flex-start; }
.rank-list { display: flex; flex-direction: column; gap: 4px; }
.rank-row { display: grid; grid-template-columns: 34px 40px 1fr auto; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; background: #ffffff08; }
.rank-row.me { background: #f5c54222; outline: 1px solid #f5c54266; }
.rank-row img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.rank-no { font-weight: bold; color: var(--gold); }
.rank-name { display: flex; flex-direction: column; min-width: 0; }
.rank-name small { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.rank-nw { white-space: nowrap; }

/* 業界の動き：規制 */
.reg-list { display: flex; flex-direction: column; gap: 6px; }
.reg-row { padding: 6px 8px; border-radius: 8px; background: #ff6b6b14; border-left: 3px solid var(--bad); display: flex; flex-direction: column; gap: 2px; }
.reg-row.good { background: #3fcf7a14; border-left-color: var(--good); }
.reg-row.over { opacity: 0.5; }
.reg-rule { color: var(--muted); }
.heat-list { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.heat-row { display: grid; grid-template-columns: 7em 1fr 2.5em; align-items: center; gap: 6px; font-size: calc(12px * var(--fs, 1)); }
.heat-row small { text-align: right; color: var(--muted); }

/* 百貨店の美術画廊・コレクション */
.pc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0; }
.pc-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: #ffffff08; color: inherit; text-align: center; }
.pc-card img { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; }
.pc-card small { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.pc-price { color: var(--gold); font-weight: bold; }
.pc-card.rE, .pc-slot.rE { border-color: #a855f7; }
.pc-card.rL, .pc-slot.rL { border-color: var(--gold); box-shadow: 0 0 8px #f5c54255; }
.pc-card.rR, .pc-slot.rR { border-color: #3b82f6; }
.pc-series { padding: 6px 0; border-bottom: 1px solid var(--line); }
.pc-series.complete .sat-top b { color: var(--gold); }
.pc-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 4px; }
.pc-slot { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: #ffffff0d; padding: 2px; display: grid; place-items: center; }
.pc-slot img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.pc-slot.empty img { filter: brightness(0) opacity(0.35); }

/* キャリア */
.aud-row { grid-template-columns: 6.5em 1fr 4.5em; }
.career-row { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); opacity: 0.6; }
.career-row.on { opacity: 1; }
.career-row img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.career-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.career-row.on b { color: var(--gold); }

/* 志 */
.vision-box { display: flex; flex-direction: column; gap: 6px; }
.ms-row { display: grid; grid-template-columns: 1.6em 1fr; gap: 6px; align-items: start; }
.ms-row > span { color: var(--muted); font-weight: bold; }
.ms-row.done > span, .ms-row.done b { color: var(--gold); }
.ms-row > div { display: flex; flex-direction: column; gap: 3px; }
.ms-row small { color: var(--muted); }
.vision-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; width: 100%; margin-bottom: 6px; }
.vision-pick small { color: var(--muted); }

/* 暮らし・出資 */
.life-row { grid-template-columns: 2em 1fr; }
.life-lv { font-weight: bold; color: var(--gold); text-align: center; }
.invest-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.invest-line small { color: var(--muted); }

/* 仮想通貨 */
.cr-row { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cr-mid { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; }
.cr-mid small { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.cr-spark { width: 90px; height: 26px; }
.cr-spark polyline { fill: none; stroke-width: 1.6; stroke: var(--good); }
.cr-spark.down polyline { stroke: var(--bad); }
.cr-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.cr-row .pos, .ledger-grid .pos { color: var(--good); }
.cr-row .neg, .ledger-grid .neg { color: var(--bad); }

/* 狭い画面：日付とやる気を1行に収める */
@media (max-width: 380px) {
  .date b { font-size: calc(15px * var(--fs, 1)); }
  .date small { font-size: calc(11px * var(--fs, 1)); }
  .date { gap: 4px; }
  .mood { font-size: calc(12px * var(--fs, 1)); padding: 1px 6px; }
  .goal-top small { font-size: calc(9px * var(--fs, 1)); }
  .goal-top b { font-size: calc(11px * var(--fs, 1)); }
  .cash { font-size: calc(18px * var(--fs, 1)); }
  .cash img { width: 20px; height: 20px; }
  .cash-sub { margin-left: 24px; gap: 4px; }
  .cash-d { font-size: calc(12px * var(--fs, 1)); }
}


/* ---------------- 店舗巡り（ui/storerun.js） ---------------- */
.shop.sr { background: #eef0f4; }
.sr-body { padding-bottom: 20px; }
.sr-bar { position: sticky; top: 0; z-index: 2; padding: 8px 12px 6px; background: #1d2238; color: #fff; }
.sr-clock { display: flex; align-items: baseline; gap: 4px; }
.sr-clock b { font: 700 22px/1 'Orbitron', sans-serif; letter-spacing: 0.03em; }
.sr-clock small { color: #aab; font-size: calc(12px * var(--fs, 1)); }
.sr-left { margin-left: auto; font-size: calc(12px * var(--fs, 1)); color: #9fe0b0; }
.sr-left.low { color: #ff9a9a; font-weight: 700; }
.sr-time { height: 5px; margin: 6px 0 6px; background: #ffffff22; border-radius: 99px; overflow: hidden; }
.sr-time i { display: block; height: 100%; background: linear-gradient(90deg, #ffd166, #ef476f); transition: width 0.5s; }
.sr-route { display: flex; align-items: center; gap: 4px; overflow-x: auto; font-size: calc(10px * var(--fs, 1)); }
.sr-route > span { flex: none; display: grid; place-items: center; min-width: 30px; height: 20px; padding: 0 4px; border-radius: 4px; background: #ffffff1a; }
.sr-dot { background: var(--c) !important; opacity: 0.8; box-shadow: inset 0 0 0 1px #fff5; }
.sr-dot.here { opacity: 1; outline: 2px solid #fff; }
.sr-dot.next { background: transparent !important; border: 1px dashed #fff8; }
.sr-say { display: flex; gap: 10px; align-items: center; margin: 10px 12px; padding: 8px 10px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px #0001; }
.sr-say img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; flex: none; }
.sr-say p { margin: 0; font-size: calc(13px * var(--fs, 1)); }
.sr-choices { display: grid; gap: 10px; padding: 0 12px; }
.sr-store-card { --c: #555; display: block; width: 100%; padding: 0; border: none; border-radius: 10px; overflow: hidden; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; box-shadow: 0 2px 4px #0002; }
.sr-store-card:disabled { opacity: 0.45; cursor: default; }
.sr-sign { display: flex; flex-direction: column; padding: 10px 14px; background: var(--c); color: #fff; border-bottom: 4px solid #0003; }
.sr-sign small { font-size: calc(11px * var(--fs, 1)); opacity: 0.85; }
.sr-sign b { font-size: calc(19px * var(--fs, 1)); letter-spacing: 0.05em; }
.sr-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 14px; font-size: calc(12px * var(--fs, 1)); color: #555; }
.sr-meta .bad { color: #d33; font-weight: 700; }
.sr-flyer { display: flex; align-items: center; gap: 6px; margin: 0 10px 10px; padding: 5px 8px; border-radius: 6px; background: #fff6d0; border: 1px dashed #d8b84a; font-size: calc(12px * var(--fs, 1)); font-weight: 700; color: #6a4a00; }
.sr-flyer small { padding: 0 5px; border-radius: 3px; background: #e8413c; color: #fff; font-size: calc(10px * var(--fs, 1)); }
.sr-habit { display: flex; align-items: center; gap: 6px; margin: 0 10px 10px; padding: 4px 8px; border-radius: 6px; background: #eef4ff; border: 1px solid #b9cdf0; font-size: calc(12px * var(--fs, 1)); color: #23406e; }
.sr-habit small { padding: 0 5px; border-radius: 3px; background: #3b6fd1; color: #fff; font-size: calc(10px * var(--fs, 1)); }
.sr-habit.unknown { background: #f3f3f3; border-color: #ddd; color: #888; }
.sr-habit.unknown small { background: #999; }
.sr-front { --c: #555; margin: 0 0 8px; background: #fff; }
.sr-front-sign { display: flex; flex-direction: column; align-items: center; padding: 14px 10px 10px; background: var(--c); color: #fff; border-bottom: 6px solid #0003; animation: sr-in 0.35s ease-out; }
.sr-front-sign small { font-size: calc(11px * var(--fs, 1)); opacity: 0.85; }
.sr-front-sign b { font-size: calc(22px * var(--fs, 1)); letter-spacing: 0.08em; }
.sr-front p { margin: 0; padding: 8px 14px 10px; font-size: calc(13px * var(--fs, 1)); color: #444; }
@keyframes sr-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.sr-sec { display: block; width: calc(100% - 20px); margin: 8px 10px; border-radius: 10px; background: #fff; text-align: left; font: inherit; color: inherit; box-shadow: 0 1px 2px #0001; }
.sr-sec.closed { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; border: 2px dashed #c9cdd8; cursor: pointer; background: #fafbfd; }
.sr-sec.closed small { flex: none; color: #2d4fa8; font-weight: 700; }
.sr-sec.closed:disabled { cursor: default; opacity: 0.55; }
.sr-sec.closed:disabled small { color: #888; }
.sr-sec.open { padding: 8px 0 4px; animation: sr-in 0.3s ease-out; }
.sr-sec-h { display: flex; justify-content: space-between; padding: 0 12px 6px; }
.sr-sec-h small { color: #0a8a3a; font-size: calc(12px * var(--fs, 1)); }
.sr-grid { padding: 0 6px; }
.sr-none { margin: 4px 12px 8px; font-size: calc(13px * var(--fs, 1)); color: #888; }
.sh-item.in-cart { outline: 3px solid #e8413c; outline-offset: -3px; }
.sh-item.in-cart .sh-img::after { content: 'カゴ'; position: absolute; right: 6px; top: 6px; padding: 1px 6px; font-size: calc(11px * var(--fs, 1)); color: #fff; background: #e8413c; border-radius: 3px; }
.sr-foot { display: flex; flex-direction: column; gap: 8px; }
.sr-cart { display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--fs, 1)); }
.sr-cart b { font-size: calc(16px * var(--fs, 1)); color: #d33; margin-right: auto; }
.sr-cart .btn { color: #333; background: #f0f0f0; border-color: #ccc; }
.sr-pay { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.sr-pay .btn { min-height: 46px; color: #222; background: #f0f0f0; border-color: #ccc; }
.sr-pay .btn.primary, .sr-pay .bb-cash { background: #e8413c; border-color: #e8413c; color: #fff; font-weight: 700; }
.sr-pay .btn:disabled { opacity: 0.45; }
.sr-pay .btn.primary:hover, .sr-pay .bb-cash:hover { background: #d23530; }
.shop.sr .shop-footer > .btn:not(.primary), .shop.phone .shop-footer > .btn:not(.primary) { color: #333; background: #f0f0f0; border-color: #ccc; }
.bb-note { font-size: calc(12px * var(--fs, 1)); color: #555; white-space: nowrap; }
.receipt { position: relative; margin: 8px auto; width: min(300px, calc(100% - 40px)); padding: 12px 14px 16px; background: #fffef8; color: #333; font: 12px/1.6 'Courier New', monospace; box-shadow: 0 2px 6px #0002; animation: rc-print 0.5s ease-out; transform-origin: top; }
.receipt::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: linear-gradient(135deg, #fffef8 50%, transparent 50%) 0 0 / 8px 6px, linear-gradient(225deg, #fffef8 50%, transparent 50%) 0 0 / 8px 6px; }
@keyframes rc-print { from { transform: scaleY(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
.rc-h { display: flex; justify-content: space-between; border-bottom: 1px dashed #aaa; margin-bottom: 4px; }
.rc-row, .rc-total { display: flex; justify-content: space-between; gap: 8px; }
.rc-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-total { border-top: 1px dashed #aaa; margin-top: 4px; padding-top: 2px; font-size: calc(14px * var(--fs, 1)); }
.rc-ng { color: #c22; }
.sr-done { margin: 12px; padding: 14px; background: #fff; border-radius: 10px; display: flex; flex-direction: column; gap: 6px; font-size: calc(13px * var(--fs, 1)); }
.sr-done b { font-size: calc(17px * var(--fs, 1)); }
.sr-done-sum { font-size: calc(16px * var(--fs, 1)); font-weight: 700; color: #d33; }
.sr-done small { color: #888; }
.sr-busy { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #1d2238e6; color: #fff; animation: sr-in 0.2s; }
.sr-busy small { color: #ccd; }
.sr-road { position: relative; width: 70%; height: 36px; border-bottom: 4px dashed #fff6; margin-bottom: 8px; }
.sr-car { position: absolute; bottom: 2px; left: 0; font-size: calc(28px * var(--fs, 1)); font-style: normal; animation: sr-drive 0.9s linear forwards; }
@keyframes sr-drive { to { left: calc(100% - 30px); } }
.sr-busy.search b { font-size: calc(22px * var(--fs, 1)); animation: sr-shake 0.2s infinite alternate; }
@keyframes sr-shake { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.sold-list { display: flex; flex-direction: column; gap: 4px; }
.sold-row { display: flex; align-items: center; gap: 10px; font-size: calc(13px * var(--fs, 1)); }
.sold-row b { margin-left: auto; }
.sold-sum { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding-top: 6px; border-top: 1px dashed #ccc; font-size: calc(13px * var(--fs, 1)); }
.sold-sum small { color: #777; font-size: calc(11px * var(--fs, 1)); }
.sold-tag { font: 700 10px/1 'Orbitron', sans-serif; color: #fff; background: #d33; padding: 3px 6px; border-radius: 3px; }

/* ---------------- 夜のスマホ（ui/phone.js） ---------------- */
.shop.phone { background: #fff; }
.ph-status { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 14px; background: #000; color: #fff; font-size: calc(12px * var(--fs, 1)); }
.ph-status b { font-family: 'Orbitron', sans-serif; font-size: calc(13px * var(--fs, 1)); }
.ph-bed { margin: 0 auto; color: #9fe0b0; }
.ph-bed.low { color: #ff8a8a; font-weight: 700; }
.ph-batt { color: #ccc; }
.ph-home { background: linear-gradient(180deg, #1b2440 0, #3b2f5c 260px, #f4f4f7 260px); }
.ph-lock { display: flex; flex-direction: column; align-items: center; padding: 22px 0 16px; color: #fff; }
.ph-lock b { font: 300 52px/1 'Orbitron', sans-serif; letter-spacing: 0.02em; }
.ph-lock small { margin-top: 6px; opacity: 0.8; }
.ph-lock.night { padding-bottom: 40px; }
.ph-home .shop-wallet { margin: 0 10px 8px; border-radius: 10px; background: #ffffffe8; border: none; }
.ph-notes { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 10px; }
.ph-note { --c: #555; display: block; width: 100%; padding: 8px 10px; border: none; border-radius: 12px; background: #ffffffee; text-align: left; font: inherit; font-size: calc(13px * var(--fs, 1)); color: #222; cursor: pointer; box-shadow: 0 2px 6px #0003; animation: ph-drop 0.4s ease-out backwards; }
.ph-note:nth-child(2) { animation-delay: 0.15s; }
.ph-note:nth-child(3) { animation-delay: 0.3s; }
.ph-note:nth-child(4) { animation-delay: 0.45s; }
@keyframes ph-drop { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.ph-note.gone { opacity: 0.55; }
.ph-notes.still .ph-note { animation: none; }
.ph-note-h { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; font-size: calc(11px * var(--fs, 1)); color: #666; }
.ph-note-h i, .ph-app i, .ph-tab i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--c); color: #fff; font-style: normal; font-weight: 700; font-size: calc(11px * var(--fs, 1)); }
.ph-note-h small { margin-left: auto; }
.ph-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px 10px; }
.ph-app { --c: #555; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border: none; background: none; font: inherit; color: #222; cursor: pointer; }
.ph-app i { width: 52px; height: 52px; border-radius: 14px; font-size: calc(24px * var(--fs, 1)); box-shadow: 0 2px 4px #0003; }
.ph-app b { font-size: calc(11px * var(--fs, 1)); white-space: nowrap; }
.ph-app small { font-size: calc(9px * var(--fs, 1)); color: #888; }
.ph-empty { margin: 10px 14px; font-size: calc(13px * var(--fs, 1)); color: #888; text-align: center; }
.ph-home .ph-empty { color: #ccd; }
.ph-ad { display: flex; align-items: center; gap: 8px; width: calc(100% - 20px); margin: 8px 10px; padding: 6px 8px; border: 1px solid #e0d7a8; border-radius: 8px; background: linear-gradient(90deg, #fff8d6, #fff); text-align: left; font: inherit; color: #333; cursor: pointer; grid-column: 1 / -1; }
.ph-ad img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; flex: none; }
.ph-ad div { display: flex; flex-direction: column; min-width: 0; }
.ph-ad small { font-size: calc(9px * var(--fs, 1)); color: #999; border: 1px solid #ccc; align-self: flex-start; padding: 0 3px; border-radius: 2px; }
.ph-ad b { font-size: calc(13px * var(--fs, 1)); }
.ph-ad span { font-size: calc(11px * var(--fs, 1)); color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-results { margin: 8px 10px; padding: 10px 12px; background: #fff; border-radius: 10px; font-size: calc(13px * var(--fs, 1)); display: flex; flex-direction: column; gap: 4px; }
.ph-results .pos { color: #0a8a3a; }
.ph-results .neg { color: #d33; }
.ph-foot { background: #f4f4f7; }
.ph-apphead { --c: #555; flex: none; padding: 8px 12px 6px; background: var(--c); color: #fff; }
.ph-apphead > b { font-size: calc(17px * var(--fs, 1)); letter-spacing: 0.04em; }
.ph-apphead.flea { background: #fff; color: #222; border-bottom: 1px solid #eee; }
.ph-apphead.flea > b { color: var(--c); }
.ph-apphead.shady > b { color: #ff0; text-shadow: 2px 2px 0 #c00; font-style: italic; }
.ph-search { display: flex; gap: 6px; align-items: center; margin: 6px 0; padding: 6px 10px; border-radius: 99px; background: #ffffff33; font-size: calc(12px * var(--fs, 1)); }
.ph-apphead.flea .ph-search { background: #f0f2f5; color: #666; }
.ph-sorts { display: flex; gap: 6px; overflow-x: auto; }
.ph-sorts button { flex: none; padding: 3px 10px; border-radius: 99px; border: 1px solid #ffffff88; background: transparent; color: inherit; font: inherit; font-size: calc(11px * var(--fs, 1)); cursor: pointer; }
.ph-sorts button.on { background: #fff; color: #222; }
.ph-apphead.flea .ph-sorts button { border-color: #ccc; }
.ph-apphead.flea .ph-sorts button.on { background: var(--c); color: #fff; border-color: var(--c); }
.ph-list { background: #fff; padding-bottom: 12px; }
.ph-list.shady { background: repeating-linear-gradient(45deg, #fff200 0 14px, #ffe000 14px 28px); }
.ph-promo { margin: 8px 10px; padding: 8px 12px; border-radius: 8px; background: linear-gradient(90deg, #bf2e2e, #e8613c); color: #fff; display: flex; flex-direction: column; }
.ph-promo span { font-size: calc(11px * var(--fs, 1)); opacity: 0.9; }
.ph-promo.shady { background: #e00; text-align: center; animation: soft-blink 0.8s steps(2) infinite; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }
.ph-tile { display: flex; flex-direction: column; padding: 0 0 6px; border: none; background: #fff; text-align: left; font: inherit; color: #222; cursor: pointer; min-width: 0; }
.ph-img { position: relative; aspect-ratio: 1; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff, #e8e8ee); }
.ph-img img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.ph-price { position: absolute; left: 0; bottom: 6px; padding: 2px 8px 2px 6px; border-radius: 0 99px 99px 0; background: #000a; color: #fff; font-weight: 700; font-size: calc(12px * var(--fs, 1)); }
.ph-badge { position: absolute; left: 4px; top: 4px; font-size: calc(10px * var(--fs, 1)); padding: 1px 5px; border-radius: 3px; background: #0a8a3a; color: #fff; }
.ph-tile.sold .ph-img img, .ph-row.sold img { opacity: 0.45; }
.ph-name { padding: 2px 6px 0; font-size: calc(12px * var(--fs, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-sub { padding: 0 6px; font-size: calc(10px * var(--fs, 1)); color: #888; }
.ph-sub em { font-style: normal; font-weight: 700; }
.ph-sub .pos, .ph-auc .pos { color: #0a8a3a; }
.ph-sub .neg { color: #d33; }
.ph-list.shady .ph-tile { border: 2px solid #e00; }
.ph-list.shady .ph-price { background: #e00; font-size: calc(13px * var(--fs, 1)); }
.ph-carousel { margin: 2px 0 8px; }
.ph-banners { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ph-banners::-webkit-scrollbar { display: none; }
.ph-slide { flex: 0 0 100%; box-sizing: border-box; padding: 0 10px; scroll-snap-align: start; }
.ph-banner { --c: #555; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 76px; padding: 10px 12px; border: none; border-radius: 12px; background: linear-gradient(120deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); color: #fff; text-align: left; font: inherit; cursor: pointer; box-shadow: 0 2px 6px #0004; }
.ph-banner-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ph-banner small { font-size: calc(10px * var(--fs, 1)); opacity: 0.85; letter-spacing: 0.04em; }
.ph-banner b { font-size: calc(16px * var(--fs, 1)); line-height: 1.25; }
.ph-banner span { font-size: calc(12px * var(--fs, 1)); opacity: 0.95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-banner img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; flex: none; filter: drop-shadow(0 2px 2px #0006); }
.ph-banner.ad { background: linear-gradient(120deg, #fff4c2, #ffdf7e); color: #3a2a00; }
.ph-banner.ad small { border: 1px solid #0003; padding: 0 4px; border-radius: 3px; align-self: flex-start; }
.ph-dots { display: flex; justify-content: center; gap: 5px; margin-top: 6px; }
.ph-dots i { width: 6px; height: 6px; border-radius: 50%; background: #ffffff55; }
.ph-dots i.on { background: #fff; }
.ph-section-title { margin: 8px 10px 6px; padding: 0; font-size: calc(11px * var(--fs, 1)); font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }
.ph-tile.auc .ph-img { background: linear-gradient(180deg, #f0e6ff, #e8d4ff); }
.ph-tile.auc .ph-price { background: #d33; font-size: calc(14px * var(--fs, 1)); }
.ph-tile.mall .ph-img { background: linear-gradient(180deg, #e6f7ff, #d4efff); }
.ph-tile.mall .ph-price { background: #0d7fb8; }
.ph-tile.mall .ph-pt { position: absolute; right: 4px; bottom: 6px; left: auto; background: #ff6b6b; }
.ph-promo.auction { background: linear-gradient(90deg, #c7a2e8, #e8a2c7); }
.ph-row { display: flex; gap: 10px; width: 100%; padding: 8px 10px; border: none; border-bottom: 1px solid #eee; background: #fff; text-align: left; font: inherit; color: #222; cursor: pointer; }
.ph-row img { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; background: #f2f2f6; border-radius: 6px; flex: none; }
.ph-row-b { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ph-row .ph-name, .ph-row .ph-sub { padding: 0; }
.ph-auc b { font-size: calc(16px * var(--fs, 1)); color: #d33; }
.ph-auc small { color: #888; }
.ph-pt { font-style: normal; font-size: calc(11px * var(--fs, 1)); font-weight: 700; color: #fff; background: #d33; padding: 1px 5px; border-radius: 3px; }
.ph-nav { flex: none; display: flex; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #ddd; }
.ph-tab { --c: #555; position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 56px; padding: 2px; border: none; background: none; font: inherit; color: #888; cursor: pointer; }
.ph-tab small { font-size: calc(9px * var(--fs, 1)); white-space: nowrap; }
.ph-tab.on { color: #222; font-weight: 700; }
.ph-tab:not(.on) i { opacity: 0.6; }
.ph-tab em { position: absolute; right: 6px; top: -2px; min-width: 16px; padding: 0 4px; border-radius: 99px; background: #e8413c; color: #fff; font-style: normal; font-size: calc(10px * var(--fs, 1)); }
.ph-late { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 20px; background: #000c; }
.ph-late-box { width: min(320px, 100%); padding: 18px; border-radius: 14px; background: #1b2440; color: #fff; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.ph-late-box b { font-size: calc(18px * var(--fs, 1)); }
.ph-late-box p { margin: 0; font-size: calc(13px * var(--fs, 1)); color: #ccd; }
.ph-late-box .btn { min-height: 44px; }
.nego-btns { display: flex; flex-direction: column; gap: 6px; }
.nego-note, .auc-tip { color: #888; font-size: calc(11px * var(--fs, 1)); }
.auc { display: flex; flex-direction: column; gap: 6px; font-size: calc(13px * var(--fs, 1)); }
.auc-now { display: flex; align-items: baseline; gap: 8px; }
.auc-now b { font-size: calc(22px * var(--fs, 1)); color: #d33; }
.auc-meta { display: flex; justify-content: space-between; }
.auc-meta .pos, .auc-me.pos { color: #0a8a3a; }
.auc-meta .neg, .auc-me.neg { color: #d33; }
.auc-me { font-weight: 700; }
.auc-bar { gap: 6px; }
.auc-input { width: 92px; min-width: 0; padding: 8px 6px; font: inherit; font-size: calc(14px * var(--fs, 1)); border: 1px solid #ccc; border-radius: 6px; }
.auc-bar .bb-card { padding: 8px 6px; font-size: calc(12px * var(--fs, 1)); white-space: nowrap; }
.auc-bar .bb-cash { padding: 10px 6px; }

/* ---------------- メールボックス（ui/mail.js） ---------------- */
.mailbox { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: #000a; animation: sr-in 0.2s; }
.mb-win { width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column; background: #f4f5f8; color: #222; border-radius: 16px 16px 0 0; overflow: hidden; animation: mb-up 0.35s ease-out; font-family: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', system-ui, sans-serif; }
@keyframes mb-up { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
.mb-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #2d4fa8; color: #fff; }
.mb-head b { font-size: calc(16px * var(--fs, 1)); }
.mb-count { margin-left: auto; font-size: calc(12px * var(--fs, 1)); padding: 1px 8px; border-radius: 99px; background: #fff3; }
.mb-new { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: #2d4fa8; }
.mb-env { font-style: normal; font-size: calc(22px * var(--fs, 1)); animation: mb-bounce 0.6s ease-out 2; }
@keyframes mb-bounce { 0%, 100% { transform: none; } 40% { transform: translateY(-8px) rotate(-8deg); } 70% { transform: translateY(0) rotate(4deg); } }
.mb-list { flex: 1; overflow-y: auto; padding: 0 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.mb-row { position: relative; display: block; width: 100%; padding: 8px 10px 8px 22px; border: none; border-radius: 10px; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; box-shadow: 0 1px 2px #0001; animation: ph-drop 0.35s ease-out backwards; }
.mb-row::before { content: ''; position: absolute; left: 8px; top: 14px; width: 8px; height: 8px; border-radius: 99px; background: #2d7cf6; }
.mb-row.read::before { display: none; }
.mb-row.read .mb-subj { font-weight: 400; color: #555; }
.mb-top { display: flex; gap: 6px; font-size: calc(11px * var(--fs, 1)); color: #777; }
.mb-top small { margin-left: auto; }
.mb-from { font-weight: 700; color: #333; }
.mb-subj { font-size: calc(13px * var(--fs, 1)); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-row.good .mb-subj { color: #0a7a33; }
.mb-row.spam .mb-from { color: #999; }
.mb-body { margin-top: 6px; padding-top: 6px; border-top: 1px solid #eee; font-size: calc(12px * var(--fs, 1)); color: #444; white-space: normal; }
.mb-foot { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #e3e3e8; }
.mb-foot .btn { width: 100%; min-height: 46px; font-size: calc(15px * var(--fs, 1)); }
.mailbox.quick .mb-row, .mailbox.quick .mb-win { animation: none; }

/* ---------------- 行列（ui/queue.js） ---------------- */
.qscene { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: #000b; animation: sr-in 0.2s; }
.qs-box { width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 0 16px; border-radius: 14px; overflow: hidden; background: #fff; color: #222; text-align: center; }
.qs-sky { position: relative; width: 100%; height: 130px; background: linear-gradient(180deg, #1b2440, #e89a6a); }
.qs-clock { position: absolute; left: 12px; top: 10px; font: 700 26px/1 'Orbitron', sans-serif; color: #fff; }
.qs-sky img { position: absolute; right: 14px; top: 12px; width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 4px #0006); }
.qs-line { position: absolute; left: 10px; right: 10px; bottom: 8px; display: flex; gap: 6px; }
.qs-line i { width: 14px; height: 30px; border-radius: 7px 7px 2px 2px; background: #1b2440; opacity: 0.8; }
.qs-target { font-size: calc(12px * var(--fs, 1)); color: #666; }
.qs-say { min-height: 2.6em; padding: 0 14px; font-size: calc(14px * var(--fs, 1)); }
.qs-ticket { display: flex; flex-direction: column; padding: 8px 18px; border: 2px dashed #c9a227; border-radius: 6px; background: #fff8dc; animation: rc-print 0.4s ease-out; }
.qs-ticket b { font: 700 28px/1.1 'Orbitron', sans-serif; color: #b45309; }
.qs-ticket span { font-size: calc(11px * var(--fs, 1)); color: #555; }
.qs-counter { display: flex; flex-direction: column; }
.qs-counter b { font: 700 34px/1 'Orbitron', sans-serif; }
.qs-left { font-size: calc(13px * var(--fs, 1)); color: #d33; font-weight: 700; }
.qscene .hidden { display: none; }
.qscene.win .qs-counter b { color: #0a8a3a; }
.qscene.lose .qs-counter b { color: #d33; }
.qs-ok { min-width: 60%; min-height: 44px; }

/* ---------------- 商品ページ：上に写真と値段、下はタブ（スクロールしなくても見られる） ---------------- */
.shop-body.item.tabbed { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.it-top { flex: none; display: grid; grid-template-columns: minmax(0, 44%) 1fr; gap: 10px; padding: 8px 10px; background: #fff; border-bottom: 1px solid #eee; }
.it-top .gallery { background: none; }
.it-top .gallery .ph.big { aspect-ratio: 1; max-height: 30vh; border-radius: 8px; }
.it-top .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 4px; padding: 4px 0 0; background: none; overflow: visible; }
.it-top .thumbs button { width: 100%; height: auto; aspect-ratio: 1; }
.it-head { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.it-head .it-title { font-size: calc(15px * var(--fs, 1)); margin: 0; display: flex; flex-direction: column; }
.it-head .it-title small { font-size: calc(11px * var(--fs, 1)); font-weight: 400; color: #888; }
.it-head .it-price { font-size: calc(22px * var(--fs, 1)); line-height: 1.2; }
.it-head .it-price small { display: block; margin: 0; font-size: calc(11px * var(--fs, 1)); }
.it-head .it-badges { gap: 6px; margin: 0; font-size: calc(12px * var(--fs, 1)); }
.it-tabs { flex: none; display: flex; background: #fff; border-bottom: 1px solid #e5e5e5; }
.it-tabs button { flex: 1; padding: 10px 2px; border: none; border-bottom: 3px solid transparent; background: none; font: inherit; font-size: calc(13px * var(--fs, 1)); color: #777; cursor: pointer; }
.it-tabs button.on { color: #222; font-weight: 700; border-bottom-color: #e8413c; }
.it-pane { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 84px; background: #fff; }
.it-pane .it-sec { border-bottom-width: 4px; }

/* ---------------- 店内の見取り図（ui/storerun.js） ---------------- */
.sr-floor { --c: #555; position: relative; height: min(48vh, 340px); margin: 0 0 6px; overflow: hidden;
  background: repeating-linear-gradient(0deg, #e9e4d8 0 22px, #e2dccd 22px 23px), #e9e4d8; border-bottom: 4px solid #cfc6b0; }
.sr-floor::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 22px, #0000000a 22px 23px); pointer-events: none; }
.sr-wall { position: absolute; left: 0; right: 0; top: 0; height: 12%; display: grid; place-items: center; background: var(--c); color: #fff; border-bottom: 4px solid #0003; }
.sr-wall b { font-size: calc(13px * var(--fs, 1)); letter-spacing: 0.1em; }
.sr-zone { position: absolute; display: flex; flex-direction: column; justify-content: flex-end; padding: 3px; border: 2px solid #8a7a58; border-radius: 6px; background: #c9a86a; cursor: pointer; font: inherit; color: #222; box-shadow: 0 3px 0 #0002; }
.sr-zone.front { background: #d8d8e0; border-color: #888; border-radius: 10px 10px 4px 4px; } /* ワゴン */
.sr-zone.mid { background: #cfe8f5aa; border-color: #7fb3cc; } /* ショーケース */
.sr-zone.backR { background: #e6c48a; }
.sr-zone.open { animation: sr-pulse 1.6s ease-in-out infinite; }
@keyframes sr-pulse { 0%, 100% { box-shadow: 0 3px 0 #0002, 0 0 0 0 #ffb40000; } 50% { box-shadow: 0 3px 0 #0002, 0 0 0 4px #ffb400aa; } }
.sr-zone.done { filter: saturate(0.6); }
.sr-zone.late { opacity: 0.5; }
.sr-zone:disabled { cursor: default; }
.sr-shelf { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 1px; overflow: hidden; }
.sr-shelf img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.sr-zone.done .sr-shelf img:not(.hit) { opacity: 0.35; }
.sr-shelf img.hit { width: 28px; height: 28px; background: radial-gradient(circle, #fff7b0 0 45%, transparent 70%); animation: sr-in 0.4s ease-out; }
.sr-zone-l { display: flex; justify-content: space-between; gap: 4px; padding: 1px 4px; border-radius: 4px; background: #fffffff0; font-size: calc(10px * var(--fs, 1)); font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.sr-zone-l em { font-style: normal; color: #2d4fa8; flex: none; }
.sr-zone.done .sr-zone-l em { color: #0a8a3a; }
.sr-door { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 26%; padding: 2px 0; background: #9fd3e8; border: 2px solid #6aa9c2; border-bottom: none; border-radius: 6px 6px 0 0; text-align: center; font-size: calc(10px * var(--fs, 1)); font-weight: 700; color: #234; }
.sr-me { position: absolute; width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; transform: translate(-50%, -50%); transition: left 0.6s ease, top 0.6s ease; z-index: 3; pointer-events: none; filter: drop-shadow(0 2px 2px #0006); }
.sr-npc { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; padding: 0; border: none; background: none; transform: translate(-50%, -50%); font: inherit; cursor: default; }
.sr-npc img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px #0005); }
.sr-npc small { font-size: calc(8px * var(--fs, 1)); padding: 0 4px; border-radius: 3px; background: #fffd; color: #555; }
.sr-npc.rival small { background: #5a1f28; color: #ffc0c0; }
.sr-npc.staff small { background: #1f8f5f; color: #fff; }
.sr-bubble { position: relative; margin-bottom: 3px; padding: 2px 6px; border-radius: 8px; background: #fff; color: #333; font-size: calc(9px * var(--fs, 1)); white-space: nowrap; box-shadow: 0 1px 2px #0003; animation: sr-float 3s ease-in-out infinite; }
.sr-bubble::after { content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); border: 4px solid transparent; border-top-color: #fff; border-bottom: 0; }
.sr-npc.rival .sr-bubble { background: #ffe9ec; }
@keyframes sr-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.sr-npc.bang { cursor: pointer; }
.sr-bang { display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 2px; border-radius: 99px; background: #ff8a00; color: #fff; font: 700 15px/1 'Orbitron', sans-serif; font-style: normal; box-shadow: 0 0 0 2px #fff, 0 2px 6px #0006; animation: sr-bob 0.9s ease-in-out infinite; }
@keyframes sr-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.sr-found-h { margin: 4px 12px 0; font-size: calc(12px * var(--fs, 1)); color: #555; }
.sr-hint { margin: 4px 14px; font-size: calc(13px * var(--fs, 1)); color: #555; }
.sr-busy.search { background: #1d223833; justify-content: flex-start; padding-top: 30vh; pointer-events: auto; }
.sr-busy.search b { padding: 4px 14px; border-radius: 99px; background: #1d2238dd; }
.sr-busy.search small { display: none; }
.sr-talk { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; padding: 16px; background: #000a; animation: sr-in 0.2s; }
.sr-talk-box { width: min(340px, 100%); display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: #fff; color: #222; }
.sr-talk-who { display: flex; align-items: center; gap: 8px; }
.sr-talk-who img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; background: #f0eee6; border-radius: 10px; }
.sr-talk-box p { margin: 0; font-size: calc(14px * var(--fs, 1)); }
.sr-talk-res { padding: 6px 10px; border-radius: 8px; background: #e9f7ee; color: #0a7a33; font-size: calc(13px * var(--fs, 1)); font-weight: 700; }
.sr-talk-box .btn { min-height: 42px; }
.sr-cart-list { display: flex; flex-direction: column; gap: 6px; max-height: 32vh; overflow-y: auto; }
.sr-cart-row { display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--fs, 1)); color: #222; }
.sr-cart-row img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; background: #f2f2f6; border-radius: 4px; flex: none; }
.sr-cart-n { flex: 1; min-width: 0; display: flex; flex-direction: column; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-cart-n small { color: #888; font-size: calc(11px * var(--fs, 1)); }
.sr-cart-row .stepper, .buy-bar .stepper { display: flex; align-items: center; gap: 6px; color: #222; }
.sr-cart-row .stepper .btn, .sr-cart .btn { color: #333; background: #f0f0f0; border-color: #ccc; }
.sr-cart-btn { font-weight: 700; }
.it-top .gallery { min-width: 0; display: flex; flex-direction: column; }
.it-top .gallery .ph.big { width: 100%; height: auto; }
.sr-cart .btn:hover, .sr-cart-row .stepper .btn:hover { background: #e4e4e4; color: #222; }

/* ---------------- ミッション（ui/quests.js） ---------------- */
.side-btn.quest { grid-column: 1 / -1; font-size: calc(13px * var(--fs, 1)); font-weight: bold; padding: 8px 4px; color: #002a24; border: 1px solid #fff6; background: linear-gradient(135deg, #7ff0d0, #22b8a0); box-shadow: 0 0 10px #22b8a066; }
.side-btn.quest:hover { background: linear-gradient(135deg, #9ff7de, #2ccbb2); }
.side-btn.quest .badge { background: #ff8a00; }
.side-btn.quest.locked, .side-btn.quest.locked:hover { background: #3a3a48; color: #aaa; box-shadow: none; border-color: var(--line); }

/* チュートリアル：次に押すボタンを指し示す */
.tut-point { position: relative; z-index: 2; border-color: var(--gold) !important; animation: tut-ring 1.2s ease-in-out infinite !important; }
.tut-point::after { content: '▼'; position: absolute; left: 50%; top: -20px; transform: translateX(-50%); color: var(--gold); font-size: calc(16px * var(--fs, 1)); line-height: 1; text-shadow: 0 0 6px #000, 0 0 2px #000; pointer-events: none; animation: tut-bob 0.8s ease-in-out infinite; }
.card.inv .buy-row .btn.tut-point { overflow: visible; }
@keyframes tut-ring { 0%, 100% { box-shadow: 0 0 0 0 #ffd54a00, 0 0 0 2px #ffd54aaa; } 50% { box-shadow: 0 0 0 6px #ffd54a33, 0 0 0 2px #ffd54a; } }
@keyframes tut-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 5px); } }
.quest-card { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.quest-top { display: flex; gap: 8px; align-items: center; }
.quest-top img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; background: #0006; border-radius: 8px; flex: none; }
.quest-top div { display: flex; flex-direction: column; }
.quest-top small { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.quest-top b { font-size: calc(15px * var(--fs, 1)); color: #8ff0d6; }
.quest-desc { margin: 0; font-size: calc(13px * var(--fs, 1)); }
.quest-prog { display: flex; align-items: center; gap: 8px; font-size: calc(12px * var(--fs, 1)); }
.quest-bar { flex: 1; height: 8px; background: #0006; border-radius: 99px; overflow: hidden; }
.quest-bar i { display: block; height: 100%; background: linear-gradient(90deg, #22b8a0, #7ff0d0); }
.quest-reward { display: flex; justify-content: space-between; font-size: calc(12px * var(--fs, 1)); color: var(--gold); }
.quest-reward small { color: var(--muted); }
.quest-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* 縦が短い画面：右のパラメータ欄とボタンを詰めて、ステージに収める */
@media (max-height: 800px) {
  #side { top: 30px; gap: 4px; }
  #params { gap: 1px; padding: 3px 6px; }
  #side-btns { grid-template-columns: 1fr 1fr; gap: 3px; }
  #side-btns .side-btn { padding: 5px 0; font-size: calc(10px * var(--fs, 1)); white-space: nowrap; letter-spacing: -0.02em; }
  #side-btns .side-btn.log { grid-column: auto; }
  #side-btns .side-btn.quest, #side-btns .side-btn.tree { grid-column: 1 / -1; padding: 5px 4px; font-size: calc(12px * var(--fs, 1)); }
  .pr-tabs button { font-size: calc(9px * var(--fs, 1)); padding: 0; }
}
/* さらに縦が短い画面（360×640 など）：パラメータ欄の行を詰める */
@media (max-height: 700px) {
  #side { top: 28px; gap: 3px; }
  #params { padding: 2px 5px; line-height: 1.25; }
  .pr, .pr.ab { font-size: calc(11px * var(--fs, 1)); }
  #side-btns .side-btn { padding: 4px 0; }
  #side-btns .side-btn.quest, #side-btns .side-btn.tree { padding: 4px; font-size: calc(11px * var(--fs, 1)); }
}

/* 難易度の選択 */
.diff-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin-bottom: 8px; padding: 10px 14px; text-align: left; }
.diff-btn b { font-size: calc(16px * var(--fs, 1)); }
.diff-btn small { font-size: calc(12px * var(--fs, 1)); opacity: 0.85; font-weight: normal; }

/* 在庫：ワンタップの一括操作 */
.inv-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.inv-quick .btn { flex: 1 1 auto; font-size: calc(12px * var(--fs, 1)); padding: 6px 8px; }

/* 経営画面のグラフ（ui/charts.js）。青＝黒字、赤＝赤字（暗い面で検証済みの組み合わせ） */
.ch { --gain: #3987e5; --loss: #e66767; margin: 6px 0 10px; padding: 10px 10px 8px; border-radius: 10px; background: #0d1224; border: 1px solid #ffffff14; }
.ch figcaption { font-size: calc(13px * var(--fs, 1)); font-weight: 700; margin-bottom: 8px; }
.ch figcaption small { font-weight: normal; color: var(--muted); font-size: calc(11px * var(--fs, 1)); margin-left: 4px; }
.ch-plot { display: flex; gap: 2px; height: 120px; }
.ch-col { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0; border: none; background: none; cursor: pointer; font: inherit; color: var(--muted); border-radius: 4px; }
.ch-col.on { background: #ffffff0d; }
.ch-up, .ch-down { display: flex; justify-content: center; min-height: 0; }
.ch-up { align-items: flex-end; border-bottom: 1px solid #ffffff40; }
.ch-down { align-items: flex-start; }
.ch-bar { display: block; width: 70%; max-width: 18px; min-height: 2px; }
.ch-bar.gain { background: var(--gain); border-radius: 4px 4px 0 0; }
.ch-bar.loss { background: var(--loss); border-radius: 0 0 4px 4px; }
.ch-col small { flex: none; font-size: calc(9px * var(--fs, 1)); line-height: 14px; text-align: center; }
.ch-cap { margin-top: 6px; font-size: calc(12px * var(--fs, 1)); color: var(--text); min-height: 1.4em; }
.ch-rows { display: flex; flex-direction: column; gap: 6px; }
.ch-row { display: grid; grid-template-columns: 7.8em 1fr 5.5em; align-items: center; gap: 8px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); white-space: nowrap; }
.ch-track { height: 12px; border-radius: 0 4px 4px 0; }
.ch-track i { display: block; height: 100%; min-width: 2px; background: var(--gain); border-radius: 0 4px 4px 0; }
.ch-row b { color: var(--text); text-align: right; font-size: calc(12px * var(--fs, 1)); display: flex; flex-direction: column; line-height: 1.2; }
.ch-row b small { color: var(--muted); font-weight: normal; font-size: calc(10px * var(--fs, 1)); }

/* キーボード操作：マウスのある画面では、行動カード・選択肢に数字キーを添える */
#commands, #choices { counter-reset: key; }
#commands .cmd, #choices button { counter-increment: key; }
@media (hover: hover) and (pointer: fine) {
  #commands .cmd::before, #choices button::before { content: counter(key); position: absolute; left: 5px; top: 3px; font-size: calc(10px * var(--fs, 1)); line-height: 1; color: var(--muted); pointer-events: none; }
  #choices button { position: relative; padding-left: 20px; }
}

/* ニュースのティッカーに流れるSNSの投稿と、タイムライン（engine/sns.js） */
#news-ticker { cursor: pointer; }
#news-ticker .tk-who { color: #8ec5ff; font-weight: 700; margin-right: 6px; }
#news-ticker .sns.angry { color: #ffb3b3; }
#news-ticker .sns.thanks { color: #b8f0c4; }
.sns-post { margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; background: #ffffff0d; border-left: 3px solid var(--line); }
.sns-post.angry { border-left-color: var(--bad); }
.sns-post.thanks { border-left-color: var(--good); }
.sns-post.trend { border-left-color: var(--info); }
.sns-post.rival { border-left-color: #a78bfa; }
.sns-h { display: flex; justify-content: space-between; font-size: calc(12px * var(--fs, 1)); }
.sns-h b { color: #8ec5ff; }
.sns-h small { color: var(--muted); }
.sns-post p { margin: 4px 0 0; font-size: calc(13px * var(--fs, 1)); line-height: 1.5; }

/* 取引メッセージ（メールの中のチャット） */
.mb-chat { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 8px; border-radius: 10px; background: #eef1f6; }
.mb-chat-h { font-size: calc(10px * var(--fs, 1)); color: #777; }
.mb-msg { align-self: flex-start; max-width: 85%; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: #fff; font-size: calc(12px * var(--fs, 1)); line-height: 1.45; color: #222; box-shadow: 0 1px 1px #0001; }
.mb-msg b { font-size: calc(10px * var(--fs, 1)); color: #2d4fa8; }
.mb-msg.me { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: #d8f3dc; }

/* 実績とエンディングの回収 */
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 10px; }
.ach { padding: 8px 10px; border-radius: 8px; background: #ffffff0a; border: 1px solid var(--line); color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.ach.row { margin-bottom: 6px; }
.ach b { font-size: calc(13px * var(--fs, 1)); }
.ach small { font-size: calc(11px * var(--fs, 1)); }
.ach.on { color: var(--text); border-color: var(--gold); background: #f5c54214; }
.ach.on b { color: var(--gold); }
.ach-date { color: var(--muted); }
.ach-new { margin: 10px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--gold); background: #f5c54214; display: flex; flex-direction: column; gap: 4px; font-size: calc(13px * var(--fs, 1)); }
.ach-new b { color: var(--gold); }
.map-h { margin: 12px 0 4px; font-size: calc(14px * var(--fs, 1)); color: var(--muted); }
.map-habit { margin-top: 4px; font-size: calc(13px * var(--fs, 1)); color: var(--info); }
.map-habit.unknown { color: var(--muted); }
.map-legend { margin-top: 12px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.map-legend summary { cursor: pointer; }
/* 部屋に積み上がる在庫：仕入れた品のアイコン（ui/stage.js setClutter）。ドット絵は等倍の64px */
/* z-index: 0 で重なりの層をつくり、品どうしの前後は層の中だけで決める（クリスや右側のボタンより必ず後ろ） */
#stage-boxes { position: absolute; inset: auto 0 0 0; height: 70%; pointer-events: none; z-index: 0; }
#stage-boxes .room-item { position: absolute; width: 64px; height: 64px; margin-left: -32px; image-rendering: pixelated; filter: brightness(0.85) drop-shadow(0 3px 0 #0006); animation: room-in 0.3s ease-out; }
#stage-boxes.over .room-item { filter: brightness(0.7) saturate(0.85) drop-shadow(0 3px 0 #0006); }
@keyframes room-in { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 発送の演出（ui/room.js） */
.ship { position: absolute; inset: 0; z-index: 6; cursor: pointer; }
.ship-sum { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; align-items: baseline; gap: 8px; padding: 4px 12px; border-radius: 99px; background: #000b; color: #fff; font-size: calc(13px * var(--fs, 1)); white-space: nowrap; }
.ship-sum small { color: #ffd76a; }
.ship-sum span { font: 700 15px/1 'Orbitron', sans-serif; color: #7dffa8; }
.ship-skip { position: absolute; right: 8px; bottom: 6px; font-size: calc(10px * var(--fs, 1)); color: #fffa; }
.ship-box { position: absolute; left: 50%; bottom: 10px; width: 132px; height: 78px; transform: translateX(-50%); background: linear-gradient(#c99a5c, #a8783f); border: 2px solid #6e4b22; border-radius: 3px; box-shadow: inset 0 14px 0 #5a3c18, 0 4px 0 #0005; }
.ship-box .flap { position: absolute; top: -2px; width: 50%; height: 30px; background: linear-gradient(#d8ad70, #b88a4f); border: 2px solid #6e4b22; transition: transform 0.18s ease-in; }
.ship-box .flap.l { left: -2px; transform-origin: 0 0; transform: rotate(-150deg); }
.ship-box .flap.r { right: -2px; transform-origin: 100% 0; transform: rotate(150deg); }
.ship-box.closed .flap { transform: rotateX(0deg); }
.ship-box.closed { box-shadow: 0 4px 0 #0005; }
.ship-box .tape { position: absolute; left: 50%; top: -3px; width: 0; height: 18px; transform: translateX(-50%); background: #e8d9a8e6; border-left: 1px dashed #b9a46a; border-right: 1px dashed #b9a46a; transition: width 0.22s ease-out; z-index: 1; }
.ship-box.taped .tape { width: 100%; height: 26px; }
.ship-stamp { position: absolute; left: 50%; top: 30px; white-space: nowrap; line-height: 1.2; transform: translateX(-50%) rotate(-12deg) scale(1.6); padding: 1px 8px; border: 3px solid #d33; border-radius: 6px; color: #d33; font-size: calc(18px * var(--fs, 1)); opacity: 0; transition: transform 0.15s, opacity 0.15s; }
.ship-box.sent .ship-stamp { opacity: 1; transform: translateX(-50%) rotate(-12deg) scale(1); }
.ship.lanes-3 .ship-box { width: 96px; height: 62px; }
.ship.lanes-3 .ship-box .flap { height: 22px; }
.ship.lanes-3 .ship-box .flap.l { transform: rotate(-125deg); }
.ship.lanes-3 .ship-box .flap.r { transform: rotate(125deg); }
.ship.lanes-3 .ship-box.closed .flap { transform: rotateX(0deg); }
.ship.lanes-3 .ship-stamp { top: 24px; font-size: calc(15px * var(--fs, 1)); }
.ship-fly { position: absolute; width: 64px; height: 64px; image-rendering: pixelated; z-index: 2; pointer-events: none; }
.ship-yen { position: absolute; z-index: 3; font: 700 15px/1 'Orbitron', sans-serif; color: #7dffa8; text-shadow: 0 2px 0 #000; white-space: nowrap; pointer-events: none; }
.ship-yen.neg { color: #ff8a8a; }
/* 撮影（ui/worklife.js） */
.pz-shot { position: relative; height: 170px; margin: 0 0 6px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; transition: background 0.2s, filter 0.2s; }
.pz-shot img { width: 120px; height: 120px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 6px 6px #0005); }
.pz-shadow { position: absolute; inset: 0; background: linear-gradient(120deg, transparent 40%, #0003 70%); }
.pz-count { position: absolute; right: 8px; bottom: 6px; padding: 1px 6px; border-radius: 10px; background: #0007; color: #fff; font-size: calc(11px * var(--fs, 1)); }
.pz-name { margin: 0 0 8px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.pz-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.pz-row b { width: 3em; font-size: calc(13px * var(--fs, 1)); }
.pz-score { display: flex; justify-content: space-between; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel); font-size: calc(14px * var(--fs, 1)); }
/* 業者オークションの競り・問屋の見積書（ui/pro.js） */
.seri { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; background: #1d1a14; border: 2px solid #5b4a2e; }
.seri.me { border-color: var(--good); }
.seri.rival { border-color: var(--bad); }
.seri.won { background: #13301f; }
.seri-img { width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; background: #f2ead8; border-radius: 8px; }
.seri-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.seri-info small { color: var(--muted); }
.seri-est { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.seri-price { font: 700 26px/1.2 'Orbitron', sans-serif; color: #ffd76a; }
.seri-count { letter-spacing: 4px; color: #ffd76a; }
.seri-who { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: calc(14px * var(--fs, 1)); }
.seri-who img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.quote { padding: 12px; border-radius: 6px; background: #fbfaf5; color: #222; font-size: calc(13px * var(--fs, 1)); box-shadow: 0 2px 6px #0006; }
.quote-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 2px solid #222; }
.quote-head b { font-size: calc(16px * var(--fs, 1)); letter-spacing: 0.3em; }
.quote-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dotted #aaa; }
.quote-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sh-size { font-size: calc(11px * var(--fs, 1)); color: #777; }
/* くじ引き（ui/kuji.js） */
.kuji-sheet { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 8px; background: #fff7e6; color: #3a2a10; }
.kuji-row { display: grid; grid-template-columns: 4.6em 36px 1fr auto; align-items: center; gap: 6px; font-size: calc(13px * var(--fs, 1)); }
.kuji-row.out { opacity: 0.4; text-decoration: line-through; }
.kuji-row img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.kuji-tier { color: #c0392b; }
.kuji-name small, .kuji-left small { display: block; font-size: calc(10px * var(--fs, 1)); color: #8a6d3b; }
.kuji-left { text-align: right; font-weight: 700; }
.kuji-result { margin-top: 10px; }
.kuji-balls { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kuji-ball { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: calc(12px * var(--fs, 1)); font-weight: 700; background: #888; color: #fff; }
.kuji-ball.tA { background: #e0a100; box-shadow: 0 0 8px #ffd54a; }
.kuji-ball.tB { background: #c0392b; }
.kuji-ball.tC { background: #8e44ad; }
.kuji-ball.tD { background: #2980b9; }
.kuji-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.inv-claim { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0; font-size: calc(12px * var(--fs, 1)); color: var(--warn, #f0b35a); }
.inv-claim small { display: block; font-size: calc(10px * var(--fs, 1)); color: var(--muted); }
/* 仲間（ui/companions.js） */
.comp-face { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; background: #0003; border-radius: 8px; }
.comp.unmet .comp-face { filter: brightness(0) opacity(0.5); }
.comp-dots { display: flex; gap: 4px; margin: 4px 0; }
.comp-dots i { width: 10px; height: 10px; border-radius: 50%; background: #fff2; }
.comp-dots i.on { background: #ffd76a; }
.comp-reward { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.comp-reward.got { color: #ffd76a; }
/* 交渉バトル（ui/battle.js）。カットインはマイクリのパッシブスキル演出（Style/Cutins/passive_skill_cutin.css）に倣う */
.bt { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
/* クリス（72×140）は縮めず、等倍のまま胸から上を切り出す */
.bt-fx { position: absolute; right: 8%; bottom: 18%; width: 100px; height: 100px; background: url('../assets/effects/hit.webp') 0 0 no-repeat; transform: scale(1.6); image-rendering: pixelated; }
.bt-hud { position: absolute; left: 8px; right: 8px; top: 30px; display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 10px; background: #000b; color: #fff; font-size: calc(12px * var(--fs, 1)); animation: bt-in 0.2s ease-out; }
.bt-names { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bt-names > b { font: 700 14px/1 'Orbitron', sans-serif; color: #ffd76a; }
.bt-me { color: #8fd3ff; }
.bt-foe { min-width: 0; color: #ffb3b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 交渉成功率の円ゲージ。25/50/75% を境に 赤→オレンジ→黄→緑 */
.bt { --rate: #ff5b5b; }
.bt[data-tier="o"] { --rate: #ff9f40; }
.bt[data-tier="y"] { --rate: #ffd23f; }
.bt[data-tier="g"] { --rate: #3ddc84; }
.bt-rate { flex: none; display: flex; align-items: center; gap: 6px; }
.bt-rate > div { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.bt-rate small { font-size: calc(9px * var(--fs, 1)); color: #fffa; }
.bt-pct { min-width: 3.2em; font: 700 calc(20px * var(--fs, 1))/1 'Orbitron', sans-serif; color: var(--rate); text-shadow: 0 0 8px color-mix(in srgb, var(--rate) 50%, transparent); }
.bt-ring { width: 40px; height: 40px; }
.bt-ring-bg { fill: none; stroke: #ffffff22; stroke-width: 4; }
.bt-ring-fill { fill: none; stroke: var(--rate); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--rate)); }
.bt.fixed .bt-ring { animation: bt-ring-pop 0.35s ease-out; }
.bt.off .bt-rate { opacity: 0.35; }
@keyframes bt-ring-pop { 50% { transform: scale(1.18); } }
.choice small.choice-rate { font-weight: bold; }
.choice-rate.t-r { color: #ff7b7b; } .choice-rate.t-o { color: #ffaf5f; } .choice-rate.t-y { color: #ffd23f; } .choice-rate.t-g { color: #3ddc84; }
@keyframes bt-in { from { opacity: 0; transform: translateY(-6px); } }
/* スキル名：クリスの頭上に出す */
.bt-skill { position: absolute; left: 30%; top: 70px; z-index: 5; display: flex; flex-direction: column; align-items: center; max-width: 60%; padding: 3px 10px 4px; border: 1px solid #8fd3ff; border-radius: 8px; background: #0b1d33e6; color: #fff; transform: translateX(-50%); white-space: nowrap; pointer-events: none; animation: bt-skill-in 0.18s ease-out; }
.bt-skill::after { content: ''; position: absolute; left: 50%; bottom: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #8fd3ff; transform: translateX(-50%); }
.bt-skill small { font-size: calc(9px * var(--fs, 1)); color: #8fd3ff; letter-spacing: 0.1em; }
.bt-skill b { font-size: calc(14px * var(--fs, 1)); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@keyframes bt-skill-in { from { opacity: 0; transform: translate(-50%, 6px); } }
/* 交渉の結果：上のバーに小さく */
.bt-res { flex: none; padding: 1px 8px; border-radius: 99px; font-style: normal; font-weight: 700; font-size: calc(11px * var(--fs, 1)); animation: bt-in 0.2s ease-out; }
.bt-res.win { background: #ffd76a; color: #2a1d00; }
.bt-res.lose { background: #4a5163; color: #d6dbe6; }
/* セリフの色分け（ui/markup.js）。色だけに頼らないよう、金額は太字・用語は下線もつける */
.hl-money { color: #ffd76a; font-weight: 700; }
.hl-game { color: #7fd8ff; }
.hl-term { color: #9dffb0; text-decoration: underline dotted #9dffb088; text-underline-offset: 3px; }
.log-gloss { margin: 2px 0 0 1em; padding: 3px 8px; border-left: 3px solid #9dffb0; background: #9dffb012; color: #c6f3cf; font-size: calc(12px * var(--fs, 1)); line-height: 1.5; }
.log-gloss b { margin-right: 6px; color: #9dffb0; }

/* 仕入れ後の「すぐ出品する？」 */
.listnow-lead { margin: 0 0 8px; }
.listnow-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.listnow-rows li { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; background: #ffffff0d; border-radius: 6px; }
.listnow-rows small { color: #9ab; }
.listnow-rows b { color: #ffd76a; }
.listnow-note { margin: 8px 0 0; font-size: calc(12px * var(--fs, 1)); color: #9ab; }
.modal-footer .btn.swap:not(.primary) { color: #ffd2a6; border-color: #ffb36b88; }
.modal-footer:has(.btn.swap) .btn { flex: 1 1 40%; } /* 4つのときは2つずつ2段 */
.listnow-swap { margin-top: 10px; padding: 8px; border: 1px dashed #ffb36b66; border-radius: 6px; background: #ffb36b0d; }
.listnow-swap p { margin: 0 0 6px; font-size: calc(12px * var(--fs, 1)); color: #ffd2a6; }
.listnow-swap ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.listnow-swap li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: baseline; font-size: calc(12px * var(--fs, 1)); color: #c9d2de; }
.listnow-swap li small { color: #9ab; }

/* キーボードで操作したときに、どこにいるかが見えるように */
:focus-visible { outline: 2px solid #ffd76a; outline-offset: 2px; }

/* オンラインランキング（週替わりチャレンジ） */
.online-box { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff08; text-align: left; }
.online-form { display: flex; gap: 8px; margin: 8px 0; }
.online-name { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0b1020; color: var(--text); font: inherit; font-size: calc(15px * var(--fs, 1)); }
.online-out .good { color: #9dffb0; }
.online-out .bad { color: #ff9a9a; }
.online-me { color: #ffd76a; }
.btn .btn-sub { display: block; font-size: calc(11px * var(--fs, 1)); opacity: 0.8; margin-top: 2px; }

/* 期間限定フェア（現実の季節） */
.live-banner { margin: 6px auto 0; max-width: 340px; padding: 6px 10px; border-radius: 8px; border: 1px dashed #ffffff44; color: #cfd6ff; text-align: center; }
.live-banner.on { border: 1px solid #ffd76a; background: #ffd76a1a; color: #ffd76a; }
.live-banner b { display: block; }
.live-banner small { display: block; font-size: calc(11px * var(--fs, 1)); opacity: 0.9; }

/* 見出しの右上の小さな「戻る」（選ぶ画面で、下の大きなボタンを押しまちがえないように） */
.modal-title.has-back { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-back { flex: none; font: inherit; font-size: calc(12px * var(--fs, 1)); padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #1a2350e6; color: var(--text); cursor: pointer; }
.modal-back::before { content: '◀ '; font-size: 0.8em; opacity: 0.8; }
.modal:has(.modal-back) .modal-body { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

/* 難易度：縦長のカードを横に並べる */
.diff-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.diff-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 230px; padding: 22px 6px 12px; font: inherit; color: var(--text); text-align: center; border-radius: 12px; border: 2px solid var(--line); background: linear-gradient(#26305e, #1a2246); cursor: pointer; }
.diff-card b { font-size: calc(18px * var(--fs, 1)); }
.diff-card dl { margin: 0; display: grid; gap: 2px; width: 100%; }
.diff-card dt { font-size: calc(10px * var(--fs, 1)); color: var(--muted); }
.diff-card dd { margin: 0 0 4px; font-size: calc(14px * var(--fs, 1)); font-weight: 700; color: #ffd76a; }
.diff-card small { margin-top: auto; font-size: calc(11px * var(--fs, 1)); line-height: 1.4; opacity: 0.85; }
.diff-card.easy { border-color: #4fbf8a; }
.diff-card.normal { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px #f5c54255; }
.diff-card.hard { border-color: #d9605a; }
.diff-card:active { transform: scale(0.98); }
.diff-rec { position: absolute; top: -1px; left: 50%; transform: translate(-50%, -50%); padding: 2px 8px; border-radius: 99px; background: var(--gold); color: #1b1300; font-style: normal; font-size: calc(10px * var(--fs, 1)); font-weight: 700; white-space: nowrap; }

/* 基礎能力の画面（全画面。ui/abilities.js） */
.ab-screen { z-index: 61; }
.ab-head { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 10px; background: rgba(10, 12, 16, 0.92); border-bottom: 1px solid var(--t-line); }
.ab-title { display: flex; align-items: center; gap: 10px; }
.ab-title .tree-title { flex: 1; }
.ab-cv-toggle { flex: none; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--t-strong); background: var(--t-raised); color: var(--t-ink); font: inherit; font-size: calc(12px * var(--fs, 1)); cursor: pointer; }
.ab-cv-toggle.on { border-color: var(--t-gold); color: var(--t-gold); }
.ab-exp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ab-exp span { display: flex; flex-direction: column; align-items: center; padding: 3px 2px; border-radius: 8px; background: var(--t-surface); border: 1px solid var(--t-line); line-height: 1.15; }
.ab-exp i { font-style: normal; font-size: calc(11px * var(--fs, 1)); color: var(--c); }
.ab-exp b { font-family: 'Orbitron', monospace; font-size: calc(13px * var(--fs, 1)); }
.ab-convert { margin-top: 0; padding: 8px; border: 1px dashed var(--t-strong); border-radius: 10px; }
.ab-body { flex: 1; overflow-y: auto; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.ab-lead { margin: 0; font-size: calc(12px * var(--fs, 1)); color: var(--t-ink2); line-height: 1.5; }
.ab-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: rgba(20, 24, 31, 0.9); border: 1px solid var(--t-line); }
.ab-card.can { border-color: #F5C54288; }
.ab-card-top { display: flex; align-items: center; gap: 10px; }
.ab-card .ab-main b { font-size: calc(16px * var(--fs, 1)); }
.ab-lv { margin-left: 8px; font-family: 'Orbitron', monospace; color: var(--t-gold); }
.ab-card .ab-main b small { color: var(--t-ink3); font-weight: normal; }
.ab-card .ab-fx { margin: 0; }
.ab-raise { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ab-raise .cost-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ab-raise .cost-row small { color: var(--t-ink3); font-size: calc(11px * var(--fs, 1)); }
.ab-raise .ab-btns { max-width: none; flex-wrap: nowrap; }
.ab-raise .tree-btn.mini { min-width: 56px; min-height: 36px; }
.ab-max { margin: 0; color: var(--t-ok); font-size: calc(12px * var(--fs, 1)); }
@media (min-width: 720px) {
  .ab-body { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
  .ab-lead { grid-column: 1 / -1; }
}

/* 商品ページの判断の帯（見立て・値段の割合・見込み利益） */
.it-judge { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 4px 0 2px; padding: 4px 8px; border-radius: 8px; background: #0000000d; border: 1px solid #0000001a; }
.it-judge span { display: flex; flex-direction: column; line-height: 1.15; }
.it-judge small { font-size: calc(10px * var(--fs, 1)); color: #777; }
.it-judge b { font-size: calc(13px * var(--fs, 1)); white-space: nowrap; }
.it-judge b.pos { color: #16a34a; }
.it-judge b.neg { color: #dc2626; }
.it-judge b.unk { color: #999; }
.it-judge.cheap { border-color: #16a34a66; background: #16a34a10; }
.it-judge.dear { border-color: #dc262655; }

/* 所持金の増減（ui/hud.js） */
.money-float { position: fixed; z-index: 90; pointer-events: none; font: 700 calc(14px * var(--fs, 1)) / 1 'Orbitron', sans-serif; text-shadow: 0 2px 0 #000; white-space: nowrap; animation: money-up 1s ease-out forwards; }
.money-float.gain { color: #7dffa8; }
.money-float.lose { color: #ff8a8a; }
@keyframes money-up { from { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-18px); } }
.debt-line.down b { color: #7dffa8; animation: debt-glow 1.2s ease-out; }
@keyframes debt-glow { 0%, 60% { text-shadow: 0 0 8px #7dffa8; } 100% { text-shadow: none; } }

/* HUD の説明の吹き出し */
#hud [data-tip] { cursor: help; }
.hud-tip { position: fixed; z-index: 95; width: 260px; max-width: calc(100vw - 16px); padding: 8px 10px; border: 1px solid var(--gold); border-radius: 8px; background: #0b1020f2; color: var(--text); font-size: calc(12px * var(--fs, 1)); line-height: 1.5; box-shadow: 0 4px 12px #0008; animation: bt-in 0.15s ease-out; }

/* 週末レポート（受信トレイのいちばん上。ui/trade.js salesSummary） */
.wk-sum { margin: 2px 0 8px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 2px solid #f5c542; box-shadow: 0 2px 6px #0001; color: #222; }
.wk-head { display: flex; justify-content: space-between; align-items: baseline; }
.wk-head small { color: #8a6d00; font-weight: 700; }
.wk-head span { font-weight: 700; }
.wk-main { display: flex; gap: 18px; margin: 4px 0; }
.wk-main div { display: flex; flex-direction: column; }
.wk-main small { color: #777; font-size: calc(11px * var(--fs, 1)); }
.wk-main b { font: 700 calc(20px * var(--fs, 1)) / 1.1 'Orbitron', sans-serif; }
.wk-main b.pos, .wk-best em.pos { color: #16a34a; }
.wk-main b.neg { color: #dc2626; }
.wk-best { display: flex; align-items: center; gap: 6px; font-size: calc(12px * var(--fs, 1)); }
.wk-best .item-icon { width: 28px; height: 28px; }
.wk-best span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-best em { font-style: normal; font-weight: 700; color: #16a34a; }
.wk-notes { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; font-size: calc(11px * var(--fs, 1)); color: #666; }
.wk-notes .neg, .wk-best em.neg { color: #dc2626; }

/* お知らせのまとめ（ui/stage.js showInfos） */
.dg-item { padding: 1px 0 1px 8px; border-left: 3px solid var(--info); margin-bottom: 3px; }
#message.digest #text { font-size: 0.92em; line-height: 1.35; }
.dg-item b { display: block; font-size: calc(12px * var(--fs, 1)); color: var(--info); }
.dg-item.good { border-color: var(--good); }
.dg-item.good b { color: var(--good); }
.dg-item.bad { border-color: var(--bad); }
.dg-item.bad b { color: var(--bad); }

/* 月末の決算カード（ui/monthcard.js） */
.mc-card .mc-label { display: block; margin-top: 6px; color: var(--muted); font-size: calc(12px * var(--fs, 1)); }
.mc-net { display: block; font: 700 calc(36px * var(--fs, 1)) / 1.15 'Orbitron', sans-serif; }
.mc-net.pos { color: #7dffa8; text-shadow: 0 0 14px #6be58f66; }
.mc-net.neg { color: #ff8a8a; }
.mc-card.red { border-color: var(--bad); box-shadow: 0 0 24px #ff6b6b33; }
.mc-sub { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 10px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.mc-sub .pos { color: var(--good); }
.mc-sub .neg { color: var(--bad); }
.mc-goal { text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #0005; }
.mc-goal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: calc(12px * var(--fs, 1)); }
.mc-goal .goal-bar { margin: 4px 0; }
.mc-goal .goal-bar i { transition: width 0.8s cubic-bezier(0.2, 0.8, 0.3, 1) 0.2s; }
.mc-note { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.mc-lines { margin-top: 8px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }

/* つづきからの「前回まで」カード（ui/resume.js） */
.mc-goal .goal-bar.done i { background: linear-gradient(90deg, #3fcf7a, #b7f05a); }
.rs-date { margin: 6px 0 8px; }
.rs-date b { font-size: calc(18px * var(--fs, 1)); color: var(--gold); }
.rs-date small { color: var(--muted); }
.rs-money { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; }
.rs-money div { display: flex; flex-direction: column; }
.rs-money small { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.rs-money b { font: 700 calc(18px * var(--fs, 1)) / 1.2 'Orbitron', sans-serif; }
.rs-money .neg { color: #ffc4c4; }
.rs-money .pos { color: var(--good); }
.rs-list { list-style: none; margin: 10px 0 0; padding: 0; text-align: left; font-size: calc(13px * var(--fs, 1)); }
.rs-list li { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dotted #ffffff1a; }
.rs-list small { flex: none; width: 5.5em; color: var(--muted); }

/* 文字送りの AUTO（メッセージ欄の右上） */
.auto-read { position: absolute; top: 4px; right: 6px; z-index: 1; padding: 1px 7px; border: 1px solid #c8cff566; border-radius: 99px; background: transparent; color: #c8cff599; font: 700 10px/1.4 'Orbitron', sans-serif; letter-spacing: 0.05em; cursor: pointer; }
.auto-read.on { border-color: var(--gold); color: var(--gold); background: #f5c54222; }
.install-btn { display: block; margin: 0 auto 10px; padding: 5px 14px; border-radius: 99px; border-color: var(--gold); color: var(--gold); font-size: calc(13px * var(--fs, 1)); background: #0b1020cc; }

/* 時間の流れ（ui/calendar.js）：季節の粒・夜の色味・日めくり */
#stage-fx { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#stage-fx::before, #stage-fx::after { content: ''; position: absolute; inset: -40px 0 0 0; background-repeat: repeat; opacity: 0.75; }
#stage[data-season="spring"] #stage-fx::before { background-image: radial-gradient(4px 3px at 20% 10%, #ffc3dc 60%, transparent 62%), radial-gradient(3px 4px at 70% 40%, #ffd6e7 60%, transparent 62%), radial-gradient(4px 3px at 45% 75%, #ffb3d1 60%, transparent 62%); background-size: 180px 180px; animation: fx-fall 14s linear infinite; }
#stage[data-season="spring"] #stage-fx::after { background-image: radial-gradient(3px 3px at 35% 30%, #ffe0ee 60%, transparent 62%), radial-gradient(4px 3px at 85% 85%, #ffc3dc 60%, transparent 62%); background-size: 240px 240px; animation: fx-fall 20s linear infinite; }
#stage[data-season="summer"] #stage-fx::before { inset: 0; background: linear-gradient(170deg, #ffe08a30, transparent 55%); opacity: 1; }
#stage[data-season="autumn"] #stage-fx::before { background-image: radial-gradient(5px 3px at 25% 15%, #e8823a 60%, transparent 62%), radial-gradient(4px 4px at 75% 55%, #c9692c 60%, transparent 62%), radial-gradient(5px 3px at 50% 85%, #f0a04b 60%, transparent 62%); background-size: 220px 220px; animation: fx-fall 16s linear infinite; opacity: 0.6; }
#stage[data-season="winter"] #stage-fx::before { background-image: radial-gradient(3px 3px at 15% 20%, #fff 60%, transparent 62%), radial-gradient(4px 4px at 60% 50%, #fff 60%, transparent 62%), radial-gradient(3px 3px at 85% 80%, #fff 60%, transparent 62%), radial-gradient(3px 3px at 40% 90%, #fff 60%, transparent 62%); background-size: 150px 150px; animation: fx-fall 18s linear infinite; opacity: 0.85; }
#stage[data-season="winter"] #stage-fx::after { background-image: radial-gradient(3px 3px at 30% 40%, #ffffffcc 60%, transparent 62%), radial-gradient(2px 2px at 75% 15%, #ffffffcc 60%, transparent 62%); background-size: 220px 220px; animation: fx-fall 26s linear infinite; opacity: 0.6; }
@keyframes fx-fall { from { background-position: 0 0; } to { background-position: 60px 360px; } }
body.night-time #stage-bg { filter: brightness(0.4) saturate(0.75); }
body.night-time #stage-fx { background: linear-gradient(#0a1440aa, #0a144055 70%, transparent); }
@media (prefers-reduced-motion: reduce) { #stage-fx::before, #stage-fx::after { animation: none; } }

.wk-flip { position: absolute; left: 50%; top: 22%; z-index: 6; display: flex; flex-direction: column; align-items: center; min-width: 120px; padding: 10px 18px 12px; border-radius: 10px; background: #fdfaf2; color: #2a2a2a; box-shadow: 0 8px 20px #0008; border-top: 10px solid #d33; transform: translateX(-50%); animation: wk-flip 0.65s ease-in-out both; cursor: pointer; }
.wk-flip.month { animation-duration: 0.9s; }
.wk-flip small { font-size: calc(11px * var(--fs, 1)); color: #777; }
.wk-flip b { font: 700 calc(30px * var(--fs, 1)) / 1.1 'Orbitron', 'Zen Kaku Gothic New', sans-serif; }
.wk-flip.month b { font-size: calc(40px * var(--fs, 1)); color: #c22; }
.wk-flip span { font-size: calc(14px * var(--fs, 1)); font-weight: 700; }
@keyframes wk-flip { 0% { opacity: 0; transform: translateX(-50%) perspective(400px) rotateX(-70deg); } 25%, 70% { opacity: 1; transform: translateX(-50%) perspective(400px) rotateX(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(-14px) perspective(400px) rotateX(35deg); } }

/* ---------- エンディングのふり返り（F2） ---------- */
.ending.rv-on .rv { opacity: 0; transform: translateY(8px); }
.ending.rv-on .rv.in { opacity: 1; transform: none; transition: opacity 0.45s, transform 0.45s; }
.ending.rv-on .rv-stamp { transform: scale(2.6) rotate(-14deg); }
.ending.rv-on .rv-stamp.in { transform: rotate(-8deg); transition: none; animation: rv-stamp 0.42s cubic-bezier(0.3, 1.5, 0.5, 1); }
.ending.rv-on:not(.rv-done) { cursor: pointer; }
@keyframes rv-stamp { 0% { opacity: 0; transform: scale(2.6) rotate(-14deg); } 70% { opacity: 1; transform: scale(0.92) rotate(-8deg); } 100% { transform: rotate(-8deg); } }
.end-worth { margin: 14px 0 0; display: flex; flex-direction: column; align-items: center; }
.end-worth small { color: var(--muted); }
.end-worth b { font-size: calc(30px * var(--fs, 1)); color: #fff; font-variant-numeric: tabular-nums; }
.dc { margin: 16px 0 6px; text-align: left; }
.dc-plot { position: relative; height: 130px; background: #0004; border-radius: 8px; padding: 6px 4px 18px; }
.dc-svg { width: 100%; height: 100%; display: block; }
.dc-zero { stroke: #ffffff33; stroke-width: 1; vector-effect: non-scaling-stroke; }
.dc-gain { fill: #6be58f99; }
.dc-loss { fill: #ff6b6b99; }
.dc-line { fill: none; stroke: var(--gold); stroke-width: 2; vector-effect: non-scaling-stroke; }
.dc-hits { position: absolute; inset: 0 4px; display: flex; }
.dc-hit { flex: 1 1 0; background: none; border: 0; border-left: 1px dotted #ffffff14; color: var(--muted); display: flex; align-items: flex-end; justify-content: center; padding: 0 0 2px; font: inherit; cursor: pointer; }
.dc-hit:first-child { border-left: 0; }
.dc-hit.on { background: #ffffff10; color: var(--gold); }
.dc-hit small { font-size: calc(10px * var(--fs, 1)); }
.hl-list { display: flex; flex-direction: column; gap: 6px; text-align: left; margin: 6px 0 12px; }
.hl-row { display: flex; gap: 10px; align-items: flex-start; background: #ffffff08; border-radius: 8px; padding: 6px 10px; }
.hl-icon { font-size: calc(20px * var(--fs, 1)); line-height: 1.4; }
.hl-row small { display: block; color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.hl-row b { color: var(--gold); }
.hl-text { font-size: calc(13px * var(--fs, 1)); }
.end-count { margin: 14px 0 4px; color: var(--gold); }
.end-count small { display: block; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ending.rv-on .rv, .ending.rv-on .rv-stamp { opacity: 1; transform: none; animation: none; } }

/* ステージが低いとき（ui/layout.js が body に stage-s / stage-xs をつける）：右の欄を詰めて、ステージに収める */
body.stage-s #side { top: 30px; gap: 4px; }
body.stage-s #params { gap: 1px; padding: 3px 6px; }
body.stage-s #side-btns { grid-template-columns: 1fr 1fr; gap: 3px; }
body.stage-s #side-btns .side-btn { padding: 5px 0; font-size: calc(10px * var(--fs, 1)); white-space: nowrap; letter-spacing: -0.02em; }
body.stage-s #side-btns .side-btn.log { grid-column: auto; }
body.stage-s #side-btns .side-btn.quest, body.stage-s #side-btns .side-btn.tree { grid-column: 1 / -1; padding: 5px 4px; font-size: calc(12px * var(--fs, 1)); }
body.stage-s .pr-tabs button { font-size: calc(9px * var(--fs, 1)); padding: 0; }
body.stage-xs #side { top: 28px; gap: 3px; }
body.stage-xs #params { padding: 2px 5px; line-height: 1.25; }
body.stage-xs .pr, body.stage-xs .pr.ab { font-size: calc(11px * var(--fs, 1)); }
body.stage-xs #side-btns .side-btn { padding: 4px 0; }
body.stage-xs #side-btns .side-btn.quest, body.stage-xs #side-btns .side-btn.tree { padding: 4px; font-size: calc(11px * var(--fs, 1)); }

/* 行動が7つ以上ある分類（後半の「仕入れ」など）：カードを横長に詰めて、画面に収める */
#commands:has(> .cmd:nth-child(7 of .cmd)) { gap: 5px; }
#commands:has(> .cmd:nth-child(7 of .cmd)) .cmd:not(.grp) { flex-direction: row; justify-content: flex-start; min-height: 46px; padding: 4px 6px 4px 14px; text-align: left; gap: 5px; }
#commands:has(> .cmd:nth-child(7 of .cmd)) .cmd:not(.grp) .cmd-ic { width: 24px; height: 24px; }
#commands:has(> .cmd:nth-child(7 of .cmd)) .cmd:not(.grp) b { font-size: calc(11.5px * var(--fs, 1)); line-height: 1.2; }
/* 選択肢がないあいだは、メッセージ欄の高さを固定する（下の行動カードが動かないように。長い文は ui/stage.js が1枚ずつに分ける） */
#message:not(:has(#choices > *)) { height: clamp(128px, calc(100dvh - 674px), 180px); overflow: hidden; }

/* 段階的な開放（C6）：開いたボタンは NEW で光って現れる */
.side-btn .new-tag, .menu-main .btn .new-tag { position: absolute; top: -7px; right: -4px; z-index: 1; font-family: 'Orbitron', var(--font); font-size: calc(9px * var(--fs, 1)); font-weight: 700; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 99px; background: linear-gradient(135deg, #ff4d6d, #ff8a3d); color: #fff; box-shadow: 0 0 10px #ff4d6d99; animation: new-pulse 1.2s ease-in-out infinite; }
.menu-main .btn { position: relative; }
.side-btn.fresh, .menu-main .btn.fresh { border-color: #ff8a3d; box-shadow: 0 0 0 1px #ff8a3d88, 0 0 12px #ff8a3d55; animation: ui-reveal 0.6s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes ui-reveal { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .side-btn.fresh, .menu-main .btn.fresh { animation: none; } .side-btn .new-tag, .menu-main .btn .new-tag { animation: none; } }

/* メッセージは枠からあふれさせない：お知らせ・会話は1枚ずつに分け、予告（タップを待たない表示）は文字を少し小さく */
#message.tight #text { font-size: 0.9em; line-height: 1.35; }
#message.tighter #text { font-size: 0.8em; line-height: 1.3; }

/* 基礎能力の画面：下に「戻る」（グレー）と「自動で割り振る」（緑）を横並び */
.ab-body { padding-bottom: 12px; }
.ab-foot { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(10, 12, 16, 0.94); border-top: 1px solid var(--t-line); }
.ab-foot-btn { min-height: 48px; border-radius: 10px; font: inherit; font-size: calc(15px * var(--fs, 1)); font-weight: 700; cursor: pointer; }
.ab-foot-btn.back { background: #3a3f4b; border: 1px solid #5a6070; color: #e6e9f0; }
.ab-foot-btn.auto { background: linear-gradient(180deg, #34D57A, #16A34A); border: 1px solid #fff4; color: #04140a; }
.ab-foot-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ab-auto-note { position: absolute; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; max-width: 90%; padding: 8px 14px; border-radius: 99px; background: #0d2a1acc; border: 1px solid #34D57A; color: #d9ffe6; font-size: calc(13px * var(--fs, 1)); text-align: center; pointer-events: none; animation: rv-fade 2.2s ease-out forwards; }
@keyframes rv-fade { 0% { opacity: 0; transform: translate(-50%, 8px); } 12%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* 在庫画面：絞り込み・並べ替え・1行1品の表示（B5） */
.inv-tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.inv-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.inv-chip { font: inherit; font-size: calc(12px * var(--fs, 1)); padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: #ffffff08; color: var(--text); cursor: pointer; }
.inv-chip small { margin-left: 4px; color: var(--muted); }
.inv-chip.on { border-color: var(--gold); color: var(--gold); background: #f5c54218; }
.inv-chip:disabled { opacity: 0.4; cursor: default; }
.inv-tools-r { display: flex; gap: 4px; margin-left: auto; }
.inv-sort { font: inherit; font-size: calc(12px * var(--fs, 1)); padding: 3px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.inv-view { font: inherit; font-size: calc(14px * var(--fs, 1)); width: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.inv-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; margin-bottom: 4px; border-radius: 8px; border: 1px solid var(--line); background: #ffffff06; cursor: pointer; user-select: none; }
.inv-row.listed { border-left: 3px solid var(--good); }
.inv-row.selected { border-color: var(--gold); background: #f5c54214; }
.inv-row .item-icon { width: 34px; height: 34px; flex: none; }
.ir-main { flex: 1; min-width: 0; }
.ir-name { font-size: calc(13px * var(--fs, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ir-name small { color: var(--muted); }
.ir-sub { display: flex; gap: 6px; font-size: calc(11px * var(--fs, 1)); color: var(--muted); }
.ir-st.listed { color: var(--good); }
.ir-st.wait { color: var(--info); }
.ir-r { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.25; }
.ir-r small { color: var(--muted); font-size: calc(10px * var(--fs, 1)); }
.ir-r b { font-size: calc(12px * var(--fs, 1)); }
.ir-more { color: var(--muted); font-size: calc(18px * var(--fs, 1)); }
.inv-row .sel-dot { position: static; }
.card.inv { position: relative; }
.inv-fold { position: absolute; top: 6px; right: 6px; font: inherit; font-size: calc(11px * var(--fs, 1)); width: 26px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: #0006; color: var(--muted); cursor: pointer; }

/* 店舗巡りの手数を減らす（A6）：残りの売り場をまとめて見る・＋カゴ */
.sr-all { display: block; width: calc(100% - 12px); margin: 6px 6px 4px; padding: 8px; font-size: calc(13px * var(--fs, 1)); }
.sr-cell { position: relative; display: flex; }
.sr-cell > .sh-item { flex: 1; min-width: 0; }
.sr-quick { position: absolute; right: 6px; top: 6px; z-index: 1; padding: 4px 9px; border-radius: 99px; border: 1px solid #fff8; background: #e8413c; color: #fff; font: inherit; font-size: calc(12px * var(--fs, 1)); font-weight: 700; box-shadow: 0 2px 6px #0006; cursor: pointer; }

/* 自己ベスト・初めての達成のスタンプ（C3） */
.wk-stamps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.wk-stamp { display: flex; flex-direction: column; align-items: center; padding: 3px 9px; border: 2px solid #e8413c; border-radius: 6px; color: #e8413c; background: #fff4f2; transform: rotate(-3deg); line-height: 1.2; animation: wk-stamp 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.wk-stamp:nth-child(2) { animation-delay: 0.15s; transform: rotate(2deg); }
.wk-stamp:nth-child(3) { animation-delay: 0.3s; }
.wk-stamp:nth-child(4) { animation-delay: 0.45s; transform: rotate(2deg); }
.wk-stamp b { font-size: calc(12px * var(--fs, 1)); }
.wk-stamp small { font-size: calc(10px * var(--fs, 1)); color: #b33; }
@keyframes wk-stamp { 0% { opacity: 0; scale: 2; } 100% { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .wk-stamp { animation: none; } }

/* 行動カードの体力・費用の目安（B3） */
.cmd-cost { display: flex; flex-wrap: wrap; column-gap: 5px; justify-content: center; font-size: calc(10px * var(--fs, 1)); color: var(--muted); line-height: 1.1; }
.cmd-cost .heal { color: var(--good); }
.cmd-cost .yen { color: #ffd76a; }
.cmd-cost .low { color: var(--bad); font-weight: 700; }
#commands:has(> .cmd:nth-child(7 of .cmd)) .cmd:not(.grp) { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 5px; row-gap: 1px; align-content: center; }
#commands:has(> .cmd:nth-child(7 of .cmd)) .cmd:not(.grp) .cmd-ic { grid-row: span 2; align-self: center; }
#commands:has(> .cmd:nth-child(7 of .cmd)) .cmd-cost { justify-content: flex-start; }
.cmd-cost span { white-space: nowrap; }

/* メニューの整理（B7）：機能を見出しで分け、設定は別の画面に */
.menu-h { margin: 4px 0 6px; font-size: calc(12px * var(--fs, 1)); color: var(--gold); letter-spacing: 0.08em; border-bottom: 1px solid #ffffff14; padding-bottom: 3px; }
.menu-settings { width: 100%; margin-top: 4px; }
.menu-back { font: inherit; font-size: calc(13px * var(--fs, 1)); background: none; border: 1px solid var(--line); color: var(--gold); border-radius: 99px; padding: 3px 12px; margin-bottom: 10px; cursor: pointer; }
.menu-list + .menu-h { margin-top: 14px; }

/* 音量のつまみ（G2）：BGM・効果音を 0〜100%（5%きざみ）。帯はいまの値まで色で埋める（--val は status.js が入れる） */
.vol-row { flex-wrap: nowrap; gap: 8px; }
.vol-row > span { flex: none; }
.vol-value { flex: none; min-width: 3.4em; text-align: right; color: var(--info); }
.vol-range { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; height: 28px; margin: 0; background: transparent; cursor: pointer; }
.vol-range::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--info) var(--val, 100%), #0005 var(--val, 100%)); }
.vol-range::-moz-range-track { height: 10px; border-radius: 99px; border: 1px solid var(--line); background: #0005; }
.vol-range::-moz-range-progress { height: 10px; border-radius: 99px; background: var(--info); }
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -6px; border-radius: 50%; background: var(--text); border: 2px solid var(--info); }
.vol-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--text); border: 2px solid var(--info); }
.vol-range:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* タイトル画面の整理（E5）：つづきから／はじめからを大きく、チャレンジは横並び、そのほかは下に小さく */
.title-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(340px, 100%); }
.title-row .btn { min-width: 0; padding: 8px 6px; font-size: calc(13px * var(--fs, 1)); }
.title-buttons .btn.big { min-width: min(340px, 100%); }
.title-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.title-foot .btn { min-width: 0; padding: 5px 10px; font-size: calc(12px * var(--fs, 1)); border-radius: 99px; background: #ffffff10; }

/* 仕入れ直後を1画面に（A7）：手に入れた品の絵を「すぐ出品する？」の上に並べる */
.listnow-rows .ln-ic { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; }
.listnow-got { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; padding: 10px; border-radius: 10px; background: radial-gradient(circle, #f5c54233, transparent 70%); }
.listnow-got b { font-family: 'Orbitron', var(--font); color: var(--gold); letter-spacing: 0.1em; text-shadow: 0 0 10px #f5c54288; }
.lg-item { position: relative; animation: cel-pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.lg-item:nth-child(3) { animation-delay: 0.08s; } .lg-item:nth-child(4) { animation-delay: 0.16s; } .lg-item:nth-child(5) { animation-delay: 0.24s; } .lg-item:nth-child(6) { animation-delay: 0.32s; } .lg-item:nth-child(7) { animation-delay: 0.4s; }
.lg-item img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.lg-item small { position: absolute; right: -4px; bottom: -2px; font-size: calc(11px * var(--fs, 1)); background: #000a; padding: 0 4px; border-radius: 4px; }

/* ステージ到達で増えたもの（C5） */
.unlock-card .ul-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 8px; text-align: left; }
.ul-item { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: #ffffff10; animation: cel-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.ul-item img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.ul-item .ul-dot { color: var(--gold); text-align: center; }
.ul-item small { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.ul-tree { margin: 4px 0 10px; font-size: calc(12px * var(--fs, 1)); color: var(--gold); }

/* 1年のまとめカード（D3） */
.yc-card { max-width: 380px; }
.yc-card .ch { margin: 8px 0 4px; text-align: left; }
.yc-up { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; color: var(--gold); font-size: calc(12px * var(--fs, 1)); }

/* 相場画面のタブ（B6） */
.mkt-tabs { margin-bottom: 8px; }
.mkt-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mkt-bar .note { margin: 0; }

/* 用語集と遊び方（B8） */
.gl-search { width: 100%; box-sizing: border-box; padding: 8px 10px; margin: 6px 0 8px; border-radius: 8px; border: 1px solid var(--line); background: #0006; color: var(--text); font: inherit; }
.gl-list { display: flex; flex-direction: column; gap: 6px; }
.gl-row { padding: 6px 10px; border-radius: 8px; background: #ffffff08; }
.gl-row b { color: #9dffb0; }
.gl-row p { margin: 2px 0 0; font-size: calc(13px * var(--fs, 1)); }
.gd-sec { margin-bottom: 12px; }
.gd-sec b { color: var(--gold); }
.gd-sec ul { margin: 4px 0 0; padding-left: 18px; font-size: calc(13px * var(--fs, 1)); line-height: 1.55; }
#message .hl-term { cursor: help; }
.term-tip { position: fixed; transform: translateY(-100%); }
.term-tip b { display: block; color: #9dffb0; }

/* 10年の道のり（F3） */
.road { margin-bottom: 10px; padding: 8px 10px 4px; border-radius: 10px; background: #ffffff08; }
.road-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.road-h b { color: var(--gold); font-size: calc(13px * var(--fs, 1)); }
.road-h small { color: var(--muted); }
.road-track { position: relative; height: 8px; border-radius: 99px; background: #0007; }
.road-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #22b8a0, var(--gold)); }
.road-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: #ffffff30; }
.road-st { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 16px; height: 16px; border-radius: 50%; background: var(--gold); color: #221a00; font-size: calc(10px * var(--fs, 1)); font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #0b1020; }
.road-me { position: absolute; top: -14px; transform: translateX(-50%); color: #fff; font-size: calc(10px * var(--fs, 1)); }
.road-years { display: grid; grid-template-columns: repeat(10, 1fr); margin-top: 3px; }
.road-years small { text-align: center; color: var(--muted); font-size: calc(10px * var(--fs, 1)); }

/* 繰上げ返済のワンタップ（全額・手持ちの50%） */
.repay-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 8px; }
.repay-quick .btn { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; }
.repay-quick .btn small { font-size: calc(11px * var(--fs, 1)); opacity: 0.85; font-weight: normal; }

/* 月に一度の業者オークション：仕入れの中で目立たせる */
.cmd.featured { border-color: #d4a017; background: linear-gradient(160deg, #3a2f10, var(--panel) 70%); box-shadow: 0 0 0 1px #f5c54255, 0 0 12px #f5c54233; }
.cmd .event-tag { position: absolute; top: -8px; right: -4px; z-index: 1; font-size: calc(10px * var(--fs, 1)); font-weight: 700; padding: 1px 7px; border-radius: 99px; background: linear-gradient(135deg, #f5c542, #e3a81f); color: #221a00; box-shadow: 0 0 10px #f5c54288; animation: new-pulse 1.4s ease-in-out infinite; white-space: nowrap; }
.cmd.grp .grp-event { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font-size: calc(9px * var(--fs, 1)); font-weight: 700; padding: 0 6px; border-radius: 99px; background: #f5c542; color: #221a00; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .cmd .event-tag { animation: none; } }

/* bearko.games の総合ランキングへの導線（MyCryptoPortfolio#29） */
.platform-link { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; text-align: center; }
.platform-link a { color: var(--gold); font-weight: bold; font-size: calc(14px * var(--fs, 1)); }
.platform-link small { color: var(--muted); font-size: calc(11px * var(--fs, 1)); }

/* タイトル：はじめての人向けの小さい「難易度を選んで始める」（docs/18） */
.title-buttons .btn.link-btn { min-width: 0; background: none; border: none; box-shadow: none; padding: 2px 8px; color: var(--muted); font-size: calc(12px * var(--fs, 1)); text-decoration: underline; }
/* はじめての出品（docs/18）：出品ボタンと値付けだけ */
.inv-simple .inv-opts, .inv-simple .inv-tools, .inv-simple .inv-quick, .inv-simple .inv-buy, .inv-simple .sel-dot { display: none; }
.modal-footer .btn.tut-point { overflow: visible; }

/* ---------- PC：操作の列と演出の列（docs/19。ui/layout.js が body.pc と --dock などを決める） ----------
   左：演出の列（舞台・メッセージ欄）、右：操作の列（上の情報・能力・行動のタブ・ボタン）。右端の全体チャットのドック（SDK）の左に収める */
/* 右端にチャットのドックがあるとき（1 列でも）：ゲームはドックの左に収める。ドックは SDK がいちばん上に描く */
body.chat-dock #app { margin-left: max(0px, calc((100% - var(--dock, 0px) - 520px) / 2)); margin-right: auto; }
body.chat-dock .modal-backdrop, body.chat-dock .confirm-backdrop, body.chat-dock .goal-pop, body.chat-dock .mailbox, body.chat-dock .qscene, body.chat-dock .celebrate, body.chat-dock .tree-screen { right: var(--dock, 0px); }
body.chat-dock .shop { right: var(--dock, 0px); }
body.chat-dock .toast-stack { left: calc((100% - var(--dock, 0px)) / 2); }
body.pc #app { max-width: none; margin: 0; width: calc(100% - var(--dock, 0px)); }
body.pc #title-screen, body.pc #ending-screen { max-width: 520px; margin: 0 auto; }
body.pc #game-screen:not([hidden]) { flex-direction: row; justify-content: center; gap: 16px; height: 100dvh; min-height: 0; padding: 12px 16px; overflow: hidden; }
body.pc .col-stage { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-width: 0; max-width: 760px; }
body.pc .col-ops { display: flex; flex-direction: column; gap: 8px; flex: 0 0 clamp(440px, 45%, 520px); min-width: 0; min-height: 0; }
body.pc #hud { position: static; border: 2px solid var(--line); border-radius: var(--radius); }
body.pc #stage { flex: 1 1 auto; min-height: 0; border: 2px solid var(--line); border-radius: var(--radius); }
body.pc #side { display: none; }
/* 演出の列の文字：スマホに合わせた大きさから、PC の距離で読みやすい大きさに */
body.pc #news-ticker { padding: 7px 14px; font-size: calc(15px * var(--fs, 1)); }
body.pc #message { flex: none; margin: 0; min-height: 184px; padding: 12px 18px 16px; }
body.pc #speaker { font-size: calc(17px * var(--fs, 1)); min-height: 26px; }
body.pc #text { font-size: calc(19px * var(--fs, 1)); line-height: 1.65; min-height: 64px; }
body.pc #next-mark { right: 14px; bottom: 6px; font-size: calc(15px * var(--fs, 1)); }
/* 人物：舞台が大きいので、スマホの頭打ち（最大 230px）を上げる。ドットは fitPixel が整数倍にそろえる */
body.pc #sprite-left { left: 10%; height: min(56%, 360px); }
body.pc #sprite-right { height: min(46%, 300px); }
body.pc #sprite-right.hero { height: min(42%, 270px); }
body.pc #sprite-right.enemy { height: min(44%, 280px); }
body.pc #sprite-right.orig.mine { height: min(52%, 340px); }
body.pc #sprite-right.orig.maycri { height: min(28%, 180px); }
/* 能力：ヘッダーの下に、5 つを列で */
body.pc #params { display: grid; grid-template-columns: auto repeat(5, minmax(0, 1fr)); gap: 6px; padding: 8px 10px; line-height: 1.3; background: #0b1020; border: 2px solid var(--line); border-radius: var(--radius); }
body.pc .pr-tabs { grid-template-columns: 1fr; align-content: center; gap: 4px; margin: 0; }
body.pc .pr-tabs button { padding: 4px 8px; font-size: calc(12px * var(--fs, 1)); }
body.pc #params .pr { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 0; border: 1px solid #ffffff14; border-radius: 8px; background: #ffffff08; text-align: center; font-size: calc(12px * var(--fs, 1)); }
body.pc #params .pr .pn { font-size: calc(12px * var(--fs, 1)); }
body.pc #params .pr.ab .pn { color: var(--muted); }
body.pc #params .pr.ab .rk { font-size: calc(15px * var(--fs, 1)); }
body.pc #params .pr b { font: 700 calc(18px * var(--fs, 1)) / 1 'Orbitron', sans-serif; text-align: center; }
body.pc #params .pr i { min-height: 1.1em; font-size: calc(10px * var(--fs, 1)); }
/* 行動：4 つのタブと、選んだタブの中身 */
body.pc #commands { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 2px 4px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cmd-tabs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 2px solid #c8cff5; margin-bottom: 4px; }
.cmd-tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 4px 8px; font: inherit; font-weight: bold; font-size: calc(15px * var(--fs, 1)); color: var(--muted); background: transparent; border: 2px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; cursor: pointer; white-space: nowrap; }
.cmd-tab:hover { color: var(--text); }
.cmd-tab img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.cmd-tab.on { color: var(--text); background: var(--panel); border-color: #c8cff5; margin-bottom: -2px; }
.cmd-tab.off { opacity: 0.4; cursor: default; }
.cmd-tab .k { font: 10px 'Orbitron', sans-serif; color: var(--muted); }
.cmd-tab .new-tag, .cmd-tab .grp-event { position: absolute; top: -6px; right: 2px; }
.cmd-tab .n { font-size: calc(10px * var(--fs, 1)); color: var(--muted); font-weight: normal; }
body.pc #commands .cmd-header { grid-column: 1 / -1; }
/* 選択肢：PC では操作の列（タブの中身の場所）に大きく出す */
body.pc #choices { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 0; padding: 2px; gap: 8px; } /* 選択肢が多いときは、この欄の中でスクロール（フッターを押し出さない） */
body.pc #choices .choice { padding: 12px 16px; font-size: calc(16px * var(--fs, 1)); }
body.pc #choices button { padding-left: 24px; }
body.pc .col-ops:has(#choices:not(:empty)) #commands { display: none; }
/* ボタン群：操作の列のフッターに、幅いっぱいで 1 行。演出の最中も消さない */
body.pc #ops-foot { order: 4; display: block; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); } /* いつも操作の列の下 */
body.pc #side-btns, body.pc.busy.gain-flash #side-btns { display: flex; gap: 6px; }
body.pc #side-btns .side-btn { flex: 1 1 0; min-width: 0; padding: 10px 0; font-size: calc(12px * var(--fs, 1)); letter-spacing: 0; white-space: nowrap; overflow: visible; }
body.pc #side-btns .side-btn.quest, body.pc #side-btns .side-btn.tree { flex-grow: 1.5; padding: 10px 2px; font-size: calc(12px * var(--fs, 1)); }
/* チャット：ドックが広がっているあいだは点灯（押すと畳む） */
.side-btn.chat.on { border-color: #a78bfa; background: #2b2558e6; color: #ece7ff; }
body.pc.busy #side-btns { opacity: 0.55; }
/* 画面に重ねるもの：開く画面は操作の列の上だけ、お祝いは演出の列の上、全画面のものはドックの左まで */
body.pc .modal-backdrop, body.pc .confirm-backdrop, body.pc .goal-pop, body.pc .mailbox, body.pc .qscene { left: var(--ov-l, 0px); right: var(--ov-r, var(--dock, 0px)); }
body.pc .shop { left: var(--ov-l, 0px); right: var(--ov-r, var(--dock, 0px)); box-shadow: none; }
body.pc .celebrate { left: var(--st-l, 0px); right: var(--st-r, var(--dock, 0px)); }
body.pc .tree-screen { right: var(--dock, 0px); }
body.pc .toast-stack { left: calc((var(--ov-l, 0px) + 100% - var(--ov-r, 0px)) / 2); }

