/* =========================================
   Which Came First? — clean, centered layout
   (scoped; safe for header/footer)
   ========================================= */

/* Scope + consistent sizing */
.wcf-page, .wcf-page * { box-sizing: border-box; }

/* Typography: lock to site stack (or --cb-font if defined in /assets/site.css) */
.wcf-page {
  font-family: var(--cb-font, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji") !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Page layout */
  max-width: 760px;
  margin: 0 auto;              /* center in page flow */
  padding: 24px clamp(12px, 4vw, 24px);
  width: 100%;
  text-align: center;
}

/* Container (optional if you use one) */
.wcf-page .container { width: 100%; margin: 0 auto; }

/* Logo */
.wcf-page .logo {
  max-width: 400px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 2rem;
}

/* Screens */
.wcf-page .screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.wcf-page .screen.active { display: flex; }

/* Headings & text inherit site font */
.wcf-page h1,
.wcf-page h2,
.wcf-page h3,
.wcf-page p,
.wcf-page .question,
.wcf-page .progress {
  font: inherit !important;
}

/* Headings */
.wcf-page h1 {
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin: 0 0 .5rem;
}

/* Buttons */
.wcf-page .btn {
  background-color: #007bff;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background 0.3s ease;
}
.wcf-page .btn:hover { background-color: #0056b3; }
.wcf-page .btn:disabled { background-color: #555; cursor: not-allowed; }

.wcf-page .btn-secondary { background-color: #007bff; }
.wcf-page .btn-secondary:hover { background-color: #0056b3; }

.wcf-page #shareBtn { background-color: #28a745; }
.wcf-page #shareBtn:hover { background-color: #218838; }

/* Quiz text */
.wcf-page .progress {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #ccc;
}
.wcf-page .question {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Options grid — never overflow horizontally */
.wcf-page .options {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
}
.wcf-page .option {
  background-color: #222;
  border: 2px solid #444;
  border-radius: 10px;
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.wcf-page .option:hover  { background-color: #333; border-color: #007bff; }
.wcf-page .option.correct{ background-color: #28a745; border-color: #28a745; }
.wcf-page .option.wrong  { background-color: #dc3545; border-color: #dc3545; }

.wcf-page .year {
  font-size: 0.85rem;
  color: #aaa;
  min-height: 1.2em;
  margin: 0.25rem 0 0.75rem;
  text-align: center;
}

.wcf-page #feedback {
  margin-top: 1rem;
  font-size: 1rem;
  height: 1.5rem;
  color: #ffc107;
}

/* Results */
.wcf-page #results h1 { font-size: 2rem; margin-bottom: 1rem; }
.wcf-page .stat { font-size: 1.2rem; margin: 0.5rem 0; }

/* Post-game links (partial) */
.wcf-page #postGameLinks { margin: 24px auto 0; max-width: 960px; }
.wcf-page .game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.wcf-page .game-link {
  display: block;
  text-align: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: #1e1e1e;
  color: #fff;
  text-decoration: none;
}
.wcf-page .game-link:hover { background: #262626; }

/* Media never overflow */
.wcf-page img, .wcf-page video, .wcf-page canvas { max-width: 100%; height: auto; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .wcf-page { padding: 16px 12px; }
  .wcf-page .options {
    grid-template-columns: 1fr;   /* stack */
    max-width: 360px;             /* tidy column */
    margin-inline: auto;          /* center the stack */
    justify-items: stretch;
  }
  .wcf-page .option {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
  .wcf-page .game-grid { grid-template-columns: 1fr; }
}
