/* THE ONE FLASHCARD SCREEN (job S5-08, 20 Nov 2026): its look, in one block. The behaviour is js/flashcard-screen.js
   (svFlashScreen), for the dashboard's deck, a lesson's deck and the cards chosen by subject and unit. The colours are
   the screen's own, so it looks the same on Home and on a lesson; the card's words are in the pupil's reading font
   (--font-read, which the reading settings change) and never break a word with a hyphen. A page loads this file
   before css/bar.css and css/buttons.css (which stays the last style sheet, test u106).

   A wide screen: a panel in the middle of the dimmed page, its foot a row of buttons. A phone (600px and less): the
   screen fills it, the card fills the space between the head and the foot, the question at its top and the box to
   type in at its foot (at the thumb), and the foot is the bar at the foot of the screen (css/bar.css, sv-bar-in). */
.svfc{
  --fc-page:#faf8f5; --fc-card:#fffdf8; --fc-ink:#2d2a26; --fc-sec:#5c574f; --fc-mut:#736e66; --fc-line:#e4dccc;
  --fc-right:#3e7d58; --fc-right-bg:#edf6f0; --fc-part:#8a6a12; --fc-part-bg:#fbf3df; --fc-miss:#8a4a3f; --fc-miss-bg:#f6ece6;
  --fc-ui:'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fc-read:var(--font-read, var(--read, 'Literata', Georgia, serif));
  position:fixed; inset:0; z-index:10001; display:grid; place-items:center; padding:24px;
  background:rgba(38, 30, 18, .45); font-family:var(--fc-ui); color:var(--fc-ink); animation:svfc-in .2s ease-out;
}
.svfc[hidden]{ display:none; }
body.dark-mode .svfc{
  --fc-page:var(--sv-night-page,#181614); --fc-card:var(--sv-night-card,#23211f); --fc-ink:var(--sv-night-ink,#ece9e4); --fc-sec:var(--sv-night-sec,#b3aea6); --fc-mut:var(--sv-night-mut,#9a948a); --fc-line:var(--sv-night-line,#3a3734);
  --fc-right:#9fd3b4; --fc-right-bg:#1c2f24; --fc-part:#f0d28a; --fc-part-bg:#352b14; --fc-miss:#f0b3a3; --fc-miss-bg:#33231f;
  background:rgba(0, 0, 0, .62);
}
html.svfc-on, html.svfc-on body{ overflow:hidden; }
/* a revision session's clock over the screen (js/focus-time.js #fxmini, at the top of a phone) and its "Time's up" note
   (js/timer.js) stay in view, as they did over Home's old deck; the head makes room for the clock */
body.fc-open #svtimesup, body.fc-open #fxmini{ z-index:10010; }
@media (max-width:640px){ body.fx-cover .svfc-head{ padding-top:calc(3.4rem + env(safe-area-inset-top, 0px)); } }
.svfc:focus{ outline:none; }
.svfc *{ box-sizing:border-box; }
.svfc [hidden]{ display:none !important; }
.svfc-box{ display:flex; flex-direction:column; width:min(560px, 100%); max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px);
  background:var(--fc-page); border-radius:16px; box-shadow:0 30px 70px -25px rgba(0, 0, 0, .5); overflow:hidden; }

/* the head: the title with the count under it, in the middle; the close */
.svfc-head{ flex:none; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:8px;
  padding:10px 12px 8px 16px; border-bottom:1px solid var(--fc-line); }
.svfc-side{ display:flex; min-width:0; }
.svfc-side-r{ justify-content:flex-end; }
.svfc-title{ display:flex; flex-direction:column; align-items:center; text-align:center; line-height:1.25; }
.svfc-title b{ font-size:1.1rem; font-weight:700; }
.svfc-count{ font-size:.95rem; color:var(--fc-mut); font-variant-numeric:tabular-nums; }
.svfc-count:empty{ display:none; }

/* the body: the card, the end, or the choice of cards */
.svfc-body{ flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:16px; display:flex; flex-direction:column; }
.svfc-body > [hidden]{ display:none !important; }
.svfc-card{ display:flex; flex-direction:column; gap:14px; min-height:280px; padding:16px 18px 18px; background:var(--fc-card);
  border:1px solid var(--fc-line); border-radius:12px; }
