/* ==========================================================================
   Preseli Beast / Realtime Racing — Live Results
   Neat results-board stylesheet (legacy class names preserved)
   ========================================================================== */

:root {
    --brand: #ff7f21;
    --brand-2: #ffb14d;


    --bg: #0d0e11;
    --bg-2: #0a0b0e;
    --panel: #14161b;
    --panel-2: #1a1d23;
    --panel-3: #20242b;

    --row-odd: #14161b;
    --row-even: #181b21;
    --row-hover: rgba(255, 127, 33, 0.07);

    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);

    --text: #f3f4f6;
    --text-dim: #a4a7af;
    --text-mute: #6b6e76;

    --status-started: #529bff;
    --status-started-bg: rgba(82, 155, 255, 0.12);
    --status-started-border: rgba(82, 155, 255, 0.38);

    --radius: 10px;
    --radius-sm: 4px;

}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 0 16px 60px;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background-color: black;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1, 'cv11' 1;
}

.holder {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 0 0;
}

/* ---------- Header ---------- */
.pageHeader {
    text-align: center;
    margin: 0 auto 22px;
}

.pageHeader p {
    padding: 0 !important;
    margin: 0;
}

.logo {
    width: 240px !important;
    margin: 0 auto 14px;
    display: block;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.5));
}

.liveBadge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 10px;
    background: rgba(220, 38, 38, 0.10);
    border: 1px solid rgba(220, 38, 38, 0.40);
    color: #fca5a5;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 0;
    margin-bottom: 12px;
    margin-top: 20px;
}

.liveDot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: livePulse 1.6s infinite;
    flex-shrink: 0;
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70%  { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 6px;
    line-height: 1.15;
    text-align: center;
}

h1 .headSep {
    color: var(--brand);
    font-weight: 500;
    margin: 0 6px;
}

h1 .headSub {
    font-weight: 500;
    color: var(--text-dim);
}

h2 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    text-align: center;
    margin: 4px 0 0;
}

.brandColor { color: var(--brand); font-weight: 600; }

.updateNote {
    color: var(--text-mute) !important;
    font-size: 12.5px;
    font-weight: 400;
    margin: 12px 0 0 !important;
    text-align: center;
}

/* ---------- Tabs (rectangular platform-style — kept) ---------- */
.tableArea { width: 100%; }

.container { text-align: center; }
.container > .resultsBlock { text-align: left; }

.tabHolder {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    margin: 14px auto 18px;
    padding: 4px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0;
}

.categoryTab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: auto;
    padding: 0 20px;
    margin: 0 2px;
    float: none;
    background: transparent;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    user-select: none;
    border: 1px solid transparent;
}

.categoryTab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.categoryTab.active {
    background: var(--brand);
    color: #1a0e00;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.categoryTab.active:hover {
    background: var(--brand-2);
    color: #1a0e00;
}

/* ---------- Results panel ---------- */
.resultsBlock {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: inset 0 2px 0 var(--brand), var(--shadow);
    overflow: hidden;
}

#customers {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}

#customers tr { transition: background-color 0.12s ease; }

/* Header row — override the inline coloured tr from the markup */
#customers tr:first-child {
    background: var(--panel-2) !important;
    color: var(--text-dim) !important;
    border: none;
}

#customers th {
    background: transparent !important;
    color: var(--text-dim) !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 11px !important;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    text-align: left;
    padding: 12px 12px !important;
    border: none !important;
    border-bottom: 1px solid var(--line-strong) !important;
    height: auto !important;
    position: sticky;
    top: 0;
    z-index: 2;
}

#customers tr:first-child th { color: var(--text-dim) !important; }

#customers td {
    padding: 11px 12px !important;
    border: none !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--text);
    height: auto !important;
    vertical-align: middle;
}

/* Zebra striping */
#customers tr:nth-child(odd):not(:first-child)  { background-color: var(--row-odd); }
#customers tr:nth-child(even):not(:first-child) { background-color: var(--row-even); }
#customers tr:hover:not(:first-child) {
    background-color: var(--row-hover) !important;
    color: #fff;
}

/* Position cell — clean tabular number */
#customers td:first-child {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    width: 50px;
    text-align: center !important;
    border-left: 2px solid transparent !important;
}

/* Age-category winner — the first finisher within each age group, wherever
   they land overall. Row tint + amber age badge + trophy icon (added in the
   template) rather than anything tied to overall finishing position. */
#customers tr.ageWinner {
    background-color: rgba(255, 127, 33, 0.06);
}
/* #customers tr.ageWinner td:first-child {
    border-left: 2px solid var(--brand) !important;
} */
#customers td.ageGr.ageWinnerBadge {
    background-color: #e39d00;
    color: #1a0e00;
    font-weight: 700;
}

/* Position cell for runners without a placing yet */
#customers tr.rowStarted td:first-child,
#customers tr.rowDNF td:first-child {
    color: var(--text-mute);
    font-weight: 400;
}

#customers tr.rowStarted,
#customers tr.rowDNF { opacity: 0.88; }

