@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #103b35;
  --ink-deep: #0a2e2a;
  --sand: #f3efe5;
  --paper: #fffdf8;
  --lime: #e9ff55;
  --coral: #ff785f;
  --positive: #23864b;
  --positive-soft: #dff3e6;
  --negative: #d64545;
  --negative-soft: #f8e1e1;
  --sky: #9edbd1;
  --muted: #73827d;
  --line: rgba(16, 59, 53, 0.14);
  --shadow: 0 22px 60px rgba(7, 39, 35, 0.18);
}

* { box-sizing: border-box; }
html { background: #dcd8cf; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Roboto", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input { font: inherit; }
button { color: inherit; }

#app {
  width: 100%;
  min-height: 100dvh;
  background: var(--ink);
  overflow: hidden;
}

.screen {
  width: 100%;
  min-height: 100dvh;
  position: relative;
  padding: max(22px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.light-screen { background: var(--sand); }
.brand, .topbar, .team-heading, .section-heading, .score-row,
.primary-button, .bottom-nav, .stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .14em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 50%;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 22px;
  font-style: italic;
}
.hero { margin-top: 14vh; color: white; position: relative; z-index: 2; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.eyebrow.dark { color: var(--ink); opacity: .65; }
h1, h2, p { margin-top: 0; }
h1, h2 {
  margin-bottom: 14px;
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: .92;
}
h1 { font-size: clamp(53px, 15vw, 70px); }
h1 em, h2 em { color: var(--lime); font-weight: 400; }
.light-screen h1 em { color: var(--coral); }
.hero-copy { max-width: 320px; color: rgba(255,255,255,.68); line-height: 1.55; font-size: 14px; }

.court-graphic {
  position: absolute;
  width: 390px;
  height: 390px;
  right: -170px;
  bottom: 90px;
  border: 1px solid rgba(255,255,255,.18);
  transform: rotate(-18deg);
}
.court-line { position: absolute; background: rgba(255,255,255,.18); }
.line-one { width: 100%; height: 1px; top: 50%; }
.line-two { height: 100%; width: 1px; left: 50%; }
.line-three { width: 70%; height: 70%; top: 15%; left: 15%; border: 1px solid rgba(255,255,255,.14); background: none; }
.ball {
  position: absolute;
  z-index: 2;
  top: -18px;
  left: 74px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 15px 35px rgba(0,0,0,.2);
}
.home-actions { position: absolute; z-index: 3; left: 20px; right: 20px; bottom: max(26px, env(safe-area-inset-bottom)); }
.primary-button {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  background: var(--lime);
  color: var(--ink-deep);
  font-weight: 700;
  cursor: pointer;
}
.primary-button:disabled { opacity: .55; }
.positive-button { background: var(--positive); color: white; }
.negative-button { background: var(--negative); color: white; }
.home-secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.04);
  color: white;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.recent-title { margin: 18px 0 8px; color: rgba(255,255,255,.55); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.recent-match { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.15); color: white; text-align: left; }
.recent-match-info { min-width: 0; font-size: 12px; }
.recent-match-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-match small { display: block; margin-top: 3px; color: rgba(255,255,255,.5); }
.recent-match-action { flex: none; min-height: 34px; padding: 0 11px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: white; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.topbar {
  height: 40px;
  font-size: 13px;
  font-weight: 700;
}
.icon-button, .text-button, .undo-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.icon-button { font-size: 24px; padding: 4px; }
.step { color: var(--muted); font-size: 11px; }
.setup-intro { margin: 46px 4px 32px; }
.setup-intro h1 { margin-bottom: 18px; }
.setup-intro > p:last-child { color: var(--muted); font-size: 13px; }
.team-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}
.team-choice legend, .polarity-choice legend {
  width: 100%;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.team-choice label { position: relative; cursor: pointer; }
.team-choice input { position: absolute; opacity: 0; pointer-events: none; }
.team-choice-card {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.45);
}
.team-choice-card strong, .team-choice-card small { display: block; }
.team-choice-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.team-choice input:checked + .team-choice-card {
  border-color: var(--ink);
  box-shadow: inset 0 -4px var(--lime);
}
.team-choice input:checked + .team-choice-card.coral { box-shadow: inset 0 -4px var(--coral); }
.team-block {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.45);
}
.team-heading { justify-content: flex-start; gap: 12px; margin-bottom: 16px; }
.team-heading strong, .team-heading small { display: block; }
.team-heading strong { font-size: 14px; }
.team-heading small { color: var(--muted); margin-top: 2px; font-size: 10px; }
.team-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--lime);
  font-weight: 800;
}
.team-b .team-badge { background: var(--coral); color: white; }
.player-fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
.player-fields label span, .note-field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.player-picker { position: relative; min-width: 0; }
.player-picker-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: none;
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 14px 32px rgba(7,39,35,.16);
}
.player-picker-menu.visible { display: block; }
.player-picker-menu button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.player-picker-menu button:last-child { border-bottom: 0; }
.player-picker-menu button:active { background: var(--sand); }
.player-picker-menu p { margin: 0; padding: 12px; color: var(--muted); font-size: 10px; line-height: 1.4; }
input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 12px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
input:focus { border-color: var(--ink); }
.versus { height: 30px; display: grid; place-items: center; position: relative; }
.versus::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.versus span { z-index: 1; padding: 4px 8px; background: var(--sand); font-size: 9px; font-weight: 800; }
.fixed-action { margin-top: 26px; }

