:root {
  --bg: #eef9ff;
  --surface: #ffffff;
  --text: #073b72;
  --muted: #2b6da8;
  --line: #a9ddff;
  --primary: #1597f4;
  --primary-dark: #0874cb;
  --primary-deep: #075aab;
  --primary-soft: #dff4ff;
  --sky: #52c7ff;
  --sky-soft: #effaff;
  --yellow-soft: #fff4bd;
  --yellow-text: #936900;
  --danger: #d33b55;
  --shadow: 0 14px 34px rgba(21, 151, 244, .16);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(82,199,255,.35), transparent 32%),
    linear-gradient(180deg, #f7fdff 0%, #eaf8ff 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 15px env(safe-area-inset-bottom);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 2px 10px;
}
.eyebrow { margin: 0 0 2px; color: var(--primary); font-size: 11px; font-weight: 900; letter-spacing: .15em; }
h1 { margin: 0; font-size: 23px; letter-spacing: .01em; color: var(--primary-deep); }
h2 { margin: 0; font-size: clamp(25px, 7vw, 33px); line-height: 1.35; color: var(--primary-deep); }
h3 { margin: 0; font-size: 18px; }
p { line-height: 1.7; }
.spaced-title { margin-top: 17px; }
.center { text-align: center; }

.icon-button {
  width: 46px; height: 46px; border: 2px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--primary); font-size: 25px; box-shadow: 0 7px 18px rgba(21,151,244,.14);
}
.app-main { padding: 8px 0 28px; }

