.abz-3d-runner-game,
.abz-3d-runner-game #dc-root,
.abz-3d-runner-game #dc-root > .sc-host {
  width: 100%;
  max-width: none;
  min-height: var(--abz-game-stage-height, 600px);
}

.abz-3d-runner-game {
  position: relative;
  overflow: hidden;
  background: #0a1233;
}

.abz-3d-runner-game * {
  box-sizing: border-box;
}

.abz-3d-runner-game .runner-stage {
  min-height: var(--abz-game-stage-height, 600px) !important;
}

.abz-3d-runner-game .runner-arena {
  min-height: max(520px, calc(var(--abz-game-stage-height, 840px) - 36px)) !important;
}

.abz-3d-runner-game [data-screen-label="Home"] {
  height: max(520px, calc(var(--abz-game-stage-height, 840px) - 36px)) !important;
}

.abz-3d-runner-game [data-screen-label="Race"] {
  height: max(520px, calc(var(--abz-game-stage-height, 800px) - 36px)) !important;
}

.abz-3d-runner-game [data-screen-label="Skill select"],
.abz-3d-runner-game [data-screen-label="Difficulty select"],
.abz-3d-runner-game [data-screen-label="Customize runner"],
.abz-3d-runner-game .abz-runner-finish-card {
  box-sizing: border-box;
}

.abz-3d-runner-game button {
  min-height: 44px;
}

.abz-3d-runner-game .runner-finish-overlay {
  overflow: hidden;
  padding: 12px;
}

.abz-3d-runner-game .abz-runner-finish-card {
  position: relative;
  z-index: 2;
  max-height: calc(100% - 12px);
  overflow-y: auto;
}

.abz-3d-runner-game .runner-first-place-burst {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 232, 112, 0.62) 0 12%, rgba(255, 180, 0, 0.24) 30%, transparent 58%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,0.2) 0 7deg, transparent 7deg 18deg);
  animation: runnerVictoryGlow 1.2s ease-in-out infinite alternate;
}

.abz-3d-runner-game .runner-first-place-burst span {
  position: absolute;
  display: block;
  font-size: clamp(2rem, 6vw, 4.8rem);
  filter: drop-shadow(0 5px 8px rgba(88, 45, 0, 0.45));
  animation: runnerVictoryFloat 1.9s ease-in-out infinite alternate;
}

.abz-3d-runner-game .runner-first-place-burst span:nth-child(1) { left: 4%; top: 8%; animation-delay: -0.2s; }
.abz-3d-runner-game .runner-first-place-burst span:nth-child(2) { left: 16%; top: 67%; animation-delay: -0.8s; }
.abz-3d-runner-game .runner-first-place-burst span:nth-child(3) { left: 27%; top: 14%; animation-delay: -1.3s; }
.abz-3d-runner-game .runner-first-place-burst span:nth-child(4) { right: 27%; top: 9%; animation-delay: -0.5s; }
.abz-3d-runner-game .runner-first-place-burst span:nth-child(5) { right: 14%; top: 64%; animation-delay: -1.1s; }
.abz-3d-runner-game .runner-first-place-burst span:nth-child(6) { right: 4%; top: 14%; animation-delay: -1.6s; }
.abz-3d-runner-game .runner-first-place-burst span:nth-child(7) { left: 5%; top: 43%; animation-delay: -1.4s; }
.abz-3d-runner-game .runner-first-place-burst span:nth-child(8) { right: 5%; top: 40%; animation-delay: -0.9s; }

.abz-3d-runner-game .runner-first-place-card {
  border: 4px solid #ffe269 !important;
  box-shadow: 0 0 0 7px rgba(255, 179, 0, 0.24), 0 0 58px rgba(255, 210, 62, 0.9), 0 30px 70px rgba(0,0,0,0.58) !important;
  animation: runnerChampionEntrance 0.78s cubic-bezier(.2,.9,.25,1.25), runnerChampionGlow 1.15s ease-in-out 0.8s infinite alternate !important;
}

.abz-3d-runner-game .runner-first-place-card .runner-finish-trophy {
  font-size: clamp(4.6rem, 12vw, 7rem) !important;
  animation: runnerTrophyBounce 0.85s ease-in-out infinite alternate;
}

.abz-3d-runner-game .runner-champion-ribbon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff9f0a, #ffe56c, #ff9f0a);
  color: #3d2100;
  font-size: clamp(0.85rem, 2.7vw, 1.15rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 5px 0 #b66b00, 0 0 22px rgba(255, 225, 92, 0.8);
}

.abz-3d-runner-game .runner-feedback-form {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  text-align: left;
}

.abz-3d-runner-game .runner-feedback-form strong {
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.abz-3d-runner-game .runner-feedback-form textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 2px solid rgba(255,255,255,0.24);
  border-radius: 12px;
  padding: 11px 12px;
  color: #17213f;
  background: #fff;
  font: 600 0.9rem/1.35 'Poppins', sans-serif;
}

