/* =============================================================================
   BLACK SIGNAL — css/screens/completion.css
   Shared completion-screen styling for every course (Linux / C / Python labs,
   and the MCQ quiz & exam cycle). Rendered by bsCompletionScreen() in
   app/01-core.js, which wraps all of them in .linux-completion-screen so one
   stylesheet gives them a single uniform premium look.

   These .rcs-* base rules were dropped when the monolithic stylesheet was split
   into css/; this file restores them. They are deliberately UNSCOPED (single
   class) so the per-screen refinements in css/screens/labs.css
   (.linux-completion-screen .rcs-*) always win on specificity. Button styling is
   left to .bs-key / .bs-sweep — we do not re-add the old .rcs-btn-* layout.
   ========================================================================== */
@layer screens {

/* --ink is the scoped token the whole .rcs-* namespace reads from. labs.css
   owns the rest of .linux-completion-screen; we only supply the token. */
.linux-completion-screen {
  --ink: var(--white);
  --ink-rgb: 244, 243, 240;
}

/* The spinning kunda glyph in the background of every completion screen —
   the same signal mark that turns behind the title/auth screens
   (css/screens/title.css). The shared base .wlc-ghost::after already paints the
   masked, theme-colored glyph on a 30s ghostSpin; what the completion screen
   was missing is the title's full-bleed container, so the glyph was mis-placed
   and effectively invisible. Give .wlc-ghost the same box + title opacity, and
   keep the completion content painting above it. */
/* The screen is a flex column (restored from the pre-split design — the band's
   `flex: 0 0 auto` in labs.css assumes it): band on top, body grows to fill, and
   .rcs-main centers the ceremony vertically in that space. */
.linux-completion-screen { position: relative; display: flex; flex-direction: column; }
.linux-completion-screen .wlc-ghost {
  display: block;
  position: absolute;
  inset: 0;
  width: auto; height: auto;
  transform: none;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  container-type: size;
}
.linux-completion-screen .wlc-ghost::after { opacity: 0.12; }
.linux-completion-screen .rcs-body { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .linux-completion-screen .wlc-ghost::after { animation: none; }
}

/* The quiz/exam cycle completion renders into #quiz-area, which is a 3-column
   grid for the live-quiz rails. The completion screen replaces that layout, so
   it spans every track and owns the full width + height. */
.secplus-quiz-shell .bs-grid > .linux-completion-screen {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

/* Corner marks — off by default, as in the original design. */
.rcs-corner { display: none; }

/* Body + main: the ceremony is centered both axes. labs.css refines padding,
   gap and overflow on top of this. */
.rcs-body {
  flex: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  position: relative;
  z-index: 1;
  min-height: 0;
}
.rcs-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 60px;
  text-align: center;
  min-height: 0;
}

/* Kicker / headline / title ------------------------------------------------ */
.rcs-kicker {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--orange);
}
.rcs-headline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.rcs-bracket {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.rcs-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}
.rcs-category {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.75;
}

/* Exam / cycle pass-fail pill ---------------------------------------------- */
.rcs-exam-status {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--orange) 22%, transparent);
  display: inline-block;
}
.rcs-exam-status--pass {
  border-color: var(--orange);
  color: var(--accent-on-accent);
  background: var(--orange);
  box-shadow: 0 8px 26px -10px color-mix(in srgb, var(--orange) 55%, transparent);
}
.rcs-exam-status--review {
  border-color: color-mix(in srgb, var(--orange) 55%, transparent);
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 14%, transparent);
}

/* Stat row ----------------------------------------------------------------- */
.rcs-stat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--orange) 40%, transparent);
  margin-top: 2px;
  clip-path: polygon(8px 0%, 100% 0%, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0% 100%, 0% 8px);
}
.rcs-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 28px;
  flex: 1;
}
.rcs-stat-divider {
  width: 1px;
  height: 60px;
  background: color-mix(in srgb, var(--orange) 40%, transparent);
  flex-shrink: 0;
}
.rcs-stat-val {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rcs-stat-val--warn { color: var(--orange); }
.rcs-stat-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.75;
}

/* Action row --------------------------------------------------------------- */
.rcs-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

/* Ticker — hidden by default, kept for parity ------------------------------ */
.rcs-ticker-wrap { display: none; }
.rcs-ticker-inner {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  animation: rcsTicker 18s linear infinite;
}
.rcs-ticker-item {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.5;
}
@keyframes rcsTicker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Bottom status bar -------------------------------------------------------- */
.rcs-statusbar {
  position: relative;
  z-index: 2;
  height: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 0 18px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-dim);
  flex-shrink: 0;
}
.rcs-statusbar span:nth-child(2) { text-align: center; }
.rcs-statusbar span:last-child { text-align: right; }

