/* ===========================================================================
   Ninja Run Finder - editorial-athletic, light & premium
   Type: Archivo (display) · Hanken Grotesk (body) · Space Mono (timestamps)
   =========================================================================== */
:root {
  --paper:   #f6f7f9;
  --paper-2: #ffffff;
  --ink:     #0b1220;
  --ink-2:   #3a4660;
  --muted:   #7a85a0;
  --hair:    #e6e9f0;
  --hair-2:  #eef0f5;
  --blue:    #1b4dff;   /* primary accent */
  --blue-ink:#0b2bb5;
  --volt:    #1fd17a;   /* live / spark */
  --shadow:  0 1px 2px rgba(13,22,46,.04), 0 8px 24px rgba(13,22,46,.06);
  --shadow-lift: 0 2px 6px rgba(13,22,46,.06), 0 16px 40px rgba(13,22,46,.12);
  --top: env(safe-area-inset-top, 0px);
  --r: 16px;
  --topbar-h: 52px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(27,77,255,.05), transparent 60%),
    radial-gradient(90% 50% at 0% 0%, rgba(31,209,122,.05), transparent 55%),
    var(--paper);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--blue); color: #fff; }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  /* full-width bar, but content aligned to the same 760px column as everything below */
  padding: calc(10px + var(--top)) max(20px, calc((100% - 760px) / 2 + 20px)) 10px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px 12px;
  background: rgba(246,247,249,.92);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--hair);
}
.brand { order: 1; }
.topbar .menu-btn { order: 2; margin-left: auto; }
.hsearch { order: 3; flex-basis: 100%; position: relative; display: flex; align-items: center; }
.hsearch .field-icon { position: absolute; left: 14px; width: 18px; height: 18px; pointer-events: none;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.hsearch #q {
  width: 100%; height: 44px; padding: 0 42px; font-size: 1rem; font-weight: 500;
  font-family: "Hanken Grotesk", sans-serif; color: var(--ink);
  background: var(--paper-2); border: 1.5px solid var(--hair); border-radius: 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.hsearch #q::placeholder { color: #9aa3ba; }
.hsearch #q::-webkit-search-cancel-button { display: none; }
.hsearch #q:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,77,255,.14); }
.hsearch .field-clear { position: absolute; right: 8px; width: 30px; height: 30px; border: 0; cursor: pointer;
  border-radius: 50%; background: var(--hair-2); color: var(--ink-2); display: grid; place-items: center; }
.hsearch .field-clear[hidden] { display: none; }
.hsearch .field-clear svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (min-width: 640px) {
  .hsearch { order: 2; flex: 1 1 auto; flex-basis: auto; max-width: 560px; margin: 0 6px; }
  .topbar .menu-btn { order: 3; margin-left: 0; }
}
.subbar { max-width: 760px; margin: 0 auto; padding: 10px 20px 0; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; flex: none; display: block;
  filter: drop-shadow(0 2px 6px rgba(27,77,255,.35)); }
.brand-glyph {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, var(--blue), #4f74ff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 2px 8px rgba(27,77,255,.35);
  position: relative;
}
.brand-glyph::after {
  content: ""; position: absolute; inset: 6px 5px;
  background: #fff; clip-path: polygon(0 50%, 100% 0, 100% 100%); /* play/shuriken wedge */
  opacity: .92;
}
.brand-text {
  font-family: "Archivo", sans-serif; font-weight: 600; font-size: .98rem;
  letter-spacing: -.02em; line-height: 1;
}
.brand-text em { font-style: normal; font-weight: 800; color: var(--blue); }
.season {
  font-family: "Space Mono", monospace; font-size: .68rem; letter-spacing: .04em;
  color: var(--ink-2); border: 1px solid var(--hair); border-radius: 999px;
  padding: 4px 9px; background: var(--paper-2);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-btn {
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  width: 38px; height: 38px; padding: 0; border: 1px solid var(--hair); border-radius: 10px;
  background: var(--paper-2); cursor: pointer;
}
.menu-btn span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.menu {
  position: fixed; top: calc(var(--topbar-h) + var(--top) + 6px); right: 14px; z-index: 50;
  width: 240px; background: var(--paper-2); border: 1px solid var(--hair); border-radius: 14px;
  box-shadow: var(--shadow-lift); padding: 6px; display: flex; flex-direction: column; gap: 2px;
  animation: menupop .14s ease;
}
.menu[hidden] { display: none !important; }
@keyframes menupop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; text-decoration: none;
  cursor: pointer; font-family: "Hanken Grotesk", sans-serif; font-size: .96rem; font-weight: 600;
  color: var(--ink); background: none; border: 0; padding: 12px 12px; border-radius: 9px;
}
.menu-item:hover { background: var(--hair-2); }
.menu-item.accent { color: var(--blue); }

/* ---- Hero --------------------------------------------------------------- */
.hero { max-width: 720px; margin: 0 auto; padding: 30px 20px 6px; }
.lead {
  font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: -.035em;
  font-size: clamp(2rem, 9vw, 3.2rem); line-height: .98; margin: 0;
}
.lead-sub { color: var(--ink-2); margin: 10px 0 0; font-size: clamp(.95rem, 3.6vw, 1.05rem); max-width: 52ch; }

/* ---- Search (sticky under topbar) --------------------------------------- */
.search {
  position: sticky; top: calc(var(--topbar-h) + var(--top)); z-index: 20;
  max-width: 720px; margin: 18px auto 0; padding: 10px 20px 14px;
  background: linear-gradient(180deg, var(--paper) 72%, rgba(246,247,249,0));
}
.field { position: relative; display: flex; align-items: center; }
.field-icon {
  position: absolute; left: 16px; width: 20px; height: 20px; pointer-events: none;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
#q {
  width: 100%; height: 58px; padding: 0 52px; font-size: 1.1rem; font-weight: 500;
  font-family: "Hanken Grotesk", sans-serif; color: var(--ink);
  background: var(--paper-2); border: 1.5px solid var(--hair);
  border-radius: 14px; outline: none; box-shadow: var(--shadow);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
#q::placeholder { color: #9aa3ba; font-weight: 500; }
#q::-webkit-search-cancel-button { display: none; }
#q:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(27,77,255,.14), var(--shadow); }
.field-clear {
  position: absolute; right: 10px; width: 34px; height: 34px; border: 0; cursor: pointer;
  border-radius: 50%; background: var(--hair-2); color: var(--ink-2);
  display: grid; place-items: center;
}
.field-clear[hidden] { display: none; }
.field-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.metarow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 0 2px; }
.count { font-size: .8rem; color: var(--muted); font-weight: 500; min-width: 0; }
.meta-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.linkbtn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer;
  font-family: "Hanken Grotesk", sans-serif; font-size: .78rem; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--hair); background: var(--paper-2);
  padding: 6px 12px; border-radius: 999px; transition: border-color .15s, color .15s, background .15s;
}
.linkbtn:active { border-color: var(--blue); color: var(--blue); }
.linkbtn.accent { color: #fff; background: var(--blue); border-color: var(--blue); }
.linkbtn.accent:active { filter: brightness(.95); color: #fff; }
@media (hover: hover) { .linkbtn:hover { border-color: var(--blue); color: var(--blue); }
  .linkbtn.accent:hover { color: #fff; background: var(--blue-ink); } }

/* Modal (submit / status) */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(8,12,24,.5); backdrop-filter: blur(3px); padding: 16px; animation: fade .15s ease; }
.modal[hidden] { display: none !important; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { position: relative; width: 100%; max-width: 560px; max-height: 86vh; overflow: auto;
  background: var(--paper-2); border: 1px solid var(--hair); border-radius: 18px;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lift);
  animation: slideup .22s cubic-bezier(.2,.7,.2,1); }
@media (max-width: 560px) { .modal { place-items: end center; padding: 0; }
  .modal-card { border-radius: 18px 18px 0 0; } }
@keyframes slideup { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0;
  border-radius: 50%; background: var(--hair-2); color: var(--ink-2); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.modal h3 { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.25rem; margin: 0 0 4px; letter-spacing: -.02em; }
.modal p.lead-note { color: var(--muted); font-size: .88rem; margin: 0 0 14px; }
.submit-form { display: flex; flex-direction: column; gap: 9px; }
.submit-form input { height: 50px; padding: 0 14px; font-size: 1rem; border-radius: 11px;
  border: 1.5px solid var(--hair); background: var(--paper); color: var(--ink); outline: none;
  font-family: "Hanken Grotesk", sans-serif; }
.submit-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,77,255,.14); }
.submit-form button { height: 50px; margin-top: 2px; border: 0; border-radius: 11px;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
  font-family: "Archivo", sans-serif; letter-spacing: -.01em; }
.submit-form button:active { filter: brightness(.95); }
.submit-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.submit-done { text-align: center; padding: 6px 4px 2px; }
.done-check { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px;
  background: rgba(31,209,122,.15); color: #137a43; font-size: 1.9rem; font-weight: 800;
  display: grid; place-items: center; }
.submit-msg { margin-top: 12px; font-size: .9rem; font-weight: 600; }
.submit-msg.ok { color: #137a43; } .submit-msg.err { color: #c0392b; }
.status-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.status-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--hair); border-radius: 11px; background: var(--paper); }
.status-item .si-title { font-weight: 600; font-size: .9rem; }
.status-item .si-sub { color: var(--muted); font-size: .76rem; font-family: "Space Mono", monospace; }
.sbadge { font-family: "Archivo", sans-serif; font-weight: 700; font-size: .62rem; text-transform: uppercase;
  letter-spacing: .05em; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.sbadge.done { color: #137a43; background: rgba(31,209,122,.13); }
.sbadge.pending { color: #9a6a00; background: rgba(246,183,60,.16); }
.sbadge.processing { color: var(--blue-ink); background: rgba(27,77,255,.1); }
.status-group-title { font-family: "Archivo", sans-serif; font-weight: 800; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 16px 0 2px; }

/* ---- Results ------------------------------------------------------------ */
.results { max-width: 760px; margin: 0 auto; padding: 4px 20px 48px; min-height: 80vh; }

/* Featured "live now" banner */
.livebar { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px;
  padding: 14px 16px; border-radius: 14px; color: #fff;
  background: linear-gradient(120deg, #0b1220, #18234a); box-shadow: var(--shadow); }
.livebar .live { display: inline-flex; align-items: center; gap: 7px; flex: none;
  font-family: "Archivo", sans-serif; font-weight: 800; font-size: .72rem; letter-spacing: .08em;
  color: #fff; background: #e11d48; padding: 5px 10px; border-radius: 999px; }
.livebar .live.recent { background: var(--blue); }
.livebar .live .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
.livebar .lb-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.livebar .lb-comp { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; }
.livebar .lb-meta { font-size: .76rem; color: rgba(255,255,255,.7); }

.card {
  background: var(--paper-2); border: 1px solid var(--hair); border-radius: var(--r);
  padding: 16px 16px 14px; margin: 12px 0; box-shadow: var(--shadow);
  animation: rise .26s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.name {
  font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: -.02em;
  font-size: 1.32rem; line-height: 1.08;
}
.name mark { background: transparent; color: var(--blue); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 55%; }
.divpill {
  font-family: "Archivo", sans-serif; font-weight: 700; font-size: .6rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--blue-ink); white-space: nowrap;
  background: rgba(27,77,255,.08); border: 1px solid rgba(27,77,255,.18);
  border-radius: 999px; padding: 4px 10px;
}
.sub { color: var(--muted); font-size: .85rem; margin-top: 3px; font-weight: 500; }

.divgroup { margin-top: 14px; }
.divname {
  display: flex; align-items: center; gap: 8px;
  font-family: "Archivo", sans-serif; font-weight: 700; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink);
  margin: 0 0 8px;
}
.divname::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--blue); }
.runs { display: grid; gap: 10px; grid-template-columns: minmax(0,1fr); }

.run {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  text-decoration: none; color: #fff; background: #0b1220;
  border-radius: 13px; border: 1px solid var(--hair);
  transition: transform .12s ease, box-shadow .16s ease;
}
@media (hover: hover) { .run:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); } }
.run:active { transform: scale(.99); }

.thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease; }
@media (hover: hover) { .run:hover .thumb-img { transform: scale(1.05); } }

.scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,12,24,.35) 0%, rgba(7,12,24,0) 32%,
              rgba(7,12,24,0) 46%, rgba(7,12,24,.55) 78%, rgba(7,12,24,.9) 100%); }

