/* サッカー貯金: スマホ優先、大きめの文字、ライト/ダーク対応、画像なし */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --text: #131614;
  --muted: #4b524d;
  --line: #d6dbd6;
  --accent: #1d6b45;
  --accent-text: #ffffff;
  --accent-soft: #e6f2eb;
  --plus: #13623d;
  --minus: #b0262f;
  --win: #13623d;
  --draw: #6b5a00;
  --loss: #b0262f;
  --home: #0b5f73;
  --away: #8a4806;
  --c-PD: #b01f47;
  --c-PL: #4b2a8f;
  --c-CL: #164a8c;
  --warn-bg: #fff1c9;
  --warn-text: #4f3a00;
  --focus: #1d6b45;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101311;
    --surface: #1a1f1c;
    --text: #eff3f0;
    --muted: #b2bbb5;
    --line: #333b36;
    --accent: #7fd3a6;
    --accent-text: #0b1a12;
    --accent-soft: #1d3326;
    --plus: #7fd3a6;
    --minus: #ff9aa0;
    --win: #7fd3a6;
    --draw: #f1d36b;
    --loss: #ff9aa0;
    --home: #7fd0e3;
    --away: #f5b971;
    --c-PD: #ff8aa6;
    --c-PL: #c4adff;
    --c-CL: #8cbcff;
    --warn-bg: #3d3110;
    --warn-text: #ffe4a3;
    --focus: #7fd3a6;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main, header.site, footer.site { max-width: 720px; margin: 0 auto; padding: 0 16px; }

.sample-banner { background: var(--warn-bg); color: var(--warn-text); padding: 10px 16px; font-size: 15px; font-weight: 700; text-align: center; }
header.site { padding-top: 12px; }
.brand { font-weight: 800; font-size: 18px; }
.hero h1 { font-size: 30px; line-height: 1.3; margin: 6px 0 0; }
.hero .lead { margin: 8px 0; color: var(--muted); font-size: 16px; }
.note-money { margin: 8px 0 0; font-size: 15px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }

h2 { font-size: 21px; line-height: 1.4; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 16px 0 4px; }
.small { font-size: 14px; color: var(--muted); margin: 6px 0; }
.stepno {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 8px;
  border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 17px; vertical-align: 2px;
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 18px 0; }
.card p { margin: 0 0 8px; }
details.card > summary { cursor: pointer; color: var(--accent); font-weight: 800; padding: 6px 0; min-height: 44px; display: flex; align-items: center; }
details.card[open] > summary { margin-bottom: 8px; }

