/* === Recall mode ====================================================
   Companion to js/games/recall-mode.js + games/recall.partial.html.
   Styles for the intro overlay (modal that appears when the user clicks
   the Recall pill). The canvas-overlay UI (.study-hint-overlay,
   .recall-progress, .recall-nudge) stays in css/main.css because its
   markup lives inside the carousel card / toolbar.
   ====================================================================== */
.recall-intro-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 14, 14, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    animation: recall-intro-fade 0.18s ease;
}
.recall-intro-backdrop.active { display: flex; }
@keyframes recall-intro-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.recall-intro {
    background: var(--bg);
    color: var(--text);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    width: min(440px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 22px 22px 18px;
    position: relative;
    animation: recall-intro-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes recall-intro-pop {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.recall-intro-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-faint);
    cursor: pointer;
    padding: 4px 8px;
}
.recall-intro-close:hover { color: var(--text); }
.recall-intro-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 4px;
    letter-spacing: 0.01em;
}
.recall-intro-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 16px;
}
.recall-intro-section {
    margin-bottom: 14px;
}
.recall-intro-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-bottom: 6px;
}
/* Per-character tiles for the selected family. The start target gets
   a highlighted ring; learned characters use the green palette. */
.recall-intro-chars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 6px;
}
.recall-intro-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border: 1px solid var(--ink-border);
    border-radius: 8px;
    background: transparent;
    min-height: 64px;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
}
.recall-intro-char:hover { background: var(--ink-hover); }
.recall-intro-char.learned:hover { background: var(--green-bg); filter: brightness(1.05); }
.recall-intro-char:active { transform: scale(0.96); }
.recall-intro-char.learned {
    background: var(--green-bg);
    border-color: var(--green-border);
}
.recall-intro-char.due:not(.learned) {
    background: var(--orange-bg);
    border-color: var(--orange-border);
}
.recall-intro-char-glyph {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: 0.02em;
}
.recall-intro-char.learned .recall-intro-char-glyph {
    color: var(--green);
}
.recall-intro-overall-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}
.recall-intro-overall-count {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.recall-intro-overall-pct {
    font-size: 0.8rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}
.recall-intro-bar {
    height: 8px;
    background: var(--ink-bg);
    border-radius: 4px;
    overflow: hidden;
}
.recall-intro-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 4px;
    transition: width 0.25s ease;
}
.recall-intro-families {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
}
.recall-intro-family {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--ink-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
    font-variant-numeric: tabular-nums;
}
.recall-intro-family:hover {
    background: var(--ink-hover);
    border-color: var(--text-faint);
}
.recall-intro-family.selected {
    background: var(--accent-bg);
    border-color: var(--accent);
}
.recall-intro-family.complete {
    background: var(--green-bg);
    border-color: var(--green-border);
}
.recall-intro-family.complete .recall-intro-family-count {
    color: var(--green);
}
/* Locked: family is past the sequential frontier — user must finish
   earlier families before unlocking this one. */
.recall-intro-family.locked {
    background: transparent;
    border-style: dashed;
    opacity: 0.45;
    cursor: not-allowed;
}
.recall-intro-family.locked:hover {
    background: transparent;
    border-color: var(--ink-border);
}
.recall-intro-family.locked .recall-intro-family-name {
    color: var(--text-faint);
}
.recall-intro-family-name {
    font-weight: 600;
}
.recall-intro-family-count {
    color: var(--text-faint);
    font-size: 0.78rem;
}
.recall-intro-start {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 12px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.15s, transform 0.1s;
}
.recall-intro-start:hover { background: var(--heading); }
.recall-intro-start:active { transform: translateY(1px); }
/* Reviews section uses a subtle orange accent — read as "could use a
   refresh," not "you must." Reviews are an opt-in choice; the Start
   button continues with Current Lesson by default. */
#recall-intro-reviews-section .recall-intro-section-label {
    color: var(--orange);
}

/* Opt-in "Review N →" button — visually distinct from the primary
   Start button (which advances the lesson). Subdued outline style so
   the user reads it as an alternative, not a competitor. */
.recall-intro-reviews-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 9px 16px;
    background: transparent;
    color: var(--orange);
    border: 1px solid var(--orange-border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.15s, border-color 0.15s;
}
.recall-intro-reviews-btn:hover {
    background: var(--orange-bg);
    border-color: var(--orange);
}

/* Progressive "Try Recall" nudge — shown once after first successful Trace/Free Hand */
.recall-nudge {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 8px 14px 8px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(179,42,42,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 50;
    animation: recall-nudge-in 0.25s ease;
    pointer-events: auto;
}
.recall-nudge[hidden] { display: none; }
.recall-nudge::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--accent);
}
.recall-nudge-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: 0.8;
}
.recall-nudge-close:hover { opacity: 1; }
@keyframes recall-nudge-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* Light-grey progress pill shown throughout Recall mode. Always
   visible while study-active (including during drawing) so the user
   can see which character they're writing and how far they've got. */
.recall-progress {
    display: none;
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-faint);
    opacity: 0.7;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}
/* The "Correct N/3" counter and streak surfacing in this pill became
   meaningless under the v2 SRS — kept hidden but the element is still
   in the DOM in case any code path still queries its ID. */
body.study-active .recall-progress { display: none; }
.recall-progress-label { opacity: 0.75; margin-right: 2px; }
.recall-progress-learned { color: var(--green); opacity: 0.9; }

