/* ============================================================
   CanIBeTheirPartner — Styles
   ============================================================ */

/* ---------- Reset & Variables ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Palette */
  --color-primary: #e84393;
  --color-primary-light: #fd79a8;
  --color-primary-dark: #c0247a;
  --color-secondary: #6c5ce7;
  --color-secondary-light: #a29bfe;
  --color-accent: #fdcb6e;
  --color-accent-dark: #e17055;
  --color-success: #00b894;
  --color-bg: #fdf6f9;
  --color-bg-card: #ffffff;
  --color-text: #2d3436;
  --color-text-light: #636e72;
  --color-text-muted: #b2bec3;
  --color-border: #e8e0e4;
  
  /* Gradients */
  --gradient-main: linear-gradient(135deg, #e84393 0%, #6c5ce7 50%, #00b894 100%);
  --gradient-warm: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
  --gradient-card: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%);
  --gradient-hero: linear-gradient(135deg, #2d1b69 0%, #5b2c6f 30%, #e84393 70%, #fdcb6e 100%);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 50%;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(232, 67, 147, 0.3);
  
  /* Fonts */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* Evitar scroll horizontal sin romper position:sticky en móvil */
#form-view, #results-view {
  overflow-x: clip;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

/* ---------- Utility ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================================
   FORM VIEW (Landing / Formulario)
   ============================================================ */

#form-view,
#results-view {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

#form-view.active,
#results-view.active {
  display: block;
  opacity: 1;
}

/* Hero Header */
.hero {
  background: var(--gradient-hero);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(253, 121, 168, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(108, 92, 231, 0.1) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-5%, 3%) scale(1.05); }
}

.hero__title {
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-sm);
}

.hero__subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 400;
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero__emoji {
  font-size: 3rem;
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-md);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Privacy note */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
  margin-top: var(--space-md);
}

/* Form container */
.form-container {
  max-width: 900px;
  margin: calc(-1 * var(--space-2xl)) auto var(--space-2xl);
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 2;
}

.form-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* Form sections */
.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-section__title {
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.2rem;
}

.form-section__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--gradient-warm);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- Drop Zone ---------- */
.drop-zone {
  border: 3px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: linear-gradient(135deg, #fdf2f8 0%, #f0e6f6 100%);
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.drop-zone:hover {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #fce4ec 0%, #ede7f6 100%);
  transform: scale(1.01);
}

.drop-zone.drag-over {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #fce4ec 0%, #ede7f6 100%);
  border-style: solid;
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.drop-zone.has-image {
  padding: var(--space-md);
  border-style: solid;
  border-color: var(--color-success);
}

.drop-zone__icon {
  font-size: 3rem;
  color: var(--color-primary-light);
}

.drop-zone__text {
  color: var(--color-text-light);
  font-size: 1rem;
}

.drop-zone__text strong {
  color: var(--color-primary);
}

.drop-zone__hint {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.drop-zone-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

#form-photo-preview {
  max-width: 200px;
  max-height: 250px;
  border-radius: var(--radius-md);
  object-fit: cover;
  display: none;
}

#upload-error {
  color: var(--color-accent-dark);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition-normal);
  min-height: 1.5em;
}

#upload-error.visible {
  opacity: 1;
}

.file-input-hidden {
  display: none !important;
}

/* ---------- Height Controls ---------- */
.height-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.height-slider-row {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.height-slider-wrapper {
  flex: 1;
  position: relative;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-primary-light) 0%, var(--color-secondary) 100%);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: white;
  box-shadow: 0 2px 8px rgba(232, 67, 147, 0.4);
  border: 3px solid var(--color-primary);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: white;
  box-shadow: 0 2px 8px rgba(232, 67, 147, 0.4);
  border: 3px solid var(--color-primary);
  cursor: pointer;
}

.height-input-group {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

input[type="number"] {
  width: 80px;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  font-family: var(--font-body);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}

input[type="number"]:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.15);
}

.height-unit {
  color: var(--color-text-light);
  font-weight: 500;
}

.height-display {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-heading);
}

/* ---------- Gender Selector ---------- */
.gender-selector {
  display: flex;
  gap: var(--space-md);
}

.gender-btn {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-light);
  transition: all var(--transition-normal);
  font-family: var(--font-body);
}

.gender-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.gender-btn.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 100%);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.1);
}

.gender-btn__icon {
  font-size: 1.4rem;
}

/* ---------- Celebrity Grid ---------- */
.celebrity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-md);
}

.celebrity-card {
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.celebrity-card:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.celebrity-card.selected {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 100%);
  box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.15), var(--shadow-md);
}

.celebrity-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.celebrity-card__image {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  max-height: 160px;
}

.celebrity-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.celebrity-card:hover .celebrity-card__image img {
  transform: scale(1.05);
}

