:root {
  color-scheme: dark;
  --page: #071122;
  --panel: #14213d;
  --panel-2: #1a2747;
  --line: #2b3a61;
  --text: #f7f7fb;
  --muted: #b7bed2;
  --green: #67d686;
  --orange: #ffb15c;
  --gold: #ffd36a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Arial, sans-serif;
  letter-spacing: 0;
}

.phone-shell {
  width: min(100vw, 560px);
  min-height: 0;
  margin: 0 auto;
  background: transparent;
  border: 0;
  overflow: hidden;
}

.topbar,
.hero,
.leader-card,
.mini-grid,
.pending-grid,
.source-line,
footer {
  display: none !important;
}

.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  font-weight: 800;
  font-size: 18px;
}

.dynamic-island {
  width: 164px;
  height: 38px;
  border-radius: 22px;
  background: #000;
  box-shadow: inset 0 0 0 1px #151515;
}

.hero {
  text-align: center;
  padding: 10px 26px 22px;
}

.hero img {
  display: block;
  width: 100%;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  image-rendering: pixelated;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

h1 {
  margin: 16px 0 14px;
  font-size: 25px;
  line-height: 1.08;
  font-weight: 850;
}

.mode-pill {
  border: 1px solid #56617c;
  border-radius: 999px;
  color: var(--text);
  background: #101831;
  padding: 8px 25px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.dashboard {
  border: 0;
  padding: 8px;
  background: transparent;
}

.race-window {
  position: relative;
  height: 204px;
  overflow: hidden;
  background-color: transparent;
  background-image: url("assets/race-track-obs-thin.png?v=20260608-obs4");
  background-repeat: repeat-x;
  background-size: auto 100%;
  animation: terrain-scroll 1.45s linear infinite;
  border: 0;
  margin: 0 0 2px;
}

.track-bg {
  display: none;
}

.finish-line {
  display: none;
}

.runner {
  position: absolute;
  bottom: 45px;
  --runner-size: 110px;
  --frame-w: 110px;
  width: var(--runner-size);
  height: var(--runner-size);
  transition: left 850ms cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 2;
}

.runner-sanchez {
  bottom: 64px;
  --sprite-frames: 8;
}

.sprite-viewport {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: calc(var(--runner-size) * var(--sprite-frames)) var(--runner-size);
  background-position: 0 0;
  image-rendering: pixelated;
  will-change: background-position;
}

.runner-sanchez .sprite-viewport {
  background-image: url("assets/sprites/sanchez-run.png?v=20260608-obs4");
  animation: run-sprite-8 0.56s step-end infinite;
}

.runner-keiko .sprite-viewport {
  background-image: url("assets/sprites/keiko-run.png?v=20260608-obs4");
  animation: run-sprite-11 0.72s step-end infinite;
  animation-delay: -0.16s;
}

.runner img {
  display: none;
}

.runner-keiko {
  bottom: 38px;
  --sprite-frames: 11;
  z-index: 3;
}

.runner-sanchez .bubble {
  top: -36px;
}

.runner-keiko .bubble {
  top: -22px;
}

.bubble {
  position: absolute;
  top: -21px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: #f6f7ff;
  font-size: 31px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  text-shadow:
    0 2px 0 #041024,
    2px 0 0 #041024,
    -2px 0 0 #041024,
    0 -2px 0 #041024,
    0 4px 10px rgba(0, 0, 0, 0.86);
  z-index: 4;
}

.score-card,
.leader-card,
.mini-card,
.pending-grid article {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
}

.score-card {
  display: grid;
  grid-template-columns: 1fr 38px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-shadow:
    0 2px 0 #050913,
    2px 0 0 #050913,
    -2px 0 0 #050913,
    0 -2px 0 #050913,
    0 5px 12px rgba(0, 0, 0, 0.9);
}

.score-card span {
  display: block;
  color: #f5f7ff;
  margin-bottom: 2px;
  font-size: 18px;
  font-weight: 850;
}

.score-card strong {
  display: block;
  font-size: clamp(34px, 7vw, 44px);
  line-height: 1.05;
  font-weight: 900;
}

.score-card b {
  text-align: center;
  color: rgba(255, 255, 255, 0.76);
  font-size: 21px;
  font-weight: 950;
}

.right {
  text-align: right;
}

.green {
  color: var(--green);
}

.orange {
  color: var(--orange);
}

.leader-card {
  margin-top: 13px;
  padding: 14px;
  text-align: center;
  color: var(--gold);
  border-color: #8f6332;
  background: #322a31;
  font-weight: 900;
  font-size: 18px;
}

.mini-grid,
.pending-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.mini-card,
.pending-grid article {
  min-height: 80px;
  padding: 15px 12px;
  text-align: center;
}

.mini-card span,
.pending-grid span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}

.mini-card strong,
.pending-grid strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(23px, 7vw, 30px);
  line-height: 1.05;
  font-weight: 900;
}

