/* ═══════════════════════════════════════════════════════════
   INKWELL ATLAS — quiz question card
   Prefix: .qia-*
   Used by /bunkagame (live + review) and the home Pop Quiz.
   ═══════════════════════════════════════════════════════════ */

/* Top bar — date centered */
.qia-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}
.qia-counter {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint, #8D6E63);
  letter-spacing: .02em;
}
.qia-date-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-faint, #8D6E63);
  letter-spacing: .02em;
  text-align: center;
}
.qia-top--review {
  justify-content: space-between;
}

/* Brand strip */
.qia-brand {
  text-align: center;
  font: 500 10px/1 var(--mono, 'JetBrains Mono', monospace);
  letter-spacing: .3em;
  color: #5BAFB1;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Atlas paper card */
.qia-paper {
  background: #FBF3DF;
  color: #2A1F18;
  border: 1.5px solid rgba(17,100,102,.14);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Map panel — full-bleed to card top/left/right edges */
.qia-map {
  position: relative;
  height: 128px;
  margin: -24px -24px 16px;
  border-radius: 0;
  overflow: hidden;
  background: #F2E2BE;
  flex-shrink: 0;
}
.qia-mapbg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Arc SVG — drawn dynamically by JS, sits behind graphic items */
.qia-arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Horizontal graphic: place square — connection circle — place square */
.qia-graphic {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 25px 20px 16px;
}

/* Place columns: padding-top aligns square midpoint with circle midpoint */
.qia-g-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 26px;
  width: 64px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.qia-g-place-img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: #FBF3DF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qia-g-place-img:has(.qia-g-mystery) { box-shadow: 0 0 0 2px #D95D39; }
.qia-g-place-img .qia-g-mystery { color: #D95D39; }
.qia-g-place-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qia-g-place-name:empty { display: none; }
.qia-g-place-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 9px;
  color: #2A1F18;
  text-align: center;
  max-width: 64px;
  line-height: 1.2;
  background: rgba(251,243,223,.9);
  padding: 1px 5px;
  border-radius: 2px;
}
a.qia-g-place { text-decoration: none; color: inherit; }
a.qia-g-place .qia-g-place-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* Connection column: label + circle; gap+label height = 16px so circle center = 16+30 = 46... adjusted */
.qia-g-conn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 80px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.qia-g-conn-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 10px;
  color: #116466;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
a.qia-g-conn { text-decoration: none; color: inherit; }
a.qia-g-conn .qia-g-conn-label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.qia-g-conn-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: #FBF3DF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qia-g-conn-img:has(.qia-g-mystery) { box-shadow: 0 0 0 2.5px #116466; }
.qia-g-conn-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Text elements inside image containers */
.qia-pin-initials {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 14px;
  color: #8D6E63;
}
.qia-pin-mystery, .qia-g-mystery {
  font-family: 'Lora', Georgia, serif;
  font-weight: 700;
  font-style: normal;
  font-size: 28px;
  color: #116466;
}
.qia-chip-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 8px;
  color: #2A1F18;
  text-align: center;
  line-height: 1.3;
  padding: 3px;
  word-break: break-word;
  max-width: 54px;
}

/* Pips inside paper */
.qia-pips-row { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.qia-pips-row .progress-pips { display: flex; gap: 3px; flex: 1; }
.qia-paper .pip { background: rgba(17,100,102,.18); }
.qia-paper .pip.done-correct { background: var(--color-success); }
.qia-paper .pip.done-wrong   { background: var(--color-error); }
.qia-paper .pip.active       { background: #ffffff; box-shadow: inset 0 0 0 2px rgba(17,100,102,.18); }

/* Question line */
.qia-qline {
  font-family: 'Lora', Georgia, serif;
  font-style: normal;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.55;
  color: #2A1F18;
  margin: 20px 0 20px;
  text-align: left;
}
.qia-em { font-style: normal; color: #116466; font-weight: 600; }

/* Answer buttons */
.qia-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qia-answer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #FBF3DF;
  border: 1.5px solid rgba(17,100,102,.2);
  border-radius: 28px;
  color: #2A1F18;
  font: 600 13px/1.3 'Poppins', 'Inter', system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  width: 100%;
}
.qia-answer:hover:not(:disabled) {
  background: #F0E8CC;
  border-color: rgba(17,100,102,.45);
}
.qia-answer:disabled { cursor: default; }
.qia-answer.is-correct {
  background: #edfaed;
  border-color: var(--color-success);
  color: var(--color-success-text);
}
.qia-answer.is-wrong {
  background: #fff1f1;
  border-color: var(--color-error);
  color: var(--color-error-text);
}
.qia-answer.is-neutral { opacity: .55; }
.qia-letter {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #116466;
  color: #FBE9CB;
  display: grid;
  place-items: center;
  font: 700 11px/1 var(--mono, 'JetBrains Mono', monospace);
  flex-shrink: 0;
}
.qia-answer.is-correct .qia-letter { background: var(--color-success); color: #fff; }
.qia-answer.is-wrong   .qia-letter { background: var(--color-error); color: #fff; }

/* Reveal (inside paper) */
.qia-reveal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
  animation: qia-fadeUp .25s ease both;
}
.qia-reveal-result {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
}
.qia-reveal-result.correct { color: var(--color-success); }
.qia-reveal-result.wrong   { color: var(--color-error); }
.qia-reveal-was {
  font-size: 13px;
  color: #4A3B30;
  background: rgba(17,100,102,.07);
  border: 1px dashed rgba(17,100,102,.3);
  border-radius: 4px;
  padding: 8px 12px;
}
.qia-reveal-text {
  font-family: 'Lora', Georgia, serif;
  font-style: normal;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.55;
  color: #2A1F18;
  margin: 0;
}
.qia-reveal-explore {
  font-size: 12px;
  font-weight: 600;
  color: #116466;
  text-decoration: none;
}
.qia-reveal-explore:hover { text-decoration: underline; }
.qia-btn-next {
  display: block;
  width: 100%;
  padding: 13px;
  background: #D95D39;
  color: #fff;
  border: none;
  border-radius: 12px;
  font: 700 14px/1 'Poppins', 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background var(--duration-fast);
  text-align: center;
}
.qia-btn-next:hover { background: #BF360C; }

/* Reveal fade keyframes (renamed from fadeUp to avoid collision) */
@keyframes qia-fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
