/* Quire - Manu Arcade
   Chrome (masthead, hud, seal, overlay, colophon) comes from ../_shared/palette.css.
   Only game-specific surfaces live here: the leaf canvas sizing, the run-progress
   pips, and the four illuminated answer options. No em dashes in on-screen copy. */

/* ---- The page leaf -------------------------------------------------------- */
.quire-frame {
  width: min(560px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

#leaf {
  display: block;
  width: 100%;
  height: clamp(200px, 42vw, 260px);
  touch-action: manipulation;
  border-radius: 8px;
}

/* ---- Run-progress pips ---------------------------------------------------- */
.pips {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: clamp(10px, 2vw, 14px);
  padding-top: 2px;
}
.pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(122, 104, 80, .5);
  box-shadow: inset 0 1px 1px rgba(58, 46, 34, .12);
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.pip.now {
  border-color: var(--oxblood);
  background: rgba(90, 26, 31, .12);
  transform: scale(1.18);
}
.pip.hit {
  background: var(--gold);
  border-color: var(--gold-deep);
}
.pip.miss {
  background: var(--oxblood);
  border-color: var(--oxblood-deep);
}

/* ---- Answer options (DOM buttons) ---------------------------------------- */
.options {
  --tint: var(--pig-1);
  width: min(560px, 94vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 2vw, 12px);
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: var(--display);
  font-size: clamp(15px, 3.4vw, 19px);
  line-height: 1.18;
  color: var(--ink);
  padding: clamp(12px, 2.6vw, 16px) clamp(12px, 2.6vw, 16px);
  min-height: 58px;
  border-radius: 10px;
  border: 1px solid var(--ink-rule);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(0, 0, 0, .03)),
    var(--parchment-warm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), 0 3px 7px rgba(58, 46, 34, .2);
  transition: transform .12s var(--ease), filter .15s var(--ease),
    background .25s var(--ease), color .25s var(--ease),
    border-color .25s var(--ease), box-shadow .25s var(--ease), opacity .3s var(--ease);
}
.option:hover:not(:disabled) { filter: brightness(1.04); border-color: var(--tint); }
.option:active:not(:disabled) { transform: translateY(2px) scale(.985); }

/* The lettered mark (A/B/C/D) sits in a pigment medallion. */
.option-mark {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--caps);
  font-size: 14px;
  letter-spacing: 0;
  color: var(--parchment);
  background: var(--tint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 3px rgba(58, 46, 34, .3);
}
.option-label { flex: 1 1 auto; }

/* Once answered, every button is dimmed unless it is highlighted. */
.option.answered { cursor: default; }
.option.answered:not(.correct):not(.reveal):not(.wrong) { opacity: .5; }

/* Correct choice: solid gold fill with dark ink text (clearly visible). */
.option.correct,
.option.reveal {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: var(--gold-deep);
  color: var(--oxblood-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 12px rgba(156, 120, 38, .45);
  opacity: 1;
}
.option.correct .option-mark,
.option.reveal .option-mark {
  background: var(--oxblood);
  color: var(--gold-bright);
}

/* The reveal (after a wrong pick) gets a soft attention pulse. */
.option.reveal {
  animation: quire-reveal .5s var(--ease);
}

/* Wrong choice: oxblood wash, light text. */
.option.wrong {
  background: linear-gradient(180deg, var(--oxblood-bright), var(--oxblood));
  border-color: var(--oxblood-deep);
  color: var(--parchment);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 3px 9px rgba(61, 15, 18, .4);
  opacity: 1;
  animation: quire-shake .42s var(--ease);
}
.option.wrong .option-mark {
  background: var(--oxblood-deep);
  color: var(--parchment);
}

/* The chosen-correct button gives a satisfying pop. */
.option.pop { animation: quire-pop .42s var(--ease); }

@keyframes quire-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes quire-reveal {
  0% { transform: scale(1); filter: brightness(1.25); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes quire-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Single-column options on narrow phones for comfortable tap targets. */
@media (max-width: 440px) {
  .options { grid-template-columns: 1fr; }
  .option { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .option.pop, .option.reveal, .option.wrong { animation: none; }
}
