/*
 * FM Quiz — brand styles for Forgotten Midwest.
 * Sepia brown #6B4A2B, rust accent #9A3B26, dark walnut #3E2E1E,
 * cream #FAF5EC (matches the site), muted slate #4A5568.
 * Headings: "Playfair Display" (Georgia fallback). Body: "Lora" (Georgia fallback).
 * Mobile-first: most players arrive from Facebook on a phone.
 * Sizing is container-relative only — no viewport units for game elements.
 */

.fmq-game,
.fm-lb-wrap {
  background: #FAF5EC;
  color: #3E2E1E;
  font-family: Lora, Georgia, "Times New Roman", serif;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 24px;
  padding: 20px 16px 24px;
  border: 2px solid #6B4A2B;
  border-radius: 14px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-wrap: break-word;
}

.fmq-game *,
.fm-lb-wrap * { box-sizing: border-box; }

.fmq-game [hidden] { display: none !important; }

.fmq-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  color: #3E2E1E;
  font-size: 1.8rem;
  margin: 0 0 4px;
  text-align: center;
}

.fmq-sub {
  text-align: center;
  margin: 0 0 14px;
  color: #4A5568;
  font-size: 0.95rem;
  font-style: italic;
}

.fmq-lb-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  color: #3E2E1E;
  font-size: 1.25rem;
  margin: 22px 0 8px;
  text-align: center;
}

.fmq-btn {
  display: inline-block;
  background: #6B4A2B;
  color: #FAF5EC;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.fmq-btn:hover,
.fmq-btn:focus { background: #9A3B26; }

.fmq-btn-big { width: 100%; padding: 14px 18px; font-size: 1.1rem; min-height: 52px; }

.fmq-btn-small { padding: 6px 12px; font-size: 0.85rem; }

/* ---------- nickname bar ---------- */

.fm-nickname-bar {
  background: #FFFBF2;
  border: 1px dashed #6B4A2B;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  max-width: 100%;
  overflow-wrap: break-word;
}

.fmq-nickname-set { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.fmq-nickname-set strong { min-width: 0; overflow-wrap: anywhere; }
.fmq-nickname-set .fmq-btn { flex: 0 1 auto; }

.fmq-nickname-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.fmq-nickname-form label { width: 100%; font-weight: 700; color: #6B4A2B; }
.fmq-nickname-form input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #C9B895;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.fmq-nickname-msg { width: 100%; color: #9A3B26; font-size: 0.85rem; }

/* ---------- quiz flow ---------- */

.fmq-howto { line-height: 1.55; margin: 0 0 16px; }

.fmq-progress {
  text-align: center;
  font-weight: 700;
  color: #6B4A2B;
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}

.fmq-photo-wrap {
  margin: 0 0 6px;
  background: #FFFFFF;
  border: 1px solid #D8CBB2;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 2px 10px rgba(62, 46, 30, 0.18);
}

.fmq-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

.fmq-credit {
  text-align: center;
  font-size: 0.8rem;
  font-style: italic;
  color: #718096;
  padding-top: 6px;
}

.fmq-place { text-align: center; margin: 10px 0 2px; }
.fmq-place-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #718096;
  margin-bottom: 2px;
}
.fmq-place-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.3rem;
  color: #3E2E1E;
}

.fmq-year-value {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.1;
  text-align: center;
  color: #9A3B26;
  margin: 4px 0 2px;
}

.fmq-slider-row { display: flex; align-items: center; gap: 10px; }

.fmq-step {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #6B4A2B;
  background: #FFFBF2;
  color: #6B4A2B;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.fmq-step:hover, .fmq-step:focus { background: #6B4A2B; color: #FAF5EC; }

.fmq-slider {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  accent-color: #9A3B26;
  cursor: pointer;
}

.fmq-range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #718096;
  margin: 0 62px 12px;
}

/* ---------- reveal ---------- */

.fmq-reveal-headline {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 1.45rem;
  text-align: center;
  color: #3E2E1E;
  margin: 4px 0 2px;
}

.fmq-points { text-align: center; font-weight: 700; color: #9A3B26; margin: 0 0 14px; }

.fmq-track {
  position: relative;
  height: 10px;
  background: #E9DFC9;
  border-radius: 5px;
  margin: 26px 10px 34px;
}

.fmq-marker {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.fmq-marker-guess { background: #718096; border: 2px solid #FAF5EC; z-index: 1; }
.fmq-marker-actual { background: #9A3B26; border: 2px solid #FAF5EC; z-index: 2; }

.fmq-marker-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.fmq-label-guess { top: 14px; color: #4A5568; }
.fmq-label-actual { bottom: 14px; color: #9A3B26; }

.fmq-reveal-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 4px;
  color: #3E2E1E;
}

.fmq-blurb { line-height: 1.55; margin: 0 0 10px; }

.fmq-article-link { color: #9A3B26; font-weight: 700; }

/* ---------- end panel ---------- */

.fmq-final {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  margin: 6px 0 2px;
  color: #3E2E1E;
}

.fmq-verdict { text-align: center; font-size: 1.05rem; margin: 0 0 6px; }
.fmq-end-line { text-align: center; color: #4A5568; font-size: 0.92rem; margin: 0 0 14px; }

/* ---------- leaderboard ---------- */

.fmq-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: #FFFBF2;
  border-radius: 10px;
  overflow: hidden;
}

.fmq-lb-table th {
  background: #6B4A2B;
  color: #FAF5EC;
  font-family: "Playfair Display", Georgia, serif;
  text-align: left;
  padding: 8px 10px;
}

.fmq-lb-table td { padding: 7px 10px; border-top: 1px solid #E7DCC4; }
.fmq-lb-table tbody tr:nth-child(even) { background: #F3EAD8; }
.fmq-lb-loading, .fmq-lb-empty { text-align: center; color: #4A5568; margin: 8px 0; }
