/* Newark Cue Club — consolidated stylesheet. Cascade order preserved. */
:root {
    font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
    color: #edf2f7;
    background: #0d1118;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

header {
    border-bottom: 1px solid #303b49;
    padding: 22px max(18px, calc((100vw - 1060px)/2));
}

h1 {
    margin: 0;
}

.sub {
    color: #aab7c8;
    margin: 6px 0 0;
}

.wrap {
    max-width: 1060px;
    margin: auto;
    padding: 24px 16px 70px;
}

.tabs,
.views {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

button,
select,
input {
    font: inherit;
}

button {
    cursor: pointer;
    background: #263242;
    border: 1px solid #3b4859;
    color: #edf2f7;
    padding: 11px 15px;
    border-radius: 10px;
}

button.active,
.primary {
    color: white;
}

button:hover {
    filter: brightness(1.13);
}

.panel {
    border: 1px solid #2b3848;
    border-radius: 14px;
    margin: 14px 0;
}

.head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.muted {
    color: #aab7c8;
}

.scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 590px;
}

th {
    text-align: right;
    padding: 13px 9px;
    border-bottom: 1px solid #3b4859;
}

td {
    text-align: right;
    padding: 13px 9px;
    border-bottom: 1px solid #2b3644;
    font-variant-numeric: tabular-nums;
}

th:nth-child(2),
td:nth-child(2) {
    text-align: left;
}

tr:last-child td {
    border-bottom: 0;
}

.name {
    background: none;
    border: 0;
    padding: 0;
    font-weight: 600;
    text-align: left;
}

.rank {
    font-weight: 700;
}

.form {
    display: grid;
    grid-template-columns: 1fr 1fr 100px 100px;
    gap: 12px;
    align-items: end;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #bac7d5;
}

input,
select {
    background: #0f1722;
    color: #f3f6fa;
    border: 1px solid #435064;
    border-radius: 8px;
    padding: 11px;
    width: 100%;
    min-width: 0;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 13px;
}

.match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #303b49;
}

.match:last-child {
    border: 0;
}

.score {
    font-size: 20px;
    font-weight: 750;
    white-space: nowrap;
}

.pill {
    display: inline-block;
    border-radius: 7px;
    padding: 4px 8px;
    font-size: 12px;
}

.empty {
    padding: 25px;
    text-align: center;
    color: #9baabe;
}

.note {
    border-left: 3px solid #bd53e4;
    padding-left: 12px;
    color: #c7d2de;
}

.danger {
    background: #46212a;
    border-color: #773d4b;
}

.foot {
    margin-top: 20px;
    color: #8292a4;
    font-size: 12px;
}

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

    .form label:nth-child(-n/**/+2) {
        grid-column: span 2;
    }

    .match {
        align-items: flex-start;
    }

    .score {
        font-size: 17px;
    }

}
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.admin-grid .wide {
    grid-column: 1/-1;
}

.admin-msg {
    margin-top: 12px;
    color: #d9b3ed;
}

.admin-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #303b49;
}

.admin-match button {
    padding: 7px 10px;
}

.admin-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

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

}
.fixture-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.fixture-select {
    max-width: 420px;
    margin: 15px 0;
}

.fixture-progress {
    border-radius: 10px;
    margin: 14px 0;
}

.fixture-progress strong {
    color: #e2a0f5;
}

.progress-track {
    height: 7px;
    background: #394353;
    border-radius: 9px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #ad45d7;
}

.fixture-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #303b49;
}

.fixture-row:last-child {
    border: 0;
}

.matrix {
    min-width: max-content;
}

.matrix th,
.matrix td {
    text-align: center !important;
}

.matrix th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left !important;
}

.matrix td.matrix-win {
    font-weight: 700;
}

.matrix td.matrix-self {
    background: #29303e;
    color: #718096;
}

.matrix td.matrix-pending {
    color: #78869a;
}

.fixture-group {
    border: 1px solid #344254;
    border-radius: 12px;
    margin: 14px 0;
    overflow: hidden;
}

.fixture-group summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fixture-group summary::-webkit-details-marker {
    display: none;
}

.fixture-group summary:before {
    content: "▸";
    color: #d27af0;
}

.fixture-group[open] summary:before {
    content: "▾";
}

.fixture-count {
    background: #36445a;
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 12px;
}

.fixture-group>.fixture-row,
.fixture-group>.match,
.fixture-group>p {
    margin-left: 14px;
    margin-right: 14px;
}

