/* ============================================================
   DLSJBC SPORTS FEST 2026 — public landing page

   Dark green is the brand, gold is an accent only, white/cream
   carries the page. One container width, one radius scale, one
   shadow. Kept in its own file so a change to the admin
   stylesheet can never restyle the public site.
   ============================================================ */

:root {
    --lp-forest: #004D3B;
    --lp-forest-deep: #003328;
    --lp-forest-mid: #0A5D47;
    --lp-forest-soft: #EDF4F1;
    --lp-cream: #FFFFFF;
    --lp-gold: #D6AA32;
    --lp-gold-deep: #B8912A;
    --lp-silver: #C3CAD2;
    --lp-bronze: #C9803E;
    --lp-ink: #1B2420;
    --lp-muted: #667370;
    --lp-line: #E4E9E7;
    --lp-line-soft: #F2F5F4;
    --lp-radius: 12px;
    --lp-radius-sm: 9px;
    --lp-shadow: 0 1px 2px rgba(0, 51, 40, .04), 0 6px 18px rgba(0, 51, 40, .05);
    --lp-shadow-hover: 0 2px 4px rgba(0, 51, 40, .06), 0 12px 28px rgba(0, 51, 40, .09);
    --lp-container: 1300px;
}

* { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    /* Same two reasons as style.css: stop iOS inflating text in landscape,
       which breaks every fixed-height card here, and declare momentum
       scrolling once for every scroll container on the page. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
}
body.lp-body {
    margin: 0;
    background: var(--lp-cream);
    color: var(--lp-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.lp-container { width: 100%; max-width: var(--lp-container); margin: 0 auto; padding: 0 28px; }
.lp-body a { color: inherit; text-decoration: none; }
.lp-body h1, .lp-body h2, .lp-body h3 { margin: 0; line-height: 1.2; }
.lp-body p { margin: 0; }

/* ============================ HEADER ============================ */
.lp-header {
    background: var(--lp-forest-deep);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.lp-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; min-height: 74px;
}
.lp-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lp-header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.lp-brand-logo {
    width: 44px; height: 44px; object-fit: contain; border-radius: 9px;
    background: #fff; padding: 3px; flex: 0 0 auto;
}
.lp-brand-rule { width: 1px; height: 32px; background: rgba(255, 255, 255, .22); flex: 0 0 auto; }
.lp-brand-block { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lp-brand-1 { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: .02em; }
.lp-brand-2 { font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, .6); letter-spacing: .04em; }
.lp-brand-fest {
    font-size: 14px; font-weight: 700; color: var(--lp-gold);
    letter-spacing: .10em; white-space: nowrap;
}

.lp-login {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 20px; border-radius: 8px;
    background: #fff;
    border: 1px solid #fff;
    color: var(--lp-forest);
    font-size: 13.5px; font-weight: 600;
    transition: background .18s, color .18s;
    flex: 0 0 auto;
}
.lp-login:hover { background: var(--lp-gold); border-color: var(--lp-gold); color: #241B00; }

/* The one extra header affordance: opens the Live Podium over this page.
   Matches Login - white at rest, gold on hover - so the pair reads as one
   set of controls. */
.lp-podium-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: 8px;
    background: #fff;
    border: 1px solid #fff;
    color: var(--lp-forest);
    font-size: 13.5px; font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .18s, color .18s, border-color .18s;
    flex: 0 0 auto;
}
.lp-podium-link:hover {
    background: var(--lp-gold);
    border-color: var(--lp-gold);
    color: #241B00;
}

/* ---------- Live-connection indicator ----------
   Small, unobtrusive, and in the header's own language: a dot plus one word.
   It reports whether the figures on screen are being kept current, nothing more
   - a public visitor never needs an error dialog, and showing one during a
   momentary network blip would be alarming and pointless.

   The dot breathes slowly when live. A 2.4s cycle is slow enough to read as
   "this is a status light" rather than an animation competing for attention. */
.lp-live {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 13px; border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .72);
    font-size: 12px; font-weight: 600;
    white-space: nowrap; flex: 0 0 auto;
    transition: background .2s, color .2s, border-color .2s;
}
.lp-live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--lp-muted); flex: 0 0 auto;
    transition: background .2s;
}
.lp-live.is-live { color: #fff; border-color: rgba(214, 170, 50, .5); }
.lp-live.is-live .lp-live-dot {
    background: #4ADE80;
    animation: lpPulse 2.4s ease-in-out infinite;
}
@keyframes lpPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); }
    50%      { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
}
/* Reconnecting: amber, and steady rather than pulsing - an urgency signal, not
   a normal one. Still no icon change and no layout shift. */
