/* ============================================
   MatchSire — Horse Breeding Simulator
   Standing Stallions — ai.standingstallions.com
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep: #0a0a1a;
  --bg-card: #111127;
  --bg-card-hover: #1a1a3a;
  --gold: #C9A961;
  --gold-light: #e8c76a;
  --gold-dark: #b8922e;
  --silver: #c0c0c0;
  --silver-light: #e0e0e0;
  --teal: #00d4aa;
  --danger: #ef4444;
  --success: #4ade80;
  --warning: #f59e0b;
  --text: #f5f5f5;
  --text-muted: #6b7280;
  --text-dim: #4a4a6a;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --border-radius: 12px;
  --glow-gold: 0 0 30px rgba(212, 168, 67, 0.3);
  --glow-teal: 0 0 20px rgba(0, 212, 170, 0.3);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--gold-light); }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; }

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 168, 67, 0.1);
  transition: all 0.3s;
}

.navbar.scrolled {
  padding: 0.6rem 2rem;
  background: rgba(10, 10, 26, 0.95);
  border-bottom-color: rgba(212, 168, 67, 0.25);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-brand-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.nav-brand-text span { color: var(--text); font-weight: 400; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-deep) !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s;
}

.nav-cta:hover {
  box-shadow: var(--glow-gold);
  transform: translateY(-1px);
  color: var(--bg-deep) !important;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 2rem;
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg-deep) 75%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2rem;
  opacity: 0;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  opacity: 0;
}

.hero h1 .gold { color: var(--gold); }
.hero h1 .line { display: block; }

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  opacity: 0;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-deep);
}

.btn-primary:hover {
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
  color: var(--bg-deep);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: bobble 2s infinite;
}

@keyframes bobble {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}

/* --- Section Styles --- */
.section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- How It Works --- */
.how-it-works {
  position: relative;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  position: relative;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.1);
  border-radius: var(--border-radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.step-card:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 168, 67, 0.3);
  box-shadow: var(--glow-gold);
}

.step-card:hover::before { opacity: 1; }

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.1);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--gold);
  margin: 0 auto 1.5rem;
}

.step-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.step-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Simulator Section --- */
.simulator-section {
  padding: 6rem 2rem;
  position: relative;
}

.simulator-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, rgba(212, 168, 67, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.simulator-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Parent Selection */
.parent-selection {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}

.parent-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: var(--border-radius);
  padding: 2rem;
  transition: all 0.3s;
}

.parent-card:hover {
  border-color: rgba(212, 168, 67, 0.3);
}

.parent-card.stallion { border-top: 3px solid var(--gold); }
.parent-card.mare { border-top: 3px solid var(--silver); }

.parent-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.parent-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stallion .parent-icon { background: rgba(212, 168, 67, 0.15); }
.mare .parent-icon { background: rgba(192, 192, 192, 0.15); }

.parent-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.parent-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.stallion .parent-title { color: var(--gold); }
.mare .parent-title { color: var(--silver-light); }

.gene-group {
  margin-bottom: 1.25rem;
}

.gene-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gene-label .info-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: help;
  color: var(--text-dim);
  transition: all 0.3s;
}

.gene-label .info-icon:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.gene-select {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(10, 10, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.gene-select:hover { border-color: rgba(212, 168, 67, 0.3); }
.gene-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1); }

.gene-select option {
  background: var(--bg-deep);
  color: var(--text);
}

/* Center connector */
.breed-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 3rem;
}

.connector-line {
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, var(--gold), var(--silver));
  border-radius: 1px;
}

.connector-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid rgba(212, 168, 67, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s;
}

/* Simulate Button */
.simulate-area {
  text-align: center;
  margin-bottom: 3rem;
}

.btn-simulate {
  padding: 1rem 3rem;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  background-size: 200% 200%;
  color: var(--bg-deep);
  border: none;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.btn-simulate::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s;
}

.btn-simulate:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(212, 168, 67, 0.4);
  animation: shimmer-legacy 2s infinite;
}

.btn-simulate:hover::before {
  left: 100%;
}

@keyframes shimmer-legacy {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-simulate:active { transform: translateY(-1px); }

.btn-simulate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* DNA Animation Overlay */
.dna-animation-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 26, 0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
}

.dna-animation-overlay.active { display: flex; }

.dna-animation-overlay canvas {
  max-width: 400px;
  max-height: 400px;
}

.dna-status-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 2px;
  animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Results Panel */
.results-panel {
  display: none;
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: var(--border-radius);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

.results-panel.active { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-header {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.1), rgba(0, 212, 170, 0.05));
  padding: 2rem;
  border-bottom: 1px solid rgba(212, 168, 67, 0.1);
  text-align: center;
}

