@charset "UTF-8";
/* =========================================================
   Rune Seed UI 部品 (スマホ縦画面・片手操作向け)
   読み込み:
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700&family=Shippori+Mincho:wght@600&display=swap">
     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3/dist/tabler-icons.min.css">
     <link rel="stylesheet" href="ui/rc-ui.css">
     <script src="ui/rc-ui.js" defer></script>
   ========================================================= */

/* ---------- 色・大きさの約束ごと ---------- */
:root {
  --bg:        #f4ede0;   /* 羊皮紙 */
  --bg-deep:   #ebe1cf;
  --surface:   #fffaf1;
  --surface-2: #f8f0e2;
  --line:      #e0d3bd;
  --line-strong:#c9b797;
  --text:      #2b2419;
  --text-sub:  #6e6250;
  --text-mute: #504b43;

  --primary:   #3f4e6e;   /* 藍の墨 */
  --primary-press:#2e3a54;
  --on-primary:#fbf6ea;
  --gold:      #b8862b;
  --gold-soft: #f3e3bf;
  --danger:    #b8423a;
  --danger-soft:#f6dcd8;
  --success:   #3f8a5a;
  --success-soft:#dcefe2;
  --info-soft: #e6e3d8;

  --g-hp:  #3f9a6a;
  --g-vt:  #d8932c;
  --g-mp:  #56779e;
  --g-exp: #8a6a9e;
  --g-track: #e6dac5;

  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --font-title: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --r-sm: 3px;
  --r-md: 5px;
  --r-lg: 7px;
  --shadow: 0 1px 0 rgba(60,40,10,.07);
  --shadow-up: 0 -1px 0 rgba(60,40,10,.10);
  --cmd:       #4d5a3a;   /* 主なコマンド (探索する) の地: 苔色 */
  --cmd-press: #3c4730;
  --on-cmd:    #f6efdc;
  --paper-noise: .05;
  --tap: 48px;            /* 指で押しやすい最小の高さ */
  --gutter: 16px;
  --tabbar-h: 64px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {   /* ランプの光 */
    --bg:#1b1712; --bg-deep:#15120e; --surface:#221d17; --surface-2:#2a241c;
    --line:#3a3227; --line-strong:#574b3a; --text:#ece2cc; --text-sub:#bdb098; --text-mute:#b3ada2;
    --primary:#d0a95f; --primary-press:#a98640; --on-primary:#1c160e;
    --gold:#d9b064; --gold-soft:#3a2f1d; --danger:#dc7b6c; --danger-soft:#3b231f;
    --success:#98bd7c; --success-soft:#263022; --info-soft:#2c271f;
    --g-hp:#86b56c; --g-vt:#d69a45; --g-mp:#86a3c2; --g-exp:#b394c4; --g-track:#2f2920;
    --shadow:0 1px 0 rgba(0,0,0,.35);
    --shadow-up:0 -1px 0 rgba(0,0,0,.4);
    --cmd:#6b5a33; --cmd-press:#54462a; --on-cmd:#f4e9cf;
    --paper-noise:.06;
  }
}
:root[data-theme="dark"] {
  --bg:#1b1712; --bg-deep:#15120e; --surface:#221d17; --surface-2:#2a241c;
  --line:#3a3227; --line-strong:#574b3a; --text:#ece2cc; --text-sub:#bdb098; --text-mute:#a49d90;
  --primary:#d0a95f; --primary-press:#a98640; --on-primary:#1c160e;
  --gold:#d9b064; --gold-soft:#3a2f1d; --danger:#dc7b6c; --danger-soft:#3b231f;
  --success:#98bd7c; --success-soft:#263022; --info-soft:#2c271f;
  --g-hp:#86b56c; --g-vt:#d69a45; --g-mp:#86a3c2; --g-exp:#b394c4; --g-track:#2f2920;
  --shadow:0 1px 0 rgba(0,0,0,.35);
  --shadow-up:0 -1px 0 rgba(0,0,0,.4);
  --cmd:#6b5a33; --cmd-press:#54462a; --on-cmd:#f4e9cf;
  --paper-noise:.06;
}

/* ---------- 土台 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  /* 紙の目 (とても薄い) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .4  0 0 0 0 .25  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
/* プレイヤーの文字色が初期値の黒のときは、明るい・暗いに合わせた色にする */
font[color="#000000"], font[color="#000"], font[color="black"] { color: inherit; }
b, strong { font-weight: 700; }
.ti { line-height: 1; vertical-align: -0.12em; }

/* ---------- 画面の骨組み ---------- */
.app {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
/* 広い画面 (PC): 左右の余白に、set.cgi $ui_bg の絵をうすく出す。まん中の列は紙の色のまま (09-30) */
@media (min-width: 720px) {
  html:not(.in-frame) body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: center / cover no-repeat;   /* 絵は base.cgi header が set.cgi の $ui_bg から入れる */
    opacity: .3;
  }
  html:not(.in-frame) .app, html:not(.in-frame) body > .page {
    background-color: var(--bg);
    box-shadow: 0 0 0 1px var(--line), 0 0 48px rgb(0 0 0 / .18);
  }
}
@media (min-width: 720px) and (prefers-color-scheme: dark) {
  html:not(.in-frame):not([data-theme="light"]) body::before { opacity: .22; filter: brightness(.7) saturate(.8); }
}
@media (min-width: 720px) {
  html[data-theme="dark"]:not(.in-frame) body::before { opacity: .22; filter: brightness(.7) saturate(.8); }
}
.app-body {
  flex: 1;
  padding: 12px var(--gutter) calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 上の帯: 場所の名前 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-main { flex: 1; min-width: 0; }
.topbar-sub { font-size: 14px; color: var(--text-sub); display: flex; align-items: center; gap: 4px; }
.topbar-title {
  font-family: var(--font-title); font-size: 21px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  position: relative;
  width: 44px; height: 44px; border-radius: var(--r-sm);
  display: inline-grid; place-items: center;
  border: none; background: transparent; color: var(--text-sub);
  font-size: 23px; cursor: pointer;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 9px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--bg);
}

/* 下のタブバー */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-up);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: none; background: none; cursor: pointer;
  color: var(--text-mute); font: inherit; font-size: 12px;
}
.tab .ti { font-size: 24px; }
.tab[aria-current="page"] { color: var(--primary); font-weight: 700; }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--primary);
}
.tab .count {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px;
}

/* 親指エリアに固定するメインボタン */
.dock {
  position: fixed; left: 0; right: 0; z-index: 25;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto;
  padding: 10px var(--gutter) 12px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  display: flex; gap: 10px;
}
.dock > .btn { flex: 1; }

