/* ほりほり工場：見た目（デザイン）はこのファイルの変数で決める。ゲームの機能（main.js）とは分けてある */
:root {
  --hdr: 80px; --edge: 26px; --dash: 0px;
  /* 明るい配色：白とグレーが基本。色は「お金（アクセント）」と「選択」だけ */
  --bg: #e6e6e3;
  --glass: rgba(250, 250, 248, .84);     /* ヘッダー・メニューの背景（半透明） */
  --glass2: rgba(252, 252, 250, .97);    /* パネルの背景 */
  --line: rgba(0, 0, 0, .09);            /* 細い線 */
  --line2: rgba(0, 0, 0, .18);
  --text: #2b2b2e;                       /* 文字（濃いグレー） */
  --sub: #77767a;                        /* 補足の文字 */
  --accent: #d0661f;                     /* お金・値段（オレンジ） */
  --sel: #2b2b2e;                        /* 選択中（黒っぽいグレー） */
  --selbg: #2b2b2e;
  --bad: #c0392b;
  --good: #4f8a5b;
  --radius: 4px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-user-select: none; user-select: none; letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

/* ゲーム画面は全面。ヘッダーやメニューは半透明で上に重なる */
#cv { position: fixed; inset: 0; width: 100vw; height: 100%; display: block; touch-action: none; }
#cv.grab { cursor: grab; }
#cv.grabbing { cursor: grabbing; }
#cv.place { cursor: crosshair; }

/* ヘッダー */
#hdr {
  position: fixed; top: 0; left: 0; right: 0; height: var(--hdr); z-index: 30;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 2px 10px;
  background: var(--glass); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  white-space: nowrap; overflow: hidden;
}
.hrow { display: flex; align-items: center; gap: 10px; min-width: 0; }
#timeGroup { gap: 4px; }
/* タイトル（ワードマーク） */
#hdr .brand { display: flex; align-items: baseline; gap: 6px; cursor: pointer; }
#hdr .title { font-size: 15px; font-weight: 600; letter-spacing: .08em; }
#hdr .wm { font-size: 9px; letter-spacing: .32em; color: var(--sub); font-weight: 500; }
#hdr small { color: var(--sub); font-size: 10px; letter-spacing: .05em; }
#hdr .stat { font-size: 13px; color: var(--sub); display: flex; align-items: baseline; gap: 5px; }
#hdr .stat b { color: var(--accent); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
#hdr .stat b.neg { color: var(--bad); }
#hdr #date { color: var(--text); font-variant-numeric: tabular-nums; }
#hdr .grow { flex: 1; }
#hdr button { padding: 5px 9px; }
#hdr .icon { font-size: 15px; padding: 3px 8px; }
.sm { display: none; }
/* はみ出したら段階的に詰める（main.js の fitHeader が実際の幅を測って c1→c2→c3 を付ける） */
#hdr.c1 small, #hdr.c1 .wm { display: none; }
#hdr.c1 .hrow { gap: 6px; }
#hdr.c2 .lg { display: none; } #hdr.c2 .sm { display: inline; }
#hdr.c3 { padding: 2px 6px; }
#hdr.c3 .title { font-size: 13px; letter-spacing: .04em; }
#hdr.c3 .stat { font-size: 11px; } #hdr.c3 .stat b { font-size: 13px; }
#hdr.c3 .hrow { gap: 5px; } #hdr.c3 #timeGroup { gap: 3px; }
#hdr.c3 button { padding: 5px 6px; font-size: 12px; } #hdr.c3 button.sq { width: 26px; }

