:root {
  --gold: #d4af37;
  --gold-light: #f3d576;
  --black: #0a0f1e;
  --black-soft: #111a33;
  --cream: #f7f1e3;
  --blue: #2563eb;
  --blue-light: #60a5fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.page-header {
  position: relative;
  z-index: 2;
  padding: 18px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--gold-light);
  font-size: 1.2rem;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.back-btn:hover {
  background: rgba(212, 175, 55, 0.12);
  transform: scale(1.05);
}

.favorites-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--blue-light);
  text-decoration: none;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.favorites-nav-btn:hover {
  background: rgba(96, 165, 250, 0.15);
  transform: scale(1.05);
}

.header-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

.night-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--blue-light);
  background: transparent;
  font-size: 1.1rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.night-mode-toggle:hover {
  background: rgba(96, 165, 250, 0.15);
  transform: scale(1.05);
}

/* وضع القراءة الليلي: تعتيم عام وميل دافئ (تقليل الضوء الأزرق) بدل
   إعادة تعريف كل لون على حدة، مناسب لقراءة قصة قبل النوم مباشرة. */
body.night-mode {
  filter: brightness(0.8) sepia(0.15);
  transition: filter 0.3s ease;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 35%, var(--black-soft) 0%, var(--black) 75%);
  font-family: 'Cairo', sans-serif;
  color: var(--cream);
  overflow-x: hidden;
  position: relative;
}

/* توهج أزرق ليلي سحري خلف المحتوى */
.magic-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 40%, rgba(37, 99, 235, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 45% 30% at 15% 85%, rgba(37, 99, 235, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 45% 30% at 85% 15%, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
  filter: blur(4px);
  pointer-events: none;
}

/* خلفية نجوم ذهبية/زرقاء صغيرة متلألئة (أشكال نجوم حقيقية عبر SVG) */
.stars {
  position: fixed;
  inset: 0;
  --star-gold-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1L12.52 7.75L19 10L12.52 12.25L10 19L7.48 12.25L1 10L7.48 7.75Z' fill='%23f3d576'/%3E%3C/svg%3E");
  --star-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1L12.52 7.75L19 10L12.52 12.25L10 19L7.48 12.25L1 10L7.48 7.75Z' fill='%23d4af37'/%3E%3C/svg%3E");
  --star-blue-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1L12.52 7.75L19 10L12.52 12.25L10 19L7.48 12.25L1 10L7.48 7.75Z' fill='%2360a5fa'/%3E%3C/svg%3E");
  background-image:
    var(--star-gold-light),
    var(--star-gold-light),
    var(--star-gold),
    var(--star-gold-light),
    var(--star-gold),
    var(--star-gold-light),
    var(--star-blue-light),
    var(--star-blue-light);
  background-repeat: no-repeat;
  background-position: 10% 20%, 80% 30%, 30% 70%, 60% 80%, 90% 65%, 20% 90%, 45% 15%, 70% 55%;
  background-size: 9px 9px, 9px 9px, 7px 7px, 9px 9px, 7px 7px, 7px 7px, 9px 9px, 7px 7px;
  opacity: 0.6;
  animation: twinkle 4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to   { opacity: 0.8; }
}

.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 6px;
}

.ink-wrap {
  position: relative;
  margin-bottom: 8px;
}

.ink-drop {
  animation: drip 2.6s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(37, 99, 235, 0.45));
}

@keyframes drip {
  0%   { transform: translateY(-6px); }
  50%  { transform: translateY(6px); }
  100% { transform: translateY(-6px); }
}

.ink-ripple {
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 40px;
  height: 10px;
  border: 2px solid var(--blue-light);
  border-radius: 50%;
  transform: translateX(-50%) scale(1);
  opacity: 0;
  animation: ripple 2.6s ease-in-out infinite;
}

@keyframes ripple {
  0%, 40%  { opacity: 0; transform: translateX(-50%) scale(0.6); }
  55%      { opacity: 0.7; }
  85%      { opacity: 0; transform: translateX(-50%) scale(1.6); }
  100%     { opacity: 0; transform: translateX(-50%) scale(1.6); }
}

.logo-text {
  font-family: 'Aref Ruqaa', serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 60%, #a9791f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 18px rgba(212, 175, 55, 0.35);
  line-height: 1.15;
}

.logo-text .dot {
  color: var(--blue-light);
  -webkit-text-fill-color: var(--blue-light);
}

.tagline {
  color: var(--gold-light);
  font-size: 1.05rem;
  opacity: 0.85;
  margin-bottom: 34px;
}

.start-btn {
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--black);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: none;
  border-radius: 999px;
  padding: 16px 42px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.start-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.45);
}

.start-btn:active {
  transform: translateY(0) scale(0.97);
}

.btn-sparkle {
  display: inline-block;
  animation: spin 3s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.mvp-tag {
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--cream);
  opacity: 0.4;
  letter-spacing: 0.5px;
}

.about-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  text-decoration: none;
  opacity: 0.75;
}

.about-link:hover {
  text-decoration: underline;
}