/* Status pill — reuses the header's live-pulse language for an in-progress runner */
.statusPill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 0;
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.statusStarted {
    color: var(--status-started);
    background: var(--status-started-bg);
    border: 1px solid var(--status-started-border);
}

.statusDot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-started);
    box-shadow: 0 0 0 0 rgba(82, 155, 255, 0.55);
    animation: startedPulse 1.8s infinite;
    flex-shrink: 0;
}

@keyframes startedPulse {
    0%   { box-shadow: 0 0 0 0 rgba(82, 155, 255, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(82, 155, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(82, 155, 255, 0); }
}

.statusDNF {
    color: var(--text-mute);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

/* Runner name */
#customers td:nth-child(2) {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

/* Club */
#customers td:nth-child(3) {
    color: var(--text-dim);
    font-size: 12.5px;
}

/* Age group */
#customers td.ageGr,
#customers td:nth-child(4) {
    text-align: center;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-dim);
    min-width: 56px;
    padding-left: 14px !important;
    padding-right: 14px !important;
    letter-spacing: 0.02em;
}

/* Bib */
#customers td:nth-child(5) {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    font-weight: 500;
}

/* Time — mono, right-aligned, the most prominent value */
#customers td:last-child {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    letter-spacing: 0.01em;
    text-align: right !important;
    padding-right: 16px !important;
    white-space: nowrap;
}

/* Trophy icon */
#customers td img {
    height: 13px !important;
    width: auto;
    margin-left: 8px;
    vertical-align: middle;
    opacity: 0.95;
}

#customers tr:last-child td { border-bottom: none !important; }

/* ---------- Race info text ---------- */
.raceStartText { margin: 6px 0 0; }
.raceStartText h2 { margin: 0; }

/* ---------- Footer ---------- */
.realtime {
    width: 100%;
    clear: both;
    margin: 28px 0 10px;
    padding: 0;
    text-align: center;
    color: var(--text-mute);
    font-size: 12px;
    letter-spacing: 0.04em;
    float: none;
}
.realtime a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}
.realtime a:hover { color: var(--brand-2); }
.realtime img { width: 280px; margin: 8px auto 0; display: block; opacity: 0.85; }

/* ---------- Misc legacy elements ---------- */
.sectionHeader { width: 100%; float: left; color: var(--text); text-align: center; }
.noFinishers { text-align: center; color: var(--text-dim); margin: 24px; padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; }
.totalRunners { text-align: center; color: var(--text); font-size: 14px; margin: 12px 0; letter-spacing: 0.04em; }
.registered { color: var(--brand); }

p { color: var(--text-dim); line-height: 1.6; }

