/* 麻雀会サイト スマホ最優先スタイル */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #1b7a43;        /* 雀卓の緑 */
  --green-dark: #145c33;
  --bg: #f4f5f2;
  --card: #ffffff;
  --text: #22302a;
  --muted: #6b7a72;
  --line: #e2e6e1;
  --red: #c0392b;
  --yellow-bg: #fff7e0;
}

html { font-size: 16px; }
body {
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 76px; /* 下部ナビの分 */
}

/* 上部バー */
.topbar {
  background: var(--green);
  color: #fff;
  padding: 12px 16px;
  position: sticky; top: 0; z-index: 10;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }

.container { max-width: 640px; margin: 0 auto; padding: 16px 12px; }

h2 { font-size: 1.05rem; margin: 20px 4px 8px; color: var(--green-dark); }
h3 { font-size: 1rem; margin-bottom: 10px; color: var(--green-dark); }

/* カード */
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  display: block;
}

/* 次回開催カード */
.next-card { text-decoration: none; color: inherit; border-left: 6px solid var(--green); }
.next-label { color: var(--green); font-weight: 700; font-size: .85rem; }
.next-date { font-size: 1.4rem; font-weight: 700; margin: 4px 0; }
.next-place { color: var(--muted); font-size: .9rem; }
.next-names { margin-top: 8px; font-size: 1.05rem; font-weight: 600; }

/* 開催リスト */
.event-list { display: flex; flex-direction: column; gap: 8px; }
.event-row {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.event-row.past { opacity: .75; }
.event-row.cancelled { opacity: .5; }
.event-date { font-weight: 700; min-width: 74px; }
.event-main { flex: 1; min-width: 0; }
.event-teams { font-size: .85rem; color: var(--muted); }
.event-names { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* バッジ */
.badge {
  font-size: .72rem; padding: 3px 8px; border-radius: 999px;
  background: var(--line); color: var(--text); white-space: nowrap;
}
.badge.green { background: #d9f2e2; color: var(--green-dark); }
.badge.yellow { background: var(--yellow-bg); color: #8a6d1a; }
.badge.gray { background: #e6e6e6; color: #777; }

/* 開催詳細 */
.detail-date { font-size: 1.3rem; font-weight: 700; }
.detail-place { color: var(--muted); margin-bottom: 10px; }
.member-list { list-style: none; }
.member-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.member-list li:last-child { border-bottom: none; }
.team-chip {
  display: inline-block; width: 22px; height: 22px; line-height: 22px;
  text-align: center; border-radius: 50%;
  background: var(--green); color: #fff; font-size: .75rem; font-weight: 700;
  margin-right: 8px;
}

/* フォーム */
label { display: block; margin-bottom: 12px; font-size: .9rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], input[type="file"], select {
  width: 100%; padding: 12px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 1rem; background: #fff; color: var(--text);
}
.two-col { display: flex; gap: 10px; }
.two-col label { flex: 1; }

/* ボタン */
.btn {
  display: inline-block; padding: 12px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 1rem; cursor: pointer; text-decoration: none; text-align: center;
}
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.btn.danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn.big { width: 100%; padding: 14px; margin-top: 6px; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.link { border: none; background: none; color: var(--green-dark); text-decoration: underline; padding: 4px 0; }

/* テーブル */
table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.num.minus { color: var(--red); }
.num.few { color: var(--red); }
.rank { font-weight: 700; color: var(--green-dark); }
.standings-table th { font-size: .8rem; color: var(--muted); }
.sum-row td { font-weight: 700; background: #fafbf9; }

/* 成績入力 */
.points-input { text-align: right; font-size: 1.2rem; }
.entry-table td:first-child { width: 45%; }

/* 年度ナビ */
.year-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.year-nav h2 { margin: 0; }

/* 管理 */
.admin-table td { font-size: .92rem; }
.small-text td { font-size: .78rem; color: var(--muted); }
.inline-form { display: inline; }
.member-form { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.member-form input[type="text"] { flex: 2; margin-top: 0; }
.member-form select { flex: 1; margin-top: 0; width: auto; }
.status-list { list-style: none; margin-bottom: 12px; }
.status-list li { padding: 4px 0; }

/* メッセージ */
.flash {
  background: #d9f2e2; color: var(--green-dark);
  padding: 12px; border-radius: 10px; margin-bottom: 12px; font-size: .95rem;
}
.error { color: var(--red); margin: 8px 0; font-size: .95rem; }
.hint { color: var(--muted); font-size: .82rem; margin: 8px 4px; }

/* ログイン */
.login-card { margin-top: 15vh; text-align: center; }
.login-card h1 { margin-bottom: 8px; }
.login-card p { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.login-card input { text-align: center; font-size: 1.2rem; margin-bottom: 10px; }
.danger-zone h3 { color: var(--red); }

/* 下部ナビ */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; text-align: center; padding: 8px 0 6px;
  text-decoration: none; color: var(--muted); font-size: 1.3rem; line-height: 1.1;
}
.bottomnav a span { display: block; font-size: .68rem; }
