/* 冬の電気代サバイバル：ゲーム固有のスタイル（色は変数のみ） */
:root {
  --ds-sky: #26355e; --ds-sky2: #6b7fae; --ds-wall: #efe6d6; --ds-wall2: #ddd0bb; --ds-floor: #b98c5c; --ds-floor2: #9c7146;
  --ds-white: #fbfaf6; --ds-ink: #2a211b; --ds-red: #e4572e; --ds-snow: #ffffff; --ds-ac: #f4f2ec; --ds-warm: #ffb05c; --ds-cool: #8fc4f0;
  --ds-wood: #7a4f2c; --ds-blanket: #5a7fb8; --ds-skin: #f7f1e6; --ds-meter: #3c4249; --ds-lcd: #b9f3c9; --ds-shadow: rgba(40, 25, 10, .18); --ds-carpet: #c8473c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ds-sky: #0f1630; --ds-sky2: #2c3866; --ds-wall: #3a332a; --ds-wall2: #2e2820; --ds-floor: #6b4a2c; --ds-floor2: #553820;
    --ds-white: #e9e4da; --ds-ink: #17120e; --ds-red: #ff7a50; --ds-snow: #e8eef8; --ds-ac: #d9d5cc; --ds-warm: #ffa040; --ds-cool: #6fa6d6;
    --ds-wood: #8a5a33; --ds-blanket: #4a6aa0; --ds-skin: #efe7d8; --ds-meter: #20252b; --ds-lcd: #8fd9a6; --ds-shadow: rgba(0, 0, 0, .35); --ds-carpet: #a83a31;
  }
}
:root[data-theme="dark"] {
  --ds-sky: #0f1630; --ds-sky2: #2c3866; --ds-wall: #3a332a; --ds-wall2: #2e2820; --ds-floor: #6b4a2c; --ds-floor2: #553820;
  --ds-white: #e9e4da; --ds-ink: #17120e; --ds-red: #ff7a50; --ds-snow: #e8eef8; --ds-ac: #d9d5cc; --ds-warm: #ffa040; --ds-cool: #6fa6d6;
  --ds-wood: #8a5a33; --ds-blanket: #4a6aa0; --ds-skin: #efe7d8; --ds-meter: #20252b; --ds-lcd: #8fd9a6; --ds-shadow: rgba(0, 0, 0, .35); --ds-carpet: #a83a31;
}

.ds-hero { padding: 12px 0 4px; }
.ds-hero h1 em { font-style: normal; color: var(--accent); }
.ds-start { margin: 12px 0 16px; }
.ds-list { margin: 6px 0 0; padding-left: 1.2em; }
.ds-list li + li { margin-top: 4px; }
.ds-friend { border-color: var(--accent); background: var(--accent-soft); }
.ds-daily .btn { white-space: normal; }
.ds-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; }

/* 部屋の絵 */
.ds-room-wrap, .ds-room-box { margin: 10px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.ds-room { display: block; width: 100%; height: auto; }
.ds-hero-photo { margin: 10px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.ds-hero-photo img, .ds-portrait img { display: block; width: 100%; height: auto; }
.ds-portrait { border-radius: var(--radius); overflow: hidden; max-width: 360px; margin: 0 auto; }
.ds-flake { animation: ds-fall 5s linear infinite; }
.ds-flake1 { animation-delay: -1.2s; } .ds-flake2 { animation-delay: -2.5s; } .ds-flake3 { animation-delay: -3.7s; }
@keyframes ds-fall { 0% { transform: translate(0, -10px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(6px, 40px); opacity: 0; } }
.ds-wind { animation: ds-wind 1.8s ease-in-out infinite; }
.ds-wind1 { animation-delay: -.6s; } .ds-wind2 { animation-delay: -1.2s; }
@keyframes ds-wind { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: .85; transform: translateY(4px); } }
.ds-disk { transform-origin: 0 0; animation: ds-spin 2.4s linear infinite; transform-box: view-box; }
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ガチャ */
.ds-slots { padding: 8px 12px; }
.ds-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; }
.ds-slot:last-child { border-bottom: 0; }
.ds-slot-label { font-size: 12px; color: var(--text-sub); font-weight: 700; }
.ds-slot-val { font-weight: 800; font-size: 15px; line-height: 1.4; min-width: 0; }
.ds-slot.is-spinning .ds-slot-val { color: var(--text-sub); }
.ds-slot.is-rare-sr, .ds-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); }

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

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

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

/* 電気代ゲーム固有 */
.ds-month { font-size: 24px; font-weight: 900; line-height: 1.2; }
.ds-meter.is-over { border-color: var(--bad); }
.ds-comfort { height: 10px; }
.ds-bills-box { margin: 4px 0 10px; }
.ds-bills { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; height: 130px; margin-top: 8px; }
.ds-bill-col { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--text-sub); min-width: 0; }
.ds-bill-v { height: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ds-bill-track { position: relative; flex: 1; width: 100%; background: var(--surface-2); border-radius: 6px 6px 0 0; }
.ds-bill-bar { position: absolute; left: 12%; right: 12%; bottom: 0; background: var(--good); border-radius: 4px 4px 0 0; transition: height .6s ease; }
.ds-bill-col.is-over .ds-bill-bar { background: var(--bad); }
.ds-bill-avg { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--text-sub); z-index: 1; }
.ds-mbill { font-size: clamp(30px, 9vw, 40px); font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.ds-qcard.is-dramatic { border-color: var(--info); background: var(--info-soft); }
.ds-ev { grid-template-columns: 1.6em 1fr; }
.ds-ev-v { grid-column: 2; }
.ds-ev-bill .ds-ev-t { font-weight: 700; }
.ds-ev-bill .ds-ev-v { color: var(--text); }
.ds-result-sub.is-good { color: var(--good); }
.ds-result-sub.is-bad { color: var(--bad); }
.ds-whatlist { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13px; }
.ds-whatlist li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.ds-whatlist b.is-good { color: var(--good); }
.ds-whatlist b.is-bad { color: var(--bad); }
.ds-dist { grid-template-columns: repeat(9, 1fr); }