/* legacy winner accent */
.M50:first-of-type td.ageGr { background-color: var(--brand) !important; color: #1a0e00 !important; font-weight: 700 !important; }

/* ==========================================================================
   Form / admin pages — same neat palette
   ========================================================================== */

h4 { font-family: 'Space Grotesk', 'Inter', sans-serif; margin-bottom: 20px; font-weight: 600; color: var(--text); font-size: 1.05em; letter-spacing: -0.01em; }

.fieldSet { text-align: center; width: 96%; margin: 5px 2%; float: left; font-size: 12px; min-height: 65px; display: block; background-color: var(--panel-2); color: var(--text-dim); border: 1px solid var(--line); border-radius: var(--radius-sm); }

.error { color: #ff6b6b; font-size: 15px; font-weight: 600; margin: 12px 0; font-family: 'Inter', sans-serif; }

.fieldInput .fieldInputPin { width: 100%; }

select { font-size: 14px; background-color: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; margin-left: 0; font-family: 'Inter', sans-serif; text-align: center; text-align-last: center; }

.btnbck { border-radius: var(--radius-sm); background: var(--brand); color: #1a0e00; border: none; padding: 11px 20px; font-size: 14px; font-weight: 600; text-align: center; margin: 20px auto; display: block; cursor: pointer; }
.btnbck:hover { background: var(--brand-2); }

.close { width: 99%; text-align: right; color: var(--text); font-size: 22px; padding: 10px 20px 0 0; }

.blueBand, .redBand { width: 46%; margin: 5px 2%; float: left; min-height: 65px; border-radius: var(--radius-sm); }
.redBand { background-color: #db6b62; }
.blueBand { background-color: #2c72c3; }
.redbg { background-color: #ef4444; color: white; }
.bluebg { background-color: #3b82f6; color: white; }

.timeCol { width: 56px; text-align: center; }
.smallColl, .rAge, .rNumber { width: 54px; text-align: center !important; }
.editRow { background-color: var(--panel-2); }

.cancelBtn, .submitBtn { width: 96%; margin: 5px 2%; float: left; text-align: center; }
.submitBtn .btn { background-color: var(--brand); color: #1a0e00; }
.cancelBtn .btn { background-color: var(--panel-2); color: var(--text-dim); border: 1px solid var(--line); }
.btn { text-transform: uppercase; text-align: center; background-color: #161d27; color: var(--text); width: 80%; display: block; padding: 13px 10%; font-size: 13px; letter-spacing: 0.06em; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; }
.runnersNameHolder .fieldSet { float: none; display: block;  text-align: center;}
.runnersNameHolder .cancelBtn { float: none; display: block; width: 96%; margin: 16px 2% 4px; }
.runnersNameHolder .submitBtn { float: none; display: block; width: 96%; margin: 4px 2%; }
.runnersNameHolder .btn { width: 100%; padding: 14px; }
.fieldNote { width: 96%; margin: 4px 2% 6px; font-size: 10.5px; color: var(--text-mute); line-height: 1.4; }
.overrideTimeInput { width: 96%; margin: 8px 2%; font-size: 22px; color: var(--text); text-align: center; border: none; border-bottom: 1px solid var(--line); background: transparent; padding: 6px 0; font-family: 'IBM Plex Mono', monospace; }
.editBG { background-color: #000; }

.raceNumber { width: 96%; margin: 20px 2%; font-size: 56px; color: var(--text); text-align: center; border: none; border-bottom: 1px solid var(--line); background: transparent; letter-spacing: 0.02em; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; }
.fieldLabel { width: 96%; margin: 5px 2%; font-size: 11px; color: var(--text-mute); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.fieldLabelPin { width: 86%; margin: 5px 7%; font-size: 11px; color: var(--text-mute); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.raceNumberHolder, .runnersNameHolder { width: 100%; float: left; }
.leftcolHolder, .runnersNameHolder { width: 48%; float: left; font-family: 'Inter', sans-serif; }
.runnersNameHolder { margin: 0 2% 2% 0; }
.leftcolHolder { margin: 0 0 2% 2%; }
.raceNumberHolder { height: 119px; margin: 5px 2%; background-color: var(--panel-2); width: 96%; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.runnersNameHolder input[type="text"], .leftcolHolder input[type="text"], .loginHolder input[type="text"] { width: 96%; margin: 8px 5% 9px 2%; font-size: 16px; color: var(--text); border: none; border-bottom: 1px solid var(--line); background: transparent; padding: 8px 0; }
.loginHolder p { color: var(--text); }
.fieldInputPin input[type="text"] { width: 80%; margin: 0 10%; font-size: 20px; }

.raceColourHolder img { height: 50px; display: block; padding-top: 10%; }
.searchClear img { height: 20px; display: block; }
.addRunner img { height: 50px; display: block; }
.searcArea { width: 240px; margin: 30px auto 70px; }
.searchQueryNew { width: 100%; height: 36px; font-size: 16px; font-family: 'Inter', sans-serif; background-color: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius-sm); padding: 0 12px; }
.searchField { width: 160px; height: 36px; float: left; display: block; }
.searchClear { width: 40px; height: 36px; float: left; display: block; }
.searchIntro { text-align: center; color: var(--text-mute); letter-spacing: 0.04em; margin: 5px 0; font-size: 12px; }
.fontInc { font-size: 22px; text-transform: uppercase; }
.addRunner { width: 50px; margin: 0 auto; position: fixed; right: 12px; top: 12px; }
.fieldCheck { font-size: 14px; padding: 6px; }
.checkboxPadding { padding: 12px; font-size: 13px; }
.checkboxPadding label { position: relative; top: -10px; }
input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--brand); }

input.searchQuery { font-size: 28px; width: 150px; text-align: center; text-transform: uppercase; background: transparent; border: none; border-bottom: 1px solid var(--line); color: var(--text); font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; }

input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"],
input[type="email"], input[type="month"], input[type="number"], input[type="text"],
select:focus, textarea {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
}

.btnlink { color: var(--text); }
.inline-inner { padding: 20px; }
.fem, .male { color: var(--text-dim); }
.grey { color: var(--text-mute); }
.footer { width: 100%; clear: both; }
tr th { background-color: transparent; color: var(--text-dim); }
.icons { width: 20px !important; }
.logoReg { width: 80px !important; display: inline-block; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 720px) {
    .holder { padding-top: 18px; }
    .logo { width: 210px !important; }
    h1 { font-size: 24px; }
    h1 .headSep { display: inline; }
    h1 .headSub { display: block; font-size: 16px; margin-top: 2px; }

    #customers { font-size: 12.5px; }
    #customers th { padding: 11px 9px !important; font-size: 10.5px !important; letter-spacing: 0.08em; }
    #customers td { padding: 10px 9px !important; }
    #customers td:nth-child(2) { font-size: 13px; }
    #customers td:last-child { font-size: 13px; padding-right: 12px !important; }
}

@media (max-width: 520px) {
     h1 .headSep { display:none }
    body { padding: 0 8px 40px; }
    .categoryTab { padding: 0 14px; height: 34px; font-size: 12px; }
    .tabHolder { padding: 3px; }
    .realtime img { width: 220px; }

    /* Hide club on the smallest screens — keep #, runner, age, bib, time */
    /* #customers th:nth-child(3),
    #customers td:nth-child(3) { display: none; } */
}

@media (max-width: 380px) {
    .categoryTab { padding: 0 10px; font-size: 11.5px; }
    h1 { font-size: 20px; }
    .liveBadge { font-size: 10px; padding: 4px 10px 4px 8px; }
}