.lp-live.is-retry { color: #FFE9B0; border-color: rgba(255, 202, 40, .45); }
.lp-live.is-retry .lp-live-dot { background: var(--lp-gold); }

@media (prefers-reduced-motion: reduce) {
    .lp-live.is-live .lp-live-dot { animation: none; }
}

/* ---------- Current-event bar ----------
   Sits between the hero and the statistics row. It carries the figures that
   change most often while a fest is running - which event is live, how many
   evaluations are in - so a visitor watching the page sees the present state
   without scrolling to the tabulation at the bottom. */
.lp-livebar { margin-top: 22px; }
.lp-livecard {
    display: flex; align-items: center; justify-content: space-between;
    gap: 26px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--lp-line);
    border-radius: var(--lp-radius); box-shadow: var(--lp-shadow);
    padding: 18px 22px;
}
.lp-livecard-main { min-width: 0; }
.lp-livecard-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; letter-spacing: .10em;
    text-transform: uppercase; color: var(--lp-gold-deep);
}
.lp-livecard-title {
    font-size: 21px; font-weight: 800; color: var(--lp-forest);
    line-height: 1.25; margin: 5px 0 9px;
}
.lp-livecard-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.lp-chip {
    display: inline-flex; align-items: center;
    padding: 4px 11px; border-radius: 999px;
    background: var(--lp-forest-soft); border: 1px solid var(--lp-line);
    color: var(--lp-forest); font-size: 11.5px; font-weight: 700;
}
.lp-chip-live {
    background: rgba(74, 222, 128, .12);
    border-color: rgba(8, 123, 89, .35);
    color: #05603A;
}
.lp-chip-quiet { background: #F4F6F5; color: var(--lp-muted); }

/* Submission progress. The fill animates its width so "12 of 15" becoming
   "13 of 15" is visible rather than instantaneous. */
.lp-livecard-progress {
    display: flex; flex-direction: column; gap: 5px;
    min-width: 190px; flex: 0 0 auto;
}
.lp-progress-label {
    font-size: 11px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--lp-muted);
}
.lp-progress-value { font-size: 14px; color: var(--lp-muted); }
.lp-progress-value b { font-size: 20px; font-weight: 800; color: var(--lp-forest); }
.lp-progress-track {
    display: block; height: 6px; border-radius: 999px;
    background: var(--lp-line-soft); overflow: hidden;
}
.lp-progress-fill {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--lp-forest) 0%, var(--lp-forest-mid) 100%);
    transition: width .5s ease;
}
.lp-progress-sub { font-size: 11.5px; color: var(--lp-muted); }

@media (max-width: 860px) {
    .lp-livecard { flex-direction: column; align-items: stretch; }
    .lp-livecard-progress { min-width: 0; }
}

/* ============================ HERO ============================ */
.lp-hero { position: relative; overflow: hidden; background: var(--lp-forest-deep); }
.lp-hero-bg {
    position: absolute; inset: 0;
    /* Royalty-free athletic-field courtesy of landing.jpg already in the
       assets folder. It has a strong horizontal gradient into our forest tone
       on the left, so the white hero text stays legible without leaning on a
       heavier veil. */
    background:
        linear-gradient(90deg, rgba(0, 51, 40, .92) 0%, rgba(0, 77, 59, .76) 46%, rgba(0, 77, 59, .40) 100%),
        url('../images/landing.jpg') center/cover no-repeat;
    transform: scale(1.02);
}
.lp-hero::after {
    /* Dark green veil + a gold hairline across the base: keeps the white type
       legible on any photo without flattening the image completely. */
    content: ''; position: absolute; inset: 0;
    background:
        linear-gradient(100deg, rgba(0, 40, 31, .94) 0%, rgba(0, 77, 59, .84) 52%, rgba(0, 77, 59, .70) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, .28), transparent 45%);
}
.lp-hero-inner { position: relative; z-index: 1; padding: 40px 28px 56px; color: #fff; }

/* Two-column hero grid: emblem | wordmark */
.lp-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 40px;
    max-width: 1500px;
    margin: 0 auto;
}

/* Left column: AL emblem - positioned from left, larger */
.lp-hero-col-emblem { display: flex; justify-content: flex-start; padding-left: 0.5cm; }
.lp-hero-emblem {
    width: auto;
    max-width: 400px;
    height: auto;
    object-fit: contain;
}

/* Right column: wordmark + tagline underneath */
.lp-hero-col-wordmark { display: flex; flex-direction: column; justify-content: flex-start; align-items: center; gap: 4px; }
.lp-hero-wordmark {
    width: auto;
    max-width: 800px;
    height: auto;
    object-fit: contain;
}

/* The welcome under the wordmark. It is a greeting rather than a headline, so it
   is set below the wordmark's own size and centred with it; the lead line and the
   motto are the two emphasised sentences of that greeting. */