.rank {
  position: absolute; top: 9px; left: 9px; z-index: 3;
  font-family: "Space Mono", monospace; font-weight: 700; font-size: .72rem;
  color: #fff; background: rgba(11,18,32,.72); backdrop-filter: blur(3px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 3px 9px;
}
.rank.top { background: rgba(27,77,255,.92); border-color: rgba(255,255,255,.25); }
.rank.gold { background: linear-gradient(135deg, #ffd66b, #e8901a); color: #2a1800; border-color: rgba(255,255,255,.4); }

.dur {
  position: absolute; top: 9px; right: 9px; z-index: 3;
  font-family: "Space Mono", monospace; font-size: .7rem; color: #fff;
  background: rgba(11,18,32,.72); backdrop-filter: blur(3px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 3px 8px;
}

.playover { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; opacity: 0;
  transition: opacity .18s ease; }
.playover::before { content: ""; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(11,18,32,.55); backdrop-filter: blur(2px); position: absolute; }
@media (hover: hover) { .run:hover .playover { opacity: 1; } }
.playover .tri { position: relative; width: 0; height: 0; border-left: 16px solid #fff;
  border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 6px; }

.run-over { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 12px 13px; display: flex; flex-direction: column; gap: 1px; }
.run-title { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.05rem;
  letter-spacing: -.01em; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.run-sub { display: flex; align-items: center; gap: 8px; font-size: .76rem;
  color: rgba(255,255,255,.82); text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hits {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: "Space Mono", monospace; font-size: .66rem; color: #fff;
  background: rgba(11,18,32,.6); border-radius: 5px; padding: 2px 6px; white-space: nowrap;
}
.hits .eye { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---- Browse (landing: top runs per video) ------------------------------- */
.browse-intro { padding: 6px 2px 4px; }
.browse-hint { color: var(--ink-2); font-size: .92rem; margin: 0 0 10px; }
.browse-hint b { color: var(--blue); font-weight: 700; }
.browse-sec { margin: 18px 0 4px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 0 2px 10px; border-bottom: 1px solid var(--hair); margin-bottom: 12px; }
.sec-title { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.1rem;
  letter-spacing: -.02em; margin: 0; }
.sec-meta { font-family: "Space Mono", monospace; font-size: .68rem; color: var(--muted);
  text-align: right; white-space: nowrap; }

/* ---- About page --------------------------------------------------------- */
.about { max-width: 680px; margin: 0 auto; padding: 26px 20px 60px; }
.about h1 { font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(1.8rem, 7vw, 2.6rem); margin: 0 0 8px; }
.about-lead { font-size: 1.05rem; color: var(--ink-2); margin: 0 0 26px; }
.about h2 { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 1.2rem;
  letter-spacing: -.01em; margin: 26px 0 8px; }
.about p { color: var(--ink-2); margin: 0 0 12px; }
.about b { color: var(--ink); }
.about-steps { color: var(--ink-2); padding-left: 20px; display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.about-steps li { padding-left: 4px; }
.about-foot { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--hair);
  font-size: .85rem; color: var(--muted); }
.about-foot a { color: var(--blue); text-decoration: none; font-weight: 600; }

/* ---- Division nav (jump-to) --------------------------------------------- */
.divnav { display: flex; flex-wrap: wrap; gap: 7px; }
.divnav-btn { font-family: "Archivo", sans-serif; font-weight: 700; font-size: .74rem;
  color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--hair);
  border-radius: 999px; padding: 7px 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.divnav-btn:active { border-color: var(--blue); color: var(--blue); }
@media (hover: hover) { .divnav-btn:hover { border-color: var(--blue); color: var(--blue); } }

/* ---- Leaderboards (homepage) -------------------------------------------- */
.lb-wrap { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; margin-top: 14px; }
.lb { background: var(--paper-2); border: 1px solid var(--hair); border-radius: 16px;
  padding: 14px 14px 8px; box-shadow: var(--shadow); animation: rise .24s ease both;
  scroll-margin-top: calc(var(--topbar-h) + var(--top) + 96px); }
.lb-list.collapsed > li:nth-child(n+11) { display: none; }
.lb-more { width: 100%; margin: 6px 0 4px; padding: 10px; cursor: pointer;
  border: 1px solid var(--hair); background: var(--paper); border-radius: 10px;
  font-family: "Archivo", sans-serif; font-size: .82rem; font-weight: 700; color: var(--blue); }
.lb-more:active { background: var(--hair-2); }
@media (hover: hover) { .lb-more:hover { border-color: var(--blue); } }
.lb-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.lb-name { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.15rem;
  letter-spacing: -.02em; margin: 0; }
.lb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-tab { font-family: "Hanken Grotesk", sans-serif; font-size: .76rem; font-weight: 600;
  color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--hair); cursor: pointer;
  padding: 5px 12px; border-radius: 999px; }
.lb-tab.active { color: #fff; background: var(--ink); border-color: var(--ink); }
@media (hover: hover) { .lb-tab:not(.active):hover { border-color: var(--blue); color: var(--blue); } }

.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 9px;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--hair-2); cursor: pointer; }
.lb-list li:last-child .lb-row { border-bottom: 0; }
@media (hover: hover) { .lb-row:hover { background: var(--paper); } }
.lb-row:active { background: var(--hair-2); }
.lb-row.off .lb-athlete { color: var(--muted); }
.lb-rank { flex: none; width: 30px; text-align: center; font-family: "Space Mono", monospace;
  font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.lb-rank.gold { font-size: 1rem; }
.lb-rank.top { color: var(--blue-ink); }
.lb-athlete { flex: 1; min-width: 0; font-weight: 650; font-size: .95rem; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; }
.lb-row:hover .lb-athlete { text-decoration-color: var(--blue); }
.lb-time { flex: none; font-family: "Space Mono", monospace; font-size: .8rem; color: var(--ink-2); }
.lb-play { flex: none; width: 26px; height: 26px; display: grid; place-items: center; font-size: .6rem;
  color: #fff; background: var(--blue); border-radius: 50%; text-decoration: none; }
.lb-soon { flex: none; font-family: "Space Mono", monospace; font-size: .58rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); border: 1px solid var(--hair); border-radius: 999px; padding: 2px 7px; }

@media (min-width: 720px) { .lb-wrap { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }

/* ---- States ------------------------------------------------------------- */
.state { text-align: center; color: var(--ink-2); padding: 40px 16px 24px; max-width: 460px; margin: 0 auto; }
.state .em { font-size: 2.6rem; line-height: 1; }
.state h2 { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; margin: 14px 0 4px; color: var(--ink); }
.state p { margin: 0; color: var(--muted); font-size: .92rem; }
.stat-strong { color: var(--blue); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip {
  font-family: "Archivo", sans-serif; font-weight: 600; font-size: .82rem;
  background: var(--paper-2); border: 1px solid var(--hair); color: var(--ink);
  padding: 9px 15px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, color .15s, transform .1s;
}
.chip:active { transform: scale(.96); }
@media (hover: hover) { .chip:hover { border-color: var(--blue); color: var(--blue); } }

.skel { height: 96px; border-radius: var(--r); margin: 12px 0; border: 1px solid var(--hair);
  background: linear-gradient(100deg, #fff 30%, #eef1f7 50%, #fff 70%); background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---- Footer ------------------------------------------------------------- */
/* ---- Video timeline (paste a URL) --------------------------------------- */
.tl-head { margin: 14px 0 4px; }
.tl-title { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.tl-meta { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.tl-meta a { color: var(--blue); text-decoration: none; font-weight: 600; }
.tl-note { color: var(--ink-2); font-size: .82rem; background: var(--paper-2); border: 1px solid var(--hair);
  border-radius: 10px; padding: 10px 12px; margin: 8px 0 12px; }
.tl-list { background: var(--paper-2); border: 1px solid var(--hair); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.tl-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--hair-2); }
.tl-row:last-child { border-bottom: 0; }
.tl-time { flex: none; width: 64px; font-family: "Space Mono", monospace; font-size: .78rem; color: var(--ink-2); }
.tl-rank { flex: none; width: 30px; font-family: "Space Mono", monospace; font-size: .72rem; color: var(--muted); }
.tl-name { flex: 1; min-width: 0; font-weight: 650; letter-spacing: -.01em; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-name:hover { color: var(--blue); }
.tl-dur { flex: none; font-family: "Space Mono", monospace; font-size: .76rem; color: var(--ink-2); }
.tl-go { flex: none; width: 30px; height: 30px; display: grid; place-items: center; font-size: .62rem;
  color: #fff; background: var(--blue); border-radius: 50%; text-decoration: none; }
.tl-flag { flex: none; width: 30px; height: 30px; border: 1px solid var(--hair); background: var(--paper);
  border-radius: 8px; cursor: pointer; color: var(--muted); font-size: .85rem; }
.tl-flag:hover { border-color: #e0a; color: #c0392b; }

/* ---- Flag modal --------------------------------------------------------- */
.flag-kinds { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.flag-kind { font-family: "Hanken Grotesk", sans-serif; font-size: .82rem; font-weight: 600; cursor: pointer;
  color: var(--ink-2); background: var(--paper); border: 1px solid var(--hair); border-radius: 999px; padding: 7px 13px; }
.flag-kind.active { color: #fff; background: var(--ink); border-color: var(--ink); }
.flag-note { width: 100%; padding: 10px 12px; font-family: "Hanken Grotesk", sans-serif; font-size: .95rem;
  border: 1.5px solid var(--hair); border-radius: 11px; resize: vertical; outline: none; }
.flag-note:focus { border-color: var(--blue); }
.submit-form-btn { width: 100%; height: 46px; margin-top: 10px; border: 0; border-radius: 11px;
  background: var(--blue); color: #fff; font-weight: 700; font-size: .95rem; cursor: pointer; font-family: "Archivo", sans-serif; }
.flag-takedown { color: var(--muted); font-size: .76rem; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--hair); }

.foot { max-width: 720px; margin: 0 auto; padding: 8px 24px calc(30px + env(safe-area-inset-bottom)); }
.foot p { color: #9aa3ba; font-size: .72rem; text-align: center; line-height: 1.55; }

@media (min-width: 640px) {
  .runs { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* ---- Tier / format switcher --------------------------------------------- */
.viewsw { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.view-tab { font-family: "Archivo", sans-serif; font-weight: 700; font-size: .85rem; cursor: pointer;
  color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--hair);
  border-radius: 999px; padding: 9px 16px; transition: all .15s; }
.view-tab.active { color: #fff; background: var(--ink); border-color: var(--ink); }
@media (hover: hover) { .view-tab:not(.active):hover { border-color: var(--blue); color: var(--blue); } }

/* ---- In-page run player (embed + standings rail) ------------------------ */
.modal-card.wide { max-width: 980px; }
.player { display: flex; gap: 16px; }
.player-main { flex: 1; min-width: 0; }
.player-video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.player-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-info { margin-top: 11px; }
.player-name { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.player-meta { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.player-views { font-family: "Space Mono", monospace; color: var(--ink-2); }
.player-yt { display: inline-block; margin-top: 10px; color: var(--blue); font-weight: 700; font-size: .85rem; text-decoration: none; }
.player-yt:hover { text-decoration: underline; }
.player-side { width: 290px; flex: none; display: flex; flex-direction: column; min-height: 0; }
.side-title { font-family: "Archivo", sans-serif; font-weight: 800; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-2); margin-bottom: 8px; }
.side-list { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; max-height: 440px; padding-right: 2px; }
.side-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--hair); border-radius: 10px; padding: 8px 10px; }
.side-item:hover { border-color: #c8d2ee; }
.side-item.active { border-color: var(--blue); background: rgba(27,77,255,.06); }
.side-rank { flex: none; width: 30px; text-align: center; font-family: "Space Mono", monospace; font-size: .76rem;
  font-weight: 700; color: var(--ink-2); }
.side-rank.gold { font-size: .95rem; }
.side-name { flex: 1; min-width: 0; font-weight: 650; font-size: .88rem; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-time { flex: none; font-family: "Space Mono", monospace; font-size: .74rem; color: var(--ink-2); }
@media (max-width: 720px) {
  .player { flex-direction: column; }          /* video on top, standings below */
  .player-side { width: 100%; }
  .side-list { max-height: 46vh; }
}

/* ---- Player: name row, action buttons, athlete/standings tabs ----------- */
.player-namerow { display: flex; align-items: baseline; gap: 10px; }
a.player-name { color: var(--ink); text-decoration: none; }
a.player-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.player-views { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: auto;
  font-family: "Space Mono", monospace; font-size: .82rem; color: var(--ink-2); }
.player-views .eye { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pbtn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: "Hanken Grotesk", sans-serif; font-weight: 700; font-size: .85rem; color: var(--ink);
  background: #fff; border: 1px solid var(--hair); border-radius: 9px; padding: 7px 12px; text-decoration: none; }
.pbtn:hover { border-color: #c8d2ee; }
.pbtn.share { background: var(--blue); color: #fff; border-color: var(--blue); }
.pbtn.share:hover { background: var(--blue-ink); }
.pbtn.ok { background: #16a34a; color: #fff; border-color: #16a34a; }
.pbtn.flag { color: var(--ink-2); }
.pico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-tabs { display: flex; gap: 6px; margin-bottom: 9px; }
.side-tab { flex: 1; cursor: pointer; font-family: "Archivo", sans-serif; font-weight: 700;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2);
  background: #f4f6fc; border: 1px solid transparent; border-radius: 8px; padding: 7px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-tab.active { background: rgba(27,77,255,.08); color: var(--blue-ink); border-color: rgba(27,77,255,.25); }
.side-ct { font-family: "Space Mono", monospace; font-size: .9em; opacity: .7; }
.side-list.hidden { display: none; }

/* ---- Most watched / Most searched -------------------------------------- */
.topwrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 4px 0 22px; }
.topcol { background: #fff; border: 1px solid var(--hair); border-radius: 14px; padding: 14px 14px 8px; }
.top-h { display: flex; align-items: center; gap: 7px; margin: 0 0 8px;
  font-family: "Archivo", sans-serif; font-weight: 800; font-size: .82rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink); }
.top-h .eye { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { border-top: 1px solid var(--hair); }
.top-list li:first-child { border-top: 0; }
.top-run, .top-search { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  cursor: pointer; background: none; border: 0; padding: 8px 2px; color: var(--ink); font: inherit; }
.top-run:hover .top-name, .top-search:hover .top-name { color: var(--blue); }
.top-i { flex: none; width: 18px; font-family: "Space Mono", monospace; font-size: .8rem; color: var(--muted); }
.top-name { flex: 1; min-width: 0; font-weight: 650; font-size: .9rem; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-n { flex: none; font-family: "Space Mono", monospace; font-size: .78rem; color: var(--ink-2); }
@media (max-width: 560px) { .topwrap { grid-template-columns: 1fr; } }
