/* =========================
   🌿 GLOBAL COLOR THEME (Wedding Palette)
========================= */
:root {
  --color-primary: #208E8E;    /* teal */
  --color-secondary: #641912; /* wine red */
  --color-header: #0B4056;    /* deep teal-blue */
  --color-bg: #f7f9f8;
  --color-text: #2F242C;
  --color-muted: #e5e5e5;
  --hint-bg-light: #fff3cd;
  --hint-text-light: #333;
}



/* =========================
   📐 Box-Sizing + Layout Reset
========================= */
html {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: inherit;
  max-width: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, Arial, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  padding-top: 60px;
}

/* =========================
   TYPOGRAPHY
========================= */
h1, h2, h3 {
  color: var(--color-text);
  font-weight: 600;
  text-align: center;
}

h1 {
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  margin: 1rem 0;
}

.quest-title {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 600;
  color: var(--color-primary);
}

.quest-description,
.puzzle-description {
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.5;
}

/* =========================
   MEDIA CONTENT
========================= */
.quest-description img,
.puzzle-description img {
  display: block;
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  margin: 0.5rem auto;
  border-radius: 6px;
  object-fit: contain;
}

.quest-description iframe,
.puzzle-description iframe {
  max-width: 100%;
  display: block;
  margin: 0.5rem auto;
}

.quest-description pre,
.puzzle-description pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 0.9rem;
  background: var(--color-muted);
  padding: 0.5rem;
  border-radius: 6px;
  overflow-x: auto;
}

/* =========================
   CARDS
========================= */
.quest-card,
.puzzle-card {
  background: white;
  color: var(--color-text);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  max-width: 700px;
  margin: 1rem auto;
  padding: 1rem 1.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow-wrap: break-word;
}

.quest-card:hover,
.puzzle-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}



/* =========================
   DESKTOP WARNING BANNER
========================= */
#desktopWarningBanner {
  display: none;
}

@media (min-width: 768px) {
  #desktopWarningBanner {
    display: block;
    background: var(--color-header);
    color: white;
    padding: 0.75em 1em;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 2px solid var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 3000;
  }

  #desktopWarningBanner .banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
  }

  #desktopWarningBanner .banner-close {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
  }

  #desktopWarningBanner .banner-close:hover {
    opacity: 0.8;
  }
}

/* =========================
   NAV BAR (Fixed)
========================= */
.shared-nav {
  background: var(--color-header);
  color: white;
  font-size: 0.95rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.shared-nav .nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75em 1em;
  width: 100%;
  max-width: 100%;
  margin: 0;
}


.shared-nav .nav-title {
  font-weight: bold;
}

.shared-nav .nav-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  display: none;
}

.shared-nav .nav-links {
  display: flex;
  gap: 1em;
}

.shared-nav .nav-links a {
  color: white;
  text-decoration: none;
  padding: 0.4em 0.6em;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.shared-nav .nav-links a:hover {
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
  .shared-nav .nav-toggle {
    display: block;
  }

  .shared-nav .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-header);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.5em 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }

  .shared-nav .nav-links.open {
    display: flex;
    max-height: 400px;
    opacity: 1;
  }

  .shared-nav .nav-links a {
    padding: 1em;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }

  .shared-nav .nav-links a:last-child {
    border-bottom: none;
  }
}

/* =========================
   BUTTONS
========================= */
.btn {
  display: block;
  width: 100%;
  max-width: 500px;
  margin: 0.75rem auto;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: #0b6666;
}

.btn-secondary {
  background: var(--color-secondary);
  color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #4e120d;
  color: white;
}
.preview-progress-btn {
  display: block;
  width: 100%;
  padding: 1em;
  background-color: #ffcc00;
  border: none;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
}

.preview-progress-btn:hover {
  background-color: #ffb700;
}
/* =========================
   BANNERS
========================= */
#previewBanner {
  position: sticky;
  top: 0;
  z-index: 2500;
  background: #ffeeba;
  color: var(--color-secondary);
  padding: 1em;
  text-align: center;
  font-size: 0.9rem;
  font-weight: bold;
  border-bottom: 2px solid #f0ad4e;
  cursor: pointer;
}


.preview-link-icon {
  display: inline-block;
  margin-right: 4px;
  font-size: 1.1em;
  text-decoration: none;
}

#adminMessageBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: #ffeeba;
  color: var(--color-secondary);
  padding: 0.75em 1em;
  border-bottom: 2px solid #f0ad4e;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;  /* 🧭 centers content horizontally */
  text-align: center;       /* ensures multiline text stays centered */
  gap: 0.75rem;
}

#adminMessageBanner span {
  flex: 1;                 /* takes up remaining space */
  text-align: center;      /* 👈 centers the text itself */
}

#adminMessageBanner .close-btn {
  background: none;
  border: none;
  color: var(--color-secondary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: 0;
  flex-shrink: 0;         /* keep close button size fixed */
}


.shared-nav {
  position: fixed;
  top: 0; /* JS will adjust dynamically */
  left: 0;
  right: 0;
  z-index: 1000;
}


/* =========================
   MODAL
========================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 3000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  text-align: center;
}



/* =========================
   HINT BOX
========================= */
.hint-box {
  background: var(--hint-bg-light);
  color: var(--hint-text-light);
  border: 1px solid #ffc107;
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 1rem;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .hint-box {
    background: var(--hint-bg-light);
    color: var(--hint-text-light);
  }
}

/* 🔸 Universal image containment inside cards and content blocks */
.card img,
.puzzle-card img,
.quest-card img,
.challenge-card img,
#descriptionContainer img,
#hintContainer img,
#solutionContainer img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  margin: 0.5rem auto;
  box-sizing: border-box;
}

/* 🔸 Force any parent container to not allow overflow */
.card,
.puzzle-card,
.quest-card,
.challenge-card,
#descriptionContainer,
#hintContainer,
#solutionContainer {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 🔸 Prevent <p> wrappers from pushing images out */
.card p img,
.puzzle-card p img,
.quest-card p img,
.challenge-card p img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.5rem auto;
  padding: 0;
}

.page-container {
  margin-top: 95px; /* push entire page below fixed nav */
  padding-top: 1rem; /* optional extra spacing */
  max-width: 600px;      /* control the content width */
  margin: 0 auto;        /* center horizontally */
  text-align: center;    /* center child text */
}

.page-container h1 {
  margin-top: 0;
}
/* =========================
   🌈 Softer Quest Status Styling
========================= */
.quest-card.not-started {
  border-left: 6px solid #ccc;        /* lighter gray */
  background: #fafafa;               /* near white */
}

.quest-card.in-progress {
  border-left: 6px solid #9ad9d9;     /* light teal */
  background: #f0fafa;               /* very pale teal background */
}

.quest-card.complete {
  border-left: 6px solid #a5d6a7;     /* soft green */
  background: #f4f9f4;               /* pale green background */
  opacity: 1;
}
.quest-card.keep-working {
  border-left: 6px solid #ffe58f;     /* soft yellow */
  background: #f4f9f4;               /* pale green background */
  opacity: 1;
}


/* =========================
   ✅ MOBILE LAYOUT FIX (Padding + Overflow)
========================= */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
  max-width: 100%;
}

/* Add space on sides globally */
body {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Ensure cards stay centered and constrained */
.quest-card,
.puzzle-card {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 700px;
  box-sizing: border-box;
}
.page-container {
  margin-top: 80px; /* push entire page below fixed nav */
  padding-top: 1rem; /* optional extra spacing */
}

/* =========================
   📱 MOBILE WIDTH FIXES
========================= */
@media (max-width: 480px) {
  body, html {
    overflow-x: hidden;
  }

  body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  [style*="width:"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  img, iframe, video, input, textarea, button, .btn, .card, .puzzle-card, .quest-card {
    max-width: 100% !important;
    box-sizing: border-box;
  }
}
/* 🧰 Fix for zoomed-in modal/prompt overlay on some mobile browsers */
.modal {
  contain: layout paint; /* Prevent focus-triggered repaint flicker */
}
.modal-overlay {
  will-change: opacity, transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}


.modal input[type="password"] {
  font-size: 16px; /* prevents iOS Safari zoom */
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}
/* =========================
   ADMIN MESSAGE BANNER
========================= */
.admin-message-banner {
  background: #fffae6;
  color: #333;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.admin-message-banner .close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  color: #333;
}

.admin-message-banner .close-btn:hover {
  color: #000;
}

