
/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
button:focus:not(:focus-visible) { outline: none; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: system-ui, sans-serif; }
body { background: #1a1a2e; color: #2d3436; }

:root {
  --font-display: system-ui, sans-serif;
  --font-body: system-ui, sans-serif;
  --warm-cream: #F8F6F2;
  --warm-bg: #F0EDE8;
  --warm-tan: #E4DED5;
  --text-dark: #2d3436;
  --text-medium: #636e72;
  --text-light: #b2bec3;
  --accent-teal: #00b894;
  --accent-teal-dark: #00a381;
  --accent-orange: #FF6633;
  --accent-blue: #4A9BD9;
  --shadow-soft: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-medium: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-strong: 0 12px 48px rgba(0,0,0,0.18);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   SCREENS
   ============================================ */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: scale(1.02);
  z-index: 1;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 10;
}

/* ============================================
   TITLE SCREEN
   ============================================ */
#title-screen {
  background: #111;
  overflow: hidden;
}
.title-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: brightness(0.7);
}
.title-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0.85) 100%);
}
.title-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 700px;
}
.title-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: #fff;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  line-height: 1.1;
}
.title-content .tagline {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--accent-teal);
  margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0,184,148,0.3);
}
.title-content .subtitle {
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  margin-bottom: 2.5rem;
  font-weight: 400;
}
.how-to-play {
  margin: 0.8rem auto;
  max-width: 340px;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  text-align: left;
}
.how-to-play summary {
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  padding: 0.4rem;
  list-style: none;
}
.how-to-play summary::before { content: '\2139\FE0F '; }
.how-to-play summary::-webkit-details-marker { display: none; }
.how-to-play-content {
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-top: 0.4rem;
}
.how-to-play-content p {
  margin: 0.3rem 0;
  font-size: 0.8rem;
  line-height: 1.4;
}
.explore-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: #fff;
  background: var(--accent-teal);
  border: none;
  border-radius: 60px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,184,148,0.4);
  transition: all var(--transition-bounce);
  animation: pulse-glow 2s ease-in-out infinite;
}
.explore-btn:hover {
  background: var(--accent-teal-dark);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 40px rgba(0,184,148,0.5);
}
.explore-btn svg {
  width: 24px; height: 24px;
  transition: transform 0.3s ease;
}
.explore-btn:hover svg { transform: translateX(4px); }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 8px 32px rgba(0,184,148,0.4); }
  50% { box-shadow: 0 8px 48px rgba(0,184,148,0.6), 0 0 60px rgba(0,184,148,0.2); }
}
.title-branding {
  position: absolute;
  bottom: 1.5rem;
  left: 0; right: 0;
  text-align: center;
  z-index: 2;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}
.title-branding a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.3s;
}
.title-branding a:hover { color: rgba(255,255,255,0.8); }

/* ============================================
   RISK PROFILE INTAKE SCREEN (NEW)
   ============================================ */
