/* はじめての一人暮らしサバイバル：ゲーム固有のスタイル（色は変数のみ） */
:root {
  --hg-sky: #9fd0f0; --hg-sky2: #fbe2d6; --hg-wall: #f3e9d8; --hg-wall2: #e6d7bf; --hg-floor: #c99a66; --hg-floor2: #b4844f;
  --hg-wood: #8a5a33; --hg-box: #d8a96a; --hg-box2: #b98a4c; --hg-white: #fbfaf6; --hg-ink: #2a211b; --hg-red: #e4572e;
  --hg-cloth: #5a7fb8; --hg-sofa: #4f8a6b; --hg-skin: #f7f1e6; --hg-sakura: #f6b7c8; --hg-shadow: rgba(40, 25, 10, .18); --hg-steel: #c9ced3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hg-sky: #1d2a4a; --hg-sky2: #3b2c4a; --hg-wall: #3a332a; --hg-wall2: #2e2820; --hg-floor: #6b4a2c; --hg-floor2: #553820;
    --hg-wood: #a0703f; --hg-box: #a57d48; --hg-box2: #8a6538; --hg-white: #e9e4da; --hg-ink: #17120e; --hg-red: #ff7a50;
    --hg-cloth: #4a6aa0; --hg-sofa: #3f7357; --hg-skin: #efe7d8; --hg-sakura: #d98ea4; --hg-shadow: rgba(0, 0, 0, .35); --hg-steel: #8f959b;
  }
}
:root[data-theme="dark"] {
  --hg-sky: #1d2a4a; --hg-sky2: #3b2c4a; --hg-wall: #3a332a; --hg-wall2: #2e2820; --hg-floor: #6b4a2c; --hg-floor2: #553820;
  --hg-wood: #a0703f; --hg-box: #a57d48; --hg-box2: #8a6538; --hg-white: #e9e4da; --hg-ink: #17120e; --hg-red: #ff7a50;
  --hg-cloth: #4a6aa0; --hg-sofa: #3f7357; --hg-skin: #efe7d8; --hg-sakura: #d98ea4; --hg-shadow: rgba(0, 0, 0, .35); --hg-steel: #8f959b;
}

.hg-hero { padding: 12px 0 4px; }
.hg-hero h1 em { font-style: normal; color: var(--accent); }
.hg-start { margin: 12px 0 16px; }
.hg-list { margin: 6px 0 0; padding-left: 1.2em; }
.hg-list li + li { margin-top: 4px; }
.hg-friend { border-color: var(--accent); background: var(--accent-soft); }
.hg-daily .btn { white-space: normal; }
.hg-disclaimer { font-size: 11px; color: var(--text-sub); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; margin: 16px 0 0; line-height: 1.6; }

