/* === SCENARIO WALKTHROUGHS — scenario-specific UI (nav + bg inherited from flashcards.css) === */

.sc-view { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* ── Selector header ─────────────────────────────────────────── */
.sc-head { text-align: center; margin-bottom: 1.25rem; }
.sc-title { font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: .03em; color: #fff; }
.sc-subtitle { color: var(--fc-muted); font-size: 1.08rem; max-width: 640px; margin: .4rem auto 1rem; }
.sc-progress-row { display: flex; align-items: center; gap: .9rem; max-width: 520px; margin: 0 auto; }
.sc-progress-track { flex: 1; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .12); }

/* ── Filters ─────────────────────────────────────────────────── */
.sc-filters { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.sc-filter-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.sc-diff-btn { font-size: .92rem; }
.sc-cat-filter { display: inline-flex; align-items: center; gap: .6rem; color: var(--fc-muted); font-size: .95rem; }
.sc-cat-label { white-space: nowrap; }
#categoryFilter {
  padding: .45rem 1rem; font-size: .95rem; color: var(--fc-text); cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 99px; outline: none; transition: border-color .2s ease, background .2s ease;
}
#categoryFilter:hover { background: rgba(255, 255, 255, .13); }
#categoryFilter:focus { border-color: var(--fc-green); }
#categoryFilter option { color: #1a2410; background: #f2f5ec; }

/* ── Difficulty stars ────────────────────────────────────────── */
.sc-stars { letter-spacing: .08em; font-size: .95em; }
.diff-simple .sc-stars, .sc-card[data-difficulty="simple"] .sc-stars { color: #4ade80; }
.diff-moderate .sc-stars, .sc-card[data-difficulty="moderate"] .sc-stars { color: #fbbf24; }
.diff-complex .sc-stars, .sc-card[data-difficulty="complex"] .sc-stars { color: #f87171; }

/* ── Scenario card grid ──────────────────────────────────────── */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.sc-card {
  position: relative; display: flex; flex-direction: column; gap: .65rem; text-align: left;
  padding: 1.1rem 1.2rem 1.2rem; cursor: pointer; color: var(--fc-text); font-family: inherit;
  background: #1a5d2a;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius);
  box-shadow: inset 0 0 0 4px #1a5d2a, inset 0 0 0 6px rgba(255, 255, 255, .9);
  transition: transform .15s ease, border-color .2s ease, background .2s ease;
}
.sc-card:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--fc-green); }
.sc-card:focus-visible { outline: 3px solid var(--fc-green); outline-offset: 3px; }
.sc-card-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.sc-cat-badge {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: #dcead0; background: rgba(0, 0, 0, .35); padding: .28rem .8rem; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%;
}
.sc-diff-stars { flex-shrink: 0; }
.sc-card-title { font-size: 1.25rem; line-height: 1.3; color: #fff; }
.sc-card-status { margin-top: auto; display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--fc-muted); }
.sc-mastered-check { color: #4ade80; font-weight: 700; }
.sc-best-score { color: var(--fc-muted); }

/* Locked cards */
.sc-card.locked { cursor: default; opacity: .55; background: rgba(255, 255, 255, .05); border-style: dashed; box-shadow: none; }
.sc-lock-icon { font-size: 1.1rem; }
.sc-unlock-hint { color: var(--fc-muted); font-size: .88rem; line-height: 1.35; }

/* Category mastery badge on cards */
.sc-card-badge {
  position: absolute; top: -0.7rem; right: .9rem;
  background: linear-gradient(90deg, var(--fc-green-dark), var(--fc-green)); color: #fff;
  font-size: .74rem; letter-spacing: .05em; padding: .28rem .8rem; border-radius: 99px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4); white-space: nowrap;
}

/* ── Runner top bar ──────────────────────────────────────────── */
.sc-run-topbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.sc-back-btn { flex-shrink: 0; }
.sc-run-title { font-size: clamp(1.3rem, 3.4vw, 1.8rem); color: #fff; letter-spacing: .02em; flex: 1; min-width: 200px; }
.sc-step-counter {
  flex-shrink: 0; color: var(--fc-muted); font-size: .95rem; white-space: nowrap;
  background: rgba(8, 12, 5, .75); border: 1px solid rgba(255, 255, 255, .16);
  padding: .35rem .95rem; border-radius: 99px;
}

/* ── Scene description + layout ──────────────────────────────── */
.sc-scene-desc { color: var(--fc-muted); font-size: 1.08rem; max-width: 760px; margin-bottom: 1.25rem; line-height: 1.55; }
.sc-run-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.4rem; align-items: start; }

.sc-scene-panel {
  padding: 1.4rem 1.5rem; border-radius: var(--radius);
  background: rgba(8, 12, 5, .78); border: 1px solid rgba(255, 255, 255, .16);
  border-left-width: 6px; min-height: 180px;
}
.diff-simple .sc-scene-panel { border-left-color: #4ade80; }
.diff-moderate .sc-scene-panel { border-left-color: #fbbf24; }
.diff-complex .sc-scene-panel { border-left-color: #f87171; }
.sc-narration { font-size: clamp(1.2rem, 3vw, 1.5rem); line-height: 1.45; color: #fff; outline: none; }

/* ── Choice buttons ──────────────────────────────────────────── */
.sc-choices { display: flex; flex-direction: column; gap: .8rem; }
.sc-choice-btn {
  text-align: left; font-family: inherit; font-size: 1.05rem; line-height: 1.4; color: var(--fc-text);
  padding: .95rem 1.2rem; cursor: pointer; border-radius: 10px;
  background: rgba(8, 12, 5, .82); border: 1px solid rgba(255, 255, 255, .2);
  transition: background .2s ease, border-color .2s ease, transform .1s ease;
}
.sc-choice-btn:hover:not(:disabled) { background: rgba(24, 34, 14, .92); }
.sc-choice-btn:focus-visible { outline: 3px solid var(--fc-green); outline-offset: 2px; }
.sc-choice-btn:disabled { cursor: default; opacity: .75; }
.sc-choice-btn.chosen-correct { background: rgba(22, 163, 74, .3); border-color: #4ade80; color: #eafff0; opacity: 1; }
.sc-choice-btn.chosen-wrong { background: rgba(220, 38, 38, .25); border-color: #f87171; color: #ffecec; opacity: 1; }
.sc-choice-btn.reveal-correct { border-color: #4ade80; border-style: dashed; }

/* ── Feedback panel (bottom sheet) ───────────────────────────── */
.sc-feedback {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  transform: translateY(105%); transition: transform .3s ease-in;
  background: rgba(8, 12, 4, .97); border-top: 2px solid rgba(255, 255, 255, .16);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .55);
}
.sc-feedback.show { transform: translateY(0); }
.sc-fb-inner { max-width: 760px; margin: 0 auto; padding: 1.2rem 1.25rem calc(1.4rem + env(safe-area-inset-bottom)); display: flex; align-items: flex-start; gap: .9rem; }
.sc-fb-icon { font-size: 1.7rem; line-height: 1.2; flex-shrink: 0; }
.sc-feedback.correct { border-top-color: #4ade80; background: linear-gradient(180deg, rgba(22, 101, 52, .92), rgba(8, 12, 4, .97)); }
.sc-feedback.correct .sc-fb-icon { color: #4ade80; }
.sc-feedback.incorrect { border-top-color: #f87171; background: linear-gradient(180deg, rgba(127, 29, 29, .85), rgba(8, 12, 4, .97)); }
.sc-feedback.incorrect .sc-fb-icon { color: #f87171; }
.sc-fb-text { flex: 1; font-size: 1.06rem; line-height: 1.5; color: var(--fc-text); margin-bottom: .9rem; }
.sc-continue-btn { min-width: 140px; }

/* ── Completion screen ───────────────────────────────────────── */
.sc-complete-card {
  max-width: 620px; margin: 2.5rem auto 0; text-align: center;
  padding: 2.2rem 2rem 2.4rem; border-radius: var(--radius);
  background: #1a5d2a;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 4px #1a5d2a, inset 0 0 0 6px rgba(255, 255, 255, .9), 0 6px 28px rgba(34, 85, 17, .45);
}
.sc-done-icon { font-size: 3rem; display: inline-block; margin-bottom: .4rem; }
.sc-complete-title { font-size: clamp(1.7rem, 4.5vw, 2.3rem); color: #fff; letter-spacing: .03em; }
.sc-complete-scene { color: var(--fc-muted); font-size: 1.05rem; margin-top: .3rem; }
.sc-score-row { display: flex; justify-content: center; gap: 2.4rem; margin: 1.6rem 0 1rem; }
.sc-score-stat { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.sc-score-num { font-size: 2.3rem; color: #fff; line-height: 1; }
.sc-score-num.sc-good { color: #4ade80; }
.sc-score-cap { font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fc-muted); }
.sc-complete-msg { color: var(--fc-text); font-size: 1.08rem; min-height: 1.6em; margin-bottom: .4rem; }
.sc-badges { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0 1.2rem; }
.sc-badge-earned {
  background: linear-gradient(90deg, var(--fc-green-dark), var(--fc-green)); color: #fff;
  font-size: .85rem; letter-spacing: .04em; padding: .4rem 1rem; border-radius: 99px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .4);
}

/* ── Reset All Scenarios — red street-sign button (mimics .street-sign-btn) ── */
.sc-reset-row { display: flex; justify-content: center; margin-top: 2.75rem; padding-bottom: 3rem; }
.sc-reset-btn {
  --sign-bg: #dc2626;
  background: var(--sign-bg); color: #fff; border: none; border-radius: 10px;
  padding: .8rem 2.4rem; font-size: 1.15rem; font-weight: 700; cursor: pointer; font-family: inherit;
  letter-spacing: .09em; text-transform: uppercase; text-shadow: 0 1px 3px rgba(0,0,0,.4);
  box-shadow: inset 0 0 0 4px var(--sign-bg), inset 0 0 0 6px rgba(255,255,255,.9), 0 4px 16px rgba(0,0,0,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.sc-reset-btn:hover {
  background: var(--sign-bg); color: #fff;
  transform: scale(1.08) rotate(-5deg);
  box-shadow: inset 0 0 0 4px var(--sign-bg), inset 0 0 0 6px rgba(255,255,255,.9), 0 6px 20px rgba(0,0,0,.55);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sc-run-layout { grid-template-columns: 1fr; }
  .sc-scene-panel { min-height: 0; }
}
@media (max-width: 480px) {
  .sc-view { padding: 1.1rem .75rem 3rem; }
  .sc-grid { grid-template-columns: 1fr; }
  .sc-filters { flex-direction: column; align-items: stretch; }
  .sc-filter-group { justify-content: center; }
  .sc-cat-filter { justify-content: center; }
  #categoryFilter { width: 100%; }
  .sc-run-topbar { gap: .6rem; }
  .sc-step-counter { order: 3; width: 100%; text-align: center; }
  .sc-score-row { gap: 1.4rem; }
}
