/* ════════════════════════════════════════
   RESULTS — cards, radar, AI, share, comparator, clubs
   ════════════════════════════════════════ */

.result-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; margin-bottom: 20px; }
.result-title { font-family: 'Barlow Condensed', sans-serif; font-size: clamp(28px,4vw,48px); line-height: 1; letter-spacing: -.02em; margin-bottom: 10px; font-weight: 900; }

.confidence-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(15,23,42,.06);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; white-space: nowrap;
  font-family: 'Barlow Condensed', sans-serif;
}

.results-grid { display: grid; gap: 14px; }

.result-card { border: 1px solid var(--line); border-radius: var(--r-xl); background: #fff; box-shadow: var(--sh); overflow: hidden; position: relative; }
.result-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: linear-gradient(180deg,var(--gold),#ffe8a3); }
.result-card.rank-2::before { background: linear-gradient(180deg,var(--silver),#edf1f7); }
.result-card.rank-3::before { background: linear-gradient(180deg,var(--bronze),#ffd7ad); }
.result-inner { padding: 16px 16px 16px 20px; }
.result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.sport-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.medal {
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 900; font-family: 'Barlow Condensed', sans-serif; font-size: 18px;
  flex: 0 0 auto;
  background: linear-gradient(135deg,var(--gold),#ffe8a3);
  box-shadow: 0 6px 18px rgba(15,23,42,.12);
  border: 1px solid rgba(15,23,42,.08);
}
.rank-2 .medal { background: linear-gradient(135deg,var(--silver),#f8fafc); }
.rank-3 .medal { background: linear-gradient(135deg,var(--bronze),#ffd7ad); }
.sport-title h3 { margin: 0; font-family: 'Barlow Condensed', sans-serif; font-size: clamp(20px,2.5vw,28px); line-height: 1.05; letter-spacing: -.01em; font-weight: 900; }

.percent { min-width: 72px; text-align: right; font-family: 'Barlow Condensed', sans-serif; font-size: 30px; line-height: 1; font-weight: 900; }
.percent small { display: block; font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; font-family: 'Barlow', sans-serif; font-weight: 600; }

.scorebar { height: 8px; border-radius: 999px; background: rgba(15,23,42,.07); overflow: hidden; margin-bottom: 12px; }
.scorebar-fill {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg,var(--blue),var(--green),var(--yellow));
  transition: width .65s cubic-bezier(.22,1,.36,1);
}

/* ── TAGS ── */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: #f8fafc;
  color: #334155; font-size: 12px; font-weight: 600;
}
.tag.safety-high { background: rgba(0,159,61,.08);  border-color: rgba(0,159,61,.20);  color: #075e2d; }
.tag.safety-mid  { background: rgba(244,195,0,.11); border-color: rgba(244,195,0,.26); color: #604800; }
.tag.safety-low  { background: rgba(223,0,36,.08);  border-color: rgba(223,0,36,.20);  color: #8a1022; }
.tag.cost-low    { background: rgba(0,159,61,.07);  border-color: rgba(0,159,61,.18);  color: #075e2d; }
.tag.cost-mid    { background: rgba(244,195,0,.10); border-color: rgba(244,195,0,.24); color: #604800; }
.tag.cost-high   { background: rgba(223,0,36,.07);  border-color: rgba(223,0,36,.18);  color: #8a1022; }

.explanation { color: #334155; line-height: 1.6; font-size: 14px; margin-bottom: 14px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── WHY breakdown ── */
.why-list { margin-top: 10px; margin-bottom: 14px; display: grid; gap: 5px; }
.why-row  { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; }
.why-row .why-icon { font-size: 14px; flex: 0 0 auto; }
.why-row .why-bar  { flex: 1; height: 5px; background: rgba(15,23,42,.07); border-radius: 999px; overflow: hidden; }
.why-row .why-fill { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg,var(--blue),var(--green));
  transition: width .6s .3s cubic-bezier(.22,1,.36,1); }
.why-row .why-pts  { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 13px; min-width: 32px; text-align: right; color: var(--muted); }

/* ── LEAD BOX ── */
.lead-box {
  margin-top: 20px; border-radius: var(--r-xl);
  border: 1px solid rgba(0,133,199,.18);
  background: radial-gradient(380px 140px at 0% 0%, rgba(0,133,199,.09), transparent 65%), #fff;
  box-shadow: var(--sh); padding: 20px;
}
.lead-box h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 900; margin-bottom: 6px; letter-spacing: -.01em; }
.lead-box p  { color: var(--muted); line-height: 1.55; font-size: 14px; margin-bottom: 14px; }
.lead-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 12px; }

/* ── RADAR ── */
.radar-wrap { margin: 18px 0 6px; border-radius: var(--r-xl); border: 1px solid var(--line); background: #fff; box-shadow: var(--sh); padding: 18px; overflow: hidden; }
.radar-title { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 900; margin-bottom: 14px; letter-spacing: -.01em; }
.radar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.radar-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #334155; }
.radar-legend-dot  { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

/* ── AI PANEL ── */
.ai-panel {
  margin-top: 10px; border-radius: var(--r-xl);
  border: 1px solid rgba(0,133,199,.20);
  background: radial-gradient(420px 140px at 0% 0%, rgba(0,133,199,.08), transparent 65%), #fff;
  box-shadow: var(--sh); overflow: hidden;
}
.ai-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  gap: 10px; flex-wrap: wrap;
}
.ai-panel-head h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 900; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.ai-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ai-tab {
  padding: 6px 13px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--muted); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: border-color .13s, color .13s, background .13s;
}
.ai-tab:hover  { border-color: rgba(0,133,199,.3); color: var(--blue); }
.ai-tab.active { border-color: var(--blue); background: rgba(0,133,199,.08); color: var(--blue); }
.ai-body { padding: 18px; min-height: 80px; font-size: 14px; line-height: 1.7; color: #334155; }
.ai-body.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-style: italic; }
.ai-spinner { width: 18px; height: 18px; border-radius: 999px;
  border: 2px solid rgba(0,133,199,.2); border-top-color: var(--blue);
  animation: spin .7s linear infinite; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-body p { margin-bottom: 10px; }
.ai-body p:last-child { margin-bottom: 0; }
.ai-body strong { color: var(--ink); }
.ai-plan-week { margin-bottom: 14px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: #f8fafc; }
.ai-plan-week h4 { font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 900; margin-bottom: 6px; color: var(--blue); }

/* ── SHARE BAR ── */
.share-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
}
.share-bar p { width: 100%; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.share-url-box { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 200px; }
.share-url-input {
  flex: 1; min-height: 38px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 8px 12px; font-size: 12px; color: var(--muted);
  background: #f8fafc; font-family: monospace; outline: 0; cursor: text;
  transition: border-color .14s;
}
.share-url-input:focus { border-color: rgba(0,133,199,.4); }

/* ── COMPARE TRIGGER ── */
.compare-trigger {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.compare-trigger p { width: 100%; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }

/* ── COMPARATOR MODAL ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(7,17,31,.55);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  width: min(780px,100%); max-height: 90vh; overflow-y: auto;
  border-radius: var(--r-xl); background: #fff;
  box-shadow: 0 32px 80px rgba(7,17,31,.28);
  border: 1px solid var(--line);
  animation: modal-in .22s cubic-bezier(.22,1,.36,1);
}
@keyframes modal-in {
  from { opacity:0; transform: translateY(16px) scale(.97); }
  to   { opacity:1; transform: none; }
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.modal-head h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 900; letter-spacing: -.01em; }
.modal-close {
  width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  cursor: pointer; display: grid; place-items: center;
  font-size: 16px; color: var(--muted);
  transition: background .13s, color .13s;
}
.modal-close:hover { background: #f1f5f9; color: var(--ink); }

.cmp-pick {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 12px; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.cmp-pick select {
  width: 100%; min-height: 44px;
  border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 10px 12px; font-size: 15px; font-weight: 700;
  font-family: inherit; color: var(--ink); background: #fff;
  cursor: pointer; outline: 0;
  transition: border-color .14s;
}
.cmp-pick select:focus { border-color: rgba(0,133,199,.45); }
.cmp-vs { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 900; color: var(--muted); text-align: center; white-space: nowrap; }

.cmp-table { width: 100%; border-collapse: collapse; }
.cmp-table th, .cmp-table td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.cmp-table th { font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #f8fafc; }
.cmp-table th:first-child { color: var(--ink); font-size: 11px; }
.cmp-table td:first-child { color: var(--muted); font-weight: 600; font-size: 13px; }
.cmp-table td.winner { background: rgba(0,159,61,.06); color: #075e2d; font-weight: 700; }
.cmp-table td.loser  { color: var(--muted); }
.cmp-table tr:last-child td { border-bottom: 0; }

.cmp-bar-cell { display: flex; align-items: center; gap: 8px; }
.cmp-bar { flex: 1; height: 6px; background: rgba(15,23,42,.07); border-radius: 999px; overflow: hidden; }
.cmp-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,var(--blue),var(--green)); }

.cmp-verdict {
  margin: 16px 22px 22px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: radial-gradient(360px 120px at 0% 0%, rgba(0,133,199,.09), transparent 65%), #f8fafc;
  border: 1px solid rgba(0,133,199,.14);
  font-size: 14px; line-height: 1.6; color: #334155;
}
.cmp-verdict strong { color: var(--ink); }

/* ── CLUBS SECTION ── */
.clubs-section {
  margin-top: 14px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(0,159,61,.18);
  background: radial-gradient(380px 140px at 0% 0%, rgba(0,159,61,.07), transparent 65%), #fff;
  box-shadow: var(--sh); overflow: hidden;
}
.clubs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  gap: 12px; flex-wrap: wrap;
}
.clubs-header h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 900; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}

.geo-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  border: 1px solid var(--line); background: #f8fafc; color: var(--muted);
}
.geo-status.locating { border-color: rgba(244,195,0,.3); background: rgba(244,195,0,.09); color: #604800; }
.geo-status.located  { border-color: rgba(0,159,61,.25); background: rgba(0,159,61,.08); color: #075e2d; }
.geo-status.error    { border-color: rgba(223,0,36,.22); background: rgba(223,0,36,.07); color: #8a1022; }

.geo-dot {
  width: 7px; height: 7px; border-radius: 999px; flex: 0 0 auto;
  background: var(--muted);
}
.geo-status.locating .geo-dot { background: var(--yellow); animation: pulse-dot 1.2s infinite; }
.geo-status.located  .geo-dot { background: var(--green); }
.geo-status.error    .geo-dot { background: var(--red); }

@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.city-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.city-tab {
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff; color: var(--muted);
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit;
  transition: border-color .13s, color .13s, background .13s;
}
.city-tab:hover  { border-color: rgba(0,133,199,.3); color: var(--blue); }
.city-tab.active { border-color: var(--blue); background: rgba(0,133,199,.08); color: var(--blue); }
.city-tab.nearest::after { content: ' 📍'; }

.clubs-list {
  display: grid; gap: 0;
  max-height: 400px; overflow-y: auto;
}

.club-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: start;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.club-row:last-child { border-bottom: 0; }
.club-row:hover { background: #f8fafc; }

.club-sport-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; border-radius: var(--r-md);
  background: rgba(0,133,199,.10); color: var(--blue);
  font-size: 16px; flex: 0 0 auto;
}

.club-info { min-width: 0; }
.club-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px; font-weight: 900;
  letter-spacing: -.01em; line-height: 1.15;
  color: var(--ink); margin-bottom: 2px;
}
.club-addr { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 4px; }
.club-social { display: flex; flex-wrap: wrap; gap: 5px; }
.club-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: #f8fafc;
  color: #334155; font-size: 11px; font-weight: 700;
  text-decoration: none !important;
  transition: border-color .12s, color .12s;
}
.club-link:hover { border-color: rgba(0,133,199,.3); color: var(--blue); }

.club-distance {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--muted);
  white-space: nowrap; text-align: right;
  flex: 0 0 auto;
}
.club-distance.near { color: var(--green); }

.clubs-empty {
  padding: 28px 18px; text-align: center;
  color: var(--muted); font-size: 14px; line-height: 1.6;
}

.clubs-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); line-height: 1.5;
}

/* ── CONFETTI CANVAS ── */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 9999; display: none; }

@media (max-width:860px) {
  .lead-grid { grid-template-columns: 1fr; }
  .result-head { grid-template-columns: 1fr; }
}
@media (max-width:520px) {
  .result-actions { flex-direction: column; align-items: stretch; }
  .result-top { flex-direction: column; }
  .percent { text-align: left; }
  .radar-wrap svg { width: 100% !important; height: auto !important; }
  .share-url-box  { flex-direction: column; align-items: stretch; }
}
