/* ============================================================
   YumnAI — Color Analysis Result Screen (Final Reference Match)
   Premium Digital Color Draping Experience:
   - Very Large Radial Draping Wheel filling near-full viewport width
   - Large face-only circular portrait centered inside the wheel
   - Overlapping Interactive 12-Season Ring at lower-right, partially
     extending beyond the right edge (matching reference composition)
   - Match Percentage Badge with Downward Pointer
   - Editorial Typography Hierarchy
   - Single Primary Bottom Action: "View My Palette →"
   - Header Info (ⓘ) and Palette (🎨) controls
   ============================================================ */

/* ─── Result Screen Container ─────────────────────────────────── */
.yn-color-result {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
  background: #FBF4EF;
  background: linear-gradient(180deg, #FDF7F3 0%, #F8EFEA 100%);
  color: var(--ink, #1A1A1A);
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  padding: 0 0 24px 0;
  box-sizing: border-box;
}

/* Ensure parent #hero-result resets default constraints */
#hero-result {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

#hero-result.yn-hero-state {
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
}

@media (min-width: 769px) {
  body[data-flow-state="result"] #hero-result,
  body[data-flow-state="result"] #hero-result.active,
  body[data-flow-state="result"] #color-result-screen-root,
  body[data-flow-state="result"] .yn-color-result {
    display: flex !important;
  }
}

/* ─── Top Header Bar ──────────────────────────────────────────── */
.yn-cr-topbar {
  width: 100%;
  max-width: 440px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(253, 247, 243, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.yn-cr-back-btn {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ink, #1A1A1A);
  cursor: pointer;
  transition: transform 0.15s, background-color 0.2s;
  padding: 0;
  z-index: 2;
}

.yn-cr-back-btn:active {
  transform: translateY(-50%) scale(0.95);
  background: rgba(0, 0, 0, 0.04);
}

.yn-cr-brand-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.38em;
  margin: 0;
  margin-right: -0.38em;
  color: #1A1A1A;
  text-align: center;
  user-select: none;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.yn-cr-actions {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.yn-cr-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  border: 1.2px solid #DECBC4;
  color: #5C323E;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(90, 50, 50, 0.05);
  transition: transform 0.15s, background-color 0.2s, border-color 0.2s;
  padding: 0;
}

.yn-cr-icon-btn:active {
  transform: scale(0.95);
  background: #EFE4DC;
}

.yn-cr-info-glyph {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-weight: 700;
  font-size: 1.05rem;
  color: #5C323E;
  line-height: 1;
}

/* ─── Scrollable Body ─────────────────────────────────────────── */
.yn-cr-body {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  /* Allow the season ring to extend beyond the right edge
     while clipping it at the card boundary */
  overflow: hidden;
}

/* ─── Hero Stage: Selfie + Draping Wheel + Ring ───────────────── */
.yn-cr-hero-stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  box-sizing: border-box;
  /* Allow the season ring to visually extend past the right edge */
  overflow: visible;
}

/* The composition wrapper — sized to the large draping wheel.
   The wheel itself extends to ~100vw (nearly full width).
   The season ring extends beyond the right edge of the composition. */
.yn-cr-composition {
  position: relative;
  width: min(98vw, 400px);
  /* Height = wheel + extra space for the overlapping season ring below */
  height: calc(min(98vw, 400px) + 38px);
  margin: 0 auto;
}

/* 1. Large Multi-Color Radial Draping Wheel (24 segments)
   This is the DOMINANT visual element.
   Fills nearly the entire card width. */
.yn-cr-halo-fan-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: min(98vw, 400px);
  height: min(98vw, 400px);
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 4px 16px rgba(60, 30, 20, 0.09));
}

.yn-cr-fan-wedge {
  transition: fill 0.35s ease;
}

/* 2. Face-Only Oval Portrait
   Centered inside the draping wheel.
   Sized at 60% width x 69% height of wheel diameter so the seasonal color draping
   forms a broad, deep fabric band around the face (matching Image 2 reference).
   The face itself retains its prominent size and crop via proportional scale. */
.yn-cr-portrait-oval {
  position: absolute;
  /* Center inside the wheel */
  left: 50%;
  top: calc(min(98vw, 400px) / 2);
  transform: translate(-50%, -50%);
  width: calc(min(98vw, 400px) * 0.60);
  height: calc(min(98vw, 400px) * 0.69);
  border-radius: 50%;
  z-index: 2;
  overflow: hidden;
  border: 2px solid #FFFFFF;
  box-shadow: 0 4px 18px rgba(40, 20, 10, 0.08);
  background: #EEDFD7;
}

