/* The Lonely Card: numbered slots, packet lifts, the reference row. */

/* `hidden` must win over the display rules of .btn, .lc-peek and .verdict */
.stage [hidden] { display: none !important; }
/* Local override: the shared curtain rule paints the primary button's background
   in the page colour, which hides its (page-coloured) label. */
.curtain .btn.btn-primary { background: var(--text); color: var(--page); }
.curtain .btn.btn-primary:disabled { background: var(--page); color: var(--text); }

/* Numbered places: the position stays with the slot, the card moves. */
.lc-slots { display: flex; flex-wrap: wrap; gap: 26px 8px; padding-top: 18px; margin-top: 14px; }
.lc-slot { display: grid; justify-items: center; gap: 6px; width: var(--card-w); }
.lc-spot { width: var(--card-w); height: calc(var(--card-w) * var(--card-ratio)); position: relative; }
.lc-pos { font-size: 0.78rem; font-weight: 700; color: var(--secondary-on-stage); font-variant-numeric: tabular-nums; line-height: 1; }
.lc-pos.is-even { color: var(--paper); }
.lc-pos.is-flipping { color: var(--active); }

#try-stage { --card-w: clamp(44px, 5.4vw, 66px); }
#challenge-stage { --card-w: clamp(52px, 7vw, 72px); }

/* A packet picked up from the table (cut packet, the pair being turned) */
.card.is-lifted .card-tilt { transform: translateY(calc(var(--w) * -0.16)); }

.lc-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.lc-controls { margin-top: 22px; }
.lc-side { display: grid; gap: 16px; margin-top: 22px; }
@media (min-width: 900px) { .lc-side { grid-template-columns: 1fr 1fr; align-items: start; } }

/* The private peek */
.lc-peek { display: flex; gap: 14px; align-items: center; border-left: 3px solid var(--active); padding: 6px 0 6px 14px; }
.lc-peek .card { --card-w: 46px; }

/* Why it works: real card on top, reference beneath */
#why-stage { --card-w-base: clamp(44px, 6.4vw, 70px); --card-w: var(--card-w-base); }
#why-stage.is-many { --card-w-base: clamp(44px, 4.6vw, 58px); }
.why-slots { padding-top: 20px; }
.why-slot { display: grid; justify-items: center; gap: 5px; width: var(--card-w); }
.why-slot .lc-spot.ref { --card-w: calc(var(--card-w-base) * 0.8); }
.why-mark { font-family: var(--font-math); font-size: 1.05rem; line-height: 1; height: 1.1em; color: var(--structure); }
.why-mark.is-diff { color: var(--active); font-weight: 700; }
.card.is-ref { opacity: 0.72; }
.why-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.88rem; color: var(--secondary-on-stage); margin-bottom: 4px; }
.bits { font-family: var(--font-math); font-size: 1.15rem; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.bits .is-diff { color: var(--active); text-decoration: underline; text-underline-offset: 4px; }
.readouts { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-start; margin-top: 20px; }
.readout-value.is-small { font-size: 1.2rem; }

/* Challenge */
.ch-rows { display: grid; gap: 18px; }
@media (min-width: 760px) { .ch-rows { grid-template-columns: auto auto; justify-content: start; gap: 18px 56px; } }
.ch-calc { font-size: 0.98rem; color: var(--secondary-on-stage); min-height: 1.5em; }
.ch-calc strong { color: var(--paper); }
.match-tick { font-size: 0.78rem; font-weight: 700; color: var(--structure); height: 1em; line-height: 1; }
.match-tick.is-match { color: var(--invariant); }
.ch-target-pick .card { cursor: pointer; }

@media (max-width: 560px) {
  .lc-slots { gap: 24px 6px; }
}
.stage .pile-label { text-align: left; }
