/* ==========================================================================
   youth-engine.css — styling for the PREDICT→VERIFY→KEEP→SHARE loop + scenario
   engine (js/youth-engine.js). On-brand: dark surfaces, orange accent (sparingly),
   white text, RECTANGULAR 2px, Inter. Sanctioned success green (#28a745) ONLY for
   a correct prediction. No purple. Tokens fall back to homepage values.
   ========================================================================== */
:root {
  --yf-bg:       var(--dark-bg, #16181c);
  --yf-surface:  var(--card-bg, #101010);
  --yf-surface-2:#1b1d22;
  --yf-text:     var(--text-primary, #F7F7F2);
  --yf-muted:    var(--text-secondary, #b3b3b3);
  --yf-border:   var(--border-color, #2a2a2a);
  --yf-accent:   var(--primary-orange, #FF7A00);
  --yf-accent-2: #FFD400;
  --yf-good:     var(--success, #28a745);
  --yf-radius:   2px;
  --yf-font:     'Inter', system-ui, -apple-system, sans-serif;
}

/* Shared card shell for the four loop beats */
.yf-card {
  background: var(--yf-surface);
  border: 1px solid var(--yf-border);
  border-left: 3px solid var(--yf-accent);
  border-radius: var(--yf-radius);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
  color: var(--yf-text);
  font-family: var(--yf-font);
}
.yf-kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--yf-accent); margin-bottom: 0.5rem;
  font-family: 'JetBrains Mono', var(--yf-font);
}
.yf-muted { color: var(--yf-muted); }

/* Inputs + buttons (rectangular, readable — never faint-on-fill) */
.yf-input {
  background: var(--yf-bg); border: 1px solid var(--yf-border); border-radius: var(--yf-radius);
  color: var(--yf-text); padding: 0.5rem 0.7rem; font-size: 1rem; font-family: var(--yf-font); min-width: 0;
}
.yf-input:focus-visible { outline: 2px solid var(--yf-accent); outline-offset: 1px; }
.yf-btn {
  display: inline-block; background: transparent; color: var(--yf-text);
  border: 2px solid var(--yf-accent); border-radius: var(--yf-radius);
  padding: 0.45rem 1rem; font-size: 0.92rem; font-weight: 700; font-family: var(--yf-font);
  cursor: pointer; transition: background .15s, color .15s;
}
.yf-btn:hover { background: rgba(255,122,0,.14); }
.yf-btn:disabled { opacity: .65; cursor: default; border-color: var(--yf-border); }
.yf-btn-secondary { border-color: var(--yf-border); color: var(--yf-muted); font-weight: 600; }
.yf-btn-secondary:hover { border-color: var(--yf-accent); color: var(--yf-text); background: transparent; }

/* ① Predict */
.yf-predict-q { margin: 0 0 0.6rem; font-weight: 600; }
.yf-predict-input { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.yf-unit { color: var(--yf-muted); font-size: 0.9rem; }
.yf-locked .yf-input { opacity: .8; }
.yf-reveal { margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px dashed var(--yf-border); }
.yf-reveal-actual { font-size: 1.05rem; }
.yf-good { color: var(--yf-good); font-weight: 700; }
.yf-gap { color: var(--yf-accent-2); }
.yf-reveal-note { margin: 0.4rem 0 0; color: var(--yf-muted); font-size: 0.92rem; }

/* ② Verify */
.yf-verify-claim { margin: 0 0 0.3rem; }
.yf-verify-sub { margin: 0 0 0.6rem; color: var(--yf-muted); font-size: 0.92rem; }
.yf-verify-live { font-size: 1.05rem; margin-bottom: 0.5rem; }
.yf-live { color: var(--yf-accent); font-weight: 700; font-family: 'JetBrains Mono', var(--yf-font); }
.yf-verify-verdict { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--yf-muted); font-size: 0.92rem; }
.yf-verify-verdict.hidden, .hidden { display: none; }

/* ③ Keep — artifact sheet (also the print layout) */
.yf-artifact-sheet { margin: 1.25rem 0; }
.yf-sheet {
  background: var(--yf-surface); border: 1px solid var(--yf-border); border-radius: var(--yf-radius);
  padding: 1.25rem 1.4rem; color: var(--yf-text); font-family: var(--yf-font);
}
.yf-sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.yf-sheet-brand { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--yf-muted); }
.yf-sheet-kicker { font-size: 0.72rem; font-weight: 700; color: var(--yf-accent); font-family: 'JetBrains Mono', var(--yf-font); }
.yf-sheet-title {
  margin: 0.4rem 0 0.9rem; font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(90deg, #FFE600 0%, #FFD400 18%, #FF9A00 48%, #FF7A00 78%, #E85F00 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--yf-accent);
}
.yf-sheet-table { width: 100%; border-collapse: collapse; }
.yf-sheet-table th, .yf-sheet-table td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--yf-border); vertical-align: top; }
.yf-sheet-table th { color: var(--yf-muted); font-weight: 600; width: 42%; }
.yf-sheet-foot { margin-top: 1rem; font-size: 0.72rem; color: var(--yf-muted); }
.yf-sheet-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.yf-plan-table .yf-row-todo th { color: var(--yf-muted); }
.yf-plan-table a { color: var(--yf-accent); }

/* ④ Share */
.yf-share-prompt { margin: 0 0 0.7rem; font-weight: 600; }
.yf-share-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.yf-share-actions .yf-input { flex: 1 1 220px; }
.yf-share-done { color: var(--yf-good); font-weight: 600; margin: 0; }

/* ⑤ Scenario engine */
.yf-scene { background: var(--yf-surface); border: 1px solid var(--yf-border); border-radius: var(--yf-radius); padding: 1.1rem 1.25rem; color: var(--yf-text); }
.yf-scene .dialogue, .yf-scene .story-text { color: var(--yf-text); }
.yf-choices { display: grid; gap: 0.65rem; margin-top: 0.9rem; }
.yf-choice {
  text-align: left; background: var(--yf-surface-2); border: 1px solid var(--yf-border);
  border-left: 3px solid var(--yf-border); border-radius: var(--yf-radius);
  padding: 0.8rem 1rem; cursor: pointer; color: var(--yf-text); font-family: var(--yf-font);
  transition: border-color .15s, background .15s; display: block; width: 100%;
}
.yf-choice:hover, .yf-choice:focus-visible { border-left-color: var(--yf-accent); background: #20232a; outline: none; }
.yf-choice-title { display: block; font-weight: 700; }
.yf-choice-desc { display: block; color: var(--yf-muted); font-size: 0.9rem; margin-top: 0.2rem; }
.yf-outcome { border: 1px solid var(--yf-border); border-radius: var(--yf-radius); padding: 1.1rem 1.25rem; background: var(--yf-surface); }
.yf-outcome-good { border-left: 3px solid var(--yf-good); }
.yf-outcome-bad  { border-left: 3px solid #dc3545; }
.yf-outcome-mixed{ border-left: 3px solid var(--yf-accent); }
.yf-outcome-title { margin: 0 0 0.5rem; color: var(--yf-text); }
.yf-learning { margin-top: 0.9rem; background: var(--yf-surface-2); border: 1px solid var(--yf-border); border-radius: var(--yf-radius); padding: 0.9rem 1.1rem; }
.yf-learning h4 { margin: 0 0 0.5rem; color: var(--yf-accent); font-size: 0.95rem; }
.yf-learning ul { margin: 0; padding-left: 1.1rem; color: var(--yf-text); }
.yf-restart { margin-top: 0.9rem; }

/* Print: clean white keepsake */
.yf-print-page { background: #fff !important; color: #111 !important; }
.yf-print-page .yf-sheet { background: #fff; border: 1px solid #ccc; color: #111; }
.yf-print-page .yf-sheet-title { -webkit-text-fill-color: #E85F00; color: #E85F00; background: none; }
.yf-print-page .yf-sheet-table th { color: #555; }
.yf-print-page .yf-sheet-table th, .yf-print-page .yf-sheet-table td { border-bottom: 1px solid #ddd; }
@media print { .yf-sheet-actions, .yf-btn { display: none !important; } body { background: #fff; } }

@media (max-width: 640px) {
  .yf-card, .yf-sheet, .yf-scene { padding: 1rem; }
  .yf-sheet-table th { width: 50%; }
}