.celebrity-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.celebrity-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.celebrity-card__meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Small cards for sidebar */
.celebrity-card--small {
  padding: var(--space-xs);
}

.celebrity-card--small .celebrity-card__image {
  aspect-ratio: 1;
  margin-bottom: var(--space-xs);
}

.celebrity-card--small .celebrity-card__name {
  font-size: 0.75rem;
}

.celebrity-card--small .celebrity-card__meta {
  font-size: 0.65rem;
}

/* ---------- Submit Button ---------- */
.submit-section {
  text-align: center;
  padding-top: var(--space-md);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  background: var(--gradient-warm);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px rgba(232, 67, 147, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(232, 67, 147, 0.4);
}

.btn-submit:hover::before {
  left: 100%;
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit__icon {
  font-size: 1.4rem;
}

/* ============================================================
   RESULTS VIEW (3 columnas)
   ============================================================ */

.results-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  min-height: 100vh;
  gap: 0;
}

/* ---------- Left Sidebar (Controls) ---------- */
.sidebar-left {
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
  padding: var(--space-lg);
  overflow-y: auto;
  max-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sidebar-section__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.side-photo-preview-wrapper {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  cursor: pointer;
  position: relative;
  border: 2px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-photo-preview-wrapper:hover {
  border-color: var(--color-primary-light);
}

.side-photo-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-photo-change-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.75rem;
  padding: var(--space-xs) var(--space-sm);
  text-align: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.side-photo-preview-wrapper:hover .side-photo-change-hint {
  opacity: 1;
}

.side-celebrity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
}

.btn-back {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.btn-back:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Side height controls */
.side-height-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.side-height-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.side-height-row input[type="range"] {
  flex: 1;
  height: 6px;
}

.side-height-row input[type="number"] {
  width: 65px;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.9rem;
}

.side-gender-selector {
  display: flex;
  gap: var(--space-xs);
}

.side-gender-selector .gender-btn {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.85rem;
}

/* ---------- Center (Height Comparison) ---------- */
.main-content {
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, #fdf6f9 0%, #f0e6f6 50%, #fdf6f9 100%);
}

.comparison-title {
  text-align: center;
  margin-bottom: var(--space-2xl);
  color: var(--color-text);
}

.comparison-title span {
  color: var(--color-primary);
}

/* Height comparison container */
.height-comparison {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0; /* el solapamiento se calcula por JS con margin-left negativo */
  padding: var(--space-xl) 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  flex-wrap: nowrap;
  overflow: visible;
}

/* Ground line */
.height-comparison::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 3px;
  background: var(--gradient-main);
  border-radius: 2px;
}

/* Individual figure */
.figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 0 0 auto;
  min-width: 0;
  position: relative;
  z-index: 5;
  /* solapamiento: cada figura se mete X px sobre la anterior */
  margin-left: clamp(-30px, -4vw, -12px);
}
/* La primera figura no necesita margen negativo */
.figure:first-child {
  margin-left: 0;
}
/* Al hacer hover, la figura sube al frente */
.figure:hover {
  z-index: 20 !important;
  transform: translateY(-4px);
}

.figure--visible {
  opacity: 1;
  transform: translateY(0);
}

.figure__height-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background: white;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.figure__image-wrapper {
  overflow: visible; /* las imágenes se superponen sin recorte */
  background: transparent;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: auto; /* el wrapper se ajusta al ancho natural de la imagen */
}

.figure__image {
  display: block;
  /* height y width vienen del inline style de JS; sin max-width para preservar aspecto */
  max-width: none;
}

.figure__name {
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.figure__tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  white-space: nowrap;
}

/* Figure type colors — via drop-shadow on the silhouette, no box */
.figure--user {
  z-index: 10; /* el usuario siempre en primer plano */
}
.figure--user .figure__image {
  filter: drop-shadow(0 0 10px rgba(232, 67, 147, 0.55));
}
.figure--user .figure__tag { background: #fce4ec; color: var(--color-primary); }
.figure--user .figure__height-label { color: var(--color-primary); }

.figure--celebrity {
  z-index: 8;
}
.figure--celebrity .figure__image {
  filter: drop-shadow(0 0 10px rgba(108, 92, 231, 0.55));
}
.figure--celebrity .figure__tag { background: #ede7f6; color: var(--color-secondary); }
.figure--celebrity .figure__height-label { color: var(--color-secondary); }

.figure--partner-real {
  z-index: 6;
}
.figure--partner-real .figure__image {
  filter: drop-shadow(0 0 8px rgba(0, 184, 148, 0.45));
}
.figure--partner-real .figure__tag { background: #e8f5e9; color: var(--color-success); }

.figure--partner-fictional {
  z-index: 5;
}
.figure--partner-fictional .figure__image {
  filter: drop-shadow(0 0 8px rgba(253, 150, 68, 0.45));
}
.figure--partner-fictional .figure__tag { background: #fff3e0; color: var(--color-accent-dark); }

/* ---------- Right Sidebar (Verdict) ---------- */
.sidebar-right {
  background: var(--color-bg-card);
  border-left: 1px solid var(--color-border);
  padding: var(--space-xl);
  overflow-y: auto;
  max-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Verdict Card */
.verdict-card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.verdict-card__title {
  font-size: 1.3rem;
  color: var(--color-primary);
}

.verdict-percentage {
  font-size: 3.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* Verdict progress bar */
.verdict-bar {
  width: 100%;
  height: 12px;
  background: #f0e6f6;
  border-radius: 6px;
  overflow: hidden;
}

.verdict-bar__fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.verdict-bar--perfect { background: var(--gradient-warm); }
.verdict-bar--good { background: linear-gradient(90deg, var(--color-primary-light), var(--color-secondary-light)); }
.verdict-bar--medium { background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark)); }
.verdict-bar--low { background: linear-gradient(90deg, var(--color-accent-dark), #e17055); }

.verdict-diff {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.verdict-diff strong {
  color: var(--color-primary);
}

.verdict-message {
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.6;
  background: #fdf2f8;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary-light);
}

.verdict-reversed {
  font-size: 0.9rem;
  color: var(--color-secondary);
  background: #ede7f6;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-style: italic;
  display: none;
}

/* Tips */
.verdict-tips {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.verdict-tip {
  font-size: 0.9rem;
  color: var(--color-text-light);
  padding: var(--space-sm) var(--space-md);
  background: #f8f9fa;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
  line-height: 1.5;
}

/* Fun Facts */
.fun-facts {
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fun-facts__title {
  font-size: 1rem;
  color: var(--color-secondary);
}

.fun-facts__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.fun-facts__item {
  font-size: 0.9rem;
  color: var(--color-text-light);
  padding-left: var(--space-lg);
  position: relative;
  line-height: 1.5;
}

.fun-facts__item::before {
  content: '💡';
  position: absolute;
  left: 0;
  top: 0;
}

/* ============================================================
   CROP MODAL
   ============================================================ */

.crop-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.crop-modal.visible {
  display: flex;
}

.crop-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.crop-modal__container {
  position: relative;
  z-index: 1;
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90vw;
  max-width: 700px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.crop-modal__header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crop-modal__title {
  font-size: 1.2rem;
  color: var(--color-text);
}

.crop-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f8f9fa;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  transition: all var(--transition-fast);
}

.crop-modal__close:hover {
  background: #e9ecef;
  color: var(--color-text);
}

/* Loading phase */
.crop-loading-phase {
  padding: var(--space-3xl) var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  min-height: 300px;
}

.crop-spinner {
  width: 60px;
  height: 60px;
  position: relative;
}

.crop-spinner::before,
.crop-spinner::after {
  content: '';
  position: absolute;
  border-radius: var(--radius-full);
}

.crop-spinner::before {
  width: 100%;
  height: 100%;
  border: 4px solid #f0e6f6;
  border-top-color: var(--color-primary);
  animation: spin 1s linear infinite;
}

.crop-spinner::after {
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
  border: 4px solid #f0e6f6;
  border-bottom-color: var(--color-secondary);
  animation: spin 0.7s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.crop-loading-message {
  font-size: 1.1rem;
  color: var(--color-text-light);
  text-align: center;
  transition: opacity 0.3s ease;
  min-height: 1.5em;
}

.crop-progress-container {
  width: 80%;
  max-width: 300px;
  height: 6px;
  background: #f0e6f6;
  border-radius: 3px;
  overflow: hidden;
}

.crop-progress-bar {
  height: 100%;
  background: var(--gradient-warm);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

/* Crop edit phase */
.crop-edit-phase {
  display: none;
  flex-direction: column;
}

.crop-image-container {
  width: 100%;
  max-height: 50vh;
  overflow: hidden;
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50%/16px 16px;
}

.crop-image-container img {
  display: block;
  max-width: 100%;
}

.crop-toolbar {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.crop-tool-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--color-text-light);
}

.crop-tool-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fdf2f8;
}

.crop-tool-separator {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  margin: 0 var(--space-xs);
}

.crop-fallback-message {
  display: none;
  padding: var(--space-sm) var(--space-md);
  background: #fff3e0;
  color: var(--color-accent-dark);
  font-size: 0.85rem;
  text-align: center;
  border-bottom: 1px solid #ffe0b2;
}

/* Silhouette phase */
.crop-silhouette-phase {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  flex: 1;
  overflow: hidden;
}

.crop-silhouette-message {
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 600;
  text-align: center;
  padding: var(--space-xs) var(--space-md);
  background: linear-gradient(135deg, #fdf2f8, #f3e8ff);
  border-radius: var(--radius-md);
  border: 1px solid rgba(232, 67, 147, 0.15);
}

.crop-silhouette-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  /* checkerboard pattern para mostrar transparencia */
  background: repeating-conic-gradient(#eaeaea 0% 25%, #ffffff 0% 50%) 0 0 / 20px 20px;
  min-height: 200px;
  max-height: 50vh;
  width: 100%;
}

.crop-silhouette-preview img {
  max-width: 100%;
  max-height: 48vh;
  object-fit: contain;
  display: block;
  /* Sombra suave para destacar la silueta sobre el checkerboard */
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.18));
}

/* Botón ajuste manual */
.btn-crop-manual {
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--color-primary);
  background: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-primary);
  font-family: var(--font-body);
  font-weight: 600;
  transition: all var(--transition-fast);
  display: none;
  align-items: center;
  gap: var(--space-xs);
}

.btn-crop-manual:hover {
  background: #fdf2f8;
  border-color: var(--color-primary-dark, var(--color-primary));
}

.crop-modal__footer {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
}

.btn-crop-skip {
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--color-border);
  background: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.btn-crop-skip:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.btn-crop-confirm {
  padding: var(--space-sm) var(--space-xl);
  border: none;
  background: var(--gradient-warm);
  color: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 10px rgba(232, 67, 147, 0.3);
}

.btn-crop-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(232, 67, 147, 0.4);
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-text);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-xl);
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: transform var(--transition-slow);
  max-width: 90vw;
  text-align: center;
}

.toast--visible {
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   SHAKE ANIMATION
   ============================================================ */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s ease;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Toggle pill y top bar — ocultos en desktop */
.mobile-controls-toggle { display: none; }
.mobile-top-bar { display: none; }

@media (max-width: 1024px) {

  /* Layout apilado */
  .results-layout {
    display: flex;
    flex-direction: column;
    position: relative;
  }

  /* Barra superior: Volver + título */
  .mobile-top-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    order: -1;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
  }
  .mobile-top-bar .btn-back { display: flex; }

  /* Toggle pill (sticky) */
  .mobile-controls-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    order: 0;
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-bg-card);
    border: none;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    cursor: pointer;
    gap: var(--space-sm);
    font-family: var(--font-body);
    transition: background var(--transition-fast);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(232, 67, 147, 0.15);
    user-select: none;
    -webkit-user-select: none;
  }
  .mobile-controls-toggle:hover { background: #fdf2f8; }

  .mobile-controls-toggle__left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
  }
  .mobile-controls-toggle__badge {
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-controls-toggle__arrow {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    transition: transform var(--transition-normal);
    flex-shrink: 0;
    margin-left: auto;
  }
  .mobile-controls-toggle.open .mobile-controls-toggle__arrow {
    transform: rotate(180deg);
  }

  /* Comparación: primero */
  .main-content {
    order: 1;
    min-height: auto;
    padding: var(--space-xl) var(--space-md);
  }

  /* Veredicto: segundo */
  .sidebar-right {
    order: 2;
    position: static;
    max-height: none;
    border: none;
    border-top: 1px solid var(--color-border);
    padding: var(--space-lg);
  }

  /* Cajón de controles — panel desplegable sobre el contenido */
  .sidebar-left {
    position: fixed;
    top: 0; /* JS sobreescribe al abrir */
    left: 0;
    right: 0;
    z-index: 35;
    background: var(--color-bg-card);
    border-bottom: 2px solid var(--color-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    /* Colapsado */
    max-height: 0;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.3s ease,
                opacity 0.25s ease;
  }
  .sidebar-left.controls-open {
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--space-lg) var(--space-md);
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar-left.controls-open .sidebar-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
  .sidebar-left .btn-back { display: none; }

  /* Comparación en móvil */
  .side-celebrity-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
  .height-comparison {
    gap: 0;
    padding: var(--space-md) 0;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }
  .figure { gap: 3px; max-width: none; }
  .figure__height-label { font-size: 0.6rem; padding: 1px 4px; }
  .figure__name { font-size: 0.65rem; max-width: none; width: 100%; text-align: center; }
  .figure__tag { display: none; }
  .figure__image-wrapper { border-width: 2px; }
}

@media (max-width: 640px) {
  .hero { padding: var(--space-2xl) var(--space-md); min-height: 200px; }
  .form-card { padding: var(--space-lg); }
  .celebrity-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: var(--space-sm); }
  .gender-selector { flex-direction: column; }
  .crop-modal__container { width: 95vw; max-height: 95vh; border-radius: var(--radius-lg); }
  .crop-toolbar { flex-wrap: wrap; }
  .main-content { padding: var(--space-md) var(--space-xs); }
  .verdict-percentage { font-size: 2.5rem; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-card);
}
.site-footer a { color: var(--color-primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