.abz-3d-runner-game .runner-feedback-form button {
  justify-self: center;
  border: 0;
  border-radius: 12px;
  padding: 10px 22px;
  background: #fff;
  color: #17213f;
  font-weight: 900;
  cursor: pointer;
}

@keyframes runnerVictoryGlow {
  from { opacity: 0.72; transform: scale(1); }
  to { opacity: 1; transform: scale(1.08); }
}

@keyframes runnerVictoryFloat {
  from { transform: translateY(10px) rotate(-12deg) scale(0.86); }
  to { transform: translateY(-18px) rotate(12deg) scale(1.15); }
}

@keyframes runnerChampionEntrance {
  0% { transform: scale(0.25) rotate(-5deg); opacity: 0; }
  65% { transform: scale(1.09) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes runnerChampionGlow {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.025); filter: brightness(1.13); }
}

@keyframes runnerTrophyBounce {
  from { transform: translateY(2px) rotate(-4deg) scale(1); }
  to { transform: translateY(-8px) rotate(4deg) scale(1.12); }
}

@media (max-width: 820px) {
  .abz-3d-runner-game .runner-stage {
    padding: 10px !important;
  }

  .abz-3d-runner-game .runner-arena {
    border-radius: 22px !important;
    min-height: max(520px, calc(var(--abz-game-stage-height, 840px) - 20px)) !important;
  }

  .abz-3d-runner-game [data-screen-label="Home"],
  .abz-3d-runner-game [data-screen-label="Race"] {
    height: max(520px, calc(var(--abz-game-stage-height, 840px) - 20px)) !important;
  }

  .abz-3d-runner-game .runner-custom-grid {
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr) !important;
    gap: 18px !important;
  }

  .abz-3d-runner-game .runner-custom-preview {
    min-height: 360px !important;
  }
}

@media (max-width: 650px) {
  .abz-3d-runner-game [data-screen-label="Home"] {
    padding: 44px 16px 64px !important;
  }

  .abz-3d-runner-game [data-screen-label="Home"] .runner-home-title-first {
    font-size: clamp(2.15rem, 12vw, 3.6rem) !important;
  }

  .abz-3d-runner-game [data-screen-label="Home"] .runner-home-title-second {
    font-size: clamp(2.65rem, 14vw, 5rem) !important;
  }

  .abz-3d-runner-game [data-screen-label="Skill select"],
  .abz-3d-runner-game [data-screen-label="Difficulty select"],
  .abz-3d-runner-game [data-screen-label="Customize runner"] {
    width: calc(100% - 20px) !important;
    padding: 24px 18px 28px !important;
  }

  .abz-3d-runner-game .runner-custom-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .abz-3d-runner-game .runner-custom-preview {
    min-height: 300px !important;
  }

  .abz-3d-runner-game .runner-options-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .abz-3d-runner-game .runner-race-hud {
    top: 8px !important;
    left: 8px !important;
    right: 8px !important;
    gap: 6px !important;
  }

  .abz-3d-runner-game .runner-race-progress {
    width: 112px !important;
    max-width: 31vw !important;
  }

  .abz-3d-runner-game .runner-rivals-overlay {
    padding: 62px 12px 18px !important;
    justify-content: center !important;
  }

  .abz-3d-runner-game .runner-question-panel {
    width: calc(100% - 20px) !important;
    padding: 14px 16px 16px !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .abz-3d-runner-game .runner-question-panel > div:last-child > div:last-child {
    gap: 8px !important;
  }

  .abz-3d-runner-game .abz-runner-finish-card {
    width: calc(100% - 20px) !important;
    padding: 24px 16px 28px !important;
  }

  .abz-3d-runner-game .runner-finish-stats {
    gap: 7px !important;
    flex-wrap: wrap !important;
  }
}

@media (max-width: 390px) {
  .abz-3d-runner-game .runner-stage {
    padding: 0 !important;
  }

  .abz-3d-runner-game .runner-arena {
    border-radius: 0 !important;
    min-height: max(520px, var(--abz-game-stage-height, 600px)) !important;
  }

  .abz-3d-runner-game [data-screen-label="Home"],
  .abz-3d-runner-game [data-screen-label="Race"] {
    height: max(520px, var(--abz-game-stage-height, 600px)) !important;
  }

  .abz-3d-runner-game .runner-race-hud > :nth-child(2) {
    display: none !important;
  }

  .abz-3d-runner-game .runner-race-progress {
    width: 96px !important;
  }

  .abz-3d-runner-game .runner-question-panel button {
    min-width: 112px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .abz-3d-runner-game *,
  .abz-3d-runner-game *::before,
  .abz-3d-runner-game *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
