/* =========================================================
   BASIC RESET / VARIABLES
   ========================================================= */

* {
    box-sizing: border-box;
}

:root {
    --bg: #4b66a7ad;
    --panel: #fff;
    --text: #17202a;
    --muted: #687482;
    --line: #e3e6ea;
    --soft: #f3f5f7;

    --primary: #e50067;
    --success: #27b95f;
    --warning: #e8a51a;
    --dark: #121a2a;

      --status-ink: #1e293e;
      --status-muted: #6c7a8f;
      --status-line: #e4e9f1;
      --status-blue: #2784dc;
      --health: #aeb9ca;
      --health-wash: rgba(174, 185, 202, .15);

    --radius: 12px;
    --gap: 12px;
}
a{color:inherit;}
html,
body {
    margin: 0;
    min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-optical-sizing: auto;

  font-style: normal;
    color: var(--text);
    background: var(--bg);
}


/* =========================================================
   DEMO LAYOUT

   Not really part of the app.
   This simply displays the six mobile screens together.
   ========================================================= */

.demo {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px;
    max-width: 1300px;
    margin: auto;
}

@media (min-width: 800px) {
    .demo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1150px) {
    .demo {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* =========================================================
   SCREEN
   ========================================================= */

.screen {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;

    background: var(--panel);
    border: 1px solid var(--dark);
    border-radius: 16px;
    overflow: hidden;

    min-height: 720px;
}

.screen-body {
    padding: 16px;
}

.stack {
    display: grid;
    gap: var(--gap);
}


/* =========================================================
   APP HEADER
   ========================================================= */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
   padding: 10px 16px 14px;
    color: white;
background: #232d43;
    background-image: none;
  background-image: radial-gradient(ellipse at 105% -15%, rgba(61, 147, 232, .18), transparent 55%);
}

.brand {
    font-size: 1.45rem;
    font-weight: 800;
}

.brand em {
    color: var(--primary);
    font-style: italic;
}

.icon-button {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    border: 0;
    background: transparent;
    color: inherit;

    font-size: 1.3rem;
}


/* =========================================================
   HERO / PAGE HEADING
   ========================================================= */

.hero {
    padding: 20px 16px;
    color: white;
    background: var(--dark);
	background:
        linear-gradient(to right, rgba(18, 26, 42,.69), rgba(18, 26, 42,.25)),
        url("../img/hero.jpg") center / cover no-repeat;
}
}

.hero-small {
    padding-block: 14px;
}

