/* ============================================================
   SchoolRugbyStats — Custom Stylesheet
   Mobile-first, no frameworks
   Primary: #1a6b3a  Accent: #f0a500  Background: #f5f5f5
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #222;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #1a6b3a;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5 {
    line-height: 1.3;
    font-weight: 700;
    color: #1a1a1a;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

/* ── NAVBAR ──────────────────────────────────────────────── */
.navbar {
    background-color: #1a6b3a;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    white-space: nowrap;
}
.navbar-brand:hover {
    text-decoration: none;
    color: #f0a500;
}

.brand-icon { font-size: 1.4rem; }
.brand-text { letter-spacing: 0.02em; }

/* Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}
.hamburger-open .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.hamburger-open .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger-open .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Nav menu — mobile default: hidden */
.nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background-color: #145530;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.nav-menu-open {
    display: flex;
}
.nav-menu li {
    width: 100%;
}
.nav-link {
    display: block;
    padding: 12px 20px;
    color: #e8f5ee;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover,
.nav-link.active {
    background-color: rgba(240,165,0,0.15);
    color: #f0a500;
    text-decoration: none;
}
.nav-link.active {
    border-left: 3px solid #f0a500;
}
.nav-user-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.nav-user-name {
    color: #e8f5ee;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.nav-logout {
    padding: 4px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Desktop nav */
@media (min-width: 768px) {
    .hamburger { display: none; }
    .nav-menu {
        display: flex;
        flex-direction: row;
        position: static;
        background: none;
        padding: 0;
        border: none;
        align-items: center;
        gap: 2px;
    }
    .nav-menu li { width: auto; }
    .nav-link {
        padding: 8px 12px;
        border-radius: 4px;
        font-size: 0.875rem;
    }
    .nav-link.active {
        border-left: none;
        border-bottom: 2px solid #f0a500;
        border-radius: 0;
        padding-bottom: 6px;
    }
    .nav-user-item {
        border-top: none;
        border-left: 1px solid rgba(255,255,255,0.2);
        margin-left: 8px;
        padding: 0 0 0 12px;
    }
    .nav-divider-item {
        border-left: 1px solid rgba(255,255,255,0.2);
        margin-left: 4px;
        padding-left: 4px;
    }
}

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.page-header h1 {
    margin: 0;
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a6b3a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f5ee;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 768px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 768px) {
    .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
thead th {
    background-color: #1a6b3a;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
}
thead th:first-child { border-radius: 0; }
tbody tr:nth-child(even) { background-color: #f9f9f9; }
tbody tr:nth-child(odd)  { background-color: #fff; }
tbody tr:hover { background-color: #e8f5ee; }
td {
    padding: 9px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* ── FORMS ───────────────────────────────────────────────── */
.form-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    max-width: 640px;
}

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 4px;
    color: #333;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #222;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a6b3a;
    box-shadow: 0 0 0 3px rgba(26,107,58,0.12);
}
.form-group textarea {
    min-height: 90px;
    resize: vertical;
}
.form-group .hint {
    font-size: 0.78rem;
    color: #666;
    margin-top: 3px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 16px;
}
@media (min-width: 480px) {
    .form-row { grid-template-columns: 1fr 1fr; }
}
.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap;
    line-height: 1;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; }

.btn-primary {
    background-color: #1a6b3a;
    color: #fff;
}
.btn-primary:hover {
    background-color: #145530;
    text-decoration: none;
    color: #fff;
}

.btn-accent {
    background-color: #f0a500;
    color: #1a1a1a;
}
.btn-accent:hover {
    background-color: #d89400;
    text-decoration: none;
    color: #1a1a1a;
}

.btn-danger {
    background-color: #c0392b;
    color: #fff;
}
.btn-danger:hover {
    background-color: #a93226;
    text-decoration: none;
    color: #fff;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}
.btn-secondary:hover {
    background-color: #5a6268;
    text-decoration: none;
    color: #fff;
}

.btn-ghost {
    background-color: transparent;
    color: #1a6b3a;
    border: 1px solid #1a6b3a;
}
.btn-ghost:hover {
    background-color: #e8f5ee;
    text-decoration: none;
}

.btn-sm {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.8rem;
    border-radius: 4px;
}

.btn-lg {
    min-height: 52px;
    padding: 0 24px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    min-width: 44px;
    padding: 0 10px;
}

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-success  { background: #d4edda; color: #155724; }
.badge-danger   { background: #f8d7da; color: #721c24; }
.badge-warning  { background: #fff3cd; color: #856404; }
.badge-info     { background: #d1ecf1; color: #0c5460; }
.badge-admin    { background: #cce5ff; color: #004085; }
.badge-coach    { background: #d4edda; color: #155724; }
.badge-viewer   { background: #e2e3e5; color: #383d41; }
.badge-role     { text-transform: capitalize; font-size: 0.7rem; }

/* ── FLASH MESSAGES ──────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 32px);
    width: 360px;
}
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    font-size: 0.9rem;
    font-weight: 500;
    animation: flash-slide-in 0.3s ease-out;
}
@keyframes flash-slide-in {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.flash-hide {
    animation: flash-slide-out 0.4s ease-in forwards;
}
@keyframes flash-slide-out {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(110%); opacity: 0; }
}
.flash-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.flash-error   { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.flash-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }
.flash-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }
.flash-icon    { font-weight: 900; font-size: 1rem; flex-shrink: 0; }
.flash-text    { flex: 1; }
.flash-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 2px;
    flex-shrink: 0;
    color: inherit;
}
.flash-close:hover { opacity: 1; }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
    background: #1a6b3a;
    color: rgba(255,255,255,0.75);
    text-align: center;
    padding: 12px 16px;
    font-size: 0.8rem;
    margin-top: auto;
}
.footer-sep { margin: 0 6px; opacity: 0.5; }

/* ── DASHBOARD ───────────────────────────────────────────── */
.dashboard-welcome {
    margin-bottom: 24px;
}
.dashboard-welcome h1 {
    font-size: 1.5rem;
    color: #1a6b3a;
}
.dashboard-welcome p {
    color: #555;
    margin-top: 4px;
}

.record-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
    margin-top: 8px;
}
@media (min-width: 480px) {
    .record-grid { grid-template-columns: repeat(6, 1fr); }
}
.record-item { display: block; }
.record-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1a6b3a;
    line-height: 1;
}
.record-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-top: 2px;
}
.record-won    .record-number { color: #1a6b3a; }
.record-lost   .record-number { color: #c0392b; }
.record-drew   .record-number { color: #d68910; }

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: #f0f8f4;
    border: 1px solid #c8e6d4;
    border-radius: 6px;
    color: #1a6b3a;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
}
.quick-action-btn:hover {
    background: #d4edda;
    border-color: #1a6b3a;
    text-decoration: none;
}
.quick-action-icon { font-size: 1.5rem; line-height: 1; }

.next-game-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.next-game-details .opponent { font-size: 1.15rem; font-weight: 700; }
.next-game-details .meta { color: #666; font-size: 0.85rem; }

.scorers-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.scorer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}
.scorer-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a6b3a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.scorer-rank-1 { background: #f0a500; color: #1a1a1a; }
.scorer-name { flex: 1; font-weight: 600; }
.scorer-count {
    font-weight: 800;
    color: #1a6b3a;
    font-size: 1rem;
}
.scorer-label {
    font-size: 0.75rem;
    color: #888;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 3px solid #e0e0e0;
    background: #fafafa;
}
.result-row.won  { border-left-color: #28a745; }
.result-row.lost { border-left-color: #dc3545; }
.result-row.drew { border-left-color: #ffc107; }
.result-date { font-size: 0.78rem; color: #888; white-space: nowrap; }
.result-opponent { flex: 1; font-weight: 600; font-size: 0.9rem; }
.result-score { font-weight: 800; font-size: 0.9rem; white-space: nowrap; }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-wrapper {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}
.login-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 32px 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo-icon { font-size: 3rem; display: block; }
.login-logo h1 { font-size: 1.3rem; color: #1a6b3a; margin-top: 8px; }
.login-logo p { color: #888; font-size: 0.85rem; }
.login-card .form-group { margin-bottom: 14px; }

/* ── STAT NUMBERS ────────────────────────────────────────── */
.stat-big {
    font-size: 2rem;
    font-weight: 800;
    color: #1a6b3a;
    line-height: 1;
}
.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-top: 3px;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    text-align: center;
}
@media (min-width: 480px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat-item {
    padding: 10px 6px;
    background: #f8fdf9;
    border-radius: 4px;
    border: 1px solid #e2ede6;
}

/* ── PLAYER PROFILE ──────────────────────────────────────── */
.player-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}
.player-jersey {
    width: 64px;
    height: 64px;
    background: #1a6b3a;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    flex-shrink: 0;
}
.player-info h2 { margin-bottom: 4px; }
.player-info .position-tag {
    display: inline-block;
    background: #e8f5ee;
    color: #1a6b3a;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── GAME SCORE DISPLAY ──────────────────────────────────── */
.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 8px 0;
}
.score-team {
    text-align: center;
    flex: 1;
}
.score-team-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.score-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: #1a6b3a;
    line-height: 1;
    font-feature-settings: "tnum";
}
.score-separator {
    font-size: 2rem;
    color: #aaa;
    font-weight: 300;
}

/* ── CAPTURE SCREEN ──────────────────────────────────────── */
.capture-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
}

.capture-topbar {
    background: #1a6b3a;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.capture-topbar h2 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 4px;
}
.capture-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 10px;
}

.capture-score-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.capture-score-team { text-align: center; }
.capture-score-name {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}
.capture-score-number {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
}
.capture-score-sep { font-size: 2rem; opacity: 0.5; font-weight: 300; }

.opponent-score-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.score-adj-btn {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 4px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}
.score-adj-btn:hover { background: rgba(255,255,255,0.35); }

.half-toggle {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: center;
}
.half-btn {
    flex: 1;
    max-width: 120px;
    padding: 6px 12px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 4px;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.half-btn.half-active {
    background: #f0a500;
    border-color: #f0a500;
    color: #1a1a1a;
}

/* Capture layout */
.capture-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 640px) {
    .capture-main { grid-template-columns: 200px 1fr; }
}
@media (min-width: 900px) {
    .capture-main { grid-template-columns: 220px 1fr; }
}

/* Player list */
.player-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.player-panel-header {
    background: #1a6b3a;
    color: #fff;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.player-list {
    max-height: 420px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    min-height: 52px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
    user-select: none;
}
.player-item:last-child { border-bottom: none; }
.player-item:hover { background: #f0f8f4; }
.player-item.selected {
    background: #e8f5ee;
    border-left: 3px solid #1a6b3a;
}
.player-item.selected .player-item-number { background: #1a6b3a; color: #fff; }
.player-item-number {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.player-item-name { font-size: 0.85rem; font-weight: 600; line-height: 1.2; }

/* Event buttons */
.event-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.selected-player-banner {
    background: #e8f5ee;
    border-bottom: 2px solid #1a6b3a;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a6b3a;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.selected-player-banner.no-selection {
    background: #fff3cd;
    border-color: #f0a500;
    color: #856404;
}

.event-categories {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}
.event-category { display: block; }
.event-category-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    font-weight: 700;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #f0f0f0;
}
.event-btn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
@media (min-width: 480px) {
    .event-btn-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .event-btn-grid { grid-template-columns: repeat(4, 1fr); }
}

.event-btn {
    min-height: 52px;
    padding: 8px 6px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
    transition: all 0.12s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    user-select: none;
}
.event-btn:hover:not(:disabled) {
    border-color: #1a6b3a;
    background: #e8f5ee;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(26,107,58,0.15);
}
.event-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}
.event-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.event-btn.scoring { border-color: #1a6b3a; background: #f0f8f4; }
.event-btn.scoring:hover:not(:disabled) { background: #d4edda; }
.event-btn.danger  { border-color: #dc3545; background: #fdf3f4; }
.event-btn.danger:hover:not(:disabled)  { background: #f8d7da; }
.event-btn.flash-confirm {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
    animation: btn-flash 0.6s ease-out;
}
@keyframes btn-flash {
    0%   { background: #28a745; transform: scale(1.05); }
    50%  { background: #34ce57; }
    100% { background: #28a745; transform: scale(1); }
}
.event-btn-icon { font-size: 1.1rem; line-height: 1; }
.event-btn-label { font-size: 0.72rem; }

/* Metres input inline */
.metres-input-wrap {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 2px solid #1a6b3a;
    border-radius: 8px;
    padding: 20px;
    z-index: 3000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 280px;
    text-align: center;
}
.metres-input-wrap.visible { display: block; }
.metres-input-wrap h4 { margin-bottom: 12px; color: #1a6b3a; }
.metres-input-wrap input {
    width: 100%;
    padding: 10px;
    font-size: 1.5rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 12px;
}
.metres-input-btns { display: flex; gap: 8px; }

/* Recent events feed */
.capture-feed {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-top: 12px;
}
.capture-feed-header {
    background: #f5f5f5;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.feed-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.82rem;
}
.feed-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-bottom: 1px solid #f5f5f5;
    animation: feed-in 0.3s ease-out;
}
@keyframes feed-in {
    from { background: #e8f5ee; }
    to   { background: transparent; }
}
.feed-item:last-child { border-bottom: none; }
.feed-half { color: #888; font-size: 0.75rem; white-space: nowrap; }
.feed-player { font-weight: 700; flex-shrink: 0; }
.feed-event  { flex: 1; color: #333; }
.feed-undo   { color: #c0392b; cursor: pointer; font-size: 0.75rem; text-decoration: underline; white-space: nowrap; }

.undo-btn {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.undo-btn:hover { background: #ffe69c; }
.undo-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Overlay backdrop */
.overlay-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2999;
}
.overlay-backdrop.visible { display: block; }

/* ── REPORT PAGES ────────────────────────────────────────── */
.report-header-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}
.report-title { font-size: 1.5rem; font-weight: 800; color: #1a6b3a; }
.report-subtitle { color: #555; font-size: 0.9rem; }

.result-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}
.result-badge-Won  { background: #d4edda; color: #155724; }
.result-badge-Lost { background: #f8d7da; color: #721c24; }
.result-badge-Drew { background: #fff3cd; color: #856404; }

.rankings-table td:first-child { font-weight: 800; text-align: center; width: 36px; }
.rankings-table td:nth-child(2) { font-weight: 600; }

/* ── SECTION HEADING ─────────────────────────────────────── */
.section-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #1a6b3a;
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8f5ee;
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}
.empty-state-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }
.empty-state p { margin-bottom: 12px; }

/* ── PAGINATION (basic) ──────────────────────────────────── */
.pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #1a6b3a;
    background: #fff;
    text-decoration: none;
    transition: background 0.15s;
}
.page-link:hover { background: #e8f5ee; text-decoration: none; }
.page-link.current { background: #1a6b3a; color: #fff; border-color: #1a6b3a; pointer-events: none; }

/* ── UTILITY ─────────────────────────────────────────────── */
.text-muted   { color: #888; }
.text-success { color: #155724; }
.text-danger  { color: #721c24; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.separator { border: none; border-top: 1px solid #e0e0e0; margin: 20px 0; }
.nowrap { white-space: nowrap; }

/* ── SELECT & FILTER BAR ─────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 14px;
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar label { font-size: 0.8rem; }

/* ── PRINT STYLES ────────────────────────────────────────── */
@media print {
    .navbar,
    .site-footer,
    .btn,
    .flash-container,
    .hamburger,
    .filter-bar .btn,
    .no-print {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }
    .main-content {
        max-width: 100%;
        padding: 0;
    }
    .card {
        border: 1px solid #999;
        box-shadow: none;
        break-inside: avoid;
    }
    table {
        font-size: 10pt;
    }
    thead th {
        background: #333 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .table-wrap { overflow: visible; border: none; }
    .capture-wrapper { display: block; }
    a { color: #000; text-decoration: none; }
    h1, h2, h3 { page-break-after: avoid; }
    .page-header { margin-bottom: 12px; }
    .card-grid, .card-grid-2 { grid-template-columns: 1fr !important; }
}