#intake-screen {
  background: var(--warm-cream);
  overflow: hidden;
}
.intake-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 580px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.intake-header {
  text-align: center;
  margin-bottom: 2rem;
}
.intake-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}
.intake-header p {
  font-size: 0.95rem;
  color: var(--text-medium);
}
/* Progress dots */
.intake-dots {
  display: flex;
  gap: 10px;
  margin-bottom: 2rem;
}
.intake-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--warm-tan);
  transition: all 0.4s var(--transition-smooth);
}
.intake-dot.active {
  background: var(--accent-teal);
  transform: scale(1.3);
}
.intake-dot.done {
  background: var(--accent-teal);
  opacity: 0.5;
}
/* Question card */
.intake-question {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-medium);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.intake-question.slide-out-left {
  opacity: 0;
  transform: translateX(-60px);
}
.intake-question.slide-out-right {
  opacity: 0;
  transform: translateX(60px);
}
.intake-question h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-dark);
  margin-bottom: 1.25rem;
  line-height: 1.3;
}
/* Answer buttons */
.intake-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.intake-options.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.intake-option-btn {
  padding: 0.85rem 1.25rem;
  background: var(--warm-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  line-height: 1.3;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .intake-option-btn:hover {
    border-color: var(--accent-teal);
    background: rgba(0,184,148,0.06);
    transform: translateY(-1px);
  }
}
.intake-option-btn:active {
  background: rgba(0,184,148,0.1);
  transform: scale(0.98);
}
.intake-option-btn.selected {
  border-color: var(--accent-teal);
  background: rgba(0,184,148,0.12);
  color: var(--accent-teal-dark);
}
/* Multi-select checkboxes */
.intake-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--warm-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}
@media (hover: hover) {
  .intake-checkbox-label:hover {
    border-color: var(--accent-teal);
    background: rgba(0,184,148,0.06);
  }
}
.intake-checkbox-label input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--accent-teal);
  cursor: pointer;
  flex-shrink: 0;
}
.intake-checkbox-label.checked {
  border-color: var(--accent-teal);
  background: rgba(0,184,148,0.1);
}
/* ZIP input */
.intake-zip-input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: var(--warm-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  letter-spacing: 0.15em;
  transition: all 0.2s ease;
  outline: none;
}
.intake-zip-input:focus {
  border-color: var(--accent-teal);
  background: rgba(0,184,148,0.06);
}
.intake-zip-input::placeholder {
  color: var(--text-light);
  letter-spacing: 0.05em;
  font-weight: 600;
}
.intake-zip-confirm {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-teal-dark);
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.intake-zip-confirm.visible {
  opacity: 1;
}
/* State dropdown (fallback) */
.intake-select {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: var(--warm-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23636e72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.intake-select:focus {
  outline: none;
  border-color: var(--accent-teal);
  background-color: rgba(0,184,148,0.06);
}
/* Next/Continue button */
.intake-next-btn {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.9rem;
  background: var(--accent-teal);
  border: none;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,184,148,0.3);
  transition: all var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.intake-next-btn:hover {
  background: var(--accent-teal-dark);
  transform: translateY(-2px);
}
.intake-next-btn:disabled {
  background: var(--warm-tan);
  color: var(--text-light);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ============================================
   HOUSE HUB SCREEN
   ============================================ */
#hub-screen {
  background: linear-gradient(135deg, #E8F6F3 0%, #FEF9E7 40%, #FDEBD0 100%);
}
.hub-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Persistent CTA */
.cta-quote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-teal-dark) 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,184,148,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.02em;
}
.cta-quote:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,184,148,0.4);
}
.cta-quote:active { transform: translateY(0); }
.cta-quote svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Floating CTA — visible on peril screen, results, etc. */
.cta-float {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 150;
  display: none;
  padding: 0.5rem 1.2rem;
  font-size: 0.8rem;
}
.cta-float.visible { display: inline-flex; }
.hub-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-dark);
}
.progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.progress-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-medium);
  white-space: nowrap;
}
.progress-bar-outer {
  width: 160px; height: 8px;
  background: var(--warm-tan);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  background: var(--accent-teal);
  border-radius: 4px;
  transition: width var(--transition-smooth);
  width: 0%;
}
.house-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-top: 60px;
}
.house-wrapper {
  position: relative;
  height: calc(100% - 30px);
  max-height: 92vh;
  aspect-ratio: auto;
}
.house-wrapper img {
  height: 100%;
  width: auto;
  max-width: 85vw;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 40px rgba(0,0,0,0.1));
}
.zone-hotspot {
  position: absolute;
  cursor: pointer;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.zone-hotspot:hover { transform: scale(1.1); }
.zone-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ring-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255,255,255,0.3), inset 0 0 12px rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}
.zone-hotspot:hover .zone-ring {
  background: rgba(255,255,255,0.35);
  box-shadow: 0 0 30px rgba(255,255,255,0.5), inset 0 0 16px rgba(255,255,255,0.2);
}
.zone-ring .zone-icon { font-size: 1.4rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }
.zone-hotspot.completed .zone-ring {
  border-color: var(--accent-teal);
  background: rgba(0,184,148,0.25);
  animation: none;
}
.zone-hotspot.completed .zone-icon { display: none; }
.zone-check { display: none; font-size: 1.4rem; }
.zone-hotspot.completed .zone-check { display: block; }
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255,255,255,0.3), inset 0 0 12px rgba(255,255,255,0.1); }
  50% { transform: scale(1.08); box-shadow: 0 0 30px rgba(255,255,255,0.5), inset 0 0 16px rgba(255,255,255,0.2); }
}
.zone-label {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(-50%) translateY(4px);
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.zone-hotspot:hover .zone-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.cloud {
  position: absolute;
  width: 120px; height: 50px;
  background: rgba(255,255,255,0.6);
  border-radius: 50px;
  top: 80px;
  animation: cloud-drift 30s linear infinite;
  z-index: 5;
  pointer-events: none;
}
.cloud::before {
  content: '';
  position: absolute;
  width: 60px; height: 40px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  top: -20px; left: 20px;
}
.cloud:nth-child(2) {
  width: 80px; height: 35px;
  top: 110px;
  animation-duration: 40s;
  animation-delay: -15s;
  opacity: 0.5;
}
@keyframes cloud-drift {
  0% { transform: translateX(-200px); }
  100% { transform: translateX(calc(100vw + 200px)); }
}

/* ============================================
   PERIL DEEP-DIVE SCREEN
   ============================================ */
#peril-screen {
  background: var(--warm-cream);
  overflow: hidden;
}
.peril-layout {
  display: flex;
  width: 100%;
  height: 100%;
}
.peril-canvas-panel {
  position: relative;
  width: 55%;
  height: 100%;
  overflow: hidden;
}
.peril-canvas-panel canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.peril-canvas-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.5rem 2rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  z-index: 2;
  pointer-events: none;
}
.peril-scene-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  margin-bottom: 0.25rem;
}
.peril-stat {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  line-height: 1.4;
}
.peril-stat-source {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.25rem;
}
.peril-solutions-panel {
  width: 45%;
  height: 100%;
  overflow-y: auto;
  padding: 2rem 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.solutions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.solutions-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-dark);
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-medium);
  transition: all 0.3s ease;
}
.back-btn:hover { background: rgba(0,0,0,0.1); color: var(--text-dark); }
.back-btn svg { width: 16px; height: 16px; }
/* Risk badge */
.risk-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  margin-bottom: 0.25rem;
  border: 2px solid;
}
.risk-badge.risk-low { background: #f0fdf4; border-color: #86efac; }
.risk-badge.risk-moderate { background: #fffbeb; border-color: #fde68a; }
.risk-badge.risk-high { background: #fff7ed; border-color: #fed7aa; }
.risk-badge.risk-very-high { background: #fff1f2; border-color: #fecdd3; animation: pulse-red 1.5s ease-in-out infinite; }
@keyframes pulse-red {
  0%, 100% { border-color: #fecdd3; }
  50% { border-color: #f43f5e; }
}
.risk-badge-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.risk-badge-text { flex: 1; }
.risk-badge-label {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.risk-badge.risk-low .risk-badge-label { color: #15803d; }
.risk-badge.risk-moderate .risk-badge-label { color: #92400e; }
.risk-badge.risk-high .risk-badge-label { color: #c2410c; }
.risk-badge.risk-very-high .risk-badge-label { color: #be123c; }
.risk-badge-reason { font-size: 0.75rem; color: var(--text-medium); line-height: 1.4; }
/* Solution cards */
.solution-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0,0,0,0.04);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.solution-card.visible { opacity: 1; transform: translateY(0); }
.solution-card.learned { border-color: var(--accent-teal); background: #f0fdf4; }
.solution-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.solution-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.solution-name { font-weight: 800; font-size: 0.95rem; color: var(--text-dark); line-height: 1.2; }
.solution-desc { font-size: 0.8rem; color: var(--text-medium); line-height: 1.5; margin-bottom: 0.75rem; }
.solution-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.solution-cost, .solution-impact {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.solution-cost { background: #FFF3E0; color: #E65100; }
.solution-impact { background: #E8F5E9; color: #2E7D32; }
.solution-savings {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 20px;
}
.got-it-btn {
  width: 100%;
  padding: 0.6rem;
  border: 2px solid var(--accent-teal);
  background: transparent;
  color: var(--accent-teal);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.got-it-btn:hover { background: var(--accent-teal); color: #fff; }
.solution-card.learned .got-it-btn { background: var(--accent-teal); color: #fff; pointer-events: none; }
.solutions-progress-text {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 700;
  text-align: center;
  margin-top: auto;
  padding-top: 0.5rem;
}

/* ============================================
   QUIZ OVERLAY (NEW)
   ============================================ */
#quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  padding: 1.5rem;
}
#quiz-overlay.visible { display: flex; }
.quiz-card {
  background: #fff;
  border-radius: 24px;
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  animation: quiz-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes quiz-in {
  0% { transform: scale(0.85) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.quiz-zone-tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--warm-tan);
  color: var(--text-medium);
}
.quiz-counter {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
}
.quiz-question {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  line-height: 1.35;
}
.quiz-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.quiz-answer-btn {
  padding: 0.8rem 1rem;
  background: var(--warm-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  line-height: 1.3;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.quiz-answer-btn:focus-visible { border-color: var(--accent-teal); }
@media (hover: hover) {
  .quiz-answer-btn:hover:not(:disabled) {
    border-color: var(--accent-teal);
    background: rgba(0,184,148,0.08);
    transform: translateY(-1px);
  }
}
.quiz-answer-btn:active:not(:disabled) {
  background: rgba(0,184,148,0.1);
  transform: scale(0.98);
}
.quiz-answer-btn.correct {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
  animation: correct-flash 0.5s ease;
}
.quiz-answer-btn.wrong {
  background: #fff1f2;
  border-color: #f43f5e;
  color: #be123c;
  animation: wrong-shake 0.5s ease;
}
@keyframes correct-flash {
  0% { transform: scale(1); }
  30% { transform: scale(1.05); }
  60% { transform: scale(0.98); }
  100% { transform: scale(1); }
}
@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.quiz-feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  display: none;
}
.quiz-feedback.show { display: block; animation: fade-in 0.3s ease; }
.quiz-feedback.correct { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.quiz-feedback.wrong { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.quiz-next-btn {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.85rem;
  background: var(--accent-teal);
  border: none;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,184,148,0.3);
  transition: all var(--transition-bounce);
  display: none;
}
.quiz-next-btn.show { display: block; animation: fade-in 0.3s ease; }
.quiz-next-btn:hover { background: var(--accent-teal-dark); transform: translateY(-2px); }
/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  display: none;
}

/* ============================================
   SCENARIO OVERLAY (NEW)
   ============================================ */
#scenario-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  padding: 1.5rem;
}
#scenario-overlay.visible { display: flex; }
.scenario-card {
  background: #1a1a2e;
  border-radius: 24px;
  padding: 2.25rem;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: quiz-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255,255,255,0.08);
}
.scenario-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-orange);
  margin-bottom: 0.75rem;
}
.scenario-narrative {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: #fff;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  min-height: 3.5rem;
}
.scenario-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent-orange);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursor-blink 0.8s ease-in-out infinite;
}
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.scenario-choices {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.scenario-choice-btn {
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .scenario-choice-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.3);
    transform: translateX(4px);
  }
}
.scenario-choice-btn:active:not(:disabled) {
  background: rgba(255,255,255,0.12);
  transform: scale(0.98);
}
.scenario-choice-btn .choice-letter {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-teal);
  flex-shrink: 0;
  margin-top: 1px;
}
.scenario-choice-btn.correct-choice {
  background: rgba(0,184,148,0.2);
  border-color: var(--accent-teal);
  animation: correct-flash 0.5s ease;
}
.scenario-choice-btn.wrong-choice {
  background: rgba(244,63,94,0.2);
  border-color: #f43f5e;
  animation: wrong-shake 0.5s ease;
}
.scenario-consequence {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  display: none;
}
.scenario-consequence.show { display: block; animation: fade-in 0.3s ease; }
.scenario-consequence.correct { background: rgba(0,184,148,0.15); color: #6ee7b7; border: 1px solid rgba(0,184,148,0.3); }
.scenario-consequence.wrong { background: rgba(244,63,94,0.15); color: #fda4af; border: 1px solid rgba(244,63,94,0.3); }
.scenario-continue-btn {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.85rem;
  background: var(--accent-teal);
  border: none;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,184,148,0.3);
  transition: all var(--transition-bounce);
  display: none;
}
.scenario-continue-btn.show { display: block; animation: fade-in 0.3s ease; }
.scenario-continue-btn:hover { background: var(--accent-teal-dark); transform: translateY(-2px); }

/* ============================================
   SOLUTIONS PANEL — PHASE GATE
   ============================================ */
.solutions-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-medium);
}
.solutions-locked-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.solutions-locked-text { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-dark); margin-bottom: 0.4rem; }
.solutions-locked-sub { font-size: 0.85rem; }

/* ============================================
   ZONE COMPLETE CELEBRATION OVERLAY
   ============================================ */
#zone-complete-overlay {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.92) 100%);
  backdrop-filter: blur(12px);
  text-align: center;
  overflow: hidden;
}
#zone-complete-overlay.visible { display: flex; }

/* Starburst behind medal */
.celebration-starburst {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(255,215,0,0.08) 5%, transparent 10%);
  background-size: 100% 100%;
  animation: starburst-spin 8s linear infinite;
}
.celebration-starburst::before {
  content: '';
  position: absolute; inset: 20px;
  border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0%, rgba(255,215,0,0.12) 5%, transparent 10%);
  animation: starburst-spin 6s linear infinite reverse;
}
@keyframes starburst-spin { to { transform: rotate(360deg); } }

/* Medal */
.celebration-medal {
  width: 130px; height: 130px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(145deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
  box-shadow:
    0 0 0 6px rgba(255,215,0,0.3),
    0 0 40px rgba(255,215,0,0.4),
    0 0 80px rgba(255,165,0,0.2),
    inset 0 -4px 8px rgba(0,0,0,0.15),
    inset 0 4px 8px rgba(255,255,255,0.3);
  position: relative;
  z-index: 2;
  animation: medal-drop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0) rotate(-20deg);
}
.celebration-medal .medal-icon { font-size: 3.2rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.celebration-medal .medal-label { font-family: var(--font-display); font-size: 0.7rem; color: #7a4a00; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
@keyframes medal-drop {
  0% { opacity: 0; transform: scale(0) rotate(-20deg); }
  60% { opacity: 1; transform: scale(1.15) rotate(5deg); }
  80% { transform: scale(0.95) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Title */
.celebration-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: #FFD700;
  margin-top: 1.2rem;
  text-shadow: 0 0 30px rgba(255,215,0,0.5), 0 2px 4px rgba(0,0,0,0.4);
  opacity: 0;
  animation: title-in 0.5s ease 0.4s forwards;
}
.celebration-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  margin-top: 0.4rem;
  opacity: 0;
  animation: title-in 0.5s ease 0.6s forwards;
}
@keyframes title-in { to { opacity: 1; transform: translateY(0); } from { opacity: 0; transform: translateY(10px); } }

/* XP Counter */
.celebration-xp {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 1.2rem;
  padding: 0.6rem 1.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 50px;
  opacity: 0;
  animation: title-in 0.5s ease 0.8s forwards;
}
.xp-icon { font-size: 1.4rem; }
.xp-value { font-family: var(--font-display); font-size: 1.3rem; color: #FFD700; }
.xp-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.xp-streak {
  font-size: 0.75rem;
  color: #FF6633;
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(255,102,51,0.15);
  border-radius: 20px;
  display: none;
}
.xp-streak.active { display: inline-block; animation: streak-pop 0.4s ease; }
@keyframes streak-pop { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Reward cards that fly in */
.celebration-rewards {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 600px;
  padding: 0 1rem;
}
.reward-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  display: flex; align-items: center; gap: 0.5rem;
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(20px);
  animation: reward-fly 0.4s ease forwards;
}
.reward-card .reward-icon { font-size: 1.3rem; }
.reward-card .reward-name { font-weight: 700; }
.reward-card .reward-savings { color: var(--accent-teal); font-size: 0.7rem; }
@keyframes reward-fly { to { opacity: 1; transform: translateY(0); } }

/* Progress ring */
.celebration-progress {
  margin-top: 1.2rem;
  display: flex; align-items: center; gap: 0.75rem;
  opacity: 0;
  animation: title-in 0.5s ease 1s forwards;
}
.progress-pips {
  display: flex; gap: 6px;
}
.progress-pip {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  background: transparent;
  transition: all 0.3s ease;
}
.progress-pip.done {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  box-shadow: 0 0 8px rgba(0,184,148,0.5);
}
.progress-pip.current {
  background: #FFD700;
  border-color: #FFD700;
  box-shadow: 0 0 12px rgba(255,215,0,0.6);
  animation: pip-glow 0.6s ease;
}
@keyframes pip-glow { 0% { transform: scale(0); } 60% { transform: scale(1.4); } 100% { transform: scale(1); } }
.celebration-progress-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

/* Auto-return bar */
.celebration-autobar {
  position: absolute;
  bottom: 0; left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-teal), #FFD700);
  animation: autobar-fill 4s linear forwards;
  border-radius: 0 2px 2px 0;
}
@keyframes autobar-fill { from { width: 0%; } to { width: 100%; } }
.celebration-skip {
  position: absolute;
  bottom: 1.5rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s;
}
.celebration-skip:hover { color: rgba(255,255,255,0.7); }

/* Gold star for completed hotspots */
.zone-hotspot.completed .zone-ring {
  border-color: #FFD700;
  background: rgba(255,215,0,0.2);
  box-shadow: 0 0 16px rgba(255,215,0,0.4), inset 0 0 8px rgba(255,215,0,0.15);
}
.zone-hotspot.completed .zone-check { display: block; font-size: 1.2rem; }
.zone-star { display: none; font-size: 1.5rem; filter: drop-shadow(0 0 6px rgba(255,215,0,0.6)); }
.zone-hotspot.completed .zone-star { display: block; animation: star-spin 0.6s ease; }
.zone-hotspot.completed .zone-check { display: none; }
@keyframes star-spin { 0% { transform: scale(0) rotate(-180deg); } 60% { transform: scale(1.3) rotate(15deg); } 100% { transform: scale(1) rotate(0deg); } }

/* ============================================
   RESULTS SCREEN (ENHANCED)
   ============================================ */
#results-screen {
  background: linear-gradient(135deg, #E8F6F3 0%, #FEF9E7 40%, #FDEBD0 100%);
  overflow-y: auto;
  justify-content: flex-start;
  padding-top: 2rem;
}
.results-content {
  text-align: center;
  padding: 2rem;
  max-width: 700px;
  width: 100%;
  padding-bottom: 3rem;
}
.results-badge {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-teal) 0%, #00d2d3 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 40px rgba(0,184,148,0.3);
  animation: badge-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badge-pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.results-grade { font-family: var(--font-display); font-size: 3rem; color: #fff; line-height: 1; }
.results-score-label { font-size: 0.7rem; color: rgba(255,255,255,0.8); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.results-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2rem); color: var(--text-dark); margin-bottom: 0.5rem; }
.results-subtitle { font-size: 0.95rem; color: var(--text-medium); margin-bottom: 1.5rem; line-height: 1.5; }
.results-state-info { background: var(--warm-bg); border: 1px solid rgba(0,0,0,0.06); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.state-risks-title, .state-tips-title { font-family: var(--font-display); font-size: 0.8rem; color: var(--text-dark); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.03em; }
.state-risks { font-size: 0.85rem; color: var(--accent-teal-dark); font-weight: 600; margin-bottom: 0.75rem; }
.state-tips-title { margin-top: 0.5rem; }
.state-tips { font-size: 0.8rem; color: var(--text-medium); line-height: 1.5; }

/* Stats row */
.results-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.results-stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 1rem 0.75rem;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.results-stat-icon { font-size: 1.4rem; margin-bottom: 0.3rem; }
.results-stat-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent-teal);
  line-height: 1;
  margin-bottom: 0.2rem;
}
.results-stat-label { font-size: 0.68rem; font-weight: 800; color: var(--text-medium); text-transform: uppercase; letter-spacing: 0.04em; }

/* Risk chart */
.results-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  text-align: left;
}
.results-risk-chart {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
  text-align: left;
}
.risk-chart-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.risk-chart-row:last-child { margin-bottom: 0; }
.risk-chart-label {
  width: 100px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-dark);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.risk-chart-bar-outer {
  flex: 1;
  height: 18px;
  background: var(--warm-tan);
  border-radius: 9px;
  overflow: hidden;
}
.risk-chart-bar-inner {
  height: 100%;
  border-radius: 9px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}
.risk-chart-val {
  font-size: 0.75rem;
  font-weight: 800;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Priority actions */
.results-priority {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
  text-align: left;
}
.priority-action {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.priority-action:last-child { border-bottom: none; padding-bottom: 0; }
.priority-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.priority-text { flex: 1; }
.priority-name { font-weight: 800; font-size: 0.88rem; color: var(--text-dark); margin-bottom: 0.15rem; }
.priority-zone { font-size: 0.75rem; color: var(--text-medium); }

/* Savings callout */
.results-savings-callout {
  background: linear-gradient(135deg, #e0f2fe, #f0fdf4);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0,184,148,0.2);
  text-align: center;
}
.savings-callout-label { font-size: 0.78rem; font-weight: 800; color: var(--text-medium); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.savings-callout-value { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 1.8rem); color: var(--accent-teal); }
.savings-callout-sub { font-size: 0.78rem; color: var(--text-medium); margin-top: 0.3rem; }

/* Zone summary */
.results-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.results-zone-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 0.75rem;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.results-zone-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.results-zone-name { font-size: 0.7rem; font-weight: 800; color: var(--text-dark); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.25rem; }
.results-zone-score { font-size: 0.75rem; font-weight: 700; color: var(--accent-teal); }

/* Deep Dive Email Capture */
.results-deepdive {
  background: linear-gradient(135deg, rgba(0,184,148,0.08) 0%, rgba(74,155,217,0.08) 100%);
  border: 2px solid rgba(0,184,148,0.2);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  margin: 1.5rem 0;
}
.deepdive-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.deepdive-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}
.deepdive-desc {
  font-size: 0.85rem;
  color: var(--text-medium);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto 1.2rem;
}
.deepdive-form {
  display: flex;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto;
}
.deepdive-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 2px solid var(--warm-tan);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.deepdive-input:focus { border-color: var(--accent-teal); }
.deepdive-submit {
  padding: 0.7rem 1.3rem;
  background: var(--accent-teal);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}
.deepdive-submit:hover { background: var(--accent-teal-dark); transform: translateY(-1px); }
.deepdive-success { padding: 0.5rem 0; }
.deepdive-success-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.deepdive-success-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-teal-dark);
  margin-bottom: 1rem;
}
.deepdive-quote-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-teal-dark) 100%);
  color: #fff;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,184,148,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.deepdive-quote-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,184,148,0.4); }

.deepdive-details-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 480px;
  margin: 0 auto;
}
.deepdive-row {
  display: flex;
  gap: 0.5rem;
}
.deepdive-row .deepdive-input { flex: 1; }
.deepdive-row .dd-short { flex: 0 0 80px; }
.deepdive-step2-header {
  margin-bottom: 1rem;
}
.deepdive-optin {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-medium);
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
  margin: 0.3rem 0;
}
.deepdive-optin input[type=checkbox] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-teal);
  flex-shrink: 0;
}
.deepdive-final { padding: 0.5rem 0; }

