:root {
  color-scheme: dark;
  --bg: #0a0a09;
  --bg-card: #161614;
  --bg-card-alt: #1e1e1b;
  --border: #2c2c27;
  --text: #f3f2ee;
  --text-muted: #97968d;
  --accent: #d7f229;
  --accent-soft: rgba(215, 242, 41, 0.14);
  --accent-ink: #14170a;
  --accent-2: #6fb1ff;
  --accent-3: #ff8a65;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.app {
  max-width: 920px;
  margin: auto;
  padding: 28px 18px 70px;
}

/* Hero Section */
.hero {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 18px;
}

.racket-icon {
  flex-shrink: 0;
}

.hero h1 {
  font-size: clamp(42px, 9vw, 86px);
  line-height: 0.94;
  letter-spacing: -0.055em;
  margin: 0 0 25px;
  color: var(--text);
}

.hero h1 .muted {
  color: var(--text-muted);
}

.lang-toggle {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  z-index: 50;
  border: 1px solid var(--border);
  background: var(--bg-card-alt);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 9px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-toggle:active {
  transform: scale(0.94);
}

.hero p {
  font-size: 20px;
  line-height: 1.5;
  max-width: 620px;
  color: var(--text-muted);
  margin: 0 0 32px;
}

.meta {
  color: var(--text-muted);
}

/* Mode select */
.mode-select,
.partner-invite-section {
  padding: 60px 0;
}

.partner-invite-section > .badge {
  margin-bottom: 14px;
}

.partner-invite-section > h1 {
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: -0.04em;
  margin: 0 0 14px;
  color: var(--text);
}

.partner-invite-section > p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 560px;
  margin: 0 0 24px;
}

.link-btn.partner-invite-link {
  display: block;
  margin-top: 10px;
}

.mode-select > .badge {
  margin-bottom: 14px;
}

.mode-select > h1 {
  font-size: clamp(36px, 7vw, 56px);
  letter-spacing: -0.04em;
  margin: 0 0 14px;
  color: var(--text);
}