.results-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.results-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.results-body {
  padding: 2rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* Foal Card */
.foal-card {
  background: rgba(10, 10, 26, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
}

.foal-silhouette {
  width: 200px;
  height: 160px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.foal-silhouette svg {
  width: 100%;
  height: 100%;
}

.foal-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.foal-genotype {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gold);
  padding: 0.25rem 0.75rem;
  background: rgba(212, 168, 67, 0.1);
  border-radius: 4px;
  display: inline-block;
}

/* Probability Bars */
.prob-section {
  margin-bottom: 2rem;
}

.prob-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prob-item {
  margin-bottom: 0.75rem;
}

.prob-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.prob-label span:last-child {
  font-family: var(--font-mono);
  color: var(--gold);
}

.prob-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.prob-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

.prob-fill.bay { background: linear-gradient(90deg, #8B4513, #cd853f); }
.prob-fill.black { background: linear-gradient(90deg, #1a1a2e, #333); }
.prob-fill.chestnut { background: linear-gradient(90deg, #8B2500, #cd5c3c); }
.prob-fill.gold-fill { background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }
.prob-fill.teal-fill { background: linear-gradient(90deg, #007a5e, var(--teal)); }

/* Health / Disease Risk */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(10, 10, 26, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.health-shield {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.health-shield.clear { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.health-shield.carrier { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.health-shield.affected { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.health-info .health-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.health-info .health-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Gait Section */
.gait-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.gait-display {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.gait-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 200px;
  padding: 1rem;
  background: rgba(10, 10, 26, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gait-icon {
  font-size: 2rem;
  min-width: 40px;
  text-align: center;
}

.gait-name {
  font-weight: 600;
  font-size: 1rem;
}

.gait-prob {
  font-family: var(--font-mono);
  color: var(--teal);
  font-size: 0.9rem;
}

/* --- Punnett Square Section --- */
.punnett-section {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, var(--bg-deep), rgba(17, 17, 39, 0.5), var(--bg-deep));
}

.punnett-container {
  max-width: 1000px;
  margin: 0 auto;
}

.punnett-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.punnett-btn {
  padding: 0.5rem 1.25rem;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 8px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.punnett-btn:hover, .punnett-btn.active {
  background: rgba(212, 168, 67, 0.2);
  border-color: var(--gold);
}

.punnett-grid-wrapper {
  display: flex;
  justify-content: center;
}

.punnett-grid {
  display: grid;
  grid-template-columns: auto repeat(2, 1fr);
  grid-template-rows: auto repeat(2, 1fr);
  gap: 4px;
  max-width: 400px;
  width: 100%;
}

.punnett-cell {
  padding: 1.25rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  border-radius: 8px;
  transition: all 0.3s;
}

.punnett-header {
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
}

.punnett-header.stallion-header { color: var(--gold); }
.punnett-header.mare-header { color: var(--silver); }

.punnett-result {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
}

.punnett-result:hover {
  border-color: var(--gold);
  transform: scale(1.05);
  z-index: 1;
}

.punnett-result .genotype {
  font-size: 1rem;
  font-weight: 700;
}

.punnett-result .phenotype {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.punnett-result .pct {
  font-size: 0.75rem;
  color: var(--teal);
  margin-top: 0.15rem;
}

.punnett-corner { background: transparent; }

.punnett-legend {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Foal Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.1);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
}

.gallery-item:hover {
  border-color: rgba(212, 168, 67, 0.3);
  transform: translateY(-3px);
}

.gallery-horse {
  width: 120px;
  height: 100px;
  margin: 0 auto 1rem;
}

.gallery-horse svg { width: 100%; height: 100%; }

.gallery-color {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gallery-genotype {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gold);
}

.gallery-prob {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--teal);
  margin-top: 0.5rem;
}

/* Compatibility Score */
.compat-ring-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.compat-ring {
  position: relative;
  width: 180px;
  height: 180px;
}

.compat-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.compat-ring .ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.compat-ring .ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.compat-score {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.compat-number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
}

.compat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid rgba(212, 168, 67, 0.1);
  padding: 4rem 2rem 2rem;
  background: rgba(10, 10, 26, 0.5);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand .brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 400px;
}

.footer-col h4 {
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer-standing-stallions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.3s;
}

.footer-standing-stallions:hover { color: var(--gold); }

/* --- Sound Toggle --- */
.sound-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s;
  font-size: 1.1rem;
}

.sound-toggle:hover {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

/* --- Tooltip --- */
.tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text);
  max-width: 250px;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tooltip.visible { opacity: 1; }

/* --- Loading Shimmer --- */
@keyframes shimmerLoad {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-card), var(--bg-card-hover), var(--bg-card));
  background-size: 200% 100%;
  animation: shimmerLoad 1.5s infinite;
}

/* --- Mobile Responsive --- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 26, 0.98);
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(212, 168, 67, 0.1);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .parent-selection {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .breed-connector {
    flex-direction: row;
    padding-top: 0;
  }

  .connector-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(to right, var(--gold), var(--silver));
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero h1 { font-size: 2.2rem; }
  .section { padding: 4rem 1.5rem; }
}

@media (max-width: 600px) {
  .navbar { padding: 0.75rem 1rem; }
  .hero { min-height: 90vh; padding: 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .btn { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
  .btn-simulate { padding: 0.85rem 2rem; font-size: 1rem; }
  .punnett-cell { padding: 0.75rem; font-size: 0.9rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════
   DOCUMENT UPLOAD & OCR SECTION
   ═══════════════════════════════════════════ */

.upload-section {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, var(--bg-deep), rgba(17, 17, 39, 0.3), var(--bg-deep));
  position: relative;
}

.upload-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(0, 212, 170, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.upload-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Moat badge */
.moat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.25);
  border-radius: 50px;
  font-size: 0.78rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.moat-badge .lock-icon { font-size: 0.9rem; }

/* Target selection (stallion/mare) */
.upload-target-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.target-btn {
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.target-btn:hover { border-color: rgba(212, 168, 67, 0.3); color: var(--text); }

.target-btn.active {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold);
}

.target-btn.active.stallion-target { border-color: var(--gold); color: var(--gold); }
.target-btn.active.mare-target { border-color: var(--silver); color: var(--silver-light); }

/* Document type tabs */
.doc-type-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.doc-type-btn {
  padding: 0.6rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-type-btn:hover { border-color: rgba(0, 212, 170, 0.3); color: var(--text); }

.doc-type-btn.active {
  border-color: var(--teal);
  background: rgba(0, 212, 170, 0.08);
  color: var(--teal);
}

.doc-type-btn .doc-icon { font-size: 1.1rem; }

.doc-type-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 2rem;
  min-height: 1.2rem;
}

/* ── Dropzone ── */
.upload-dropzone {
  position: relative;
  border: 2px dashed rgba(212, 168, 67, 0.25);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s;
  background: rgba(17, 17, 39, 0.5);
  overflow: hidden;
}

.upload-dropzone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(212, 168, 67, 0.02), transparent 70%);
  transition: all 0.4s;
}

.upload-dropzone:hover {
  border-color: rgba(212, 168, 67, 0.5);
  background: rgba(17, 17, 39, 0.7);
}

.upload-dropzone:hover::before {
  background: radial-gradient(circle at center, rgba(212, 168, 67, 0.05), transparent 70%);
}

.upload-dropzone.dragover {
  border-color: var(--teal);
  border-style: solid;
  background: rgba(0, 212, 170, 0.05);
  transform: scale(1.01);
}

.upload-dropzone.dragover::before {
  background: radial-gradient(circle at center, rgba(0, 212, 170, 0.08), transparent 70%);
}

.upload-dropzone.has-file {
  border-style: solid;
  border-color: rgba(212, 168, 67, 0.3);
}

.upload-dropzone.error {
  border-color: var(--danger);
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.dropzone-content {
  position: relative;
  z-index: 1;
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.dropzone-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.dropzone-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.dropzone-formats {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.format-tag {
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.dropzone-size-hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

#upload-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

.upload-dropzone.has-file .dropzone-content { display: none; }

/* ── File Preview ── */
.file-preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(10, 10, 26, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: 10px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.file-preview-icon {
  font-size: 2rem;
  min-width: 40px;
  text-align: center;
}

.file-preview-info { flex: 1; }

.file-preview-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.file-preview-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.file-preview-remove {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.file-preview-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
}

.file-preview-thumb {
  margin-top: 1rem;
  height: 200px;
  border-radius: 8px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(10, 10, 26, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

/* Extract Button */
#extract-btn {
  display: none;
  margin: 1.5rem auto 0;
  padding: 0.85rem 2.5rem;
  background: linear-gradient(135deg, #007a5e, var(--teal));
  color: var(--bg-deep);
  border: none;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  gap: 0.5rem;
  align-items: center;
}

#extract-btn:hover {
  box-shadow: var(--glow-teal);
  transform: translateY(-2px);
}

#extract-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.extract-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 10, 26, 0.3);
  border-top-color: var(--bg-deep);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Extraction Results ── */
.extraction-results {
  display: none;
  margin-top: 2rem;
}

.extraction-results.active { display: block; }

#extraction-status {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--teal);
  padding: 1rem 0;
  min-height: 3rem;
}

.pulse-text { animation: fadeInOut 1s ease-in-out; }

.extraction-results:not(.complete) #extracted-data { display: none; }
.extraction-results.complete #extraction-status { display: none; }

/* Extraction Card */
.extraction-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 170, 0.15);
  border-radius: var(--border-radius);
  padding: 2rem;
  animation: slideUp 0.5s ease-out;
}

.extraction-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
}

.extraction-badge.lab-badge {
  background: rgba(0, 212, 170, 0.1);
  border-color: rgba(0, 212, 170, 0.3);
  color: var(--teal);
}

.verified-icon {
  font-weight: 700;
}

.extraction-header {
  margin-bottom: 1.5rem;
}

.extraction-horse-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
}

.extraction-reg {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.extraction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.extraction-field {
  padding: 0.75rem;
  background: rgba(10, 10, 26, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.extraction-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.extraction-value {
  font-size: 1rem;
  font-weight: 600;
}

.extraction-value.gold { color: var(--gold); }

.extraction-genotypes {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.genotype-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.genotype-chip {
  padding: 0.3rem 0.75rem;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.genotype-chip strong { color: var(--gold); }

/* Genetic Test Results Grid */
.test-results-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.test-result-row {
  display: grid;
  grid-template-columns: 100px 80px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: rgba(10, 10, 26, 0.4);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.test-gene {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.test-genotype code {
  font-family: var(--font-mono);
  background: rgba(212, 168, 67, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--gold);
  font-size: 0.85rem;
}

.test-status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.test-status.clear { color: var(--success); }
.test-status.carrier { color: var(--warning); }
.test-status.info { color: var(--teal); }

/* Pedigree Tree */
.pedigree-tree {
  padding: 1.5rem 0;
}

.pedigree-level {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pedigree-node {
  padding: 1rem;
  background: rgba(10, 10, 26, 0.5);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.pedigree-node.sire {
  border-left: 3px solid var(--gold);
}

.pedigree-node.dam {
  border-left: 3px solid var(--silver);
}

.pedigree-sub {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pedigree-sub span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  padding-left: 0.75rem;
  position: relative;
}

.pedigree-sub span::before {
  content: '└';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

/* Auto-fill area */
.autofill-area {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.autofill-btn {
  font-size: 1rem;
  padding: 0.85rem 2.5rem;
}

.autofill-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

/* Auto-fill toast */
.autofill-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
}

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

.toast-icon { font-size: 1.1rem; }

/* ── Mobile responsive for upload ── */
@media (max-width: 900px) {
  .extraction-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .test-result-row {
    grid-template-columns: 80px 70px 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) {
  .upload-dropzone { padding: 2rem 1.5rem; }
  .extraction-grid { grid-template-columns: 1fr; }
  .pedigree-level { grid-template-columns: 1fr; }
  .upload-target-row { gap: 0.5rem; }
  .doc-type-btn { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
  .file-preview-name { max-width: 180px; }
}

/* ── Auth Nav ── */
.nav-user-name {
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 500;
}
.nav-auth-link {
  color: var(--gold) !important;
  font-weight: 600;
}
.nav-logout-link {
  color: var(--text-muted) !important;
  font-size: 0.82rem !important;
}
.nav-login-cta {
  padding: 0.4rem 1rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #0a0a1a !important;
  border-radius: 8px;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
}

/* ══════════════════════════════════════════════════════
   GENE PUSH-BUTTON SELECTORS (Upgrade 1)
   ══════════════════════════════════════════════════════ */

.gene-label-sub {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-top: -0.2rem;
  margin-bottom: 0.55rem;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.gene-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0.3rem;
  margin-bottom: 0.25rem;
}

.gene-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 10px 7px;
  background: linear-gradient(145deg, #1a1a2e, #0f0f1a);
  border: 2px solid rgba(212, 168, 67, 0.14);
  border-radius: 10px;
  color: #777;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow:
    4px 4px 12px rgba(0,0,0,0.45),
    -2px -2px 8px rgba(255,255,255,0.025),
    inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  flex: 1;
  min-width: 58px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gene-btn:hover {
  border-color: rgba(212, 168, 67, 0.38);
  color: #bbb;
  transform: translateY(-1px);
  box-shadow:
    6px 6px 16px rgba(0,0,0,0.55),
    -2px -2px 10px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.gene-btn:active {
  transform: translateY(0);
  box-shadow:
    2px 2px 6px rgba(0,0,0,0.5),
    inset 0 2px 4px rgba(0,0,0,0.3);
}

.gene-btn.active {
  background: linear-gradient(145deg, #2a1a06, #1c1200);
  border-color: #C9A961;
  color: #C9A961;
  transform: translateY(-1px);
  box-shadow:
    0 0 18px rgba(212, 168, 67, 0.18),
    4px 4px 14px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,220,100,0.08);
}

.gene-btn.active .hs-icon::before {
  border-color: #C9A961;
  box-shadow: 0 0 6px rgba(212,168,67,0.5);
}

/* Horseshoe icon */
.hs-icon {
  display: block;
  width: 14px;
  height: 10px;
  position: relative;
}
.hs-icon::before {
  content: '';
  display: block;
  width: 11px;
  height: 8px;
  border: 2px solid rgba(255,255,255,0.22);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  margin: 0 auto;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.hs-icon::after {
  content: '';
  display: block;
  width: 5px;
  height: 3px;
  border-left: 2px solid rgba(255,255,255,0.22);
  border-right: 2px solid rgba(255,255,255,0.22);
  margin: 0 auto;
  transition: border-color 0.18s;
}
.gene-btn.active .hs-icon::after {
  border-color: #C9A961;
}

.btn-geno {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

.btn-pheno {
  font-size: 8.5px;
  line-height: 1.25;
  text-align: center;
  opacity: 0.72;
  max-width: 68px;
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 480px) {
  .gene-btn-group { gap: 4px; }
  .gene-btn {
    min-width: calc(50% - 4px);
    flex: 1 1 calc(50% - 4px);
  }
  .btn-geno { font-size: 10px; }
  .btn-pheno { font-size: 8px; }
}

/* ══════════════════════════════════════════════════════
   ENHANCED FOAL GALLERY (Upgrade 2)
   ══════════════════════════════════════════════════════ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  background: linear-gradient(160deg, rgba(10,8,24,0.92) 0%, rgba(18,12,32,0.98) 100%);
  border: 1px solid rgba(212,168,67,0.15);
  border-radius: 16px;
  padding: 1.4rem 1rem 1.1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.gallery-item::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(212,168,67,0.10) 0%, transparent 68%);
  pointer-events: none;
}

.gallery-item:hover {
  transform: translateY(-3px);
  border-color: rgba(212,168,67,0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 24px rgba(212,168,67,0.08);
}

.gallery-horse {
  width: 100%;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 0.9rem;
}

.gallery-horse svg {
  width: 100%;
  height: auto;
  max-height: 220px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.65));
  transition: filter 0.22s ease;
}

.gallery-item:hover .gallery-horse svg {
  filter: drop-shadow(0 8px 22px rgba(0,0,0,0.75)) drop-shadow(0 0 12px rgba(212,168,67,0.12));
}

.gallery-horse::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 18px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

.gallery-color {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8d8b0;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.gallery-prob {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 0 14px rgba(212,168,67,0.4);
}

.gallery-prob-bar {
  height: 2px;
  background: rgba(212,168,67,0.15);
  border-radius: 2px;
  margin: 0.45rem auto;
  width: 60%;
  overflow: hidden;
}
.gallery-prob-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #C9A961, #f5c842);
  border-radius: 2px;
  transition: width 1s ease;
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .gallery-horse { min-height: 130px; }
  .gallery-color { font-size: 0.9rem; }
  .gallery-prob  { font-size: 1rem; }
}

/* === BUTTON FIX: Better spacing, symmetry, clear selection === */
.gene-btn-group {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px !important;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.gene-btn {
  padding: 12px 14px 10px !important;
  min-width: 110px !important;
  border-radius: 12px !important;
  border: 2px solid rgba(100, 100, 140, 0.25) !important;
  background: linear-gradient(160deg, #1e1e35, #141428) !important;
  color: #888 !important;
  font-size: 13px !important;
  text-align: center !important;
}
.gene-btn .gb-code {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.gene-btn .gb-label {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  white-space: nowrap;
}
/* CLEAR selected state - unmistakable gold */
.gene-btn.active {
  background: linear-gradient(160deg, #2d1f08, #1a1200) !important;
  border: 2px solid #C9A961 !important;
  color: #D4B570 !important;
  box-shadow:
    0 0 24px rgba(212, 168, 67, 0.25),
    0 4px 16px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,220,100,0.12) !important;
  transform: translateY(-2px) scale(1.02) !important;
}
.gene-btn.active .gb-code {
  color: #C9A961 !important;
  text-shadow: 0 0 8px rgba(212,168,67,0.4);
}
.gene-btn.active::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  color: #C9A961;
}
/* Unselected: clearly recessed */
.gene-btn:not(.active) {
  box-shadow:
    inset 2px 2px 6px rgba(0,0,0,0.4),
    inset -1px -1px 3px rgba(255,255,255,0.02) !important;
}
.gene-btn:not(.active):hover {
  border-color: rgba(212,168,67,0.35) !important;
  color: #aaa !important;
  transform: translateY(-1px) !important;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

/* === GENETICS SUMMARY TABLE === */
.genetics-summary {
  background: linear-gradient(160deg, #12122a, #0d0d1e);
  border: 1px solid rgba(212,168,67,0.2);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 20px 0;
  position: sticky;
  top: 80px;
  z-index: 10;
}
.genetics-summary h4 {
  color: #C9A961;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.genetics-summary table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.genetics-summary th {
  color: #999;
  font-weight: 400;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.genetics-summary td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.genetics-summary td:first-child {
  color: #ccc;
  font-weight: 500;
}
.genetics-summary td:nth-child(2),
.genetics-summary td:nth-child(3) {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}
.genetics-summary .gs-stallion { color: #C9A961; }
.genetics-summary .gs-mare { color: #c0c0c0; }
.genetics-summary .gs-unknown { color: #555; font-style: italic; }
.genetics-summary .gs-set { color: #4ade80; }

/* === STANDING STALLIONS BRAND MATCH === */
:root {
  --bg-primary: #0B1929 !important;      /* Deep navy like Standing Stallions */
  --bg-secondary: #0F2035 !important;    /* Slightly lighter navy */
  --bg-card: #132845 !important;         /* Card background - navy */
  --bg-card-hover: #1A3355 !important;
  --gold: #C9A961 !important;            /* Standing Stallions muted gold */
  --gold-bright: #D4B570 !important;
  --gold-dim: #A08840 !important;
  --border: rgba(201,169,97,0.2) !important;
}

body {
  background: #0B1929 !important;
}

/* Nav/Header match */
.site-header, header, .navbar, nav {
  background: #0B1929 !important;
  border-bottom: 1px solid rgba(201,169,97,0.15) !important;
}

/* Hero section */
.hero, .hero-section, [class*="hero"] {
  background: transparent !important;
}

/* All gold accents → Standing Stallions gold */
.btn-simulate, .btn-primary, [class*="btn-gold"], .cta-btn {
  background: linear-gradient(135deg, #C9A961, #A08840) !important;
  color: #0B1929 !important;
}
.btn-simulate:hover, .btn-primary:hover {
  background: linear-gradient(135deg, #D4B570, #B09950) !important;
}

/* Cards */
.card, .sim-card, .result-card, [class*="card"] {
  background: #132845 !important;
  border-color: rgba(201,169,97,0.15) !important;
}

/* Gene buttons - navy theme */
.gene-btn {
  background: linear-gradient(160deg, #162D4A, #0F2035) !important;
  border-color: rgba(201,169,97,0.2) !important;
}
.gene-btn.active {
  background: linear-gradient(160deg, #1E3A5C, #162D4A) !important;
  border-color: #C9A961 !important;
  color: #C9A961 !important;
  box-shadow: 0 0 20px rgba(201,169,97,0.2), 0 4px 16px rgba(0,0,0,0.4) !important;
}
.gene-btn.active .gb-code {
  color: #C9A961 !important;
  text-shadow: 0 0 8px rgba(201,169,97,0.4);
}
.gene-btn.active::after {
  color: #C9A961 !important;
}
.gene-btn:not(.active) {
  color: #7B8EA6 !important;
  box-shadow: inset 2px 2px 6px rgba(0,0,0,0.4), inset -1px -1px 3px rgba(255,255,255,0.02) !important;
}
.gene-btn:not(.active):hover {
  border-color: rgba(201,169,97,0.35) !important;
  color: #9AA8BC !important;
}

/* Genetics summary table */
.genetics-summary {
  background: linear-gradient(160deg, #132845, #0F2035) !important;
  border-color: rgba(201,169,97,0.2) !important;
}
.genetics-summary h4 {
  color: #C9A961 !important;
}

/* Gold text accents */
h1, h2, h3, .section-title, [class*="heading"] {
  color: #fff !important;
}
.gold, .text-gold, [class*="gold"] {
  color: #C9A961 !important;
}

/* Simulator section */
.simulator-section, .simulator-container, .upload-section {
  background: #0F2035 !important;
}

/* Footer */
footer, .footer {
  background: #091422 !important;
  border-top: 1px solid rgba(201,169,97,0.15) !important;
}

/* Sign in button */
.sign-in-btn, .auth-btn, a[href*="login"] {
  background: linear-gradient(135deg, #C9A961, #A08840) !important;
  color: #0B1929 !important;
}

/* Scrollbar */
::-webkit-scrollbar-thumb {
  background: #C9A961 !important;
}

/* Auth gate overlay */
#sim-auth-gate, #upload-auth-gate {
  background: rgba(11,25,41,0.92) !important;
}

/* ═══════════════════════════════════════
   DB LOADED BADGE
   ═══════════════════════════════════════ */
.db-badge-wrapper {
  margin-top: 4px;
}
.db-loaded-badge {
  display: inline-block;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 4px;
}
.db-loaded-badge strong { color: #86efac; }

/* ═══════════════════════════════════════
   COMBINED 5-GEN PEDIGREE
   ═══════════════════════════════════════ */
#combined-pedigree-section {
  display: none;
  margin: 2rem 0;
  border-top: 1px solid rgba(201,169,97,0.2);
  padding-top: 1.5rem;
}
.combined-pedigree-wrapper {
  background: #0e1e30;
  border-radius: 16px;
  border: 1px solid rgba(201,169,97,0.2);
  padding: 1.5rem;
}
.combined-ped-header { text-align: center; margin-bottom: 1.5rem; }
.combined-ped-header h3 { color: #C9A961; font-size: 1.2rem; margin: 0 0 0.25rem; }
.combined-ped-subtitle { color: #6b7280; font-size: 0.85rem; margin: 0; }
.ped-legend-common { color: #C9A961; font-weight: 600; }

.combined-ped-columns {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}
.combined-ped-side { flex: 1; min-width: 0; }
.combined-ped-foal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.foal-node {
  background: linear-gradient(135deg, #C9A961, #A08840);
  color: #0B1929;
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 80px;
}
.foal-node span:first-child { font-size: 1.5rem; }

.ped-side-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #C9A961;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(201,169,97,0.1);
  border-radius: 6px;
  display: inline-block;
}
.stallion-side { text-align: right; }
.stallion-side .ped-branch, .stallion-side .ped-node { margin-left: auto; }
.mare-side { text-align: left; }

.ped-branch {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ped-children {
  padding-left: 1rem;
  border-left: 2px solid rgba(201,169,97,0.2);
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stallion-side .ped-children {
  padding-left: 0;
  padding-right: 1rem;
  border-left: none;
  border-right: 2px solid rgba(201,169,97,0.2);
  align-items: flex-end;
}
.ped-node {
  background: #132845;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.72rem;
  color: #c0d0e0;
  display: inline-block;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ped-node.common-ancestor {
  background: rgba(201,169,97,0.18) !important;
  border-color: #C9A961 !important;
  color: #C9A961 !important;
  font-weight: 700;
}
.ped-node.unknown { color: #4a5568; border-style: dashed; }
.ped-node-name { font-weight: 600; }
.ped-node-year { font-size: 0.65rem; color: #6b7280; margin-left: 3px; }
.ped-node-gait {
  font-size: 0.6rem;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 4px;
  color: #9ca3af;
}

.common-ancestor-list {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(201,169,97,0.15);
  padding-top: 1rem;
}
.common-ancestor-list h4 { color: #C9A961; font-size: 0.9rem; margin: 0 0 0.75rem; }
.common-ancestor-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.common-ancestor-chip {
  background: rgba(201,169,97,0.15);
  border: 1px solid rgba(201,169,97,0.4);
  color: #C9A961;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

/* ═══════════════════════════════════════
   STANDING STALLIONS QUICK SELECT
   ═══════════════════════════════════════ */
.standing-stallions-section {
  margin-bottom: 2rem;
}
.standing-stallions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.standing-stallions-header h3 {
  color: #C9A961;
  font-size: 1rem;
  margin: 0;
}
.standing-stallions-header a {
  color: #6b7280;
  font-size: 0.8rem;
  text-decoration: none;
}
.standing-stallions-header a:hover { color: #C9A961; }
.standing-stallions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ss-stallion-card {
  background: #0e1e30;
  border: 1.5px solid rgba(201,169,97,0.3);
  border-radius: 10px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
}
.ss-stallion-card:hover {
  background: rgba(201,169,97,0.15);
  border-color: #C9A961;
  transform: translateY(-1px);
}
.ss-stallion-card .ss-name {
  color: #e0e8f0;
  font-weight: 700;
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.2;
}
.ss-stallion-card .ss-gait {
  color: #6b7280;
  font-size: 0.62rem;
}
.ss-stallion-card.ss-selected {
  background: rgba(201,169,97,0.2);
  border-color: #C9A961;
  box-shadow: 0 0 0 2px rgba(201,169,97,0.3);
}
.ss-stallion-card .ss-gait.Trotter { color: #60a5fa; }
.ss-stallion-card .ss-gait.Pacer { color: #34d399; }

@media (max-width: 768px) {
  .combined-ped-columns { flex-direction: column; }
  .combined-ped-side { width: 100%; }
  .stallion-side { text-align: left; }
  .stallion-side .ped-branch, .stallion-side .ped-node { margin-left: 0; }
  .stallion-side .ped-children {
    padding-right: 0;
    padding-left: 1rem;
    border-right: none;
    border-left: 2px solid rgba(201,169,97,0.2);
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════
   MATCHSIRE REPORT — SCREEN STYLES
   ══════════════════════════════════════ */

/* Download Report Button */
.matchsire-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: linear-gradient(135deg, #C9A961, #A08840);
  color: #0B1929;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.matchsire-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,169,97,0.4);
}
.matchsire-download-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Download Report Row in Results Panel */
.download-report-row {
  display: none;
  text-align: center;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-radius: 0 0 20px 20px;
}
.download-report-row.visible {
  display: block;
}
.download-report-row .download-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Screen Report Summary Styles */
.screen-report {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sr-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
}
.sr-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #C9A961;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.sr-exec-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.sr-exec-text strong {
  color: var(--text);
}
.sr-flag {
  margin-top: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #fca5a5;
  line-height: 1.5;
}
.sr-flag strong { color: #f87171; }
.sr-clear {
  margin-top: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: rgba(74,222,128,0.07);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #86efac;
}
.sr-narrative {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.sr-narrative strong { color: var(--text); }
.sr-rec {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid;
  border-radius: 10px;
}
.sr-rec-icon { font-size: 1.5rem; flex-shrink: 0; }
.sr-rec-status { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.sr-rec-reason { font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; }

/* ══════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════ */
@media print {
  body {
    background: #fff !important;
    color: #1a1a2e !important;
  }
  .navbar,
  .hero,
  .how-it-works,
  .parent-selection,
  .simulate-area,
  .upload-section,
  .punnett-section,
  .footer,
  .sound-toggle,
  #save-sim-row,
  .download-report-row,
  .dna-animation-overlay,
  .hero-scroll-indicator,
  #dna-overlay {
    display: none !important;
  }
  .results-panel {
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #1a1a2e !important;
    padding: 20px !important;
  }
  .results-panel h2,
  .results-panel h3 {
    color: #0B1929 !important;
  }
  .prob-fill {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .health-shield {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .screen-report {
    border-top: 1px solid #e5e7eb !important;
  }
  .sr-section {
    background: #f9fafb !important;
    border-color: #e5e7eb !important;
    color: #374151 !important;
  }
  .sr-exec-text, .sr-narrative { color: #374151 !important; }
  .sr-exec-text strong, .sr-narrative strong { color: #0B1929 !important; }
}

/* === Standing Stallions v2 Cards === */
.standing-stallions-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  gap: 10px !important;
  padding: 10px 0 !important;
}
.ss-card-v2 {
  background: linear-gradient(160deg, #132845, #0e1e35);
  border: 1.5px solid rgba(201,169,97,0.2);
  border-radius: 14px;
  padding: 14px 10px 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.ss-card-v2:hover {
  border-color: rgba(201,169,97,0.6);
  background: linear-gradient(160deg, #1a3355, #132845);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 16px rgba(201,169,97,0.1);
}
.ss-card-v2.ss-active {
  border-color: #C9A961 !important;
  background: linear-gradient(160deg, #2a1f08, #1a1200) !important;
  box-shadow: 0 0 24px rgba(201,169,97,0.3), 0 8px 24px rgba(0,0,0,0.4) !important;
  transform: translateY(-3px) scale(1.03) !important;
}
.ss-card-v2.ss-active::after {
  content: '✓ SELECTED';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9px;
  color: #C9A961;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.ss-card-v2.ss-active .ss-card-action {
  display: none;
}
.ss-card-emoji {
  font-size: 28px;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.ss-card-name {
  color: #e0e8f0;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.2;
  margin-bottom: 6px;
}
.ss-active .ss-card-name {
  color: #C9A961 !important;
}
.ss-card-badge {
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 8px;
  display: inline-block;
  font-weight: 600;
}
.ss-card-badge.ss-trotter {
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
}
.ss-card-badge.ss-pacer {
  background: rgba(52,211,153,0.15);
  color: #34d399;
}
.ss-card-action {
  font-size: 0.55rem;
  color: rgba(201,169,97,0.4);
  margin-top: 6px;
  letter-spacing: 1px;
  font-weight: 600;
}

/* === Standing Stallions Horse Tiles v3 === */
.standing-stallions-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  gap: 12px !important;
}
.ss-card-v2 {
  background: linear-gradient(160deg, #162D4A, #0e1e35) !important;
  border: 2px solid rgba(201,169,97,0.25) !important;
  border-radius: 16px !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 4px 12px rgba(0,0,0,0.3),
    0 1px 3px rgba(0,0,0,0.2) !important;
}
.ss-card-v2:hover {
  transform: translateY(-4px) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 8px 24px rgba(0,0,0,0.4),
    0 0 16px rgba(201,169,97,0.15) !important;
  border-color: rgba(201,169,97,0.5) !important;
}
.ss-card-v2.ss-active {
  border-color: #C9A961 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,220,100,0.15),
    0 0 28px rgba(201,169,97,0.3),
    0 8px 24px rgba(0,0,0,0.4) !important;
}
/* Horse image area */
.ss-card-img {
  width: 100%;
  height: 100px;
  background: linear-gradient(180deg, #0a1520 0%, #132845 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.ss-card-img .horse-silhouette {
  font-size: 52px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  transition: transform 0.3s;
}
.ss-card-v2:hover .horse-silhouette {
  transform: scale(1.1);
}
.ss-card-img .gait-ribbon {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.55rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.gait-ribbon.trotter { background: rgba(96,165,250,0.25); color: #60a5fa; }
.gait-ribbon.pacer { background: rgba(52,211,153,0.25); color: #34d399; }
/* Name area */
.ss-card-info {
  padding: 10px 12px;
  text-align: center;
}
.ss-card-info .ss-card-name {
  color: #e0e8f0 !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  line-height: 1.25 !important;
  margin-bottom: 2px !important;
}
.ss-active .ss-card-info .ss-card-name { color: #C9A961 !important; }
.ss-card-info .ss-card-gait {
  font-size: 0.65rem;
  font-weight: 600;
}
.ss-card-info .ss-card-gait.trotter { color: #60a5fa; }
.ss-card-info .ss-card-gait.pacer { color: #34d399; }

/* Stallion card link */
.ss-card-link {
  color: #e0e8f0 !important;
  text-decoration: none !important;
  transition: color 0.2s;
}
.ss-card-link:hover {
  color: #C9A961 !important;
  text-decoration: underline !important;
}
.ss-card-v2 .ss-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.ss-card-v2:hover .ss-card-img img {
  transform: scale(1.08);
}

/* Fix Sign In / Sign Out button wrapping */
.sign-in-btn, .auth-btn, .nav-auth a, a[href*='login'], .nav-cta {
  white-space: nowrap !important;
  min-width: auto !important;
  padding: 6px 12px !important;
  font-size: 0.75rem !important;
}
.site-header .nav-auth, .site-header nav {
  flex-shrink: 0;
}

/* Fix CTA button spacing */
.hero-cta, .cta-buttons, .hero-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  align-items: center !important;
  margin-top: 24px !important;
}
.hero-cta a, .cta-buttons a, .hero-buttons a {
  display: inline-block !important;
  min-width: 220px !important;
  text-align: center !important;
  padding: 14px 28px !important;
  white-space: nowrap !important;
}
@media (min-width: 600px) {
  .hero-cta, .cta-buttons, .hero-buttons {
    flex-direction: row !important;
    justify-content: center !important;
  }
}

/* Remove redundant large category tiles from resources page */
.resource-hero-cards, .res-category-tiles, .category-hero-grid {
  display: none !important;
}

/* Hide redundant resource card grid - tools are inline below */
#resources-grid {
  display: none !important;
}
/* Also hide the category pills filter bar since grid is hidden */
#category-pills {
  display: none !important;
}
/* Make the search still work by scrolling to relevant sections */


/* === UNIFIED NAV === */
.ms-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: #0D1B2A;
  position: sticky;
  top: 0;
  z-index: 100;
}
.ms-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.ms-nav-brand-icon { font-size: 1.3rem; }
.ms-nav-brand-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #C9A961;
}
.ms-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ms-nav-links a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-family: Inter, system-ui, sans-serif;
  transition: color 0.2s;
}
.ms-nav-links a:hover { color: #C9A961; }
.ms-nav-links a.active { font-weight: 600; }
.ms-nav-links a.external::after { content: ' ↗'; font-size: 0.75rem; }
.ms-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ms-nav-welcome {
  color: #fff;
  font-size: 0.9rem;
}
.ms-nav-welcome strong { font-weight: 600; }
.ms-nav-signout {
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  padding: 6px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.ms-nav-signout:hover { border-color: #C9A961; color: #C9A961; }
.ms-nav-signin {
  background: linear-gradient(135deg, #C9A961, #A08840);
  color: #0D1B2A;
  padding: 8px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .ms-nav { padding: 0 12px; height: 56px; }
  .ms-nav-links { display: none !important; }
  .ms-nav-brand-name { font-size: 1rem; }
  .ms-nav-hamburger { display: block !important; }
}
.ms-nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
/* Mobile menu */
.ms-mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: #0D1B2A;
  border-top: 1px solid rgba(201,169,97,0.2);
  padding: 16px;
  z-index: 99;
  flex-direction: column;
  gap: 12px;
}
.ms-mobile-menu.open { display: flex; }
.ms-mobile-menu a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* === UNIFIED BUTTON STYLES === */
/* Primary: gold gradient, dark text */
.btn-primary, .btn-simulate, .btn-gold, .cta-btn, 
button[type='submit'], .res-btn, .calc-submit,
a.btn-primary, a.cta-btn {
  background: linear-gradient(135deg, #C9A961, #A08840) !important;
  color: #0D1B2A !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  font-family: Inter, system-ui, sans-serif !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-block !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
}
.btn-primary:hover, .btn-simulate:hover, .btn-gold:hover, .cta-btn:hover,
button[type='submit']:hover, .res-btn:hover, .calc-submit:hover {
  background: linear-gradient(135deg, #D4B570, #B09950) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(201,169,97,0.3) !important;
}

/* Secondary: outlined, transparent bg */
.btn-secondary, .btn-outline, .btn-ghost,
a.btn-secondary, a.btn-outline {
  background: transparent !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  font-family: Inter, system-ui, sans-serif !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-block !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
}
.btn-secondary:hover, .btn-outline:hover, .btn-ghost:hover {
  border-color: #C9A961 !important;
  color: #C9A961 !important;
}

/* Danger: red for delete actions */
.btn-danger, .btn-delete {
  background: transparent !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239,68,68,0.4) !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.btn-danger:hover, .btn-delete:hover {
  background: rgba(239,68,68,0.1) !important;
  border-color: #ef4444 !important;
}

/* Download/PDF button */
.matchsire-download-btn {
  background: linear-gradient(135deg, #C9A961, #A08840) !important;
  color: #0D1B2A !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px 28px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.matchsire-download-btn:hover {
  background: linear-gradient(135deg, #D4B570, #B09950) !important;
  transform: translateY(-1px) !important;
}

/* Small/compact buttons */
.btn-sm, .btn-small {
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  border-radius: 6px !important;
}

/* Guide/article expand buttons */
.guide-toggle-btn, .article-toggle-btn {
  background: transparent !important;
  color: #C9A961 !important;
  border: 1px solid rgba(201,169,97,0.3) !important;
  border-radius: 6px !important;
  padding: 4px 12px !important;
  font-size: 0.8rem !important;
  cursor: pointer !important;
}
.guide-toggle-btn:hover, .article-toggle-btn:hover {
  background: rgba(201,169,97,0.1) !important;
}

/* === HEADER FIX — Sign In button no wrap === */
.ms-nav-signin {
  white-space: nowrap !important;
  padding: 8px 18px !important;
  font-size: 0.85rem !important;
  min-width: auto !important;
  flex-shrink: 0 !important;
}
.ms-nav-signout {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.ms-nav-welcome {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
/* Prevent brand text from wrapping */
.ms-nav-brand-name {
  white-space: nowrap !important;
}
/* Add gold bottom border to nav */
.ms-nav {
  border-bottom: 1px solid rgba(201,169,97,0.3) !important;
}
/* Right side: keep items tight */
.ms-nav-right {
  flex-shrink: 0 !important;
  gap: 12px !important;
}
/* On very small screens, shrink brand text instead of wrapping button */
@media (max-width: 400px) {
  .ms-nav-brand-name {
    font-size: 0.95rem !important;
  }
  .ms-nav-signin {
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
  }
}

/* === FIX: Hamburger menu visibility + spacing === */
.ms-nav-hamburger {
  display: block !important;
  font-size: 1.6rem !important;
  padding: 8px !important;
  color: #fff !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  margin-left: 8px !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}
/* On desktop, hide hamburger and show nav links */
@media (min-width: 769px) {
  .ms-nav-hamburger { display: none !important; }
  /* desktop nav links shown via default display:flex */
}
/* On mobile, show hamburger, hide nav links */
@media (max-width: 768px) {
  .ms-nav-hamburger { display: block !important; }
  .ms-nav-links { display: none !important; }
  .ms-nav { gap: 8px !important; }
  .ms-nav-right { gap: 8px !important; }
}

/* === Brand subtitle: "by Standing Stallions" === */
.ms-nav-brand-sub {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #fff;
  margin-left: 6px;
  white-space: nowrap;
}
@media (max-width: 400px) {
  .ms-nav-brand-sub {
    font-size: 0.75rem;
  }
}

/* === MOBILE NAV OVERFLOW FIX === */
/* Prevent horizontal scroll globally */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

/* Mobile: hide welcome text + sign out, show only brand + ellipsis */
@media (max-width: 768px) {
  .ms-nav {
    padding: 0 12px !important;
    gap: 0 !important;
    overflow: hidden !important;
  }
  .ms-nav-brand {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .ms-nav-brand-name {
    font-size: 1rem !important;
  }
  .ms-nav-brand-sub {
    font-size: 0.72rem !important;
  }
  /* Hide welcome/signout on mobile — put in mobile menu instead */
  .ms-nav-right .ms-nav-welcome,
  .ms-nav-right .ms-nav-signout {
    display: none !important;
  }
  .ms-nav-right .ms-nav-signin {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
  }
  .ms-nav-right {
    flex-shrink: 0 !important;
    gap: 6px !important;
  }
  .ms-nav-hamburger {
    font-size: 1.8rem !important;
    padding: 4px 8px !important;
  }
  /* Mobile menu gets auth items */
  .ms-mobile-menu {
    top: 56px !important;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .ms-nav-brand-sub {
    display: none !important;
  }
  .ms-nav-brand-name {
    font-size: 0.95rem !important;
  }
}

/* Dashboard nav mobile fix */
@media (max-width: 768px) {
  .dash-nav {
    padding: 0 12px !important;
    overflow: hidden !important;
  }
  .dash-nav-links {
    display: none !important;
  }
  .dash-nav-right {
    gap: 8px !important;
  }
  .dash-user-name {
    display: none !important;
  }
}

/* === PWA Install Banner === */
#pwa-install-banner {
  position: fixed;
  bottom: -80px;
  left: 0;
  right: 0;
  z-index: 9999;
  transition: bottom 0.3s ease;
  padding: 0 12px 12px;
}
#pwa-install-banner.pwa-visible {
  bottom: 0;
}
.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #132845;
  border: 1px solid rgba(201,169,97,0.3);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  max-width: 480px;
  margin: 0 auto;
}
.pwa-banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.pwa-banner-text {
  flex: 1;
  min-width: 0;
}
.pwa-banner-text strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  font-family: "Playfair Display", Georgia, serif;
}
.pwa-banner-text span {
  display: block;
  color: #7B8EA6;
  font-size: 0.8rem;
  margin-top: 2px;
}
.pwa-banner-btn {
  background: linear-gradient(135deg, #C9A961, #A08840);
  color: #0B1929;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  flex-shrink: 0;
  font-family: Inter, system-ui, sans-serif;
  transition: all 0.2s;
}
.pwa-banner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,169,97,0.3);
}
.pwa-banner-close {
  background: none;
  border: none;
  color: #5a6a7e;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.pwa-banner-close:hover {
  color: #fff;
}
horses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.horse-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  transition: border-color 0.2s, background 0.2s;
}

.horse-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(212,168,67,0.2);
}

.horse-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.horse-card-name {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #f5f5f5;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.horse-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.gait-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.gait-badge.trotter {
  background: rgba(0,212,170,0.12);
  border: 1px solid rgba(0,212,170,0.3);
  color: #00d4aa;
}

.gait-badge.pacer {
  background: rgba(212,168,67,0.12);
  border: 1px solid rgba(212,168,67,0.3);
  color: #d4a843;
}

.color-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.07);
  color: #9ca3af;
  white-space: nowrap;
}

.horse-card-lineage {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.horse-card-reg {
  font-size: 0.75rem;
  color: #4b5563;
  font-family: var(--font-mono, monospace);
  margin-bottom: 0.75rem;
}

.horse-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.btn-use {
  flex: 1;
  font-size: 0.78rem;
  padding: 0.4rem 0.5rem;
  background: transparent;
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: 7px;
  color: #d4a843;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-width: 100px;
  text-align: center;
}

.btn-use:hover {
  background: rgba(212,168,67,0.1);
  border-color: rgba(212,168,67,0.5);
}

.btn-delete-h {
  font-size: 0.78rem;
  padding: 0.4rem 0.65rem;
  background: transparent;
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 7px;
  color: #ef4444;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-delete-h:hover {
  background: rgba(239,68,68,0.1);
}

/* Save to My Horses button in uploader */
.save-horse-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: rgba(0,212,170,0.12);
  border: 1px solid rgba(0,212,170,0.3);
  border-radius: 8px;
  color: #00d4aa;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.save-horse-btn:hover {
  background: rgba(0,212,170,0.2);
  border-color: rgba(0,212,170,0.5);
}

/* === PWA Banner Body Padding (prevents overlap) === */
body.pwa-banner-open {
  padding-bottom: 80px;
}
body.pwa-banner-open .ms-chat-btn {
  bottom: 170px !important;
}

/* === GAMIFIED FOAL GALLERY === */

/* Rarity Colors */
.foal-card[data-rarity="common"] { --rarity-color: #9ca3af; --rarity-glow: rgba(156,163,175,0.3); }
.foal-card[data-rarity="uncommon"] { --rarity-color: #22c55e; --rarity-glow: rgba(34,197,94,0.3); }
.foal-card[data-rarity="rare"] { --rarity-color: #3b82f6; --rarity-glow: rgba(59,130,246,0.3); }
.foal-card[data-rarity="epic"] { --rarity-color: #a855f7; --rarity-glow: rgba(168,85,247,0.3); }
.foal-card[data-rarity="legendary"] { --rarity-color: #C9A961; --rarity-glow: rgba(201,169,97,0.4); }

.foal-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.foal-card {
  perspective: 1000px;
  cursor: pointer;
  transition: transform 0.3s;
}
.foal-card:hover {
  transform: translateY(-8px);
}

.foal-card-inner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, #0d1f35, #132845);
  border: 2px solid var(--rarity-color, #333);
  box-shadow: 0 0 20px var(--rarity-glow, rgba(0,0,0,0.3)),
              0 8px 32px rgba(0,0,0,0.4);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.foal-card:hover .foal-card-inner {
  box-shadow: 0 0 30px var(--rarity-glow),
              0 0 60px var(--rarity-glow),
              0 12px 40px rgba(0,0,0,0.5);
}

/* Holographic shimmer effect */
.foal-card-shimmer {
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  width: 200%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.05) 45%,
    rgba(255,255,255,0.1) 50%,
    rgba(255,255,255,0.05) 55%,
    transparent 60%
  );
  z-index: 10;
  pointer-events: none;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-30%); }
  50% { transform: translateX(30%); }
  100% { transform: translateX(-30%); }
}

/* Rarity badge */
.foal-card-rarity {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rarity-color);
  background: rgba(0,0,0,0.6);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--rarity-color);
}

/* Horse image */
.foal-card-image {
  padding: 20px 10px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  position: relative;
}

.foal-card-image img {
  max-width: 85%;
  max-height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  transition: transform 0.5s ease;
  animation: horse-breathe 3s ease-in-out infinite;
}

@keyframes horse-breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.02) translateY(-2px); }
}

.foal-card:hover .foal-card-image img {
  transform: scale(1.08);
  animation: none;
}

/* Ambient glow behind horse */
.foal-card-image::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--rarity-glow) 0%, transparent 70%);
  z-index: -1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
}

/* Info section */
.foal-card-info {
  padding: 12px 16px 16px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.2);
}

.foal-card-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.foal-card-prob {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--rarity-color);
  margin-bottom: 8px;
}

.foal-card-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.foal-card-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rarity-color), var(--rarity-color));
  border-radius: 2px;
  transition: width 1s ease;
}

/* Particle burst on card reveal */
.foal-card.revealed .foal-card-inner {
  animation: card-reveal 0.6s ease-out;
}

@keyframes card-reveal {
  0% { transform: scale(0.8) rotateY(90deg); opacity: 0; }
  50% { transform: scale(1.05) rotateY(0deg); opacity: 1; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

/* Legendary cards get extra glow */
.foal-card[data-rarity="legendary"] .foal-card-inner {
  animation: legendary-pulse 2s ease-in-out infinite;
}

@keyframes legendary-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(201,169,97,0.3), 0 8px 32px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 40px rgba(201,169,97,0.5), 0 0 80px rgba(201,169,97,0.2), 0 8px 32px rgba(0,0,0,0.4); }
}

/* Responsive */
@media (max-width: 480px) {
  .foal-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .foal-card-image { min-height: 140px; }
  .foal-card-image img { max-height: 120px; }
  .foal-card-prob { font-size: 1.1rem; }
}

/* === MEET MATCHIE SECTION === */
.matchie-section {
  padding: 5rem 2rem;
  background: linear-gradient(180deg, rgba(11,25,41,0.3) 0%, rgba(201,169,97,0.05) 50%, rgba(11,25,41,0.3) 100%);
}
.matchie-container {
  max-width: 900px;
  margin: 0 auto;
}
.matchie-intro {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}
.matchie-avatar {
  font-size: 5rem;
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(201,169,97,0.2), rgba(201,169,97,0.05));
  border: 2px solid rgba(201,169,97,0.3);
  border-radius: 24px;
  animation: matchie-pulse 3s ease-in-out infinite;
}
@keyframes matchie-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(201,169,97,0.1); }
  50% { box-shadow: 0 0 40px rgba(201,169,97,0.25); }
}
.matchie-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.5rem;
}
.matchie-tagline {
  font-size: 1.2rem;
  color: #C9A961;
  font-style: italic;
  margin-bottom: 2rem;
  font-family: 'Playfair Display', Georgia, serif;
}
.matchie-capabilities {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.matchie-cap {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.cap-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.matchie-cap strong {
  color: #fff;
  font-size: 1rem;
  display: block;
  margin-bottom: 0.25rem;
}
.matchie-cap p {
  color: #7B8EA6;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}
.matchie-cta {
  font-size: 1rem !important;
  padding: 14px 32px !important;
}
@media (max-width: 768px) {
  .matchie-intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .matchie-headline { font-size: 2rem; }
  .matchie-cap { flex-direction: column; align-items: center; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════
   v3.4 — Compact Genetics Control Panel
   ═══════════════════════════════════════════════════════════ */

/* Outer wrapper — mirrors .parent-selection layout */
.parent-selection-compact {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

/* Parent panel card */
.parent-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 18px;
}
.stallion-panel { border-top: 3px solid var(--gold, #C9A961); }
.mare-panel     { border-top: 3px solid var(--silver, #A8B8CC); }

/* Panel header row */
.parent-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.parent-panel-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(201,169,97,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--gold, #C9A961);
  flex-shrink: 0;
}
.mare-panel .parent-panel-icon {
  background: rgba(168,184,204,0.12);
  color: var(--silver, #A8B8CC);
}
.parent-panel-title {
  flex: 1;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold, #C9A961);
}
.mare-panel .parent-panel-title { color: var(--silver, #A8B8CC); }

.upload-link-btn {
  color: #00d4aa;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 10px;
  border: 1px solid rgba(0,212,170,0.3);
  border-radius: 20px;
  transition: background 0.15s;
}
.upload-link-btn:hover { background: rgba(0,212,170,0.1); text-decoration: none; }

/* Section sub-labels */
.compact-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #7B8EA6;
  margin: 10px 0 6px;
}
.compact-section-label.disease-label {
  color: rgba(220, 80, 80, 0.85);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* Compact dropdown row */
.gene-compact-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.gene-compact {
  flex: 1;
  min-width: 58px;
}
.gene-compact label {
  display: block;
  font-size: 0.62rem;
  color: #7B8EA6;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
  white-space: nowrap;
}

/* The compact selects */
.gene-select-compact {
  width: 100%;
  padding: 7px 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,169,97,0.2);
  border-radius: 8px;
  color: #f0f0f0;
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gene-select-compact:hover { border-color: rgba(201,169,97,0.45); }
.gene-select-compact:focus {
  border-color: var(--gold, #C9A961);
  outline: none;
  box-shadow: 0 0 0 2px rgba(201,169,97,0.18);
}
.gene-select-compact option {
  background: #0d1f35;
  color: #f0f0f0;
}
/* Disease selects — red tint */
.gene-select-compact.disease-select {
  border-color: rgba(220,80,80,0.2);
}
.gene-select-compact.disease-select:hover { border-color: rgba(220,80,80,0.45); }
.gene-select-compact.disease-select:focus {
  border-color: rgba(220,80,80,0.8);
  box-shadow: 0 0 0 2px rgba(220,80,80,0.15);
}
/* When a carrier/affected is selected — highlight */
.gene-select-compact.disease-select.has-risk {
  border-color: rgba(255,140,0,0.6);
  background: rgba(255,140,0,0.06);
}

/* Genotype summary bar */
.genotype-summary {
  font-size: 0.78rem;
  color: #7B8EA6;
  padding: 8px 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-top: 12px;
  line-height: 1.4;
  min-height: 34px;
}

/* Mobile: wrap nicely */
@media (max-width: 900px) {
  .parent-selection-compact {
    grid-template-columns: 1fr;
  }
  .breed-connector {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }
  .breed-connector .connector-line {
    width: 60px;
    height: 1px;
  }
}
@media (max-width: 480px) {
  .gene-compact { min-width: calc(33% - 5px); }
  .gene-compact-row { gap: 5px; }
}