@media (max-width: 500px) {
  .deepdive-form { flex-direction: column; }
  .deepdive-submit { width: 100%; }
  .deepdive-row { flex-direction: column; }
  .deepdive-row .dd-short { flex: 1; }
}

.results-resource-cards { display: flex; gap: 0.75rem; margin: 1.25rem 0; }
.resource-card { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 1rem 0.75rem; background: var(--warm-bg); border: 1px solid rgba(0,0,0,0.06); border-radius: 12px; text-decoration: none; color: var(--text-dark); transition: all 0.2s ease; text-align: center; }
.resource-card:hover { border-color: var(--accent-teal); background: rgba(0,184,148,0.04); }
.resource-icon { font-size: 1.3rem; }
.resource-title { font-family: var(--font-display); font-size: 0.8rem; line-height: 1.3; color: var(--text-dark); }
.resource-desc { font-size: 0.7rem; color: var(--text-medium); line-height: 1.3; }
.results-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  background: var(--accent-teal);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,184,148,0.3);
  transition: all var(--transition-bounce);
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.results-cta:hover { background: var(--accent-teal-dark); transform: translateY(-2px); }
.results-restart {
  display: block;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-medium);
  background: transparent;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.results-restart:hover { border-color: var(--accent-teal); color: var(--accent-teal); }

