/* ============================================================
   StandaloneSummary — unified hero + ledger summary card.
   Shared visual chrome for the post-completion moment across
   reading, flashcards, writing and grammar. Mirrors the iOS
   QuizCompletionHero / SessionCompleteCard pattern: tier headline,
   weekly-progress pill, ledger card (gradient stroke + paired
   shadow), monumental TOTAL row, primary 3D-press CTA, secondary
   outline + tertiary text link.

   Class prefix is `.fs-*` for historical reasons — these rules
   used to live in flashcards/styles/flashcards.css. JS that builds
   the markup is static/scripts/standalone_summary.js.
   ============================================================ */

.fs-container {
    width: 100%;
    max-width: 540px;
    margin: 24px auto 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fs-rise-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fs-rise-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero block ─────────────────────────────────────────── */

.fs-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

.fs-headline {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.9px;
    color: var(--gray-900);
    line-height: 1.1;
    margin: 0;
    flex: 1;
    animation: fs-headline-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fs-headline-pulse {
    0%   { transform: scale(0.92); opacity: 0; }
    60%  { transform: scale(1.04); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

.fs-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 9999px;
    color: var(--amber-700);
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
    animation: fs-pill-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.fs-pill-icon {
    color: var(--amber-600);
    font-size: 14px;
    font-weight: 900;
}

@keyframes fs-pill-pop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ── Ledger card (gradient stroke + paired shadow) ─────── */

.fs-ledger {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 20px 22px;
    border: 1px solid transparent;
    /* Linear gradient stroke + matching white interior — Meng-style.
       Same visual chrome as SectionCard.secondaryCardChrome on iOS. */
    background-image:
        linear-gradient(var(--white), var(--white)),
        linear-gradient(180deg, rgba(255,255,255,0.95), rgba(229,231,235,0.80) 50%, rgba(229,231,235,0.55));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow:
        0 1px 1px rgba(0,0,0,0.04),
        0 8px 14px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fs-card-rise 0.4s ease-out 0.15s both;
}

@keyframes fs-card-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Section heading: 4×18 teal-gradient bar + uppercase eyebrow + trailing */
.fs-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fs-bar {
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--teal-600), var(--teal-400));
    flex-shrink: 0;
}

.fs-eyebrow {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.7px;
    color: var(--teal-700);
    text-transform: uppercase;
}

.fs-trailing {
    margin-left: auto;
    font-size: 15px;
    font-weight: 800;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
}

/* Outcome row */
.fs-row {
    display: flex;
    align-items: baseline;
    padding: 14px 4px;
    animation: fs-row-slide 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

@keyframes fs-row-slide {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fs-row-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.fs-row-value {
    margin-left: auto;
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
}

.fs-divider {
    height: 1.5px;
    background: var(--gray-200);
    margin: 0;
    border: 0;
}

/* TOTAL row */
.fs-total-row {
    display: flex;
    align-items: baseline;
    padding-top: 4px;
    animation: fs-total-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.65s both;
}

@keyframes fs-total-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fs-total-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.3px;
    color: var(--gray-500);
    text-transform: uppercase;
}

.fs-total-wrap {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.fs-total-number {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -1.2px;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Pop animation when this is a *new* award (awarded:true). Fires on
   top of the TOTAL row's fs-total-rise so the number lands with a
   small overshoot. */
.fs-total-pop {
    animation:
        fs-total-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.65s both,
        fs-total-bump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
}

@keyframes fs-total-bump {
    0%   { transform: scale(0.8); }
    60%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.fs-total-unit {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-400);
    padding-bottom: 4px;
}

/* ── Actions ────────────────────────────────────────────── */

.fs-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fs-card-rise 0.35s ease-out 1.05s both;
}

/* Primary 3D-press button — matches StartQuizButton / SessionCompletionBanner
   primary on iOS. Two-stack shadow (tight teal-700 shelf + wide ambient halo)
   plus an idle teal-600 glow that breathes after the user is idle. */
.fs-primary {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: var(--teal-600);
    color: var(--white);
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    border: 0;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
    box-shadow:
        0 4px 0 0 var(--teal-700),
        0 10px 24px -8px rgba(13, 148, 136, 0.45);
    font-family: inherit;
}
.fs-primary:hover {
    background: var(--teal-700);
}
.fs-primary:active {
    transform: translateY(3px);
    box-shadow:
        0 1px 0 0 var(--teal-700),
        0 4px 12px -6px rgba(13, 148, 136, 0.45);
}

/* Secondary outlined CTA — the lateral move ("Pick another deck").
   Sits below the primary but still earns full-width chrome so the user
   sees it as a real option, not a quiet text link. Matches the iOS
   standalone summary's outlined secondary. */
.fs-secondary {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: var(--white);
    color: var(--teal-700);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: 2px solid var(--teal-600);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s ease-out;
}
.fs-secondary:hover {
    background: #F0FDFA;
}

/* Tertiary text link — quiet escape hatch. The eye should land on the
   primary, not here. */
.fs-tertiary {
    display: block;
    width: 100%;
    padding: 10px 8px;
    background: transparent;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.fs-tertiary:hover {
    color: var(--gray-700);
    text-decoration: underline;
}

/* Mobile breathing room: tighter horizontal padding on small screens
   so the card doesn't push against the viewport edges. */
@media (max-width: 600px) {
    .fs-container { margin-top: 16px; gap: 16px; }
    .fs-headline { font-size: 28px; letter-spacing: -0.7px; }
    .fs-ledger { padding: 18px; }
    .fs-row-label, .fs-row-value { font-size: 17px; }
    .fs-total-number { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .fs-container, .fs-headline, .fs-pill, .fs-ledger,
    .fs-row, .fs-total-row, .fs-total-pop, .fs-actions {
        animation: none !important;
    }
}