.herox h1 {margin: 0 0 0.25em;}
.hero h2 {
    margin: 0.75em 0 0.25em;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 2em;

    font-size: .85rem;
    opacity: .85;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.tabs {
    display: flex;
    overflow-x: auto;

    border-bottom: 1px solid var(--line);
    background: white;
}

.tabs a {
    flex: 1 0 auto;
    padding: 13px 14px;

    text-align: center;
    text-decoration: none;

    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;

    border-bottom: 3px solid transparent;
}

.tabs a.active {
    color: var(--text);
    border-color: var(--primary);
}


/* =========================================================
   GENERIC CARDS
   ========================================================= */

.card {
    padding: 14px;

    border: 1px solid var(--line);
    border-radius: var(--radius);

    background: white;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 10px;
}

.card-header h2,
.card-header h3 {
    margin: 0;
}


/* =========================================================
   STATUS
   ========================================================= */

.status {
    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    border-radius: 999px;

    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;

    background: var(--soft);
	color: var(--dark);
}

.status.live,
.status.finished {
    color: white;
    background: var(--success);
}

.status.pending {
    color: var(--muted);
}


/* =========================================================
   RACE / EVENT LIST
   ========================================================= */

.event-list {
    display: grid;
    gap: 10px;
}

.event-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;

    padding: 14px;

    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.event-card:nth-child(4n + 1) { --icon: #22c55e; --icon-bg: #dcfce7; }
.event-card:nth-child(4n + 2) { --icon: #3b82f6; --icon-bg: #dbeafe; }
.event-card:nth-child(4n + 3) { --icon: #f59e0b; --icon-bg: #fef3c7; }
.event-card:nth-child(4n + 4) { --icon: #a855f7; --icon-bg: #f3e8ff; }

.event-icon {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    border-radius: 50%;


    font-size: 1.4rem;

    color: var(--icon);
    background: var(--icon-bg);
	border: 0px solid #121a2a14;
}

h1 a, a.eventLink {text-decoration: none;}
.event-main h3 {

	margin: 0 0 3px;

}

.event-main p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
}

.event-progress {
    grid-column: 2 / -1;
}

.progress {
    height: 6px;
    overflow: hidden;

    border-radius: 999px;
    background: var(--line);
}

.progress span {
    display: block;
    height: 100%;
    background: var(--success);
}

.progressBar{transition: width ease-in-out 1s;}

.event-stats {
    display: flex;
    gap: 12px;

    margin-top: 7px;

    color: var(--muted);
    font-size: .72rem;
}


/* =========================================================
   SUMMARY STAT CARDS
   ========================================================= */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat {
    padding: 10px 5px;

    text-align: center;

    border-radius: 9px;
    background: var(--soft);
}

.stat strong {
    display: block;
    font-size: 1.05rem;
}

.stat span {
    color: var(--muted);
    font-size: .7rem;
}


/* =========================================================
   SEARCH / FILTERS
   ========================================================= */

.search {
    display: flex;
    gap: 8px;
}

.search input {
    min-width: 0;
    flex: 1;

    padding: 11px 13px;

    border: 1px solid var(--line);
    border-radius: 9px;

    font: inherit;
}

.filters {
    display: flex;
    gap: 7px;
    overflow-x: auto;
}

.filter {
    flex: 0 0 auto;

    padding: 8px 12px;

    border: 0;
    border-radius: 999px;

    background: var(--soft);
    color: var(--muted);

    font-size: .75rem;
}

.filter.active {
    color: white;
    background: var(--primary);
}


/* =========================================================
   RESULTS LIST

   Visually spreadsheet-like without actually needing <table>.
   ========================================================= */

.results {
    margin: 0;
    padding: 0;
    list-style: none;

    border-top: 1px solid var(--line);
}


.result-row {
    display: grid;
    grid-template-columns: 32px 52px minmax(100px, 1fr) auto auto auto;
    gap: 7px;
    align-items: center;

    min-height: 44px;

    border-bottom: 1px solid var(--line);

    font-size: .82rem;

}

.result-row.header {
    min-height: 34px;

    color: var(--muted);
    background: var(--soft);

    font-size: .65rem;
    text-transform: uppercase;
}

.result-position {
    text-align: center;
    font-weight: 700;
}

.result-bib {
    color: var(--muted);
}

.result-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.result-time {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.result-status {
    text-align: right;
}

.result-row .favorite{font-size:1rem;}


/* Narrow phones */

@media (max-width: 380px) {
    .result-row {
        grid-template-columns: 28px 42px minmax(90px, 1fr) auto;
    }

    .result-status {
        display: none;
    }
}


/* =========================================================
   ATHLETE
   ========================================================= */

.athlete-heading {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    align-items: start;
}

.bib {
    min-width: 55px;
    padding: 8px;

    text-align: center;
    font-weight: 700;

    border-radius: 7px;
    background: var(--soft);
}



.athlete-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: .8rem;
}

.big-result {
    margin: 16px 0;
    padding: 16px;

    text-align: center;

    border-radius: var(--radius);
    background: var(--soft);
}

.big-result strong {
    display: block;
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
}

.placing {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
    color: var(--muted);

}


/* =========================================================
   SPLITS
   ========================================================= */

.split-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.split {
    position: relative;

    display: grid;
    grid-template-columns: repeat(7,1fr);
    gap: 10px;
    padding: 10px 0 10px 24px;
    border-bottom: 1px solid var(--line);
font-size: 13px;
  text-align: center;

}

.split::before {
    content: "";

    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;

    width: 2px;
    background: var(--success);
}

.split::after {
    content: "";

    position: absolute;
    left: 1px;
    top: 16px;

    width: 8px;
    height: 8px;

    border-radius: 50%;
    background: var(--success);
}

.split:first-child::before {
    top: 18px;
}

.split:last-child::before {
    bottom: calc(100% - 18px);
}

.split strong {
    font-weight: 600;
}

.split span {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
font-size: 15px;
  font-weight: 500;
}


/* =========================================================
   FAKE CHART

   Replace with canvas/svg later if required.
   ========================================================= */

.chart {
    position: relative;

    height: 150px;
    margin-top: 15px;

    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);

    background:
        linear-gradient(to right, transparent 24%, var(--line) 25%, transparent 26%),
        linear-gradient(to bottom, transparent 24%, var(--line) 25%, transparent 26%);
    background-size: 25% 25%;
}

.chart-line {
    position: absolute;
    inset: 15px 10px 10px;

    clip-path: polygon(
        0 92%,
        18% 73%,
        34% 59%,
        52% 48%,
        70% 32%,
        84% 22%,
        100% 5%,
        100% 9%,
        84% 26%,
        70% 36%,
        52% 52%,
        34% 63%,
        18% 77%,
        0 96%
    );

    background: var(--primary);
}


/* =========================================================
   LIVE FEED
   ========================================================= */

.live-indicator {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 15px;
}

.live-dot {
    width: 14px;
    height: 14px;

    border-radius: 50%;
    background: var(--primary);

    box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 15%, transparent);
}

.live-indicator strong {
    display: block;
}

.live-indicator small {
    color: var(--muted);
}

.feed {
    display: grid;
    gap: 9px;
}

.feed-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 10px;
    align-items: center;

    padding: 11px;

    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.feed-time {
    color: var(--muted);
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
}

.feed-athlete strong {
    display: block;
}

.feed-athlete small {
    color: var(--muted);
}


/* =========================================================
   SPLIT LEADERBOARD
   ========================================================= */

.split-select {
    display: flex;
    gap: 7px;

    overflow-x: auto;

    margin-bottom: 12px;
}

.split-select button {
    min-width: 48px;

    padding: 8px;

    border: 0;
    border-radius: 8px;

    background: var(--soft);
}

.split-select button.active {
    color: white;
    background: var(--primary);
}


/* =========================================================
   EVENT INFO
   ========================================================= */

.info-list {
    margin: 0;
}

.info-row {
    display: grid;
    grid-template-columns: 26px 95px 1fr;
    gap: 10px;

    padding: 12px 0;

    border-bottom: 1px solid var(--line);
}

.info-row dt,
.info-row dd {
    margin: 0;
}

.info-row dt {
    color: var(--muted);
    font-size: .8rem;
}

.info-row dd {
    font-size: .82rem;
}


/* =========================================================
   BUTTON
   ========================================================= */

.button {
    display: block;

    padding: 12px 16px;

    text-align: center;
    text-decoration: none;

    color: white;
    background: var(--primary);

    border-radius: 9px;

    font-weight: 600;
}

/* LIVE SHEEN */
.status.live{
    position: relative;
    overflow: hidden;
}

.status.live::after {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        110deg,
        transparent 25%,
        rgba(255,255,255,.45) 45%,
        transparent 65%
    );

    transform: translateX(-120%);
    animation: live-sheen 2.5s ease-in-out infinite;
}

@keyframes live-sheen {
    0%, 55% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(120%);
    }
}