.float {
  position: fixed; z-index: 10;
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
[hidden] { display: none !important; }
.group { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
.sep { width: 1px; height: 20px; background: var(--line2); margin: 0 3px; }
.lab { color: var(--sub); font-size: 12px; }

/* ボタン：細い線・平ら */
button {
  background: #ffffff; color: var(--text); border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 6px 10px; font-size: 13px; cursor: pointer; font-family: inherit; letter-spacing: .03em; touch-action: manipulation;
  transition: background .12s, border-color .12s;
}
button:hover { background: #f1f1ef; }
button:disabled { opacity: .35; cursor: default; }
button small { color: var(--accent); font-variant-numeric: tabular-nums; margin-left: 2px; }
button.active { background: var(--selbg); border-color: var(--sel); color: #fff; }
button.active small { color: #f3b27e; }
button.x { padding: 2px 8px; font-size: 12px; border-color: var(--line); }
button.sq { width: 30px; padding: 6px 0; }
button.dir { width: 34px; padding: 6px 0; }
button.test { border-style: dashed; color: #9a6a3a; }
button.hand { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; }
.play { min-width: 62px; }

/* 移動：画面の端の帯（押している間動く）。中の小さなボタンは目印 */
.mv { position: fixed; z-index: 9; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: pointer; }
.mv:active { background: rgba(0,0,0,.05); }
#mvUp { top: var(--hdr); left: 0; right: 0; height: var(--edge); }
#mvDown { bottom: 0; left: 0; right: 0; height: var(--edge); }
#mvLeft { top: calc(var(--hdr) + var(--edge)); bottom: var(--edge); left: 0; width: var(--edge); }
#mvRight { top: calc(var(--hdr) + var(--edge)); bottom: var(--edge); right: 0; width: var(--edge); }
.mvb {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 20px; font-size: 9px; line-height: 1;
  background: rgba(255,255,255,.7); border: 1px solid var(--line2); border-radius: var(--radius); color: #555;
  pointer-events: none;
}
#mvLeft .mvb, #mvRight .mvb { width: 20px; height: 34px; }
#dirBar { right: calc(var(--edge) + 4px); flex-wrap: nowrap; width: max-content; }

/* 下のメニュー */
#menuBtn { bottom: calc(var(--edge) + 4px); right: calc(var(--edge) + 4px); padding: 9px 18px; font-size: 13px; letter-spacing: .12em; }
#menuCur { color: var(--sel); margin-left: 6px; font-size: 12px; letter-spacing: .02em; }
#menuCur:empty { display: none; }
#catBar { bottom: calc(var(--edge) + 4px); right: calc(var(--edge) + 4px); width: max-content; max-width: calc(100vw - var(--edge) * 2 - 8px); justify-content: flex-end; }
#subMenu { right: calc(var(--edge) + 4px); width: max-content; max-width: calc(100vw - var(--edge) * 2 - 8px); justify-content: flex-end; }
#subMenu { flex-direction: column; align-items: stretch; gap: 6px; }
/* 設置：左に項目（ドリル・コンベア・機械）、右にその種類（縮小した絵つき） */
.brow { display: flex; align-items: flex-start; gap: 6px; }
.brow .grp { min-width: 5.5em; text-align: left; }
.brow .grp.open { border-color: var(--sel); }
.types { display: flex; flex-wrap: wrap; gap: 4px; }
#subMenu .si { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; min-width: 64px; max-width: 120px; text-align: center; }
#subMenu .si .nm { font-size: 11px; line-height: 1.3; }
#subMenu .si .rec { font-size: 9px; color: var(--sub); line-height: 1.3; }
#subMenu .si.active .rec { color: #ddd; }
canvas.thumb { width: 30px; height: 30px; image-rendering: pixelated; }
.lockNote { font-size: 11px; color: var(--sub); padding: 2px 4px; }
button.cat.open { border-color: var(--sel); }

.msg {
  position: fixed; top: calc(var(--hdr) + 32px); left: 50%; transform: translateX(-50%); margin: 0; z-index: 40;
  color: var(--text); font-size: 13px; background: var(--glass2); padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--line2); border-left: 3px solid var(--accent);
  pointer-events: none; white-space: nowrap; max-width: calc(100vw - 20px); overflow: hidden; text-overflow: ellipsis;
}
.msg:empty { display: none; }
#curTool { left: calc(var(--edge) + 4px); bottom: calc(var(--edge) + 4px); font-size: 12px; color: var(--text); border-left: 3px solid var(--sel); pointer-events: none; }

/* パネル */
.panel { top: calc(var(--hdr) + var(--edge) + 4px); right: 8px; width: min(390px, calc(100vw - 16px)); max-height: calc(100% - var(--hdr) - 80px); overflow: auto; z-index: 20; background: var(--glass2); padding: 10px 12px; }
.panel.bottom { top: auto; right: calc(var(--edge) + 4px); }
.panel.drag .handle { cursor: move; touch-action: none; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; padding-bottom: 6px; font-size: 13px; letter-spacing: .1em; border-bottom: 1px solid var(--line); }
.sub { font-size: 12px; color: var(--sub); line-height: 1.6; }
.row2 { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.row2 .name { font-weight: 600; font-size: 13px; }
.row2 .spec { font-size: 11px; color: var(--sub); grid-column: 1; line-height: 1.5; }
.row2 button { grid-row: 1 / span 2; grid-column: 2; }
.credit { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: var(--sub); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.credit a { color: var(--sel); text-decoration: none; }
.wide { width: 100%; margin-top: 6px; }
.secT { margin: 12px 0 2px; font-size: 11px; font-weight: 600; color: var(--sub); letter-spacing: .14em; }
.bar { height: 3px; background: rgba(0,0,0,.08); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; background: var(--good); }

/* 遊び方：2ペイン（左に項目・右に説明） */
#help { width: min(640px, calc(100vw - 16px)); }
.help2 { display: grid; grid-template-columns: 9em 1fr; gap: 12px; min-height: 240px; }
#helpNav { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); padding-right: 8px; }
#helpNav button { text-align: left; border-color: transparent; background: none; padding: 6px 8px; font-size: 12px; }
#helpNav button.active { background: var(--selbg); border-color: var(--sel); color: #fff; }
#helpBody h3 { margin: 2px 0 8px; font-size: 14px; letter-spacing: .08em; font-weight: 600; }
#helpBody p { margin: 0 0 8px; font-size: 13px; line-height: 1.75; color: var(--text); }
@media (max-width: 560px) {
  .help2 { grid-template-columns: 1fr; }
  #helpNav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 6px; }
}

/* 情報 */
.data { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; margin-bottom: 8px; }
.data span:nth-child(odd) { color: var(--sub); }
.data span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.graph { width: 100%; height: 90px; display: block; background: rgba(0,0,0,.04); border-radius: var(--radius); margin: 3px 0 8px; }

/* 縮小地図 */
#mapPanel { top: calc(var(--hdr) + var(--edge) + 4px); left: calc(var(--edge) + 4px); z-index: 15; padding: 5px 7px 7px; }
#mapPanel .handle { cursor: move; touch-action: none; }
#mapCv { display: block; touch-action: none; cursor: pointer; border-radius: 2px; }

.btn2 { display: flex; gap: 4px; grid-row: 1 / span 2; grid-column: 2; }
.btn2 button { padding: 5px 9px; }
/* 調整パネル */
.tuneRow { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); font-size: 12px; }
.tuneRow input { grid-column: 1 / span 2; width: 100%; accent-color: var(--sel); }
.tuneRow b { font-variant-numeric: tabular-nums; font-weight: 500; }
.tuneRow b.chg { color: var(--accent); }
.tuneOut { width: 100%; height: 120px; margin-top: 6px; font-size: 11px; background: #fff; color: var(--text); border: 1px solid var(--line2); border-radius: var(--radius); -webkit-user-select: text; user-select: text; }
.adminGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.adminGrid button { width: 100%; }

/* タップメニュー */
#pop { display: flex; flex-direction: column; gap: 6px; width: min(262px, calc(100vw - 16px)); z-index: 25; background: var(--glass2); padding: 8px 10px; }
#pop .head { margin: 0; }
.prow { display: flex; gap: 4px; }
#popDirs button { width: 42px; height: 32px; padding: 0; font-size: 15px; }
/* ラベル固定列＋右側で折り返し */
.prow.labeled { display: grid; grid-template-columns: 5.5em 1fr; align-items: start; font-size: 12px; margin: 4px 0; }
.prow.labeled .lab { padding-top: 6px; }
.prow .opts { display: flex; gap: 4px; flex-wrap: wrap; }
.prow .opts button { padding: 4px 7px; font-size: 11px; }
#pop .wide { margin-top: 0; }
.lvline { color: var(--accent); }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; }
.modal .box { background: var(--glass2); border: 1px solid var(--line2); border-radius: var(--radius); padding: 18px 20px; width: min(320px, calc(100vw - 32px)); }
.modal p { margin: 0 0 16px; font-size: 14px; line-height: 1.6; }
.modal .btns { display: flex; justify-content: flex-end; gap: 8px; }
.modal .btns button { min-width: 84px; padding: 8px 12px; }

/* ===== 試験：下のタブと引き出し（body.dash のときだけ）=====
   書類フォルダの見出しのように、タブを下に並べる。押すとその上に引き出しが伸び、左上に取っ手が付く。
   影や立体の縁は付けない（平らな紙と細い線） */
body.dash { --dash: 50px; --paper: #f3f2ee; --paper2: #ffffff; }
body.dash #menuBtn, body.dash #catBar { display: none !important; }
body.dash #cv { height: calc(100% - var(--dash)); }
body.dash #mvDown { bottom: var(--dash); }
body.dash #mvLeft, body.dash #mvRight { bottom: calc(var(--dash) + var(--edge)); }
body.dash #curTool { bottom: calc(var(--dash) + var(--edge) + 4px); }
#dash {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--dash); z-index: 30;
  display: flex; align-items: flex-end; gap: 3px; padding: 0 6px;
  background: var(--glass); border-top: 1px solid var(--line2);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#dash[hidden] { display: none; }
/* タブ1枚＝見出し付きの書類。左上の小さな出っ張りが取っ手 */
#dash .dtab {
  position: relative; flex: 1; min-width: 0; height: 40px; margin-top: 8px; padding: 2px 4px 0;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  background: var(--paper); color: var(--text); text-align: left;
  border: 1px solid var(--line2); border-bottom: none; border-radius: 0 3px 0 0;
  transition: background .12s, transform .15s;
}
#dash .dtab::before {   /* 取っ手 */
  content: ""; position: absolute; left: -1px; top: -8px; width: 46%; height: 8px;
  background: inherit; border: 1px solid var(--line2); border-bottom: none; border-radius: 3px 3px 0 0;
}
#dash .dtab[hidden] { display: none; }
#dash .dtab b { font-weight: 600; font-size: 13px; letter-spacing: .06em; padding-left: 4px; }
#dash .dtab i { font-style: normal; font-size: 7.5px; letter-spacing: .22em; color: var(--sub); padding-left: 4px; white-space: nowrap; overflow: hidden; }
#dash .dtab:hover { background: #fbfaf7; }
#dash .dtab.cur b { color: var(--accent); }                      /* その中の道具を選んでいる */
#dash .dtab.open { background: var(--paper2); transform: translateY(-3px); z-index: 2; }   /* 引き出しを開いている */
#dash .dtab.open::before { visibility: hidden; }                  /* 取っ手は引き出しの上へ移る */
html[lang=en] #dash .dtab i { display: none; }
/* 引き出し：タブの上から上へ伸びる（設置・施設・工事の種類／強化・スキルのパネル） */
body.dash #subMenu, body.dash .panel.bottom {
  left: 0; right: 0; width: auto; max-width: none; border-radius: 0;
  background: var(--paper2); border: none; border-top: 1px solid var(--line2);
  box-shadow: none; padding: 10px 12px;
  animation: drawerUp .24s ease-out;   /* タブの後ろから上へせり出す */
}
body.dash #subMenu { align-items: flex-start; }
body.dash .panel.bottom { max-height: calc(100% - var(--hdr) - var(--dash) - 40px); }
@keyframes drawerUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes handleUp { from { transform: translateY(var(--dh, 100px)); } to { transform: none; } }   /* 取っ手も引き出しと同じ距離・同じ速さで動く */
#dHandle {
  position: fixed; z-index: 21; height: 22px; padding: 0 12px 0 10px;
  display: flex; align-items: baseline; gap: 8px; line-height: 22px;
  background: var(--paper2); border: 1px solid var(--line2); border-bottom: none; border-radius: 4px 4px 0 0;
  pointer-events: none;
}
#dHandle[hidden] { display: none; }
#dHandle.go { animation: handleUp .24s ease-out; }
#dHandle b { font-size: 12px; font-weight: 600; letter-spacing: .08em; }
#dHandle i { font-style: normal; font-size: 8px; letter-spacing: .24em; color: var(--sub); }
html[lang=en] #dHandle i { display: none; }
body.dash .panel.bottom > .head { display: none; }   /* 名前は取っ手に出ている。閉じるのはタブをもう一度押す */

/* ヘッダー2段目を畳む（▴▾ボタン） */
body.hfold { --hdr: 42px; }
body.hfold #timeGroup { display: none; }
#hdr .fold { font-size: 11px; padding: 4px 8px; color: var(--sub); }
#unfoldBtn {   /* 畳んだ2段目の右端に、ヘッダーから垂れたつまみ */
  position: fixed; z-index: 31; top: calc(var(--hdr) - 1px); right: 10px;
  font-size: 11px; padding: 1px 10px 3px; color: var(--sub);
  background: var(--glass); border: 1px solid var(--line2); border-top: none; border-radius: 0 0 5px 5px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#unfoldBtn[hidden] { display: none; }
/* 資金：ゲーム画面の左上。白いふちどりで、空でも土でも読める */
#moneyHud {
  position: fixed; z-index: 12; top: calc(var(--hdr) + 6px); left: 10px; pointer-events: none;
  display: flex; align-items: baseline; gap: 6px; color: var(--text); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 0 0 6px rgba(255,255,255,.9);
}
#moneyHud span { font-size: 11px; color: #55545a; letter-spacing: .08em; }
#moneyHud b { font-size: 21px; font-weight: 700; color: var(--text); letter-spacing: .03em; }
#moneyHud b.neg { color: var(--bad); }
/* 下のタブのときは、情報も引き出しになる（ヘッダーの情報ボタンは隠す） */
body.dash #infoBtn { display: none; }

/* 情報：まとまり（お金・累計・現場）ごとに小さな見出しと線。幅に合わせて2〜3列 */
.igrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin-bottom: 10px; }
.igraphs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.igrp .ihead { font-size: 10px; letter-spacing: .2em; color: var(--sub); padding-bottom: 3px; margin-bottom: 4px; border-bottom: 1px solid var(--line2); }
.igrp .data { margin: 0; gap: 3px 10px; }
.igrp .data b { font-weight: 600; font-size: 14px; }
.igrp .data .pos { color: var(--good); }
.igrp .data .neg { color: var(--bad); }
.igrp .graph { margin: 2px 0 4px; height: 80px; }

/* 遊び方：選択の印（黒い四角）が項目の間を滑って移る */
#helpNav { position: relative; }
#helpNav .hmark { position: absolute; left: 0; top: 0; background: var(--selbg); border-radius: var(--radius); transition: transform .22s ease, width .22s ease, height .22s ease; pointer-events: none; }
#helpNav button { position: relative; z-index: 1; transition: color .22s; }
#helpNav button.active { background: none; border-color: transparent; color: #fff; }

#timeGroup .zl { font-size: 11px; margin-right: -1px; }
#speedBtn[hidden] { display: none; }

/* 情報：財務／履歴 */
.itabs { display: flex; gap: 4px; margin-bottom: 10px; }
.itabs button { padding: 4px 14px; font-size: 12px; }
.ihist { font-size: 12px; line-height: 1.6; }
.ihist .hrow2 { display: grid; grid-template-columns: 6.5em 1fr; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ihist .hrow2 span:first-child { color: var(--sub); font-variant-numeric: tabular-nums; }
/* タイトル画面：上は空、下に地上（ゲーム画面がそのまま見える） */
body.title #hdr, body.title #dash, body.title #moneyHud, body.title .mv, body.title #unfoldBtn,
body.title #curTool, body.title #dirBar, body.title #subMenu, body.title #dHandle { display: none !important; }
body.title #cv { height: 100%; }
body.title .panel { z-index: 45; }
#title { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
#title[hidden] { display: none; }
#title .tbox { text-align: center; }
#title .tname { margin: 0; font-size: 38px; font-weight: 700; letter-spacing: .14em; color: #fff; text-shadow: 0 2px 0 rgba(30,60,90,.18); }
#title .tsub { margin: 6px 0 30px; font-size: 10px; letter-spacing: .5em; color: rgba(255,255,255,.9); }
#title .tmenu { display: flex; flex-direction: column; gap: 10px; width: 210px; margin: 0 auto; }
#title .tmenu button { padding: 11px; font-size: 15px; letter-spacing: .2em; background: rgba(255,255,255,.94); }
#title .tmenu button[hidden] { display: none; }
#title .tlang { margin-top: 18px; display: flex; gap: 6px; justify-content: center; }
#title .tlang button { font-size: 11px; padding: 4px 8px; background: rgba(255,255,255,.6); }
#title .tlang button.active { background: var(--selbg); color: #fff; }
#title .tfoot { margin-top: 16px; font-size: 10px; letter-spacing: .1em; color: rgba(255,255,255,.9); }
.awaybar { height: 6px; margin: 0 0 14px; }

.mv[hidden] { display: none; }

/* 取引 */
.adScreen { height: 120px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; background: #2b2b2e; color: #c8c8c4; border-radius: 4px; letter-spacing: .2em; font-size: 13px; }
#boostHud { display: block; font-size: 10px; color: var(--accent); letter-spacing: .04em; margin-left: 2px; }
#moneyHud { flex-wrap: wrap; }
#boostHud:empty { display: none; }

/* ===== v0.40 ===== */
/* お知らせ：スマホでもはみ出さず、折り返す */
.msg { white-space: normal; width: max-content; max-width: calc(100vw - 24px); text-align: center; line-height: 1.5; text-overflow: clip; }
/* 選択中の道具（左下）：押すと選択が外れる */
#curTool { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 8px; padding-right: 4px; }
#curTool .ctx { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--line2); border-radius: var(--radius); background: #fff; font-size: 11px; color: var(--sub); }
/* ▼の帯は、下のタブと少し離す（押し間違い防止） */
body.dash #mvDown { bottom: calc(var(--dash) + 14px); }
body.dash #mvLeft, body.dash #mvRight { bottom: calc(var(--dash) + var(--edge) + 14px); }
/* 引き出しを閉じる×（右上） */
#dClose { position: fixed; z-index: 21; right: 8px; height: 24px; padding: 0 10px; background: var(--paper2, #fff); border: 1px solid var(--line2); border-bottom: none; border-radius: 4px 4px 0 0; }
#dClose[hidden] { display: none; }
/* 情報：引き出しで選ぶので、中のタブは出さない */
body.dash #info .itabs { display: none; }
#subMenu .ipick { gap: 6px; }
#subMenu .ipick button { min-width: 96px; padding: 10px 14px; font-size: 13px; letter-spacing: .08em; }
/* カタログ */
.icat .row2 .name { display: flex; align-items: center; gap: 6px; }
.icat .cicon { width: 16px; height: 16px; image-rendering: pixelated; }
.icat .cprice { grid-row: 1 / span 2; grid-column: 2; color: var(--accent); font-variant-numeric: tabular-nums; font-size: 14px; }
/* 今月の収支（資金の下） */
#monthHud { display: block; width: 100%; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
#monthHud.pos { color: var(--good); } #monthHud.neg { color: var(--bad); }
#monthHud:empty { display: none; }
#dClose.go { animation: handleUp .24s ease-out; }
/* お知らせ：秘書の顔＋文（改行あり） */
.msg { display: flex; align-items: center; gap: 8px; white-space: pre-line; text-align: left; padding: 6px 12px 6px 8px; }
.msg:empty { display: none; }
.msg .secIcon { width: 32px; height: 32px; flex: none; image-rendering: pixelated; border-radius: 3px; background: #eef1f4; }
.msg.good { border-left-color: var(--good); }
.msg.bad { border-left-color: var(--bad); }
#noticeMsg { display: flex; gap: 12px; align-items: flex-start; white-space: pre-line; }
#noticeMsg .secBig { width: 48px; height: 48px; flex: none; image-rendering: pixelated; border-radius: 4px; background: #eef1f4; }
/* 遊び方の挿絵 */
.hfig { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin: 2px 0 10px; padding: 8px; background: #eceae4; border-radius: var(--radius); }
.hfig .hpic { width: 40px; height: 40px; image-rendering: pixelated; }
/* 自動プレイ（見る）：AIのしたこと */
#aiHud { display: block; width: 100%; font-size: 10px; line-height: 1.45; color: #4a4a50; white-space: pre-line; letter-spacing: .02em; margin-top: 2px; }
#aiHud:empty { display: none; }

/* v0.43 自動プレイ（見る）：時間を進めるボタン */
#liveBar { display: inline-flex; gap: 4px; }   /* 自動プレイ（見る）の間だけ、速さの横に出る */
#liveBar[hidden] { display: none; }

/* v0.46 自動プレイの結果：改行して出す */
#awayMsg { white-space: pre-line; }
#aiTime { display: block; width: 100%; font-size: 10px; line-height: 1.45; color: #4a4a50; letter-spacing: .02em; margin-top: 2px; }
#aiTime:empty { display: none; }
/* v0.49 FPS（右上に小さく） */
#fpsHud { position: fixed; z-index: 12; top: calc(var(--hdr) + 6px); right: 10px; pointer-events: none; font-size: 10px; color: #4a4a50; text-shadow: 0 0 2px #fff, 0 0 2px #fff; font-variant-numeric: tabular-nums; }
body.title #fpsHud { display: none; }
/* v0.51 今の目標（資金の下） */
#goalHud { display: block; width: 100%; font-size: 10.5px; line-height: 1.45; color: #2b2b2e; white-space: pre-line; letter-spacing: .02em; }
#goalHud:empty { display: none; }
/* v0.55 釣り合い調整（全部の数字） */
#balPanel { position: fixed; inset: 0; z-index: 60; background: rgba(250,250,248,.97); display: flex; flex-direction: column; font-size: 12px; color: #2b2b2e; }
#balPanel[hidden] { display: none; }
#balPanel .balHead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,.15); }
#balPanel .balHead input[type=search] { flex: 1; min-width: 140px; font: inherit; padding: 4px 6px; }
#balPanel .balHead button, #balPanel .balRow button { font: inherit; padding: 3px 8px; border: 1px solid rgba(0,0,0,.25); border-radius: 3px; background: #fff; cursor: pointer; }
#balPanel textarea { margin: 6px 10px; height: 90px; font: 11px monospace; }
#balPanel .balBody { flex: 1; overflow: auto; padding: 6px 10px 40px; }
#balPanel details { margin: 4px 0; border: 1px solid rgba(0,0,0,.1); border-radius: 4px; background: #fff; }
#balPanel summary { padding: 6px 8px; font-weight: 600; cursor: pointer; }
#balPanel .balRow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 76px auto; gap: 6px; align-items: center; padding: 3px 8px; border-top: 1px solid rgba(0,0,0,.05); }
#balPanel .balRow[hidden] { display: none; }
#balPanel .balRow.chg { background: #fff3d6; }
#balPanel .balRow .bl { overflow-wrap: anywhere; }
#balPanel .balRow input[type=number] { width: 100%; font: inherit; padding: 2px 4px; }
#balPanel .balRow input[type=range] { width: 100%; }
@media (max-width: 520px) { #balPanel .balRow { grid-template-columns: minmax(0, 1fr) 70px auto; } #balPanel .balRow input[type=range] { display: none; } }
/* v0.56 メッセージ：関係する所があればタップできる */
.msg.jump { pointer-events: auto; cursor: pointer; }
.msg.jump .mtext { text-decoration: underline dotted; text-underline-offset: 3px; }
/* v0.59 new の印・タブの●・遊び方の一覧とおねがい */
.newtag { display: inline-block; margin-left: 4px; font-size: 9px; font-weight: 700; color: #d0661f; letter-spacing: .04em; vertical-align: top; }
.hasNew { position: relative; }
.hasNew::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #d0661f; }
#helpBody .hlist h4 { margin: 12px 0 4px; font-size: 13px; }
#helpBody .hrow2 { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; border-top: 1px solid rgba(0,0,0,.06); }
#helpBody .hrow2 canvas { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
#helpBody .hrow2 b { font-size: 12.5px; }
#helpBody .pleaseBtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#helpBody .btnLink { display: inline-block; padding: 6px 12px; border: 1px solid rgba(0,0,0,.25); border-radius: 4px; background: #fff; color: #2b2b2e; text-decoration: none; font-size: 12.5px; }
#helpBody { overflow-y: auto; }
/* v0.64 広告を見る／やめる */
.adAsk { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.adAsk[hidden] { display: none; }
.adAsk button { font: inherit; padding: 6px 14px; border: 1px solid rgba(0,0,0,.25); border-radius: 4px; background: #fff; cursor: pointer; }
