* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #0B0B0B;
  color: #FFFFFF;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: 40%;
  left: 50%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 212, 0, 0.015) 0%, rgba(255, 212, 0, 0.005) 40%, transparent 70%);
  animation: ambientPulse 16s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

.container {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.logo {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #9CA3AF;
  margin: 0 0 4px 0;
}

.tagline {
  color: #9CA3AF;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  margin: 0 0 32px 0;
  opacity: 0.5;
}

.clock {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: clamp(3.8rem, 14vw, 7rem);
  font-weight: 700;
  letter-spacing: 2px;
  color: #FFD400;
  margin-bottom: 6px;
  line-height: 1;
  min-height: 1em;
  text-shadow:
    0 0 20px rgba(255, 212, 0, 0.2),
    0 0 60px rgba(255, 212, 0, 0.06);
  position: relative;
  white-space: nowrap;
  contain: layout style;
}

.clock-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 212, 0, 0.05) 0%, transparent 65%);
  animation: glowBreathe 4s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
  will-change: opacity;
}

@keyframes glowBreathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.clock-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 212, 0, 0.08), transparent);
  animation: highlightSweep 1.8s ease-in-out 0.5s forwards;
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes highlightSweep {
  0% { transform: translateX(-200%); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(350%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .clock-glow { animation: none; opacity: 0.6; }
  .clock-sweep { animation: none; display: none; }
  #seconds { transition: none; }
}

.clock span {
  display: inline-block;
  transition: opacity 0.15s ease;
  vertical-align: baseline;
}

#seconds {
  transition: opacity 0.12s ease;
}

#seconds.tick {
  opacity: 0.6;
}

.colon {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.clock-sub {
  font-size: 0.65rem;
  color: #9CA3AF;
  opacity: 0.4;
  letter-spacing: 1px;
  margin: 8px 0 28px 0;
  position: relative;
  z-index: 2;
}

.fact-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 28px 24px;
  min-height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  contain: content;
}

.fact-box p {
  font-size: 1.15rem;
  color: #FFFFFF;
  line-height: 1.7;
  font-weight: 400;
  margin: 0;
  transition: opacity 0.4s ease;
}

.fact-box p.fade-out {
  opacity: 0;
}

.fact-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 0 0;
}

.fact-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: #9CA3AF;
  border: 1px solid rgba(156, 163, 175, 0.12);
  border-radius: 8px;
  font-size: 0.72rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.fact-action-btn:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.fact-action-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.05);
}

.fact-action-btn.copied {
  color: #22D3EE;
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.04);
}

.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fact-action-btn svg {
  flex-shrink: 0;
}

.quiz-cta {
  margin-top: 28px;
  text-align: center;
}

.quiz-cta-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 4px 0;
  letter-spacing: 0.3px;
}

.quiz-cta-sub {
  font-size: 0.78rem;
  color: #9CA3AF;
  margin: 0 0 18px 0;
  letter-spacing: 0.3px;
}

.quiz-cta-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 16px 24px;
  background: #FFD400;
  color: #0B0B0B;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.quiz-cta-btn:hover {
  background: #ffe033;
  box-shadow: 0 0 24px rgba(255, 212, 0, 0.2);
}

.quiz-cta-btn:active {
  transform: scale(0.97);
}

.quiz-cta-note {
  font-size: 0.7rem;
  color: #9CA3AF;
  margin: 12px 0 0 0;
  opacity: 0.6;
  letter-spacing: 0.3px;
}

a {
  text-decoration: none;
}

footer {
  margin-top: 56px;
  font-size: 0.68rem;
  color: #9CA3AF;
  letter-spacing: 0.5px;
  opacity: 0.35;
  line-height: 1.6;
}

footer p {
  margin: 0;
}

.footer-sub {
  margin-top: 2px !important;
  font-size: 0.6rem !important;
  opacity: 0.7;
}

@media (min-width: 640px) {
  .container {
    max-width: 560px;
    padding: 64px 32px 56px;
  }

  .logo {
    font-size: 1rem;
    letter-spacing: 8px;
  }

  .tagline {
    font-size: 0.75rem;
    margin-bottom: 40px;
  }

  .clock {
    font-size: clamp(5rem, 12vw, 9rem);
    text-shadow:
      0 0 30px rgba(255, 212, 0, 0.25),
      0 0 80px rgba(255, 212, 0, 0.08);
  }

  .clock-sub {
    margin-bottom: 36px;
  }

  .fact-box {
    padding: 36px 32px;
    border-radius: 16px;
  }

  .fact-box p {
    font-size: 1.35rem;
  }

  .fact-actions {
    margin-top: 20px;
  }

  .quiz-cta {
    margin-top: 40px;
  }

  footer {
    margin-top: 72px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 640px;
    padding: 80px 40px 64px;
  }

  .clock {
    font-size: 10rem;
    margin-bottom: 8px;
  }

  .fact-box p {
    font-size: 1.45rem;
  }
}