/* ---------- カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text-sub); letter-spacing: .04em; }
.card-flat { box-shadow: none; background: var(--surface-2); border-color: transparent; }
/* 画面の いちばん上の 見出しのカード (アイコン＋名前＋説明。押せない)。押せる行と まちがえないように、箱にしない (10-04 勝博さん) */
.card:has(> .tile-icon), .card:has(> div > .tile-icon) {
  background: transparent; border: none; border-radius: 0; box-shadow: none;
  border-bottom: 1px solid var(--line); padding: 4px 2px 14px;
}
.card:has(> .tile-icon) > .tile-icon, .card:has(> div > .tile-icon) > div > .tile-icon {
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: var(--surface-2); font-size: 24px;
}
.card:has(> .tile-icon) > div > div:first-child, .card:has(> div > .tile-icon) > div > div > div:first-child { font-size: 18px; }
.section-title {
  font-family: var(--font-title); font-size: 17px; font-weight: 600;
  margin: 6px 2px -4px; display: flex; align-items: center; gap: 6px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 6px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; user-select: none;
  transition: transform .12s var(--ease), background .15s, box-shadow .15s;
}
.btn .ti { font-size: 20px; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }
.btn-primary {
  background: var(--primary); color: var(--on-primary); border-color: var(--primary-press);
  box-shadow: inset 0 -2px 0 var(--primary-press);
}
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-gold {
  background: var(--gold); color: #fff; border-color: color-mix(in srgb, var(--gold) 70%, #000);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--gold) 70%, #000);
}
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-lg { min-height: 54px; font-size: 17px; border-radius: var(--r-md); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 15px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .75; }
.btn:disabled { opacity: .4; box-shadow: none; transform: none; cursor: not-allowed; }
.btn[aria-busy="true"]::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: rc-spin .7s linear infinite;
}
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
/* 「戻る」などを大きく、「閉じる」を小さく (まちがえて押さないように。10-08 勝博さん) */
.btn-row > .btn:not(.only-frame), .btn-row > form { flex: 2 1 0; }
.btn-row > .btn.only-frame { flex: 1 1 0; }
@keyframes rc-spin { to { transform: rotate(360deg); } }

/* ---------- ゲージ ---------- */
.gauges { display: grid; gap: 10px; }
.gauge-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.gauge-label { font-weight: 700; display: flex; align-items: center; gap: 4px; }
.gauge-value { font-variant-numeric: tabular-nums; color: var(--text-sub); }
.gauge-value b { color: var(--text); font-size: 16px; }
.gauge-bar {
  position: relative; height: 8px; margin-top: 4px;
  border-radius: 1px; background: var(--g-track); overflow: hidden;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line-strong) 45%, transparent);
}
.gauge-fill {
  --c: var(--g-hp);
  height: 100%; width: 0; border-radius: 0;
  background: var(--c);
  transition: width .8s var(--ease);
}
.gauge.hp  .gauge-fill { --c: var(--g-hp); }
.gauge.vt  .gauge-fill { --c: var(--g-vt); }
.gauge.mp  .gauge-fill { --c: var(--g-mp); }
.gauge.exp .gauge-fill { --c: var(--g-exp); }
.gauge.wt  .gauge-fill { --c: var(--gold); }
.gauge.low .gauge-fill { --c: var(--danger); animation: rc-pulse 1.4s ease-in-out infinite; }
.gauge-note { font-size: 13px; color: var(--text-mute); margin-top: 2px; }
@keyframes rc-pulse { 50% { opacity: .55; } }

/* 丸いゲージ (待ち時間など) */
.ring {
  --p: 0; --c: var(--primary);
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--g-track) 0);
  font-size: 14px; font-weight: 700;
}
.ring > span { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }

/* ---------- 札 (バッジ・チップ) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  background: var(--surface-2); color: var(--text-sub);
  border: 1px solid var(--line);
}
.chip .ti { font-size: 14px; }
.chip.info    { background: var(--info-soft);    color: var(--primary); border-color: transparent; }
.chip.good    { background: var(--success-soft); color: var(--success); border-color: transparent; }
.chip.warn    { background: var(--gold-soft);    color: var(--gold);    border-color: transparent; }
.chip.bad     { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.rarity { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; border: 1px solid currentColor; }
.rarity.r1 { color: var(--text-mute); }
.rarity.r2 { color: var(--success); }
.rarity.r3 { color: var(--g-mp); }
.rarity.r4 { color: var(--g-exp); }
.rarity.r5 { color: var(--gold); background: var(--gold-soft); }

/* ---------- できることタイル ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles > form { display: grid; margin: 0; }            /* タイルをformで包んだとき */
.tiles > form > .tile { width: 100%; }
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 88px; padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: transform .12s var(--ease);
}
.tile:active { transform: scale(.97); }
.tile-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 4px;
  background: none; color: var(--text-sub); border: 1px solid var(--line);
}
.tile-icon.gold  { color: var(--gold); }
.tile-icon.green { color: var(--success); }
.tile-icon.red   { color: var(--danger); }
.tile-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.tile-sub  { font-size: 13px; color: var(--text-mute); }
.tile .badge-new {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--danger);
  padding: 1px 6px; border-radius: 6px;
}

/* ---------- 一覧 (持ち物など) ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 14px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  color: var(--text); background: none; width: 100%; font: inherit; text-align: left;
}
.row:last-child { border-bottom: none; }
.list > form { margin: 0; }                              /* 1行ずつformで包んだとき */
.list > form > .row:last-child { border-bottom: 1px solid var(--line); }
.list > form:last-child > .row:last-child { border-bottom: none; }
button.row, a.row { cursor: pointer; }
button.row:active, a.row:active { background: var(--surface-2); }
button.row:disabled { cursor: not-allowed; opacity: .55; background: none; }
.row-icon {
  flex: none; width: 32px; height: 40px;
  display: grid; place-items: center; font-size: 21px;
  background: none; color: var(--text-sub);
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 16px; line-height: 1.35; display: flex; align-items: center; gap: 6px; }
.row-sub { font-size: 14px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { flex: none; text-align: right; font-size: 15px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.row-end .ti-chevron-right { color: var(--text-mute); font-size: 18px; }
.row.is-equipped .row-icon { color: var(--primary); }
.row-title { flex-wrap: wrap; }
.row-title .ti { font-size: 15px; color: var(--text-mute); }
/* 押して選べる行 (<label class="row pick"><input class=row-check …>) */
label.row { cursor: pointer; }
.row-check { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--primary); }
.row.pick:has(.row-check:checked) { background: var(--info-soft); }
.row.pick:has(.row-check:checked) .row-icon { color: var(--primary); }
/* アイテムの品質の色 */
.i2 { color: #a0643c; } .i3 { color: #a08a10; } .i4 { color: var(--success); }
.i5 { color: var(--g-exp); } .i6 { color: var(--danger); } .i7 { color: var(--g-mp); }

/* ---------- 結果・ログ ---------- */
.log {
  position: relative;
  padding: 12px 14px 12px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 16px; line-height: 1.75;
  animation: rc-in .35s var(--ease);
}
.log::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 0; background: var(--primary);
}
.log.good::before { background: var(--success); }
.log.bad::before  { background: var(--danger); }
.log-time { font-size: 13px; color: var(--text-mute); }
.log:empty { display: none; }
.gain { color: var(--success); font-weight: 700; }
.loss { color: var(--danger); font-weight: 700; }
@keyframes rc-in { from { opacity: 0; transform: translateY(6px); } }

/* 台詞の吹き出し */
.talk { display: flex; gap: 10px; align-items: flex-start; }
.talk-avatar {
  flex: none; width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: 20px;
  background: none; border: 1px solid var(--line); color: var(--gold);
}
.talk-body {
  position: relative; padding: 9px 13px; border-radius: 2px var(--r-lg) var(--r-lg) var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); font-size: 16px;
}
.talk-name { font-size: 13px; color: var(--text-mute); font-weight: 700; }

