/* where: tmas-app(city.html だけが読む・最後に読む上書き) / what: スマホの街の HUD(tmas-city-hud.js)の見た目と、
   HUD が出ている間の、今の部品(サイトの頭・ニュースの帯・自分の札・戦況ログの丸・PC 向けの説明)の見た目の上書き。
   body.city-hud(幅 700px 以下で HUD を出している間)だけに効く。外す時は city.html の 1行と、この表。
   / why: 2026-11-17 Rii2「街を見ている・介入している感。スマホで美しく。少し透明度が高い、イケてる TMA らしいリキッドグラス」。
   面: 暗い紺の半透明・上の縁の光・細い枠。家の色は近い色へのグラデーション(白へ抜かない)。金は持ち金と主の手だけ。
   スマホ(body.lite)はぼかさない(発熱)。ぼかすのは PC の幅で HUD を出した時だけ(今は出さない) */

/* ── 面(ガラス) ───────────────────────────────────────────── */
.chud-glass{
  background:
    linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.025) 46%, rgba(255,255,255,0) 100%),
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--fam,#C9A84C) 16%, transparent) 0%, transparent 58%),
    rgba(10,11,19,.44);
  border:1px solid rgba(255,255,255,.13);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.4), 0 10px 26px rgba(0,0,0,.38);
}
body:not(.lite) .chud-glass{-webkit-backdrop-filter:blur(14px) saturate(1.3);backdrop-filter:blur(14px) saturate(1.3);background-color:rgba(10,11,19,.3)}
.chud{position:fixed;z-index:302;color:var(--text,#E8E4DC);font:12px/1.4 "Noto Sans JP","Yu Gothic",sans-serif;-webkit-tap-highlight-color:transparent}
body:not(.city-hud) .chud, body.city-hud--off .chud{display:none}
/* PC(2026-11-18): 上の札だけを、画面の左端に出す(下の操作の帯は出さない)。区画マップ・案内の間は隠す(--off) */
body.city-hud-pc:not(.city-hud--off) #city-hud-top{display:flex;top:92px;left:14px;width:420px}

/* ── 上: 自分の状況の札(左上・自分の顔の札の左) ───────────────── */
.chud-top{top:calc(88px + env(safe-area-inset-top,0px));left:8px;width:min(420px,calc(100% - 84px));height:62px;padding:8px 11px 7px;border-radius:8px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;
  animation:chud-drop .36s cubic-bezier(.2,.8,.2,1) both}
.chud-top::before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:2px;border-radius:2px;background:linear-gradient(180deg,var(--fam,#C9A84C),var(--fam2,#E9CF7A))}   /* 左の細い家の色(近い色へ) */
.chud-top__row{display:flex;align-items:center;gap:7px;min-width:0;white-space:nowrap}
.chud-sp{flex:1 1 auto}
.chud-crest{flex:none;width:20px;height:20px;border-radius:50%;overflow:hidden;box-shadow:0 0 0 1.5px color-mix(in srgb,var(--fam,#C9A84C) 70%,transparent)}
.chud-crest:empty{display:none}
.chud-crest img{width:100%;height:100%;object-fit:cover;display:block}
.chud-fam{font-family:var(--fh,"Noto Serif JP",serif);font-weight:900;font-size:14px;letter-spacing:.06em;
  background:linear-gradient(90deg,var(--fam,#C9A84C),var(--fam2,#E9CF7A));-webkit-background-clip:text;background-clip:text;color:transparent}
.chud-season{font-family:var(--fm,monospace);font-size:10.5px;letter-spacing:.06em;color:var(--text-dim,#9B978F)}
.chud-season i{font-style:normal}
.chud-top .chud-loot{flex:none}   /* 上の段の右(2026-11-18: 時計の位置に持ち金) */
.chud-phase{font-family:var(--fm,monospace);font-size:10.5px;letter-spacing:.04em;color:rgba(255,226,170,.86)}
.chud-meters{display:flex;align-items:center;gap:10px;min-width:0;overflow:hidden;font-family:var(--fm,monospace);font-size:12px}
/* 手数(侵攻・移動): 線の絵・残り / 上限・小さなゲージ(2026-11-18)。ゲージは段の区切りつき(--seg 段)。侵攻は自分の家の2色・移動は青 → 水色。尽きたら赤みの字 */
.chud-m{--c1:var(--fam,#C9A84C);--c2:var(--fam2,#E9CF7A);display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
.chud-m[data-k="move"]{--c1:#5b8fe0;--c2:#5ed3ff}
.chud-m[data-k="recover"]{--c1:#2f9d6c;--c2:#7ee2a8}   /* 回復の回数(緑) */
.chud-m svg{flex:none;width:13px;height:13px;color:var(--c2)}
.chud-m b{font-weight:700;color:var(--text,#E8E4DC)}
.chud-m small{font-size:9.5px;color:var(--text-dim,#9B978F)}
.chud-m[data-empty="1"] b{color:#e08a5a}
.chud-m__g{position:relative;flex:none;width:36px;height:5px;margin-left:3px;background:rgba(255,255,255,.1);overflow:hidden}
.chud-m__g::before{content:"";position:absolute;left:0;top:0;bottom:0;width:var(--p,0%);background:linear-gradient(90deg,var(--c1),var(--c2));box-shadow:0 0 6px color-mix(in srgb,var(--c2) 55%,transparent);transition:width .3s ease}
.chud-m__g::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,transparent 0 calc(100% / var(--seg,8) - 1px),rgba(8,9,15,.9) calc(100% / var(--seg,8) - 1px) calc(100% / var(--seg,8)))}   /* 段の区切り */
.chud-loot{display:inline-flex;align-items:baseline;gap:5px;font-family:var(--fm,monospace)}
.chud-loot i{font-style:normal;font-size:8.5px;letter-spacing:.18em;color:var(--text-dim,#9B978F)}
.chud-loot b{font-size:14px;font-weight:700;color:#F0D98A;text-shadow:0 0 10px rgba(240,217,138,.25)}

/* ── 下: 操作の帯(中央・丸い札。押した手応えは縮んで戻る) ───────────── */
.chud-dock{left:50%;bottom:calc(10px + env(safe-area-inset-bottom,0px) + var(--tma-bottom-bar,0px));   /* --tma-bottom-bar = ブラウザの下のバー(radio-station.js が測る) */transform:translateX(-50%);width:min(360px,calc(100% - 20px));height:58px;padding:6px;border-radius:999px;
  display:grid;grid-template-columns:repeat(4,1fr);gap:4px;animation:chud-rise .4s cubic-bezier(.2,.8,.2,1) .06s both}
.chud-btn{appearance:none;border:0;background:none;color:var(--text,#E8E4DC);font:inherit;cursor:pointer;border-radius:999px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  position:relative;transition:background-color .18s ease,color .18s ease}
.chud-btn svg{width:21px;height:21px;opacity:.92}
.chud-btn span{font-size:10px;letter-spacing:.12em;text-indent:.12em;color:var(--text-dim,#B9B4AA)}
.chud-btn:active,.chud-btn:focus-visible{background:rgba(255,255,255,.08);outline:none}
.chud-btn--here{color:#fff}
.chud-btn--here::before{content:"";position:absolute;inset:3px 10px;border-radius:999px;z-index:-1;   /* 主の手(現在地)は自分の家の 2色 */
  background:linear-gradient(135deg,color-mix(in srgb,var(--fam,#C9A84C) 62%,transparent),color-mix(in srgb,var(--fam2,#E9CF7A) 48%,transparent));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 4px 14px color-mix(in srgb,var(--fam,#C9A84C) 35%,transparent)}
.chud-btn--here span{color:#fff}
.chud-btn.is-tap{animation:chud-tap .32s ease-out}
.chud-btn.has-dot::after{content:"";position:absolute;top:7px;left:calc(50% + 8px);width:7px;height:7px;border-radius:50%;background:#e8604c;box-shadow:0 0 0 2px rgba(10,11,19,.9),0 0 8px rgba(232,96,76,.6)}   /* 今日の依頼の知らせ */

/* ── HUD が出ている間の、今の部品 ─────────────────────────── */
body.city-hud:not(.city-hud--off) .tmas-header{background:linear-gradient(180deg,rgba(8,8,13,.82) 0%,rgba(8,8,13,.38) 100%);border-bottom-color:rgba(255,255,255,.06);box-shadow:none}
body.city-hud:not(.city-hud--off) .news-ticker{background:linear-gradient(90deg,rgba(8,8,13,.66),rgba(8,8,13,.22) 60%,rgba(8,8,13,.5));border-color:rgba(255,255,255,.05);
  -webkit-mask-image:linear-gradient(90deg,#000 0,#000 86%,transparent 100%);mask-image:linear-gradient(90deg,#000 0,#000 86%,transparent 100%)}
body.city-hud:not(.city-hud--off) #phase-pill,                 /* 昼夜は状況の札へ写した */
body.city-hud:not(.city-hud--off) #feed-fab-btn,               /* 戦況ログは下の帯の「戦況」 */
body.city-hud #hud-hint{display:none!important}                /* PC 向けの説明(ホイール・ダブルクリック) */
body.city-hud:not(.city-hud--off) #hud-you{top:calc(88px + env(safe-area-inset-top,0px));right:8px;border-radius:8px;box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 10px 26px rgba(0,0,0,.38)}
body:has(#hud-you.mobile-open) .chud-top{display:none}   /* 自分の札(リーダーカード)を開いている間は、上の札をどける(開いた札が左へ広がる) */
body.city-hud:not(.city-hud--off) .tma-vinyl{bottom:calc(16px + env(safe-area-inset-bottom,0px) + var(--tma-bottom-bar,0px) + 68px)!important}   /* RADIO の盤を、下の帯(58 + 10px)の上へ */
html.rpg-embed .chud{display:none!important}   /* RPG に埋め込んだ CITY では出さない */
@media (pointer:coarse){ body.city-hud:not(.city-hud--off) #tip{display:none!important} }   /* 指では「上に乗る」が無いので、触れた後に吹き出しが残る */

/* 現在地へ寄せた時、自分のピンを一度だけ光らせる */
.player-pin--current.chud-ping{animation:chud-ping .9s ease-out 1}

@keyframes chud-drop{from{opacity:0;transform:translateY(-8px)}}
@keyframes chud-rise{from{opacity:0;transform:translate(-50%,10px)}}
@keyframes chud-tap{40%{transform:scale(.9)}}
@keyframes chud-ping{0%{filter:drop-shadow(0 0 0 rgba(255,255,255,0))}35%{filter:drop-shadow(0 0 12px rgba(255,255,255,.75))}100%{filter:drop-shadow(0 0 0 rgba(255,255,255,0))}}
@media (max-width:360px){   /* 狭いスマホ: 1行目は家と季だけ(時刻を省く)。2行目の数の字を少し詰める */
  .chud-phase{display:none}
  .chud-top .chud-season i{display:none}   /* 上の札: 「あと N日」を省く(右の持ち金を切らない) */
  .chud-top{padding:8px 9px 7px 10px}
  .chud-meters{gap:7px;font-size:11.5px}
  .chud-m small{display:none}   /* 上限を省き、残りとゲージだけ */
  .chud-m__g{width:26px}
  .chud-loot i{display:none}
}
@media (prefers-reduced-motion:reduce){.chud-top,.chud-dock,.chud-btn.is-tap,.player-pin--current.chud-ping{animation:none}.chud-m__g::before{transition:none}}
/* 畳んだ TMAs カード(2026-11-18 Rii2): PC の全体マップの自分の札(畳んだ時)と、区画マップの見出しの右。中身は上の札と同じ部品(家・季・手数のゲージ・昼夜・持ち金) */
.chud-card{display:grid;gap:5px;min-width:0}
.chud-card__r{display:flex;align-items:center;gap:6px;min-width:0;white-space:nowrap;overflow:hidden}
.chud-card__r .chud-sp{flex:1}
.chud-card__m{display:grid;gap:4px;font-family:var(--fm,monospace);font-size:11.5px}
.chud-card__m .chud-m{display:flex}
.chud-card__m .chud-m__g{flex:1;width:auto;min-width:24px}
.chud-card .chud-fam{font-size:12.5px}
.chud-card .chud-season{font-size:9.5px;overflow:hidden;text-overflow:ellipsis}
/* 家の特性の小さな札(2026-11-24・S10〜): 家の名前の右。家の色を落ち着かせた縁と地・字は白 */
.chud-trait{flex:none;padding:0 6px;border-radius:999px;border:1px solid color-mix(in srgb,var(--fam,#C9A84C) 55%,transparent);
  background:color-mix(in srgb,var(--fam,#C9A84C) 18%,rgba(8,9,17,.7));color:#fff;font:700 9px/1.6 "Noto Sans JP",sans-serif;letter-spacing:.04em;white-space:nowrap}
.chud-trait[hidden]{display:none}
.chud-trait b{font-weight:700}.chud-trait i{font-style:normal}
@media (max-width:520px){   /* 上の札が 420px より狭い幅: 1行目に家の特性の札を入れるため、「あと N日」を省き、札は型の名前だけ(数は指を置いた時の説明・ルールの画面) */
  .chud-top .chud-trait:not([hidden]) ~ .chud-season i{display:none}
  .chud-top .chud-trait i{display:none}
}
.chud-card .chud-phase{display:inline;font-size:9.5px}
.chud-card .chud-m small{display:inline}
.chud-card .chud-loot i{display:inline}
.chud-card .chud-loot b{font-size:13px}
/* 帯(2026-11-18 Rii2「区画マップの見出しの下に、全体マップのスマホ表示の時と同じ物を」): 上の札(.chud-top)と同じ中身・同じ面。置き場は呼び出し側(区画マップの .zm-you)。data-chud-strip へ tmas-city-hud.js が写す */
.chud-strip{position:relative;height:62px;padding:8px 11px 7px;border:1px solid rgba(255,255,255,.13);border-radius:8px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;color:var(--text,#E8E4DC);font:12px/1.4 "Noto Sans JP","Yu Gothic",sans-serif;
  background:radial-gradient(120% 140% at 0% 0%,color-mix(in srgb,var(--fam,#C9A84C) 16%,transparent) 0%,transparent 58%),rgba(10,11,19,.66)}
.chud-strip::before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:2px;border-radius:2px;background:linear-gradient(180deg,var(--fam,#C9A84C),var(--fam2,#E9CF7A))}
.chud-strip:empty{display:none}