.svfc-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:8px; margin:-6px -8px -4px 0; }
.svfc-tags{ display:flex; flex-direction:column; gap:2px; padding-top:6px; min-width:0; line-height:1.3; }
.svfc-tag{ font-size:.85rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--fc-mut); }
.svfc-unit{ font-size:.95rem; color:var(--fc-sec); }
.svfc-tag:empty, .svfc-unit:empty{ display:none; }
.svfc-speak.is-speaking{ outline:2px solid currentColor; }
/* the words of a card: the pupil's reading font, a word never broken with a hyphen */
.svfc-q, .svfc-a, .svfc-more, .svfc-lq, .svfc-la{ font-family:var(--fc-read); hyphens:manual; -webkit-hyphens:manual; overflow-wrap:break-word; }
.svfc-q{ font-size:1.45rem; line-height:1.4; color:var(--fc-ink); }
.svfc-q.long{ font-size:1.25rem; }
.svfc-q.xlong{ font-size:1.1rem; line-height:1.5; }
.svfc-gap{ display:inline-block; min-width:2.6em; border-bottom:2px solid currentColor; margin:0 .1em; }
.svfc.showa .svfc-q{ color:var(--fc-sec); }   /* the answer is the news now: the question stays where it was, quieter */
.svfc-back{ display:flex; flex-direction:column; gap:10px; padding-top:12px; border-top:1px solid var(--fc-line); }
.svfc-back, .svfc-tick{ margin-top:auto; }   /* the answer at the foot of the card, just above Not yet and Got it, where the box to type in was */
.svfc-a{ font-size:1.3rem; line-height:1.4; font-weight:600; color:var(--fc-ink); }
.svfc-more{ font-size:1rem; line-height:1.55; color:var(--fc-sec); }
.svfc-verdict{ margin:0; font-size:1rem; line-height:1.4; font-weight:700; }
.svfc-verdict.is-partly{ color:var(--fc-part); }
.svfc-verdict.is-wrong{ color:var(--fc-miss); }
.svfc-verdict.is-off{ font-weight:600; color:var(--fc-sec); }
.svfc-mine{ padding:.6rem .8rem; border-radius:8px; background:color-mix(in srgb, var(--fc-line) 45%, var(--fc-card)); font-size:1rem; line-height:1.45; color:var(--fc-ink); }
.svfc-mine span, .svfc-lw span{ display:block; font-size:.95rem; font-weight:600; color:var(--fc-mut); }
.svfc-appeal{ align-self:flex-start; }
.svfc-tick{ display:flex; align-items:flex-start; gap:12px; padding-top:12px; border-top:1px solid var(--fc-line); }
.svfc-tick-mark{ flex:none; display:grid; place-items:center; width:40px; height:40px; border-radius:50%; background:var(--fc-right-bg); color:var(--fc-right); animation:svfc-tick .35s cubic-bezier(.16, 1, .3, 1); }
.svfc-tick-mark svg{ width:22px; height:22px; }
.svfc-typed{ margin-top:auto; }
.svfc-typed textarea{ display:block; width:100%; resize:none; font-family:var(--fc-ui); font-size:16px; line-height:1.45; padding:.7rem .85rem;
  border:1.5px solid var(--fc-line); border-radius:8px; background:var(--fc-page); color:var(--fc-ink); }
.svfc-typed textarea:focus{ outline:none; border-color:var(--fc-sec); }
.svfc-typed textarea:disabled{ opacity:.6; }

/* the end of the deck: the score in words, the ones to go over */
.svfc-end{ padding:4px 2px 8px; }
.svfc-score{ margin:8px 0 4px; font-family:var(--fc-ui); font-size:1.6rem; line-height:1.3; font-weight:800; letter-spacing:-.01em; text-align:center; color:var(--fc-ink); }   /* a lesson page gives its headings its own font: not here */
.svfc-part{ margin:0; line-height:1.4; text-align:center; color:var(--fc-sec); }
.svfc-sec{ margin:20px 0 8px; font-family:var(--fc-ui); line-height:1.3; font-size:.85rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--fc-mut); }
.svfc-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.svfc-list li{ padding:.75rem .9rem; border:1px solid var(--fc-line); border-radius:10px; background:var(--fc-card); }
.svfc-lq{ margin:0 0 .4rem; font-size:1rem; line-height:1.45; color:var(--fc-sec); }
.svfc-la{ margin:0; display:flex; align-items:flex-start; gap:8px; font-size:1.05rem; line-height:1.4; font-weight:600; }
.svfc-mark{ flex:none; width:18px; height:18px; margin-top:3px; color:var(--fc-right); }
.svfc-mark svg{ width:100%; height:100%; }
.svfc-lw{ margin:.45rem 0 0; font-size:.95rem; line-height:1.4; color:var(--fc-sec); }

/* Choose cards: the subjects as buttons, then the subject's units, one a row */
.svfc-subs{ display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:8px; }   /* the chosen subject is a main button (js/flashcard-screen.js) */
.svfc-units{ display:flex; flex-direction:column; gap:8px; margin-top:16px; }
.svfc-units .svfc-unitbtn{ justify-content:flex-start; text-align:left; }
.svfc-note{ margin:12px 0 0; line-height:1.4; color:var(--fc-sec); }

/* Choose cards (Home): a quiet button under the card, so the title stays in the middle of the head */
.svfc-chooserow{ flex:none; display:flex; justify-content:center; margin-top:12px; }

/* the foot: the action of the moment (a phone: the bar at the foot of the screen) */
.svfc-foot{ flex:none; display:flex; gap:8px; padding:12px 16px; border-top:1px solid var(--fc-line); background:var(--fc-page); }
.svfc-foot .sv-btn{ flex:1 1 0; }
.svfc-foot .sv-quiet{ flex:0 0 auto; }

@media (max-width:600px){
  .svfc{ padding:0; place-items:stretch; background:var(--fc-page); --sv-bar-bg:var(--fc-page); }
  .svfc-box{ width:100%; height:100%; max-height:none; border-radius:0; box-shadow:none; }
  .svfc-head{ min-height:60px; padding:calc(6px + env(safe-area-inset-top, 0px)) 8px 6px 12px; }
  .svfc-body{ padding:12px; }
  .svfc-card{ flex:1 0 auto; }
  .svfc-foot{ padding:8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); border-top:1px solid var(--sv-bar-line); }
}
@keyframes svfc-in{ from{ opacity:0; } }
@keyframes svfc-tick{ from{ transform:scale(.4); opacity:0; } }
@media (prefers-reduced-motion:reduce){ .svfc, .svfc-tick-mark{ animation:none; } }