/*  fake spin squish */
@keyframes flatSpin {
	0%, 100% { transform: scaleX(1); }
	50%      { transform: scaleX(0.05); }

}

@keyframes flatSpinRotate {
	0%, 100% { transform: scaleX(1);transform:rotateY(0); }
	25%      { transform: scaleX(0.05); }
	50%      { transform: scaleX(1); transform:rotateY(180deg);}
	75%      { transform: scaleX(0.05); }
}

.spin-flat {
	animation: flatSpin 1s ease-in-out 1;
	animation-delay: 10s;
}

/* heartbeat */
.live-heartbeat {
    position: relative;

    width: 7px;
    height: 7px;

    margin-right: 5px;

    border-radius: 50%;
    background: currentColor;
}

.live-heartbeat::after {
    content: "";

    position: absolute;
    inset: 0;

    border: 2px solid currentColor;
    border-radius: 50%;

    opacity: 0;
}

.live-heartbeat.tick::after {
    animation: data-tick .5s ease-out 5;
}

@keyframes data-tick {
    from {
        transform: scale(1);
        opacity: .8;
    }

    to {
        transform: scale(3);
        opacity: 0;
    }
}


.live-heartbeat.connected {
    color: #35c86f;
}

.live-heartbeat.connecting {
    color: #e5a82d;
}

