/* ==========================================================================
   NOVEMBER STARS -- STYLESHEET
   Solid colors only. No gradients. No glassmorphism. No symbols.
   ========================================================================== */

:root {
  /* Solid Color Palette */
  --bg-night: #182033;
  --blue-deep: #222C45;
  --navy-muted: #34415E;
  --cream-warm: #F5EEDC;
  --gold-muted: #D6B56D;
  --blue-soft: #8293B3;
  --grey-muted: #9AA2B0;
  --text-dark: #252A36;
  --text-light: #EEE9DF;
  --brown-muted: #8D7864;

  /* Typography */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Motion */
  --transition-calm: 0.35s ease;
  --transition-fast: 0.18s ease;
}

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

html {
  font-size: 16px;
  background-color: var(--bg-night);
  color: var(--text-light);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-night);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 24px 16px;
}

/* Accessibility: Screen reader utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Background Night Sky Dots (CSS shapes only: no symbols, no gradients)
   -------------------------------------------------------------------------- */
.sky-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.background-light {
  position: absolute;
  border-radius: 50%;
  background-color: var(--blue-soft);
  opacity: 0.35;
  animation: floatDrift 16s ease-in-out infinite alternate;
}

/* Discrete static placement of subtle sky dots */
.dot-1  { top: 8%;  left: 12%; width: 3px; height: 3px; opacity: 0.4; animation-duration: 14s; }
.dot-2  { top: 16%; left: 84%; width: 4px; height: 4px; opacity: 0.3; background-color: var(--cream-warm); animation-duration: 19s; }
.dot-3  { top: 28%; left: 22%; width: 2px; height: 2px; opacity: 0.45; animation-duration: 12s; }
.dot-4  { top: 22%; left: 68%; width: 3px; height: 3px; opacity: 0.35; animation-duration: 18s; }
.dot-5  { top: 42%; left: 8%;  width: 4px; height: 4px; opacity: 0.25; background-color: var(--gold-muted); animation-duration: 22s; }
.dot-6  { top: 48%; left: 91%; width: 3px; height: 3px; opacity: 0.4; animation-duration: 15s; }
.dot-7  { top: 62%; left: 16%; width: 3px; height: 3px; opacity: 0.3; animation-duration: 17s; }
.dot-8  { top: 67%; left: 79%; width: 4px; height: 4px; opacity: 0.35; background-color: var(--cream-warm); animation-duration: 20s; }
.dot-9  { top: 78%; left: 32%; width: 2px; height: 2px; opacity: 0.5; animation-duration: 13s; }
.dot-10 { top: 85%; left: 88%; width: 3px; height: 3px; opacity: 0.3; animation-duration: 16s; }
.dot-11 { top: 92%; left: 24%; width: 4px; height: 4px; opacity: 0.25; animation-duration: 24s; }
.dot-12 { top: 12%; left: 45%; width: 2px; height: 2px; opacity: 0.35; animation-duration: 18s; }
.dot-13 { top: 35%; left: 52%; width: 3px; height: 3px; opacity: 0.2; animation-duration: 21s; }
.dot-14 { top: 74%; left: 62%; width: 3px; height: 3px; opacity: 0.35; background-color: var(--gold-muted); animation-duration: 15s; }
.dot-15 { top: 5%;  left: 72%; width: 4px; height: 4px; opacity: 0.3; animation-duration: 19s; }
.dot-16 { top: 56%; left: 40%; width: 2px; height: 2px; opacity: 0.4; animation-duration: 13s; }

/* Gentle motion keyframe: very small translation */
@keyframes floatDrift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(6px, -8px);
  }
}

/* When letter screen is open, background dots become fully static */
body.static-stars .background-light {
  animation: none !important;
}

/* --------------------------------------------------------------------------
   Layout & Container Structure
   -------------------------------------------------------------------------- */
.site-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Screen Management */
.screen {
  display: none;
  width: 100%;
  opacity: 0;
  transition: opacity var(--transition-calm);
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Night Card (Primary Container for Screens 1, 2, 3, 4, 6)
   -------------------------------------------------------------------------- */
.night-card {
  width: 100%;
  background-color: var(--blue-deep);
  border: 1px solid var(--navy-muted);
  border-radius: 4px;
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
}

/* Game Card Specific Spacing */
.game-card {
  padding: 28px 24px;
  gap: 20px;
}

/* --------------------------------------------------------------------------
   Header Metadata Row
   -------------------------------------------------------------------------- */
.header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--navy-muted);
  padding-bottom: 16px;
  width: 100%;
}

