:root {
  --navy-950: #061221;
  --navy-900: #07172c;
  --navy-800: #0b2240;
  --navy-700: #10345e;
  --blue: #1473e6;
  --blue-2: #2d8cff;
  --gold: #ffc928;
  --red: #d83636;
  --green-900: #0c5d36;
  --green-800: #116f40;
  --green-700: #16864b;
  --white: #ffffff;
  --page: #edf2f8;
  --card: #ffffff;
  --text: #0d1b2b;
  --muted: #64748b;
  --line: #d9e2ec;
  --shadow: 0 8px 24px rgba(7, 23, 44, .10);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.app-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  color: #fff;
  background: linear-gradient(120deg, var(--navy-950), var(--navy-800));
  border-bottom: 4px solid var(--blue);
}
.brand-wrap { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark {
  width: 72px; height: 72px; flex: 0 0 72px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-header h1 { margin: 0; font-size: clamp(20px, 2.3vw, 31px); line-height: 1.05; letter-spacing: .02em; }
.app-header p { margin: 6px 0 0; color: #b9c9dd; font-size: 13px; }
.app-header h1, .app-header p { text-shadow: 0 1px 0 rgba(0,0,0,.18); }
.header-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.version { font-size: 13px; color: var(--gold); font-weight: 800; }

.app-shell { width: min(1600px, 100%); margin: 0 auto; padding: 18px 20px 30px; }
.tabs {
  display: flex; gap: 3px; padding: 7px;
  background: var(--navy-900);
  border-radius: 13px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.tab {
  min-width: 140px;
  border: 0; border-radius: 9px;
  padding: 12px 18px;
  background: transparent; color: #cbd8e7;
  font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.tab:hover { background: rgba(255,255,255,.06); color: #fff; }
.tab.active { color: var(--navy-950); background: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card { background: var(--card); border: 1px solid #e2e8f0; border-radius: var(--radius); box-shadow: var(--shadow); }
.status-row {
  min-height: 40px; margin-bottom: 12px; padding: 0 5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.status-pill { margin-left: 0; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.board-status-block { display:flex; flex-direction:column; align-items:flex-start; gap:5px; }
.status-pill.local { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.status-pill.shared { color:#0b4f8a; background:#dbeafe; border:1px solid #93c5fd; }
.status-pill.reconnecting { color:#854d0e; background:#fef3c7; border:1px solid #fcd34d; }
.status-pill.offline { color:#991b1b; background:#fee2e2; border:1px solid #fca5a5; }
.autosave { color: var(--muted); font-size: 12px; }

.whiteboard-layout { display: grid; grid-template-columns: minmax(720px, 1fr) 320px; gap: 18px; align-items: start; }
.field-card { padding: 18px; min-width: 0; }
.info-card { padding: 20px; position: sticky; top: 14px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading.compact { margin-bottom: 5px; }
.section-heading h2 { margin: 3px 0 0; font-size: 22px; color: var(--navy-900); }
.section-heading p { max-width: 520px; margin: 4px 0 0; color: var(--muted); font-size: 13px; text-align: right; }
.board-heading { justify-content:flex-start; }
.board-heading-main { width:100%; max-width:760px; }
.board-title-input {
  display:block; width:100%; max-width:520px; margin:0 0 7px; padding:0;
  border:0; border-bottom:1px solid transparent; outline:none; background:transparent;
  color:var(--navy-900); font-size:22px; font-weight:800; line-height:1.2;
}
.board-title-input::placeholder { color:#94a3b8; font-weight:700; opacity:.9; }
.board-title-input:focus { border-bottom-color:var(--blue); }

.field-notes-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(280px, 2fr);
  gap: 3px;
  align-items: stretch;
}
.board-notes {
  min-width: 0;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.board-notes[hidden] { display: none !important; }
.board-notes-heading { margin-bottom: 9px; display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.board-notes-heading h3 { margin: 3px 0 0; color: var(--navy-900); font-size: 18px; }
.board-notes textarea {
  width: 100%;
  flex: 1 1 auto;
  min-height: 520px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  outline: none;
}
.board-notes textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,115,230,.12); }
.notes-helper { margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.oval-top-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 7;
  display:flex;
  align-items:center;
  gap:8px;
}
.oval-notes-toggle,
.oval-share-image {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 50px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(7,23,44,.88);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.oval-notes-toggle:hover, .oval-share-image:hover { background: rgba(11,34,64,.96); }
.oval-notes-toggle[aria-pressed="true"] {
  background: var(--blue);
  border-color: rgba(255,255,255,.95);
}
.field-notes-layout.notes-hidden { grid-template-columns: minmax(0, 1fr); }
.field-notes-layout.notes-hidden .oval { max-width: 100%; }

.oval-share-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 50px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(7,23,44,.88);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.image-share-modal[hidden] { display:none !important; }
.image-share-modal {
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.image-share-backdrop {
  position:absolute;
  inset:0;
  background:rgba(2,10,20,.72);
  backdrop-filter:blur(3px);
}
.image-share-panel {
  position:relative;
  z-index:1;
  width:min(92vw, 620px);
  max-height:92vh;
  overflow:auto;
  border-radius:16px;
  background:#fff;
  box-shadow:0 24px 70px rgba(0,0,0,.35);
  padding:16px;
}
.image-share-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.image-share-heading h2 { margin:3px 0 0; color:var(--navy-900); font-size:20px; }
.image-share-close {
  width:34px;
  height:34px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fafc;
  color:var(--navy-900);
  font-size:22px;
  line-height:1;
  font-weight:800;
}
.image-share-preview-wrap {
  display:flex;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:12px;
  background:#eef2f6;
  padding:8px;
}
.image-share-preview {
  display:block;
  width:auto;
  max-width:100%;
  max-height:62vh;
  border-radius:10px;
  box-shadow:0 5px 18px rgba(0,0,0,.18);
}
.image-share-status { min-height:18px; margin-top:8px; color:var(--muted); font-size:11px; line-height:1.4; }
.image-share-status.error { color:#b91c1c; }
.image-share-status.success { color:#166534; }
.image-share-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.image-share-actions .btn { flex:1 1 130px; }
body.image-share-open { overflow:hidden; }

.oval-magnets {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 12px;
  background: rgba(7,23,44,.88);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  min-width: 185px;
}
.oval-magnets.is-collapsed {
  min-width: 0;
  padding-bottom: 8px;
}
.oval-magnets-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.oval-magnets-label {
  display:block;
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.magnets-toggle-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  padding:0;
  border:1px solid rgba(255,255,255,.55);
  border-radius:6px;
  background: rgba(255,255,255,.08);
  color:#fff;
  font-size:15px;
  font-weight:900;
  line-height:1;
}
.magnets-toggle-btn:hover { background: rgba(255,255,255,.14); }
.oval-magnets-body {
  margin-top: 6px;
}
.oval-magnets.is-collapsed .oval-magnets-body {
  display:none;
}
.oval-magnet-buttons {
  display:flex;
  gap:7px;
  align-items:center;
  flex-wrap:wrap;
}
.magnet-swatch {
  width: calc(25px * var(--board-scale));
  height: calc(25px * var(--board-scale));
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: inset 0 0 0 1px rgba(6,18,33,.25);
  cursor: pointer;
  display:inline-flex; align-items:center; justify-content:center; color:#fff; font-size:calc(11px * var(--board-scale)); font-weight:900; text-shadow:0 1px 2px rgba(0,0,0,.75);
}
.magnet-swatch.is-active {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(255,255,255,.22), inset 0 0 0 1px rgba(6,18,33,.25);
}
.magnet-black { background:#111827; }
.magnet-blue { background:#2563eb; }
.magnet-red { background:#dc2626; }
.magnet-yellow { background:#facc15; }
.magnet-green { background:#16a34a; }
.magnet-pink { background:#ec4899; }
.oval-magnets-help {
  margin-top: 7px;
  color: rgba(255,255,255,.84);
  font-size: 12px;
  line-height: 1.05;
}
.position-node.has-magnet .position-role,
.position-node.has-magnet .position-input {
  box-shadow: 0 2px 7px rgba(0,0,0,.14);
}
.position-magnet-dot {
  display:inline-flex;
  width: calc(18px * var(--board-scale));
  height: calc(18px * var(--board-scale));
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 2px 5px rgba(0,0,0,.22);
  pointer-events: none;
  flex: 0 0 calc(18px * var(--board-scale));
  align-items:center; justify-content:center; color:#fff; font-size:calc(10px * var(--board-scale)); font-weight:900; line-height:1; text-align:center; text-shadow:0 1px 2px rgba(0,0,0,.7);
}
.position-magnet-dot.magnet-black { background:#111827; }
.position-magnet-dot.magnet-blue { background:#2563eb; }
.position-magnet-dot.magnet-red { background:#dc2626; }
.position-magnet-dot.magnet-yellow { background:#facc15; }
.position-magnet-dot.magnet-green { background:#16a34a; }
.position-magnet-dot.magnet-pink { background:#ec4899; }

.oval {
  --board-scale: 1;
  --board-box-scale: 1;
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 0.72 / 1;
  min-height: 700px;
  margin: 0;
  overflow: visible;
  background: linear-gradient(180deg, #7cc242 0%, #73b83c 100%);
  box-shadow: inset 0 0 0 3px rgba(18, 88, 25, .24), 0 10px 22px rgba(20, 61, 22, .16);
  border-radius: 16px;
}
.field-markings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.field-outline,
.field-arc,
.field-square,
.field-circle {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.field-outline { stroke: rgba(255,255,255,.98); stroke-width: 1.7; }
.field-arc { stroke-width: 1.45; }
.field-square,
.field-circle { stroke: rgba(255,255,255,.98); stroke-width: 1.15; }
.field-arc-top { stroke: #1769d2; }
.field-arc-bottom { stroke: #d62828; }

.position-node {
  position: absolute; transform: translate(-50%,-50%);
  width: calc(clamp(88px, 15.15%, 127px) * var(--board-box-scale));
  z-index: 2;
  overflow: visible;
}
.position-label-row {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:calc(5px * var(--board-box-scale));
  margin: 0 auto calc(4px * var(--board-box-scale));
  width: max-content;
  max-width: 100%;
}
.position-role {
  display: block; margin: 0; width: max-content; max-width: 100%;
  padding: calc(2px * var(--board-box-scale)) calc(7px * var(--board-box-scale)); border-radius: 999px;
  background: rgba(6,18,33,.84); color: #fff;
  font-size: calc(12px * var(--board-scale)); font-weight: 900; letter-spacing: .04em;
  line-height: 1.25;
  box-shadow: 0 2px 5px rgba(0,0,0,.15);
}
.position-input {
  width: 100%; height: calc(34px * var(--board-box-scale)); padding: calc(5px * var(--board-box-scale)) calc(7px * var(--board-box-scale));
  border: 1px solid rgba(255,255,255,.86); border-radius: calc(7px * var(--board-box-scale));
  background: rgba(255,255,255,.95); color: #0b1728;
  text-align: center; font-size: calc(13px * var(--board-scale)); font-weight: 800; line-height: 1.05;
  outline: none; box-shadow: 0 2px 7px rgba(0,0,0,.14);
}
.position-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,201,40,.3); }
.position-node.duplicate .position-input { border: 2px solid #fbbf24; background: #fff7d8; }
.position-node.duplicate::after {
  content: "Duplicate"; position:absolute; top:100%; left:50%; transform:translateX(-50%); margin-top:2px;
  font-size:9px; font-weight:900; color:#7c2d12; background:#fef3c7; padding:1px 4px; border-radius:4px;
}

.oval-scale-controls {
  position: absolute;
  left: 10px;
  bottom: 10px;
  transform: none;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 12px;
  background: rgba(7,23,44,.88);
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
.oval-scale-controls.is-collapsed {
  gap: 0;
  padding-right: 5px;
}
.oval-scale-controls-body {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.oval-scale-controls.is-collapsed .oval-scale-controls-body {
  display: none;
}
.oval-scale-toggle,
.oval-scale-btn {
  min-width: 42px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.oval-scale-toggle {
  min-width: 32px;
  width: 32px;
  padding: 0;
}
.oval-scale-toggle:hover,
.oval-scale-btn:hover { background: rgba(255,255,255,.14); }
.oval-scale-current {
  min-width: 76px;
}
.bench-wrap { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.bench-heading { align-items: center; margin-bottom: 10px; }
.bench-meta { display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.bench-count { color: var(--muted); font-size: 12px; }
.bench-add-btn { border:0; padding:0; background:transparent; color:var(--blue); font-size:11px; font-weight:900; cursor:pointer; }
.bench-add-btn:hover { text-decoration:underline; }
.bench-add-btn:disabled { color:#94a3b8; cursor:not-allowed; text-decoration:none; }
.bench-label-row { display:flex; align-items:center; gap:6px; width:max-content; max-width:100%; margin-bottom:5px; cursor:pointer; }
.bench-label-row label { margin-bottom:0 !important; cursor:pointer; }
.bench-magnet-dot { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; flex:0 0 18px; border-radius:50%; border:2px solid #fff; color:#fff; font-size:10px; line-height:1; font-weight:900; text-align:center; text-shadow:0 1px 2px rgba(0,0,0,.7); box-shadow:0 2px 5px rgba(0,0,0,.22); }
.bench-magnet-dot.magnet-black { background:#111827; }
.bench-magnet-dot.magnet-blue { background:#2563eb; }
.bench-magnet-dot.magnet-red { background:#dc2626; }
.bench-magnet-dot.magnet-yellow { background:#facc15; }
.bench-magnet-dot.magnet-green { background:#16a34a; }
.bench-magnet-dot.magnet-pink { background:#ec4899; }
.bench-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bench-slot { position:relative; border: 1px solid var(--line); border-radius: 10px; padding: 9px; background: #f8fafc; }
.bench-slot label { display:block; color:var(--navy-700); font-size:11px; font-weight:900; margin-bottom:5px; }
.bench-slot input { width:100%; border:1px solid #cbd5e1; border-radius:7px; padding:8px; font-size:12px; font-weight:700; }
.bench-slot.duplicate { border-color: #f59e0b; background: #fffbeb; }
.bench-remove-btn {
  position:absolute;
  top:5px;
  right:5px;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:6px;
  background:#fee2e2;
  color:#991b1b;
  font-size:16px;
  font-weight:900;
  line-height:1;
  cursor:pointer;
  z-index:3;
}
.bench-remove-btn:hover { background:#fecaca; }
.bench-slot:has(.bench-remove-btn) .bench-label-row { padding-right:24px; }


.match-info { margin: 6px 0 18px; }
.match-info > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.match-info dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.match-info dd { margin: 4px 0 0; color: var(--navy-900); font-size: 16px; font-weight: 800; word-break: break-word; }
.sharing-preview { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.sharing-preview h3 { margin: 5px 0 6px; color: var(--navy-900); font-size: 16px; }
.sharing-preview p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.share-label { display:block; margin:10px 0 5px; color:var(--navy-800); font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; }
.share-input { width:100%; padding:10px 11px; border:1px solid #cbd5e1; border-radius:8px; outline:none; background:#fff; color:var(--text); font-weight:800; }
.share-input:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(20,115,230,.12); }
.board-code-input { text-transform:uppercase; letter-spacing:.18em; text-align:center; font-size:17px; }
.share-action { margin-top:9px; }
.share-divider { display:flex; align-items:center; gap:8px; margin:14px 0 5px; color:#94a3b8; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.share-divider::before,.share-divider::after { content:""; flex:1; height:1px; background:var(--line); }
.share-live-row { display:flex; align-items:center; gap:8px; margin:8px 0 12px; color:var(--navy-900); font-size:15px; }
.share-live-dot { width:10px; height:10px; border-radius:50%; background:#f59e0b; box-shadow:0 0 0 3px rgba(245,158,11,.15); }
.share-live-dot.live { background:#16a34a; box-shadow:0 0 0 3px rgba(22,163,74,.15); }
.share-live-dot.offline { background:#dc2626; box-shadow:0 0 0 3px rgba(220,38,38,.15); }
.share-code-card { padding:12px; border-radius:10px; background:var(--navy-900); color:white; text-align:center; }
.share-code-card span { display:block; color:#a8bad0; font-size:9px; font-weight:900; letter-spacing:.12em; }
.share-code-card strong { display:block; margin-top:3px; font-size:27px; letter-spacing:.18em; }
.share-coaches { margin:10px 0 3px; color:var(--muted); font-size:12px; font-weight:800; text-align:center; }
.share-retention { margin-top:11px !important; font-size:10px !important; text-align:center; }
.share-status { min-height:18px; margin-top:8px; color:var(--muted); font-size:11px; line-height:1.4; }
.share-status.error { color:#b91c1c; font-weight:800; }
.share-status.success { color:#166534; font-weight:800; }


.btn { border: 0; border-radius: 9px; padding: 10px 14px; font-weight: 850; transition: transform .08s ease, filter .15s ease; }
.btn:hover:not(:disabled) { filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.secondary { background: #e5edf7; color: var(--navy-800); }
.btn.danger { background: var(--red); color: #fff; }
.btn.full { width: 100%; }

.setup-grid { display: grid; gap: 18px; }
.setup-card, .roster-card { padding: 20px; }
.form-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid label { color: var(--navy-800); font-size: 12px; font-weight: 850; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid input {
  display:block; width:100%; margin-top:6px; padding:11px 12px; border:1px solid #cbd5e1; border-radius:9px; outline:none;
  background:#fff; color:var(--text);
}
.form-grid input:focus, .roster-table input:focus, .bench-slot input:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(20,115,230,.12); }
.roster-heading { align-items: center; }
.roster-actions { display:flex; gap:8px; }
.helper { margin:-5px 0 14px; color:var(--muted); font-size:12px; }
.roster-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:11px; max-height: 520px; }
.roster-table { width:100%; border-collapse:collapse; min-width:700px; }
.roster-table th { position:sticky; top:0; z-index:1; padding:10px; text-align:left; color:#dbe8f8; background:var(--navy-800); font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
.roster-table td { padding:7px 10px; border-bottom:1px solid #edf2f7; background:#fff; }
.roster-table tr:last-child td { border-bottom:0; }
.roster-table tr.has-error td { background:#fff7ed; }
.roster-table .row-num { width:50px; text-align:center; }
.roster-table .remove-col { width:62px; }
.roster-table td:first-child { text-align:center; color:var(--muted); font-size:12px; font-weight:800; }
.roster-table input { width:100%; padding:8px 9px; border:1px solid #cbd5e1; border-radius:7px; outline:none; }
.player-number-input { max-width: 130px; }
.icon-btn { width:34px; height:34px; border:0; border-radius:8px; background:#fee2e2; color:#991b1b; font-weight:900; }
.roster-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:13px; }
#rosterCount { color:var(--muted); font-size:12px; font-weight:800; }

footer {
  display:flex; justify-content:space-between; gap:12px;
  padding:16px 24px 24px; color:#6b7d91; font-size:11px;
}

@media (max-width: 1080px) {
  .whiteboard-layout { grid-template-columns: 1fr; }
  .field-notes-layout { grid-template-columns: minmax(0, 5fr) minmax(240px, 2fr); gap: 3px; }
  .board-notes textarea { min-height: 430px; }
  .info-card { position: static; }
  .match-info { display:grid; grid-template-columns: repeat(5,1fr); gap:8px; }
  .match-info > div { border:1px solid var(--line); border-radius:9px; padding:10px; }
  .oval { min-height: 600px; max-width: 650px; }
}

@media (max-width: 760px) {
  .app-header { padding:12px 14px; min-height:78px; }
  .brand-mark { width:54px; height:54px; flex-basis:54px; border-radius:12px; }
  .app-header p { display:none; }
  .header-actions { flex-direction:column; gap:5px; align-items:flex-end; }
  .version { font-size:10px; }
  .btn.danger { padding:7px 10px; font-size:12px; }
  .app-shell { padding:12px 8px 24px; }
  .tabs { position:sticky; top:0; z-index:20; }
  .tab { flex:1; min-width:0; padding:10px 9px; font-size:12px; }
  .status-row { align-items:flex-start; }
  .autosave { text-align:right; }
  .field-card, .info-card, .setup-card, .roster-card { padding:12px; border-radius:12px; }
  .field-notes-layout { grid-template-columns: minmax(0, 5fr) minmax(150px, 2fr); gap: 3px; align-items: stretch; }
  .field-notes-layout.notes-hidden { grid-template-columns: minmax(0, 1fr); }
  .board-notes { min-height: 0; }
  .board-notes textarea { min-height: 280px; }
  .section-heading { display:block; }
  .section-heading p { text-align:left; margin-top:5px; }
  .oval { min-height: 0; aspect-ratio: .72 / 1; max-width: 100%; border-radius: 14px; }
  .oval-top-actions { top:7px; right:7px; gap:5px; }
  .oval-notes-toggle, .oval-share-image { height:45px; padding:8px 10px; font-size:11px; }
  .oval-scale-controls { bottom: 7px; gap: 5px; padding: 5px 6px; }
  .oval-scale-controls.is-collapsed { padding-right: 5px; }
  .oval-scale-btn { min-width: 38px; height: 30px; padding: 0 8px; font-size: 12px; }
  .oval-scale-toggle { min-width: 30px; width: 30px; height: 30px; font-size: 12px; }
  .oval-scale-current { min-width: 70px; }
  .oval-magnets { top:7px; left:7px; padding:9px 10px; min-width: 165px; }
  .oval-magnets-help { font-size:11px; }
  .magnet-swatch { width:calc(28px * var(--board-scale)); height:calc(28px * var(--board-scale)); font-size:calc(12px * var(--board-scale)); }
  .magnets-toggle-btn { width:24px; height:24px; font-size:14px; }
  .position-node { width: calc(clamp(72px, 18.36%, 96px) * var(--board-box-scale)); }
  .position-role { font-size:calc(11px * var(--board-scale)); padding:calc(1px * var(--board-box-scale)) calc(5px * var(--board-box-scale)); }
  .position-input { height:calc(29px * var(--board-box-scale)); font-size:calc(11px * var(--board-scale)); padding:calc(4px * var(--board-box-scale)); }
  .bench-grid { grid-template-columns: repeat(2,1fr); }
  .match-info { grid-template-columns: repeat(2,1fr); }
  .match-info > div:last-child { grid-column:1 / -1; }
  .form-grid { grid-template-columns:1fr; }
  .form-grid label.wide { grid-column:auto; }
  .roster-heading { display:block; }
  .roster-actions { margin-top:10px; }
  .roster-actions .btn { flex:1; }
  footer { flex-direction:column; padding:14px; }
}

@media (max-width: 430px) {
  .ground-rain-metrics { grid-template-columns:1fr; }
  .app-header h1 { font-size:17px; }
  .oval { aspect-ratio: .72 / 1; }
  .position-node { width: calc(20.20% * var(--board-scale)); }
  .oval-magnets { min-width: 150px; }
  .oval-magnet-buttons { gap:6px; }
  .position-magnet-dot { width:calc(16px * var(--board-scale)); height:calc(16px * var(--board-scale)); flex-basis:calc(16px * var(--board-scale)); font-size:calc(10px * var(--board-scale)); }
  .bench-magnet-dot { width:16px; height:16px; flex-basis:16px; font-size:9px; }
  .position-input { font-size:calc(10px * var(--board-scale)); }
  .bench-grid { grid-template-columns:1fr 1fr; }
  .match-info { grid-template-columns:1fr; }
  .match-info > div:last-child { grid-column:auto; }
}


/* v1.0.3 setup/team list/weather */
.team-list-card, .weather-card { padding: 20px; }
.team-list-help, .weather-help { line-height: 1.55; color: var(--muted); }
.team-list-input {
  width: 100%; min-height: 210px; resize: vertical; padding: 14px;
  border: 1px solid #cbd5e1; border-radius: 12px; background: #fbfdff; color: var(--text);
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; outline: none;
}
.team-list-input:focus, .weather-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,115,230,.12); }
.team-list-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top: 12px; }
.team-list-actions #rosterCount { margin-left: 2px; }
.inline-status { min-height: 20px; margin-top: 9px; color: #166534; font-size: 12px; font-weight: 750; }
.inline-status.error { color: #b42318; }
.weather-location-label { display:block; color:var(--navy-800); font-size:12px; font-weight:850; }
.weather-location-label input { display:block; width:100%; margin-top:7px; padding:12px; border:1px solid #cbd5e1; border-radius:10px; outline:none; background:#fff; color:var(--text); }
.weather-actions { display:flex; gap:10px; flex-wrap:wrap; margin: 14px 0 6px; }
.btn.dark { background: #07366d; color:#fff; }
.weather-summary { margin-top: 12px; padding: 12px 14px; border:1px solid #cfe0f5; border-radius:11px; background:#f4f8fd; color:var(--navy-900); font-size:15px; line-height:1.55; }
.setup-footer-actions { display:flex; justify-content:flex-end; }
@media (max-width:760px){
  .team-list-card, .weather-card { padding:12px; }
  .weather-actions .btn { flex:1 1 calc(50% - 6px); }
  .setup-footer-actions .btn { width:100%; }
}
@media (max-width:430px){
  .weather-actions .btn { flex-basis:100%; }
}


/* v1.0.6 ground-surface estimate shown with Weather Lookup */

.ground-rain-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:10px 0 8px; }
.ground-rain-metrics > div { padding:8px 10px; border:1px solid #dbe4ee; border-radius:9px; background:#fff; }
.ground-rain-metrics span { display:block; color:var(--muted); font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; }
.ground-rain-metrics strong { display:block; margin-top:3px; color:var(--navy-900); font-size:14px; }
.ground-estimate-card {
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid #cfe0f5;
  border-radius: 11px;
  background: #f8fbff;
}
.ground-estimate-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.ground-estimate-heading strong { color:var(--navy-900); font-size:18px; }
.ground-estimate-card p { margin:7px 0 5px; color:#53677f; font-size:12px; line-height:1.45; }
.ground-estimate-card small { color:#718198; font-size:10px; line-height:1.4; }