.yn-cr-selfie-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.yn-cr-lighting-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  transition: background-color 0.4s ease;
  border-radius: 50%;
}

/* 3. Overlapping Interactive Season Ring at Lower-Right
   The ring is visually subordinate to the face/draping wheel.
   It extends BEYOND the right edge of the card, with ~25-30% clipped.
   Sized at ~39% of wheel diameter — smaller than the face. */
.yn-cr-ring-container {
  position: absolute;
  /* Push far right so ~25-30% extends beyond the card right edge */
  right: -42px;
  /* Overlapping the lower-right of the draping wheel */
  bottom: 6px;
  /* ~39% of wheel diameter — smaller and subordinate to face */
  width: calc(min(98vw, 400px) * 0.39);
  height: calc(min(98vw, 400px) * 0.39);
  z-index: 10;
}

/* Match Percentage Badge + Pointer Triangle
   Positioned at the TOP-LEFT of the ring container,
   near the overlap with the face */
.yn-cr-match-badge {
  position: absolute;
  top: -16px;
  left: 4px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.9));
}

.yn-cr-match-num {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 1.22rem;
  font-weight: 800;
  color: #B5283D;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.95), 0 0 6px #FFFFFF, 0 1px 3px rgba(0, 0, 0, 0.12);
}

.yn-cr-match-arrow {
  width: 0;
  height: 0;
  border-left: 5.5px solid transparent;
  border-right: 5.5px solid transparent;
  border-top: 6.5px solid #B5283D;
  margin-top: 2px;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.9));
}

/* Ring Rotator Container */
.yn-cr-ring-rotator {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform-origin: center center;
}

.yn-cr-ring-rotator:active {
  cursor: grabbing;
}

.yn-cr-ring-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.10));
}

.yn-cr-ring-slice {
  cursor: pointer;
  transition: stroke 0.2s, stroke-width 0.2s, filter 0.2s;
}

.yn-cr-ring-slice.is-active {
  stroke: #FFFFFF !important;
  stroke-width: 2.5px !important;
  filter: brightness(1.08);
}

/* Static Center Disc — Cream circle showing selected season */
.yn-cr-ring-center-disc {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: #FFFDF9;
  border: 1.5px solid rgba(224, 212, 204, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 11;
  text-align: center;
  padding: 4px;
  box-sizing: border-box;
}

.yn-cr-disc-season-pre {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1F1916;
  line-height: 1.15;
  text-transform: uppercase;
}

.yn-cr-disc-season-name {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1F1916;
  line-height: 1.15;
  text-transform: uppercase;
}

.yn-cr-disc-traits {
  font-size: 0.44rem;
  color: #6E625B;
  font-weight: 500;
  margin-top: 3px;
  line-height: 1.25;
}

/* Season emoji icon inside disc */
.yn-cr-disc-emoji {
  font-size: 0.82rem;
  margin-bottom: 2px;
  line-height: 1;
}

/* ─── Result Text Details Below ───────────────────────────────── */
.yn-cr-result-details {
  text-align: left;
  width: 100%;
  max-width: 400px;
  padding: 10px 24px 6px 24px;
  margin: 0 auto;
  box-sizing: border-box;
}

.yn-cr-lead-text {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.05rem;
  color: #63534B;
  margin-bottom: 2px;
}

.yn-cr-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 2.25rem;
  font-weight: 700;
  color: #5B2433;
  line-height: 1.12;
  margin: 2px 0 4px 0;
}

.yn-cr-match-line {
  font-size: 1.1rem;
  font-weight: 600;
  color: #923445;
  margin-bottom: 6px;
}

.yn-cr-desc {
  font-size: 0.95rem;
  color: #554D47;
  line-height: 1.5;
  max-width: 340px;
  margin: 0;
}