/* ダンジョンなどの読みもの */
.story { font-size: 16px; line-height: 1.85; letter-spacing: .02em; }
.talk-body.story { font-size: 16px; line-height: 1.75; }

/* ---------- 入力 ---------- */
.field { display: grid; gap: 6px; }
.field-label { font-size: 15px; font-weight: 700; color: var(--text-sub); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; /* 16px未満だとiPhoneで勝手に拡大される */
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.field-hint { font-size: 14px; color: var(--text-mute); }
.field-count { font-size: 14px; color: var(--text-mute); text-align: right; font-variant-numeric: tabular-nums; }
.field-count.over { color: var(--danger); font-weight: 700; }

/* 数を増やす・減らす */
.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface);
}
.stepper button {
  width: var(--tap); height: var(--tap); border: none; background: none;
  color: var(--primary); font-size: 20px; cursor: pointer;
}
.stepper button:active { background: var(--surface-2); }
.stepper output { min-width: 56px; text-align: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }

/* 切り替えボタン (セグメント) */
.segmented {
  display: flex; padding: 4px; gap: 4px;
  border-radius: var(--r-md); background: var(--surface-2);
}
.segmented button {
  flex: 1; min-height: 40px; border: none; border-radius: var(--r-sm);
  background: none; color: var(--text-sub); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ラジオボタンで作る切り替え (<label><input type=radio><span>…</span></label>) */
.segmented label { flex: 1; position: relative; display: flex; }
.segmented label input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented label span {
  flex: 1; display: grid; place-items: center; min-height: 40px; border-radius: var(--r-sm);
  color: var(--text-sub); font-size: 16px; font-weight: 700; pointer-events: none;
}
.segmented label input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented label input:focus-visible + span { outline: 2px solid var(--primary); }

/* タイトル (トップページ) */
.hero { text-align: center; padding: 28px 0 8px; display: grid; gap: 8px; justify-items: center; }
.hero-mark {
  width: 64px; height: 64px; display: grid; place-items: center;
  color: var(--gold); font-size: 40px;
}
.hero-title { font-family: var(--font-title); font-size: 34px; font-weight: 600; margin: 4px 0 0; line-height: 1.2; letter-spacing: .04em; }
.hero-sub { margin: 0 0 6px; color: var(--text-sub); font-size: 16px; }

/* ギルドのしるし・札 (--gc にギルドの色) */
.gmark {
  flex: none; display: grid; place-items: center; border-radius: 30%;
  color: var(--gc); background: color-mix(in srgb, var(--gc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc) 40%, transparent);
}
.gbadge {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 99px;
  font-size: 12px; font-weight: 700; color: var(--gc); background: color-mix(in srgb, var(--gc) 15%, transparent);
}
.gbadge .ti { font-size: 13px; color: inherit; }
.gdot { width: 12px; height: 12px; border-radius: 50%; background: var(--gc); display: inline-block; }

/* アイコンや色をタップで選ぶ */
.pickgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.pickicon { position: relative; }
.pickicon input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pickicon span {
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: var(--r-sm); pointer-events: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-sub); font-size: 15px; font-weight: 700;
}
.pickicon span .ti { font-size: 22px; }
.pickicon input:checked + span { border: 2px solid var(--primary); color: var(--primary); background: var(--info-soft); }
.pickicon input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 図鑑 */
/* タブは 横にスクロールさせず、3つずつ2段に並べる (はみ出して 見えないタブがあった。10-03)。広い画面では1段 */
.gtabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-bottom: 4px; }
@media (min-width: 640px) { .gtabs { grid-template-columns: repeat(6, auto); justify-content: start; } }
.gtab {
  min-width: 0; white-space: nowrap; justify-content: center;
  display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 8px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text-sub); font-size: 15px; font-weight: 700;
}
.gtab[aria-current=page] { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.gtab .ti { font-size: 16px; }
button.gtab { cursor: pointer; font-family: inherit; }
button.chip { cursor: pointer; font: inherit; font-size: 13px; }
details.grow { border-bottom: 1px solid var(--line); }
details.grow:last-child { border-bottom: none; }
details.grow > summary { list-style: none; cursor: pointer; border-bottom: none; }
details.grow > summary::-webkit-details-marker { display: none; }
details.grow[open] > summary { background: var(--surface-2); }
.gdetail { padding: 4px 14px 14px 66px; display: grid; gap: 6px; }

/* クレジット (library/credits.cgi) */
.credits { max-width: 480px; margin: 24px auto 0; padding: 0 var(--gutter) 24px; text-align: center; font-size: 13px; line-height: 1.8; color: var(--text-mute); }
.credits a { color: var(--text-mute); }
.credits a:hover { color: var(--primary); }

/* オン・オフ */
.switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong);
  transition: background .2s; pointer-events: none;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s var(--ease);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }

/* 音の設定 (メニュー) */
.sound-set { display: grid; gap: 6px; }
.sound-row { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.sound-name { display: inline-flex; align-items: center; gap: 8px; }
.sound-vol { width: 100%; margin: 0 0 6px; accent-color: var(--primary); }
.sound-vol:disabled { opacity: .4; }
.sound-set p { margin: 0; }

/* ---------- 下から出るパネル ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 14, 6, .5);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-width: 480px; margin: 0 auto; max-height: 86dvh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 10px 10px 0 0;
  border-top: 1px solid var(--line-strong);
  box-shadow: var(--shadow-up);
  transform: translateY(105%);
  transition: transform .32s var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet::before { /* つまみ */
  content: ""; align-self: center; flex: none;
  width: 40px; height: 5px; margin: 10px 0 4px; border-radius: 3px; background: var(--line-strong);
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px var(--gutter); }
.sheet-title { flex: 1; font-family: var(--font-title); font-size: 19px; font-weight: 600; }
.sheet-body { overflow-y: auto; min-height: 0; padding: 4px var(--gutter) var(--gutter); display: grid; gap: 12px; grid-auto-rows: max-content; overscroll-behavior: contain; }
.sheet-foot { padding: 10px var(--gutter) 14px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sheet-foot > .btn { flex: 1; }
.sheet.is-open { transform: translateY(0); }
.sheet.is-open + .sheet-backdrop, .sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
body.sheet-lock { overflow: hidden; }

/* 子画面(昔の画面)をパネルの中で開く */
.sheet-frame { height: 86dvh; }
.sheet-frame .sheet-body { flex: 1; padding: 0; display: block; overflow: hidden; position: relative; }
.sheet-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.sheet-frame.is-loading .sheet-body::after {
  content: ""; position: absolute; top: 40%; left: 50%; width: 28px; height: 28px; margin: -14px;
  border-radius: 50%; border: 3px solid var(--primary); border-right-color: transparent;
  animation: rc-spin .7s linear infinite;
}
.sheet-frame.is-loading iframe { opacity: .3; }
.sheet-frame.is-scene .sheet-body::after { display: none; }
.sheet-frame.is-scene iframe { opacity: 0; }

/* ---------- 時間のかかる行動の短い演出 (rc-ui.js RC.scene) ---------- */
.scene {
  position: fixed; inset: 0; z-index: 55;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px var(--gutter);
  background: var(--bg);
  opacity: 0; transition: opacity .25s ease; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.scene.in-box { position: absolute; z-index: 2; }
.scene.is-on { opacity: 1; }
.scene-stage {
  position: relative; width: 112px; height: 112px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 20px rgb(0 0 0 / .08);
  overflow: hidden;
}
.scene-stage > i { position: relative; z-index: 1; font-size: 52px; color: var(--primary); }
.scene-fx { position: absolute; inset: 0; }
.scene-text {
  margin: 0; min-height: 1.6em; text-align: center;
  font-family: var(--font-title); font-size: 17px; color: var(--text);
  transition: opacity .18s ease;
}
.scene-text.is-swap { opacity: 0; }
.scene-bar { width: min(220px, 70%); height: 4px; border-radius: 2px; background: var(--g-track); overflow: hidden; }
.scene-bar > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width linear; }
.scene-skip { margin: 0; font-size: 12px; color: var(--text-sub); }
.scene.is-end .scene-skip { visibility: hidden; }

/* 歩く: 上下にゆれて、地面の点が流れる */
.scene-walk .scene-stage > i { animation: sc-bob .5s ease-in-out infinite alternate; }
.scene-walk .scene-fx {
  top: auto; height: 20px; bottom: 14px;
  background: radial-gradient(circle, var(--line-strong) 2px, transparent 2.5px) 0 50% / 18px 8px repeat-x;
  animation: sc-ground .6s linear infinite;
}
/* 摘む: 左右にやさしくゆれる */
.scene-sway .scene-stage > i { animation: sc-sway 1.1s ease-in-out infinite alternate; transform-origin: 50% 90%; }
.scene-sway .scene-fx { background: radial-gradient(circle at 50% 110%, var(--success-soft) 0 45%, transparent 46%); }
/* 振る: 斧・つるはし */
.scene-swing .scene-stage > i { animation: sc-swing .55s cubic-bezier(.5,0,.8,.4) infinite; transform-origin: 20% 85%; }
.scene-swing .scene-fx::after {
  content: ""; position: absolute; left: 62%; top: 58%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); opacity: 0; animation: sc-spark .55s ease-out infinite;
}
/* 水: 波紋が広がる */
.scene-float .scene-stage > i { animation: sc-bob 1s ease-in-out infinite alternate; }
.scene-float .scene-fx::before, .scene-float .scene-fx::after {
  content: ""; position: absolute; left: 50%; top: 70%; width: 20px; height: 8px; margin: -4px -10px;
  border: 2px solid var(--g-mp); border-radius: 50%; opacity: 0; animation: sc-ripple 1.6s ease-out infinite;
}
.scene-float .scene-fx::after { animation-delay: .8s; }
/* ねらう: 輪がしぼむ */
.scene-aim .scene-stage > i { animation: sc-hold 1.4s ease-in-out infinite; }
.scene-aim .scene-fx::after {
  content: ""; position: absolute; inset: 10px; border-radius: 50%;
  border: 2px dashed var(--danger); opacity: .0; animation: sc-aim 1.4s ease-in infinite;
}
/* 家畜の子どもが生まれる (rc-ui.js initBirth): 2匹が近づく → ハート → ポンと子ども */
.birth .birth-stage { position: relative; width: 220px; height: 120px; }
.birth-a, .birth-b, .birth-baby {
  position: absolute; top: 34px; left: 50%; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--primary); font-size: 30px;
  transition: transform 1.6s cubic-bezier(.3,.7,.3,1), opacity .4s ease;
}
.birth-a { transform: translateX(-80px); }
.birth-b { transform: translateX(80px) scaleX(-1); }
.birth.is-on .birth-a { transform: translateX(-30px); }
.birth.is-on .birth-b { transform: translateX(30px) scaleX(-1); }
.birth-hearts { position: absolute; left: 50%; top: 20px; width: 0; }
.birth-hearts .ti {
  position: absolute; left: -9px; font-size: 18px; color: #d9607a; opacity: 0;
  animation: bh-float 1.4s ease-out infinite;
}
.birth-hearts .ti:nth-child(2) { animation-delay: .45s; left: -20px; font-size: 14px; }
.birth-hearts .ti:nth-child(3) { animation-delay: .9s;  left: 4px;   font-size: 15px; }
.birth-baby { top: 70px; width: 40px; height: 40px; margin-left: -20px; font-size: 22px; opacity: 0; transform: scale(0); transition: transform .45s cubic-bezier(.3,1.6,.5,1), opacity .2s ease; }
.birth.is-born .birth-baby { opacity: 1; transform: scale(1); border-color: #d9607a; box-shadow: 0 0 0 6px color-mix(in srgb, #d9607a 18%, transparent); }
.birth.is-born .birth-a, .birth.is-born .birth-b { opacity: .55; }
.birth.is-born .birth-hearts .ti { animation: bh-pop .5s ease-out forwards; }
@keyframes bh-float { 0% { opacity: 0; transform: translateY(14px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px) scale(1.1); } }
@keyframes bh-pop { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: translateY(-10px) scale(2.2); } }
@keyframes sc-bob { from { transform: translateY(3px); } to { transform: translateY(-5px); } }
@keyframes sc-ground { to { background-position: -18px 50%; } }
@keyframes sc-sway { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes sc-swing { 0% { transform: rotate(-35deg); } 70% { transform: rotate(18deg); } 100% { transform: rotate(-35deg); } }
@keyframes sc-spark { 0%,60% { opacity: 0; transform: scale(.3); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes sc-ripple { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(4); } }
@keyframes sc-hold { 50% { transform: scale(1.08); } }
@keyframes sc-aim { from { opacity: 0; transform: scale(1.3); } 60% { opacity: .9; } to { opacity: 0; transform: scale(.55); } }

/* ---------- お知らせ (トースト) ---------- */
.toast-area {
  position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top)); z-index: 60;
  display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 var(--gutter);
}
.toast {
  max-width: 440px; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg);
  font-size: 16px; font-weight: 500; box-shadow: var(--shadow);
  animation: rc-toast 2.6s var(--ease) forwards;
}
.toast .ti { font-size: 18px; }
.toast.good .ti { color: var(--g-hp); }
.toast.bad .ti { color: var(--danger); }
@keyframes rc-toast {
  0% { opacity: 0; transform: translateY(-10px) scale(.96); }
  10%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* ---------- 空っぽ表示・区切り・小物 ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--text-mute); font-size: 16px; }