.hidden {
  display: none;
}

/* --- FACTOCLOCK DAILY QUIZ PAGE --- */
.quiz-page {
  max-width: 480px;
  padding: 40px 20px;
}

.quiz-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #9CA3AF;
  margin: 0 0 4px 0;
}

.quiz-number {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #FFD400;
  margin: 0 0 28px 0;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 440px;
  margin: 0 auto 20px;
}

.quiz-progress {
  font-size: 0.75rem;
  color: #9CA3AF;
  letter-spacing: 1px;
}

.quiz-timer {
  font-size: 0.75rem;
  color: #9CA3AF;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

#question {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #FFFFFF;
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

#answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}

.answer-btn {
  padding: 14px 20px;
  border: 1px solid #2B2B2B;
  border-radius: 10px;
  background: #161616;
  color: #FFFFFF;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  text-align: left;
}

.answer-btn:hover:not(:disabled) {
  background: #1F1F1F;
  border-color: #3A3A3A;
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.correct {
  background-color: #FFD400;
  color: #0B0B0B;
  border-color: #FFD400;
}

.answer-btn.wrong {
  background-color: #1E1012;
  color: #9B6A6A;
  border-color: #2E1A1D;
}

.answer-btn.correct-reveal {
  background-color: #FFD400;
  color: #0B0B0B;
  border-color: #FFD400;
  animation: revealFlash 0.5s ease;
}

@keyframes revealFlash {
  0% { background-color: #161616; color: #FFFFFF; border-color: #2B2B2B; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 212, 0, 0); }
  35% { background-color: #FFD400; color: #0B0B0B; border-color: #FFD400; transform: scale(1.03); box-shadow: 0 0 20px 2px rgba(255, 212, 0, 0.25); }
  60% { transform: scale(1.0); box-shadow: 0 0 12px 1px rgba(255, 212, 0, 0.15); }
  100% { background-color: #FFD400; color: #0B0B0B; border-color: #FFD400; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 212, 0, 0); }
}

.quiz-explain {
  margin: 12px 0 0;
  padding: 0 4px;
  font-size: 0.85rem;
  color: #9CA3AF;
  font-style: italic;
  line-height: 1.4;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

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

.quiz-circle {
  width: 280px;
  height: 280px;
  margin: 28px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-circle canvas {
  display: block;
}

.result-streak {
  font-size: 0.9rem;
  color: #FFD400;
  margin: 0 0 4px 0;
  letter-spacing: 0.5px;
  min-height: 1.2em;
  text-align: center;
}

.result-time {
  font-size: 0.8rem;
  color: #9CA3AF;
  margin: 0 0 28px 0;
  letter-spacing: 0.5px;
  text-align: center;
}

.result-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

#share-btn {
  padding: 12px 28px;
  background: #FFD400;
  color: #0B0B0B;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#share-btn:hover {
  background: #ffe033;
}

#back-btn {
  display: inline-block;
  padding: 12px 28px;
  background: transparent;
  color: #9CA3AF;
  border: 1px solid rgba(156, 163, 175, 0.15);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

#back-btn:hover,
#completed-back-btn:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
}

#completed-back-btn {
  display: inline-block;
  padding: 12px 28px;
  background: transparent;
  color: #9CA3AF;
  border: 1px solid rgba(156, 163, 175, 0.15);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.completed-message {
  margin: 32px 0 28px;
}

.completed-headline {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 8px 0;
}

.completed-sub {
  font-size: 0.85rem;
  color: #9CA3AF;
  margin: 0;
}

.completed-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 0 0 28px 0;
}

.completed-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.completed-stat-value {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #FFD400;
}

.completed-stat-label {
  font-size: 0.7rem;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.completed-history {
  margin: 0 0 28px 0;
}

.completed-history-title {
  font-size: 0.75rem;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

.completed-history-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(156, 163, 175, 0.08);
  font-size: 0.82rem;
}

.completed-history-entry span:first-child {
  color: #9CA3AF;
}

.completed-history-entry span:last-child {
  color: #FFD400;
  font-weight: 600;
}

@media (min-width: 640px) {
  .quiz-page {
    max-width: 560px;
    padding: 48px 24px;
  }

  #question {
    font-size: 1.35rem;
  }

  .quiz-circle {
    width: 320px;
    height: 320px;
    margin: 36px auto;
  }
}