.mode-select > p {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.55;
  max-width: 620px;
  margin: 0 0 32px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.mode-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.mode-card-pro {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.mode-card-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.mode-card-meta {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.mode-card-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 4px 0 8px;
  flex-grow: 1;
}

.mode-card-cta {
  font-weight: 800;
  color: var(--text);
  font-size: 14px;
}

.mode-back {
  width: auto;
}

/* Buttons */
.primary,
.secondary {
  border: 0;
  border-radius: 14px;
  padding: 16px 22px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.primary:hover {
  background: #e4ff5c;
}

.primary .arrow {
  margin-left: 18px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.primary:hover .arrow {
  transform: translateX(3px);
}

.secondary {
  background: var(--bg-card-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary:hover {
  background: #26261f;
}

.primary:active,
.secondary:active,
.option:active,
.buy:active {
  transform: scale(0.97);
}

.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim-in {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .anim-in {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Progress */
.progress-wrap {
  margin: 10px 0 24px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 9px;
}

.progress {
  height: 7px;
  background: var(--bg-card-alt);
  border-radius: 99px;
  overflow: hidden;
}

.progress div {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}

/* Card & Question */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
}

.card h2 {
  font-size: 32px;
  letter-spacing: -0.035em;
  margin: 10px 0 8px;
  color: var(--text);
}

.hint {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 22px;
}

/* Options */
.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.option {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--bg-card-alt);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.2s ease;
  min-height: 48px;
}

.option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option small {
  display: block;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 5px;
}

/* Range */
.range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 32px;
}

.range-value {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  margin: 12px;
  color: var(--accent);
}

.text-input {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--bg-card-alt);
  color: var(--text);
}

/* Actions */
.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 25px;
}

.actions .primary,
.actions .secondary {
  flex: 1;
}

/* Results */
.results-head {
  padding: 45px 0 25px;
}

.results-head h1 {
  font-size: clamp(38px, 8vw, 70px);
  line-height: 1;
  margin: 10px 0;
  color: var(--text);
}

.results-head p {
  color: var(--text-muted);
}

/* Profile Stats */
.profile {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0 30px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.stat b {
  display: block;
  font-size: 22px;
  margin-bottom: 5px;
  color: var(--text);
}

.stat span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Analysis / Radar chart */
.analysis {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 25px 20px;
  margin: 20px 0 30px;
}

.analysis-title {
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.radar-wrap {
  max-width: 340px;
  margin: 10px auto 0;
}

.radar-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.radar-grid {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.radar-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.radar-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.radar-user {
  fill: rgba(215, 242, 41, 0.22);
  stroke: var(--accent);
  stroke-width: 2;
}

.radar-racket {
  fill: rgba(111, 177, 255, 0.08);
  stroke: var(--accent-2);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.radar-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.radar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend-user {
  background: var(--accent);
}

.legend-racket {
  background: var(--accent-2);
}

.radar-partner {
  fill: rgba(255, 138, 101, 0.16);
  stroke: var(--accent-3);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}

.legend-partner {
  background: var(--accent-3);
}

/* Recommendations */
.recommendation {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 25px;
  margin: 15px 0;
  transition: box-shadow 0.2s ease;
}

.recommendation:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.rank {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: #1c1f0c;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.rec-body {
  display: flex;
  gap: 20px;
}

.rec-main {
  flex: 1;
  min-width: 0;
}

.card-image {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 16px;
  background: radial-gradient(circle at 42% 38%, #f3f4ee, #d9dbcd 78%);
  border: 1px solid var(--border);
  overflow: hidden;
  /* keeps the multiply blend confined to the tile (WebKit otherwise blends against ancestors) */
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  mix-blend-mode: multiply;
}

.card-image-placeholder,
.card-image.broken {
  color: #8a8c7e;
}

.card-image .racket-icon {
  display: none;
  width: 32px;
  height: 32px;
}

.card-image-placeholder .racket-icon,
.card-image.broken .racket-icon {
  display: block;
}

.card-image.broken img {
  display: none;
}

.rec-title {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 15px;
}

.rec-title h2 {
  font-size: 26px;
  margin: 7px 0 5px;
  color: var(--text);
}

.rec-title > div:first-child > div {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 3px;
}

.score {
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 99px;
}

/* Stat bars */
.stat-bars {
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stat-bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.stat-bar-label {
  color: var(--text-muted);
  font-weight: 700;
}

.stat-bar-track {
  height: 8px;
  background: var(--bg-card-alt);
  border-radius: 99px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-bar-value {
  text-align: right;
  color: var(--text-muted);
  font-weight: 700;
}

/* Reason & Details */
.reason {
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.buy {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 14px 18px;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 800;
  transition: background 0.2s ease;
  min-height: 48px;
}

.buy:hover {
  background: #e4ff5c;
}

.why {
  margin-top: 20px;
}

.why h3 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
}

.why p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Notice & Footer */
.notice {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 22px;
  padding: 15px;
  background: var(--bg-card-alt);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.restart {
  margin-top: 20px;
  width: 100%;
}

.source-note {
  font-size: 11px;
  color: var(--text-muted);
  margin: 10px 0 0;
}

.shop-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 13px;
}

.shop-links-label {
  color: var(--text-muted);
}

.shop-link {
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.shop-link:hover {
  border-bottom-color: currentColor;
}

/* Selected & multi-select options */
.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-multi {
  display: flex;
  align-items: center;
  gap: 12px;
}

.check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--accent-ink);
}

.option-multi.selected .check {
  background: var(--accent);
  border-color: var(--accent);
}

.option-multi.selected .check::after {
  content: "✓";
}

.primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.primary:disabled:hover {
  background: var(--accent);
}

/* Player analysis */
.player-analysis {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 25px;
  margin: 30px 0 15px;
}

.player-analysis h3 {
  font-size: 15px;
  margin: 24px 0 10px;
  color: var(--text);
}

.stage {
  margin-top: 20px;
  padding: 18px;
  background: var(--bg-card-alt);
  border-radius: 16px;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stage-head b {
  font-size: 18px;
  color: var(--accent);
}

.stage-track {
  height: 10px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}

.stage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-labels {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.stage-labels .active {
  color: var(--accent);
  font-weight: 800;
}

.stage .hint {
  margin: 0;
}

.analysis-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
}

.tag-list-focus li {
  background: var(--bg-card-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.tip-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 14px;
}

.tip-list li {
  margin-bottom: 10px;
}

.tip-list li::marker {
  color: var(--accent);
  font-weight: 800;
}

/* Mobile */
@media (max-width: 650px) {
  .analysis-columns {
    grid-template-columns: 1fr;
  }

  .stage-labels span:not(.active) {
    display: none;
  }

  .player-analysis {
    padding: 20px 16px;
  }

  .options {
    grid-template-columns: 1fr;
  }

  .profile {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 22px;
  }

  .rec-title {
    display: block;
  }

  .score {
    margin-top: 5px;
    display: inline-block;
  }

  .hero {
    min-height: 78vh;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-select {
    padding: 32px 0;
  }

  .stat-bar-row {
    grid-template-columns: 88px 1fr 38px;
    font-size: 12px;
  }

  .analysis {
    padding: 20px 14px;
  }

  .rec-body {
    flex-direction: column;
  }

  .card-image {
    width: 100%;
    height: 140px;
  }

  .lang-toggle {
    top: 12px;
    right: 12px;
    padding: 7px 12px;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 40px;
  }

  .card h2 {
    font-size: 26px;
  }

  .actions {
    flex-direction: column;
  }
}

/* Link button (hero → browse) */
.link-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-top: 22px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-btn:hover {
  color: var(--accent);
}

/* Share section */
.share-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.share-actions .primary,
.share-actions .secondary {
  flex: 1;
  min-width: 140px;
}

/* Install banner */
.install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 18px;
  padding: 16px 18px;
  z-index: 90;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.install-banner b {
  color: var(--text);
  font-size: 15px;
}

.install-banner p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 4px 0 12px;
}

.install-banner-actions {
  display: flex;
  gap: 10px;
}

.install-banner-actions .primary,
.install-banner-actions .secondary {
  min-height: 40px;
  padding: 10px 16px;
  font-size: 13px;
}

/* Refine panel */
.refine-row {
  display: grid;
  grid-template-columns: 90px 52px 1fr 52px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

.refine-label {
  font-weight: 800;
  color: var(--text);
}

.refine-end {
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.refine-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 28px;
}

.refine-panel .secondary {
  margin-top: 8px;
}

/* Confidence badge */
.confidence-badge {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 15px;
  border: 1px solid var(--border);
  background: var(--bg-card-alt);
  color: var(--text-muted);
}

.confidence-badge.clear {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Upgrade check */
.upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.upgrade-row {
  display: grid;
  grid-template-columns: 1fr auto 56px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-card-alt);
  font-size: 13px;
  font-weight: 700;
}

.upgrade-label {
  color: var(--text);
}

.upgrade-values {
  color: var(--text-muted);
}

.upgrade-diff {
  text-align: right;
  font-weight: 900;
}

.upgrade-row.up .upgrade-diff {
  color: var(--accent);
}

.upgrade-row.down .upgrade-diff {
  color: var(--accent-3);
}

.upgrade-row.same .upgrade-diff {
  color: var(--text-muted);
}

/* Compare table */
.compare-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.compare-table th {
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  text-align: center;
  vertical-align: bottom;
}

.compare-table th:first-child,
.compare-row-label {
  text-align: left;
  color: var(--text-muted);
  font-weight: 700;
}

.compare-table td.compare-best {
  color: var(--accent);
  font-weight: 900;
  background: var(--accent-soft);
}

.compare-personal-row td {
  border-top: 2px solid var(--accent);
  font-weight: 800;
}

/* Browse personal score */
.browse-score {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.browse-score b {
  color: var(--accent);
}

@media (max-width: 650px) {
  .refine-row {
    grid-template-columns: 80px 1fr;
  }

  .refine-end {
    display: none;
  }

  .upgrade-row {
    grid-template-columns: 1fr auto 44px;
    padding: 9px 10px;
    font-size: 12px;
  }
}

/* Hero background: padel court + floating ball, kept subtle so it doesn't fight the text */
.hero {
  position: relative;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: -20px 0 auto auto;
  width: 60%;
  height: 130%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.hero-court {
  position: absolute;
  right: -20px;
  top: 50%;
  height: 100%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.07;
  transform: translateY(-50%) perspective(900px) rotateX(52deg) rotateZ(-18deg);
  animation: courtDrift 26s ease-in-out infinite alternate;
}

.hero-court .net {
  stroke-width: 2;
}

.hero-ball {
  position: absolute;
  width: 64px;
  height: 64px;
  right: 18%;
  top: 10%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 34% 32%, #f6ff9e, var(--accent) 55%, #93ab12);
  box-shadow: 0 0 50px 12px rgba(215, 242, 41, 0.12);
  opacity: 0.55;
  animation: ballFloat 9s ease-in-out infinite;
}

.hero-ball::before,
.hero-ball::after {
  content: "";
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.hero-ball::before { left: -64%; }
.hero-ball::after { left: 64%; }

@keyframes ballFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(18deg); }
}

@keyframes courtDrift {
  from { transform: translateY(-50%) perspective(900px) rotateX(52deg) rotateZ(-18deg); }
  to { transform: translateY(-52%) translateX(-16px) perspective(900px) rotateX(52deg) rotateZ(-12deg); }
}

.hero-float-images {
  position: absolute;
  inset: 0;
}

.hero-float {
  position: absolute;
  width: 84px;
  height: 84px;
  object-fit: contain;
  opacity: 0;
  filter: grayscale(0.3) brightness(1.1);
  border-radius: 14px;
  animation: heroFloatIn 1s ease-out forwards, heroFloatDrift 8s ease-in-out infinite;
}

.hero-float-1 { top: 6%; right: 8%; animation-delay: .5s, 1.5s; }
.hero-float-2 { top: 42%; right: 24%; width: 64px; height: 64px; animation-delay: .75s, 1.75s; }
.hero-float-3 { top: 66%; right: 2%; width: 96px; height: 96px; animation-delay: 1s, 2s; }

@keyframes heroFloatIn {
  from { opacity: 0; transform: translateY(14px) scale(0.9); }
  to { opacity: 0.32; transform: translateY(0) scale(1); }
}

@keyframes heroFloatDrift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (max-width: 720px) {
  .hero-bg {
    width: 85%;
    opacity: 0.7;
  }

  .hero-float-2 {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-float {
    display: none;
  }
}

/* Progress shimmer */
.progress div {
  background: linear-gradient(90deg, var(--accent), #f6ff9e, var(--accent));
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}

/* Option select pop */
.option.selected {
  animation: optionPop 0.25s ease;
}

@keyframes optionPop {
  50% { transform: scale(1.03); }
}

/* Radar polygons grow from the center */
.radar-user,
.radar-racket,
.radar-partner {
  transform-box: view-box;
  transform-origin: 150px 150px;
  animation: radarGrow 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.radar-racket {
  animation-delay: 0.15s;
}

@keyframes radarGrow {
  from { transform: scale(0.1); opacity: 0; }
}

/* Score ring */
@property --p {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.score-ring {
  --p: 0;
  position: relative;
  flex-shrink: 0;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-card-alt) 0);
  transition: --p 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--bg-card);
}

.score-ring .score {
  position: relative;
  background: none;
  padding: 0;
  font-size: 17px;
}

/* Top pick highlight */
.recommendation {
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.recommendation:hover {
  transform: translateY(-3px);
}

.recommendation.top-pick {
  position: relative;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 24px 60px rgba(215, 242, 41, 0.07);
}

/* Accessories */
.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.acc-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.acc-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.acc-card .card-image {
  width: 100%;
  height: 120px;
}

.acc-category {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.acc-body h3 {
  font-size: 14px;
  line-height: 1.3;
  margin: 4px 0 6px;
  color: var(--text);
}

.acc-why {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 8px;
}

.acc-price {
  font-weight: 900;
  color: var(--text);
}

.acc-body .buy {
  margin-top: 10px;
  padding: 10px 14px;
  font-size: 13px;
  min-height: 40px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 20px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Browse & compare */
.browse-section {
  padding: 40px 0 20px;
}

.browse-section > .badge {
  margin-bottom: 14px;
}

.browse-section > h1 {
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--text);
}

.browse-section > p {
  color: var(--text-muted);
  margin: 0 0 24px;
}

.browse-back {
  margin-bottom: 20px;
  width: auto;
}

.browse-controls {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.browse-select {
  background: var(--bg-card-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 700;
  height: 48px;
}

.compare-bar {
  position: sticky;
  top: 66px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.compare-bar .secondary {
  min-height: 36px;
  padding: 8px 14px;
  width: auto;
}

.browse-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}

.browse-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.browse-card:hover {
  border-color: var(--accent);
}

.browse-card .card-image {
  width: 100%;
  height: 130px;
}

.browse-card-body h3 {
  font-size: 15px;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.3;
}

.browse-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.browse-toggle {
  width: 100%;
  min-height: 40px;
  font-size: 13px;
}

.browse-toggle.selected {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 750px) {
  .browse-controls {
    grid-template-columns: 1fr 1fr;
  }

  .browse-controls .text-input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .browse-controls {
    grid-template-columns: 1fr;
  }

  .browse-controls .text-input {
    grid-column: auto;
  }

  .compare-bar {
    flex-direction: column;
    align-items: flex-start;
    top: 0;
  }
}

/* Hero stats */
.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin: 22px 0 6px;
  position: relative;
}

.hero-stat b {
  display: block;
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.hero-stat span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Score breakdown */
.breakdown {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(215, 242, 41, 0.18);
  border-radius: 14px;
  background: rgba(215, 242, 41, 0.035);
}

.breakdown summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
  list-style: none;
}

.breakdown summary::-webkit-details-marker { display: none; }

.breakdown summary::after {
  content: "▾";
  margin-left: 8px;
  display: inline-block;
  transition: transform 0.2s;
}

.breakdown:not([open]) summary::after { transform: rotate(-90deg); }

.bd-row {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr 44px;
  align-items: center;
  gap: 10px;
  margin: 7px 0;
  font-size: 13px;
}

.bd-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bd-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.bd-row.pos .bd-fill { background: linear-gradient(90deg, rgba(215, 242, 41, 0.5), var(--accent)); }
.bd-row.neg .bd-fill { background: linear-gradient(90deg, rgba(255, 138, 101, 0.5), var(--accent-3)); }
.bd-value { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.bd-row.pos .bd-value { color: var(--accent); }
.bd-row.neg .bd-value { color: var(--accent-3); }

.nogo-warning {
  font-size: 13px;
  color: var(--accent-3);
  border-left: 3px solid var(--accent-3);
  padding: 6px 10px;
  margin: 10px 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions .primary,
.hero-actions .secondary {
  width: auto;
}

.hero-compare-btn,
.results-browse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
}

.results-browse {
  margin: 4px auto 18px;
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .primary,
  .hero-actions .secondary {
    width: 100%;
  }
}

.compare-bar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compare-bar .primary {
  min-height: 36px;
  padding: 8px 14px;
  width: auto;
}

/* Live refine re-renders without replaying entry animations */
.static .anim-in,
.static .radar-user,
.static .radar-racket,
.static .radar-partner {
  animation: none !important;
}

/* Toggling a multi-select option re-renders the card without replaying the pop */
.no-anim .option.selected {
  animation: none;
}

.invite-own-test {
  display: block;
  margin-top: 14px;
}

@media (max-width: 720px) {
  /* keeps the "71%" label clear of the fixed language toggle */
  .progress-top {
    padding-right: 64px;
  }

  /* iOS zooms into inputs below 16px */
  .text-input,
  .browse-select {
    font-size: 16px;
  }
}

.static .stat-bar-fill,
.static .bd-fill {
  transition: none;
}

#questionCard h2:focus { outline: none; }
#questionCard h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (max-width: 560px) {
  .hero-stats { gap: 18px; }
  .hero-stat b { font-size: 24px; }
  .bd-row { grid-template-columns: 1fr 40px; }
  .bd-track { grid-column: 1 / -1; grid-row: 2; }
}