.meta-label,
.meta-handle,
.meta-step {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-soft);
  font-weight: 600;
}

.meta-handle {
  color: var(--grey-muted);
}

.meta-step {
  color: var(--gold-muted);
}

/* --------------------------------------------------------------------------
   Hero & Title Typography
   -------------------------------------------------------------------------- */
.hero-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.title-primary {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  line-height: 1.15;
  font-weight: 500;
  color: var(--cream-warm);
  letter-spacing: -0.01em;
}

.subtitle-primary {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--blue-soft);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.title-secondary {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--cream-warm);
}

/* --------------------------------------------------------------------------
   Body & Narrative Typography
   -------------------------------------------------------------------------- */
.body-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.narrative-line {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-light);
  font-weight: 400;
}

.narrative-space {
  height: 12px;
}

/* --------------------------------------------------------------------------
   Status Panels & Information Grids
   -------------------------------------------------------------------------- */
.status-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background-color: var(--bg-night);
  border: 1px solid var(--navy-muted);
  border-radius: 3px;
  padding: 16px 20px;
}

.status-panel.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.status-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-soft);
  font-weight: 600;
}

.status-value {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cream-warm);
  letter-spacing: 0.06em;
}

.indicator-letter {
  color: var(--gold-muted);
}

.indicator-ready {
  color: var(--cream-warm);
}

/* --------------------------------------------------------------------------
   Buttons & Interactive Elements
   -------------------------------------------------------------------------- */
.action-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.action-block.dual-action {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.action-block.stack-action {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 16px 28px;
  border-radius: 3px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 48px;
}

.btn:focus-visible {
  outline: 2px solid var(--gold-muted);
  outline-offset: 3px;
}

/* Primary Button: Cream background, Dark text */
.btn-primary {
  background-color: var(--cream-warm);
  color: var(--text-dark);
  border: 1px solid var(--cream-warm);
}

.btn-primary:hover {
  background-color: var(--gold-muted);
  border-color: var(--gold-muted);
  color: var(--text-dark);
}

.btn-primary:active {
  background-color: var(--brown-muted);
  border-color: var(--brown-muted);
  color: var(--cream-warm);
}

/* Secondary Button: Muted Navy background, Light text */
.btn-secondary {
  background-color: var(--navy-muted);
  color: var(--text-light);
  border: 1px solid var(--navy-muted);
}

.btn-secondary:hover {
  background-color: var(--blue-soft);
  color: var(--text-dark);
  border-color: var(--blue-soft);
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  color: var(--blue-soft);
  border: 1px solid var(--navy-muted);
}

.btn-outline:hover {
  border-color: var(--blue-soft);
  color: var(--text-light);
}

/* Text Button */
.btn-text {
  background-color: transparent;
  color: var(--blue-soft);
  border: none;
  padding: 14px 20px;
}

.btn-text:hover {
  color: var(--cream-warm);
}

/* --------------------------------------------------------------------------
   Footer Metadata
   -------------------------------------------------------------------------- */
.footer-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border-top: 1px solid var(--navy-muted);
  padding-top: 16px;
  width: 100%;
}

.footer-meta.dual-footer {
  justify-content: space-between;
}

.footer-note {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--grey-muted);
  text-transform: lowercase;
}

/* --------------------------------------------------------------------------
   SCREEN 3: CATCH THE LIGHTS GAME SPECIFIC
   -------------------------------------------------------------------------- */
.game-top-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--navy-muted);
  padding-bottom: 12px;
}

.game-heading-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--cream-warm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hint-strip {
  text-align: center;
  padding: 6px 12px;
  min-height: 28px;
}

.hint-text {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--blue-soft);
  transition: color var(--transition-calm);
}

.hint-text.highlight {
  color: var(--gold-muted);
  font-weight: 600;
}

/* Game Arena Playing Field */
.game-arena-wrapper {
  width: 100%;
  position: relative;
}

.game-arena {
  width: 100%;
  height: 380px;
  background-color: var(--bg-night);
  border: 1px solid var(--navy-muted);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Collectible Target Light Button (HTML Button styled with solid CSS shapes) */
.game-light-target {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  touch-action: manipulation;
}

.game-light-target:focus-visible {
  outline: 2px solid var(--gold-muted);
  outline-offset: 4px;
}

/* Outer ring: subtle solid soft boundary */
.target-ring-outer {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--blue-soft);
  opacity: 0.35;
  pointer-events: none;
}

