/* One continuous, upward-facing shared track. Position is a projection of the
   current fifteen-minute value on a logarithmic scale; only the road and character gait loop between frames. */
.shared-race { max-width:800px; margin:22px auto 30px; --sr-scale:1.65; --sr-body-offset:62.7px; }
.sr-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.sr-heading h2 { font:650 18px var(--sans); margin:0; color:var(--ink); }
.sr-direction { color:var(--accent); font:12px var(--mono); }
.sr-hint { margin:0 0 14px; color:var(--ink-3); font:12px/1.6 var(--sans); }
.sr-track { position:relative; height:640px; overflow:hidden; isolation:isolate; border:1px solid #27563b; border-radius:12px;
 background:linear-gradient(90deg,#030906,#0b1b12 12%,#101f17 50%,#0b1b12 88%,#030906);
 box-shadow:inset 0 0 60px #0007,0 8px 28px #0004; }
.sr-track::before { content:''; position:absolute; inset:0; pointer-events:none; z-index:2;
 background:linear-gradient(180deg,#39ff8810,transparent 16%,transparent 90%,#03090688),
 repeating-linear-gradient(90deg,transparent 0 calc(25% - 1px),#b1f0ca08 calc(25% - 1px) 25%); }
.sr-flow { position:absolute; inset:-96px 12px 0; z-index:0; pointer-events:none;
 background:repeating-linear-gradient(180deg,transparent 0 46px,#baffcf12 46px 48px,transparent 48px 96px),
 repeating-linear-gradient(180deg,#c9ffdf25 0 16px,transparent 16px 48px) 50% 0 / 2px 100% no-repeat; }
.sr-edges { position:absolute; inset:-96px 0 0; z-index:1; pointer-events:none;
 background:repeating-linear-gradient(180deg,#75dca155 0 22px,#163523 22px 48px) left / 7px 100% no-repeat,
 repeating-linear-gradient(180deg,#75dca155 0 22px,#163523 22px 48px) right / 7px 100% no-repeat; }
.sr-slot { position:absolute; left:calc(16px + (100% - 32px) * var(--sr-slot)); top:0; height:100%;
 width:clamp(52px,calc((100% - 32px)/4 - 4px),160px); transform:translate(-50%,calc(var(--sr-place) * 100%));
 pointer-events:none; z-index:3; }
.shared-race[data-ready="true"][data-near="true"] .sr-slot { transition:transform 1100ms cubic-bezier(.22,.75,.2,1); }
.sr-entrant { position:relative; pointer-events:auto; display:block; width:100%; height:200px; padding:0; border:0;
 border-radius:10px; background:none; color:var(--brand-ink,var(--ink)); font:inherit; cursor:pointer; text-align:center; }
.sr-entrant:focus-visible { outline:2px solid var(--brand-ink); outline-offset:4px; background:#07140dbb; }
.sr-entrant:hover .sr-caption { border-color:var(--br-color); background:#07160ef2; }
.sr-sprite { position:relative; display:block; width:100%; height:150px; }
.sr-sprite .brand-racer { left:50%; top:calc(50% + var(--sr-body-offset)); width:170px; height:82px; margin:0;
 transform:translate(-50%,-50%) rotate(90deg) scale(var(--sr-scale)); transform-origin:center center; }
.sr-sprite .br-course { display:none; }
.sr-sprite .sr-upright { display:grid; place-items:center; width:100%; height:100%; transform:rotate(-90deg); }
.sr-sprite .br-emblem { flex:none; }
.sr-waiting { position:absolute; left:50%; top:50%; width:46px; height:46px; padding:7px; border-radius:50%;
 background:#e4ede7; transform:translate(-50%,-50%); opacity:.55; box-sizing:border-box; }
.sr-waiting[hidden] { display:none; }
.sr-rank { position:absolute; top:4px; left:8px; z-index:2; min-width:26px; height:26px; display:grid; place-items:center;
 border:1px solid color-mix(in srgb,var(--br-color) 65%,transparent); border-radius:50%; background:#08130eee; font:650 12px var(--mono); }
.sr-entrant[data-rank="1"] .sr-rank { background:#e6c86f; border-color:#efd77d; color:#261e07; box-shadow:0 0 15px #efd77d33; }
.sr-caption { position:relative; z-index:2; display:block; box-sizing:border-box; width:100%; padding:5px 6px; border:1px solid var(--line);
 border-radius:7px; background:#06110bf2; box-shadow:0 3px 14px #0006; }
.sr-name { display:block; font:650 13px/1.2 var(--sans); color:var(--ink); }
.sr-value { display:inline-block; max-width:100%; overflow-wrap:anywhere; margin-top:4px; font:700 21px/1 var(--mono); font-variant-numeric:tabular-nums; }
.sr-value.sr-long { font-size:16px; }
.sr-unit { display:inline-block; font:9px var(--mono); color:var(--ink-3); margin-left:3px; }
.sr-entrant[data-available="false"] { height:90px; }
.sr-entrant[data-available="false"] .sr-sprite { height:44px; }
.sr-entrant[data-available="false"] .sr-rank { display:none; }
.sr-entrant[data-available="false"] .sr-value { font-size:15px; color:var(--ink-3); }
.shared-race:not([data-status="live"]) .sr-track { opacity:.7; }
.company-board[data-motion="on"][data-status="live"] .shared-race[data-near="true"][data-moving="true"] :is(.sr-flow,.sr-edges) {
 animation:sr-road-flow var(--sr-road-period,1s) linear infinite; }
.company-board[data-motion="on"][data-status="live"] .shared-race .brand-racer[data-moving="true"][data-near="true"] .br-runner { animation-name:sr-run-step; }
@keyframes sr-road-flow { to { transform:translateY(96px); } }
@keyframes sr-run-step { 0%,100% { transform:translateX(3px); } 50% { transform:translateX(-3px); } }
/* One shared card per metric; all three remain visible on desktop. */
.company-race-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.company-race-grid .shared-race {
  width: 100%; max-width: none; margin: 0; padding: 14px 12px 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, #0b1710, #07100b);
  --sr-scale: 1.15; --sr-body-offset: 43.7px;
}
.company-race-grid .sr-heading { min-height: 25px; gap: 8px; margin-bottom: 5px; }
.company-race-grid .sr-heading h2 { font-size: 17px; line-height: 1.35; }
.company-race-grid .sr-direction { font-size: 10px; white-space: nowrap; }
.company-race-grid .sr-hint { min-height: 34px; margin-bottom: 10px; font: 11px/1.5 var(--sans); }
.company-race-grid .sr-track { height: clamp(460px, 54vh, 600px); border-radius: 9px; }
.company-race-grid .sr-entrant { height: 166px; }
.company-race-grid .sr-sprite { height: 100px; }
.company-race-grid .sr-rank { top: 0; left: 2px; min-width: 20px; height: 20px; font-size: 10px; }
.company-race-grid .sr-caption { padding: 6px 2px; }
.company-race-grid .sr-name { font-size: 11px; }
.company-race-grid .sr-value { margin-top: 5px; font-size: clamp(15px, 1.45vw, 21px); }
.company-race-grid .sr-value.sr-long { font-size: clamp(12px, 1.2vw, 17px); }
.company-race-grid .sr-unit { display: block; margin: 4px 0 0; font: 9px/1.25 var(--mono); }
.company-race-grid .sr-entrant[data-available="false"] { height: 100px; }
.company-race-grid .sr-entrant[data-available="false"] .sr-sprite { height: 32px; }
.company-race-grid .sr-waiting { width: 36px; height: 36px; padding: 5px; }
.company-model-cost strong { color: var(--ink); font-size: 13px; }
.company-model-cost small { display: block; font: 9px var(--sans); color: var(--ink-3); }
@media (min-width: 1001px) and (max-width: 1299px) {
  .company-race-grid .shared-race { --sr-scale: 1; --sr-body-offset: 38px; padding: 12px 8px 8px; }
  .company-race-grid .sr-heading { display: block; min-height: 40px; }
  .company-race-grid .sr-heading h2 { font-size: 15px; }
  .company-race-grid .sr-direction { display: block; margin-top: 3px; font-size: 9px; }
}
@media (max-width: 1000px) {
  .company-race-grid { grid-template-columns: 1fr; max-width: 620px; margin-left: auto; margin-right: auto; gap: 18px; }
  .company-race-grid .sr-track { height: 480px; }
  .company-race-grid .sr-value { font-size: 18px; }
  .company-race-grid .sr-value.sr-long { font-size: 15px; }
  .company-race-grid .sr-name { font-size: 12px; }
}
@media (max-width: 620px) {
  .company-race-grid .shared-race { padding: 12px 8px 8px; }
  .company-race-grid .sr-heading h2 { font-size: 16px; }
  .company-race-grid .sr-hint { min-height: 0; margin-bottom: 12px; font-size: 10px; }
  .company-race-grid .sr-name { font-size: 11px; }
  .company-race-grid .sr-value { font-size: 16px; }
  .company-race-grid .sr-value.sr-long { font-size: 13px; }
}
@media (max-width: 380px) {
  .company-race-grid .shared-race { --sr-scale: 1; --sr-body-offset: 38px; }
  .company-race-grid .sr-heading { display: block; }
  .company-race-grid .sr-heading h2 { font-size: 16px; }
  .company-race-grid .sr-direction { display: block; margin-top: 3px; }
  .company-race-grid .sr-name { font-size: 10px; }
  .company-race-grid .sr-unit { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) { .shared-race * { animation: none !important; transition: none !important; } }

/* Fit the complete numeric readout to its own lane, including narrow phones. */
.company-race-grid .sr-caption { container-type: inline-size; }
.company-race-grid .sr-value,
.company-race-grid .sr-value.sr-long {
  font-size: min(clamp(16px, 1.45vw, 21px), calc(100cqw / var(--sr-value-chars, 5) * 1.6));
  white-space: nowrap;
  overflow-wrap: normal;
}
