/*
 * guide.css — Scala 40-specific table & play-screen geometry on top of
 * _shared/base.css. Only layout/shape lives here; every colour comes from the
 * --gc-* theme variables. All card faces/backs are REAL images resolved via
 * the data-card contract (gc-cardimg) — no tile stand-ins for cards.
 */

/* A horizontal scene: cards, melds and arrows side by side. */
.s40-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(10px, 4vw, 22px);
  width: 100%;
}
.s40-scene.s40-tight { gap: 8px; }

/* A meld: distinct cards side by side (a slight gap, no fan overlap). */
.s40-minimeld {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 10px;
}
.s40-meldrow {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.s40-meldrow + .s40-meldrow { margin-top: 8px; }
.s40-meldstack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Highlight states mirrored from the real play view. */
.s40-slot { outline: 2px dashed var(--gc-accent); outline-offset: 2px; }
.s40-ring-gold { outline: 3px solid var(--gc-warning); outline-offset: 2px; }
.s40-ring-blue { outline: 3px solid var(--gc-accent); outline-offset: 2px; }
.s40-ring-dash {
  outline: 2px dashed var(--gc-accent);
  outline-offset: 3px;
  border-radius: 10px;
}
.s40-freed { outline: 3px solid var(--gc-warning); outline-offset: 2px; }
.s40-dimmed { opacity: 0.55; }
.s40-dim { opacity: 0.45; }

/* Flow arrows. */
.s40-arrow {
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 800;
  color: var(--gc-accent);
  flex: 0 0 auto;
}
.s40-lock { font-size: clamp(22px, 6vw, 30px); }
.s40-vs-label { margin: 6px 0 0; font-size: 13px; text-align: center; }

/* The table frame (goal + interface chapters). */
.s40-table,
.s40-screen { gap: 12px; }
.s40-opporow,
.s40-midrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 4vw, 24px);
  flex-wrap: wrap;
}
.s40-avatar {
  font-size: 24px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gc-text) 12%, transparent);
  border: 2px solid var(--gc-border);
}
.s40-oppo-hand { display: inline-flex; }
.s40-oppo-hand .gc-cardimg { width: calc(var(--gc-card-w) * 0.5); }
.s40-oppo-hand .gc-cardimg + .gc-cardimg { margin-left: calc(var(--gc-card-w) * -0.3); }
.gc-cardwrap .s40-deck-top { position: absolute; left: 3px; top: -3px; }

/* The EMPTY discard space (owner rule: no starter card). */
.s40-ghostcard {
  display: inline-block;
  width: calc(var(--gc-card-w) * 0.72);
  aspect-ratio: 5 / 7;
  border-radius: 8px;
  background: color-mix(in srgb, var(--gc-text) 8%, transparent);
  border: 2px dashed color-mix(in srgb, var(--gc-text) 30%, transparent);
}

/* Thirteen dealt cards: a tight rank-sorted fan. */
.s40-fan13 { --overlap: calc(var(--gc-card-w) * -0.5); }

/* Opponent "Opened" seal + penalty total (mirrors the real strip). */
.s40-seal {
  font-size: 12px;
  font-weight: 700;
  color: var(--gc-success);
  border: 1px solid var(--gc-success);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.s40-penalty {
  font-size: 14px;
  font-weight: 800;
  color: var(--gc-warning);
}

/* The coaching banner. */
.s40-banner {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gc-accent);
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gc-text) 8%, transparent);
  max-width: 100%;
}

/* Staged/action bar with schematic buttons (labels are i18n). */
.s40-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.s40-bar-text {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.s40-btn {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--gc-bg);
  background: var(--gc-accent);
  white-space: nowrap;
}
.s40-btn.secondary {
  color: var(--gc-text);
  background: color-mix(in srgb, var(--gc-text) 12%, transparent);
  border: 1px solid var(--gc-border);
}

/* Opening math: the sub-forty total reads as "not yet". */
.s40-total-short {
  background: color-mix(in srgb, var(--gc-text) 14%, transparent);
  color: var(--gc-text);
}
.s40-carry {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 18px;
  background: color-mix(in srgb, var(--gc-text) 14%, transparent);
}

/* Round-by-round score line (match chapter; the long game just runs longer). */
.s40-line {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.s40-line-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.s40-line-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  min-width: 64px;
}
.s40-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gc-text) 45%, var(--gc-bg));
}
.s40-dot.mine { background: var(--gc-accent); }
.s40-chip {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  padding: 5px 8px;
  border-radius: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--gc-text) 10%, transparent);
  border: 1px solid var(--gc-border);
}
.s40-chip-out {
  background: color-mix(in srgb, var(--gc-error) 22%, transparent);
  border-color: var(--gc-error);
}
.s40-flag {
  font-size: 13px;
  font-weight: 800;
  color: var(--gc-warning);
  white-space: nowrap;
}
.s40-trophy { font-size: 18px; }

/* Discard pile in the go-out frame: the new top card overlaps the old one. */
.s40-minipile { position: relative; display: inline-block; }
.s40-minipile .s40-pile-top {
  position: absolute;
  left: 8px;
  top: -6px;
  transform: rotate(6deg);
}
