/* ══════════════════════════════════════════════════════
   MOSSWICK — THEME
   Color palette, typography, and atmospheric base styles
   ══════════════════════════════════════════════════════ */

:root {
  --void: #060a06;
  --deep-forest: #0a110a;
  --moss: #2d4a2a;
  --fern: #3d6b38;
  --sage: #6b8f5e;
  --moonlight: #e8f0e0;
  --petal: #f0e8f0;
  --rose-dust: #c9a0a8;
  --lavender: #9b8fb5;
  --silver: #c8d4c0;
  --gold-moss: #8a9a4a;
  --amber: #c8922a;
  --bark: #4a3020;
  --candlelight: #fef8e8;
  --ink-dark: #1a2018;
}

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

body {
  background: var(--void);
  font-family: 'Cormorant Garamond', serif;
  color: var(--moonlight);
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  overflow-x: hidden;
  cursor: default;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Prevent zoom on input focus (iOS) */
input, textarea, select { font-size: 16px; }

/* Touch-friendly tap targets */
button, .npc-btn, .nav-btn, .action-btn, .qbtn {
  min-height: 36px;
  touch-action: manipulation;
}

/* Atmospheric layered background */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 15% 85%, rgba(45,74,42,0.35) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 15%, rgba(155,143,181,0.12) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(61,107,56,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 0%, rgba(10,17,10,0.8) 0%, transparent 60%),
    linear-gradient(180deg, #060a06 0%, #0a110a 40%, #0d150d 100%);
  pointer-events: none;
}

/* ── ACCESSIBILITY ── */

/* Focus indicators */
:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
  border-radius: 2px;
}

button:focus-visible, .npc-btn:focus-visible, .nav-btn:focus-visible, .action-btn:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 2px;
  box-shadow: 0 0 8px rgba(155,143,181,0.3);
}

/* Skip to content (visible on focus) */
.skip-link {
  position: absolute; top: -100px; left: 50%;
  transform: translateX(-50%);
  background: var(--deep-forest);
  color: var(--moonlight);
  padding: 8px 16px; border-radius: 0 0 4px 4px;
  font-family: 'Cinzel', serif; font-size: 0.7rem;
  letter-spacing: 0.1em; z-index: 1000;
  border: 1px solid var(--sage);
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --sage: #8ab87a;
    --moonlight: #ffffff;
    --silver: #e0e8d8;
    --lavender: #b8a8d8;
    --rose-dust: #e0b0b8;
  }
  .grove-scroll { border-width: 2px; }
  .msg-dm { border-left-width: 3px; }
  .msg-player { border-right-width: 3px; }
}

/* Floating botanical particles */
.spore {
  position: fixed; pointer-events: none; z-index: 0;
  border-radius: 50%;
  animation: drift linear infinite;
  opacity: 0;
}

@keyframes drift {
  0%   { opacity: 0; transform: translateY(100vh) translateX(0) scale(0.5); }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-10vh) translateX(40px) scale(1); }
}

@keyframes breathe {
  0%,100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

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

@keyframes pulse {
  0%,80%,100% { transform: scale(1); }
  40% { transform: scale(1.5); }
}
