        :root {
            --red: #CC0000;
            --red-dark: #990000;
            --red-light: #fff0f0;
            --red-border: #f5c4c4;
            --bg: #f5f4f0;
            --surface: #ffffff;
            --surface2: #f0eeea;
            --text: #1a1a1a;
            --text2: #666;
            --text3: #999;
            --border: rgba(0, 0, 0, 0.1);
            --border2: rgba(0, 0, 0, 0.18);
            --radius: 10px;
            --radius-sm: 6px;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            -webkit-tap-highlight-color: transparent;
        }

        html,
        body {
            font-family: 'Barlow', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100dvh;
            max-width: 480px;
            margin: 0 auto;
            position: relative;
        }

        /* ── HEADER ── */
        .app-header {
            background: var(--red);
            padding: 16px 20px 12px;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .app-title {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 26px;
            font-weight: 700;
            color: #fff;
            letter-spacing: 0.5px;
        }

        .app-title span {
            opacity: 0.6;
            font-weight: 400;
        }

        /* ── NAV ── */
        .nav {
            display: flex;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 64px;
            z-index: 99;
        }

        .nav-btn {
            flex: 1;
            border: none;
            background: none;
            cursor: pointer;
            padding: 11px 4px 9px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            color: var(--text3);
            font-size: 10px;
            font-family: 'Barlow', sans-serif;
            border-bottom: 2.5px solid transparent;
            transition: color 0.15s, border-color 0.15s;
        }

        .nav-btn svg {
            width: 22px;
            height: 22px;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .nav-btn.active {
            color: var(--red);
            border-bottom-color: var(--red);
        }

        /* ── PANES ── */
        .pane {
            display: none;
            padding: 16px;
            padding-bottom: 40px;
        }

        .pane.active {
            display: block;
        }

        /* ── SECTION LABEL ── */
        .section-label {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: var(--text3);
            margin-bottom: 8px;
            margin-top: 20px;
        }

        .section-label:first-child {
            margin-top: 0;
        }

        /* ── SEARCH ── */
        .search-wrap {
            position: relative;
            margin-bottom: 10px;
        }

        .search-wrap svg {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 18px;
            height: 18px;
            stroke: var(--text3);
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            pointer-events: none;
        }

        .search-input {
            width: 100%;
            padding: 11px 12px 11px 40px;
            border: 1px solid var(--border2);
            border-radius: var(--radius);
            background: var(--surface);
            font-size: 15px;
            font-family: 'Barlow', sans-serif;
            color: var(--text);
            outline: none;
            transition: border-color 0.15s;
        }

        .search-input:focus {
            border-color: var(--red);
        }

        /* ── PLAYER LIST ── */
        .player-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .player-card {
            display: flex;
            align-items: center;
            gap: 12px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 10px 12px;
            cursor: pointer;
            transition: border-color 0.12s, background 0.12s;
            user-select: none;
        }

        .player-card:active {
            transform: scale(0.99);
        }

        .player-card.selected {
            border-color: var(--red);
            background: var(--red-light);
        }

        .avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            flex-shrink: 0;
            background: var(--red-light);
            color: var(--red);
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.5px;
        }

        .player-card.selected .avatar {
            background: var(--red);
            color: #fff;
        }

        .player-meta {
            flex: 1;
            min-width: 0;
        }

        .player-name-text {
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .player-sub {
            font-size: 12px;
            color: var(--text2);
            margin-top: 1px;
        }

        .player-debt {
            font-size: 13px;
            font-weight: 600;
            color: var(--red);
            white-space: nowrap;
        }

        /* ── OFFENSE GRID ── */
        .offense-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .offense-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 10px 11px;
            cursor: pointer;
            transition: border-color 0.12s, background 0.12s;
            user-select: none;
        }

        .offense-card:active {
            transform: scale(0.98);
        }

        .offense-card.selected {
            border-color: var(--red);
            background: var(--red-light);
        }

        .offense-icon {
            font-size: 20px;
            margin-bottom: 5px;
            display: block;
        }

        .offense-name-text {
            font-size: 13px;
            font-weight: 500;
            color: var(--text);
            line-height: 1.3;
            margin-bottom: 5px;
        }

        .offense-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
        }

        .offense-tag {
            font-size: 11px;
            padding: 2px 7px;
            border-radius: 20px;
            background: var(--red-light);
            color: var(--red);
            font-weight: 500;
        }

        /* ── CONTEXT BUTTONS ── */
        .ctx-row {
            display: flex;
            gap: 8px;
        }

        .ctx-btn {
            flex: 1;
            padding: 9px 6px;
            border: 1px solid var(--border2);
            border-radius: var(--radius-sm);
            background: var(--surface);
            font-size: 13px;
            font-family: 'Barlow', sans-serif;
            color: var(--text2);
            cursor: pointer;
            transition: all 0.12s;
        }

        .ctx-btn.active {
            background: var(--red);
            color: #fff;
            border-color: var(--red);
        }

        /* ── NUMBER INPUT ── */
        .number-row {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .number-row label {
            font-size: 14px;
            color: var(--text2);
            white-space: nowrap;
        }

        .number-row input[type=number] {
            width: 80px;
            padding: 9px;
            border: 1px solid var(--border2);
            border-radius: var(--radius-sm);
            background: var(--surface);
            font-size: 15px;
            font-family: 'Barlow', sans-serif;
            color: var(--text);
            text-align: center;
            outline: none;
        }

        .number-row input[type=number]:focus {
            border-color: var(--red);
        }

        .number-row span {
            font-size: 13px;
            color: var(--text3);
        }

        /* ── PREVIEW ── */
        .fine-preview {
            background: var(--red-light);
            border: 1px solid var(--red-border);
            border-radius: var(--radius);
            padding: 14px 16px;
            display: none;
        }

        .fine-preview.show {
            display: block;
        }

        .preview-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding: 5px 0;
            border-bottom: 1px solid var(--red-border);
        }

        .preview-row:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .preview-row.total-row {
            padding-top: 10px;
            margin-top: 4px;
        }

        .preview-label {
            font-size: 12px;
            color: #993C1D;
        }

        .preview-value {
            font-size: 13px;
            font-weight: 500;
            color: #993C1D;
            text-align: right;
            max-width: 60%;
        }

        .preview-total {
            font-size: 22px;
            font-weight: 700;
            color: var(--red);
            font-family: 'Barlow Condensed', sans-serif;
        }

        .preview-exercise {
            font-size: 11px;
            color: #993C1D;
            text-align: right;
            max-width: 65%;
        }

        /* ── SUBMIT BUTTON ── */
        .btn-submit {
            width: 100%;
            padding: 15px;
            background: var(--red);
            color: #fff;
            border: none;
            border-radius: var(--radius);
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 17px;
            font-weight: 700;
            letter-spacing: 0.5px;
            cursor: pointer;
            transition: opacity 0.15s, transform 0.1s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-submit:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }

        .btn-submit:not(:disabled):active {
            transform: scale(0.99);
            opacity: 0.9;
        }

        /* ── TOAST ── */
        .toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%) translateY(80px);
            background: #1a1a1a;
            color: #fff;
            padding: 12px 20px;
            border-radius: 100px;
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            z-index: 999;
            transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1);
            pointer-events: none;
        }

        .toast.show {
            transform: translateX(-50%) translateY(0);
        }

        /* ── LEADERBOARD ── */
        .team-banner {
            background: var(--red);
            border-radius: var(--radius);
            padding: 16px;
            margin-bottom: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .team-banner-label {
            font-size: 12px;
            color: rgba(255, 255, 255, 0.7);
            margin-bottom: 2px;
        }

        .team-banner-val {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 32px;
            font-weight: 700;
            color: #fff;
        }

        .team-banner-count {
            font-size: 12px;
            color: rgba(255, 255, 255, 0.6);
            margin-top: 2px;
        }

        .lb-item {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: border-color 0.12s;
        }

        .lb-item:active {
            border-color: var(--red);
        }

        .lb-rank {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 20px;
            font-weight: 700;
            color: var(--text3);
            width: 28px;
            text-align: center;
        }

        .lb-rank.gold {
            color: #c9a227;
        }

        .lb-rank.silver {
            color: #888;
        }

        .lb-rank.bronze {
            color: #a0522d;
        }

        .lb-info {
            flex: 1;
            min-width: 0;
        }

        .lb-name {
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
        }

        .lb-sub {
            font-size: 12px;
            color: var(--text2);
            margin-top: 1px;
        }

        .lb-right {
            text-align: right;
        }

        .lb-amount {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 20px;
            font-weight: 700;
            color: var(--red);
        }

        .lb-ex {
            font-size: 11px;
            color: var(--text3);
        }

        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--text3);
            font-size: 14px;
        }

        /* ── DETAIL OVERLAY ── */
        .overlay {
            position: fixed;
            inset: 0;
            background: var(--bg);
            z-index: 200;
            display: none;
            flex-direction: column;
            max-width: 480px;
            margin: 0 auto;
        }

        .overlay.open {
            display: flex;
        }

        .overlay-header {
            background: var(--red);
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 14px;
            position: sticky;
            top: 0;
        }

        .btn-back {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            border-radius: 8px;
            padding: 7px 10px;
            cursor: pointer;
            color: #fff;
            display: flex;
            align-items: center;
        }

        .btn-back svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2.5;
            stroke-linecap: round;
        }

        .overlay-title {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 20px;
            font-weight: 700;
            color: #fff;
        }

        .overlay-sub {
            font-size: 12px;
            color: rgba(255, 255, 255, 0.7);
        }

        .overlay-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }

        /* detail summary bar */
        .detail-summary {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }

        .detail-stat {
            flex: 1;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 10px 12px;
            text-align: center;
        }

        .detail-stat-val {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 22px;
            font-weight: 700;
        }

        .detail-stat-val.red {
            color: var(--red);
        }

        .detail-stat-val.green {
            color: #2a7a2a;
        }

        .detail-stat-label {
            font-size: 10px;
            color: var(--text3);
            margin-top: 2px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* fine entry with action buttons */
        .fine-entry-wrap {
            margin-bottom: 8px;
        }

        .fine-entry {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 12px;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            transition: border-color 0.15s, opacity 0.2s;
        }

        .fine-entry.paid {
            opacity: 0.55;
            border-color: #b8dbb8;
            background: #f3fbf3;
        }

        .fine-entry.paid .fine-entry-amount {
            color: #2a7a2a;
        }

        .fine-entry-left {
            flex: 1;
        }

        .fine-offense-name {
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
            margin-bottom: 2px;
        }

        .fine-entry-meta {
            font-size: 12px;
            color: var(--text2);
        }

        .fine-entry-amount {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 18px;
            font-weight: 700;
            color: var(--red);
        }

        .fine-entry-ex {
            font-size: 11px;
            color: var(--text3);
            text-align: right;
            margin-top: 1px;
        }

        .fine-entry-badge {
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            padding: 2px 7px;
            border-radius: 20px;
            margin-top: 4px;
            display: inline-block;
        }

        .fine-entry-badge.paid-badge {
            background: #d4edda;
            color: #2a7a2a;
        }

        /* action row below each entry */
        .fine-actions {
            display: flex;
            gap: 6px;
            margin-top: 5px;
        }

        .fine-action-btn {
            flex: 1;
            padding: 7px 6px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border2);
            background: var(--surface2);
            font-size: 12px;
            font-weight: 500;
            font-family: 'Barlow', sans-serif;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            transition: background 0.12s, color 0.12s, border-color 0.12s;
            color: var(--text2);
        }

        .fine-action-btn svg {
            width: 14px;
            height: 14px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            flex-shrink: 0;
        }

        .fine-action-btn.pay-btn:hover {
            background: #d4edda;
            border-color: #2a7a2a;
            color: #2a7a2a;
        }

        .fine-action-btn.pay-btn.active {
            background: #d4edda;
            border-color: #2a7a2a;
            color: #2a7a2a;
        }

        .fine-action-btn.del-btn:hover {
            background: var(--red-light);
            border-color: var(--red);
            color: var(--red);
        }

        /* filter tabs in detail */
        .detail-filter {
            display: flex;
            gap: 6px;
            margin-bottom: 14px;
        }

        .detail-filter-btn {
            padding: 6px 12px;
            border-radius: 100px;
            border: 1px solid var(--border2);
            background: var(--surface);
            font-size: 12px;
            font-family: 'Barlow', sans-serif;
            cursor: pointer;
            color: var(--text2);
            transition: all 0.12s;
        }

        .detail-filter-btn.active {
            background: var(--red);
            color: #fff;
            border-color: var(--red);
        }

        /* ── INFO ── */
        .info-block {
            margin-bottom: 20px;
        }

        .info-block-title {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 16px;
            font-weight: 700;
            color: var(--red);
            display: flex;
            align-items: center;
            gap: 6px;
            border-bottom: 2px solid var(--red-border);
            padding-bottom: 7px;
            margin-bottom: 10px;
        }

        .info-row {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 9px 0;
            border-bottom: 1px solid var(--border);
            gap: 12px;
        }

        .info-row:last-child {
            border-bottom: none;
        }

        .info-row-left {
            flex: 1;
        }

        .info-offense {
            font-size: 13px;
            font-weight: 500;
            color: var(--text);
        }

        .info-note {
            font-size: 11px;
            color: var(--text3);
            margin-top: 2px;
            line-height: 1.5;
        }

        .info-amounts-col {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 3px;
        }

        .info-amt-row {
            font-size: 12px;
            color: var(--text2);
            display: flex;
            gap: 6px;
            align-items: baseline;
        }

        .info-amt-val {
            font-weight: 600;
            color: var(--text);
            font-size: 13px;
        }

        .relief-box {
            background: var(--surface2);
            border-radius: var(--radius);
            padding: 13px;
            margin-bottom: 8px;
        }

        .relief-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 4px;
        }

        .relief-desc {
            font-size: 12px;
            color: var(--text2);
            line-height: 1.7;
        }