.match-screen { padding: max(20px, env(safe-area-inset-top)) 0 90px; background: var(--ink); color: white; overflow: auto; }
.match-header { padding: 0 20px; }
.match-header-top, .match-title-row { display: flex; align-items: center; justify-content: space-between; }
.match-header strong { font-family: "Roboto", Arial, sans-serif; font-size: 25px; font-weight: 500; }
.match-status-row { display: flex; align-items: center; gap: 8px; }
.match-status-row .eyebrow { margin: 0; }
.match-title-row { margin-top: 8px; gap: 12px; }
#match-date { color: rgba(255,255,255,.65); font-size: 12px; font-weight: 500; white-space: nowrap; }
.match-back-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 17px;
  cursor: pointer;
}
.text-button { color: rgba(255,255,255,.7); font-size: 11px; text-decoration: underline; }
.dark-link { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.danger-link { color: var(--negative); }
.scoreboard { margin-top: 22px; padding: 0 20px 26px; }
.score-table-head, .score-row { display: grid; grid-template-columns: minmax(0,1fr) 38px 46px; gap: 8px; align-items: center; }
.score-table-head { margin-bottom: 7px; color: rgba(255,255,255,.5); font-size: 10px; text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.score-table-head span:first-child { text-align: left; }
.score-row { min-height: 72px; border-top: 1px solid rgba(255,255,255,.15); }
.score-row:last-child { border-bottom: 1px solid rgba(255,255,255,.15); }
.team-names { min-width: 0; }
.team-names strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.team-names small { color: rgba(255,255,255,.55); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.set-score { color: rgba(255,255,255,.6); text-align: center; font-size: 17px; }
.game-score {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  justify-self: end;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}
.score-row.team-two .game-score { background: var(--coral); color: white; }
.live-section {
  min-height: 56vh;
  padding: 28px 20px 34px;
  border-radius: 28px 28px 0 0;
  background: var(--sand);
  color: var(--ink);
}
.section-heading { align-items: flex-end; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 38px; }
.undo-button { display: flex; gap: 5px; color: var(--muted); font-size: 11px; }
.player-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.match-complete-card { padding: 22px; border: 1px solid var(--line); background: var(--paper); text-align: center; }
.match-complete-card h2 { margin: 5px 0 12px; font-size: 42px; }
.match-complete-card p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.match-complete-actions { display: grid; gap: 8px; margin-top: 20px; }
.secondary-button { width: 100%; min-height: 52px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; }
.player-card { padding: 14px; border: 1px solid var(--line); background: var(--paper); }
.player-card-live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: center;
}
.player-card-main { min-width: 0; }
.player-card h3 { margin: 0; font-family: "Roboto", Arial, sans-serif; font-size: 27px; font-weight: 500; line-height: 1; }
.player-card small { color: var(--muted); font-size: 9px; }
.player-live-scores { display: flex; gap: 16px; align-items: center; }
.player-live-scores div { min-width: 38px; text-align: center; }
.player-live-scores span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.player-live-scores strong { color: var(--muted); font-size: 19px; }
.player-live-scores strong.positive { color: var(--positive); }
.player-live-scores strong.negative { color: var(--negative); }
.point-actions { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.point-action { height: 44px; border: 0; border-radius: 2px; font-weight: 800; cursor: pointer; }
.point-action.negative { background: var(--negative); color: white; }
.point-action.positive { background: var(--positive); color: white; }
.bottom-nav {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(66px + env(safe-area-inset-bottom));
  padding: 6px 22px env(safe-area-inset-bottom);
  background: var(--ink-deep);
}
.bottom-nav button { flex: 1; border: 0; background: none; color: rgba(255,255,255,.4); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.bottom-nav button span { display: block; margin-bottom: 3px; font-size: 18px; }
.bottom-nav button.active { color: var(--lime); }

.sheet-backdrop { position: fixed; z-index: 20; inset: 0; background: rgba(5,25,22,.62); backdrop-filter: blur(3px); }
.bottom-sheet {
  position: fixed;
  z-index: 21;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88dvh;
  overflow: auto;
  padding: 12px 20px max(24px, env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--sand);
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: slide-up .22s ease-out;
}
@keyframes slide-up { from { transform: translateY(100%); } }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 28px; border-radius: 4px; background: rgba(16,59,53,.2); }
.bottom-sheet h2 { font-size: 42px; }
.sheet-copy { color: var(--muted); font-size: 12px; line-height: 1.45; }
.event-cause-search { margin-top: 18px; }
.event-cause-list {
  max-height: 245px;
  margin: 10px 0 22px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.event-cause-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.event-cause-row strong { font-size: 11px; font-weight: 600; }
.event-cause-sign { font-size: 10px; font-weight: 800; }
.event-cause-row.event-positive .event-cause-sign { color: var(--positive); }
.event-cause-row.event-negative .event-cause-sign { color: var(--negative); }
.event-cause-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 11px;
}
.event-cause-row.event-positive.selected { background: var(--positive-soft); }
.event-cause-row.event-positive.selected .event-cause-check { border-color: var(--positive); background: var(--positive); color: white; }
.event-cause-row.event-negative.selected { background: var(--negative-soft); }
.event-cause-row.event-negative.selected .event-cause-check { border-color: var(--negative); background: var(--negative); color: white; }
.score-edit-grid { display: grid; grid-template-columns: 1fr 76px 76px; gap: 8px; align-items: center; margin: 22px 0; }
.score-edit-grid strong { font-size: 10px; text-align: center; }
.score-edit-grid label { color: var(--muted); font-size: 11px; }
.score-edit-grid input { text-align: center; }
.note-field { display: block; margin-bottom: 22px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; margin-top: 24px; }
.danger-button { background: var(--negative); color: white; }
.polarity-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}
.polarity-choice label { position: relative; cursor: pointer; }
.polarity-choice input { position: absolute; opacity: 0; pointer-events: none; }
.polarity-choice label span {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 11px;
  font-weight: 700;
}
.polarity-choice label:first-of-type input:checked + span { border-color: var(--positive); background: var(--positive); color: white; }
.polarity-choice label:last-of-type input:checked + span { border-color: var(--negative); background: var(--negative); color: white; }

.causes-screen { padding-bottom: 40px; }
.causes-hero { padding: 44px 4px 25px; }
.causes-hero h1 { font-size: 58px; }
.causes-hero > p:not(.eyebrow) { max-width: 330px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.manager-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.manager-search > span { color: var(--muted); font-size: 18px; }
.manager-search input {
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
}
.manager-search input:focus { border: 0; }
.causes-manager {
  margin: 0 -20px -40px;
  padding: 26px 20px 40px;
  border-radius: 28px 28px 0 0;
  background: var(--paper);
}
.cause-group + .cause-group { margin-top: 28px; }
.cause-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.polarity-dot { width: 8px; height: 8px; border-radius: 50%; }
.polarity-dot.positive { background: var(--positive); }
.polarity-dot.negative { background: var(--negative); }
.cause-manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border-top: 1px solid var(--line);
}
.cause-manager-row:last-child { border-bottom: 1px solid var(--line); }
.cause-manager-row > div:first-child { min-width: 0; }
.cause-manager-row strong { display: inline; font-size: 12px; }
.cause-manager-row small { margin-left: 8px; color: var(--muted); font-size: 9px; }
.cause-manager-row small.positive, .cause-bar-label strong.positive { color: var(--positive); }
.cause-manager-row small.negative, .cause-bar-label strong.negative { color: var(--negative); }
.cause-row-actions { display: flex; gap: 9px; }
.cause-row-actions button { padding: 4px 0; border: 0; background: transparent; color: var(--muted); font-size: 9px; text-decoration: underline; cursor: pointer; }
.cause-row-actions .delete-cause { color: var(--negative); }

.players-screen { padding-bottom: 40px; }
.players-hero { padding: 44px 4px 25px; }
.players-hero h1 { font-size: 58px; }
.players-hero > p:not(.eyebrow) { max-width: 330px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.players-manager {
  margin: 0 -20px -40px;
  padding: 26px 20px 40px;
  border-radius: 28px 28px 0 0;
  background: var(--paper);
}
.player-manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  border-top: 1px solid var(--line);
}
.player-manager-row:last-child { border-bottom: 1px solid var(--line); }
.player-manager-info { display: flex; align-items: center; gap: 11px; min-width: 0; }
.player-manager-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.player-manager-number {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16,59,53,.08);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.stats-screen { padding-left: 0; padding-right: 0; padding-bottom: 90px; }
.stats-screen .topbar { padding: 0 20px; }
.stats-hero { padding: 44px 20px 28px; }
.stats-hero h1 { font-size: 58px; }
.stats-summary { display: grid; grid-template-columns: 1fr 1fr; margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-item { padding: 14px 0; }
.summary-item + .summary-item { padding-left: 16px; border-left: 1px solid var(--line); }
.summary-item strong { display: block; font-family: "Roboto", Arial, sans-serif; font-size: 31px; font-weight: 500; }
.summary-item strong.positive { color: var(--positive); }
.summary-item span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.stats-content { padding: 26px 20px; background: var(--paper); border-radius: 28px 28px 0 0; }
.section-heading.compact { margin-top: 16px; }
.section-heading.compact h2 { font-size: 31px; }
.chart-card { padding: 14px 10px 6px; border: 1px solid var(--line); background: #faf8f2; overflow: hidden; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 4px 6px 16px; font-size: 14px; font-weight: 500; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.performance-svg { display: block; width: 100%; height: 215px; }
.chart-grid { stroke: rgba(16,59,53,.1); stroke-width: 1; }
.chart-zero { stroke: rgba(16,59,53,.35); stroke-dasharray: 3 3; }
.chart-time-grid { stroke: rgba(16,59,53,.07); stroke-width: 1; }
.chart-time-label {
  fill: var(--muted);
  font-family: "Roboto", Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
}
.games-heading { margin-top: 30px !important; }
.games-performance { display: grid; gap: 14px; }
.games-list { display: grid; gap: 10px; }
.game-performance-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left-width: 5px;
  background: #faf8f2;
}
.game-performance-card.won { border-left-color: var(--positive); }
.game-performance-card.lost { border-left-color: var(--negative); }
.game-performance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}
.game-performance-head strong { font-size: 15px; }
.game-performance-card.won .game-performance-head strong { color: var(--positive); }
.game-performance-card.lost .game-performance-head strong { color: var(--negative); }
.game-performance-head span { color: var(--muted); font-size: 12px; font-weight: 500; }
.game-performance-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 13px;
}
.game-player-scores { display: grid; gap: 7px; }
.game-player-scores > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}
.game-player-scores > div.positive { color: var(--positive); }
.game-player-scores > div.negative { color: var(--negative); }
.game-player-scores > div.neutral { color: var(--muted); }
.game-player-scores > div strong { font-size: 15px; }
.game-player-scores > div.responsible span,
.game-player-scores > div.responsible strong { font-weight: 800; }
.game-running-score {
  min-width: 52px;
  color: var(--ink);
  font-size: 21px;
  text-align: center;
}
.game-player-totals {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}
.game-player-totals > div {
  display: grid;
  gap: 4px;
  padding: 13px;
  background: var(--paper);
}
.game-player-totals > div.positive { color: var(--positive); }
.game-player-totals > div.negative { color: var(--negative); }
.game-player-totals > div.neutral { color: var(--muted); }
.game-player-totals strong { font-size: 16px; }
.game-player-totals span { font-size: 12px; font-weight: 500; }
.player-stats { display: grid; gap: 9px; }
.stat-card { padding: 16px; border: 1px solid var(--line); }
.stat-head h3 { margin: 0; font-family: "Roboto", Arial, sans-serif; font-size: 25px; font-weight: 500; }
.total-score { font-size: 21px; font-weight: 800; }
.total-score.positive { color: var(--positive); }
.total-score.negative { color: var(--negative); }
.total-score.neutral { color: var(--muted); }
.stat-balance .positive { color: var(--positive); }
.stat-balance .negative { color: var(--negative); }
.stat-balance { display: flex; gap: 22px; margin: 16px 0 18px; color: var(--muted); font-size: 15px; font-weight: 500; }
.cause-bar { margin-top: 12px; }
.cause-bar-label { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 14px; }
.cause-bar-label strong { font-size: 14px; }
.cause-track { height: 4px; background: #ebe8df; }
.cause-fill { height: 100%; }
.cause-fill.positive { background: var(--positive); }
.cause-fill.negative { background: var(--negative); }
.set-insights { margin-top: 24px; }
.insight-card { padding: 15px 0; border-top: 1px solid var(--line); }
.insight-card strong { display: block; margin-bottom: 4px; font-size: 12px; }
.insight-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.light-nav { background: rgba(255,253,248,.96); border-top: 1px solid var(--line); }
.light-nav button { color: var(--muted); }
.light-nav button.active { color: var(--ink); }
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 90px;
  max-width: calc(100% - 40px);
  padding: 11px 16px;
  border-radius: 3px;
  background: var(--ink-deep);
  color: white;
  font-size: 11px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s;
}
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; font-size: 12px; }

@media (min-width: 600px) {
  body { padding: 20px 0; background: #d8d4ca; }
  #app { width: 430px; min-height: calc(100dvh - 40px); margin: auto; box-shadow: var(--shadow); }
  .screen { min-height: calc(100dvh - 40px); }
  .bottom-nav, .bottom-sheet { width: 430px; left: 50%; right: auto; transform: translateX(-50%); }
  .bottom-sheet { animation: slide-up-desktop .22s ease-out; }
  @keyframes slide-up-desktop { from { transform: translate(-50%, 100%); } }
}
