/* Handball Tracker v1.28 revision 16: dark unified shells with light court surfaces, scrollable linked review, defense-position filter support */
body.v128r16-ui .r3-review-card:has(canvas),
body.v128r16-ui .r13-gk-card,
body.v128r16-ui .r14-linked-review {
  background: linear-gradient(145deg, #071a2a, #04111d) !important;
  color: #e8f4fb !important;
  border: 1px solid rgba(80, 140, 180, .32) !important;
  box-shadow: 0 18px 42px rgba(0, 8, 15, .38) !important;
}
body.v128r16-ui .r3-review-card:has(canvas) h2,
body.v128r16-ui .r3-review-card:has(canvas) h3,
body.v128r16-ui .r3-review-card:has(canvas) h4,
body.v128r16-ui .r14-linked-review h2,
body.v128r16-ui .r14-linked-review h3,
body.v128r16-ui .r13-gk-card h3,
body.v128r16-ui .r13-gk-card h4 {
  color: #f2fbff !important;
}
body.v128r16-ui .r3-review-card:has(canvas) p,
body.v128r16-ui .r14-linked-review p,
body.v128r16-ui .r13-gk-card p,
body.v128r16-ui .r13-gk-card span,
body.v128r16-ui .r3-field-legend {
  color: #9bb4c6 !important;
}
body.v128r16-ui .r3-half-court-wrap,
body.v128r16-ui .r3-goal-wrap,
body.v128r16-ui .r3-full-field-wrap,
body.v128r16-ui .r3-timeline-wrap,
body.v128r16-ui #courtWrap,
body.v128r16-ui #goalWrap {
  background: linear-gradient(180deg, #0b2132, #04111d) !important;
  border: 1px solid rgba(91, 148, 188, .34) !important;
  border-radius: 18px !important;
  padding: 9px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 12px 30px rgba(0, 10, 20, .30) !important;
}
body.v128r16-ui .r3-half-court-wrap canvas,
body.v128r16-ui .r3-goal-wrap canvas,
body.v128r16-ui .r3-full-field-wrap canvas,
body.v128r16-ui #courtCanvas,
body.v128r16-ui #goalCanvas {
  border-radius: 14px !important;
  background: #f5f9fc !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 8px 20px rgba(0,0,0,.18) !important;
}

/* Live tracking returns to the dark app personality; only the drawn field itself remains light. */
body.v128r16-ui #trackingInputCard.tracking-main-card {
  background: linear-gradient(145deg, #091c2c, #061624) !important;
  color: #e8f4fb !important;
  border-color: rgba(91, 148, 188, .34) !important;
  box-shadow: 0 18px 42px rgba(0, 8, 15, .42) !important;
}
body.v128r16-ui #trackingInputCard h2,
body.v128r16-ui #trackingInputCard h3,
body.v128r16-ui #trackingInputCard label {
  color: #f2fbff !important;
}
body.v128r16-ui #trackingInputCard p,
body.v128r16-ui #trackingInputCard .hint,
body.v128r16-ui #trackingInputCard #stepText {
  color: #98afc1 !important;
}
body.v128r16-ui #trackingInputCard input,
body.v128r16-ui #trackingInputCard select,
body.v128r16-ui #detailsPanel input,
body.v128r16-ui #detailsPanel select {
  background: #071827 !important;
  color: #e8f4fb !important;
  border-color: rgba(91, 148, 188, .32) !important;
}
body.v128r16-ui .r10-active-players {
  background: linear-gradient(145deg, #0a2032, #061624) !important;
  color: #e8f4fb !important;
  border-color: rgba(91, 148, 188, .32) !important;
}
body.v128r16-ui .r10-active-players h3,
body.v128r16-ui .r10-active-players strong { color: #f2fbff !important; }
body.v128r16-ui .r10-active-players p,
body.v128r16-ui .r10-active-players span { color: #9bb4c6 !important; }

/* Linked shot review stays compact, but expanded data can scroll horizontally on phone. */
body.v128r16-ui .r14-linked-review,
body.v128r16-ui .r15-linked-review {
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
body.v128r16-ui .r15-linked-review > summary {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: min(100%, 340px);
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(145deg, #071a2a, #04111d) !important;
  border-radius: 14px;
  padding: 4px 4px 8px !important;
}
body.v128r16-ui .r15-linked-review > summary h2 { color: #f2fbff !important; }
body.v128r16-ui .r15-linked-review > summary p { color: #9bb4c6 !important; }
body.v128r16-ui .r15-expand-label {
  background: #0b2132 !important;
  color: #dff3ff !important;
  border-color: rgba(91, 148, 188, .42) !important;
}
body.v128r16-ui .r15-linked-review[open] .r14-selected-shot-card,
body.v128r16-ui .r15-linked-review[open] .r14-shot-list {
  min-width: 760px;
}
body.v128r16-ui .r14-selected-shot-card {
  background: linear-gradient(145deg, #0b2132, #071827) !important;
  color: #e8f4fb !important;
  border-color: rgba(91, 148, 188, .32) !important;
}
body.v128r16-ui .r14-detail-grid span { color: #9bb4c6 !important; }
body.v128r16-ui .r14-detail-grid b { color: #f2fbff !important; }
body.v128r16-ui .r14-selected-shot-card button,
body.v128r16-ui .r14-shot-list button {
  background: #0b2132 !important;
  color: #dff3ff !important;
  border-color: rgba(91, 148, 188, .38) !important;
}
body.v128r16-ui .r14-shot-list {
  max-width: 100%;
  overflow-x: auto !important;
  border-color: rgba(91, 148, 188, .28) !important;
}
body.v128r16-ui .r14-shot-list table {
  min-width: 760px;
  background: #071827 !important;
}
body.v128r16-ui .r14-shot-list th {
  background: #0b2132 !important;
  color: #b7d4e8 !important;
}
body.v128r16-ui .r14-shot-list td {
  color: #e8f4fb !important;
  border-bottom-color: rgba(91,148,188,.18) !important;
}
body.v128r16-ui .r14-shot-list tr.selected td,
body.v128r16-ui .r14-shot-list tr:hover td {
  background: rgba(91, 148, 188, .16) !important;
}

@media (max-width: 760px) {
  body.v128r16-ui .r15-linked-review[open] .r14-selected-shot-card,
  body.v128r16-ui .r15-linked-review[open] .r14-shot-list {
    min-width: 720px;
  }
  body.v128r16-ui .r14-shot-list table { min-width: 720px; }
}
