:root {
  --bg: #0f1720;
  --surface: #18222e;
  --border: #2a3847; /* カードの枠・区切り線（装飾） */
  --control-border: #687c91; /* ボタン・入力欄の枠。背景とのコントラスト 3:1 以上（WCAG 1.4.11） */
  --text: #f2f6fa;
  --muted: #9fb0c0;
  --primary: #2fd27a;
  --primary-text: #05210f;
  --warn: #ffb020;
  --warn-text: #2b1b00;
  --my: #4da3ff;
  --my-text: #04203a;
  --opp: #ff7a6b;
  --opp-text: #3a0a05;
  --danger: #ff5d5d;
  --danger-text: #2a0505;
  --win: #2fd27a;
  --loss: #ff7a6b;
  --radius: 16px;
  /* 部品ごとの色（テーマで切り替える） */
  --focus: #ffffff;
  --press: rgba(255, 255, 255, 0.06);
  --backdrop: rgba(0, 0, 0, 0.65);
  --shadow: rgba(0, 0, 0, 0.5);
  --seg-on-bg: rgba(47, 210, 122, 0.15);
  --chip-on-text: #06210f;
  --alert-warn-bg: #ffb020;
  --alert-warn-text: #1a1200;
  --alert-swap-text: #ffffff;
  color-scheme: dark;
}

/* ライトモード。アクセント色は「白地の文字」と「白文字の背景」の両方で 4.5:1 以上になる濃さにする */
:root[data-theme="light"] {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --border: #d5dde6;
  --control-border: #7b8a99;
  --text: #111a24;
  --muted: #52606e;
  --primary: #15804a;
  --primary-text: #ffffff;
  --warn: #a65800;
  --warn-text: #ffffff;
  --my: #1f6fd1;
  --my-text: #ffffff;
  --opp: #c23b2e;
  --opp-text: #ffffff;
  --danger: #c62828;
  --danger-text: #ffffff;
  --win: #15804a;
  --loss: #c23b2e;
  --focus: #111a24;
  --press: rgba(0, 0, 0, 0.05);
  --backdrop: rgba(15, 23, 32, 0.45);
  --shadow: rgba(15, 23, 32, 0.25);
  --seg-on-bg: rgba(21, 128, 74, 0.12);
  --chip-on-text: #ffffff;
  --alert-swap-text: #ffffff;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  /* 二度押しでの拡大を防ぐ。コート脇の素早い連打対策 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(88px + env(safe-area-inset-bottom));
}

.app-header h1 {
  margin: 0;
  padding: 16px 0 8px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.env-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1.5px solid var(--warn);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--warn);
  vertical-align: 1px;
}

.env-badge[hidden] {
  display: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 20px;
}

.card + .card {
  margin-top: 12px;
}

.stopwatch {
  text-align: center;
}

