:root {
  --runner-ink: #231826;
  --runner-muted: #5d5062;
  --runner-gold: #ffc83d;
  --runner-mint: #9cf2d1;
  --runner-coral: #ff6f61;
  --runner-blue: #37c7ff;
  --runner-card: #ffffff;
  --runner-shadow: 0 18px 44px rgba(35, 24, 38, 0.18);
}

* {
  box-sizing: border-box;
}

body.sphinx-runner-page,
body.sphinx-runner-embed {
  margin: 0;
  color: var(--runner-ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 200, 61, 0.62), transparent 24%),
    radial-gradient(circle at 88% 16%, rgba(55, 199, 255, 0.42), transparent 28%),
    linear-gradient(140deg, rgba(156, 242, 209, 0.52), rgba(255, 215, 220, 0.44)),
    #f7fbff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.sphinx-runner-embed {
  background: transparent;
}

a {
  color: inherit;
}

.runner-page-main,
.runner-site-header,
.runner-site-footer {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.runner-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 10px;
  flex-wrap: wrap;
}

.runner-brand,
.runner-nav a,
.runner-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
}

.runner-brand {
  padding: 10px 16px;
  color: #ffffff;
  background: var(--runner-ink);
  box-shadow: 0 4px 0 rgba(35, 24, 38, 0.24);
}

.runner-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.runner-nav a {
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(35, 24, 38, 0.1);
  font-size: 0.92rem;
}

.runner-page-hero {
  display: grid;
  gap: 16px;
  padding: 16px 0 10px;
}

.runner-kicker {
  margin: 0 0 8px;
  color: #117a76;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.runner-page-hero h1,
.runner-content-section h2 {
  margin: 0;
  line-height: 1.05;
}

.runner-page-hero h1 {
  max-width: 820px;
  font-size: clamp(2.1rem, 9vw, 4.2rem);
}

.runner-summary {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--runner-muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.runner-game-shell {
  padding: 10px 0 18px;
}

.sphinx-runner-embed .runner-game-shell {
  padding: 0;
}

.runner-game {
  width: min(100%, 1000px);
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  border: 4px solid rgba(35, 24, 38, 0.96);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 0 rgba(35, 24, 38, 0.18), 0 26px 70px rgba(35, 24, 38, 0.22);
}

.runner-topbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 200, 61, 0.36), transparent 28%),
    linear-gradient(120deg, #231826, #3a2450 56%, #117a76);
  border-bottom: 3px solid rgba(35, 24, 38, 0.9);
}

.runner-stat {
  min-width: 0;
  padding: 8px 10px;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 0 rgba(35, 24, 38, 0.16);
}

.runner-stat:nth-child(1) {
  background: linear-gradient(145deg, #fff9c7, #ffc83d);
}

.runner-stat:nth-child(2) {
  background: linear-gradient(145deg, #dff9ff, #37c7ff);
}

.runner-stat:nth-child(3) {
  background: linear-gradient(145deg, #ffe1e5, #ff6f61);
}

.runner-stat:nth-child(4) {
  background: linear-gradient(145deg, #d9fff2, #9cf2d1);
}

.runner-stat span {
  display: block;
  color: rgba(35, 24, 38, 0.68);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.runner-stat strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.05rem, 5vw, 1.55rem);
  line-height: 1;
  white-space: nowrap;
}

.runner-stat strong span {
  display: inline;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.runner-stage {
  position: relative;
  height: clamp(430px, 68svh, 640px);
  min-height: 430px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 200, 61, 0.72), transparent 18%),
    radial-gradient(circle at 80% 20%, rgba(255, 111, 97, 0.35), transparent 20%),
    linear-gradient(180deg, #fff4ff 0%, #e6fbff 48%, #fff1a8 100%);
  touch-action: manipulation;
  cursor: pointer;
}

.runner-stage::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 12%;
  height: 46%;
  border-radius: 30px;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 200, 61, 0.16) 0 8deg, transparent 8deg 18deg);
  opacity: 0.7;
  transform: rotate(-7deg);
  pointer-events: none;
}

.runner-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 104px;
  border-top: 4px solid rgba(35, 24, 38, 0.86);
  background:
    repeating-linear-gradient(90deg, rgba(35, 24, 38, 0.16) 0 18px, transparent 18px 36px),
    linear-gradient(180deg, #9cf2d1, #117a76);
}

.runner-ground::before {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  top: 18px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  animation: trackSlide 1.1s linear infinite;
}

.runner-sphinx {
  position: absolute;
  left: clamp(28px, 11vw, 92px);
  bottom: 68px;
  z-index: 4;
  width: clamp(94px, 28vw, 166px);
  transform: translate3d(0, calc(var(--player-y, 0px) * -1), 0);
  transition: filter 120ms ease;
  pointer-events: none;
}

.runner-sphinx.is-hit {
  filter: drop-shadow(0 0 18px rgba(255, 111, 97, 0.86));
}

.runner-sphinx img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 16px rgba(35, 24, 38, 0.2)) drop-shadow(0 0 20px rgba(255, 200, 61, 0.32));
}