.live-heartbeat.disconnected {
    color: #d95757;
}


/* live flash */

@keyframes live-flash {
    0%   { opacity:0; transform:rotateY(180deg);}
    25%  {   }
    100% { opacity:1;transform:rotateY(0);}
}

@keyframes live-fade-in {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);

    }
}

.live-flash {
    animation: live-flash 2s ease-out;
}

.live-fade-in {
    animation: live-fade-in 0.9s ease-out;
}

/* flip */
.flip-container {
    perspective: 500px;
}

.flip-out {
    animation: flip-out .6s ease-in forwards;
}

.flip-in-start {
    transform: rotateX(-90deg);
}

.flip-in {
    animation: flip-in .3s ease-out forwards;
}

@keyframes flip-out {
    from {
        transform: rotateX(0deg);
    }

    to {
        transform: rotateX(-270deg);
		opacity:0.2
    }
}

@keyframes flip-in {
    from {
        transform: rotateX(-270deg);
    }

    to {
        transform: rotateX(-360deg);
		opacity:1
    }
}

#qrcode {max-width: 250px;margin: 0 auto;}

.favorite{cursor:pointer;}
.favorite.active {font-weight:bold;color:#f00;}

#share {max-width:250px;text-align:center;display:flex;margin: 2rem auto 0;  padding: 0;justify-content: space-evenly;}

.material-symbols-outlined{vertical-align:text-top;}

.screen-body h2 {margin: 0 0 1em 0;
  padding: 0.5em;
  color: #bc5509;
border-bottom: 2px solid #bc55091c;
}}

/* preview stuff */