/* =============================================================================
   LAB MASTERY bar — sits above the stat row on the Linux lab completion screen.
   ========================================================================== */
.rcs-mastery {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 auto;
}
.rcs-mastery--no-transition .rcs-mastery-seg { transition: none; }
.rcs-mastery-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.rcs-mastery-kicker {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.55;
}
.rcs-mastery-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: color var(--dur) var(--ease);
}
.rcs-mastery-track {
  display: flex;
  gap: 4px;
  height: 18px;
  width: 100%;
}
.rcs-mastery-seg {
  flex: 1;
  height: 100%;
  background: color-mix(in srgb, var(--white) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--white) 18%, transparent);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.rcs-mastery-seg--filled { background: var(--orange); border-color: var(--orange); }
.rcs-mastery-seg--gain {
  background: var(--orange);
  border-color: var(--ink);
  transform: scaleY(1.20);
  box-shadow: 0 0 8px color-mix(in srgb, var(--orange) 55%, transparent);
}
.rcs-mastery-seg--loss {
  background: color-mix(in srgb, var(--white) 14%, transparent);
  border-color: color-mix(in srgb, var(--white) 14%, transparent);
  transform: scaleY(0.82);
}
@keyframes rcs-mastery-pulse {
  0%   { opacity: 1; }
  42%  { opacity: 0.38; }
  100% { opacity: 1; }
}
.rcs-mastery-seg--pulse { animation: rcs-mastery-pulse var(--dur-slow) var(--ease) forwards; }
.rcs-mastery-seg--mastered { background: var(--orange); border-color: var(--ink); }
@keyframes rcs-mastery-glow {
  0%   { box-shadow: none; }
  45%  { box-shadow: 0 0 20px color-mix(in srgb, var(--black) 45%, transparent); }
  100% { box-shadow: none; }
}
@keyframes rcs-mastery-scale {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.022); }
  100% { transform: scale(1); }
}
.rcs-mastery--mastered-glow {
  animation: rcs-mastery-glow var(--dur-slow) var(--ease) forwards,
             rcs-mastery-scale var(--dur-slow) var(--ease) forwards;
}

/* =============================================================================
   CONCEPTS-TO-REVIEW section (Linux labs) + OPERATOR PROGRESS (quiz cycle).
   Same card frame so every completion screen reads as one family.
   ========================================================================== */
.rcs-concept-section {
  margin: 4px auto;
  max-width: 480px;
  width: 100%;
  border: 1px solid var(--orange-dark);
  padding: 12px 16px;
  background: var(--acc-surf-1);
  text-align: left;
}
.rcs-concept-header {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--orange-dark);
  margin-bottom: 12px;
}
.rcs-concept-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--acc-hair);
}
.rcs-concept-item:last-child { border-bottom: none; padding-bottom: 0; }
.rcs-concept-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}
.rcs-concept-habit {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--white-dim);
  line-height: 1.4;
}
.rcs-concept-empty {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--orange-dim);
  text-transform: uppercase;
}

/* Tier-2 operator debrief (live labs) — reuses .rcs-concept-section/-header.
   Coaching observations drawn from shell history, never scored. */
.rcs-tier2-item {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--white-dim);
  padding: 8px 0;
  border-bottom: 1px solid var(--acc-hair);
}
.rcs-tier2-item:last-child { border-bottom: none; padding-bottom: 0; }
.rcs-tier2-item code {
  font-family: var(--sig-mono);
  font-size: 0.86em;
  color: var(--orange);
}

/* Operator-progress block (quiz / exam cycle) reuses the concept card. */
.rcs-operator-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.rcs-operator-badge {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.rcs-operator-xp {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.rcs-operator-bar { width: 100%; height: 4px; }

@media (max-width: 600px) {
  .rcs-mastery { max-width: 100%; }
  .rcs-mastery-track { height: 14px; gap: 3px; }
  .rcs-mastery-label { font-size: 14px; }
  .rcs-title { font-size: clamp(26px, 8vw, 40px); }
  /* Five readouts become a ruled 3 + 2 table: hairlines between cells, the
     outer edges hidden under the frame (negative margin + overflow clip). */
  .rcs-stat-row { overflow: hidden; align-items: stretch; width: 100%; align-self: stretch; box-sizing: border-box; }
  .rcs-stat {
    flex: 1 1 33.333%;
    padding: 14px 10px;
    margin: -1px 0 0 -1px;
    border-left: 1px solid color-mix(in srgb, var(--orange) 28%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--orange) 28%, transparent);
  }
  .rcs-stat-val { font-size: 25px; }
  .rcs-stat-label { font-size: 11.5px; letter-spacing: 0.18em; }
  .rcs-stat-divider { display: none; }
}

}