/* Middle body circle: solid muted gold fill with thin cream border */
.target-core {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--gold-muted);
  border: 1.5px solid var(--cream-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Inner center dot: tiny solid cream dot */
.target-dot-center {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--cream-warm);
  pointer-events: none;
}

/* Catch Feedback Animations */
.game-light-target.is-spawning {
  animation: targetAppear 0.25s ease-out forwards;
}

.game-light-target.is-caught {
  transform: scale(0.3);
  opacity: 0;
  transition: transform 0.2s ease-in, opacity 0.2s ease-in;
}

.game-light-target.is-timeout {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

@keyframes targetAppear {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Game Bottom Controls */
.game-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.dual-action-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   SCREEN 5: BIRTHDAY LETTER (Warmer Reading Experience)
   Warm cream panel, dark text, deep blue surrounding background. No gradients.
   -------------------------------------------------------------------------- */
.letter-layout {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px 0 36px 0;
}

.letter-sheet {
  width: 100%;
  max-width: 640px;
  background-color: var(--cream-warm);
  color: var(--text-dark);
  border: 1px solid var(--gold-muted);
  border-radius: 4px;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.letter-sheet-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--gold-muted);
  padding-bottom: 24px;
}

.sheet-date {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown-muted);
  font-weight: 600;
}

.sheet-heading {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  line-height: 1.15;
  color: var(--text-dark);
  font-weight: 500;
}

.sheet-recipient {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--brown-muted);
}

.sheet-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sheet-content p {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-dark);
  font-weight: 400;
}

.sheet-signoff {
  font-family: var(--font-serif) !important;
  font-size: 1.15rem !important;
  font-weight: 500 !important;
  color: var(--text-dark) !important;
  padding-top: 10px;
}

.letter-sheet-footer {
  border-top: 1px solid var(--gold-muted);
  padding-top: 24px;
  width: 100%;
}

/* Letter Screen Buttons */
.btn-letter-continue {
  background-color: var(--text-dark);
  color: var(--cream-warm);
  border: 1px solid var(--text-dark);
}

.btn-letter-continue:hover {
  background-color: var(--blue-deep);
  border-color: var(--blue-deep);
  color: var(--cream-warm);
}

.btn-letter-continue:active {
  background-color: var(--navy-muted);
}

.btn-letter-back {
  background-color: transparent;
  color: var(--brown-muted);
  border: 1px solid var(--gold-muted);
}

.btn-letter-back:hover {
  background-color: var(--gold-muted);
  color: var(--text-dark);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   320px, 360px, 375px, 390px, 430px, 768px, 1024px, 1440px
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  body {
    padding: 16px 12px;
  }

  .night-card {
    padding: 32px 20px;
    gap: 22px;
  }

  .game-card {
    padding: 22px 14px;
    gap: 16px;
  }

  .title-primary {
    font-size: 2.1rem;
  }

  .title-secondary {
    font-size: 1.8rem;
  }

  .status-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 16px;
  }

  .status-panel.three-col {
    grid-template-columns: 1fr 1fr;
  }

  .status-panel.three-col .status-cell:last-child {
    grid-column: span 2;
  }

  .game-arena {
    height: 330px;
  }

  .letter-sheet {
    padding: 36px 22px;
    gap: 26px;
  }

  .sheet-heading {
    font-size: 2.1rem;
  }

  .sheet-content p {
    font-size: 1.05rem;
    line-height: 1.75;
  }

  .action-block.dual-action {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    width: 100%;
  }

  .dual-action-bar {
    flex-direction: row;
    gap: 10px;
  }

  .dual-action-bar .btn {
    flex: 1;
    padding: 14px 12px;
    font-size: 0.78rem;
  }
}

/* Small mobile devices (320px - 360px) */
@media (max-width: 360px) {
  body {
    padding: 12px 8px;
  }

  .night-card {
    padding: 26px 14px;
  }

  .title-primary {
    font-size: 1.85rem;
  }

  .game-arena {
    height: 290px;
  }

  .letter-sheet {
    padding: 28px 16px;
  }

  .sheet-content p {
    font-size: 0.98rem;
    line-height: 1.7;
  }
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
  .background-light {
    animation: none !important;
  }

  .screen {
    transition: none !important;
  }

  .game-light-target.is-spawning {
    animation: none !important;
  }

  .game-light-target.is-caught {
    transform: none !important;
    opacity: 0 !important;
    transition: none !important;
  }

  .game-light-target.is-timeout {
    opacity: 0 !important;
    transition: none !important;
  }
}
