:root {
        --brand: rgb(0, 24, 156);
        --bg: #030621;
        --panel: rgba(255, 255, 255, 0.06);
        --panel-2: rgba(255, 255, 255, 0.09);
        --stroke: rgba(255, 255, 255, 0.12);
        --text: rgba(255, 255, 255, 0.92);
        --muted: rgba(255, 255, 255, 0.68);
        --muted-2: rgba(255, 255, 255, 0.52);
        --shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
        --radius: 16px;
        --radius-sm: 12px;
        --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji";
      }

      * {
        box-sizing: border-box;
      }

      html {
        height: 100%;
      }

      body {
        min-height: 100%;
        margin: 0;
        font-family: var(--sans);
        color: var(--text);
        background: #000c4b;
        padding-top: 60px; /* Height of fixed header */
      }

      .bg-layer {
        display: none;
      }

      /* Fixed Header */
      .app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #000b72;
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000;
        display: grid;
        grid-template-columns: 48px 1fr 48px;
        align-items: center;
        padding: 0 16px;
      }

      .hamburger-btn {
        appearance: none;
        background: transparent;
        border: none;
        color: var(--text);
        cursor: pointer;
        padding: 8px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 32px;
        height: 32px;
        justify-content: center;
      }

      .hamburger-btn span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--text);
        border-radius: 2px;
        transition: all 0.3s ease;
      }

      .hamburger-btn:hover span {
        background: rgba(255, 255, 255, 1);
      }

      .hamburger-btn.open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
      }

      .hamburger-btn.open span:nth-child(2) {
        opacity: 0;
      }

      .hamburger-btn.open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
      }

      .header-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        min-height: 0;
      }

      .header-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.3;
        margin: 0;
        color: var(--text);
      }

      .header-subtitle {
        font-size: 13px;
        line-height: 1.3;
        margin: 0;
        color: var(--muted);
      }

      /* Slide-out Menu */
      .slide-menu {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: 280px;
        background: rgba(3, 6, 33, 0.98);
        backdrop-filter: blur(10px);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        overflow-y: auto;
      }

      .slide-menu.open {
        transform: translateX(0);
      }

      .menu-overlay {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 998;
      }

      .menu-overlay.open {
        opacity: 1;
        pointer-events: auto;
      }

      .menu-nav {
        padding: 20px 0;
      }

      .menu-nav a {
        display: flex;
        align-items: center;
        padding: 14px 20px;
        color: var(--text);
        text-decoration: none;
        transition: background 0.15s ease;
        font-size: 15px;
      }

      .menu-nav a:hover {
        background: rgba(255, 255, 255, 0.05);
      }

      .menu-nav a.active {
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 1);
      }

      .menu-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.1);
        margin: 12px 20px;
      }

      a {
        color: inherit;
        text-decoration: none;
      }

      .wrap {
        max-width: 1100px;
        margin: 0 auto;
        padding: 12px;
      }

      .page {
        display: grid;
        grid-template-columns: 1.25fr 0.75fr;
        gap: 14px;
      }

      .page.single-col {
        grid-template-columns: 1fr;
      }

      @media (max-width: 980px) {
        .page {
          grid-template-columns: 1fr;
        }
      }

      .col {
        display: grid;
        gap: 14px;
        align-content: start;
      }

      .stat-controls-header {
        padding: 14px 14px 12px;
        border-bottom: 1px solid var(--stroke);
        background: rgba(255, 255, 255, 0.03);
        display: grid;
        grid-template-rows: auto auto;
        gap: 10px;
      }

      .stat-controls-header.score-header {
        border-bottom: none;
        background: transparent;
        padding: 14px 12px 6px;
      }

      .stat-controls-body {
        padding: 14px;
      }

      .shooting-section {
        display: grid;
        gap: 10px;
      }

      .shooting-section + .shooting-section {
        margin-top: 12px;
      }

      .section-label {
        color: var(--muted);
        font-size: 12px;
        letter-spacing: 0.08px;
        text-transform: uppercase;
      }

      .card {
        border: 1px solid var(--stroke);
        background: var(--panel);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        overflow: hidden;
      }

      .card.inner-card {
        box-shadow: none;
        background: rgba(255, 255, 255, 0.03);
        margin: 0;
      }

      .card.inner-card .card-header {
        position: static;
        justify-content: space-between;
        text-align: left;
      }

      .card.inner-card .card-body {
        padding: 0;
      }

      .minutes-card .card-body {
        padding: 12px;
      }

      .minutes-card-body {
        padding: 4px 0 8px;
      }

      .minutes-card .card-header {
        padding: 8px 12px;
        min-height: 36px;
        justify-content: center;
        text-align: center;
      }

      .minutes-card .card-header h3 {
        margin: 0;
        font-weight: 650;
        font-size: 13px;
        width: 100%;
        text-align: center;
      }

      .minutes-card {
        margin-top: 12px;
      }

      .shooting-section + .minutes-card {
        margin-top: 12px;
      }

      .minutes-list {
        margin: 12px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
      }

      .minutes-list.compact {
        margin: 0;
        gap: 6px;
      }

      .minutes-cell {
        display: grid;
        grid-template-rows: auto auto;
        justify-items: center;
        align-items: center;
        padding: 8px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.03);
        font-size: 0.9rem;
        gap: 6px;
      }

      .minutes-cell input {
        width: 100%;
        max-width: 80px;
        text-align: center;
        padding: 6px 8px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
        font-weight: 700;
      }

      .minutes-cell.readonly {
        background: rgba(255, 255, 255, 0.02);
      }

      .minutes-cell.readonly .minutes-value {
        background: transparent;
        border: none;
        font-weight: 700;
        color: var(--text);
      }

      .minutes-value {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        padding: 6px 8px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
        font-weight: 700;
        text-align: center;
      }


      .minutes-header {
        display: none;
      }



      .card-header {
        padding: 14px 14px 12px;
        border-bottom: 1px solid var(--stroke);
        background: rgba(255, 255, 255, 0.03);
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
      }

      .card-header h2 {
        margin: 0;
        font-size: 15px;
        letter-spacing: 0.2px;
      }

      .card-header-main {
        text-align: center;
      }

      .card-header-actions {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        gap: 10px;
        align-items: center;
      }

      .card-body {
        padding: 14px;
      }

      .subtle {
        color: var(--muted);
        font-size: 13px;
      }

      .hidden {
        display: none;
      }

      .event-title {
        font-weight: 650;
        font-size: 13px;
      }

      .meta-centered {
        justify-self: center;
        grid-column: 1 / -1;
      }

      .row {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        align-items: center;
      }

      .inline-actions {
        margin-top: 12px;
      }

      .spacer {
        flex: 1;
      }

      .control-row {
        width: 100%;
        display: flex;
        justify-content: space-evenly;
        gap: 12px;
        flex-wrap: wrap;
      }

      .control-row .btn {
        min-width: 140px;
      }

      .btn {
        appearance: none;
        border: 1px solid rgba(255, 255, 255, 0.26);
        background: rgba(255, 255, 255, 0.08);
        color: var(--text);
        padding: 10px 12px;
        border-radius: 12px;
        cursor: pointer;
        font-weight: 600;
        letter-spacing: 0.1px;
        white-space: nowrap;
      }

      .btn:hover {
        background: rgba(255, 255, 255, 0.12);
      }

      .btn:active {
        transform: translateY(1px);
      }

      .btn[disabled] {
        opacity: 0.45;
        cursor: not-allowed;
        transform: none;
      }

      .btn.good {
        border-color: rgba(255, 255, 255, 0.26);
        background: rgba(255, 255, 255, 0.08);
      }

      .btn.warn {
        border-color: rgba(255, 255, 255, 0.26);
        background: rgba(255, 255, 255, 0.08);
      }

      .btn.bad {
        border-color: rgba(0, 24, 156, 0.75);
        background: rgba(0, 24, 156, 0.22);
      }

      .btn-icon {
        appearance: none;
        border: 1px solid rgba(255, 255, 255, 0.16);
        background: rgba(255, 255, 255, 0.04);
        color: var(--muted);
        cursor: pointer;
        padding: 4px 8px;
        font-size: 14px;
        border-radius: 6px;
        transition: all 0.15s ease;
        font-family: var(--sans);
        line-height: 1.4;
      }

      .btn-icon:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text);
        border-color: rgba(255, 255, 255, 0.26);
      }

      .btn-icon.danger:hover {
        background: rgba(220, 38, 38, 0.15);
        border-color: rgba(220, 38, 38, 0.4);
        color: rgb(252, 165, 165);
      }

      .pill {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 14px;
        border: 1px solid var(--stroke);
        background: rgba(255, 255, 255, 0.03);
        color: var(--muted);
        font-size: 13px;
      }

      .pill strong {
        color: var(--text);
      }

      .pill-btn {
        appearance: none;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 12px;
        line-height: 1;
        font-size: 16px;
        font-weight: 900;
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
        text-align: center;
      }

      .pill-btn:hover {
        background: rgba(255, 255, 255, 0.07);
      }

      .pill-btn[disabled] {
        opacity: 0.45;
        cursor: not-allowed;
      }

      .pill.locked {
        border-color: rgba(0, 24, 156, 0.85);
        background: rgba(0, 24, 156, 0.25);
        color: rgba(255, 255, 255, 0.84);
      }

      .pill.score {
        border-color: rgba(0, 24, 156, 0.75);
        background: rgba(0, 24, 156, 0.20);
        color: rgba(255, 255, 255, 0.88);
      }

      .grid-2 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      .form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      .form-grid .full {
        grid-column: 1 / -1;
      }

      .form-row-2 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        grid-column: 1 / -1;
      }

      @media (max-width: 620px) {
        .grid-2 {
          grid-template-columns: 1fr;
        }

        .form-grid {
          grid-template-columns: 1fr;
        }

        .form-row-2 {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }

      label {
        display: block;
        color: var(--muted);
        font-size: 12px;
        margin-bottom: 6px;
      }

      input,
      select,
      textarea {
        width: 100%;
        border: 1px solid var(--stroke);
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
        border-radius: 12px;
        padding: 10px 10px;
        outline: none;
      }


      /* Fix calendar icon color for datetime inputs */
      input[type="datetime-local"]::-webkit-calendar-picker-indicator,
      input[type="date"]::-webkit-calendar-picker-indicator,
      input[type="time"]::-webkit-calendar-picker-indicator {
        filter: brightness(0) invert(1);
        opacity: 0.7;
        cursor: pointer;
      }

      input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
      input[type="date"]:hover::-webkit-calendar-picker-indicator,
      input[type="time"]:hover::-webkit-calendar-picker-indicator {
        opacity: 1;
      }

      textarea {
        min-height: 72px;
        resize: vertical;
      }

      input:focus,
      select:focus,
      textarea:focus {
        border-color: rgba(0, 24, 156, 0.85);
        box-shadow: 0 0 0 3px rgba(0, 24, 156, 0.22);
      }

      .kpiGrid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
      }

      .kpiGrid.compact {
        gap: 6px;
      }

      @media (max-width: 980px) {
        .kpiGrid {
          grid-template-columns: repeat(4, minmax(0, 1fr));
        }
      }

      .kpi {
        border: none;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 14px;
        padding: 10px 12px;
      }

      .kpi .label {
        color: var(--muted);
        font-size: 12px;
        text-align: center;
      }

      .kpi .value {
        margin-top: 6px;
        font-size: 16px;
        font-family: var(--mono);
        font-weight: 800;
        white-space: nowrap;
        text-align: center;
      }

      .hintline {
        margin-top: 10px;
        color: var(--muted-2);
        font-size: 12px;
        line-height: 1.35;
      }

      .score-row {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        flex-wrap: wrap;
      }

      .score-row.single-row {
        flex-wrap: nowrap;
        justify-content: space-between;
      }

      .score-row.single-row .score-compact {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 6px;
        padding: 4px 0;
      }

      .score-row.single-row .score-compact:not(:first-child) {
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        padding-left: 16px;
      }

      .score-row.single-row .score-compact:not(:last-child) {
        padding-right: 16px;
      }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
  margin-top: 6px;
}

      /* Player status badge */
      .player-status-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 10px;
        border-radius: 0;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        line-height: 1.2;
        text-align: center;
      }

      .player-status-badge.in {
        background: rgba(34, 197, 94, 0.25);
        border: 1px solid rgba(34, 197, 94, 0.5);
        color: #22c55e;
      }

      .player-status-badge.out {
        background: rgba(239, 68, 68, 0.18);
        border: 1px solid rgba(239, 68, 68, 0.4);
        color: #ef4444;
      }

      .score-compact {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 12px;
        border: none;
        border-radius: 0;
        background: transparent;
        padding: 0;
        width: 100%;
        flex: 1 1 520px;
      }

      .score-side {
        display: grid;
        grid-template-rows: auto auto;
        justify-items: center;
        gap: 6px;
        min-width: 0;
      }

      .score-controls {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-width: 0;
      }

      .clock-input {
        width: 72px;
        min-height: 44px;
        text-align: center;
        padding: 8px 10px;
        border-radius: 0;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
        font-weight: 700;
        font-size: 17px;
        line-height: 1;
      }

      .clock-input:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.35);
        outline-offset: 2px;
      }

      .score-compact .name {
        color: var(--muted);
        font-size: 12px;
        font-weight: 750;
      }

      .score-compact .val {
        font-family: var(--mono);
        font-weight: 950;
        font-size: 16px;
        min-width: 22px;
        text-align: right;
      }

      .score-compact .dash {
        width: 1px;
        height: calc(100% - 14px);
        background: rgba(255, 255, 255, 0.14);
        justify-self: center;
      }

      .row-sep {
        height: 1px;
        width: calc(100% - 14px);
        background: rgba(255, 255, 255, 0.14);
        justify-self: center;
      }

      .stepper.compact {
        border-radius: 999px;
      }

      .stepper.compact button {
        padding: 6px 8px;
        min-width: 30px;
      }

      .events {
        display: grid;
        gap: 10px;
      }

      .event-list {
        border: 1px solid var(--stroke);
        border-radius: var(--radius);
        overflow: hidden;
        background: rgba(255, 255, 255, 0.03);
      }

      .event-item {
        display: grid;
        gap: 10px;
        padding: 10px 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
      }

      /* Recent events list layout (3 columns) */
      #eventList .event-item {
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 12px;
      }

      /* Empty state spans all columns */
      #eventList .event-item .top,
      #eventList .event-item .event-meta-row {
        grid-column: 1 / -1;
      }

      .stats-feed .event-item {
        border-top-color: rgba(255, 255, 255, 0.04);
      }

      .stats-feed {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
      }

      .stats-feed .event-item:last-child {
        padding-bottom: 6px;
      }

      .event-item .event-label {
        font-weight: 600;
        font-size: 13px;
      }

      .event-item .event-meta {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        font-size: 12px;
        opacity: 0.7;
      }

      .event-item .event-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 28px;
      }

      .event-item .meta {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .event-item .meta-text {
        line-height: 1;
      }

      .stat-table {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 16px;
        width: 100%;
      }

      .stat-table.full {
        grid-template-columns: minmax(0, 1fr);
      }

      .stat-grid-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin-top: 12px;
        font-size: 13px;
      }

      .stat-grid-table th,
      .stat-grid-table td {
        padding: 8px 10px;
      }

      .stat-grid-table thead th {
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-size: 11px;
        color: var(--muted);
        background: rgba(255, 255, 255, 0.04);
      }

      .stat-grid-table thead th:first-child {
        text-align: left;
      }

      .stat-grid-table tbody tr {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      }

      .stat-grid-table tbody tr:last-child {
        border-bottom: none;
      }

      .stat-grid-table td {
        border-left: none;
      }

      .stat-grid-table td:last-child,
      .stat-grid-table th:last-child {
        text-align: right;
      }

      .stat-grid-table tfoot td {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        font-weight: 700;
      }

      .stat-grid-table td:first-child,
      .stat-grid-table th:first-child {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .stat-grid-table.split-table th:not(:first-child),
      .stat-grid-table.split-table td:not(:first-child) {
        text-align: right;
      }

      .stat-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 10px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.02);
        width: 100%;
        min-height: 48px;
      }

      .stat-row .label {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--muted);
        flex: 1 1 auto;
        min-width: 0;
      }

      .stat-row .value {
        font-size: 14px;
        font-weight: 700;
        color: var(--text);
        text-align: right;
        flex: 0 1 auto;
        min-width: 0;
        white-space: nowrap;
      }


      .stat-row.split {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: center;
        gap: 16px;
        border: none;
        background: transparent;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 12px;
      }
      .stat-row.split:last-child {
        border-bottom: none;
        padding-bottom: 8px;
      }

      .stat-row.split .label {
        text-align: center;
        justify-self: center;
      }

      .stat-row .split-values {
        grid-column: span 3;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 12px;
        justify-items: center;
      }

      .stat-row .split-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 48px;
      }

      .stat-row .split-item .split-label {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--muted);
        text-align: center;
      }

      .stat-row .split-values strong {
        color: var(--text);
        font-weight: 700;
        font-size: 13px;
        font-variant-numeric: tabular-nums;
      }


      .event-item:first-child {
        border-top: none;
      }

      .event-item .top {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
        background: rgba(255, 255, 255, 0.03);
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 0;
        padding: 10px 12px;
        margin: -10px -12px 0;
        width: calc(100% + 24px);
        justify-content: center;
      }

      .event-item .meta {
        color: var(--muted-2);
        font-size: 12px;
      }


      .game-list {
        display: grid;
        gap: 12px;
      }

      .list-heading {
        font-size: 13px;
        font-weight: 700;
        color: var(--muted);
        letter-spacing: 0.04em;
        text-transform: uppercase;
        margin: 6px 4px 8px;
      }

      .day-card .card-header {
        justify-content: center;
        padding: 8px 12px;
      }

      .day-card .card-body {
        padding: 12px;
        display: grid;
        gap: 10px;
      }

      .hidden {
        display: none;
      }

      .game-item {
        border: 1px solid var(--stroke);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.03);
        padding: 12px;
        display: grid;
        gap: 8px;
        margin-bottom: 12px;
      }

      .game-top {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 10px;
        flex-wrap: wrap;
      }

      .game-title {
        font-weight: 700;
        font-size: 14px;
      }

      .game-meta {
        color: var(--muted);
        font-size: 12px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }

      .game-meta .meta-spacer {
        margin-left: auto;
      }

      .game-result {
        font-weight: 700;
      }

      .game-result.win {
        color: #3fd36e;
      }

      .game-result.loss {
        color: #ff6b6b;
      }

      .game-kpis {
        display: flex;
        gap: 14px;
        justify-content: space-between;
        font-family: var(--mono);
        font-size: 12px;
        color: var(--muted-2);
      }

      .game-kpis-group {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        display: grid;
        gap: 6px;
      }

      .delta {
        font-family: var(--mono);
        font-weight: 900;
        align-self: center;
        padding: 0;
        border-radius: 0;
        border: none;
        background: transparent;
      }

      .delta.pos {
        color: rgba(255, 255, 255, 0.85);
      }

      .delta.neg {
        color: rgba(255, 255, 255, 0.75);
      }

      .event-meta-row {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 10px;
      }

      .event-meta-row.kpi-meta-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 0;
      }

      .event-meta-row.kpi-meta-row .kpiGrid {
        gap: 8px;
        padding: 6px 0;
      }

      .event-meta-row.stat-meta-row {
        grid-template-columns: minmax(0, 1fr);
      }

      .event-actions-right {
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }

      .mini-btn {
        appearance: none;
        border: 1px solid var(--stroke);
        background: rgba(255, 255, 255, 0.03);
        color: rgba(255, 255, 255, 0.86);
        padding: 6px 10px;
        border-radius: 999px;
        cursor: pointer;
        font-weight: 750;
        font-size: 12px;
      }

      .mini-btn:hover {
        background: rgba(255, 255, 255, 0.06);
      }

      .mini-btn[disabled] {
        opacity: 0.45;
        cursor: not-allowed;
      }

      .small {
        font-size: 12px;
        color: var(--muted);
      }

      .undo-note {
        margin-top: 8px;
        text-align: center;
      }

      .divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.08);
        margin: 12px 0;
      }

      .quick {
        border: 1px solid var(--stroke);
        background: rgba(255, 255, 255, 0.03);
        border-radius: var(--radius);
        padding: 12px;
      }

      .quick-header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 10px;
      }

      .quick-title {
        font-weight: 800;
        letter-spacing: 0.1px;
      }

      .quick-sections {
        display: grid;
        gap: 12px;
      }

      .quick-section {
        display: grid;
        gap: 8px;
      }

      .quick-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
      }

      @media (max-width: 620px) {
        .quick-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }

      .stat-pair {
        display: grid;
        grid-template-columns: 1fr 1fr;
        border: 1px solid var(--stroke);
        border-radius: 14px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.03);
      }

      .stat-pair.single {
        grid-template-columns: 1fr;
      }

      .stat-grid .stat-pair {
        border: none;
        border-radius: 0;
        background: transparent;
        gap: 12px;
        overflow: visible;
      }

      .shot-grid {
        width: 100%;
        max-width: 980px;
        margin: 0 auto;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
      }

      @media (max-width: 820px) {
        .shot-grid {
          grid-template-columns: 1fr;
        }
      }

      .stat-grid {
        width: 100%;
        max-width: 980px;
        margin: 0 auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
      }

      .stat-tile {
        display: grid;
        grid-template-rows: auto auto;
        min-width: 0;
      }

      .stat-tile.wide {
        grid-column: 1 / -1;
      }

      .stat-tile.tile {
        border: 1px solid var(--stroke);
        border-radius: 14px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.03);
      }

      .stat-btn {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        min-height: 46px;
        transition: filter 120ms ease;
      }

      .stat-btn.solo {
        justify-content: center;
      }

      .stat-action {
        appearance: none;
        border: none;
        background: transparent;
        color: var(--text);
        cursor: pointer;
        padding: 12px 12px;
        font-weight: 800;
        letter-spacing: 0.1px;
        text-align: center;
        flex: 1;
        min-width: 0;
      }

      .stat-action.solo {
        width: 100%;
      }

      .stat-value {
        appearance: none;
        border: none;
        background: rgba(255, 255, 255, 0.05);
        color: var(--text);
        cursor: pointer;
        padding: 12px 12px;
        min-width: 56px;
        font-family: var(--mono);
        font-weight: 950;
        border-left: 1px solid rgba(255, 255, 255, 0.10);
      }

      .edit-panel {
        border-top: 1px solid rgba(255, 255, 255, 0.10);
        background: rgba(0, 0, 0, 0.10);
        padding: 10px 10px;
        display: none;
      }

      .edit-panel.open {
        display: block;
      }

      .confirm-panel {
        border-top: 1px solid rgba(255, 255, 255, 0.10);
        background: rgba(0, 0, 0, 0.12);
        padding: 10px 10px;
        display: none;
      }

      .confirm-panel.open {
        display: block;
      }

      .confirm-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: nowrap;
      }

      .confirm-actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }

      .stat-control-row {
        display: grid;
        gap: 10px;
        width: 100%;
      }

      .stat-control-row .edit-panel {
        border: 1px solid var(--stroke);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.03);
      }

      .stat-control-row .confirm-panel {
        border: 1px solid rgba(239, 68, 68, 0.45);
        border-radius: 14px;
        background: rgba(239, 68, 68, 0.10);
      }

      /* Header-level confirm panels (player transitions, quarter advance) */
      .stat-controls-header > .confirm-panel {
        border: 1px solid var(--stroke);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.03);
        margin-top: 10px;
      }

      .stat-controls-header > .confirm-panel .pill-btn {
        border-radius: 12px;
        padding: 10px 16px;
        font-size: 15px;
        min-width: auto;
        min-height: auto;
      }

      .stat-controls-header > .confirm-panel .edit-title {
        font-weight: 600;
        font-size: 14px;
      }

      .edit-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        flex-wrap: nowrap;
      }

      .edit-title {
        font-weight: 800;
        letter-spacing: 0.1px;
        text-align: left;
      }

      .edit-controls {
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }

      .edit-value {
        min-width: 48px;
        text-align: center;
        font-family: var(--mono);
        font-weight: 900;
        padding: 8px 10px;
        border-radius: 10px;
        border: 1px solid var(--stroke);
        background: rgba(255, 255, 255, 0.05);
      }

      .edit-help {
        margin-top: 8px;
        color: var(--muted-2);
        font-size: 12px;
      }

      /* Put the value segment on the outer edge of each paired button. */
      .stat-pair > .stat-tile:first-child .stat-btn {
        flex-direction: row-reverse;
      }

      .stat-pair > .stat-tile:first-child .stat-value {
        border-left: none;
        border-right: 1px solid rgba(255, 255, 255, 0.10);
      }

      .stat-pair > .stat-tile + .stat-tile {
        border-left: 1px solid rgba(255, 255, 255, 0.10);
      }

      .stat-grid .stat-pair > .stat-tile + .stat-tile {
        border-left: none;
      }

      .stat-btn:hover {
        filter: brightness(1.08);
      }

      .stat-action[disabled],
      .stat-value[disabled] {
        opacity: 0.45;
        cursor: not-allowed;
      }

      .stat-btn.good {
        background: rgba(34, 197, 94, 0.22);
      }

      .stat-btn.bad {
        background: rgba(239, 68, 68, 0.18);
      }

      .stat-btn.undo {
        background: rgba(239, 68, 68, 0.18);
        border: 1px solid rgba(239, 68, 68, 0.55);
        border-radius: 14px;
      }

      .stat-btn.neutral {
        background: rgba(255, 255, 255, 0.04);
      }

      .stat-btn:has(.stat-action:focus-visible),
      .stat-btn:has(.stat-value:focus-visible) {
        outline: 3px solid rgba(0, 24, 156, 0.30);
        outline-offset: 2px;
      }