:root {
    color-scheme: dark;
    --bg: #0d121b;
    --panel: #192230;
    --border: #344255;
    --text: #f1f5fb;
    --secondary: #c2cddd;
    --accent: #ba65e8;
    line-height: 1.55;
}

body {
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

header {
    padding-top: 27px;
    padding-bottom: 27px;
    background: linear-gradient(110deg, #1b2332, #171b2a);
    border-color: #344155;
}

h1 {
    font-size: clamp(25px, 4vw, 36px);
    font-weight: 780;
    letter-spacing: -.025em;
}

h2 {
    font-size: clamp(21px, 3vw, 27px);
    letter-spacing: -.02em;
}

h3 {
    font-size: 17px;
    margin: 24px 0 12px;
}

.wrap {
    padding-top: 28px;
    padding-bottom: 110px;
}

.panel {
    background: var(--panel);
    border-color: var(--border);
    padding: clamp(16px, 3vw, 26px);
    box-shadow: 0 10px 30px #0002;
}

.tabs {
    margin-bottom: 18px;
}

.views {
    margin-bottom: 20px;
}

button {
    transition: background .15s, border-color .15s, transform .15s;
    min-height: 42px;
    font-weight: 600;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 3px solid #dfadfa;
    outline-offset: 3px;
}

button.active,
.primary {
    background: #9441c7;
    border-color: #b55de3;
}

.views button {
    padding: 11px 20px;
    font-size: 18px;
    text-transform: uppercase;
}

.muted,
.sub {
    color: var(--secondary);
}

.small {
    font-size: 13px;
}

th {
    font-size: 12px;
    letter-spacing: .025em;
    text-transform: uppercase;
    color: #d4deea;
    background: #202b3b;
    white-space: nowrap;
}

td {
    color: #edf2f9;
}

th,
td {
    padding: 15px 12px;
}

tbody tr:nth-child(even) {
    background: #1d2836;
}

tbody tr:hover {
    background: #2a3850;
}

.name {
    font-size: inherit;
    color: #f7f3ff;
    text-decoration: none;
    text-transform: uppercase;
    text-decoration-color: #8b5eab;
    text-underline-offset: 4px;
}

.rank {
    color: #e0a1ff;
}

.fixture-progress {
    background: #242f42;
    padding: 18px;
}

.fixture-group {
    border-color: #44536a;
}

.fixture-group summary {
    background: #273448;
    padding: 16px 18px;
    font-size: 15px;
}

.fixture-group[open] summary {
    border-bottom: 1px solid #40516a;
}

.fixture-row {
    padding: 14px 12px;
}

.pill {
    color: #e1e9f4;
    background: #354459;
}

.matrix th,
.matrix td {
    font-size: 13px;
    min-width: 52px;
    padding: 13px 10px;
}

.matrix th:first-child {
    background: #202b3b;
    min-width: 175px;
}

.matrix td.matrix-win {
    color: #a1edbb;
}

.matrix td.matrix-loss {
    color: #f3b0b0;
}

.admin-entry {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 20;
    background: #252f40;
    border: 1px solid #4b5870;
    color: #d5deea;
    border-radius: 999px;
    padding: 9px 16px;
    min-height: 38px;
    font-size: 12px;
    box-shadow: 0 6px 24px #0007;
    opacity: .88;
}

.admin-entry:hover {
    opacity: 1;
    background: #354359;
}

.admin-section-body {
    padding: 12px 16px 18px;
}

.admin-section-body .fixture-row {
    padding-left: 0;
    padding-right: 0;
}

.archive-section {
    margin-top: 28px;
}

.admin-msg {
    font-weight: 600;
}

.admin-grid label {
    font-size: 14px;
}

.admin-match {
    gap: 15px;
    flex-wrap: wrap;
}

.admin-match span {
    overflow-wrap: anywhere;
}

@media (max-width:650px) {
    .wrap {
        padding: 18px 12px 95px;
    }

    .panel {
        border-radius: 12px;
    }

    .tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .views button {
        width: 100%;
    }

    .head {
        align-items: flex-start;
    }

    .scroll {
        margin-left: -7px;
        margin-right: -7px;
    }

    .matrix th,
        .matrix td {
        padding: 11px 8px;
    }

    .fixture-modes button {
        flex: 1 1 auto;
        font-size: 13px;
        padding: 9px;
    }

    .fixture-row {
        font-size: 14px;
    }

    .admin-entry {
        bottom: 12px;
        right: 12px;
    }

}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    object-fit: contain;
    flex: none;
}

.brand h1 {
    margin: 0;
}

.tabs {
    gap: 12px;
}

.tabs button {
    min-width: 0;
    padding: 9px 16px;
    font-size: 17px;
    text-transform: uppercase;
}

.standings-table {
    table-layout: auto;
}

.standings-table th,
.standings-table td {
    padding: 10px 9px;
}

.standings-table th:first-child,
.standings-table td:first-child {
    padding-left: 8px;
    padding-right: 3px;
    width: 28px;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
    padding-left: 4px;
}

.standings-table th:last-child,
.standings-table td:last-child {
    padding-right: 8px;
}

@media (max-width:650px) {
    header {
        padding: 15px 17px;
    }

    .brand h1 {
        font-size: 24px;
    }

    .tabs {
        margin-bottom: 16px;
    }

    .views {
        margin-bottom: 15px;
    }

    .views button {
        min-height: 43px;
    }

    .panel {
        padding: 10px 8px;
    }

    .head {
        padding: 0 4px;
    }

    .head p {
        margin: 4px 0 10px;
    }

    .standings-scroll {
        margin: 0;
    }

    .standings-table {
        width: 100%;
    }

    .standings-table th,
        .standings-table td {
        white-space: nowrap;
        text-align: center;
    }

    .standings-table th:nth-child(2),
        .standings-table td:nth-child(2) {
        white-space: normal;
    }

}
@media (max-width:360px) {
    .brand h1 {
        font-size: 22px;
    }

}
.head h2 {
    text-transform: uppercase;
}

.league-type {
    font-size: inherit;
    font-weight: inherit;
    color: var(--text);
}

@media (max-width:650px) {
    .brand {
        gap: 10px;
    }

    .tabs {
        gap: 12px;
    }

    .tabs button {
        font-size: 17px;
        padding: 8px 2px;
        min-height: 40px;
    }

    .standings-scroll {
        overflow-x: auto;
    }

    .standings-table {
        font-size: 14px;
        line-height: 1.25;
        table-layout: fixed;
        min-width: 0;
    }

    .standings-table th,
        .standings-table td {
        padding: 9px 1px;
    }

    .standings-table th:first-child,
        .standings-table td:first-child {
        width: 6%;
        padding-left: 1px;
        padding-right: 0;
    }

    .standings-table th:nth-child(2),
        .standings-table td:nth-child(2) {
        width: 35%;
        padding-left: 1px;
        padding-right: 1px;
        text-align: left;
    }

    .standings-table th:nth-child(3),
        .standings-table td:nth-child(3),
        .standings-table th:nth-child(4),
        .standings-table td:nth-child(4),
        .standings-table th:nth-child(5),
        .standings-table td:nth-child(5),
        .standings-table th:nth-child(6),
        .standings-table td:nth-child(6),
        .standings-table th:nth-child(7),
        .standings-table td:nth-child(7) {
        width: 6.5%;
    }

    .standings-table th:nth-child(8),
        .standings-table td:nth-child(8) {
        width: 12%;
    }

    .standings-table th:nth-child(9),
        .standings-table td:nth-child(9) {
        width: 14.5%;
        padding-right: 2px;
    }

    .standings-table .name {
        font-size: 13px;
        line-height: 1.25;
        overflow-wrap: normal;
        word-break: normal;
        text-transform: uppercase;
        text-decoration: none;
    }

    .standings-table th {
        font-size: 11px;
        letter-spacing: 0;
    }

    .standings-table tbody tr {
        height: 40px;
    }

    .head h2 {
        font-size: 21px;
    }

}
@media (max-width:375px) {
    .standings-table {
        min-width: 370px;
    }

}
.brand-logo {
    width: 112px;
    height: 112px;
}

.brand-copy {
    min-width: 0;
}

.brand-tagline {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: .09em;
    text-transform: uppercase;
    font-weight: 700;
}

.views {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rules-page {
    max-width: 850px;
    margin: 0 auto;
}

.rules-page h2 {
    margin: 0 0 6px;
}

.rules-page .rules-intro {
    margin: 0 0 24px;
}

.rules-section {
    padding: 18px 0;
    border-top: 1px solid var(--border);
}

.rules-section h3 {
    margin: 0 0 12px;
    font-size: 19px;
}

.rules-section ol,
.rules-section ul {
    padding-left: 24px;
    margin: 0;
}

.rules-section li {
    margin: 0 0 10px;
    line-height: 1.6;
}

.rules-section li:last-child {
    margin-bottom: 0;
}

.rules-note {
    font-size: 13px;
    color: var(--muted);
    margin-top: 20px;
}

@media (max-width:650px) {
    .brand-logo {
        width: 49px;
        height: 49px;
    }

    .brand-tagline {
        font-size: 10px;
        margin-top: 3px;
    }

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

    .views button {
        padding: 6px 4px;
        font-size: 20px;
    }

    .rules-section {
        padding: 16px 0;
    }

    .rules-section h3 {
        font-size: 17px;
    }

}
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-rules {
    flex: none;
    white-space: nowrap;
    font-weight: 650;
    font-size: 18px;
    text-transform: uppercase;
    padding: 11px 16px;
}

.header-rules.active {
    background: #a633d3;
    border-color: #a633d3;
    color: #fff;
}

@media (max-width:650px) {
    header {
        gap: 8px;
    }

    .header-rules {
        padding: 9px 8px;
        font-size: 14px;
    }

}

/* Admin readability and home navigation */
.brand-home { color: inherit; text-decoration: none; }
.brand-home:focus-visible { outline: 3px solid #dfadfa; outline-offset: 4px; }
.admin-panel .admin-grid { gap: 10px; }
.admin-panel .admin-grid label { font-size: 15px; font-weight: 600; }
.admin-panel select { text-transform: uppercase; font-size: 16px; }
.admin-panel .admin-section summary { font-size: 17px; padding: 12px 14px; }
.admin-panel .admin-section-body { padding: 8px 12px 12px; }
.admin-panel .admin-match { padding: 8px 0; gap: 8px; }
.admin-result { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px; flex: 1 1 280px; font-size: 15px; text-transform: uppercase; }
.admin-result strong:last-child { text-align: right; }
.admin-score { font-size: 19px; white-space: nowrap; }
.admin-panel .fixture-row strong, .admin-panel .match strong { text-transform: uppercase; font-size: 15px; }
.admin-panel .fixture-row { padding: 8px 0; }
.admin-panel .admin-match button { min-height: 36px; padding: 6px 10px; }
.league-management { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 4px; }
@media(max-width:650px) {
 .admin-panel .admin-match { flex-direction: column; align-items: stretch; }
 .admin-result { flex: auto; font-size: 14px; }
 .admin-panel .admin-match .admin-actions { justify-content: center; }
 .admin-panel .admin-grid { gap: 8px; }
}

.walkover-tag { display: block; font-size: 10px; text-align: center; }

/* Administrator activity log */
.admin-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0, 320px); gap:16px; align-items:start; }
.admin-layout > * { min-width:0; }
.activity-panel h3 { margin:0 0 12px; }
.activity-item { padding:12px 0; border-bottom:1px solid var(--border); font-size:15px; overflow-wrap:anywhere; }
.activity-item time { display:block; margin-top:5px; font-size:12px; color:var(--secondary); }
#moreActivity { margin-top:12px; width:100%; }
#moreActivity[hidden] { display:none; }
@media(max-width:900px) { .admin-layout { grid-template-columns:minmax(0,1fr); } }

/* Top-level navigation and historical standings */
.site-nav { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.site-nav button { font-weight:650; white-space:nowrap; }
.site-nav button.active { background:#a633d3; border-color:#a633d3; }
.history-filters { display:flex; gap:12px; flex-wrap:wrap; margin:16px 0; }
.history-filters label { display:flex; flex-direction:column; gap:6px; font-weight:600; }
.history-filters select { width:100%; min-width:110px; }
@media(max-width:650px) { header { flex-wrap:wrap; } .site-nav { width:100%; gap:5px; } .site-nav button { flex:1; padding:9px 5px; font-size:13px; } .history-filters label:first-child { flex:1 1 210px; } .history-filters label:last-child { flex:1 1 110px; } }

/* Centre navigation beneath the brand on every screen. */
header { flex-direction: column; align-items: center; gap: 14px; }
.site-nav { width: 100%; justify-content: center; }
.history-filters { gap: 18px; }
.history-filters label { font-size: 23px; line-height: 1.25; min-width: 0; }
.history-filters select { font-size: 23px; min-height: 48px; padding: 9px 12px; max-width: 100%; }
@media (max-width:650px) {
 header { gap: 8px; }
 .history-filters { gap: 12px; }
 .history-filters label { font-size: 20px; }
 .history-filters select { font-size: 20px; }
 .history-filters label:first-child { flex: 1 1 100%; }
}