.runner-bubble {
  position: absolute;
  left: clamp(24px, 10vw, 88px);
  bottom: calc(68px + clamp(100px, 29vw, 170px));
  z-index: 5;
  max-width: 230px;
  margin: 0;
  padding: 9px 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--runner-ink), #5e2f75);
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px 16px 16px 4px;
  font-size: 0.86rem;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 8px 0 rgba(35, 24, 38, 0.12);
}

.runner-object-layer,
.runner-feedback-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.runner-object {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate3d(var(--object-x, 0), var(--object-y, 0), 0);
  user-select: none;
}

.runner-object.ticket .runner-symbol {
  filter: drop-shadow(0 0 9px rgba(255, 199, 44, 0.9)) drop-shadow(0 4px 6px rgba(35, 24, 38, 0.3));
}

.runner-object.hazard .runner-symbol {
  filter: drop-shadow(0 0 9px rgba(107, 77, 145, 0.95)) drop-shadow(0 4px 6px rgba(18, 19, 26, 0.5));
}

.runner-object.is-hit {
  opacity: 0;
  transform: translate3d(var(--object-x, 0), var(--object-y, 0), 0) scale(1.2) rotate(8deg);
  transition: opacity 120ms ease, transform 120ms ease;
}

.runner-symbol {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
}

.runner-feedback-pop {
  position: absolute;
  z-index: 6;
  min-width: 52px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: #117a76;
  font-weight: 950;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: runnerFeedback 760ms ease forwards;
  box-shadow: 0 8px 18px rgba(35, 24, 38, 0.18);
}

.runner-feedback-pop.bad {
  background: var(--runner-coral);
}

.runner-screen {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 200, 61, 0.36), transparent 32%),
    rgba(245, 251, 255, 0.72);
  backdrop-filter: blur(5px);
}

.runner-screen.is-visible {
  display: flex;
}

.runner-panel {
  width: min(100%, 570px);
  padding: clamp(18px, 5vw, 32px);
  border: 4px solid rgba(35, 24, 38, 0.96);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.98), transparent 28%),
    radial-gradient(circle at 82% 0%, rgba(255, 200, 61, 0.58), transparent 26%),
    linear-gradient(150deg, #ffffff 0%, #fff3bd 47%, #d9fff2 100%);
  box-shadow: 0 14px 0 rgba(35, 24, 38, 0.18), 0 24px 52px rgba(35, 24, 38, 0.2);
  text-align: center;
}

.runner-game[dir="rtl"] .runner-panel,
.runner-game[dir="rtl"] .runner-reward-panel {
  text-align: right;
}

.runner-game[dir="rtl"] .runner-actions {
  direction: rtl;
}

.runner-panel h1,
.runner-panel h2 {
  margin: 0;
  font-size: clamp(1.95rem, 8vw, 3.25rem);
  line-height: 1;
  text-wrap: balance;
}

.runner-panel p {
  margin: 12px auto 0;
  color: var(--runner-muted);
  font-weight: 700;
}

.runner-start-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(126px, 29vw, 180px);
  margin: -8px auto 8px;
}

.runner-start-visual::before {
  content: "";
  position: absolute;
  width: min(54vw, 250px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 26%, rgba(255, 200, 61, 0.48) 27% 44%, rgba(55, 199, 255, 0.22) 45% 60%, transparent 61%);
  animation: runnerPrizeGlow 4s ease-in-out infinite;
}

.runner-start-sphinx {
  position: relative;
  z-index: 2;
  width: clamp(126px, 32vw, 178px);
  height: auto;
  filter: drop-shadow(0 16px 12px rgba(35, 24, 38, 0.2)) drop-shadow(0 0 22px rgba(255, 200, 61, 0.46));
  animation: runnerStartFloat 2.8s ease-in-out infinite;
}

.runner-preview-token {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 9px;
  border: 2px solid #ffffff;
  border-radius: 16px;
  color: var(--runner-ink);
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 7px 0 rgba(35, 24, 38, 0.16), 0 12px 22px rgba(35, 24, 38, 0.18);
  animation: runnerTokenPop 2.4s ease-in-out infinite;
}