.progress-wrap { margin-bottom: 14px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #cceeff; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sky), var(--primary)); transition: width .3s ease; }

.todo {
  margin-bottom: 16px; padding: 14px 16px; border: 2px solid #8fd7ff; border-radius: 19px;
  background: #dff5ff; box-shadow: 0 8px 20px rgba(82,199,255,.10);
}
.todo-label { display: block; margin-bottom: 5px; color: var(--primary-dark); font-size: 12px; font-weight: 1000; letter-spacing: .08em; }
.todo strong { font-size: 18px; line-height: 1.55; color: #075aab; }

.card {
  padding: 22px 18px; border: 2px solid #b7e5ff; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.lead { margin: 9px 0 20px; color: var(--muted); font-weight: 650; }
.small-note { margin: 7px 0 11px; color: var(--muted); font-size: 13px; font-weight: 650; }
.rule-note {
  margin-top: 18px; padding: 13px 14px; border: 1px solid #a9ddff; border-radius: 15px;
  background: #ecf9ff; color: #1d659f; font-size: 13px; line-height: 1.65;
}

.pair-box { margin-top: 16px; padding: 16px; border: 2px solid #c1e9ff; border-radius: 19px; background: #f5fcff; }
.pair-title { margin-bottom: 12px; font-weight: 1000; color: var(--primary-deep); }
.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.field input {
  width: 100%; padding: 15px 14px; border: 2px solid #a9ddff; border-radius: 15px; background: #fff;
  color: var(--text); font-size: 18px; outline: none;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(21,151,244,.13); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segment { min-height: 48px; border: 2px solid #a9ddff; border-radius: 14px; background: #fff; color: var(--primary-deep); font-weight: 900; }
.segment.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

.actions { display: grid; gap: 10px; margin-top: 20px; }
.btn {
  width: 100%; min-height: 57px; padding: 13px 15px; border: 0; border-radius: 17px;
  font-weight: 1000; cursor: pointer; transition: transform .08s ease, opacity .2s ease; font-size: 17px;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .42; cursor: default; }
.btn-primary { background: linear-gradient(135deg, #29b6ff, #168cf0); color: white; box-shadow: 0 10px 22px rgba(21,151,244,.25); }
.btn-secondary { background: #e3f5ff; color: #0869b7; border: 1px solid #a9ddff; }
.btn-serve { background: #e5f7ff; color: #0569b4; border: 2px solid #89d5ff; }
.btn-receive { background: #dff4ff; color: #075aab; border: 2px solid #77cfff; }
.btn-side { background: var(--yellow-soft); color: var(--yellow-text); border: 2px solid #ffe176; }

.choice-grid { display: grid; gap: 12px; margin-top: 18px; }
.choice-card {
  width: 100%; padding: 18px 16px; text-align: left; border: 2px solid #b8e6ff; border-radius: 19px;
  background: #fff; color: var(--text); box-shadow: 0 7px 18px rgba(21,151,244,.08);
}
.choice-card strong { display: block; font-size: 20px; margin-bottom: 3px; color: var(--primary-deep); }
.choice-card span { color: var(--muted); font-size: 13px; }
.choice-card:active { background: #eaf8ff; }

.coin-stage { display: grid; place-items: center; min-height: 190px; padding: 10px 0; perspective: 700px; }
.coin {
  display: grid; place-items: center; width: 118px; height: 118px; border: 8px solid #f0bd29; border-radius: 50%;
  background: linear-gradient(145deg,#fff29a,#ffd94d); color: #7b5900; font-size: 30px; font-weight: 1000;
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.45), 0 14px 28px rgba(130,91,10,.18);
}
.coin.flipping { animation: coinFlip 1.15s cubic-bezier(.2,.8,.2,1); }
@keyframes coinFlip {
  0% { transform: translateY(0) rotateY(0) rotateX(0); }
  45% { transform: translateY(-48px) rotateY(900deg) rotateX(360deg); }
  100% { transform: translateY(0) rotateY(1800deg) rotateX(720deg); }
}

.result-banner { margin: 14px 0 4px; padding: 18px 16px; border-radius: 19px; background: linear-gradient(135deg,#23b6ff,#138ce9); color: white; text-align: center; }
.result-banner small { display: block; opacity: .92; margin-bottom: 4px; }
.result-banner strong { font-size: 25px; }

.summary-list { display: grid; gap: 10px; margin-top: 18px; }
.summary-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; padding-bottom: 10px; border-bottom: 1px solid #cdeeff; }
.summary-row:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-row dt { color: var(--muted); font-size: 13px; font-weight: 900; }
.summary-row dd { margin: 0; color: var(--text); font-weight: 900; }
.summary-list.compact { margin-top: 0; }

.position-map { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.position-box { padding: 17px 10px; border: 2px solid #9edcff; border-radius: 19px; text-align: center; background: #effaff; }
.position-box.right { background: #dff4ff; border-color: #6fcbff; }
.position-box.left { background: #eefaff; border-color: #9bddff; }
.position-box .side-label { color: var(--muted); font-size: 12px; font-weight: 900; }
.position-box .player-name { display: block; margin-top: 6px; font-size: 23px; font-weight: 1000; color: var(--primary-deep); }

.game-badge, .final-badge, .result-title-chip {
  display: inline-flex; align-items: center; justify-content: center; padding: 8px 13px; border-radius: 999px;
  background: #117fd4; color: #fff; font-size: 13px; font-weight: 1000; letter-spacing: .05em;
}
.final-badge { background: linear-gradient(135deg,#20b8ff,#0877d1); }
.result-title-chip { background: #0d8fe9; }

.call-card {
  margin-bottom: 15px; padding: 20px 16px; border: 3px solid #58c7ff; border-radius: 24px;
  background: linear-gradient(145deg,#1eb3ff,#0b86e5); color: #fff; text-align: center; box-shadow: 0 14px 28px rgba(21,151,244,.24);
}
.call-label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 1000; letter-spacing: .07em; }
.call-card strong { display: block; font-size: clamp(28px, 8vw, 40px); line-height: 1.45; word-break: keep-all; }
.call-card small { display: block; margin-top: 9px; font-size: 12px; opacity: .93; }

.guide-say { padding: 18px 15px; border: 2px solid #87d5ff; border-radius: 18px; background: #e8f8ff; text-align: center; }
.guide-say span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; }
.guide-say strong { display: block; margin-top: 5px; color: var(--primary-deep); font-size: 27px; }
.timer-card { margin-top: 14px; padding: 20px; border-radius: 20px; background: #075fae; color: #fff; text-align: center; }
.timer-card span { display: block; font-size: 13px; font-weight: 800; }
.timer-card strong { display: block; margin-top: 5px; font-size: 52px; line-height: 1; font-variant-numeric: tabular-nums; }

.match-screen { display: grid; gap: 14px; }
.scoreboard-mini { display: grid; grid-template-columns: 1fr .72fr 1fr; gap: 8px; }
.scoreboard-mini > div { padding: 10px 8px; border: 2px solid #a9ddff; border-radius: 16px; background: #fff; text-align: center; }
.scoreboard-mini span, .scoreboard-mini small { display: block; color: var(--muted); font-size: 10px; font-weight: 850; }
.scoreboard-mini strong { display: block; color: var(--primary-deep); font-size: 25px; line-height: 1.1; }
.scoreboard-mini .mini-game { background: #dff4ff; border-color: #6fcbff; }

.score-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-score { padding: 15px 10px; border: 2px solid #b4e5ff; border-radius: 19px; background: #fff; text-align: center; }
.pair-score.serving { border-color: #35baff; background: #e4f7ff; box-shadow: inset 0 0 0 2px #c0ebff; }
.pair-score span { display: block; min-height: 34px; color: var(--muted); font-size: 12px; font-weight: 900; }
.pair-score strong { display: block; color: var(--primary-deep); font-size: 46px; line-height: 1; }
.pair-score small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }

.current-card { padding: 20px 16px; border-radius: 24px; background: #0878cf; color: white; box-shadow: 0 16px 32px rgba(21,151,244,.22); }
.current-card.bright { background: linear-gradient(135deg,#11a6f5,#0877d1); }
.current-title { margin: 0 0 13px; font-size: 13px; opacity: .95; font-weight: 1000; letter-spacing: .06em; }
.current-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.current-item { padding: 15px 12px; border-radius: 17px; background: rgba(255,255,255,.16); }
.current-item span { display: block; font-size: 12px; font-weight: 900; }
.current-item strong { display: block; margin-top: 3px; font-size: 27px; line-height: 1.2; }
.current-item small { display: block; margin-top: 4px; font-size: 11px; opacity: .9; }

.next-card { padding: 17px; border: 2px dashed #75cbfa; border-radius: 20px; background: #f0fbff; }
.next-title { margin-bottom: 10px; color: var(--primary-dark); font-size: 12px; font-weight: 1000; letter-spacing: .08em; }
.next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.next-grid div { padding: 11px 7px; border-radius: 14px; background: #dff4ff; text-align: center; }
.next-grid span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.next-grid strong { display: block; margin-top: 4px; color: var(--primary-deep); font-size: 15px; }

.point-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.point-btn { min-height: 112px; border: 0; border-radius: 22px; color: #fff; box-shadow: 0 12px 24px rgba(21,151,244,.20); }
.point-btn span { display: block; font-size: 17px; font-weight: 900; }
.point-btn strong { display: block; margin-top: 6px; font-size: 34px; }
.point-btn.pair-a { background: linear-gradient(145deg,#36c3ff,#118fe8); }
.point-btn.pair-b { background: linear-gradient(145deg,#248ff0,#075fb4); }

.game-result-big { margin: 15px 0; padding: 19px; border: 2px solid #8bd7ff; border-radius: 19px; background: #eaf9ff; text-align: center; }
.game-result-big span, .game-result-big small { display: block; color: var(--muted); font-weight: 850; }
.game-result-big strong { display: block; margin: 5px 0; color: var(--primary-deep); font-size: 42px; }

.winner-card { padding: 20px 15px; border-radius: 21px; background: linear-gradient(135deg,#23b7ff,#0a82db); color: #fff; text-align: center; }
.winner-card span, .winner-card small { display: block; }
.winner-card strong { display: block; margin: 5px 0; font-size: 30px; }

.result-page { overflow: hidden; }
.final-count { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 10px; margin: 17px 0; padding: 13px; border-radius: 17px; background: #e8f8ff; text-align: center; }
.final-count span { color: var(--muted); font-size: 12px; font-weight: 900; }
.final-count strong { color: var(--primary-deep); font-size: 32px; }
.final-count b { color: var(--primary); font-size: 20px; }
.table-wrap { overflow-x: auto; border: 2px solid #a9ddff; border-radius: 18px; }
.score-table { width: 100%; border-collapse: collapse; min-width: 330px; }
.score-table th { padding: 12px 8px; background: #0f91e7; color: #fff; font-size: 13px; }
.score-table td { padding: 12px 8px; border-top: 1px solid #bfe9ff; text-align: center; color: var(--text); font-weight: 850; }
.score-table td.won { background: #dff4ff; color: #0569b4; font-size: 19px; font-weight: 1000; }
.score-table tr.final-row td:first-child { color: #0874cb; font-weight: 1000; }
.answer-check { margin-top: 16px; padding: 15px; border-radius: 17px; background: #eaf9ff; color: #17639d; line-height: 1.8; }

.app-footer { display: flex; justify-content: center; gap: 14px; padding: 12px 0 24px; color: #2871aa; font-size: 11px; font-weight: 750; }

@media (max-width: 420px) {
  .summary-row { grid-template-columns: 94px 1fr; }
  .current-grid { grid-template-columns: 1fr 1fr; }
  .call-card strong { font-size: clamp(25px, 8vw, 34px); }
}
.first-point-note {
  padding: 16px; border: 2px solid #8bd7ff; border-radius: 19px; background: #eaf9ff; text-align: center;
}
.first-point-note strong { display: block; color: var(--primary-deep); font-size: 20px; }
.first-point-note span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 750; }

/* =========================
   v3: compact + ruby + press feedback
========================= */
ruby { ruby-position: over; }
rt { font-size: .46em; font-weight: 700; color: currentColor; letter-spacing: 0; }

.app-shell { padding-left: 10px; padding-right: 10px; }
.topbar { padding: 10px 1px 6px; }
.eyebrow { font-size: 9px; margin-bottom: 0; }
h1 { font-size: 19px; line-height: 1.25; }
h2 { font-size: clamp(21px, 5.8vw, 27px); line-height: 1.28; }
.spaced-title { margin-top: 10px; }
.icon-button { width: 39px; height: 39px; font-size: 21px; box-shadow: 0 4px 0 #8bd7ff; }
.app-main { padding: 4px 0 12px; }

.progress-wrap { margin-bottom: 8px; }
.progress-meta { margin-bottom: 4px; font-size: 10px; }
.progress-track { height: 5px; }

.todo { margin-bottom: 8px; padding: 8px 11px; border-radius: 14px; }
.todo-label { margin-bottom: 2px; font-size: 10px; }
.todo strong { font-size: 15px; line-height: 1.42; }

.card { padding: 13px 12px; border-radius: 17px; box-shadow: 0 8px 20px rgba(21,151,244,.12); }
.card + .card { margin-top: 8px; }
.lead { margin: 5px 0 10px; font-size: 13px; line-height: 1.5; }
.small-note { margin: 3px 0 6px; font-size: 11px; line-height: 1.4; }
.rule-note { margin-top: 9px; padding: 8px 10px; border-radius: 12px; font-size: 11px; line-height: 1.45; }

.player-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.player-pair .pair-title { grid-column: 1 / -1; }
.pair-box { margin-top: 8px; padding: 9px; border-radius: 14px; }
.pair-title { margin-bottom: 6px; font-size: 13px; }
.field { margin-bottom: 0; }
.field label { margin-bottom: 3px; font-size: 10px; }
.field input { padding: 9px 9px; border-radius: 11px; font-size: 16px; min-height: 42px; }
.segment { min-height: 42px; border-radius: 11px; font-size: 14px; }

.actions { gap: 7px; margin-top: 11px; }
.btn {
  min-height: 44px; padding: 8px 11px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 4px 0 rgba(7,90,171,.28);
  transition: transform .06s ease, box-shadow .06s ease, filter .06s ease, opacity .2s ease;
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(3px) scale(.99); box-shadow: 0 1px 0 rgba(7,90,171,.25); filter: brightness(.94); }
.btn-secondary { box-shadow: 0 4px 0 #9bdcff; }
.btn-side { box-shadow: 0 4px 0 #e4c954; }

.choice-grid { gap: 7px; margin-top: 9px; }
.choice-card {
  padding: 10px 11px; border-radius: 13px; box-shadow: 0 4px 0 #a6ddfa;
  transition: transform .06s ease, box-shadow .06s ease, filter .06s ease;
  touch-action: manipulation;
}
.choice-card strong { font-size: 16px; margin-bottom: 1px; }
.choice-card span { font-size: 11px; }
.choice-card:active { transform: translateY(3px); box-shadow: 0 1px 0 #8bcff5; filter: brightness(.96); }

.coin-stage { min-height: 125px; padding: 4px 0; }
.coin { width: 92px; height: 92px; border-width: 6px; font-size: 24px; }
.result-banner { margin: 8px 0 2px; padding: 11px 10px; border-radius: 14px; }
.result-banner strong { font-size: 20px; }

.summary-list { gap: 6px; margin-top: 9px; }
.summary-row { grid-template-columns: 92px 1fr; gap: 7px; padding-bottom: 6px; }
.summary-row dt { font-size: 11px; }
.summary-row dd { font-size: 13px; }
.position-map { gap: 7px; margin: 9px 0; }
.position-box { padding: 10px 7px; border-radius: 14px; }
.position-box .player-name { margin-top: 3px; font-size: 19px; }

.game-badge, .final-badge, .result-title-chip { padding: 5px 9px; font-size: 10px; }
.call-card { margin-bottom: 8px; padding: 11px 10px; border-radius: 17px; box-shadow: 0 8px 18px rgba(21,151,244,.18); }
.call-label { margin-bottom: 4px; font-size: 10px; }
.call-card strong { font-size: clamp(22px, 6.6vw, 30px); line-height: 1.28; }
.call-card small { margin-top: 4px; font-size: 10px; }
.guide-say { padding: 10px; border-radius: 13px; }
.guide-say span { font-size: 10px; }
.guide-say strong { margin-top: 3px; font-size: 22px; }
.timer-card { margin-top: 8px; padding: 11px; border-radius: 14px; }
.timer-card span { font-size: 10px; }
.timer-card strong { margin-top: 2px; font-size: 40px; }

.match-screen { gap: 8px; }
.scoreboard-mini { gap: 5px; }
.scoreboard-mini > div { padding: 6px 5px; border-radius: 11px; }
.scoreboard-mini span, .scoreboard-mini small { font-size: 8px; }
.scoreboard-mini strong { font-size: 20px; }
.score-card { gap: 6px; }
.pair-score { padding: 8px 6px; border-radius: 13px; }
.pair-score span { min-height: 24px; font-size: 9px; }
.pair-score strong { font-size: 34px; }
.pair-score small { margin-top: 3px; font-size: 9px; }
.current-card { padding: 11px 10px; border-radius: 16px; box-shadow: 0 8px 18px rgba(21,151,244,.18); }
.current-title { margin-bottom: 7px; font-size: 10px; }
.current-grid { gap: 6px; }
.current-item { padding: 8px; border-radius: 11px; }
.current-item span { font-size: 9px; }
.current-item strong { font-size: 21px; }
.current-item small { margin-top: 2px; font-size: 9px; }
.next-card { padding: 9px; border-radius: 13px; }
.next-title { margin-bottom: 5px; font-size: 10px; }
.next-grid { gap: 5px; }
.next-grid div { padding: 6px 4px; border-radius: 9px; }
.next-grid span { font-size: 8px; }
.next-grid strong { margin-top: 2px; font-size: 13px; }
.point-buttons { gap: 7px; }
.point-btn {
  min-height: 74px; border-radius: 15px; box-shadow: 0 5px 0 rgba(7,90,171,.32);
  transition: transform .06s ease, box-shadow .06s ease, filter .06s ease;
  touch-action: manipulation;
}
.point-btn span { font-size: 14px; }
.point-btn strong { margin-top: 2px; font-size: 27px; }
.point-btn:active { transform: translateY(4px) scale(.99); box-shadow: 0 1px 0 rgba(7,90,171,.30); filter: brightness(.92); }

.game-result-big { margin: 8px 0; padding: 11px; border-radius: 14px; }
.game-result-big strong { margin: 2px 0; font-size: 32px; }
.winner-card { padding: 12px 10px; border-radius: 15px; }
.winner-card strong { margin: 2px 0; font-size: 24px; }
.final-count { gap: 6px; margin: 9px 0; padding: 8px; border-radius: 12px; }
.final-count strong { font-size: 25px; }
.score-table th, .score-table td { padding: 8px 5px; }
.answer-check { margin-top: 9px; padding: 9px; border-radius: 12px; line-height: 1.55; font-size: 12px; }
.first-point-note { padding: 9px; border-radius: 13px; }
.first-point-note strong { font-size: 16px; }
.first-point-note span { margin-top: 2px; font-size: 10px; }
.app-footer { gap: 10px; padding: 7px 0 12px; font-size: 9px; }

@media (max-width: 420px) {
  .summary-row { grid-template-columns: 84px 1fr; }
  .call-card strong { font-size: clamp(21px, 6.5vw, 28px); }
}
.segment, .icon-button {
  transition: transform .06s ease, box-shadow .06s ease, filter .06s ease;
  touch-action: manipulation;
}
.segment { box-shadow: 0 3px 0 #a6ddfa; }
.segment:active { transform: translateY(2px); box-shadow: 0 1px 0 #8bcff5; filter: brightness(.96); }
.segment.selected { box-shadow: 0 3px 0 #075aab; }
.icon-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #75cbfa; }

/* =========================
   v4: 試合終了ナビ + スコアシート答え合わせ
========================= */
.post-progress {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 2px solid #9cddff;
  border-radius: 14px;
  background: #ecfaff;
}
.post-progress > span { color: var(--primary-dark); font-size: 11px; font-weight: 1000; }
.post-progress > strong { float: right; color: var(--primary-deep); font-size: 12px; }
.post-dots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; clear: both; padding-top: 6px; }
.post-dot { height: 5px; border-radius: 99px; background: #c8edff; }
.post-dot.done { background: #1597f4; }

after-action-card { display: block; }
.after-action-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 9px;
  align-items: start;
  margin-bottom: 8px;
  padding: 13px 12px;
  border: 3px solid #66ccff;
  border-radius: 17px;
  background: linear-gradient(145deg, #ffffff, #e8f8ff);
  box-shadow: 0 8px 18px rgba(21,151,244,.14);
}
.after-action-card.tournament { border-color: #ffe17b; background: #fff9d8; }
.after-action-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #dff4ff;
  font-size: 23px;
}
.after-action-card.tournament .after-action-icon { background: #fff0a6; }
.after-action-label { display: block; margin-bottom: 2px; color: var(--primary-dark); font-size: 10px; font-weight: 1000; }
.after-action-card.tournament .after-action-label { color: #8a6500; }
.after-action-card strong { display: block; color: var(--primary-deep); font-size: 20px; line-height: 1.3; }
.after-action-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.5; }
.after-action-card.tournament strong, .after-action-card.tournament p { color: #785b00; }
.compact-card { padding: 10px; }
.mini-result-line { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 6px; text-align: center; }
.mini-result-line span { color: var(--muted); font-size: 10px; font-weight: 900; }
.mini-result-line strong { color: var(--primary-deep); font-size: 23px; }
.inline-actions { grid-template-columns: 1fr 1.3fr; }
.inline-actions .btn:only-child { grid-column: 1 / -1; }

.compact-winner { padding: 12px 10px; border-radius: 15px; }
.compact-winner strong { font-size: 21px; }
.sheet-match-meta {
  display: grid;
  grid-template-columns: .8fr .8fr 1.4fr;
  gap: 5px;
  margin: 8px 0;
}
.sheet-match-meta div { padding: 7px 4px; border: 1px solid #b9e6ff; border-radius: 10px; background: #eefaff; text-align: center; }
.sheet-match-meta span { display: block; color: var(--muted); font-size: 8px; font-weight: 900; }
.sheet-match-meta strong { display: block; margin-top: 1px; color: var(--primary-deep); font-size: 12px; }

.official-sheet {
  overflow: hidden;
  border: 2px solid #168ee4;
  border-radius: 13px;
  background: #fff;
}
.sheet-pair-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) 84px minmax(0,1fr);
  border-bottom: 2px solid #168ee4;
}
.sheet-pair-box { min-width: 0; padding: 7px 6px; background: #effaff; }
.sheet-pair-box.right { text-align: right; }
.sheet-pair-box small { display: block; min-height: 15px; color: var(--muted); font-size: 8px; font-weight: 900; }
.sheet-pair-box strong { display: block; overflow: hidden; color: var(--primary-deep); font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.sheet-match-score { display: grid; place-items: center; padding: 5px 2px; border-left: 2px solid #168ee4; border-right: 2px solid #168ee4; background: #fff; text-align: center; }
.sheet-match-score small { color: var(--muted); font-size: 8px; font-weight: 900; }
.sheet-match-score div { display: flex; align-items: center; gap: 4px; color: var(--primary-deep); font-size: 18px; font-weight: 1000; }
.sheet-match-score b { color: #1597f4; }

.sheet-game-list { display: grid; }
.sheet-game-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 84px minmax(0,1fr);
  min-height: 62px;
  border-top: 1px solid #8cd5ff;
}
.sheet-game-row:first-child { border-top: 0; }
.sheet-game-row.final { background: #f3fbff; }
.sheet-team-record { min-width: 0; padding: 5px 5px 6px; }
.sheet-team-record + .sheet-center-score { border-left: 2px solid #168ee4; }
.sheet-center-score + .sheet-team-record { border-left: 2px solid #168ee4; }
.sheet-record-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 1000; }
.sr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 4px;
  border: 2px solid #1597f4;
  border-radius: 999px;
  background: #fff;
  color: #075aab;
  font-size: 8px;
  font-weight: 1000;
}
.sr-badge.receive { border-color: #58c7ff; background: #e7f8ff; }
.mark-strip { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 1px 2px; min-height: 31px; }
.point-mark { display: inline-grid; place-items: center; width: 15px; height: 15px; color: #075aab; font-size: 14px; font-weight: 1000; line-height: 1; }
.point-loss { color: #168ee4; }
.no-marks { color: #5d9ac8; font-size: 8px; }
.sheet-center-score { display: grid; place-content: center; gap: 2px; padding: 4px; text-align: center; }
.sheet-center-score small { color: var(--muted); font-size: 9px; font-weight: 1000; }
.sheet-center-score div { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--primary-deep); font-size: 18px; font-weight: 1000; }
.sheet-center-score b { color: #1597f4; font-size: 13px; }
.circled-score {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border: 2px solid #0874cb;
  border-radius: 50%;
  background: #e7f7ff;
  color: #075aab;
  line-height: 1;
}
.sheet-legend { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 7px; color: var(--muted); font-size: 9px; font-weight: 850; }
.sheet-legend b { color: var(--primary-deep); font-size: 13px; }
.sheet-legend i { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid #1597f4; border-radius: 50%; color: var(--primary-deep); font-style: normal; }
.score-sheet-page .answer-check { margin-top: 9px; padding: 10px 11px; border-radius: 13px; font-size: 11px; line-height: 1.65; }
.score-sheet-page .actions { margin-top: 9px; }

@media (max-width: 360px) {
  .sheet-pair-head, .sheet-game-row { grid-template-columns: minmax(0,1fr) 72px minmax(0,1fr); }
  .sheet-match-score, .sheet-center-score { font-size: 16px; }
  .point-mark { width: 13px; height: 13px; font-size: 12px; }
  .after-action-card strong { font-size: 18px; }
}

/* =========================
   v5: 判定ナビ
========================= */
.match-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 7px;
}
.btn-judgment {
  background: linear-gradient(145deg,#45c5ff,#168fe5);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 0 #0874c5;
}
.btn-judgment:active { transform: translateY(3px); box-shadow: 0 1px 0 #0874c5; }

.judgment-page { padding-bottom: 10px; }
.judgment-page h2 { margin-bottom: 8px; }
.judgment-heading {
  margin: 11px 0 6px;
  color: #075fa8;
  font-size: 14px;
  font-weight: 1000;
}
.service-status-strip {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border: 2px solid #89d6ff;
  border-radius: 13px;
  background: #e9f9ff;
}
.service-status-strip span { font-size: 10px; font-weight: 900; color: #2077b7; }
.service-status-strip strong { font-size: 15px; color: #075fa8; }
.service-status-strip small { text-align: right; font-size: 10px; font-weight: 800; color: #2574ab; }

.judgment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 6px;
}
.judgment-grid.compact-two { grid-template-columns: 1fr; }
.judgment-btn {
  min-height: 45px;
  padding: 7px 8px;
  border: 2px solid #8bd7ff;
  border-radius: 12px;
  background: #f5fcff;
  color: #075fa8;
  box-shadow: 0 3px 0 #a9e1ff;
  text-align: center;
  touch-action: manipulation;
  transition: transform .06s ease, box-shadow .06s ease, filter .06s ease;
}
.judgment-btn strong { display: block; font-size: 13px; line-height: 1.2; }
.judgment-btn small { display: block; margin-top: 2px; font-size: 8px; color: #2c79ad; font-weight: 800; }
.judgment-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #a9e1ff; filter: brightness(.96); }
.judgment-btn.special { background: #e6f7ff; }

.judgment-loser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.judgment-loser {
  min-height: 82px;
  padding: 10px;
  border: 0;
  border-radius: 15px;
  color: white;
  box-shadow: 0 5px 0 rgba(7,90,171,.30);
  touch-action: manipulation;
}
.judgment-loser.pair-a { background: linear-gradient(145deg,#35c3ff,#128fe6); }
.judgment-loser.pair-b { background: linear-gradient(145deg,#238ff1,#075fb4); }
.judgment-loser span { display: block; font-size: 12px; font-weight: 900; }
.judgment-loser strong { display: block; margin-top: 5px; font-size: 16px; }
.judgment-loser:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(7,90,171,.30); }

.judgment-notice {
  margin-bottom: 8px;
  padding: 10px 11px;
  border: 2px solid #58c8ff;
  border-radius: 15px;
  background: #e8f9ff;
  text-align: center;
  box-shadow: 0 6px 14px rgba(21,151,244,.12);
}
.judgment-notice-label { display: block; color: #1679bd; font-size: 9px; font-weight: 1000; }
.judgment-notice > strong { display: block; margin-top: 2px; color: #055f9f; font-size: 24px; line-height: 1.2; }
.judgment-notice p { margin: 4px 0 0; color: #176ca5; font-size: 11px; font-weight: 800; }
.judgment-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #9cddff;
}
.judgment-count span { color: #2877aa; font-size: 9px; font-weight: 850; }
.judgment-count b { color: #075fa8; font-size: 18px; }

@media (max-width: 360px) {
  .judgment-btn strong { font-size: 12px; }
  .service-status-strip { grid-template-columns: auto auto; }
  .service-status-strip small { grid-column: 1 / -1; text-align: left; }
}

/* v6: ダブルフォールトを読み間違えないための強調表示 */
.double-fault-notice {
  margin-bottom: 8px;
  padding: 9px;
  border: 3px solid #20aaf2;
  border-radius: 16px;
  background: #e9f9ff;
  text-align: center;
  box-shadow: 0 6px 14px rgba(21,151,244,.16);
}
.double-fault-step,
.double-fault-count {
  padding: 7px 8px;
  border-radius: 12px;
  background: #fff;
}
.double-fault-step span,
.double-fault-count span {
  display: block;
  color: #1476b8;
  font-size: 10px;
  font-weight: 1000;
}
.double-fault-step strong {
  display: block;
  margin-top: 2px;
  color: #045d9e;
  font-size: clamp(28px, 8.7vw, 38px);
  line-height: 1.15;
  letter-spacing: .02em;
}
.double-fault-count {
  margin-top: 6px;
  border: 2px solid #8bdcff;
}
.double-fault-count b {
  display: block;
  margin-top: 2px;
  color: #075fa8;
  font-size: clamp(23px, 7vw, 31px);
  line-height: 1.15;
}
.double-fault-notice p {
  margin: 6px 2px 0;
  color: #176ca5;
  font-size: 10px;
  font-weight: 850;
}


/* =========================
   v7: 戻る・判定履歴・終了ナビ・保存
========================= */
.top-actions { display: flex; align-items: center; gap: 7px; }
.back-button { font-size: 22px; font-weight: 1000; }
.back-button[hidden] { display: none; }

.compact-lead { margin: 5px 0 8px; font-size: 11px; }
.end-call-focus { text-align: center; }
.end-call-focus p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.55; }
.one-thing-note { padding: 10px; border: 2px solid #7fd3ff; border-radius: 13px; background: #e8f8ff; color: #075fa8; font-size: 12px; line-height: 1.55; }

.event-log-section { margin-top: 10px; padding: 10px; border: 2px solid #98ddff; border-radius: 14px; background: #f7fdff; }
.event-log-title { display: flex; gap: 7px; align-items: flex-start; margin-bottom: 7px; }
.event-log-title > span { font-size: 20px; }
.event-log-title strong { display: block; color: var(--primary-deep); font-size: 14px; }
.event-log-title small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 750; line-height: 1.35; }
.event-log-list { display: grid; gap: 5px; }
.event-row { display: grid; grid-template-columns: 47px minmax(0,1fr) 92px; gap: 6px; align-items: center; padding: 6px; border: 1px solid #bde9ff; border-radius: 10px; background: #fff; }
.event-when { text-align: center; }
.event-when strong { display: block; color: var(--primary-deep); font-size: 11px; }
.event-when span { display: block; color: var(--muted); font-size: 8px; font-weight: 850; }
.event-main { min-width: 0; }
.event-main strong { display: block; color: #075fa8; font-size: 12px; }
.event-main span { display: block; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.event-result { color: #176ca5; font-size: 9px; font-weight: 900; text-align: right; line-height: 1.35; }
.no-event-log { padding: 9px; border-radius: 10px; background: #eaf9ff; color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; }

.save-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 7px; margin-top: 9px; }
.save-hint { margin: 5px 2px 0; color: var(--muted); font-size: 9px; font-weight: 750; line-height: 1.4; }

@media (max-width: 360px) {
  .event-row { grid-template-columns: 42px minmax(0,1fr) 80px; }
  .save-actions { grid-template-columns: 1fr; }
}