.lp-hero-welcome { text-align: center; max-width: 660px; }
.lp-hero-welcome p {
    margin: 0 0 10px;
    font-size: 15px; line-height: 1.6;
    color: rgba(255, 255, 255, .88);
}
.lp-hero-welcome p:last-child { margin-bottom: 0; }
.lp-hero-welcome .lp-welcome-lead {
    margin-bottom: 12px;
    font-size: 19px; font-weight: 700; line-height: 1.35;
    color: #fff; letter-spacing: .01em;
}
.lp-hero-welcome .lp-welcome-motto {
    font-size: 17px; font-weight: 700; line-height: 1.3;
    color: rgba(255, 255, 255, .98); letter-spacing: .02em;
}
.lp-hero-welcome .lp-welcome-hi { font-size: 16px; font-weight: 600; color: #fff; }

/* ============================ HERO RESPONSIVE ============================ */

/* Tablet: reduce sizes and gaps, keep two columns */
@media (max-width: 1024px) {
    .lp-hero-inner { padding: 60px 20px 56px; }
    .lp-hero-grid { gap: clamp(20px, 3vw, 40px); }
    .lp-hero-col-emblem { padding-left: 1cm; }
    .lp-hero-emblem { max-width: 300px; }
    .lp-hero-wordmark { max-width: 550px; }
    .lp-hero-welcome { max-width: 560px; }
    .lp-hero-welcome p { font-size: 14px; }
    .lp-hero-welcome .lp-welcome-lead { font-size: 17px; }
    .lp-hero-welcome .lp-welcome-motto { font-size: 16px; }
    .lp-hero-welcome .lp-welcome-hi { font-size: 15px; }
}

/* Mobile: stack vertically - emblem above wordmark + tagline */
@media (max-width: 640px) {
    .lp-hero-inner { padding: 48px 16px 44px; }
    .lp-hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }
    .lp-hero-col-emblem { justify-content: center; padding-left: 0; order: 1; }
    .lp-hero-col-wordmark { justify-content: center; align-items: center; order: 2; max-width: 100%; min-width: 0; }
    .lp-hero-emblem { max-width: 260px; }
    .lp-hero-wordmark { max-width: min(350px, 100%); }
    .lp-hero-welcome { text-align: center; max-width: 100%; }
    .lp-hero-welcome p { font-size: 14px; overflow-wrap: anywhere; }
    .lp-hero-welcome .lp-welcome-lead { font-size: 16px; }
    .lp-hero-welcome .lp-welcome-motto { font-size: 15px; }
    .lp-hero-welcome .lp-welcome-hi { font-size: 14px; }
}

/* ============================ STATISTICS ============================ */
.lp-stats {
    display: grid; gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: -34px; position: relative; z-index: 2;
}
/* Compact, clickable cards: icon left, number + label beside it. */
.lp-stat {
    font: inherit; color: inherit; cursor: pointer; width: 100%;
    background: #fff; border: 1px solid var(--lp-line);
    border-radius: var(--lp-radius); box-shadow: var(--lp-shadow);
    padding: 14px 18px; text-align: left;
    display: flex; flex-direction: row; align-items: center; gap: 14px;
    transition: box-shadow .18s, transform .18s, border-color .18s;
}
.lp-stat:hover { box-shadow: var(--lp-shadow-hover); transform: translateY(-2px); border-color: var(--lp-gold); }
.lp-stat:focus-visible { outline: 2px solid var(--lp-gold); outline-offset: 2px; }
.lp-stat-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--lp-forest-soft); color: var(--lp-forest);
}
.lp-stat-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.lp-stat-value {
    font-size: 26px; font-weight: 800; color: var(--lp-forest);
    letter-spacing: -.02em; line-height: 1.1;
}
.lp-stat-label { font-size: 12.5px; font-weight: 500; color: var(--lp-muted); }
.lp-stat-go { font-size: 24px; line-height: 1; color: var(--lp-muted); transition: color .18s, transform .18s; }
.lp-stat:hover .lp-stat-go { color: var(--lp-gold-deep); transform: translateX(3px); }