.empty .ti { font-size: 40px; display: block; margin: 0 auto 6px; color: var(--line-strong); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 16px; }
.kv dt { color: var(--text-sub); }
.kv dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: none; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 6px; text-align: center; }
.stat-label { font-size: 13px; color: var(--text-mute); }
.stat-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.money { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-mute); }
.small { font-size: 14px; }
.hr { height: 1px; background: var(--line); border: none; margin: 4px 0; }

/* ---------- パネルの中の画面 ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 14px var(--gutter) 28px; display: grid; gap: 12px; grid-auto-rows: max-content; }
.result { font-size: 16px; }
.result tt { display: block; font-family: inherit; font-weight: 700; font-size: 15px; color: var(--primary); margin-top: 10px; }
.result tt:first-child { margin-top: 0; }
.result tt + br { display: none; }
.result .ti { color: var(--text-sub); }
/* 結果・戦いの記録の色 (昔の画面は legacy.css にある) */
.result .alert   { color: var(--danger); font-weight: 700; }
.result .up      { color: var(--success); font-weight: 700; }
.result .down    { color: var(--danger); font-weight: 700; }
.result .exp     { color: var(--g-mp); font-weight: 700; }
.result .levelup { color: var(--g-exp); font-weight: 700; }
.result .money   { color: var(--gold); font-weight: 700; }
.result .Ex      { color: var(--success); font-weight: 700; }
.result .Dx      { color: var(--g-exp); font-weight: 700; }
.result .dmg     { color: var(--danger); font-size: 1.1em; }
.battle { line-height: 1.8; }
.battle tt { padding-top: 8px; border-top: 1px dashed var(--line); }
.battle tt:first-child { padding-top: 0; border-top: 0; }
/* 1行ずつ見せる戦いの記録 (base.cgi say・rc-ui.js initPlay) */
.battle.is-play .ln-gap { height: .9em; }
.battle.is-play .ln > tt { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.battle.is-play .ln:first-child > tt { margin-top: 0; padding-top: 0; border-top: 0; }
.battle.is-hold { cursor: pointer; }
.battle.is-hold .ln { display: none; }
.battle.is-hold .ln.is-in { display: block; animation: rc-line .25s var(--ease); }
@keyframes rc-line { from { opacity: 0; transform: translateX(-6px); } }
.play-wait { display: none !important; }
.play-skip {
  justify-self: end; display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; color: var(--text-sub); font: inherit; font-size: 14px; cursor: pointer; padding: 4px 2px;
}
html:not(.in-frame) .only-frame { display: none !important; }
html.in-frame .only-page { display: none !important; }
.sticky-foot {
  position: sticky; bottom: 0; z-index: 5;
  margin: 0 calc(var(--gutter) * -1) -28px; padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, transparent);
  display: grid; gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 世界地図 (map.cgi) ---------- */
.wmap-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wmap-legend { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-sub); }
.wmap-zoom { margin-left: auto; display: inline-flex; gap: 4px; }
.wdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 4px; }
.wdot.here { background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent); }
.wdot.next { background: #3f4e6e; }   /* 地図の「行けるところ」は ダークでも 明るいときと同じ藍色 (現在地の金と区別。10-02) */
.wmap {
  position: relative; overflow: auto; max-height: 68vh; border-radius: 14px;
  border: 1px solid var(--line); background: #b89d6e; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.wmap.is-zoom { cursor: grab; }
.wmap.is-drag { cursor: grabbing; user-select: none; }
.wmap-inner { position: relative; width: 100%; }
.wmap-inner img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.wmap-name {
  position: absolute; transform: translate(-50%,-50%); pointer-events: none; white-space: nowrap;
  font-family: var(--font-title); font-size: clamp(12px, 3.2vw, 20px); letter-spacing: .15em; color: #3b2a14;
  text-shadow: 0 0 4px #f3e6c8, 0 0 8px #f3e6c8; opacity: .85;
}
.wmap-name.is-v { writing-mode: vertical-rl; }
.wpin {
  position: absolute; transform: translate(-50%,-50%); display: grid; justify-items: center; gap: 2px;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; z-index: 1;
}
.wpin-dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: rgba(40,30,20,.72); color: #f3e6c8; border: 2px solid #f3e6c8; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .15s var(--ease);
}
.wpin-label {
  font-size: 12px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 99px; white-space: nowrap;
  background: rgba(243,230,200,.92); color: #3b2a14; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.wpin.is-far .wpin-dot { opacity: .8; }
.wpin-dot { position: relative; }
.wpin-wx {
  position: absolute; top: -7px; right: -11px; width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
  background: #f3e6c8; border: 1px solid #3b2a14; box-shadow: 0 1px 2px rgba(0,0,0,.35); color: #3b2a14;
}
.wpin-wx.is-S { color: #b86a00; }
.wpin-wx.is-C { color: #5d5a55; }
.wpin-wx.is-R { color: #2f5f9e; }
.wpin-wx.is-H { color: #fff; background: #2f4a78; border-color: #1c2d4a; }
.wpin-wx.is-N { color: #3a78b0; background: #fff; }
.wpin.is-danger .wpin-dot { background: rgba(120,30,25,.8); }
.wpin.is-next .wpin-dot { background: #3f4e6e; color: #fbf6ea; border-color: #fff; box-shadow: 0 0 0 4px rgba(63,78,110,.4); }
.wpin.is-here { z-index: 2; }
.wpin.is-here .wpin-dot { background: var(--gold); color: #fff; border-color: #fff; animation: wpin-pulse 1.8s ease-in-out infinite; }
.wpin.is-sel .wpin-dot { transform: scale(1.18); }
.wpin.is-sel .wpin-label { background: #3b2a14; color: #f3e6c8; }
.wpin:hover .wpin-dot, .wpin:focus-visible .wpin-dot { transform: scale(1.15); }
.wpin:focus-visible { outline: none; }
@keyframes wpin-pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 60%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }

/* ---------- プレイヤーの絵 ---------- */
.avatar {
  flex: none; display: inline-block; border-radius: var(--r-sm); object-fit: cover; vertical-align: middle;
  background: #1a1d2b; border: 1px solid var(--line-strong);
}
.avatar-none { display: inline-grid; place-items: center; background: var(--surface-2); color: var(--text-sub); }
.avatar.is-dead, .portrait.is-dead { filter: grayscale(1) brightness(.7); }
.portrait {
  display: block; width: 160px; height: 210px; border-radius: var(--r-md); object-fit: cover;
  background: #1a1d2b; box-shadow: 0 0 0 1px var(--line-strong), var(--shadow);
}
.portrait-none {
  display: grid; place-content: center; justify-items: center; gap: 6px; font-size: 44px;
  background: var(--surface-2); color: var(--text-mute);
}
.portrait-none .small { font-size: 14px; }
.profile-head { display: flex; gap: 14px; align-items: flex-end; }
/* ホームの「自分」のくわしい画面 (library/main.cgi sheet-me。10-03) */
.me-top { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 12px; }
.me-pic { display: grid; gap: 6px; margin: 0; }
.me-pic .portrait { width: 100%; height: auto; aspect-ratio: 160 / 210; }
.me-pic .btn { width: 100%; padding-inline: 6px; gap: 4px; white-space: nowrap; font-size: 14px; }
.me-stats { display: grid; gap: 6px; }
.me-stats .stat { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; text-align: left; }
.me-stats .stat-label { font-size: 14px; }
.me-stats .stat-value { font-size: 18px; }
.kv2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0 0 12px; font-size: 15px; }
.kv2 > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.kv2 dt { color: var(--text-sub); white-space: nowrap; }
.kv2 dd { margin: 0; min-width: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv2 dd:empty::after { content: "—"; color: var(--text-mute); font-weight: 400; }
/* 図鑑の「手順を たどる」(library/guide.cgi guide_tree。10-03) */
.gtree { list-style: none; margin: 4px 0 0; padding: 0 0 0 14px; border-left: 1px dashed var(--line-strong); display: grid; gap: 6px; }
.gtree-box > .gtree { border-left: none; padding-left: 0; }
.gtree li { font-size: 15px; line-height: 1.5; }
.glink { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.glink .ti { margin-right: 3px; }
.gsrc { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.gmake { font-size: 14px; font-weight: 700; color: var(--text-sub); margin-top: 4px; }
.gneeds { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.gneed { display: inline-block; padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 13px; line-height: 1.6; color: var(--text-sub); }
.gneed.ok { border-color: var(--success); color: var(--success); }
.gtree-root > .gtree { border-left: none; padding-left: 0; }
.gok { color: var(--success, #6fbf73); font-weight: 700; }
.gng { color: var(--text-mute); }
.gpart { color: var(--warning, #d9a441); font-weight: 700; font-size: 13px; }
/* 図鑑の「やりたいこと」(library/guide.cgi guide_goals。10-03) */
/* 図鑑のタブ: 「やりたいこと」を 1段目いっぱいに、のこり6つは 3つずつ (画面の広さに かかわらず) */
.gtabs.gtabs-guide { grid-template-columns: repeat(3, 1fr); justify-content: stretch; }
.gtabs-guide .gtab:first-child { grid-column: 1 / -1; }
.goal-steps { margin: 4px 0 8px; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; line-height: 1.6; }
.goal-me { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); padding: 8px 10px; margin-bottom: 8px; display: grid; gap: 2px; }
.goal .row-sub { white-space: normal; }
@media (max-width: 360px) { .me-top { grid-template-columns: 120px minmax(0, 1fr); } }
.profile-head .portrait { flex: none; }
.chara-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; padding: 4px; }
.chara-pick { position: relative; display: block; cursor: pointer; aspect-ratio: 1; }
.chara-pick input { position: absolute; opacity: 0; pointer-events: none; }
.chara-pick img { width: 100%; height: 100%; border-radius: var(--r-sm); object-fit: cover; display: block; background: #1a1d2b; box-shadow: 0 0 0 2px var(--line); transition: box-shadow .15s var(--ease), transform .15s var(--ease); }
.chara-pick input:checked + img { box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px color-mix(in srgb, var(--gold) 35%, transparent); transform: scale(1.04); }
.chara-pick input:focus-visible + img { outline: 2px solid var(--primary); outline-offset: 3px; }
.row > .avatar { margin: 0; }

/* ホームの上の「自分」の行 (顔・名前) */
.me-row {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 0;
  background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.me-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.me-name { font-family: var(--font-title); font-size: 19px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-row > .ti { color: var(--text-mute); font-size: 18px; }

.avatar-btn { flex: none; background: none; border: 0; padding: 0; cursor: pointer; border-radius: var(--r-sm); line-height: 0; }
.avatar-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.talk > .avatar { margin-top: 2px; }

/* =========================================================
   ホーム (main.cgi): カードを並べず、1枚のゲーム画面として区切る
   ========================================================= */
.home .app-body { gap: 18px; padding-top: 14px; padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

/* 場所の見出し */
.place-head { padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 14px; border-bottom: 1px solid var(--line-strong); }
.place-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.place-kg { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-sub); letter-spacing: .08em; }
.place-tools { display: flex; margin-right: -8px; }
.place-tools form { margin: 0; }
.tool {
  position: relative; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 8px;
  border: 0; background: none; color: var(--text-sub); font: inherit; font-size: 15px; cursor: pointer; border-radius: var(--r-sm);
}
.tool .ti { font-size: 19px; }
.tool:active { background: color-mix(in srgb, var(--text) 8%, transparent); }
.tool .dot { position: absolute; top: 7px; left: 20px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.place-name { margin: 0; font-family: var(--font-title); font-size: 30px; font-weight: 600; line-height: 1.25; letter-spacing: .08em; }
.place-desc { margin: 2px 0 0; font-size: 15px; color: var(--text-sub); }
.place-sky { margin: 6px 0 0; font-size: 15px; line-height: 1.6; color: var(--text-sub); }
.sky-name { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; color: var(--text); font-weight: 600; white-space: nowrap; }
.sky-name .ti { font-size: 18px; color: var(--gold); }
.wx-note { display: inline-flex; align-items: baseline; gap: 5px; color: var(--text-sub); font-style: normal; }
.wx-note .ti { flex: none; font-size: 16px; color: var(--gold); transform: translateY(2px); }
/* 書かれた物を読む (小瓶の手紙など。use.cgi の read) */
.papertop, .paperbottom { display: none; }
.papercenter {
  margin: 8px 0; padding: 14px 16px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-family: var(--font-title); line-height: 1.9;
}
.place-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 8px; font-size: 14px; color: var(--text-sub); }
.meta { display: inline-flex; align-items: center; gap: 3px; }
.meta .ti { font-size: 14px; }
.meta.good { color: var(--success); }
.meta.warn { color: var(--gold); }
.meta.bad  { color: var(--danger); font-weight: 700; }

/* 自分: 顔と名前、その下に状態表 */
.me { display: grid; gap: 12px; padding-bottom: 16px; border-bottom: 1px dashed var(--line-strong); }
.me .me-row { margin: 0; }
.me .me-name { font-size: 20px; }
/* 名前の下の所持金 (main.cgi) */
.me-gold { display: inline-flex; align-items: center; gap: 2px; margin-left: 10px; color: var(--gold); font-weight: 700; white-space: nowrap; }
.me-gold .ti { font-size: 14px; }
/* お金が増えるあいだ、数字が少しふくらんで光る (rc-ui.js countUp) */
.gold-line { margin: 8px 2px 0; color: var(--text-sub); }
.gold-up { display: inline-block; transform: scale(1.12); text-shadow: 0 0 8px color-mix(in srgb, var(--gold) 55%, transparent); transition: transform .2s var(--ease); font-variant-numeric: tabular-nums; }
.me-more { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; color: var(--text-mute); flex: none; }
.me-more .ti { font-size: 15px; }
.vitals { gap: 8px; }
.vitals .gauge {
  display: grid; grid-template-columns: 4.8em 1fr 4.9em; grid-template-areas: "label bar value" ". note note";
  align-items: center; column-gap: 10px;
}
.vitals .gauge-head { display: contents; }
.vitals .gauge-label { grid-area: label; font-size: 15px; }
.vitals .gauge-label .ti { color: var(--text-mute); }
.vitals .gauge-bar { grid-area: bar; margin: 0; height: 7px; }
.vitals .gauge-value { grid-area: value; text-align: right; font-size: 14px; }
.vitals .gauge-value b { font-size: 16px; }
.vitals .gauge-note { grid-area: note; margin-top: 0; }

/* お知らせは箱にしない */
.home .log { background: none; padding: 2px 0 2px 12px; font-size: 15px; }
.home .log::before { top: 3px; bottom: 3px; }

/* 見出し (左右に罫線) */
.rule-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px;
  font-family: var(--font-title); font-size: 16px; font-weight: 600; letter-spacing: .06em;
}
.rule-title::before, .rule-title::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

/* 町でできること: 2列のコマンド表 (箱ではなく罫線で区切る) */
.cmd-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.cmd-grid > form { display: flex; margin: 0; border-bottom: 1px solid var(--line); }
.cmd-grid > form:nth-child(odd) { border-right: 1px solid var(--line); }
.cmd-item {
  flex: 1; display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; align-items: center;
  min-height: 58px; padding: 8px 10px 8px 4px;
  border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.cmd-item:active { background: color-mix(in srgb, var(--text) 7%, transparent); }
.cmd-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.cmd-ic { grid-row: 1 / 3; justify-self: center; font-size: 22px; color: var(--text-sub); }
.cmd-ic.gold  { color: var(--gold); }
.cmd-ic.green { color: var(--success); }
.cmd-ic.red   { color: var(--danger); }
.cmd-name { font-weight: 700; font-size: 16px; line-height: 1.3; }
.cmd-sub  { font-size: 14px; line-height: 1.35; color: var(--text-mute); }

.guide-links { margin: 0; font-size: 15px; line-height: 2; color: var(--text-sub); }
.guide-links .ti { margin-right: 4px; }
.guide-links .link-btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--primary); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); text-underline-offset: 3px; }   /* 職業の道の図鑑 (POST で開く。10-05) */
.guide-links a { color: var(--primary); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); text-underline-offset: 3px; }

/* 下: 探索する + 荷物・自分・メニュー */
.command-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  padding: 10px var(--gutter) calc(4px + env(safe-area-inset-bottom));
  background: var(--bg-deep); border-top: 1px solid var(--line-strong);
  display: grid; gap: 4px;
}
.cmd-explore {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 54px;
  border: 1px solid var(--cmd-press); border-radius: var(--r-md);
  background: var(--cmd); color: var(--on-cmd); cursor: pointer;
  font-family: var(--font-title); font-size: 20px; font-weight: 600; letter-spacing: .25em;
  /* 内側にもう1本の細い線 (額縁) */
  box-shadow: inset 0 0 0 3px var(--cmd), inset 0 0 0 4px color-mix(in srgb, var(--on-cmd) 30%, transparent), 0 2px 0 var(--cmd-press);
}
.cmd-explore .ti { font-size: 22px; }
.cmd-explore:active { transform: translateY(2px); box-shadow: inset 0 0 0 3px var(--cmd), inset 0 0 0 4px color-mix(in srgb, var(--on-cmd) 30%, transparent); }
.cmd-explore:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 幽体・石化・宿のあいだ (main.cgi) */
.cmd-explore:disabled {
  cursor: not-allowed; background: var(--surface-2); color: var(--text-mute); border-color: var(--line-strong);
  box-shadow: none; font-size: 15px; letter-spacing: .05em; transform: none;
}

/* ---------- 動けない状態の札 (幽体・石化・宿。main.cgi main_state_card) ---------- */
.state-badge {
  display: inline-flex; align-items: center; gap: 3px; width: fit-content;
  padding: 1px 8px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--st-soft); color: var(--st);
}
.state-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: var(--r-md);
  background: var(--st-soft); border: 1px solid color-mix(in srgb, var(--st) 35%, transparent);
  animation: rc-in .35s var(--ease);
}
.state-icon {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--st); font-size: 28px;
}
.state-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.state-title { font-family: var(--font-title); font-size: 19px; font-weight: 700; color: var(--st); }
.state-text { margin: 0; line-height: 1.7; }
.state-clock { margin: 0; font-weight: 700; }
.state-clock:empty { display: none; }
.state-main p.small { margin: 0; }
.state-main form { margin-top: 4px; }
.is-ghost { --st: #6a6fa8; --st-soft: #e7e6f2; }
.is-stone { --st: #7a7466; --st-soft: #e9e5dc; }
.is-rest  { --st: var(--primary); --st-soft: var(--info-soft); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .is-ghost { --st: #aeb3ea; --st-soft: #262538; }
  :root:not([data-theme="light"]) .is-stone { --st: #c4bca9; --st-soft: #2a2721; }
}
:root[data-theme="dark"] .is-ghost { --st: #aeb3ea; --st-soft: #262538; }
:root[data-theme="dark"] .is-stone { --st: #c4bca9; --st-soft: #2a2721; }
.state-card.is-ghost .state-icon .ti { animation: sc-bob 1.6s ease-in-out infinite alternate; }
/* 幽体の顔・全身の絵: 少しすけて、ふわふわ */
.avatar.is-ghost, .portrait.is-ghost { filter: grayscale(.8) brightness(1.05) opacity(.6); animation: rc-ghost 2.4s ease-in-out infinite alternate; }
@keyframes rc-ghost { from { transform: translateY(1px); } to { transform: translateY(-3px); } }
.cmd-menu { display: grid; grid-template-columns: repeat(3, 1fr); }
.cmd-menu-item {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px;
  border: 0; background: none; color: var(--text-sub); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.cmd-menu-item .ti { font-size: 19px; }
.cmd-menu-item.sep { border-left: 1px solid var(--line); }
.cmd-menu-item:active { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }

/* ---------- 試合の始まりのカットイン (闘技場) ---------- */
.cutin {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer;
  background: rgba(15, 10, 5, .62);
  animation: cutin-bg 1.9s ease forwards;
}
.cutin-band {
  position: relative; width: 100%; max-width: 640px; aspect-ratio: 800 / 340; overflow: hidden;
  animation: cutin-band 1.9s cubic-bezier(.2,.8,.2,1) forwards;
}
.cutin-band img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cutin-text {
  position: absolute; right: 5%; top: 50%; transform: translateY(-50%);
  display: grid; gap: 2px; justify-items: end; text-align: right;
  color: #f4e9cf; text-shadow: 0 2px 0 rgba(0,0,0,.65), 0 0 8px rgba(0,0,0,.5);
  animation: cutin-text 1.9s ease forwards;
}
.cutin-step { font-size: 12px; letter-spacing: .1em; color: #d9b064; }
.cutin-name { font-family: var(--font-title); font-size: clamp(22px, 6.5vw, 34px); font-weight: 600; letter-spacing: .08em; line-height: 1.2; }
.cutin-vs { font-size: 13px; font-weight: 700; }
@keyframes cutin-bg   { 0% { opacity: 0; } 8% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes cutin-band { 0% { transform: translateX(-110%); } 18% { transform: none; } 80% { transform: none; } 100% { transform: translateX(110%); } }
@keyframes cutin-text { 0%, 16% { opacity: 0; transform: translate(40px, -50%); } 32% { opacity: 1; transform: translate(0, -50%); } 100% { opacity: 1; transform: translate(0, -50%); } }
@media (prefers-reduced-motion: reduce) { .cutin { display: none; } }

/* 相手にも絵があるとき: 上に自分、下に相手 (右から入る・左右反転)、あいだに VS */
.cutin.is-vs { align-content: center; gap: 6px; }
.cutin-band.is-right { animation-name: cutin-band-r; animation-delay: .12s; animation-fill-mode: both; }
.cutin-band.is-right img { transform: scaleX(-1); }
.cutin-text.is-left { left: 5%; right: auto; justify-items: start; text-align: left; }
.cutin-vsmark {
  font-family: var(--font-title); font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: .1em;
  color: #d9b064; text-shadow: 0 2px 0 rgba(0,0,0,.7);
  animation: cutin-vs 1.9s ease both;
}
@keyframes cutin-band-r { 0% { transform: translateX(110%); } 18% { transform: none; } 80% { transform: none; } 100% { transform: translateX(-110%); } }
@keyframes cutin-vs { 0%, 20% { opacity: 0; transform: scale(1.6); } 32% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- はじめての手引き (コモレ村のマーサ。library/tutorial.cgi) ---------- */
.tu-card {
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 8px;
  animation: rc-in .35s var(--ease);
}
.tu-head { display: flex; align-items: center; gap: 8px; }
.tu-face {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); color: var(--gold); font-size: 20px;
}
.tu-name { font-family: var(--font-title); font-weight: 600; font-size: 17px; letter-spacing: .06em; }
.tu-dots { margin-left: auto; display: flex; gap: 5px; }
.tu-dot { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, var(--gold) 25%, transparent); }
.tu-dot.done { background: var(--gold); }
.tu-dot.now  { background: var(--surface); box-shadow: 0 0 0 2px var(--gold); }
.tu-words { margin: 0; font-size: 16px; line-height: 1.75; }
.tu-todo { font-size: 15px; font-weight: 700; color: var(--gold); display: flex; gap: 6px; align-items: baseline; }
.tu-say { margin: 8px 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--gold-soft); line-height: 1.75; }
.tu-say .ti { color: var(--gold); margin-right: 4px; }

/* ---------- はじめての施設のひとこと (library/hello.cgi) ---------- */
.hello {
  max-width: 640px; margin: 14px auto 0; padding: 12px 14px; border-radius: var(--r-md);
  width: calc(100% - var(--gutter) * 2); box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; gap: 8px; animation: rc-in .35s var(--ease);
}
.hello-head { display: flex; align-items: center; gap: 8px; }
.hello-face {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); color: var(--gold); font-size: 18px; border: 1px solid var(--line);
}
.hello-name { font-weight: 700; font-size: 15px; color: var(--text-sub); }
.hello-words { margin: 0; font-size: 16px; line-height: 1.75; }
.hello-ok { justify-self: end; }

/* コレクション (library/collect.cgi。10-03) */
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.col-it { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); font-size: 12px; text-align: center; line-height: 1.35; opacity: .8; }
.col-it > i { font-size: 22px; opacity: .45; }
.col-it .col-hint { font-size: 10.5px; opacity: .8; }
.col-it.got { border: 1px solid var(--gold); background: var(--gold-soft); opacity: 1; font-weight: 600; }
.col-it.got > i { color: var(--gold); opacity: 1; }
.col-set { position: relative; }
.col-set.done { border: 2px solid var(--gold); }
.col-set.done .col-grid { margin-top: 2px; }
.col-stamp { position: absolute; top: 8px; right: 10px; padding: 1px 8px; border: 2px solid var(--gold); border-radius: 6px; color: var(--gold); font-weight: 700; font-size: 13px; transform: rotate(-10deg); background: var(--surface); }
.col-set.fresh .col-it.got { animation: col-pop .7s var(--ease) both; animation-delay: calc(var(--i) * 90ms); }
.col-set.fresh .col-stamp { animation: col-stamp .45s .9s both; }
@keyframes col-pop { 0% { transform: scale(.7); filter: grayscale(1); opacity: .4; } 60% { transform: scale(1.1); } 100% { transform: none; filter: none; opacity: 1; } }
@keyframes col-stamp { from { opacity: 0; transform: rotate(-10deg) scale(2.4); } to { opacity: 1; transform: rotate(-10deg) scale(1); } }
.col-note { display: grid; gap: 8px; margin: 6px 0; padding: 10px; border: 2px solid var(--gold); border-radius: var(--r-md); background: var(--surface); }
.col-note .col-set { padding-top: 26px; }
@media (prefers-reduced-motion: reduce) { .col-set.fresh .col-it.got, .col-set.fresh .col-stamp { animation: none; } }

/* 家の置き場所の入れかえ (library/house.cgi house_grid・rc-ui.js houseSwap。10-03) */
.house-grid[data-swap] .house-cell { cursor: pointer; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.house-grid[data-swap] .house-cell:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.house-cell > .house-in { height: 100%; box-sizing: border-box; transition: transform .15s var(--ease), background-color .15s; }
.house-cell.sel > .house-in { outline: 3px solid var(--gold); outline-offset: -1px; background: var(--gold-soft); transform: translateY(-2px); opacity: 1; }

/* スポットライト (library/spot.cgi・rc-ui.js spotInit。10-03) */
.spot { position: fixed; inset: 0; z-index: 200; cursor: pointer; }
.spot-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62); outline: 2px solid var(--gold); pointer-events: none; transition: left .2s var(--ease), top .2s var(--ease), width .2s, height .2s; }
.spot-tip { position: fixed; box-sizing: border-box; padding: 10px 12px; border: 2px solid var(--gold); border-radius: var(--r-md); background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: default; animation: spot-in .25s var(--ease) both; }
.spot-tip p { margin: 6px 0 8px; line-height: 1.6; }
.spot-who { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.spot-who i { color: var(--gold); }
@keyframes spot-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .spot-tip { animation: none; } .spot-hole { transition: none; } }

/* ゲームの時計「夜 あと6分」(library/base.cgi game_clock_tag・rc-ui.js gameClock。10-03) */
.gclock { display: inline-flex; align-items: center; gap: 4px; margin: 0 8px; font-size: 12px; color: var(--text-sub); white-space: nowrap; }
.gclock b { font-weight: 700; }
.gclock-left { margin-left: 2px; }