/* 入力 */
.field { display: grid; gap: 4px; margin: 12px 0; font-size: 16px; font-weight: 700; }
.field.row { grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; }
.field.row > span:first-child { min-width: 0; }
.field.row.stack { grid-template-columns: 1fr; }
.field.row.stack .yen-in { justify-content: flex-start; }
input[type="text"], select, textarea {
  min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 17px; font-weight: 600; width: 100%;
}
textarea { font: 14px/1.5 ui-monospace, monospace; resize: vertical; }
.yen-in { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.yen-in input { width: 7.5em; text-align: right; font-variant-numeric: tabular-nums; }
.field.row select { width: auto; min-width: 9em; }
.sign { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sign button, .fmt button {
  min-height: 44px; min-width: 44px; padding: 6px 12px; border: 0; background: var(--bg); color: var(--muted);
  font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
}
.sign button[aria-pressed="true"], .fmt button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.sign button + button, .fmt button + button { border-left: 1px solid var(--line); }

/* ボタン */
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 10px 14px;
  border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 800; font-size: 17px; text-decoration: none; text-align: center; cursor: pointer;
}
.btn-x { background: var(--text); color: var(--bg); }
.btn-sub {
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.link-btn {
  min-height: 44px; padding: 8px 6px; border: 0; background: none; color: var(--accent);
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.btns { display: grid; gap: 10px; margin: 12px 0 6px; }
@media (min-width: 520px) { .btns.two { grid-template-columns: 1fr 1fr; } }

/* 累計 */
.total { text-align: center; }
.team-name { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 10px; font-size: 19px; }
.total-label { color: var(--muted); font-weight: 700; margin: 4px 0 0 !important; }
.total-label small { font-weight: 600; margin-left: 4px; }
.total-yen { font-size: 44px; font-weight: 800; line-height: 1.2; margin: 2px 0 4px !important; font-variant-numeric: tabular-nums; }
.total-sub { font-size: 17px; font-weight: 700; }
.team-cal { text-align: center; margin: 2px 0 12px; }
.team-cal a { display: inline-flex; align-items: center; min-height: 44px; }

/* 試合ごとの内訳 */
.list { margin-top: 22px; }
.fmt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; font-size: 15px; font-weight: 700; color: var(--muted); }
.fmt > span { margin-right: 2px; }
.fmt button { border: 1px solid var(--line); border-radius: 10px; }
.fmt button + button { border-left: 1px solid var(--line); }
ol.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.res { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; border-left: 6px solid var(--line); }
.res.r-W { border-left-color: var(--win); }
.res.r-D { border-left-color: var(--draw); }
.res.r-L { border-left-color: var(--loss); }
.res-head {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "meta yen" "main yen"; gap: 2px 12px; width: 100%;
  padding: 12px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.res-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--muted); }
.comp { font-size: 13px; font-weight: 800; padding: 0 8px; border-radius: 999px; border: 2px solid currentColor; }
.c-PD { color: var(--c-PD); } .c-PL { color: var(--c-PL); } .c-CL { color: var(--c-CL); }
.res-main { grid-area: main; display: grid; gap: 0; min-width: 0; }
.res-opp { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.ha { flex: none; font-size: 12px; font-weight: 800; padding: 0 6px; border-radius: 6px; line-height: 1.6; border: 2px solid currentColor; }
.ha.h { color: var(--home); } .ha.a { color: var(--away); }
.res-score { display: flex; gap: 10px; align-items: baseline; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.r-W .res-result { color: var(--win); } .r-D .res-result { color: var(--draw); } .r-L .res-result { color: var(--loss); }
.res-yen { grid-area: yen; display: grid; justify-items: end; align-content: center; text-align: right; }
.res-yen strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.res-yen small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.res-yen .has-extra { color: var(--accent); font-weight: 700; }
.res-head[aria-expanded="true"] { background: var(--accent-soft); }

.res-detail { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
ul.lines { list-style: none; margin: 8px 0; padding: 0; font-size: 16px; }
ul.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
ul.lines li.sum { font-weight: 800; border-bottom: 0; font-size: 17px; }
ul.lines li.mult, ul.lines li.extra { color: var(--muted); }
fieldset.extras { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; padding: 8px 12px 12px; }
fieldset.extras legend { font-weight: 800; font-size: 16px; padding: 0 4px; }
.extra-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.extra-row .yen-in { justify-content: flex-start; }
.extra-row .yen-in input { width: 100%; max-width: 9em; }
.extra-row input:not([inputmode]) { grid-column: 1 / -1; }
.extra-row .link-btn { grid-column: 1 / -1; justify-self: end; }
.report-box { margin-top: 8px; }
pre.report {
  margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
  font: 15px/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; white-space: pre-wrap;
}
.empty { color: var(--muted); padding: 12px 0; }

.about h3:first-of-type { margin-top: 4px; }
.about p { font-size: 16px; }

footer.site { margin-top: 28px; padding-top: 14px; padding-bottom: 40px; border-top: 1px solid var(--line); font-size: 15px; }
footer.site p { margin: 4px 0; }
footer.site a { display: inline-block; padding: 8px 0; }
/* 観戦カレンダー|サッカー貯金|このサイトについて(両サイト共通の小さなメニュー。目立たせないが、タップしやすい高さ) */
footer.site .site-menu { display: flex; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 14px; color: var(--muted); }
footer.site .site-menu a, footer.site .site-menu strong { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
footer.site .site-menu strong { color: var(--text); font-weight: 800; }
footer.site .site-menu .sep { padding: 0 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg);
  font-size: 16px; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); z-index: 10;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
