/* Golf Log：スマホで片手操作しやすい最低限のスタイル */
:root {
  --green: #1f7a3a;
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #e3e3e6;
  --bg: #f6f6f4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--green); }
h1 { font-size: 1.3rem; margin: 0.4rem 0; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; }
.topbar { background: var(--green); padding: 0.7rem 1rem; padding-top: max(0.7rem, env(safe-area-inset-top)); }
.brand { color: #fff; font-weight: 700; text-decoration: none; }
.container { max-width: 640px; margin: 0 auto; padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
.muted { color: var(--muted); font-size: 0.9rem; }
.strong { font-weight: 700; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.error { background: #fdecec; color: #a11; padding: 0.6rem; border-radius: 8px; margin-bottom: 0.8rem; }

.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 0.6rem 0.9rem; font-size: 1rem; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-small { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; margin: 0.8rem 0; }
.btn.disabled { opacity: 0.3; }

.form label { display: block; margin-bottom: 0.9rem; font-size: 0.9rem; color: var(--muted); }
.form input { display: block; width: 100%; margin-top: 0.3rem; padding: 0.7rem; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; }

.list { list-style: none; padding: 0; margin: 0; }
.list-item { display: flex; align-items: center; gap: 0.5rem; background: #fff; border-radius: 12px; padding: 0.7rem; margin-bottom: 0.6rem; }
.list-link { flex: 1; display: flex; justify-content: space-between; align-items: center; color: inherit; text-decoration: none; }
.score { font-size: 1.3rem; font-weight: 700; }

.scorecard { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.scorecard th, .scorecard td { padding: 0.45rem; text-align: center; border-bottom: 1px solid var(--line); }
.scorecard thead, .scorecard tfoot { background: #eef5ef; }

/* 記録画面 */
.hole-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.hole-info { text-align: center; }
.hole-label { font-size: 1.4rem; font-weight: 700; }
.hole-strokes { color: var(--muted); }
.mic {
  display: block; width: 100%; height: 9rem; margin: 1rem 0 0.5rem; border: none; border-radius: 20px;
  background: var(--green); color: #fff; font-size: 1.5rem; font-weight: 700;
}
.mic.listening { background: #c0392b; }
.status { min-height: 2.6em; text-align: center; }
.manual { display: flex; gap: 0.4rem; }
.manual input { flex: 1; padding: 0.6rem; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; }
.holeout { background: #fff; border-radius: 12px; padding: 0.8rem; }
.holeout-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.holeout-row strong { font-size: 1.6rem; min-width: 2.5rem; text-align: center; }
.events { list-style: none; padding: 0; margin: 0; }
.event { background: #fff; border-radius: 8px; padding: 0.5rem 0.7rem; margin-bottom: 0.4rem; font-size: 0.92rem; }
.event-pre_shot { border-left: 4px solid var(--green); }
.event-result { border-left: 4px solid #e0a800; }
.event-hole_out { border-left: 4px solid #555; }

/* ホール詳細 */
.map { height: 55vh; border-radius: 12px; margin: 0.6rem 0 0.2rem; }
.attribution { font-size: 0.75rem; color: var(--muted); margin: 0 0 0.8rem; }
.shot-pin {
  background: #ffd400; color: #000; border: 2px solid #000; border-radius: 50%;
  font-weight: 700; font-size: 13px; line-height: 22px; text-align: center;
}
.shots { list-style: none; padding: 0; }
.shots li { background: #fff; border-radius: 10px; padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; }
.badge { display: inline-block; width: 1.6rem; height: 1.6rem; line-height: 1.6rem; text-align: center; border-radius: 50%; background: #ffd400; font-weight: 700; margin-right: 0.3rem; }
.transcript { color: var(--muted); font-size: 0.85rem; }

/* ログイン・ヘッダー */
.topbar { display: flex; justify-content: space-between; align-items: center; }
.topbar-user { color: #fff; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.inline-form { display: inline; margin: 0; }
.topbar-logout { background: transparent; border: 1px solid rgba(255,255,255,0.6); color: #fff; border-radius: 8px; padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.flash { margin: 0.6rem 1rem 0; padding: 0.6rem 0.8rem; border-radius: 8px; background: #eef5ef; }
.flash-alert { background: #fdecec; color: #a11; }
.login { text-align: center; padding-top: 2rem; }
.login form { margin: 0; }
.btn-google { background: #fff; border-color: #dadce0; font-weight: 600; }
.btn-line { background: #06c755; border-color: #06c755; color: #fff; font-weight: 600; }
.btn-apple { background: #000; border-color: #000; color: #fff; font-weight: 600; }
.login { max-width: 420px; margin: 0 auto; }
.login .form { text-align: left; }
.form .checkbox { display: flex; align-items: center; gap: 0.4rem; }
.form .checkbox input { display: inline; width: auto; margin: 0; }
.divider { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.85rem; margin: 1rem 0 0.4rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.event-correction { border-left: 4px solid #2f6fd6; }

/* ラウンドレポート（ダーク） */
body.dark { background: #333; color: #fff; }
body.dark a { color: #9fd3a8; }
.report-kicker { color: #bbb; font-size: 0.8rem; letter-spacing: 0.04em; }
.report-title { font-size: 1.7rem; margin: 0.5rem 0 0.3rem; }
.report-sub { color: #aaa; font-size: 0.9rem; margin: 0 0 0.8rem; }
.report-heading { font-size: 1rem; margin: 0; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: 1rem; border-bottom: 1px solid #555; margin-bottom: 1.2rem; }
.totals-label { color: #bbb; font-size: 0.8rem; }
.totals-value { font-size: 2.2rem; font-weight: 700; }
.hole-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin: 0.8rem 0 1.2rem; padding-bottom: 1.2rem; border-bottom: 1px solid #555; }
body.dark a.hole-cell { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.4rem 0; background: #161616; border-radius: 8px; color: #fff; text-decoration: none; }
.hole-cell-no { color: #aaa; font-size: 0.75rem; }
.hole-cell-score { font-weight: 600; }
.hole-head { display: flex; justify-content: space-between; align-items: center; }
body.dark a.hole-step { color: #fff; text-decoration: none; padding: 0.3rem 0.7rem; background: #161616; border-radius: 8px; margin-left: 0.3rem; }
.hole-section .map { height: 60vh; border-radius: 18px; margin: 0.8rem 0 0.2rem; background: #3f5a3e; }
body.dark .attribution, body.dark .attribution a { color: #999; }
.shot-pin { background: #cf4f44; color: #fff; border: 3px solid #fff; border-radius: 50%; font-weight: 700; font-size: 15px; line-height: 26px; text-align: center; }
.leaflet-tooltip.shot-label { background: transparent; border: none; box-shadow: none; color: #fff; font-size: 17px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); padding: 0; }
.leaflet-tooltip.shot-label::before { display: none; }
.shot-table { width: 100%; border-collapse: collapse; }
.shot-table td { padding: 0.7rem 0; border-bottom: 1px solid #484848; width: 33%; }
.shot-table .shot-note td { color: #aaa; font-size: 0.85rem; padding-top: 0; }
.form select { display: block; width: 100%; margin-top: 0.3rem; padding: 0.7rem; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