.mini-card small,
.pending-grid small {
  display: block;
  margin-top: 5px;
  color: #9099b3;
  font-size: 12px;
}

.green-card {
  background: #112c40;
  border-color: #25614b;
}

.orange-card {
  background: #29263a;
  border-color: #815c35;
}

.pending-grid article {
  min-height: 124px;
  display: grid;
  place-content: center;
}

.source-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: #99a4c0;
  font-size: 12px;
}

#sourceBadge {
  color: #dce6ff;
  font-weight: 800;
}

footer {
  position: sticky;
  bottom: 0;
  padding: 19px 10px 25px;
  text-align: center;
  background: rgba(6, 12, 26, 0.94);
  font-size: 17px;
  font-weight: 700;
}

@keyframes run-sprite-8 {
  0% {
    background-position: 0 0;
  }
  12.5% {
    background-position: calc(var(--frame-w) * -1) 0;
  }
  25% {
    background-position: calc(var(--frame-w) * -2) 0;
  }
  37.5% {
    background-position: calc(var(--frame-w) * -3) 0;
  }
  50% {
    background-position: calc(var(--frame-w) * -4) 0;
  }
  62.5% {
    background-position: calc(var(--frame-w) * -5) 0;
  }
  75% {
    background-position: calc(var(--frame-w) * -6) 0;
  }
  87.5%,
  100% {
    background-position: calc(var(--frame-w) * -7) 0;
  }
}

@keyframes run-sprite-11 {
  0% {
    background-position: 0 0;
  }
  9.09% {
    background-position: calc(var(--frame-w) * -1) 0;
  }
  18.18% {
    background-position: calc(var(--frame-w) * -2) 0;
  }
  27.27% {
    background-position: calc(var(--frame-w) * -3) 0;
  }
  36.36% {
    background-position: calc(var(--frame-w) * -4) 0;
  }
  45.45% {
    background-position: calc(var(--frame-w) * -5) 0;
  }
  54.54% {
    background-position: calc(var(--frame-w) * -6) 0;
  }
  63.63% {
    background-position: calc(var(--frame-w) * -7) 0;
  }
  72.72% {
    background-position: calc(var(--frame-w) * -8) 0;
  }
  81.81% {
    background-position: calc(var(--frame-w) * -9) 0;
  }
  90.90%,
  100% {
    background-position: calc(var(--frame-w) * -10) 0;
  }
}

@keyframes terrain-scroll {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -560px 0;
  }
}

@media (max-width: 360px) {
  .topbar {
    padding: 0 18px;
    font-size: 16px;
  }

  .dynamic-island {
    width: 130px;
  }

  .dashboard {
    padding-inline: 11px;
  }

  .race-window {
    height: 198px;
  }

  .runner {
    --runner-size: 92px;
    --frame-w: 92px;
  }

  .bubble {
    font-size: 24px;
  }
}
