/*
 * guide.css — Obiettivi-specific geometry on top of the shared _shared/base.css.
 * Layout and staging ONLY; every colour comes from the --gc-* theme vars so the
 * page follows the player's theme in-app and on the site.
 *
 * Colour grammar used throughout (kept distinct on purpose):
 *   --gc-accent  (blue)   = the player's own things — selection, Objective count,
 *                           the rank a lane will accept next.
 *   --gc-warning (amber)  = the piles you may touch during the refill, and the
 *                           joker's borrowed rank.
 *   --gc-success (green)  = hint highlighting (a card you may play) and "done".
 *   --gc-error   (red)    = the illegal side of a contrast frame.
 * Gold/amber is NEVER used for the next-rank cue: on the real table amber means
 * "touchable pile" and gold means wild, so the next slot is blue.
 */

/* ── Chapter 1 · the Objective pile ─────────────────────────────────────── */

.ob-goalstage { gap: 14px; }

/* A real face-down pile with one face-up top card, fanned back-to-front. */
.ob-stack {
  position: relative;
  width: calc(var(--gc-card-w) + 26px);
  height: calc(var(--gc-card-w) * 1.4 + 26px);
  margin: 6px auto 0;
}
.ob-stack > * {
  position: absolute;
  left: 0;
  top: 0;
}
.ob-stack .ob-s3 { transform: translate(18px, 18px) rotate(3deg); opacity: 0.75; }
.ob-stack .ob-s2 { transform: translate(12px, 12px) rotate(2deg); opacity: 0.85; }
.ob-stack .ob-s1 { transform: translate(6px, 6px) rotate(1deg); }
.ob-stack .ob-s0 { transform: translate(0, 0); }

.ob-tag {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gc-text);
  opacity: 0.85;
  text-align: center;
}

/* ── Chapter 2 · the deck ───────────────────────────────────────────────── */

/* A card that is NOT in this deck: struck through and dimmed. */
.ob-struck { position: relative; display: inline-block; opacity: 0.55; }
.ob-struck::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  background: var(--gc-error);
  transform: rotate(-18deg);
}

/* The little caption under one side of a contrast frame. */
.ob-vs-cap {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.9;
}

/* Tighter fans, so a lane of six cards still fits a phone. */
.gc-cardrow.ob-tight { --overlap: calc(var(--gc-card-w) * -0.30); padding: 4px 2px; }

/* ── Chapter 3 · the shared lanes ───────────────────────────────────────── */

.ob-lanes { gap: 10px; }

.ob-lane {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
}

/* The suit pip that names a lane. */
.ob-pip {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  border-radius: 999px;
  color: var(--gc-text);
  background: color-mix(in srgb, var(--gc-text) 12%, transparent);
}
.ob-pip.red { color: var(--gc-error); }

/* The one rank a lane will accept next — an empty dashed slot, blue. */
.ob-next {
  flex: 0 0 auto;
  width: calc(var(--gc-card-w) * 0.5);
  aspect-ratio: 5 / 7;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--gc-accent);
  border: 2px dashed var(--gc-accent);
  border-radius: var(--gc-card-radius);
  background: color-mix(in srgb, var(--gc-accent) 10%, transparent);
}

/* ── Chapter 4 · refill ─────────────────────────────────────────────────── */

.ob-refill { gap: 8px; }

.ob-piles {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.ob-pilelabel {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.ob-cap {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.8;
  text-align: center;
}
/* The amber ring the real table draws around a pile you may touch right now. */
.ob-ring {
  outline: 2px solid var(--gc-warning);
  outline-offset: 2px;
  border-radius: var(--gc-card-radius);
}

.ob-arrow {
  font-size: 24px;
  line-height: 1;
  color: var(--gc-accent);
  text-align: center;
}

/* ── Chapter 5 · objectives & the joker choice ──────────────────────────── */

.ob-reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Two EQUALLY legal options (never yes/no — both are real moves). */
.ob-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ob-opt {
  padding: 10px;
  border-radius: var(--gc-radius-sm);
  border: 1px solid color-mix(in srgb, var(--gc-accent) 35%, var(--gc-border));
  background: color-mix(in srgb, var(--gc-accent) 8%, transparent);
  text-align: center;
}
.ob-opt-tag {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gc-accent);
}
@media (max-width: 380px) { .ob-choice { grid-template-columns: 1fr; } }

/* ── Chapter 6 · wilds ──────────────────────────────────────────────────── */

.ob-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.ob-swapmark {
  font-size: 24px;
  line-height: 1;
  color: var(--gc-accent);
}

/* ── Chapter 7 · the worked discard ─────────────────────────────────────── */

.ob-worked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.ob-frame {
  position: relative;
  padding: 10px 10px 8px;
  border-radius: var(--gc-radius-sm);
  border: 1px solid var(--gc-border);
  background: var(--gc-glass);
}
.ob-frame-n {
  position: absolute;
  top: -10px;
  left: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  color: var(--gc-bg);
  background: var(--gc-accent);
}
/* A card deliberately HELD BACK so the next one stays unplayable. */
.ob-hold {
  outline: 2px solid var(--gc-accent);
  outline-offset: 2px;
  border-radius: var(--gc-card-radius);
}
.ob-toss {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* ── Chapter 8 · the play interface ─────────────────────────────────────── */

.ob-screen { gap: 8px; align-items: stretch; }

.ob-banner {
  align-self: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--gc-warning);
  background: color-mix(in srgb, var(--gc-warning) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc-warning) 40%, transparent);
}

.ob-rivals {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ob-rival {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--gc-radius-sm);
  border: 1px solid var(--gc-border);
  background: var(--gc-glass);
}
.ob-rival .gc-cardimg { width: calc(var(--gc-card-w) * 0.46); }
.ob-rival-name { font-size: 15px; line-height: 1; }
.ob-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--gc-bg);
  background: var(--gc-accent);
  border-radius: 999px;
  padding: 1px 6px;
}

/* The single dashed "start a sequence" invitation. */
.ob-ghostlane .ob-ghost {
  flex: 1 1 auto;
  padding: 10px 8px;
  font-size: 12px;
  text-align: center;
  color: var(--gc-text);
  opacity: 0.75;
  border: 2px dashed var(--gc-border);
  border-radius: var(--gc-radius-sm);
}

/* Hint highlighting (green = you may play it) and selection (blue lift). */
.ob-hint {
  outline: 2px solid var(--gc-success);
  outline-offset: 2px;
  border-radius: var(--gc-card-radius);
}
.ob-sel {
  outline: 2px solid var(--gc-accent);
  outline-offset: 2px;
  border-radius: var(--gc-card-radius);
}

.ob-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ob-btn {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gc-text);
  border: 1px solid var(--gc-border);
  background: var(--gc-glass);
}
.ob-btn.primary {
  color: var(--gc-bg);
  background: var(--gc-warning);
  border-color: transparent;
}

/* ── Chapter 9 · winning ────────────────────────────────────────────────── */

.ob-finish { gap: 10px; align-items: stretch; }
.ob-finrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
/* An emptied slot on the real table: a ghost outline with a check. */
.ob-slot {
  width: calc(var(--gc-card-w) * 0.6);
  aspect-ratio: 5 / 7;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  border-radius: var(--gc-card-radius);
  border: 2px dashed var(--gc-border);
}
.ob-slot.done { color: var(--gc-success); border-color: var(--gc-success); }

/* A smaller total chip, for the left-hand side of the distance calculation. */
.gc-math .gc-math-total.sm { font-size: 15px; padding: 4px 9px; }