/* ============================================
   FOOTER
   ============================================ */
.footer-attribution {
  position: absolute;
  bottom: 0.75rem;
  left: 0; right: 0;
  text-align: center;
  z-index: 30;
  font-size: 0.65rem;
  color: var(--text-light);
}
.footer-attribution a { color: var(--text-light); text-decoration: none; transition: color 0.3s; }
.footer-attribution a:hover { color: var(--text-medium); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1000px) {
  .peril-layout { flex-direction: column; }
  .peril-canvas-panel { width: 100%; height: 45%; }
  .peril-solutions-panel { width: 100%; height: 55%; padding: 1rem; }
  .results-zones { grid-template-columns: repeat(2, 1fr); }
  .results-stats-row { grid-template-columns: repeat(3, 1fr); }
  .quiz-answers { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .hub-header { padding: 0.6rem 0.8rem; gap: 0.5rem; }
  .hub-header .cta-quote { padding: 0.3rem 0.65rem; font-size: 0.65rem; }
  .hub-header .cta-quote svg { width: 11px; height: 11px; }
  .hub-title { font-size: 0.95rem; }
  .cta-float { top: 0.6rem; right: 0.8rem; padding: 0.35rem 0.8rem; font-size: 0.7rem; }
  .progress-bar-outer { width: 100px; }
  .zone-ring { width: 44px; height: 44px; }
  .zone-ring .zone-icon { font-size: 1.1rem; }
  .results-stats-row { grid-template-columns: 1fr 1fr; }
  .intake-options.grid-2 { grid-template-columns: 1fr; }
}

/* ============================================
   MASCOT
   ============================================ */
.mascot-container {
  position: absolute;
  bottom: -160px;
  right: 10%;
  width: 120px;
  z-index: 10;
  transition: bottom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.mascot-container.visible {
  bottom: 20px;
}
.mascot-container .mascot-arm-left,
.mascot-container .mascot-arm-right {
  transform-origin: center top;
}
.mascot-container.clapping .mascot-arm-left {
  animation: clap-left 0.5s ease-in-out 3;
}
.mascot-container.clapping .mascot-arm-right {
  animation: clap-right 0.5s ease-in-out 3;
}
@keyframes clap-left {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(30deg); }
}
@keyframes clap-right {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-30deg); }
}
@keyframes mascot-slide-in {
  from { bottom: -160px; }
  to { bottom: 20px; }
}