/* ─── Primary Bottom Action: Single Clean CTA ─────────────────── */
.yn-cr-bottom-cta-wrap {
  width: 100%;
  max-width: 400px;
  margin: 10px auto 24px auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.yn-cr-primary-cta {
  width: 100%;
  height: 52px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #A85A6A 0%, #984E5E 100%);
  color: #FFFFFF;
  font-size: 1.02rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  box-shadow: 0 4px 16px rgba(160, 80, 95, 0.35);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  font-family: var(--font-sans, 'Inter', sans-serif);
}

.yn-cr-primary-cta:hover {
  background: linear-gradient(135deg, #994E5E 0%, #8A4251 100%);
  box-shadow: 0 6px 20px rgba(160, 80, 95, 0.42);
  transform: translateY(-1px);
}

.yn-cr-primary-cta:active {
  transform: scale(0.98);
}

/* ─── Bottom Sheet Modals (Info & Palette) ────────────────────── */
.yn-cr-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.yn-cr-sheet-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.yn-cr-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 24px 24px 0 0;
  z-index: 110;
  transform: translateY(105%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yn-cr-sheet.is-open {
  transform: translateY(0);
}

.yn-cr-sheet-handle-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px 0 6px 0;
  cursor: grab;
}

.yn-cr-sheet-handle {
  width: 44px;
  height: 4.5px;
  border-radius: 9999px;
  background: #E4D9D2;
}

.yn-cr-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px 16px 24px;
  border-bottom: 1px solid #F0EAE5;
}

.yn-cr-sheet-pretitle {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #B76E79;
}

.yn-cr-sheet-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 2px 0 0 0;
}

.yn-cr-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FAF7F5;
  border: 1px solid #E4D9D2;
  color: #6B6B6B;
  font-size: 0.95rem;
  cursor: pointer;
}

.yn-cr-sheet-content {
  padding: 20px 24px 36px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Biometrics Grid Inside Info Sheet ────────────────────────── */
.yn-cr-biometrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.yn-cr-bio-card {
  background: #FAF7F5;
  border: 1px solid #EDE5DF;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yn-cr-bio-dim-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.yn-cr-bio-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1A1A1A;
}

.yn-cr-bio-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #B76E79;
  background: rgba(183, 110, 121, 0.1);
  padding: 2px 8px;
  border-radius: 9999px;
  width: fit-content;
}

.yn-cr-matches-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 12px 0;
}

.yn-cr-matches-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yn-cr-match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #FAF7F5;
  border: 1px solid #EDE5DF;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.yn-cr-match-item:hover,
.yn-cr-match-item.is-active {
  background: #FDF0EB;
  border-color: #B76E79;
}

.yn-cr-match-season {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1A1A1A;
}

.yn-cr-match-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: #B76E79;
}

/* ─── Swatch Grid Inside Palette Sheet ────────────────────────── */
.yn-cr-swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.yn-cr-swatch-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #FAF7F5;
  border: 1px solid #EDE5DF;
  border-radius: 12px;
}

.yn-cr-swatch-color-pill {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.yn-cr-swatch-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yn-cr-swatch-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1A1A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yn-cr-swatch-hex {
  font-size: 0.72rem;
  font-family: monospace;
  color: #8E8E93;
}

.yn-cr-avoid-section {
  margin-bottom: 20px;
}

.yn-cr-section-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8E8E93;
  margin-bottom: 10px;
}

.yn-cr-avoid-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yn-cr-avoid-tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: #C0392B;
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.2);
  padding: 4px 10px;
  border-radius: 9999px;
}

.yn-cr-style-note {
  background: #FDF0EB;
  border-left: 3px solid #B76E79;
  border-radius: 0 12px 12px 0;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.yn-cr-style-note-quote {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-size: 0.9rem;
  color: #4A3B36;
  line-height: 1.5;
  margin: 0;
}

/* ─── Responsive & Flow Hiding Guards ─────────────────────────── */
@media (min-width: 769px) {
  #color-result-screen-root,
  .yn-color-result {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* When in result screen state, hide standard global landing headers/navs */
  body[data-flow-state="result"] .yn-header,
  body[data-flow-state="result"] #yn-mobile-bottom-nav,
  body[data-flow-state="result"] .yn-feature-section,
  body[data-flow-state="result"] .yn-section,
  body[data-flow-state="result"] .yn-section-dark,
  body[data-flow-state="result"] .yn-footer {
    display: none !important;
  }

  body[data-flow-state="result"] .yn-hero-bg {
    display: none !important;
  }
}

/* ─── Small screen refinements ────────────────────────────────── */
@media (max-width: 360px) {
  .yn-cr-disc-season-pre {
    font-size: 0.52rem;
  }
  .yn-cr-disc-season-name {
    font-size: 0.65rem;
  }
  .yn-cr-disc-traits {
    font-size: 0.38rem;
  }
  .yn-cr-match-num {
    font-size: 0.95rem;
  }
  .yn-cr-title {
    font-size: 1.85rem;
  }
  .yn-cr-ring-container {
    right: -32px;
  }
}
