/* Flashcards student pages on the games shell: navy/gold, light/dark, progress bar, keyboard keys. */
.fcp-wrap { width: min(100%, 48rem); margin: 0 auto; padding: .8rem 1rem 2rem; }
.fcp-page .fc-kicker { color: var(--wg-muted); font-size: .8rem; }
.fcp-page .fc-progress { margin: .45rem 0 .6rem; }
.fcp-page .fc-stat { background: var(--wg-card); border-color: var(--wg-line); box-shadow: var(--wg-shadow); }
.fcp-page .fc-stat-label { color: var(--wg-muted); }
.fcp-page .fc-stat-value { color: var(--wg-accent); }
.fcp-page .fc-restart { background: var(--wg-soft); color: var(--wg-ink); border: 1px solid var(--wg-line); }
.fcp-page .fc-restart:hover { background: var(--wg-gold); color: var(--wg-navy); }
.fc-bar { height: .55rem; border-radius: 999px; background: var(--wg-soft); overflow: hidden; margin: 0 0 .5rem; border: 1px solid var(--wg-line); }
.fc-bar-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--wg-navy), #3651c9 60%, var(--wg-gold)); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.fcp-page .fc-deck { margin: .3rem auto 1rem; }
.fcp-page .fc-face::before { background: linear-gradient(90deg, var(--wg-navy), #3651c9 60%, var(--wg-gold)); }
.fcp-page .fc-side { color: var(--wg-navy); }
.fcp-page .fc-btn { background: var(--wg-navy); border-radius: .85rem; font-weight: 800; }
.fcp-page .fc-btn:focus-visible, .fcp-page .fc-choice:focus-visible { outline: 3px solid var(--wg-gold); outline-offset: 2px; }
.fcp-page .fc-choice { display: flex; align-items: center; gap: .7rem; text-align: left; font-weight: 700; cursor: pointer; }
.fc-key { flex: none; width: 1.9rem; height: 1.9rem; border-radius: .55rem; display: grid; place-items: center; font-size: .95rem; font-weight: 900; background: rgba(0, 26, 114, .1); color: var(--wg-navy); }
.fcp-page .fc-choice.picked .fc-key { background: var(--wg-gold); }
.fcp-keys { text-align: center; font-size: .85rem; margin: 0; }
.fcp-keys kbd { display: inline-block; padding: .05rem .4rem; border-radius: .35rem; border: 1px solid var(--wg-line); background: var(--wg-card); font: inherit; font-weight: 800; }
.fcp-page .fc-summary { background: var(--wg-card); border-color: var(--wg-line); color: var(--wg-ink); text-align: center; justify-items: center; }
.fcp-page .fc-summary h2 { margin: 0; font-size: 2rem; }
.fcp-page .fc-done { background: var(--wg-card); color: var(--wg-ink); }
.fcp-page .fc-done p { color: var(--wg-muted); }
.fcp-page .fc-done-kicker { color: var(--wg-accent); }

html[data-wg-theme="dark"] .fcp-page .fc-face,
html[data-wg-theme="dark"] .fcp-page [class*="fc-tone-"] .fc-face-front,
html[data-wg-theme="dark"] .fcp-page [class*="fc-tone-"] .fc-face-back { background: linear-gradient(180deg, #102060, #0d1840); border-color: #2c3d80; box-shadow: 0 28px 50px rgba(0, 0, 0, .45); }
html[data-wg-theme="dark"] .fcp-page .fc-stack, html[data-wg-theme="dark"] .fcp-page .fc-stack-b { background: rgba(20, 33, 84, .75); border-color: #24326b; }
html[data-wg-theme="dark"] .fcp-page .fc-front, html[data-wg-theme="dark"] .fcp-page .fc-reveal { color: var(--wg-ink); }
html[data-wg-theme="dark"] .fcp-page .fc-side { color: var(--wg-gold); }
html[data-wg-theme="dark"] .fcp-page .fc-tap { color: var(--wg-muted); }
html[data-wg-theme="dark"] .fcp-page .fc-answer { background: #07102e; color: var(--wg-ink); border-color: #2c3d80; }
html[data-wg-theme="dark"] .fcp-page .fc-choice { background: #142154 !important; border-color: #2c3d80 !important; color: var(--wg-ink) !important; }
html[data-wg-theme="dark"] .fcp-page .fc-choice.picked { border-color: var(--wg-gold) !important; box-shadow: inset 0 0 0 1px var(--wg-gold); }
html[data-wg-theme="dark"] .fc-key { background: rgba(255, 215, 0, .16); color: var(--wg-gold); }
html[data-wg-theme="dark"] .fcp-page .fc-choice.picked .fc-key { color: var(--wg-navy); }
html[data-wg-theme="dark"] .fcp-page .fc-btn, html[data-wg-theme="dark"] .fcp-page .fc-flip-btn { background: var(--wg-gold); color: var(--wg-navy); }
html[data-wg-theme="dark"] .fcp-page .fc-btn.secondary { background: transparent; color: var(--wg-ink); border-color: var(--wg-line); }
html[data-wg-theme="dark"] .fcp-page .fc-result.ok { background: var(--wg-ok-bg); color: var(--wg-ok); }
html[data-wg-theme="dark"] .fcp-page .fc-result.bad { background: var(--wg-bad-bg); color: var(--wg-bad); }
html[data-wg-theme="dark"] .fcp-page .fc-face::after { background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .08) 50%, transparent 65%); }
@media (max-height: 800px) {
    .fcp-page .fc-face-front { min-height: 15rem; }
    .fcp-page .fc-face { padding: 1.3rem 1.3rem 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .fc-bar-fill { transition: none; }
}
/* layout fixes on the games shell */
.fcp-page #fc-play .fc-deck { width: min(100%, 42rem); }
.fcp-page #fc-play .fc-flip { flex: 1 1 auto; width: 100%; }
.fcp-page #fc-play .fc-face-front { overflow: hidden; }
.fcp-page #fc-play .fc-face-back { overflow: auto; }
.fcp-page .fc-btn, .fcp-page .fc-flip-btn { color: #fff; }
.fcp-page .fc-btn.secondary { background: transparent; color: var(--wg-ink); border: 1px solid var(--wg-line); }
/* contrast: .secondary must not inherit the navy fill from .fcp-page .fc-btn (was dark text on navy) */
.fcp-page .fc-btn svg, .fcp-page .fc-flip-btn svg { fill: currentColor; }
.fcp-page textarea, .vp-page textarea { font: inherit; color: inherit; }

/* ---- Big, responsive cards (Nov 2026) ---- */
html, body.fcp-page { overflow-x: clip; max-width: 100%; }
.fcp-page { min-height: 100dvh; display: flex; flex-direction: column; }
.fcp-page .fcp-wrap { width: min(100%, 60rem); flex: 1 1 auto; display: flex; flex-direction: column; padding: .6rem clamp(.6rem, 2vw, 1.2rem) .8rem; box-sizing: border-box; }
.fcp-page #fc-play { max-width: none; width: 100%; }
.fcp-page #fc-play .fc-deck { width: min(100%, 900px); margin: .2rem auto .5rem; padding-bottom: .5rem; overflow: visible; }
.fcp-page #fc-play .fc-scene { overflow: visible; }
/* The card fills most of the screen: ~60% of the height, never taller than what is left under the header. */
.fcp-page #fc-play .fc-flip { height: clamp(17rem, min(60vh, calc(100dvh - 16.5rem)), 44rem); min-height: 0; }
.fcp-page #fc-play .fc-face-front { height: 100%; min-height: 0; overflow: hidden; }
.fcp-page #fc-play .fc-face { padding: clamp(1.1rem, 2.4vw, 2rem) clamp(1rem, 2.6vw, 2.2rem) clamp(1rem, 2vw, 1.6rem); }
.fcp-page #fc-play .fc-face-back { overflow-x: hidden; overflow-y: auto; }
.fcp-page #fc-play .fc-front { font-size: clamp(1.55rem, .9rem + 2.3vw, 3.1rem); line-height: 1.2; margin: auto 0; text-align: center; padding: .4rem 0 .8rem; flex: 0 1 auto; overflow-y: auto; }
.fcp-page #fc-play .fc-reveal { font-size: clamp(1.8rem, 1rem + 2.6vw, 3.4rem); text-align: center; margin: auto 0 .8rem; }
.fcp-page #fc-play .fc-result { align-self: center; }
.fcp-page #fc-play .fc-answer { font-size: clamp(1.05rem, .9rem + .5vw, 1.35rem); min-height: 3.4rem; max-height: 6rem; flex: none; }
.fcp-page #fc-play .fc-flip-btn { flex: none; font-size: clamp(1rem, .9rem + .4vw, 1.2rem); padding-block: .8rem; }
.fcp-page #fc-play .fc-choices { display: grid; gap: .6rem; grid-template-columns: 1fr; flex: none; }
.fcp-page #fc-play .fc-choice { font-size: clamp(1rem, .85rem + .5vw, 1.3rem); padding: .75rem 1rem; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 700px) { .fcp-page #fc-play .fc-choices { grid-template-columns: 1fr 1fr; } }
.fcp-page #fc-play .fc-back-media { max-height: 30vh; object-fit: contain; max-width: 100%; }
.fcp-page #fc-play .fc-stack, .fcp-page #fc-play .fc-stack-b { left: 1.2rem; right: 1.2rem; }
@media (max-width: 640px) {
    .fcp-page #fc-play .fc-flip { height: clamp(16rem, calc(100dvh - 15.5rem), 40rem); }
    .fcp-page .fcp-keys { display: none; }
    .fcp-page #fc-play .fc-stack, .fcp-page #fc-play .fc-stack-b { left: .5rem; right: .5rem; }
}
/* Never let the question face sit over the answer: hide it half-way through the flip
   (some browsers ignore backface-visibility when a face clips its content). */
.fcp-page .fc-face-back { visibility: hidden; }
.fcp-page .fc-flip.is-flipped .fc-face-back { visibility: visible; transition: visibility 0s linear .3s; }
.fcp-page .fc-flip.is-flipped .fc-face-front { visibility: hidden; pointer-events: none; transition: visibility 0s linear .3s; }
.fcp-page .fc-flip.is-flipped .fc-face-back { z-index: 2; }
@media (prefers-reduced-motion: reduce) {
    .fcp-page .fc-flip.is-flipped .fc-face-back, .fcp-page .fc-flip.is-flipped .fc-face-front { transition: none; }
}

/* ---- Card motion: toss off / rise in, swipe, result pulse, progress bounce (transform + opacity only) ---- */
/* The stage clips sideways so a card flying off never adds a horizontal scrollbar. */
.fcp-page #fc-stage { overflow-x: clip; overflow-y: visible; max-width: 100%; }
@supports not (overflow: clip) { .fcp-page #fc-stage { overflow-x: hidden; } }
.fcp-page #fc-play .fc-scene { touch-action: pan-y; will-change: transform; -webkit-tap-highlight-color: transparent; }
.fcp-page #fc-play .fc-scene.is-dragging { transition: none; cursor: grabbing; user-select: none; -webkit-user-select: none; }
.fcp-page #fc-play .fc-scene.is-snapping { transition: transform .24s cubic-bezier(.2, .9, .3, 1.3); }
.fcp-page #fc-play .fc-scene.is-tossing { transition: transform .3s cubic-bezier(.45, 0, .85, .55), opacity .28s ease-in; pointer-events: none; }
.fcp-page #fc-play .fc-stack, .fcp-page #fc-play .fc-stack-b { transition: transform .3s ease, opacity .3s ease; }
.fcp-page #fc-play .fc-deck.is-advancing .fc-stack { transform: translateY(-.35rem) rotate(0deg); }
.fcp-page #fc-play .fc-deck.is-advancing .fc-stack-b { transform: translateY(-.3rem) rotate(1.4deg); opacity: .9; }
.fcp-page #fc-play .fc-deck.is-entering .fc-scene { animation: fcRise .42s cubic-bezier(.2, .8, .2, 1) both; }
.fcp-page #fc-play .fc-deck.is-entering .fc-stack-b { animation: fcFade .42s ease both; }
@keyframes fcRise {
    from { transform: translate3d(0, .9rem, 0) scale(.94); opacity: .2; }
    to { transform: none; opacity: 1; }
}
@keyframes fcFade { from { opacity: 0; } to { opacity: .7; } }
.fc-pulse { position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none; opacity: 0; }
.fc-scene.pulse-ok .fc-pulse { box-shadow: inset 0 0 0 4px rgba(22, 163, 74, .9), inset 0 0 2.2rem rgba(34, 197, 94, .35); animation: fcPulse .7s ease-out; }
.fc-scene.pulse-bad .fc-pulse { box-shadow: inset 0 0 0 4px rgba(220, 38, 38, .85), inset 0 0 2.2rem rgba(239, 68, 68, .3); animation: fcPulse .7s ease-out; }
@keyframes fcPulse { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.fcp-page .fc-bar-fill { width: 100%; border-radius: 0; transform: scaleX(0); transform-origin: left center; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.fcp-page .fc-bar.is-bounce { animation: fcBarBounce .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fcBarBounce { 0%, 100% { transform: scaleY(1); } 35% { transform: scaleY(1.9); } 65% { transform: scaleY(.85); } }
.fc-sec-chip { display: inline-block; align-self: center; margin: 0 0 .35rem; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e0e7ff; color: #312e81; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-wg-theme="dark"] .fc-sec-chip { background: #312e81; color: #e0e7ff; }
.fc-swipe-hint { margin-top: .35rem; }
/* Join page: sections picker */
.fcj-sections { border: 1px solid var(--wg-line, #e2e8f0); border-radius: .9rem; padding: .55rem .8rem .7rem; margin: .4rem 0 .9rem; min-width: 0; text-align: left; }
.fcj-sections legend { font-weight: 700; padding: 0 .3rem; }
.fcj-all, .fcj-sec { display: flex; align-items: center; gap: .5rem; padding: .35rem .1rem; min-width: 0; cursor: pointer; }
.fcj-all { font-weight: 700; border-bottom: 1px solid var(--wg-line, #e2e8f0); margin-bottom: .2rem; }
.fcj-sec span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.fcj-sec small { color: var(--wg-muted, #64748b); font-weight: 700; }
.fcj-all input, .fcj-sec input { width: 1.15rem; height: 1.15rem; flex: none; accent-color: #001A72; }
.fcj-list { max-height: 15rem; overflow-y: auto; }
@media (prefers-reduced-motion: reduce) {
    .fcp-page #fc-play .fc-scene, .fcp-page #fc-play .fc-stack, .fcp-page #fc-play .fc-stack-b, .fcp-page .fc-bar-fill { transition: none !important; animation: none !important; }
    .fcp-page #fc-play .fc-deck.is-entering .fc-scene, .fcp-page .fc-bar.is-bounce, .fc-scene .fc-pulse { animation: none !important; }
}
