/* Scale all fonts ~15% larger (16px → 18.4px root) */
html {
  font-size: 18.4px;
}

/* Onboarding overlay */
#onboarding {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#carousel {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Typing indicator animation */
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c96b64;
  display: inline-block;
  animation: typingDot 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Chat message entrance */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message {
  animation: slideUp 0.3s ease-out;
}

/* Stats bar fill animation */
@keyframes fillBar {
  from { width: 0; }
}

.stats-bar-fill {
  animation: fillBar 0.6s ease-out;
}

/* Smooth scroll for chat */
#chat {
  scroll-behavior: smooth;
}

/* Summary card gradient border */
.summary-card {
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, #c96b64, #8db3d9, #c96b64) border-box;
  border: 3px solid transparent;
  border-radius: 1rem;
}

/* Share button pulse */
@keyframes gentlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 107, 100, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(201, 107, 100, 0); }
}

.share-btn {
  animation: gentlePulse 2s infinite;
}

/* Hide scrollbar but keep scroll */
#chat::-webkit-scrollbar { width: 4px; }
#chat::-webkit-scrollbar-thumb { background: #ddd0c0; border-radius: 2px; }

/* Full-height on mobile Safari */
@supports (height: 100dvh) {
  body { height: 100dvh; }
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
  input[type="text"], input[type="email"] {
    font-size: 16px;
  }
}

/* Stabilize layout when virtual keyboard opens */
body {
  overflow: hidden;
}

/* Prevent scroll-into-view jump on focus */
#answer-input {
  scroll-margin: 0;
}

/* Lock viewport so keyboard doesn't push content around */
@supports (height: 100dvh) {
  body {
    height: 100dvh;
    min-height: 100dvh;
  }
}

/* When keyboard is visible, use visual viewport to avoid resize */
@supports (height: 1svh) {
  body {
    height: 100svh;
  }
}

/* Year guesser slider ─────────────────────────────────────────────
   Layout: segmented rail with visible gaps + pill-rounded end caps,
   a custom map-pin thumb, and a transparent native <input type=range>
   on top to drive the interaction (keyboard + drag + snap-to-step).
   The native track + thumb are invisible; we render our own so the
   thumb sits centered on the four segment centers rather than the
   usual 0/33/66/100% the browser lays down for min=0 max=3.
   ----------------------------------------------------------------- */
.year-track-wrap {
  position: relative;
  height: 40px;
  margin: 14px 0 4px;
  user-select: none;
  -webkit-user-select: none;
}
.year-segments {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  pointer-events: none;
}
.year-seg {
  flex: 1 1 0;
  height: 10px;
  border-radius: 999px;  /* pill endcaps */
  background: #ede4d9;   /* cream-200 */
  transition: background 180ms ease;
}
.year-seg.active {
  background: #6898b8;   /* cotton-500 — matches selected-answer blue */
}
.year-thumb {
  position: absolute;
  top: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  /* Bounce-settle when the slider snaps from one segment to another. */
  transition: left 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.year-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}
input[type=range].year-slider {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0;
}
input[type=range].year-slider::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent;
  border: none;
}
input[type=range].year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 40px;   /* wide hit target — invisible, custom thumb shows visually */
  height: 40px;
  background: transparent;
  border: none;
  cursor: grab;
}
input[type=range].year-slider::-moz-range-track {
  height: 100%;
  background: transparent;
  border: none;
}
input[type=range].year-slider::-moz-range-thumb {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: grab;
}
input[type=range].year-slider:active::-webkit-slider-thumb,
input[type=range].year-slider:active::-moz-range-thumb {
  cursor: grabbing;
}
input[type=range].year-slider:disabled {
  opacity: 0.6;
  cursor: default;
}
input[type=range].year-slider:disabled::-webkit-slider-thumb,
input[type=range].year-slider:disabled::-moz-range-thumb {
  cursor: default;
}

/* Odd one out grid */
.odd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 100%;
  overflow: hidden;
}
