/* ============================================
   QUESTIONS FOR US — Styles
   ============================================ */

:root {
  --bg-start: #f0f0ff;
  --bg-end: #ffeef8;
  --primary: #7c6bc4;
  --primary-light: #b8a9e8;
  --primary-soft: #e0d6ff;
  --accent: #e8507e;
  --accent-light: #ffb6c8;
  --text: #3d3557;
  --text-soft: #7a6e8a;
  --cream: #fffbf7;
  --white: #ffffff;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100dvh;
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* --- App Nav Button (bottom-left) --- */
.app-nav-btn {
  position: fixed;
  bottom: 1.4rem;
  left: 1.4rem;
  z-index: 50;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(124, 107, 196, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.app-nav-btn span {
  font-size: 1.4rem;
  line-height: 1;
}

.app-nav-btn:hover,
.app-nav-btn:focus-visible {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(124, 107, 196, 0.3);
  background: rgba(255, 255, 255, 0.9);
}

.app-nav-btn:active {
  transform: scale(0.93);
}

/* --- Floating Emojis Background --- */
.floating-emojis {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  opacity: 0;
  animation: floatUp linear infinite;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  10% { opacity: 0.45; }
  50% { opacity: 0.5; }
  90% { opacity: 0.4; }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(1.1);
    opacity: 0;
  }
}

/* --- Layout --- */
.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 2rem 1.5rem 1rem;
  gap: 1.2rem;
}

/* --- Header --- */
.header {
  text-align: center;
  padding-bottom: 0.5rem;
  animation: fadeInDown 0.8s ease-out;
}

.title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(124, 107, 196, 0.15);
}

.subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-soft);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* --- Question Card --- */
.card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 1rem;
  width: 100%;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.card-hint {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
  letter-spacing: 0.05em;
}

.question-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 300px;
  padding: 2.8rem 2rem;
  border-radius: 28px;
  background: var(--cream);
  border: 2px solid var(--primary-light);
  box-shadow:
    0 20px 50px rgba(124, 107, 196, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
}

.question-card:hover,
.question-card:focus-visible {
  transform: scale(1.02);
  box-shadow:
    0 25px 60px rgba(124, 107, 196, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.question-card:active {
  transform: scale(0.98);
}

.question-card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 6px;
}

.card-inner {
  position: relative;
  text-align: center;
  width: 100%;
}

.question-text {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Text exit animation */
.question-text.exiting {
  opacity: 0;
  transform: translateY(-30px) scale(0.9);
}

/* Text enter animation */
.question-text.entering {
  opacity: 0;
  transform: translateY(30px) scale(0.9);
}

/* Card decorations */
.card-deco {
  position: absolute;
  font-size: 1rem;
  color: var(--primary-light);
  opacity: 0.4;
  transition: color 0.4s ease;
}

.card-deco.top-left { top: -8px; left: -4px; }
.card-deco.top-right { top: -8px; right: -4px; }
.card-deco.bottom-left { bottom: -8px; left: -4px; }
.card-deco.bottom-right { bottom: -8px; right: -4px; }

/* --- Counter --- */
.counter {
  font-size: 0.8rem;
  color: var(--text-soft);
  opacity: 0.5;
  font-weight: 600;
  padding-bottom: 0.5rem;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

/* --- Animations --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

/* Card pop on new question */
@keyframes cardPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.question-card.pop {
  animation: cardPop 0.35s ease-in-out;
}

/* --- Responsive --- */
@media (min-width: 768px) {
  .question-card {
    max-width: 560px;
    min-height: 340px;
    padding: 3.2rem 3rem;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .floating-emoji { display: none; }
}
