:root {
  /* 色：藍（剣道着）・生成り・赤（たすき）。勝ちは薄い赤、負けは薄い青 */
  --bg: #f4f2ee;          /* 生成り（黄みを抑える） */
  --surface: #ffffff;
  --ink: #1b1f2a;         /* 墨 */
  --muted: #6d6a63;
  --line: #d8d6d0;
  --line-strong: #2b2b2b;
  --head: #efeeea;
  --accent: #1e3557;      /* 藍 */
  --accent-soft: #e3e9f1;
  --red: #b3261e;         /* たすきの赤 */
  --win: #fbdad6;
  --lose: #d9e7f5;
  --warn: #b3261e;
  --win-ink: #b3261e;
  --lose-ink: #1d5a99;
  --soft-line: #ebe9e4;
  --note-bg: #eef2f7;      /* 案内は藍の薄い色 */
  --note-line: #cfd8e6;
  --danger-line: #d8d6d0;  /* 危ない操作も枠は同じ灰色、文字だけ赤 */
  --radius: 10px;
  /* 文字の大きさは5段階だけ */
  --fs-xs: 12px;
  --fs-s: 14px;
  --fs-m: 16px;
  --fs-l: 20px;
  --fs-xl: 30px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  touch-action: manipulation;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- ヘッダー ---------- */
.app-header {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* アプリ名：アイコンと同じ Montserrat の極太（KENTOMO の7文字だけを入れたファイル。SIL OFL 1.1） */
@font-face {
  font-family: 'KentomoLogo';
  src: url('fonts/kentomo.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
.app-header h1.brand {
  font-family: 'KentomoLogo', var(--font);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.03em;
  line-height: 1;
}
/* 右上の「ホーム」ボタン（ホームの画面では出さない） */
.head-home {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
  min-height: 36px;
  white-space: nowrap;
}
.head-home:focus-visible, .modes button:focus-visible { outline: 3px solid #9ec0ff; outline-offset: 1px; }
body[data-view="home"] .head-home { display: none; }
@media (max-width: 359px) {
  .app-header h1 { font-size: 15px; letter-spacing: 0; }
  .app-header h1.brand { font-size: 14px; letter-spacing: 0; }
  .head-home { padding: 6px 10px; font-size: 14px; }
}
.modes {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: var(--radius);
  max-width: 520px;
}
.modes button {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 8px 0;
  border-radius: 7px;
  font-size: 15px;
}
.modes button.on {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- 記録表 ---------- */
main {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.board {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  table-layout: fixed;
  margin-bottom: 12px;
}
.board th,
.board td {
  border: 1px solid var(--line-strong);
  text-align: center;
  vertical-align: middle;
  padding: 4px 2px;
  height: 52px;
  word-break: break-all;
}
.board th { background: var(--head); font-weight: 600; font-size: 14px; }
.board .pos { font-size: 14px; }
.board .c-pos { width: 52px; }
.board .c-score { width: 21%; }
.board .c-corner { width: 128px; }
.board .c-result { width: 84px; }
.board .name, .board .score, .board .team-name { cursor: pointer; }
.board .name { font-size: 15px; }
.board .score { font-size: 20px; font-weight: 700; letter-spacing: 0.04em; }
.board .team-name { font-size: 15px; font-weight: 700; }
.board .name.win { background: var(--win); }
.board .name.lose { background: var(--lose); }
.board .sym { font-size: 26px; font-weight: 700; }
.board .total { font-size: 18px; font-weight: 700; }
.board .result th, .board .result td { background: #fafafa; }
.board .placeholder { color: #a0a6b1; font-weight: 400; }
.board .badge {
  display: inline-block;
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.board .encho {
  display: block;
  font-size: 11px;
  color: var(--warn);
}
.board td:active { background: var(--accent-soft); }
.board [role="button"]:focus-visible { outline: 3px solid #3b6fd8; outline-offset: -3px; }

/* いまの試合 */
.board.v tr.current th.pos,
.board.ind tr.current th.pos,
.board.h th.current {
  background: var(--accent);
  color: #fff;
}
.board .rep th.pos, .board th.rep { font-size: 12px; }

/* スマホは縦、PCは横 */
.board.h { display: none; }
@media (min-width: 760px) {
  .board.v { display: none; }
  .board.h { display: table; }
  .board.h .score { font-size: 22px; }
  .board.ind { max-width: 720px; }
}

/* 個人戦 */
.add-bout {
  width: 100%;
  max-width: 720px;
  display: block;
  padding: 12px;
  border: 1px dashed var(--accent);
  background: var(--surface);
  color: var(--accent);
  border-radius: var(--radius);
  font-weight: 700;
  margin-bottom: 12px;
}

/* 同点のとき */
.tie {
  background: #fff7e6;
  border: 1px solid #f0c36d;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}
.tie p { margin: 0 0 8px; font-weight: 700; }
.tie button {
  margin: 0 8px 4px 0;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
}
.tie button:first-of-type { background: var(--accent); color: #fff; }

.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* ---------- 下のボタン ---------- */
.toolbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 10;
}
.toolbar button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 2px;
  font-size: 13px;
  line-height: 1.3;
  min-height: 48px;
  word-break: keep-all;
}
.toolbar button:disabled { opacity: 0.4; cursor: default; }
.toolbar button.danger { color: var(--warn); }
.toolbar button.save { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; }
.toolbar button.save.done { background: var(--accent-soft); color: var(--accent); }
.toolbar button.save.done::before { content: "✓ "; }
@media (min-width: 760px) {
  .toolbar { grid-template-columns: repeat(4, 160px); justify-content: center; }
  .toolbar button { font-size: 14px; }
}

/* ---------- 選択パネル ---------- */
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
.sheet[hidden] { display: none; }
.sheet-panel {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 85vh;
  overflow-y: auto;
}
@media (min-width: 760px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 16px; }
}
.sheet-panel h2 { margin: 0 0 12px; font-size: 17px; }
.sheet-panel .sub { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.choices button {
  min-height: 52px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  font-size: 16px;
  padding: 6px;
}
.choices button.waza { font-size: 20px; font-weight: 700; border-color: var(--accent); color: var(--accent); }
.choices button.warn { color: var(--warn); border-color: #e5a29b; }
.choices button.skip { color: var(--muted); }
.choices button.undo { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.choices button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.choices button[hidden], .choices[hidden], .sub[hidden] { display: none; }
.choices.one { grid-template-columns: 1fr; }
.choices button.reg { border-color: var(--accent); color: var(--accent); font-weight: 700; }
/* 何回戦などの小さめの選択肢 */
.choices.chips { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choices.chips button { min-height: 44px; font-size: 14px; padding: 4px; }
.meta-form { margin-bottom: 12px; }
.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input {
  display: block;
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 17px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  min-height: 46px;
}
.primary.wide { width: 100%; min-height: 48px; font-size: 16px; }
.name-form { display: flex; gap: 8px; margin-bottom: 12px; }
.name-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 17px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.primary {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 0 18px;
  font-weight: 700;
}
.sheet-cancel {
  width: 100%;
  padding: 12px;
  border: 0;
  background: var(--head);
  border-radius: 10px;
}

/* ---------- お知らせ ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100% - 32px);
  text-align: center;
  z-index: 30;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 入力以外の画面では、下のボタンと試合形式を出さない ---------- */
body:not([data-view="input"]) { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body:not([data-view="input"]) .modes,
body:not([data-view="input"]) .toolbar { display: none; }
body:not([data-view="input"]) .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* 大会名・何回戦・日時 */
.meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 12px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}
.meta-bar .meta-title { font-weight: 700; flex: 1 1 auto; min-width: 0; word-break: break-all; }
.meta-bar .meta-date { color: var(--muted); font-size: 14px; }
.meta-edit {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 1px 10px;
  white-space: nowrap;
}
.placeholder { color: #a0a6b1; font-weight: 400; }

/* 見るだけの表 */
.board.ro td:active { background: inherit; }
.board.ro .name, .board.ro .score, .board.ro .team-name { cursor: default; }

/* ---------- 記録・成績の共通 ---------- */
#records, #stats { max-width: 720px; margin: 0 auto; }
.view-title { font-size: 18px; margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; }
.view-title .count { font-size: 13px; color: var(--muted); font-weight: 400; }
.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 12px;
}

/* 記録の一覧 */
.rec-list { display: grid; gap: 10px; }
.rec-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.rec-item:active { background: var(--accent-soft); }
.rec-item > span { display: flex; }
.rec-top { justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.rec-meta { font-weight: 700; font-size: 15px; margin-bottom: 4px; word-break: break-all; }
.rec-row { align-items: center; gap: 8px; padding: 3px 0; border-top: 1px solid var(--soft-line); }
.rec-sym { width: 1.4em; font-size: 18px; font-weight: 700; text-align: center; flex: none; }
.rec-name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.rec-pts { flex: none; font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.rec-row.ind .rec-name { font-size: 15px; }
.rec-row.ind .rec-name.r { text-align: right; }
.rec-name mark { background: var(--win); color: inherit; padding: 0 4px; border-radius: 4px; }
/* 「自分｜相手」の本数 */
.pair { flex: none; display: inline-flex; align-items: center; font-weight: 700; font-size: 15px; }
.pair i { font-style: normal; min-width: 2.2em; }
.pair i:first-child { text-align: right; }
.pair span { color: var(--muted); font-weight: 400; padding: 0 2px; }
.rec-more { font-size: 13px; color: var(--muted); padding-top: 2px; }

/* 記録を1つ開いたところ */
.back {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  padding: 8px 0;
  min-height: 44px;
  margin-bottom: 4px;
}
.rec-head h2 { margin: 0; font-size: 18px; word-break: break-all; }
.rec-head p { margin: 2px 0 12px; color: var(--muted); font-size: 14px; }
.rec-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.rec-actions button {
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  font-size: 15px;
}
.rec-actions .wide { grid-column: 1 / -1; }
.rec-actions .primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.rec-actions .danger { color: var(--warn); border-color: #e5a29b; margin-top: 12px; }

/* 成績 */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--head);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.seg button { border: 0; background: transparent; border-radius: 7px; min-height: 40px; font-size: 15px; }
.seg button.on { background: var(--surface); color: var(--accent); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
/* 見る内容の切り替え（記録｜成績｜メンバーなど） */
.seg.ctx { margin: 0 0 12px; }
.seg.ctx.n3 { grid-template-columns: 1fr 1fr 1fr; }
.seg.ctx button { min-width: 0; overflow-wrap: anywhere; }
.picker {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  text-align: left;
  font-size: 17px;
}
.picker b, .picker .placeholder { flex: 1; min-width: 0; word-break: break-all; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}
.card h3 { margin: 0 0 10px; font-size: 16px; }
.card h4 { margin: 12px 0 4px; font-size: 14px; color: var(--accent); }
.card h4:first-of-type { margin-top: 0; }
.card .hint { margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 6px; }
.tile { background: var(--head); border-radius: 8px; padding: 8px 4px; text-align: center; }
.tile b { display: block; font-size: 24px; line-height: 1.2; }
.tile span { font-size: 12px; color: var(--muted); }
.tile.win { background: var(--win); }
.tile.win b { color: var(--win-ink); }
.tile.lose { background: var(--lose); }
.tile.lose b { color: var(--lose-ink); }
.note { margin: 8px 0 0; font-size: 14px; }
.waza { width: 100%; border-collapse: collapse; table-layout: fixed; }
.waza th, .waza td { padding: 6px 4px; border-bottom: 1px solid var(--soft-line); text-align: left; font-size: 15px; }
.waza thead th { font-size: 12px; color: var(--muted); font-weight: 400; }
.waza tbody th { width: 3.6em; font-weight: 600; }
.waza thead th:first-child { width: 3.6em; }
.waza td { white-space: nowrap; }
.waza td b { display: inline-block; min-width: 1.8em; text-align: right; font-size: 16px; }
.bar { display: inline-block; vertical-align: middle; width: calc(100% - 2.2em); height: 10px; background: #f0f2f5; border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #e2847b; border-radius: 5px; }
.bar.against i { background: #7aa7d8; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--soft-line); font-size: 15px; }
.kv li:last-child { border-bottom: 0; }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  background: transparent;
  padding: 8px 0;
  text-align: left;
  min-height: 52px;
}
.hist:active { background: var(--accent-soft); }
.hist-res {
  flex: none;
  min-width: 4.4em;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--head);
}
.hist-res.win { background: var(--win); color: var(--win-ink); }
.hist-res.lose { background: var(--lose); color: var(--lose-ink); }
.hist-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hist-who { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .pair { max-width: 45%; white-space: nowrap; }
.reg-list { list-style: none; margin: 8px 0; padding: 0; }
.reg-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--soft-line); }
.reg-name { flex: 1; min-width: 0; word-break: break-all; }
button.reg-name { text-align: left; background: none; border: 0; padding: 10px 0; min-height: 44px; font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; }
.reg-name small { margin-left: 8px; color: var(--muted); font-size: 13px; }
.reg-list button {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #e5a29b;
  background: var(--surface);
  color: var(--warn);
  border-radius: 8px;
  font-size: 14px;
}
.card .add-bout { margin: 8px 0 0; max-width: none; }

/* ---------- グループ ---------- */
#groups { max-width: 720px; margin: 0 auto; }
.lead { margin: -4px 0 12px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 24px 0; margin: 0; }
.loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } }
.retry, .refresh {
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  border-radius: 999px;
  font-size: 14px;
}
.retry { display: block; margin: 12px auto 0; min-height: 44px; padding: 0 18px; }
.view-title .refresh { margin-left: auto; font-size: 13px; font-weight: 400; padding: 2px 12px; min-height: 32px; }

/* グループの一覧 */
.group-item:focus-visible { outline: 3px solid #3b6fd8; outline-offset: 1px; }
.rec-item > .rec-by { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* グループの一覧 */
.group-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.group-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}
.group-item:active { background: var(--accent-soft); }
.group-item::after { content: "›"; color: var(--muted); font-size: 22px; line-height: 1; }
.group-name { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; word-break: break-all; }
.role { flex: none; font-size: 12px; color: var(--muted); background: var(--head); border-radius: 999px; padding: 2px 8px; }
.role.owner { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.card h3 .count { margin-left: 8px; font-size: 13px; color: var(--muted); font-weight: 400; }
.reg-list.members li { min-height: 44px; }
.card .rec-actions { margin-top: 8px; }
.card.account .note { margin-top: 0; }
.email { word-break: break-all; }
.warn-note {
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  margin: 8px 0 12px;
}
.sheet-panel .note { margin: 0 0 10px; font-size: 15px; }
.field input[readonly] { background: var(--head); font-size: 14px; }

/* 共有するグループを選ぶ（チェックの印つき） */
.choices button.toggle { display: flex; align-items: center; gap: 10px; text-align: left; padding: 6px 14px; word-break: break-all; }
.choices button.toggle::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}
.choices button.toggle.on::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%23fff' stroke-width='2.2'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.choices button.primary { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; }
.danger-btn {
  border: 0;
  background: var(--warn);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
}
.danger-btn.wide { width: 100%; min-height: 48px; font-size: 16px; }
.danger-btn:disabled { opacity: 0.35; cursor: default; }
.nick-row { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.nick-row > span { flex: 1; min-width: 0; word-break: break-all; }
.nick-row .meta-edit { background: var(--surface); min-height: 32px; font: inherit; font-size: 13px; }
.card .nick-help { margin: 4px 0 12px; }
.sheet .nick-help { margin: -6px 0 12px; }
/* パネルを開いている間は、お知らせを上に出す */
body.sheet-open .toast,
body.sheet-open:not([data-view="input"]) .toast { top: calc(16px + env(safe-area-inset-top)); bottom: auto; transform: translateX(-50%) translateY(-20px); }
body.sheet-open .toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- フォルダ ---------- */
.list-title { font-size: 15px; margin: 16px 0 8px; color: var(--muted); font-weight: 700; }
.folder-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
@media (min-width: 760px) { .folder-list { grid-template-columns: 1fr 1fr; } }
.folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}
.folder-item:active { background: var(--accent-soft); }
.folder-item:focus-visible, .crumbs button:focus-visible, .chip button:focus-visible, .chip.add:focus-visible { outline: 3px solid #3b6fd8; outline-offset: 1px; }
.folder-item::after { content: "›"; color: var(--muted); font-size: 22px; line-height: 1; }
/* フォルダの形（つまみの付いた四角） */
.folder-icon { flex: none; position: relative; width: 24px; height: 18px; margin-top: 3px; background: #f2c464; border-radius: 2px 4px 4px 4px; }
.folder-icon::before { content: ""; position: absolute; left: 0; top: -4px; width: 11px; height: 5px; background: #f2c464; border-radius: 3px 3px 0 0; }
.folder-item.none .folder-icon, .folder-item.none .folder-icon::before { background: #c9ced8; }
.folder-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.folder-name { font-weight: 700; font-size: 16px; word-break: break-all; }
.folder-sub { font-size: 12px; color: var(--muted); }
.folder-new { margin-top: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.crumbs button { border: 0; background: transparent; color: var(--accent); padding: 6px 2px; min-height: 36px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.crumbs b { color: var(--ink); word-break: break-all; }
.folder-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.folder-acts button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: 14px; }
.folder-acts .danger { color: var(--warn); border-color: var(--danger-line); }
.rec-item > .rec-dup { display: block; margin-top: 4px; font-size: 12px; color: #8a5a00; background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 6px; padding: 2px 8px; }
/* 記録の詳細・保存のパネル：入っているフォルダ */
.rec-folders, .save-folders { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.rf-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 32px; padding: 2px 4px 2px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; word-break: break-all; }
.chip.none { padding-right: 12px; background: var(--head); color: var(--muted); }
.chip-x { border: 0; background: transparent; color: var(--accent); min-width: 32px; min-height: 32px; font-size: 16px; border-radius: 999px; }
.chip.add { border: 1px dashed var(--accent); background: var(--surface); padding: 2px 12px; font: inherit; font-size: 14px; color: var(--accent); }
.choices.tree button { text-align: left; min-height: 46px; font-size: 15px; }
.choices.tree button.toggle { padding-top: 4px; padding-bottom: 4px; }
.folder-quick { margin-top: 4px; }
.folder-quick button { flex: none; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); border-radius: 10px; padding: 0 12px; font-weight: 700; }
.picker.folder-filter { min-height: 44px; font-size: 15px; border-color: var(--line); margin-top: -4px; }
.ff-label { flex: none; font-size: 13px; color: var(--muted); }

/* ---------- 登録した選手とチーム ---------- */
/* 選手名のパネル：入力済みの選手（後ろに回す）、チーム名がまだのときの案内 */
.choices button small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; line-height: 1.2; }
.choices button.done { background: var(--head); color: var(--muted); }
.name-note.warn-note { margin: 0 0 12px; }
.name-note.warn-note p { margin: 0 0 8px; font-weight: 700; }
.name-note.warn-note .choices { margin-bottom: 0; }
.sheet-panel .name-note.note { color: var(--muted); font-size: 14px; }
.sheet-panel .name-hint { margin: -4px 0 12px; }
/* 個人戦：チームを選ぶ */
.team-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.team-chips button {
  min-height: 40px;
  max-width: 100%;
  padding: 4px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 15px;
  word-break: break-all;
}
.team-chips button.on { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; }
.team-chips button.none { color: var(--muted); }
.team-chips button.none.on { color: #fff; }
.team-chips button.add { border-style: dashed; border-color: var(--accent); color: var(--accent); }
.team-chips button:focus-visible, .team-head:focus-visible, .team-acts button:focus-visible { outline: 3px solid #3b6fd8; outline-offset: 1px; }
.choices.team-pick { margin-top: -4px; }
.choices.chips button { word-break: break-all; }
.choices.assign { grid-template-columns: repeat(2, 1fr); }
/* 成績：登録した選手をチームごとに */
.team-sec { border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0 0; background: var(--surface); }
.team-sec.none { border-color: var(--note-line); }
.team-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  text-align: left;
}
.team-head::after { content: "›"; flex: none; color: var(--muted); font-size: 22px; line-height: 1; transition: transform 0.15s; }
.team-head[aria-expanded="true"]::after { transform: rotate(90deg); }
.team-title { flex: 1; min-width: 0; font-weight: 700; word-break: break-all; }
.team-sec.none .team-title { color: #8a5a00; }
.team-head .count { flex: none; font-size: 13px; color: var(--muted); }
.team-body { padding: 0 12px 12px; }
.team-body .warn-note { margin: 0 0 4px; }
.team-body .reg-list { margin: 0 0 8px; }
.reg-list button.edit { border-color: var(--line); color: var(--accent); }
.team-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.team-acts button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: 14px; }
.team-acts .add { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.team-acts .danger { color: var(--warn); border-color: var(--danger-line); }
.team-acts .primary { border-color: var(--accent); background: var(--accent); color: #fff; padding: 0 16px; }
.picker b small { margin-left: 8px; font-size: 13px; color: var(--muted); font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .team-head::after { transition: none; } }

/* デモデータの案内（記録の画面のいちばん下） */
.demo-box {
  margin: 24px 0 8px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
}
.demo-box p { margin: 0 0 10px; line-height: 1.6; }
.demo-box button {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}
.demo-box button.danger { color: var(--warn); border-color: var(--danger-line); }

/* 成績：試合の一覧のポジション、ポジションの割合 */
.hist-pos { font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; margin-right: 6px; }
.pos-table td.pct { width: 3.5em; text-align: right; color: var(--muted); font-size: 13px; }
.reg-list button.reg-name { flex: 1; border: 0; background: none; color: var(--ink); text-align: left; padding: 10px 0; font-weight: 400; }
.reg-list button.reg-name small { color: var(--muted); }

/* 記録・成績の「戻る」「進む」 */
.nav-bar { display: flex; gap: 8px; margin: 0 0 10px; }
.nav-bar button { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; }
.nav-bar button:disabled { color: var(--muted); opacity: .45; }

/* 共有のパネル：グループごとのフォルダ */
.share-groups { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.share-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
.share-group.on { border-color: var(--accent); }
.share-group .toggle { width: 100%; }
.save-folders.gf { margin: 8px 4px 2px; align-items: center; }
.gf-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
/* フォルダに直接入力 */
.input-here { margin: 4px 0 12px; }
.dest-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.dest-bar span { flex: 1; min-width: 0; word-break: break-all; }
.dest-bar small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.dest-bar button { flex: none; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent); font: inherit; font-size: 13px; }

/* 最後の試合の終え忘れ */
.finish-box { margin: 10px 0 4px; padding: 12px; border: 1px solid var(--note-line); background: var(--note-bg); border-radius: var(--radius); }
.finish-box p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.finish-box button { width: 100%; min-height: 48px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 700; }

/* 結果の欄：記録用紙のように、一本は取った順の枠に赤で、反則は小さい▲ */
.board .score { position: relative; padding: 4px 3px; }
.board .slots { display: flex; height: 100%; min-height: 40px; }
.board .slots i {
  flex: 1 1 0;
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-weight: 700; font-size: 18px; line-height: 1;
  color: var(--win-ink);
  border-left: 1px solid var(--soft-line);
}
.board .slots i:first-child { border-left: 0; }
.board .foul {
  position: absolute; top: 2px; left: 3px;
  font-size: 9px; line-height: 1; font-weight: 400;
  color: var(--win-ink);
}
.board .c-mid { width: 18px; }
.board th.mid, .board td.mid { padding: 0; background: var(--surface); }
.board td.mid span {
  display: inline-block;
  writing-mode: vertical-rl;
  font-size: 10px; line-height: 1.1; letter-spacing: 0;
  color: var(--ink);
}
.board .result td.mid { background: #fafafa; }
.board.h tr.mid-row td, .board.h tr.mid-row th { height: 18px; padding: 0; }
.board.h tr.mid-row td span { writing-mode: horizontal-tb; font-size: 11px; }
@media (min-width: 760px) {
  .board.h .score .slots i { font-size: 20px; }
}
/* 右側（下側）の選手の反則は、その選手の名前に近い角に */
.board.v .foul.s1, .board.ind .foul.s1 { left: auto; right: 3px; }
.board.h .foul.s1 { top: auto; bottom: 2px; }

/* チームの成績：選手（出場が多い順） */
.tp-list { list-style: none; margin: 0; padding: 0; }
.tp-list li { border-bottom: 1px solid var(--soft-line); }
.tp-list li:last-child { border-bottom: 0; }
.tp { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 2px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.tp-name { flex: 1; min-width: 0; font-size: 16px; word-break: break-all; }
.tp-rec { font-size: 12px; color: var(--muted); }
.tp-n { font-size: 12px; color: var(--muted); min-width: 4em; text-align: right; }
.tp-n b { font-size: 16px; color: var(--ink); margin-right: 1px; }
.tp-go { color: var(--muted); font-size: 18px; }

/* =====================================================================
   見た目の整理（2026/10）
   ・枠で囲むのは、タップして開く物（記録・フォルダ・グループ）と表だけ。ほかは余白と見出しで区切る
   ・ボタンは2種類：主なボタン（藍の塗り）と控えめなボタン（枠線）。点線は使わない
   ・文字は 12/14/16/20/30px の5段階。見出しと数字ははっきり大きく
   ===================================================================== */

/* 見出し */
.view-title { font-size: var(--fs-l); font-weight: 700; margin: 4px 0 16px; letter-spacing: 0.02em; }
.view-title .count { font-size: var(--fs-s); }
.rec-head h2 { font-size: var(--fs-l); }
.rec-head p { font-size: var(--fs-s); }

/* カード → 枠なしのまとまり。まとまりの間は線1本と余白 */
.card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 0 4px;
  margin: 0 0 12px;
}
.card h3 { font-size: var(--fs-m); font-weight: 700; margin: 0 0 12px; }
.card h4 { font-size: var(--fs-s); }
.card .hint { margin-top: 10px; }

/* 数字（勝敗・本数）は大きく */
.tiles { gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--soft-line); border-radius: 10px; padding: 10px 4px 8px; }
.tile b { font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
.tile span { font-size: var(--fs-xs); }
.tile.win, .tile.lose { border-color: transparent; }
.bar { background: var(--soft-line); }
.bar i { background: var(--red); opacity: 0.75; }
.bar.against i { background: var(--lose-ink); opacity: 0.55; }

/* 説明文は控えめに */
.hint { font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }

/* 空のとき：点線の箱はやめ、文字だけを落ち着いて出す */
.empty { background: transparent; border: 0; padding: 28px 8px; font-size: var(--fs-s); line-height: 1.7; }

/* ---------- ボタンは2種類 ---------- */
/* 控えめなボタン：生成りに近い白・細い枠・藍の文字 */
.add-bout,
.rec-actions button,
.folder-acts button,
.team-acts button,
.nav-bar button,
.demo-box button,
.dest-bar button,
.retry,
.refresh,
.folder-quick button,
.tie button,
.reg-list button,
.chip.add,
.team-chips button.add {
  border: 1px solid var(--line);
  border-style: solid;
  background: var(--surface);
  color: var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: none;
}
.add-bout { min-height: 48px; font-size: var(--fs-m); }
.folder-acts button, .team-acts button { border-radius: var(--radius); }
.chip.add, .team-chips button.add { border-radius: 999px; }
/* 危ない操作は、控えめなボタンの赤い文字 */
.rec-actions .danger,
.folder-acts .danger,
.team-acts .danger,
.demo-box button.danger,
.reg-list button.danger,
.reg-list button:not(.edit):not(.reg-name) { color: var(--red); border-color: var(--danger-line); }
.reg-list button.edit { color: var(--accent); border-color: var(--line); }
/* 主なボタン：藍の塗り */
.primary,
.rec-actions .primary,
.team-acts .primary,
.choices button.primary,
.finish-box button,
.tie button:first-of-type,
.toolbar button.save {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-weight: 700;
}
.toolbar button { border-radius: var(--radius); font-size: 13px; }
.toolbar button.save.done { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.toolbar button.danger { color: var(--red); }

/* 「変更」は枠なしの文字ボタン */
.meta-edit { border: 0; padding: 2px 4px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; background: transparent; }

/* ---------- 黄色の箱は本当に大事な所だけ。枠線はやめて色だけで ---------- */
.warn-note, .tie, .finish-box { border: 0; background: var(--note-bg); }
.team-sec.none { border-color: var(--line); }
.team-sec.none .team-title { color: var(--ink); }

/* デモの案内：点線の箱をやめ、いちばん下に控えめに */
.demo-box { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 18px 0 0; margin-top: 28px; }

/* ---------- 記録の一覧・フォルダ・グループ（タップして開く物は白い面で） ---------- */
.rec-item, .folder-item, .group-item { border-color: var(--soft-line); border-radius: 12px; }
.rec-meta { font-size: var(--fs-m); }
.folder-icon, .folder-icon::before { background: #d9b46a; }

/* ---------- 成績のピッカー・切り替え ---------- */
.picker { border-color: var(--line); background: var(--surface); }
.picker b { font-size: var(--fs-l); }
.seg { background: var(--head); }

/* ---------- 選択パネル ---------- */
.sheet-panel h2 { font-size: 18px; }
.choices button { border-color: var(--line); }
.choices button.waza { border-color: var(--line); color: var(--ink); font-size: var(--fs-l); }

/* ---------- ヘッダー ---------- */
.app-header { background: var(--accent); }
.modes button.on { color: var(--accent); }

/* ---------- 記録表 ---------- */
.board th { background: var(--head); }
.board .result th, .board .result td, .board .result td.mid { background: #f7f4ee; }
.board .slots i { color: var(--red); }
.board .foul { color: var(--red); }

/* 選択パネル：色を3つ（白・藍・赤の文字）に絞る */
.sheet-panel { background: var(--surface); }
.sheet-cancel { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.choices button.warn { border-color: var(--line); color: var(--red); }
/* 案内の中のボタンは控えめなボタンにする（主なボタンは「決定」だけ） */
.name-note.warn-note .choices button.primary { background: var(--surface); border: 1px solid var(--accent); color: var(--accent); }
.name-note.warn-note p { font-weight: 400; color: var(--ink); }
.field input, .name-form input { border-color: var(--line); }
.field input:focus, .name-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

/* 選手・チームを選ぶパネルの検索 */
.pick-search {
  display: block; width: 100%; min-height: 46px; margin: 0 0 12px; padding: 10px 12px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.pick-search:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.pick-sec[hidden] { display: none; }
.pick-none { margin: 0 0 12px; }

/* ---------- みんなの場所（だれでも見られる） ---------- */
.field[hidden], .pub-cands[hidden], .pub-tcands [hidden] { display: none; }
.field select {
  display: block; width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px;
  font: inherit; font-size: 17px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
}
.field select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.pub-days { margin-bottom: 10px; }
.pub-cands .choices button { font-weight: 700; }
.pub-year { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 12px; }
.pub-year b { font-size: var(--fs-m); white-space: nowrap; }
.pub-year button {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--accent); font-size: var(--fs-s); white-space: nowrap;
}
.pub-year button:disabled { color: var(--muted); opacity: .45; cursor: default; }
.pub-ents .folder-item { min-height: 56px; }
.pub-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 20px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pub-links button {
  border: 0; background: transparent; color: var(--accent); min-height: 44px; padding: 0 2px;
  font-size: var(--fs-s); text-decoration: underline; text-underline-offset: 3px;
}
.pub-links .pub-admin-btn { margin-left: auto; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.pub-tour-meta { margin: -10px 0 12px; color: var(--muted); font-size: var(--fs-s); }
.pub-from-local { margin: 0 0 8px; }
.list-title .count { margin-left: 8px; font-size: var(--fs-xs); font-weight: 400; }
.rec-item > .rec-votes { display: block; margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); }
.rec-votes .flag { font-style: normal; font-weight: 700; color: var(--red); margin-right: 8px; }
.pub-votes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.pub-votes button {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: var(--fs-m);
}
.pub-votes button b { font-size: var(--fs-l); }
.pub-votes button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.pub-votes button.bad.on { border-color: var(--red); background: var(--win); color: var(--red); }
.pub-votes button:focus-visible { outline: 3px solid #3b6fd8; outline-offset: 1px; }
.pub-flag { color: var(--red); font-weight: 700; }
.dest-bar.pub small { line-height: 1.6; }
.pub-name-help { margin: -4px 0 12px; }
.sheet-panel .pub-space { margin: -6px 0 12px; }
.pub-tcands .choices { margin-bottom: 8px; }
.pub-tcands .pub-tc-none { margin: 0 0 12px; }
.warn-note p { margin: 0 0 4px; }
.warn-note p:last-child { margin-bottom: 0; }
.terms p { margin: 0 0 10px; font-size: var(--fs-s); line-height: 1.7; }
.terms h4 { margin: 14px 0 4px; font-size: var(--fs-s); color: var(--accent); }
.terms ul { margin: 0 0 8px; padding-left: 1.2em; }
.terms li { font-size: var(--fs-s); line-height: 1.7; margin-bottom: 2px; }
.pub-form-link { display: block; margin: 8px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--accent); text-align: center; font-weight: 700; }
.pub-count { font-size: var(--fs-xl); margin-right: 4px; }
.card .pub-visitors { margin-top: 0; }
.card .pub-admin-rule { margin: 0 0 10px; }
.card .team-chips { margin-bottom: 10px; }
.card .pub-year { margin-top: 0; }
.picker.pub-scope b { font-size: var(--fs-m); }

/* ---------- ホーム・みんなの記録 ---------- */
.app-header h1.brand button { border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; padding: 6px 0; margin: -6px 0; cursor: pointer; }
.app-header h1.brand button:focus-visible { outline: 3px solid #9ec0ff; outline-offset: 2px; border-radius: 4px; }
.home { max-width: 560px; margin: 8px auto 0; display: grid; gap: 12px; }
.home-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 112px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--accent); text-align: center; min-width: 0;
}
.home-btn.primary { min-height: 136px; border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.home-btn:focus-visible { outline: 3px solid #3b6fd8; outline-offset: 2px; }
.hm-t { font-size: var(--fs-l); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.hm-s { font-size: var(--fs-xs); font-weight: 400; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.home-btn.primary .hm-s { color: rgba(255, 255, 255, 0.85); }
@media (max-width: 359px) { .hm-t { font-size: var(--fs-m); } }
.tiles { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 760px) { .tiles { grid-template-columns: 1fr 1fr 1fr; } }
.tile {
  width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--accent); font-size: var(--fs-m); font-weight: 700; text-align: center; overflow-wrap: anywhere;
}
.tile:active { background: var(--accent-soft); }
.tile:focus-visible { outline: 3px solid #3b6fd8; outline-offset: 1px; }

/* 設定へのリンク（ホームのいちばん下）・登録選手 */
.home-more { text-align: center; margin-top: 4px; }
.link-btn { border: 0; background: transparent; color: var(--accent); font-size: var(--fs-m); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 16px; }
.link-btn:focus-visible { outline: 3px solid #3b6fd8; outline-offset: 2px; }
.roster-list { margin-bottom: 12px; }