.mascot-speech {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.mascot-speech::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #fff;
}
.mascot-speech.visible {
  opacity: 1;
}

/* Sound toggle */
.sound-toggle {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}
.sound-toggle:hover {
  background: rgba(0,0,0,0.55);
}
/* ============================================
   HOUSE MASCOT
   ============================================ */
.mascot-container {
  position: absolute;
  bottom: -180px;
  right: 8%;
  width: 110px;
  z-index: 5;
  transition: bottom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.mascot-container.visible { bottom: 60px; }
.mascot-container.exit { bottom: -180px; transition: bottom 0.5s ease-in; }

.mascot-house { width: 100%; height: auto; }

/* Clap animation */
.mascot-arm-left, .mascot-arm-right {
  transform-origin: 50% 10%;
  transition: transform 0.15s ease;
}
.mascot-container.clapping .mascot-arm-left {
  animation: clap-left 0.5s ease 3;
}
.mascot-container.clapping .mascot-arm-right {
  animation: clap-right 0.5s ease 3;
}
@keyframes clap-left {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(35deg); }
}
@keyframes clap-right {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(-35deg); }
}

/* Happy eyes squint during clap */
.mascot-container.clapping .mascot-eye-lid {
  animation: eye-squint 0.5s ease 3;
}
@keyframes eye-squint {
  0%, 100% { transform: scaleY(1); }
  30%, 50% { transform: scaleY(0.3); }
}