.status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.clock {
  margin: 2px 0 12px;
  font-size: clamp(3.5rem, 18vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.stopwatch[data-status="running"] .clock {
  color: var(--primary);
}

.stopwatch[data-status="paused"] .clock {
  color: var(--warn);
}

.controls {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  min-height: 72px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
}

.btn[hidden] {
  display: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}

.btn-warn {
  background: var(--warn);
  color: var(--warn-text);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.note {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.note[hidden] {
  display: none;
}

/* スコアボード */
.teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.team {
  text-align: center;
}

.team h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.team-my h2,
.team-my .score {
  color: var(--my);
}

.team-opp h2,
.team-opp .score {
  color: var(--opp);
}

.score {
  margin: 0 0 8px;
  font-size: clamp(3.5rem, 18vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.score-btns {
  display: flex;
  gap: 8px;
}

.btn-score {
  min-height: 72px;
  font-size: 1.6rem;
}

.team-my .btn-score {
  background: var(--my);
  color: var(--my-text);
}

.team-opp .btn-score {
  background: var(--opp);
  color: var(--opp-text);
}

.btn-undo {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn:disabled:active {
  transform: none;
}

/* 得点の履歴 */
.timeline h2,
.lineup h2,
.members h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.timeline-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 4.5rem 3.2rem 2.5rem 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.timeline-list li:first-child {
  border-top: 0;
}

.tl-time {
  font-weight: 700;
}

.tl-team {
  font-size: 0.85rem;
  font-weight: 700;
}

.tl-points {
  font-weight: 800;
}

.tl-total {
  text-align: right;
  color: var(--muted);
}

.tl-my .tl-team,
.tl-my .tl-points {
  color: var(--my);
}

.tl-opp .tl-team,
.tl-opp .tl-points {
  color: var(--opp);
}

.empty {
  margin: 0;
  padding: 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty[hidden] {
  display: none;
}

/* 試合終了ボタン */
.btn-finish {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  font-size: 1rem;
}

.btn-finish[hidden] {
  display: none;
}

.btn-danger {
  background: var(--danger);
  color: var(--danger-text);
}

.btn-danger-ghost {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
  font-size: 1rem;
}

/* タイムラインの行（タップで修正） */
.timeline h2 .hint,
.lineup h2 .hint,
.members h2 .hint {
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 400;
}

.timeline-list li {
  display: block;
  padding: 0;
}

.tl-row {
  display: grid;
  grid-template-columns: 4.5rem 3.2rem 2.5rem 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tl-row:active {
  background: var(--press);
}

.tl-row:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

/* 履歴 */
.history h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.match {
  border-top: 1px solid var(--border);
}

.day-matches li:first-child .match {
  border-top: 0;
}

.match summary {
  display: grid;
  grid-template-columns: 3.4rem 3.4rem 1fr auto;
  grid-auto-flow: row;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px 0;
  list-style: none;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.match summary::-webkit-details-marker {
  display: none;
}

.match-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.match-result {
  padding: 2px 0;
  border-radius: 999px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.res-win {
  background: var(--win);
  color: var(--primary-text);
}

.res-loss {
  background: var(--loss);
  color: var(--opp-text);
}

.res-draw {
  background: var(--border);
  color: var(--text);
}

.match-score {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
}

.match-time {
  font-size: 0.85rem;
  color: var(--muted);
}

.match-events {
  margin: 0 0 8px;
  padding: 0 0 0 8px;
  list-style: none;
}

.match-events li {
  display: grid;
  grid-template-columns: 4.5rem 3.2rem 2.5rem 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  font-variant-numeric: tabular-nums;
}

.match-events .tl-empty {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

/* 下部タブバー */
.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-inner {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
}

.tab {
  flex: 1;
  min-height: 60px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.tab[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 3px 0 var(--primary);
}

.tab:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.tab-count {
  display: inline-block;
  min-width: 1.4em;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
  font-size: 0.75rem;
  text-align: center;
}

.tab-count[hidden] {
  display: none;
}

/* トースト */
.toast {
  position: fixed;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: 16px;
  max-width: 448px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-align: center;
}

.toast[hidden] {
  display: none;
}

/* ダイアログ */
.dlg {
  width: min(92vw, 420px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.dlg::backdrop {
  background: var(--backdrop);
}

.dlg-body {
  padding: 20px 16px 16px;
}

.dlg-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.dlg-msg {
  margin: 0 0 20px;
  line-height: 1.6;
  white-space: pre-line;
}

.dlg-actions {
  display: flex;
  gap: 12px;
}

.dlg-actions .btn {
  min-height: 60px;
}

.dlg-field {
  margin-bottom: 16px;
}

.dlg-label {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.seg-group {
  display: flex;
  gap: 8px;
}

.seg {
  position: relative;
  flex: 1;
}

.seg input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}

.seg span {
  display: block;
  padding: 14px 0;
  border: 2px solid var(--border);
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
}

.seg input:checked + span {
  border-color: var(--primary);
  background: var(--seg-on-bg);
}

.seg input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.num-row {
  display: flex;
  gap: 12px;
}

.num {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
}

.num input {
  width: 100%;
  min-width: 0;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1.25rem;
  text-align: center;
}

.dlg-error {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 0.85rem;
}

.dlg-error[hidden] {
  display: none;
}

/* カウントダウン: 試合時間ボタン・超過表示 */
.btn-duration {
  display: block;
  margin: 0;
  min-height: 44px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-duration[hidden] {
  display: none;
}

.btn-duration:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* 試合時間を過ぎたら色を変える（計時中・一時停止中とも） */
.stopwatch[data-over="true"] .clock {
  color: var(--loss);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.btn-preset {
  flex: 1 0 28%;
  min-height: 48px;
  font-size: 1rem;
}

/* 試合時間・交代間隔のボタンを横に並べる */
.setting-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: -4px 0 12px;
}

/* 交代アラート: 画面上部に大きく表示。タップで閉じる */
.swap-alert {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  left: 12px;
  z-index: 20;
  max-width: 456px;
  margin: 0 auto;
  padding: 22px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--alert-warn-bg);
  color: var(--alert-warn-text);
  font: inherit;
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 28px var(--shadow);
  cursor: pointer;
}

.swap-alert[data-kind="swap"] {
  background: var(--loss);
  color: var(--alert-swap-text);
  font-size: 2.2rem;
  animation: swap-pulse 0.5s ease-in-out 4 alternate;
}

.swap-alert[hidden] {
  display: none;
}

@keyframes swap-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .swap-alert[data-kind="swap"] { animation: none; }
}

.btn-notify {
  margin-top: 12px;
}

.btn-notify[hidden] {
  display: none;
}

/* 出場メンバーの選択 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 48px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  border-color: var(--win);
  background: var(--win);
  color: var(--chip-on-text);
}

.chip:disabled {
  opacity: 0.35;
  cursor: default;
}

/* メンバー一覧 */
.member-list {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.member-name {
  font-weight: 700;
}

.member-edit {
  color: var(--muted);
  font-size: 0.85rem;
}

.text-field input {
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
}

.match-members {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.85rem;
}

.members .btn-primary {
  width: 100%;
}

.mm-name {
  white-space: nowrap;
}

/* 履歴の編集・手入力 */
.btn-edit-record {
  width: 100%;
  min-height: 44px;
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
  margin-top: 12px;
}

.dlg-note {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* スコア入力: ラベルを入力欄の上に置く（「自チーム」を折り返さない） */
.score-inputs .num {
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 4px;
}

.score-inputs .num span {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* チーム: 試合画面の両側の選択 */
.side + .side {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.side-label {
  flex: none;
  font-size: 0.85rem;
  font-weight: 800;
}

.side-label-my {
  color: var(--my);
}

.side-label-opp {
  color: var(--opp);
}

.team-select {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.team-select[hidden] {
  display: none;
}

.side-head .hint {
  margin-left: auto;
  flex: none;
  color: var(--muted);
  font-size: 0.85rem;
}

.dlg .team-select {
  width: 100%;
  margin-bottom: 10px;
}

.btn-link {
  margin-top: 8px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-link[hidden] {
  display: none;
}

/* 相手側に出ている人 */
.chip.taken {
  text-decoration: line-through;
}

/* スコアの見出しにチーム名（長い名前は省略） */
.team h2 {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* チーム一覧 */
.team-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-members {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.members + .members {
  margin-top: 16px;
}

/* 履歴: 対戦カードと両側のメンバー */
.match-teams {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  font-weight: 700;
}

.mm-side {
  font-weight: 700;
}

.team {
  min-width: 0;
}

.member-edit {
  flex: none;
  margin-left: 12px;
  white-space: nowrap;
}

/* 成績 */
.stats h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.stats-overall {
  margin: 0 0 12px;
  font-weight: 700;
  line-height: 1.7;
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
}

.stats-teams[hidden] {
  display: none;
}

.stats-head,
.stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.4rem 1.8rem 1.8rem 1.8rem 3.4rem;
  align-items: center;
  gap: 4px;
}

.stats-head {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.stats-head span:not(:first-child) {
  text-align: right;
}

.stats-row {
  width: 100%;
  min-height: 48px;
  margin-bottom: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.stats-row[aria-pressed="true"] {
  border-color: var(--win);
  box-shadow: inset 0 0 0 1px var(--win);
}

.st-name {
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.st-num {
  text-align: right;
}

.st-win {
  color: var(--win);
  font-weight: 700;
}

.st-loss {
  color: var(--loss);
  font-weight: 700;
}

.stats-hint {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.history h2 {
  display: inline-block;
}

.filter-chip {
  float: right;
  min-height: 36px;
  padding: 4px 12px;
  border: 1.5px solid var(--win);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip[hidden] {
  display: none;
}

.history-list {
  clear: both;
}

/* ヘッダー右上の「使い方・規約」 */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0 8px;
}

.app-header h1 {
  padding: 0;
}

.header-link {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.header-link[hidden] {
  display: none;
}

/* このアプリについて */
.about-back {
  margin: 0 0 8px;
}

.about h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.about p,
.about li,
.about dd {
  line-height: 1.7;
  font-size: 0.92rem;
}

.about p {
  margin: 0 0 8px;
}

.about ol,
.about ul {
  margin: 0;
  padding-left: 1.3em;
}

.about li + li {
  margin-top: 6px;
}

.about ul ul {
  margin-top: 4px;
}

.about dt {
  margin-top: 12px;
  font-weight: 700;
}

.about dt:first-child {
  margin-top: 0;
}

.about dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.about a {
  color: var(--my);
}

/* 次の交代まで */
.next-swap {
  margin: -6px 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.next-swap[hidden] {
  display: none;
}

.next-swap[data-soon="true"] {
  color: var(--warn);
}

/* お知らせ（「元に戻す」付き） */
.toast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.toast-action {
  flex: none;
  min-height: 40px;
  padding: 6px 14px;
  border: 1.5px solid var(--bg);
  border-radius: 999px;
  background: transparent;
  color: var(--bg);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.toast-action[hidden] {
  display: none;
}

/* 得点の履歴: チーム名（長い名前は省略） */
.tl-row,
.match-events li {
  grid-template-columns: 4.2rem minmax(0, 1fr) 2.5rem auto;
}

.tl-team {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dlg .btn-block {
  width: 100%;
}

/* 入力欄の単位（分・秒・分ごと）を折り返さない */
.num span {
  white-space: nowrap;
}

/* A3: 操作できる部品（ボタン・入力欄・選択肢）の枠は、背景と 3:1 以上のコントラストにする */
.btn-ghost,
.seg span,
.num input,
.btn-duration,
.chip,
.member-row,
.text-field input,
.team-select,
.stats-row,
.header-link {
  border-color: var(--control-border);
}

/* 画面には出さず、スクリーンリーダーだけが読み上げる */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 画面の色の選択（設定・使い方の画面） */
.theme-group {
  margin-top: 4px;
}

.theme-group .seg span {
  padding-left: 4px;
  padding-right: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* 履歴: 日ごとのグループ */
.day-group + .day-group {
  margin-top: 18px;
}

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 4px;
  padding: 6px 0;
  border-bottom: 2px solid var(--control-border);
  font-size: 0.95rem;
  font-weight: 800;
}

.day-count {
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.day-matches {
  margin: 0;
  padding: 0;
  list-style: none;
}