.preview-item:nth-child(4n + 1) { --icon: #22c55e; --icon-bg: #dcfce7; }
.preview-item:nth-child(4n + 2) { --icon: #3b82f6; --icon-bg: #dbeafe; }
.preview-item:nth-child(4n + 3) { --icon: #f59e0b; --icon-bg: #fef3c7; }
.preview-item:nth-child(4n + 4) { --icon: #a855f7; --icon-bg: #f3e8ff; }

.preview-item {
display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5em;
	align-items: center;
  padding: 0.75em;
  border: 1px solid var(--line);
border-radius: var(--radius);
margin-bottom:1em;}

.preview-item .icon {

    width: 44px;
    height: 44px;

    border-radius: 50%;

    font-size: 1.4rem;

    color: var(--icon);
    background: var(--icon-bg);
	border: 0px solid #121a2a14;

    display: grid;
    place-items: center;
}

.screen-body + .screen-body {margin-top:0;padding-top: 0;}
.search + .previews {margin-top:2em;}


a.live-status {text-decoration:none;}

    /* ========== LIVE STATUS ========== */
    .appStatus {

      color: var(--status-ink);

      max-width: 720px;
      margin-inline: auto;
      box-sizing: border-box;
    }
    .appStatus *, .appStatus *::before, .appStatus *::after { box-sizing: border-box; }
    .appStatus[data-health="ok"] { --health: #40db96; --health-wash: rgba(64, 219, 150, .15); }
    .appStatus[data-health="warning"] { --health: #ffcb6a; --health-wash: rgba(255, 203, 106, .13); }
    .appStatus[data-health="error"] { --health: #ff7b82; --health-wash: rgba(255, 123, 130, .14); }
    .appStatus .material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 350, 'GRAD' 0, 'opsz' 24; }

    .status-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
    .status-heading-icon { color: var(--status-blue); font-size: 30px; }
    h1 { margin: 0; font-size: clamp(27px, 5vw, 37px); font-weight: 740; line-height: 1.15; letter-spacing: -.035em; }
	.hero h1{margin: 0.25em 0 1em 0;}
    .status-heading p { margin: 4px 0 0; color: var(--status-muted); font-size: 13px; }

    .status-hero {
      position: relative; overflow: hidden;
      background: #232d43;
      background-image: radial-gradient(ellipse at 105% -15%, rgba(61, 147, 232, .18), transparent 55%);
      border-radius: 21px; padding: 21px 22px 17px; color: #fff;
      box-shadow: 0 13px 25px rgba(26, 42, 68, .12);
    }
     .status-hero-top, .appStatus .status-hero-foot, .appStatus .status-activity-head {
      display: flex; justify-content: space-between; align-items: center; gap: 12px;
    }
     .status-eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .13em; color: #a9b9d1; }
     .status-signal {
      display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px;
      border: 1px solid rgba(255,255,255,.12); border-radius: 20px;
      color: #cbd8eb; font-size: 10px; font-weight: 750; letter-spacing: .055em;
    }
    .status-signal-dot {
      height: 7px; width: 7px; border-radius: 50%; background: var(--health);
      box-shadow: 0 0 0 4px var(--health-wash); flex: 0 0 auto;
    }
    .appStatus[data-health="ok"] .status-signal-dot { animation: status-breathe 2.5s ease-in-out infinite; }
    @keyframes status-breathe { 50% { box-shadow: 0 0 0 7px transparent; } }
    .status-hero-main { display: flex; align-items: center; gap: 15px; margin: 24px 0 22px; }
    .status-health-icon {
      display: grid; place-items: center; height: 63px; width: 63px; flex: 0 0 63px;
      border-radius: 18px; background: var(--health-wash); color: var(--health);
      border: 1px solid rgba(255,255,255,.07);
    }
    .appStatus .status-health-icon .material-symbols-outlined { font-size: 35px; }
     .status-current-state {
      color: white; font-weight: 750; font-size: clamp(27px, 5.5vw, 36px);
      letter-spacing: -.04em; line-height: 1.1; text-transform: capitalize;
    }
    .status-hero-main p { margin: 6px 0 0; color: #acbfd8; font-size: 13px; }
    .status-activity-head { color: #aebed4; font-size: 11px; margin-bottom: 8px; }
    .status-activity-slot {
      min-height: 91px;
      border: 1px solid rgba(255,255,255,.075); border-radius: 11px;
      background: rgba(10, 21, 39, .35);
      overflow: hidden;
      /* Intentionally empty. Add your own graph/live component here. */
    }
    .status-hero-foot {
      border-top: 1px solid rgba(255,255,255,.10);
      margin-top: 15px; padding-top: 13px; font-size: 11px; color: #aebed4;
    }
     .status-hero-foot strong { color: #edf4ff; font-weight: 650; }

     .status-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 15px 0 23px; }
    .status-metric {
      background: white; border: 1px solid var(--status-line); border-radius: 17px;
      padding: 17px; min-width: 0; box-shadow: 0 3px 10px rgba(28, 43, 67, .025);
    }
    .appStatus .status-metric-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
    .appStatus .status-metric-label { color: var(--status-muted); font-size: 12px; font-weight: 550; }
    .appStatus .status-metric-icon { font-size: 20px; color: #7eaad5; }
    .appStatus .status-metric-value {
      display: block; font-size: clamp(25px, 6vw, 35px); line-height: 1.15;
      letter-spacing: -.045em; font-weight: 760; margin-top: 13px;
      font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
    }
    .appStatus .status-metric-hint { color: #8390a3; font-size: 11px; margin-top: 6px; }

    .appStatus .status-section-title {
      display: flex; justify-content: space-between; align-items: center;
      margin: 0 0 11px; gap: 10px;
    }
    .appStatus .status-section-title h2 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
    .appStatus .status-section-title > span { color: #8190a2; font-size: 11px; }
    .appStatus .status-services {
      background: white; border: 1px solid var(--status-line); border-radius: 17px;
      padding: 3px 17px; margin-bottom: 22px;
    }
    .appStatus .status-service { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 62px; }
    .appStatus .status-service + .status-service { border-top: 1px solid #eef1f6; }
    .appStatus .status-service-name { display: flex; align-items: center; gap: 11px; min-width: 0; font-size: 13px; font-weight: 650; }
    .appStatus .status-service-symbol { display: grid; place-items: center; color: #478dbf; background: #edf5fe; border-radius: 10px; height: 34px; width: 34px; }
    .appStatus .status-service-symbol .material-symbols-outlined { font-size: 20px; }
    .appStatus .status-service-result { display: flex; align-items: center; gap: 5px; color: #387b5e; font-size: 12px; font-weight: 650; text-transform: capitalize; }
    .appStatus .status-service-result .material-symbols-outlined { font-size: 20px; }
    .appStatus .status-tech { border-top: 1px solid #eef1f6; }
    .appStatus .status-tech summary { cursor: pointer; list-style: none; padding: 15px 0; color: #52779e; font-size: 12px; font-weight: 650; display: flex; align-items: center; justify-content: space-between; }
    .appStatus .status-tech summary::-webkit-details-marker { display: none; }
    .appStatus .status-tech summary .material-symbols-outlined { transition: transform .18s; font-size: 19px; }
    .appStatus .status-tech[open] summary .material-symbols-outlined { transform: rotate(180deg); }
    .appStatus .status-tech dl { margin: 0 0 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; font-size: 12px; }
    .appStatus .status-tech dt { color: var(--status-muted); }
    .appStatus .status-tech dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

    .appStatus .status-share {
      display: flex; align-items: center; gap: 17px; background: #e8f0fa;
      border: 1px solid #dbe7f5; border-radius: 17px; padding: 17px;
    }
    .appStatus .status-share-qr {
      place-items: center;
      background: #fff; border-radius: 10px; overflow: hidden;
    }
    .appStatus .status-share-qr svg, .appStatus .status-share-qr img,
    .appStatus .status-share-qr canvas { display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
    .appStatus .status-share-qr > .material-symbols-outlined { font-size: 57px; color: #a7bdd3; }
    .appStatus .status-share-info { min-width: 0; }
    .appStatus .status-share-info h2 { margin: 0 0 5px; font-size: 15px; line-height: 1.2; }
    .appStatus .status-share-info p { margin: 0 0 12px; color: #66798f; font-size: 12px; line-height: 1.45; }
    .appStatus .status-share-button {
      appearance: none; cursor: pointer; border: 0; border-radius: 9px; padding: 10px 13px;
      background: #247dc7; color: #fff; font: inherit; font-size: 12px; font-weight: 750;
      display: inline-flex; align-items: center; justify-content: center; gap: 7px;
      transition: background .15s, transform .15s;
    }
    .appStatus .status-share-button:hover { background: #176aae; }
    .appStatus .status-share-button:active { transform: scale(.98); }
    .appStatus .status-share-button:focus-visible, .appStatus .status-tech summary:focus-visible { outline: 3px solid #80b9f3; outline-offset: 3px; }
    .appStatus .status-share-button .material-symbols-outlined { font-size: 18px; }
    @media (max-width: 370px) {
      .appStatus .status-hero { padding: 18px; }
      .appStatus .status-metric { padding: 13px; }
      .appStatus .status-share { gap: 12px; padding: 12px; }
      .appStatus .status-share-qr { width: 88px; height: 88px; flex-basis: 88px; }
    }
    @media (prefers-reduced-motion: reduce) {
      .appStatus .status-signal-dot { animation: none !important; }
      .appStatus .status-share-button, .appStatus .status-tech summary .material-symbols-outlined { transition: none; }
    }
    /* ========== END LIVE STATUS STYLES ========== */

    .preview-logo { font-weight: 900; font-style: italic; font-size: 32px; letter-spacing: -.08em; position: relative;}
    .preview-logo small { color: #4ab2f5; font-size: 13px; font-weight: 600; font-style: italic; letter-spacing: 0; margin-left: 7px; position: relative; top: -0.5em;}

	.app-header a {text-decoration:none;}

/*** results stuff ***/

	.mainTrophy{text-align: center;
  width: 100%;
	font-size: 3em;margin-top: 6px;}

	.position-1{color:gold;}
	.position-2{color:silver;}
	.position-3{color:brown;}


.result-card {
    background: #222b3d;
	background: linear-gradient(to bottom, #222b3d, #222b3dd1);
    color: #fff;
    border-radius: 18px;
    padding: 24px;
    margin: 24px 0;
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #a9bbd1;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-trophy {
    display: none;
    color: #facc15;
    font-size: 28px;
}

.result-card-time {
    text-align: center;
    font-size: clamp(42px, 10vw, 64px);
    font-weight: 800;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    margin: 12px 0 24px;
    line-height: 1.1;
}

.result-card-positions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.result-card-positions > div {
    background: #354056;
    border-radius: 8px;
    padding: 12px 4px;
    text-align: center;
    min-width: 0;
}

.result-card-positions strong {
    display: block;
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.result-card-positions span {
    display: block;
    margin-top: 4px;
    color: #d5dce8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.result-card-message {
    display: none;
    text-align: center;
    margin-top: 18px;
    color: #e6d59b;
    font-size: 14px;
}

/* Podium finishers */
.result-card--podium .result-trophy,
.result-card--podium .result-card-message {
    display: block;
}

.result-card--podium .result-card-positions strong {
    color: #facc15;
}


/** splits **/

/* Timeline wrapper */
.splits-list {
    --split-gap: 12px;
    --split-green: #25b665;

    display: grid;
    gap: var(--split-gap);
    padding-left: 30px;
}

/* Individual checkpoint card */
.split-box {
    position: relative;
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
    background: #f2f4f7;
    color: #19212d;
}

/* Timeline dots */
.split-box::before {
    content: "";
    position: absolute;
    z-index: 1;
    left: -26px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--split-green);
}

/* Timeline connecting lines */
.split-box:not(:last-child)::after {
    content: "";
    position: absolute;
    left: -21px;
    top: 26px;
    width: 2px;
    height: calc(100% + var(--split-gap));
    background: var(--split-green);
}

/* Checkpoint name and total time */
.split-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.split-name {
    font-size: 17px;
    font-weight: 750;
}

.split-total {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.split-total small {
    color: #8491a2;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
}

.split-total strong {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.5px;
    font-variant-numeric: tabular-nums;
}

/* Recorded and split times */
.split-details {
    display: flex;
    gap: 24px;
    margin: 8px 0 12px;
    font-size: 12px;
	justify-content: space-between;
}

.split-details > div {
    display: flex;
    gap: 6px;
}

.split-details span {
    color: #8491a2;
}

.split-details strong {
    color: #536276;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Position tiles */
.split-positions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.split-positions > div {
    min-width: 0;
    padding: 8px 4px;
    border-radius: 8px;
    background: #e4e9f0;
    text-align: center;
}

.split-positions strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.split-positions span {
    display: block;
    margin-top: 2px;
    color: #68778a;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Narrow screens */
@media (max-width: 380px) {
    .split-box {
        padding: 11px;
    }

    .split-details {
        gap: 12px;
        flex-wrap: wrap;
    }

    .split-positions {
        gap: 5px;
    }

    .split-positions strong {
        font-size: 16px;
    }

    .split-positions span {
        font-size: 9px;
    }
}


/*** index ***/

/* Optional wrapper around all race cards */
.race-list {
    display: grid;
    gap: 12px;
}

/* Race card */
.race-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 20px;
    background: #fff;
    border: 1px solid #e1e6ed;
    border-radius: 16px;

    transition: border-color .2s, box-shadow .2s,
                transform .2s;

	margin: 1em;
}

.race-link:hover {
    border-color: #bdcbdc;
    box-shadow: 0 5px 20px rgba(34, 43, 61, .09);
    transform: translateY(-2px);
}

.race-link-content {
    flex: 1;
    min-width: 0;
}

/* Title */
.race-title-link {
    display: block;
    color: #19212d;
    font-size: clamp(19px, 4vw, 24px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.5px;
    text-decoration: none;
}

/* Stretch the title link over the entire card */
.race-title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.race-title-link:focus-visible {
    outline: none;
}

.race-title-link:focus-visible::after {
    outline: 3px solid #2584cc;
    outline-offset: 3px;
}

/* Date */
.race-date {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 10px;
    color: #748196;
    font-size: 13px;
    line-height: 1.5;
}

.race-date .material-symbols-outlined {
    font-size: 18px;
    flex-shrink: 0;
}

/* Arrow */
.race-arrow {
    display: grid;
    place-items: center;
    flex-shrink: 0;

    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f0f3f7;
    color: #334155;
    font-size: 21px;

    transition: background .2s,
                color .2s, transform .2s;
}

.race-link:hover .race-arrow {
    background: #222b3d;
    color: #fff;
    transform: translateX(3px);
}

@media (max-width: 480px) {
    .race-link {
        padding: 16px;
    }

    .race-arrow {
        width: 32px;
        height: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .race-link, .race-arrow {
        transition: none;
    }
}



/** result card background **/
.result-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

/* Two independently moving pools of light */
.result-card::before,
.result-card::after {
    content: "";
    position: absolute;
    inset: -50%;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
}

.result-card::before {
    background:
        radial-gradient(
            ellipse at 30% 65%,
            rgba(130, 165, 220, .20),
            transparent 45%
        ),
        radial-gradient(
            ellipse at 75% 35%,
            rgba(180, 150, 230, .12),
            transparent 40%
        );

    animation: glowRotate 5s infinite;
}

.result-card::after {
    background:
        radial-gradient(
            ellipse at 65% 70%,
            rgba(255, 200, 80, .11),
            transparent 40%
        );

    animation: glowRotate 10s infinite reverse;
}

/* Keep card content above the gradients */
.result-card > * {
    position: relative;
    z-index: 1;
}

@keyframes glowRotate {
    0% {
        transform: rotate(0deg);
        animation-timing-function: ease-in-out;
    }
    25% {
        transform: rotate(35deg);
        animation-timing-function: ease-in-out;
    }
    55% {
        transform: rotate(215deg);
        animation-timing-function: ease-in-out;
    }
    80% {
        transform: rotate(300deg);
        animation-timing-function: ease-in-out;
    }
    100% {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .result-card::before,
    .result-card::after {
        animation: none;
    }
}


.flipped {
    scale: -1 1;
}

/** notif **/
.notification {
    position: relative;
    display: inline-block;
}

.notification-count {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);

    background: #ff3b30;
    color: white;
    border-radius: 999px;

    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    font: bold 11px Arial, sans-serif;
    line-height: 1;
    white-space: nowrap;
    border: 2px solid white;
	opacity:0;
}

.notification-count[hidden] {
    display: none;
}

.notification-count.pop {
    animation: badgePop 0.3s ease-out;
	opacity:1
}

@keyframes badgePop {
    0%   { transform: translate(50%, -50%) scale(0.5); opacity:0}
    65%  { transform: translate(50%, -50%) scale(1.2); opacity:1}
    100% { transform: translate(50%, -50%) scale(1);  }
}