.runner-preview-token.good {
  left: 12%;
  top: 22%;
  background: linear-gradient(145deg, #fff9c7, var(--runner-gold));
}

.runner-preview-token.bad {
  right: 10%;
  bottom: 20%;
  color: #ffffff;
  background: linear-gradient(145deg, #6b4d91, #171923);
  animation-delay: 300ms;
}

.runner-subtitle {
  color: #117a76;
  font-size: 1.05rem;
  font-weight: 950;
  text-transform: uppercase;
}

.runner-rules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.runner-rules li {
  padding: 10px 12px;
  border: 2px solid rgba(35, 24, 38, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  font-weight: 850;
}

.runner-rules li:nth-child(1) {
  background: #fff4a6;
}

.runner-rules li:nth-child(2) {
  background: #d9fff2;
}

.runner-rules li:nth-child(3) {
  color: #ffffff;
  background: #3a2450;
}

.runner-rules li:nth-child(4) {
  background: #ffd7dc;
}

.runner-actions,
.runner-hero-actions,
.runner-link-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.runner-actions {
  margin-top: 18px;
}

.runner-button {
  min-width: min(100%, 185px);
  border: 2px solid var(--runner-ink);
  padding: 12px 18px;
  color: var(--runner-ink);
  background: #ffffff;
  box-shadow: 0 5px 0 rgba(35, 24, 38, 0.2);
  cursor: pointer;
  font: inherit;
  line-height: 1.1;
  text-align: center;
}

.runner-button.primary {
  background: linear-gradient(145deg, #fff78e, var(--runner-gold) 54%, #ff9f1c);
}

.runner-button.secondary {
  background: linear-gradient(145deg, #e8fff7, var(--runner-mint));
}

.runner-button.dark {
  color: #ffffff;
  background: linear-gradient(145deg, #42304a, var(--runner-ink));
}

.runner-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(35, 24, 38, 0.2);
}

.runner-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.runner-result-card {
  padding: 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

.runner-result-card span {
  display: block;
  color: var(--runner-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.runner-result-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.6rem, 9vw, 2.7rem);
  line-height: 1;
}

.runner-quote {
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffd7dc;
}

.runner-reward-panel {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border: 2px solid var(--runner-ink);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 200, 61, 0.62), transparent 26%),
    linear-gradient(135deg, #ffffff, rgba(156, 242, 209, 0.72));
  text-align: left;
}

.runner-reward-panel.is-visible {
  display: block;
}

.runner-reward-panel h3,
.runner-reward-panel p {
  margin: 0;
}

.runner-reward-panel h3 {
  font-size: 1.15rem;
  line-height: 1.15;
}

.runner-reward-panel p + p,
.runner-reward-panel h3 + p,
.runner-reward-panel .runner-actions {
  margin-top: 10px;
}

.runner-reward-kicker {
  color: #117a76;
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.runner-reward-status {
  min-height: 1.4em;
  color: var(--runner-muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.runner-reward-locked {
  border-color: rgba(35, 24, 38, 0.22);
  background: rgba(255, 255, 255, 0.74);
}

.runner-button.is-disabled,
.runner-button[aria-disabled="true"] {
  opacity: 0.58;
  cursor: wait;
}

.runner-content-section {
  margin: 18px 0;
  padding: clamp(18px, 5vw, 28px);
  border: 1px solid rgba(35, 24, 38, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.runner-content-section h2 {
  font-size: clamp(1.45rem, 5vw, 2.1rem);
}

.runner-content-section p {
  max-width: 850px;
  color: var(--runner-muted);
}

.runner-steps {
  padding-left: 1.2rem;
  color: var(--runner-muted);
  font-weight: 700;
}

.runner-steps li + li {
  margin-top: 8px;
}

.runner-site-footer {
  padding: 22px 0 30px;
  color: var(--runner-muted);
  font-weight: 700;
}

@keyframes runnerFeedback {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.7);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.92);
  }
}

@keyframes runnerStartFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-7px) rotate(2deg);
  }
}

@keyframes runnerPrizeGlow {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.94) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.04) rotate(10deg);
  }
}

@keyframes runnerTokenPop {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg) scale(1);
  }
  50% {
    transform: translateY(-5px) rotate(4deg) scale(1.04);
  }
}

@keyframes trackSlide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(36px);
  }
}

@media (min-width: 680px) {
  .runner-page-hero {
    padding-top: 28px;
  }

  .runner-topbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 12px;
  }

  .runner-stat {
    padding: 10px 14px;
  }

  .runner-rules {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .runner-site-header {
    align-items: stretch;
  }

  .runner-brand,
  .runner-nav,
  .runner-nav a,
  .runner-button {
    width: 100%;
  }

  .runner-nav {
    justify-content: stretch;
  }

  .runner-stage {
    height: 72svh;
    min-height: 560px;
  }

  .runner-screen {
    padding: 10px;
  }

  .runner-panel {
    max-height: calc(100% - 12px);
    overflow-y: auto;
    padding: 16px 14px;
  }

  .runner-panel h1,
  .runner-panel h2 {
    font-size: clamp(1.6rem, 8vw, 2.1rem);
  }

  .runner-panel p {
    font-size: 0.93rem;
  }

  .runner-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 12px 0;
  }

  .runner-rules li {
    padding: 8px 7px;
    font-size: 0.9rem;
  }

  .runner-actions {
    gap: 8px;
    margin-top: 12px;
  }

  .runner-button {
    min-height: 42px;
    padding: 10px 16px;
  }

  .runner-start-visual {
    min-height: 126px;
  }

  .runner-start-sphinx {
    width: clamp(116px, 38vw, 146px);
  }

  .runner-preview-token {
    min-width: 39px;
    height: 39px;
    border-radius: 14px;
    font-size: 0.68rem;
  }

  .runner-object {
    min-width: 54px;
    height: 54px;
    border-radius: 16px;
  }

  .runner-bubble {
    max-width: 175px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
