/* 福島ユナイテッドFC ボード（非公式）
   暗い画面が基本。端末が明るい設定のときは明るい配色にする。 */
:root {
  --bg: #161110;
  --card: #201a18;
  --line: #3a2f2c;
  --text: #ffffff;
  --sub: #b9aba5;
  --mute: #8f817b;
  --red: #e62e4d;
  --banner: #dc2a48;
  --red-soft: #3a1c20;
  --red-chip: #4a1a22;
  --win: #3fae68;
  --draw: #9b8679;
  --loss: #e2625c;
  --btn: #201a18;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --card: #ffffff;
    --line: #e6dfdc;
    --text: #1b1413;
    --sub: #6d605b;
    --mute: #94877f;
    --red: #d81f40;
    --banner: #dc2a48;
    --red-soft: #fdecef;
    --red-chip: #fde3e8;
    --win: #2f9a58;
    --draw: #a39288;
    --loss: #df554f;
    --btn: #ffffff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  font-feature-settings: "palt";
}
.wrap { max-width: 720px; margin: 0 auto; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.loading, .error { padding: 48px 16px; color: var(--sub); text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.nw { display: inline-block; white-space: nowrap; max-width: 100%; }

/* ── いちばん上 ── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 16px 12px; }
.league { margin: 0; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.top h1 { margin: 2px 0 0; font-size: 23px; font-weight: 900; letter-spacing: .01em; }
.asof { margin: 2px 0 0; color: var(--sub); font-size: 12px; }
.btn {
  flex: none; appearance: none; border: 1px solid var(--line); background: var(--btn); color: var(--text);
  font: inherit; font-weight: 800; padding: 9px 18px; border-radius: 999px; cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.notice { margin: 0 16px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--sub); font-size: 12px; }

/* ── 次の試合 ── */
.next { display: flex; background: var(--banner); color: #fff; padding: 18px 16px; }
.next-main { flex: 1; min-width: 0; }
.next-label { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .16em; opacity: .9; }
.next-date { margin: 8px 0 0; font-size: 15px; font-weight: 800; }
.next-card { margin: 4px 0 0; font-size: 23px; font-weight: 900; line-height: 1.25; }
.next-venue { margin: 4px 0 0; font-size: 14px; opacity: .95; }
.next-rank { flex: none; width: 104px; margin-left: 14px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.35); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.next-rank small { font-size: 12px; font-weight: 800; }
.next-rank b { font-size: 46px; font-weight: 900; line-height: 1.05; letter-spacing: -.02em; }
.next-rank b span { font-size: 20px; margin-left: 1px; }

/* ── 見出し ── */
section { padding: 0 16px; margin-top: 30px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.head h2 { margin: 0; font-size: 19px; font-weight: 900; padding-left: 12px; position: relative; }
.head h2::before { content: ""; position: absolute; left: 0; top: .22em; bottom: .16em; width: 5px; background: var(--red); border-radius: 1px; }
.head .side { color: var(--sub); font-size: 12px; text-align: right; }
.head .side a { color: inherit; text-decoration: none; }
.sub-title { margin: 14px 0 6px; font-size: 14px; font-weight: 800; }
.foot-note { margin: 8px 0 0; color: var(--sub); font-size: 12px; }
.link { display: inline-block; margin-top: 10px; color: var(--red); font-weight: 800; font-size: 13px; }

/* ── 箱（行のあつまり）── */
.box { border: 1px solid var(--line); background: var(--card); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.me { background: var(--red-soft); }
.grow { flex: 1; min-width: 0; }
.chip { flex: none; display: inline-block; padding: 3px 7px; border-radius: 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; border: 1px solid var(--line); color: var(--sub); white-space: nowrap; }
.chip.fill { background: var(--banner); border-color: var(--banner); color: #fff; }

/* ── 直近5試合 ── */
.match { align-items: flex-start; }
.res { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; margin-top: 2px; }
.res.W, .dot.W { background: var(--win); }
.res.D, .dot.D { background: var(--draw); }
.res.L, .dot.L { background: var(--loss); }
.match-title { margin: 0; font-size: 15px; font-weight: 800; }
.match-meta { margin: 1px 0 0; color: var(--sub); font-size: 13px; }
.goals { margin: 6px 0 0; font-size: 13px; }
.goals b { font-weight: 800; margin-right: 6px; }
.goals.for b { color: var(--red); }
.goals.for { font-weight: 700; }
.goals.against { color: var(--sub); }
.goals.against b { color: var(--sub); }

/* ── 順位表 ── */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); background: var(--card); }
table.st { width: 100%; min-width: 540px; border-collapse: collapse; }
.st th { font-size: 11px; font-weight: 800; color: var(--sub); padding: 9px 4px; text-align: center; white-space: nowrap; }
.st td { padding: 8px 4px; text-align: center; border-top: 1px solid var(--line); font-weight: 700; }
.st th.team, .st td.team { text-align: left; padding-left: 10px; }
.st td.pts { font-size: 16px; font-weight: 900; width: 58px; }
.st td.rk { width: 44px; line-height: 1.1; }
.st td.rk b { display: block; font-size: 14px; font-weight: 900; }
.st td.rk small { font-size: 10px; font-weight: 800; color: var(--mute); }
.st td.rk small.up { color: var(--win); }
.st td.rk small.down { color: var(--loss); }
.st td.team .name { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; }
.st tr.me td.team .name { font-weight: 900; }
.st tr.me td { background: var(--red-soft); }
.form { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.dot { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 800; }
.form small { margin-left: 4px; color: var(--mute); font-size: 9px; font-weight: 600; }

/* ── ランキング ── */
.rank-no { flex: none; width: 20px; text-align: center; color: var(--sub); font-weight: 800; }
.rank-no.red { color: var(--red); }
.rank-name { font-size: 14px; font-weight: 800; }
.row.plain .rank-name { font-weight: 600; }
.row.me .rank-name { font-weight: 900; }
.lg { display: inline-block; margin-left: 8px; padding: 2px 6px; border-radius: 4px; background: var(--red-chip); color: var(--red); font-size: 11px; font-weight: 800; vertical-align: 1px; white-space: nowrap; }
.val { flex: none; font-size: 21px; font-weight: 900; color: var(--red); white-space: nowrap; }
.val small { font-size: 11px; margin-left: 2px; font-weight: 800; }
.val.white { color: var(--text); font-size: 16px; }
.val.white small { color: var(--sub); font-weight: 600; }
.tight .row { padding-top: 10px; padding-bottom: 10px; }

/* ── 練習スケジュール ── */
.month { margin: 16px 0 6px; font-size: 14px; font-weight: 800; }
.month:first-of-type { margin-top: 4px; }
.tr { align-items: flex-start; }
.tr.past { opacity: .5; }
.tr-date { flex: none; width: 76px; font-size: 14px; font-weight: 900; }
.tr-date small { margin-left: 3px; color: var(--sub); font-size: 11px; font-weight: 600; }
.tr-title { margin: 0; font-size: 14px; font-weight: 800; }
.tr-title .time { color: var(--red); margin-left: 6px; }
.tr-sub { margin: 1px 0 0; color: var(--sub); font-size: 12px; }

/* ── 残りの試合日程 ── */
.fx-date { flex: none; width: 76px; font-size: 14px; font-weight: 900; line-height: 1.25; }
.fx-date small { display: block; color: var(--red); font-size: 13px; font-weight: 800; }
.fx-date small.tbd { color: var(--mute); font-size: 11px; font-weight: 600; }
.fx-opp { margin: 0; font-size: 14px; font-weight: 800; }
.fx-opp small { margin-left: 6px; color: var(--sub); font-size: 12px; font-weight: 500; }
.fx-venue { margin: 1px 0 0; color: var(--sub); font-size: 12px; }

/* ── いちばん下 ── */
.sources { margin-top: 34px; }
.sources h3 { margin: 0 0 6px; font-size: 13px; font-weight: 800; }
.sources a { display: inline-block; margin: 0 14px 8px 0; color: var(--red); font-size: 12px; }
.about { margin: 14px 0 0; color: var(--mute); font-size: 11px; line-height: 1.7; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; background: #000; color: #fff; font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 10; text-align: center;
}
.toast.show { opacity: .92; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

@media (max-width: 400px) {
  .top h1, .next-card { font-size: 20px; }
  .next-rank { width: 88px; margin-left: 10px; padding-left: 10px; }
  .next-rank b { font-size: 40px; }
  .tr-date, .fx-date { width: 68px; }
}