/* Speech bubble */
.mascot-speech {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: #fff;
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 16px;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.mascot-speech::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #fff;
}
.mascot-speech.visible { transform: translateX(-50%) scale(1); }

/* ============================================
   SOUND TOGGLE
   ============================================ */
.sound-toggle {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 100;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}
.sound-toggle:hover { background: rgba(0,0,0,0.25); transform: scale(1.05); }

/* ============================================
   LOADING SCREEN
   ============================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  color: #fff;
  gap: 1.5rem;
  transition: opacity 0.5s ease;
}
.loading-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  text-align: center;
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent-teal);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
.loading-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

/* ============================================
   MOBILE UX — TOUCH TARGETS & LAYOUT
   ============================================ */
input[type="text"], input[type="email"], input[type="tel"] {
  font-size: 16px; /* prevents iOS auto-zoom */
}

@media (max-width: 500px) {
  /* Title screen */
  .title-content h1 { font-size: 2rem; }
  .tagline { font-size: 0.9rem; }
  .explore-btn { padding: 0.8rem 2rem; font-size: 0.9rem; }

  /* Intake */
  .intake-option-btn { min-height: 48px; font-size: 0.85rem; }
  #intake-question-card { padding: 1.2rem; }

  /* Quiz */
  .quiz-answer-btn { min-height: 48px; padding: 0.7rem; font-size: 0.82rem; }
  .quiz-card { padding: 1rem; }

  /* Scenario */
  .scenario-choice-btn { min-height: 48px; font-size: 0.82rem; }

  /* Hub */
  .hub-header { padding: 0.5rem 0.8rem; }
  .hub-title { font-size: 0.85rem; }

  /* Results */
  .results-deepdive { padding: 1.2rem; }
  .deepdive-row { flex-direction: column; }
  .results-resource-cards { flex-direction: column; }
}


/* Assessment keyboard, reading, and motion support. */
:focus-visible { outline: 3px solid #0a7c6a; outline-offset: 4px; }
.zone-hotspot:focus-visible { border-radius: 12px; outline: 4px solid #fff; box-shadow: 0 0 0 7px #0a7c6a; }
#quiz-overlay, #scenario-overlay, #zone-complete-overlay { overflow-y: auto; }
.quiz-card, .scenario-card { max-height: calc(100dvh - 3rem); overflow-y: auto; }
.field-guide-actions { display: grid; gap: .75rem; padding: 1rem 0 2rem; }
.field-guide-actions button { min-height: 44px; }
.celebration-autobar { display: none; }
#celeb-skip { min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .cloud, .celebration-starburst { display: none !important; }
}