/* 部屋の絵 */
.hg-room-wrap, .hg-room-box { margin: 10px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.hg-room { display: block; width: 100%; height: auto; }
.hg-hero-photo { margin: 10px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hg-hero-photo img, .hg-portrait img { display: block; width: 100%; height: auto; }
.hg-portrait { border-radius: var(--radius); overflow: hidden; max-width: 360px; margin: 0 auto; }
.hg-petal { animation: hg-fall 6s linear infinite; }
.hg-petal1 { animation-delay: -1.2s; } .hg-petal2 { animation-delay: -2.6s; } .hg-petal3 { animation-delay: -3.8s; } .hg-petal4 { animation-delay: -5s; }
@keyframes hg-fall { 0% { transform: translate(0, -20px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(-14px, 60px); opacity: 0; } }

/* ガチャ */
.hg-slots { padding: 8px 12px; }
.hg-slot { display: grid; grid-template-columns: 5.5em 1fr auto; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px dashed var(--line); min-height: 52px; }
.hg-slot:last-child { border-bottom: 0; }
.hg-slot-label { font-size: 12px; color: var(--text-sub); font-weight: 700; }
.hg-slot-val { font-weight: 800; font-size: 15px; line-height: 1.4; min-width: 0; }
.hg-slot.is-spinning .hg-slot-val { color: var(--text-sub); }
.hg-slot.is-rare-sr, .hg-slot.is-rare-ssr { background: var(--info-soft); border-radius: var(--radius-sm); }
.rare-n { background: var(--surface-2); color: var(--text-sub); }
.rare-r { background: var(--good-soft); color: var(--good); }
.rare-sr { background: var(--info-soft); color: var(--info); }
.rare-ssr { background: var(--accent); color: var(--accent-ink); }

/* プレイ */
.hg-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hg-date { font-size: 24px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hg-meter { margin-top: 12px; position: sticky; top: 54px; z-index: 5; transition: border-color .3s, background .3s; }
.hg-amount { font-size: clamp(26px, 8vw, 34px); font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hg-delta { font-weight: 800; font-size: 15px; white-space: nowrap; }
.hg-delta.is-good { color: var(--good); }
.hg-delta.is-bad { color: var(--bad); }
.hg-sat { height: 10px; }
.hg-meter.is-low { border-color: var(--warn); }
.hg-meter.is-neg { background: var(--bad-soft); border-color: var(--bad); }
.hg-meter.is-neg .hg-amount { color: var(--bad); }
.hg-evlist { list-style: none; margin: 6px 0 0; padding: 0; }
.hg-ev { display: grid; grid-template-columns: 3em 1.6em 1fr; gap: 2px 6px; font-size: 14px; line-height: 1.5; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hg-ev:last-child { border-bottom: 0; }
.hg-ev-d { color: var(--text-sub); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.hg-ev-v { grid-column: 3; font-size: 12px; font-weight: 700; color: var(--text-sub); }
.hg-ev-good .hg-ev-v { color: var(--good); }
.hg-ev-bad .hg-ev-t, .hg-ev-bad .hg-ev-v { color: var(--bad); }
.hg-ev-cost .hg-ev-t { color: var(--text-sub); }
.hg-ev-choice .hg-ev-t { font-weight: 700; }
.hg-ev-choice .hg-ev-t::before { content: '選択：'; color: var(--accent); }
.hg-qcard { border: 2px solid var(--accent); }
.hg-q { font-size: 19px; margin: 4px 0 12px; line-height: 1.45; }
.hg-end-emoji { font-size: 56px; line-height: 1.2; }

/* 結果 */
.hg-result-card { padding-top: 18px; }
.hg-result-card.is-short { border-color: var(--bad); }
.hg-result-card.is-ok { border-color: var(--good); }
.hg-result-big { color: var(--accent); font-variant-numeric: tabular-nums; }
.hg-result-sub { font-weight: 800; font-size: 18px; }
.hg-title-badge { display: flex; align-items: center; gap: 10px; text-align: left; margin: 14px auto 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); max-width: 360px; }
.hg-title-badge b { font-size: 18px; line-height: 1.3; }
.hg-title-badge > div { flex: 1; min-width: 0; }
.hg-title-emoji { font-size: 34px; }
.hg-best { color: var(--good); font-weight: 700; margin: 6px 0 0; }
.hg-share { margin-top: 14px; }
.hg-again { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 8px; }
.hg-again .btn { padding: 10px 12px; font-size: 14px; white-space: normal; line-height: 1.35; }
.hg-numbers, .hg-compare { margin-top: 16px; }
.hg-bars { margin-top: 10px; }
.hg-bar-row { display: grid; grid-template-columns: 5.2em 1fr 6.5em; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.hg-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hg-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.hg-bar-v { text-align: right; font-variant-numeric: tabular-nums; }
.hg-dist { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; align-items: end; height: 110px; margin-top: 10px; }
.hg-dist-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 9px; color: var(--text-sub); text-align: center; line-height: 1.2; }
.hg-dist-bar { width: 100%; background: var(--surface-2); border-radius: 4px 4px 0 0; min-height: 2px; }
.hg-dist-col.is-me .hg-dist-bar { background: var(--accent); }
.hg-dist-col.is-me { color: var(--accent); font-weight: 700; }
.hg-timeline summary, .hg-sources summary { font-weight: 700; }
.hg-sources ul { padding-left: 1.2em; margin: 8px 0; }
.hg-sources li + li { margin-top: 6px; }
.hg-zukan { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.hg-zukan-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; font-size: 13px; opacity: .6; }
.hg-zukan-item.on { opacity: 1; background: var(--accent-soft); }
.hg-zukan-emoji { font-size: 28px; }

/* 静的解説 */
.hg-about h2 { font-size: 20px; }
.hg-table-wrap { overflow-x: auto; }
.hg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hg-table th, .hg-table td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
.hg-table td:nth-child(2) { white-space: nowrap; }
.hg-fixed-note { max-width: 560px; margin: 0 auto; padding: 0 16px; }