/* ---------- Stat card popup ---------- */
.lp-modal {
    position: fixed; inset: 0; z-index: 300;
    display: none; align-items: center; justify-content: center;
    padding: 24px; background: rgba(0, 40, 31, .55);
}
.lp-modal.open { display: flex; }
.lp-modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 760px;
    max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
    border-top: 4px solid var(--lp-gold);
    box-shadow: 0 24px 60px rgba(0, 40, 31, .35);
    animation: lpModalIn .2s ease;
}
@keyframes lpModalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.lp-modal-head {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 22px; border-bottom: 1px solid var(--lp-line);
}
.lp-modal-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--lp-forest-soft); color: var(--lp-forest);
}
.lp-modal-heading { flex: 1 1 auto; min-width: 0; }
.lp-modal-heading h3 { margin: 0; font-size: 18px; font-weight: 800; color: var(--lp-forest); }
.lp-modal-heading p { margin: 2px 0 0; font-size: 12.5px; color: var(--lp-muted); }
.lp-modal-close {
    width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--lp-forest-soft); color: var(--lp-forest); font-size: 22px; line-height: 1;
}
.lp-modal-close:hover { background: var(--lp-gold); color: #241B00; }
.lp-modal-body { overflow-y: auto; padding: 6px 22px 18px; }
.lp-modal-list { list-style: none; margin: 0; padding: 0; }
.lp-modal-item {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 0; border-bottom: 1px solid var(--lp-line-soft);
}
.lp-modal-item:last-child { border-bottom: none; }
.lp-modal-main { flex: 1 1 220px; min-width: 0; }
.lp-modal-name { font-size: 14px; font-weight: 700; color: var(--lp-ink); }
.lp-modal-meta { font-size: 12px; color: var(--lp-muted); margin-top: 1px; }
.lp-modal-status {
    font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 6px;
    background: #F4F6F5; color: var(--lp-muted); white-space: nowrap;
}
.lp-modal-status.s-active    { background: #DBEAFE; color: #1D4ED8; }
.lp-modal-status.s-closed    { background: #F5E8BD; color: #9A7418; }
.lp-modal-status.s-finalized { background: #DDF5E8; color: #087B59; }
.lp-modal-winner {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px; font-weight: 700; color: var(--lp-gold-deep); white-space: nowrap;
}

/* ============================ GRID LAYOUT ============================ */
.lp-grid-2 {
    display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
    gap: 20px; margin-top: 26px;
    align-items: stretch;
}
.lp-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lp-grid-podium { margin-top: 20px; }

.lp-final-name { white-space: nowrap; }
.lp-final-total { text-align: center; white-space: nowrap; }
.lp-medal-h { text-align: center; white-space: nowrap; }
.lp-medal-h .lp-medal-dot { margin-right: 5px; }
.lp-medal-c { text-align: center; font-variant-numeric: tabular-nums; }
/* Overall Standing alignment lives with the base .lp-table rules below, not
   here. It used to sit at this point in the file, ABOVE `.lp-table th`, and both
   selectors carry the same specificity (one class + one element), so the later
   `.lp-table th { text-align: left }` won outright: every header rendered
   left-aligned while the numbers beneath it were centred, and the header text
   appeared to drift off to the edge of its own column. Kept here only as a
   pointer - the working rule is at the end of the .lp-table block. */
.lp-medal-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    margin-right: 7px; vertical-align: middle; border: 1px solid rgba(0, 0, 0, .12);
}
.lp-medal-dot.gold { background: var(--lp-gold); }
.lp-medal-dot.silver { background: var(--lp-silver); }
.lp-medal-dot.bronze { background: var(--lp-bronze); }
.lp-medal-dot.white { background: #fff; }
/* The landing page loads only landing.css, never style.css, so the admin
 * scrollbar block cannot reach these two. The same treatment is repeated here -
   same 10px, same mint track and green thumb - so a bar reads identically on
   the public page and in the admin. Keep the two files in step. */
.lp-table-wrap,
.lp-modal-body {
    scrollbar-width: thin;
    scrollbar-color: #B9D2C7 #F2F8F5;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.lp-table-wrap::-webkit-scrollbar,
.lp-modal-body::-webkit-scrollbar { width: 10px; height: 10px; }
.lp-table-wrap::-webkit-scrollbar-track,
.lp-modal-body::-webkit-scrollbar-track { background: #F2F8F5; border-radius: 999px; }
.lp-table-wrap::-webkit-scrollbar-thumb,
.lp-modal-body::-webkit-scrollbar-thumb {
    background: #B9D2C7; border-radius: 999px;
    /* border in the track colour, so the thumb reads as a pill in the track */
    border: 2px solid #F2F8F5;
}
.lp-table-wrap::-webkit-scrollbar-thumb:hover,
.lp-modal-body::-webkit-scrollbar-thumb:hover { background: var(--lp-forest); }

.lp-table-wrap { overflow-x: auto; }
.lp-total { color: var(--lp-forest); }

/* ---------- Live-update flash ----------
   Applied by the poller to exactly the nodes whose value just changed: a stat
   that moved, a contest field that was edited, a standings row that swapped
   place. One short fade-and-wash, no loops - the brief asks for the update to
   feel natural, and a permanently pulsing scoreboard fights the content it is
   meant to highlight.

   The wash is a box-shadow inset rather than a background so it does not
   disturb the surrounding layout, and it never changes the element's box, so
   nothing reflows and the page cannot flicker. */
.lp-flash { animation: lpFlash .7s ease-out 1; }
@keyframes lpFlash {
    from { background-color: rgba(214, 170, 50, .18); }
    to   { background-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
    .lp-flash { animation: none; }
}

/* ============================ PANELS ============================ */
.lp-panel {
    background: #fff; border: 1px solid var(--lp-line);
    border-radius: var(--lp-radius); box-shadow: var(--lp-shadow);
    display: flex; flex-direction: column; overflow: hidden;
}
.lp-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 16px 20px;
    border-bottom: 1px solid var(--lp-line);
    background: #FCFDFC;
}
.lp-panel-title {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 15.5px; font-weight: 700; color: var(--lp-forest);
}
.lp-panel-sub { font-size: 12.5px; font-weight: 600; color: var(--lp-muted); }
.lp-panel-body { padding: 20px; }
.lp-more {
    font-size: 12.5px; font-weight: 600; color: var(--lp-forest);
    transition: color .15s;
}
.lp-more:hover { color: var(--lp-gold-deep); }

/* ============================ ABOUT ============================ */
.lp-about-body { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 22px; padding: 20px; }
.lp-about-text p { font-size: 14px; color: #3C4A45; }
.lp-about-points { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; }
.lp-about-points li {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 13.5px; font-weight: 500; color: var(--lp-ink);
}
.lp-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--lp-gold); margin-top: 7px; flex: 0 0 auto;
}
.lp-about-art { border-radius: var(--lp-radius-sm); overflow: hidden; border: 1px solid var(--lp-line); }
.lp-about-art img { width: 100%; height: 100%; min-height: 168px; object-fit: cover; }

/* ============================ POINT SYSTEM ============================ */
.lp-points-text { font-size: 13.5px; color: var(--lp-muted); margin-bottom: 14px; }
.lp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lp-table th {
    text-align: left; padding: 10px 14px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--lp-muted);
    background: #FBFCFC; border-bottom: 1px solid var(--lp-line);
    white-space: nowrap;
}
.lp-table td { padding: 10px 14px; border-bottom: 1px solid var(--lp-line-soft); }
.lp-table tbody tr:last-child td { border-bottom: 0; }
.lp-table tbody tr:hover { background: #FCFDFC; }
.lp-table-points th:not(:first-child), .lp-table-points td:not(:first-child) { text-align: center; }
.lp-table-points td:first-child { font-weight: 500; }

/* Overall Standing: every column centred, headings and data alike.
 *
 * Written as `.lp-table.lp-table-final` (two classes) on purpose. A single-class
 * selector here would still LOSE to the `.lp-table th` rule above, because that
 * one also carries an element selector and specificity is compared per selector,
 * not per file - element beats class. Two classes plus the element outranks it, so
 * this holds whatever order the rules end up in. */
.lp-table.lp-table-final th,
.lp-table.lp-table-final td {
    text-align: center;
    vertical-align: middle;
    padding-left: 10px;
    padding-right: 10px;
}
/* Half a column will not hold seven columns with the placement names on one
   line, so the headings wrap to two. Only th is loosened: `.lp-final-name` still
   keeps a contestant on a single line. */
.lp-table.lp-table-final th { white-space: normal; }
/* Blank slots only hold the panel at a full top-four height; they are not rows
   a visitor can point at or open. */
.lp-table tbody tr.lp-standing-slot,
.lp-table tbody tr.lp-standing-slot:hover { background: none; cursor: default; }
.lp-points-note { font-size: 12px; color: var(--lp-muted); margin-top: 12px; font-style: italic; }

/* Medal dot / medallion, used in the point table and the standing rows. */
.lp-medal {
    display: inline-flex; align-items: center; justify-content: center;
    vertical-align: middle;
}
.lp-medal.gold { color: var(--lp-gold); }
.lp-medal.silver { color: #98A2AD; }
.lp-medal.bronze { color: var(--lp-bronze); }
.lp-medal.white { color: #C7CDD2; }

/* ============================ LATEST RESULTS ============================ */
.lp-latest { flex: 1 1 auto; }
.lp-results { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.lp-result {
    display: grid; align-items: center;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    gap: 12px; padding: 14px 20px;
    border-bottom: 1px solid var(--lp-line-soft);
    transition: background .15s;
}
.lp-result:last-child { border-bottom: 0; }
.lp-result:hover { background: #FCFDFC; }
.lp-result-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--lp-forest-soft); color: var(--lp-forest);
}
.lp-result-main { min-width: 0; }
.lp-result-event {
    font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lp-result-date { font-size: 12px; color: var(--lp-muted); margin-top: 1px; }
.lp-result-sep { color: var(--lp-muted); font-weight: 400; margin: 0 2px; }
.lp-result-cat {
    font-size: 11px; font-weight: 600; color: var(--lp-muted);
    padding: 4px 9px; border-radius: 6px; background: var(--lp-forest-soft);
    white-space: nowrap;
}
.lp-result-status {
    font-size: 12.5px; font-weight: 600; color: var(--lp-forest);
    white-space: nowrap;
}
/* The selector line below was missing - the file went straight from the closing
   brace above into bare declarations and then a stray closing brace, leaving the
   parser a declaration with nothing to attach it to plus an unmatched brace.
   That cost this rule and left the block after it one out. */
.lp-empty {
    gap: 4px; padding: 42px 20px; text-align: center; color: var(--lp-muted);
    flex: 1 1 auto;
}
.lp-empty p { margin: 8px 0 0; font-size: 14.5px; font-weight: 600; color: var(--lp-ink); }
.lp-empty span { font-size: 13px; }
/* ============================ RESULT POPUP ============================ */
/* A row in Latest Results is a door: it opens the ranking of its own event.
   The pointer and the focus ring say so without moving anything on the page. */
.lp-result-open { cursor: pointer; }
.lp-result-open:focus-visible {
    outline: 2px solid var(--lp-gold);
    outline-offset: -2px;
}
/* The ranking inside the popup: the placement reads from the left, the
   contestant is centred because it leaves room on both sides, and the
   figure reads from the right. */
.lp-table.lp-table-places th:not(:first-child),
.lp-table.lp-table-places td:not(:first-child) { text-align: center; }
/* Contestant column: centred to use the space between Placement and Points.
   The result popup's three columns are marked with .lp-table-result, and its
   two outer columns are given an equal share of the width so the middle one
   lands at the true centre of the table. The name reads as centred with the
   same breathing room on both sides, instead of floating in the wide gap a
   stretched middle column leaves. */
.lp-table-result th,
.lp-table-result td { text-align: center; }
.lp-table-result th:first-child,
.lp-table-result td:first-child,
.lp-table-result th:last-child,
.lp-table-result td:last-child { width: 24%; }
.lp-place { white-space: nowrap; }
.lp-place-name { font-weight: 600; color: var(--lp-ink); text-align: center; }
.lp-place-score { font-variant-numeric: tabular-nums; }
.lp-place-points { font-weight: 700; color: var(--lp-forest); font-variant-numeric: tabular-nums; }
.lp-places-note { font-size: 12px; color: var(--lp-muted); margin: 12px 0 0; font-style: italic; }
/* The popup's second line under an event name (its category) and the date
   column beside it. */
.lp-place-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--lp-muted); margin-top: 1px; }
.lp-place-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* The total line of a contestant's contest list: the points the rows add up
   to, set against a rule so it reads as a sum and not as another contest. */
.lp-table-places tfoot td { border-top: 1px solid var(--lp-line); border-bottom: 0; }
.lp-place-total-label { font-weight: 700; color: var(--lp-forest); }
.lp-place-points-total { font-weight: 800; }

/* ============================ STANDING POPUP ============================ */
/* A row of the Overall Standing is a door too: it opens the contests behind
   its score. The score itself is the button, so keyboard users get a focus
   ring on the figure rather than on the whole row. */
.lp-standing-open { cursor: pointer; }
.lp-standing-score {
    background: none; border: 0; padding: 0; margin: 0;
    font: inherit; color: inherit; cursor: pointer; border-radius: 4px;
}
.lp-standing-score:focus-visible {
    outline: 2px solid var(--lp-gold);
    outline-offset: 2px;
}
/* The Contest column reads from the left here, unlike the result popup's
   centred Contestant column that shares the .lp-place-name class. */
#standModalBody .lp-place-name { text-align: left; }

/* Scrollable container for standing modal - limit to 6 rows (≈310px) */
.lp-standing-scroll {
    max-height: 310px;
    overflow-y: auto;
    margin: 0 -22px;      /* extend to modal body edges (desktop) */
    padding: 0 22px;      /* keep table content aligned */
    scrollbar-width: thin;
    scrollbar-color: #B9D2C7 #F2F8F5;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.lp-standing-scroll::-webkit-scrollbar { width: 10px; }
.lp-standing-scroll::-webkit-scrollbar-track { background: #F2F8F5; border-radius: 999px; }
.lp-standing-scroll::-webkit-scrollbar-thumb {
    background: #B9D2C7; border-radius: 999px; border: 2px solid #F2F8F5;
}
.lp-standing-scroll::-webkit-scrollbar-thumb:hover { background: var(--lp-forest); }
.lp-standing-scroll .lp-table { margin-bottom: 0; }

/* Mobile: modal body has less padding (12px), so adjust margins */
@media (max-width: 640px) {
    .lp-standing-scroll {
        margin: 0 -12px;
        padding: 0 12px;
    }
}

/* ============================ PODIUM STAGE ============================ */
/* Same shape as the admin Present Winners overlay: full-bleed, opened over the
   page it came from. podium.php inside the frame is built from the identical
   ws-* stage markup, so the podium matches Present Winners exactly. */
.lp-stage {
    position: fixed; inset: 0; z-index: 200;
    display: none; background: var(--lp-forest-deep);
}
.lp-stage.open { display: block; }
.lp-stage iframe { width: 100%; height: 100%; border: 0; display: block; overflow: hidden; }
.lp-stage-close {
    position: fixed; top: 14px; right: 16px; z-index: 10;
    width: 38px; height: 38px; border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .3); background: #fff;
    color: var(--lp-forest); font-size: 24px; line-height: 1; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 40, 31, .25);
    transition: background .15s, color .15s;
}
.lp-stage-close:hover { background: var(--lp-gold); color: #241B00; }

/* ============================ FOOTER ============================ */
.lp-footer { margin-top: 44px; background: var(--lp-forest-deep); color: rgba(255, 255, 255, .74); }
.lp-footer-inner {
    display: flex; align-items: center; justify-content: center;
    gap: 18px; flex-wrap: wrap; padding-top: 32px; padding-bottom: 32px;
}
.lp-footer-brand { display: flex; flex-direction: column; align-items: center; }
.lp-footer-copyright { font-size: 13px; color: rgba(255, 255, 255, .6); font-weight: 500; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1080px) {
    .lp-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .lp-brand-rule-2, .lp-brand-block:last-child { display: none; }
    .lp-about-body { grid-template-columns: minmax(0, 1fr); }
    .lp-about-art { display: none; }
    .lp-result { grid-template-columns: 38px minmax(0, 1fr); }
    .lp-result-cat, .lp-result-status { display: none; }
}
@media (max-width: 720px) {
    .lp-container { padding: 0 18px; }
    .lp-hero-inner { padding: 54px 18px 50px; }
    .lp-stats {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px; margin-top: -26px;
    }
    .lp-stat { padding: 12px 14px; }
    .lp-modal { padding: 12px; }
}

/* ---- Tables on a phone ----
   The Point System is three columns and the Overall Standing is
   seven. Neither was wrapped in a scroll container (the standing
   table's wrapper was narrower than the table itself, so its last
   columns sat off the panel and the medal headings never lined up
   with the numbers they named). At 320px the Point System measured
   326px inside a 282px panel and the standing table 558px inside
   the same 282px.

   Both are compacted to fit rather than left to scroll: fixed column
   widths, tighter cells, and a standing header that keeps the medal
   dots (which already identify the four placement columns) while the
   long placement names step aside. Every number and row stays on
   screen. */
@media (max-width: 640px) {
    .lp-points .lp-panel-body { padding: 14px; }

    .lp-table-points { table-layout: fixed; font-size: 12.5px; }
    .lp-table-points th,
    .lp-table-points td { padding: 7px 5px; }
    .lp-table-points th {
        font-size: 9.5px;
        letter-spacing: .03em;
        white-space: normal;
        line-height: 1.2;
    }
    .lp-table-points th:first-child,
    .lp-table-points td:first-child { width: 56%; }
    .lp-table-points th:nth-child(2),
    .lp-table-points td:nth-child(2),
    .lp-table-points th:nth-child(3),
    .lp-table-points td:nth-child(3) { width: 22%; }

    .lp-table.lp-table-final {
        table-layout: fixed;
        font-size: 12px;
    }
    .lp-table.lp-table-final th,
    .lp-table.lp-table-final td {
        padding: 6px 4px;
    }
    .lp-table.lp-table-final th {
        font-size: 8.5px;
        letter-spacing: 0;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }
    .lp-table.lp-table-final th:first-child,
    .lp-table.lp-table-final td:first-child { width: 8%; }
    .lp-table.lp-table-final th:nth-child(2),
    .lp-table.lp-table-final td:nth-child(2) { width: 44%; }
    .lp-table.lp-table-final th:nth-child(3),
    .lp-table.lp-table-final td:nth-child(3),
    .lp-table.lp-table-final th:nth-child(4),
    .lp-table.lp-table-final td:nth-child(4),
    .lp-table.lp-table-final th:nth-child(5),
    .lp-table.lp-table-final td:nth-child(5),
    .lp-table.lp-table-final th:nth-child(6),
    .lp-table.lp-table-final td:nth-child(6) { width: 8%; }
    .lp-table.lp-table-final th:last-child,
    .lp-table.lp-table-final td:last-child { width: 16%; }

    /* The rank heading is one word in a 14px content box; "#" says
       the same thing without forcing a break. */
    .lp-table.lp-table-final th:first-child { font-size: 0; }
    .lp-table.lp-table-final th:first-child::after { content: "#"; font-size: 9px; }
    /* The four placement headings are replaced by their medal dots:
       the dot is already what tells the four count columns apart,
       and the full names (Champion, 1st Runner-Up...) break to four
       lines in an 8% column. */
    .lp-table.lp-table-final .lp-medal-h {
        font-size: 0;
        text-align: center;
        vertical-align: middle;
    }
    .lp-table.lp-table-final .lp-medal-h .lp-medal-dot {
        width: 8px; height: 8px;
        margin: 0;
    }
    .lp-final-name {
        white-space: normal;
        overflow-wrap: anywhere;
        font-size: 12px;
        line-height: 1.25;
    }
    .lp-final-name strong { font-weight: 700; }
    .lp-final-total { white-space: normal; }
    .lp-final-total .lp-total { font-size: 13px; }
    .lp-table.lp-table-final tbody tr.lp-standing-slot td { padding-top: 0; padding-bottom: 0; }
}

/* ---- Result and Standing popups ----
   Both tables are wider than the popup body on a phone (the result
   popup's three columns lose POINTS; the standing popup's four lose
   PLACEMENT and POINTS). Each result line becomes a small card:
   contestant on its own line, then placement / date / points as
   label-and-value rows. The labels come from the same headings the
   table carries, generated here, so the markup stays untouched. */
@media (max-width: 640px) {
    .lp-modal-box { max-height: calc(100dvh - 24px); }
    .lp-modal-head { padding: 14px 16px; }
    .lp-modal-body { padding: 4px 12px 14px; }

    .lp-table-places { display: block; width: 100%; }
    .lp-table-places thead { display: none; }
    .lp-table-places tbody,
    .lp-table-places tfoot { display: block; }
    .lp-table-places tbody tr {
        display: block;
        padding: 10px 12px;
        margin: 0 0 8px;
        border: 1px solid var(--lp-line);
        border-radius: 10px;
        background: #fff;
    }
    .lp-table-places tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: auto !important;
        padding: 3px 0 !important;
        border: 0;
        text-align: right !important;
        white-space: normal;
    }
    .lp-table-places tbody td::before {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--lp-muted);
        text-align: left;
    }
    .lp-table-result td:nth-child(1)::before { content: "Placement"; }
    .lp-table-result td:nth-child(2)::before { content: "Contestant"; }
    .lp-table-result td:nth-child(3)::before { content: "Points"; }
    .lp-table-result td:nth-child(2) { font-weight: 600; color: var(--lp-ink); }
    .lp-table-result td:nth-child(3) { font-weight: 700; color: var(--lp-forest); }

    /* The contest list's first cell is the event name, so it leads
       the card on its own line instead of carrying a label. */
    #standModalBody .lp-place-name {
        display: block;
        padding-bottom: 6px !important;
        text-align: left !important;
        font-size: 14px;
    }
    #standModalBody .lp-place-name::before { display: none; }
    #standModalBody .lp-place-date::before { content: "Date"; }
    #standModalBody .lp-place::before { content: "Placement"; }
    #standModalBody .lp-place-points::before { content: "Points"; }

    #standModalBody .lp-table-places tfoot tr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border: 1px solid var(--lp-line);
        border-radius: 10px;
        background: #FBFCFC;
    }
    #standModalBody .lp-table-places tfoot td {
        display: block;
        width: auto !important;
        padding: 0 !important;
        border: 0;
    }
    #standModalBody .lp-table-places tfoot td::before { display: none; }
}

/* ---- Phone layer for the landing page ----
   The landing page is the one screen most visitors meet on a phone, and it has
   its own stylesheet, so the shared mobile.css deliberately does not reach it.
   These are the phone-only corrections that the queries above did not cover.

   The notched-phone inset comes first and is the reason the page needed a
   viewport-fit=cover meta tag to work at all: without it env() resolves to 0
   and the header sits under the notch. */
.lp-body {
    /* A long contestant or event name is the classic cause of a page-wide
       sideways scroll on a phone. */
    overflow-x: hidden;
}
@media (max-width: 720px) {
    .lp-header {
        padding-left: max(18px, env(safe-area-inset-left));
        padding-right: max(18px, env(safe-area-inset-right));
    }
    /* The two brand blocks side by side left no room for the wordmark on a
       phone; the rule between them was decorative and went with it. */
    .lp-brand { gap: 8px; }
    .lp-brand-1 { font-size: 15px; }
    .lp-header-actions { gap: 8px; }
    /* 44px targets - the header buttons were ~34px. */
    .lp-podium-link,
    .lp-login { min-height: 44px; padding: 10px 14px; }
    .lp-footer {
        padding-bottom: calc(32px + env(safe-area-inset-bottom));
    }
}
@media (max-width: 420px) {
    /* Below this the brand lockup and the two header actions cannot both fit on
       one line at a legible size, so the lockup abbreviates rather than
       wrapping the header to two rows and pushing the hero down. */
    .lp-brand-block { display: none; }
    .lp-brand-1 { font-size: 14px; }
    .lp-stat-value { font-size: 24px; }
}
@media (max-height: 480px) and (orientation: landscape) {
    .lp-hero-inner { padding: 32px 18px 30px; }
    .lp-hero-title { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    .lp-body *, .lp-body *::before, .lp-body *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
    html { scroll-behavior: auto; }
}
