/* File: public/css/flashcards.css -- flashcard player, listing cards and A4 print sheets */
.fc-app, .fc-sheet, .fcl-card { --ink:#0B2545; }
/* ============ card faces (shared by the player, the grid and the print sheets; sized by --u, one hundredth of the card width) ============ */
.fcf { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:calc(var(--u)*2.4);
  padding:calc(var(--u)*7) calc(var(--u)*6) calc(var(--u)*8.5); border-radius:calc(var(--u)*6); overflow:hidden; text-align:center; box-sizing:border-box;
  font-family:'Fredoka','Nunito','Andika','Segoe UI',system-ui,sans-serif; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.fcf.front { color:#fff; background:
  radial-gradient(circle at 88% 10%, rgba(255,255,255,.30) 0 13%, transparent 13.5%),
  radial-gradient(circle at 6% 94%, rgba(255,255,255,.20) 0 19%, transparent 19.5%),
  radial-gradient(circle at 96% 80%, rgba(255,255,255,.12) 0 9%, transparent 9.5%),
  linear-gradient(145deg, var(--c1), var(--c2)); }
.fcf.back { color:var(--ink); background:
  radial-gradient(circle, var(--soft) 22%, transparent 23%) 0 0 / calc(var(--u)*7) calc(var(--u)*7), #fff;
  border:calc(var(--u)*1.6) solid var(--c1); padding:calc(var(--u)*6.4) calc(var(--u)*5.4) calc(var(--u)*7.4); }
.fcf-pic { width:calc(var(--u)*31); height:calc(var(--u)*31); border-radius:50%; display:grid; place-items:center; flex:none; background:rgba(255,255,255,.96);
  box-shadow:0 calc(var(--u)*1.2) calc(var(--u)*3.4) rgba(0,0,0,.20); font-size:calc(var(--u)*18); line-height:1; overflow:hidden; }
.fcf.back .fcf-pic { background:var(--soft); box-shadow:none; }
.fcf-pic.big { width:calc(var(--u)*50); height:calc(var(--u)*50); font-size:calc(var(--u)*30); }
.fcf-pic img { width:82%; height:82%; object-fit:contain; }
.fcf-text { font-weight:600; line-height:1.12; font-size:calc(var(--u)*12*var(--k,1)); max-width:100%; overflow-wrap:anywhere; letter-spacing:.01em; }
.fcf.front .fcf-text { text-shadow:0 calc(var(--u)*.6) calc(var(--u)*1.6) rgba(0,0,0,.22); }
.fcf.notext .fcf-pic { width:calc(var(--u)*52); height:calc(var(--u)*52); font-size:calc(var(--u)*32); }
.fcf.nopic .fcf-text { font-size:calc(var(--u)*22*var(--k,1)); }
.fcf.back .fcf-text { color:var(--accent); }
.fcf-hint { font-size:calc(var(--u)*4.4); color:#4b5d78; font-weight:500; max-width:92%; line-height:1.25; }
.fcf-hint::before { content:'\1F4A1 '; }
.fcf-tag { position:absolute; top:calc(var(--u)*3.6); left:calc(var(--u)*4); font-size:calc(var(--u)*3.8); font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  padding:calc(var(--u)*.8) calc(var(--u)*2.6); border-radius:99px; background:rgba(255,255,255,.26); color:#fff; }
.fcf.back .fcf-tag { background:var(--soft); color:var(--accent); }
.fcf-num { position:absolute; right:calc(var(--u)*4.4); bottom:calc(var(--u)*3.2); font-size:calc(var(--u)*3.8); font-weight:600; opacity:.8; }
.fcf-brand { position:absolute; left:calc(var(--u)*4.4); bottom:calc(var(--u)*3.2); font-size:calc(var(--u)*3.4); font-weight:600; opacity:.7; letter-spacing:.02em; }
.fc-nobrand .fcf-brand { display:none; }
.fcf-say { position:absolute; top:calc(var(--u)*3); right:calc(var(--u)*3.4); width:calc(var(--u)*10); height:calc(var(--u)*10); min-width:30px; min-height:30px; border-radius:50%; border:0; cursor:pointer;
  background:rgba(255,255,255,.28); color:inherit; font-size:calc(var(--u)*5); display:grid; place-items:center; padding:0; }
.fcf.back .fcf-say { background:var(--soft); }
.fcf-say:hover { filter:brightness(1.08); transform:scale(1.06); }

/* ============ player ============ */
.fc-app { --u:6px; background:linear-gradient(180deg, var(--soft), #fff 70%); border:1px solid var(--border,#E2E8F0); border-radius:20px; padding:16px; margin-bottom:24px; }
.fc-app:fullscreen { background:linear-gradient(180deg, var(--soft), #fff); overflow:auto; padding:24px; display:flex; flex-direction:column; justify-content:center; }
.fc-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; margin-bottom:14px; }
.fc-tabs { display:flex; gap:6px; background:#fff; padding:4px; border-radius:99px; box-shadow:0 1px 3px rgba(11,37,69,.12); }
.fc-tab { border:0; background:transparent; font:600 14px var(--font); padding:8px 16px; border-radius:99px; cursor:pointer; color:#4b5d78; }
.fc-tab.on { background:linear-gradient(135deg,var(--c1),var(--c2)); color:#fff; box-shadow:0 2px 8px rgba(11,37,69,.25); }
.fc-tools { display:flex; gap:6px; flex-wrap:wrap; }
.fc-ib { border:1px solid var(--border,#E2E8F0); background:#fff; border-radius:99px; font:600 13px var(--font); padding:7px 12px; cursor:pointer; color:var(--ink); display:inline-flex; align-items:center; gap:6px; }
.fc-ib:hover { border-color:var(--c1); }
.fc-ib.on { background:var(--soft); border-color:var(--c1); color:var(--accent); }
.fc-progress { display:flex; align-items:center; gap:12px; margin:0 auto 14px; max-width:680px; }
.fc-bar { flex:1; height:10px; border-radius:99px; background:#E4EAF3; overflow:hidden; }
.fc-bar i { display:block; height:100%; width:0; border-radius:99px; background:linear-gradient(90deg,var(--c1),var(--c2)); transition:width .35s; }
.fc-pos { font:700 14px var(--font); color:var(--ink); min-width:64px; text-align:right; }
.fc-stage { display:flex; align-items:center; justify-content:center; gap:10px; }
.fc-nav { width:46px; height:46px; border-radius:50%; border:0; cursor:pointer; flex:none; font-size:20px; color:#fff; background:linear-gradient(135deg,var(--c1),var(--c2)); box-shadow:0 3px 10px rgba(11,37,69,.28); }
.fc-nav:disabled { opacity:.35; cursor:default; }
.fc-card { perspective:1600px; width:min(100%,680px); aspect-ratio:4/3; position:relative; cursor:pointer; outline:none; -webkit-tap-highlight-color:transparent; }
.fc-card:focus-visible { box-shadow:0 0 0 4px rgba(20,184,166,.5); border-radius:24px; }
.fc-inner { position:absolute; inset:0; transform-style:preserve-3d; transition:transform .6s cubic-bezier(.3,.7,.2,1); }
.fc-card.flipped .fc-inner { transform:rotateY(180deg); }
.fc-inner .fcf { backface-visibility:hidden; -webkit-backface-visibility:hidden; box-shadow:0 14px 34px rgba(11,37,69,.22); }
.fc-inner .fcf.back { transform:rotateY(180deg); }
.fc-card.slide-l { animation:fcSlideL .32s ease; } .fc-card.slide-r { animation:fcSlideR .32s ease; }
@keyframes fcSlideL { from { transform:translateX(40px); opacity:0; } to { transform:none; opacity:1; } }
@keyframes fcSlideR { from { transform:translateX(-40px); opacity:0; } to { transform:none; opacity:1; } }
.fc-actions { display:flex; gap:10px; justify-content:center; margin-top:16px; flex-wrap:wrap; }
.fc-act { border:0; border-radius:99px; font:700 15px var(--font); padding:11px 22px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; }
.fc-act.no { background:#FFE9E3; color:#B3361A; } .fc-act.yes { background:#DCF7EC; color:#0B7A57; } .fc-act.flip { background:var(--ink); color:#fff; }
.fc-act b { background:rgba(0,0,0,.1); border-radius:99px; padding:1px 8px; font-size:13px; }
.fc-hintline { text-align:center; color:var(--muted,#64748b); font-size:13px; margin:12px 0 0; }
.fc-done { position:absolute; inset:0; z-index:5; display:none; align-items:center; justify-content:center; background:rgba(255,255,255,.92); border-radius:20px; text-align:center; padding:20px; }
.fc-done.on { display:flex; }
.fc-done h3 { font:700 30px 'Fredoka',var(--font); margin:0 0 6px; color:var(--accent); } .fc-done p { margin:0 0 16px; color:#4b5d78; }
.fc-panelwrap { position:relative; }
.fc-panel { display:none; } .fc-panel.on { display:block; }
/* all-cards grid */
.fc-gridcards { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:14px; }
.fc-mini { --u:2.1px; position:relative; aspect-ratio:4/3; perspective:900px; cursor:pointer; }
.fc-mini .fc-inner { transition-duration:.5s; }
.fc-mini.flipped .fc-inner { transform:rotateY(180deg); }
.fc-mini .fcf-say, .fc-mini .fcf-tag { display:none; }
.fc-mini .fcf.known::after { content:'\2713'; position:absolute; top:6px; right:8px; background:#12936B; color:#fff; width:20px; height:20px; border-radius:50%; font:700 12px/20px var(--font); }
/* print panel */
.fc-printbox { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:22px; align-items:start; }
.fc-printbox h4 { margin:0 0 8px; font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted,#64748b); }
.fc-pp { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.fc-pp button { width:84px; border:2px solid var(--border,#E2E8F0); background:#fff; border-radius:14px; padding:8px 6px 6px; cursor:pointer; font:700 13px var(--font); color:var(--ink); text-align:center; }
.fc-pp button.on { border-color:var(--c1); background:var(--soft); color:var(--accent); box-shadow:0 0 0 3px rgba(11,37,69,.06); }
.fc-pp .ico { display:grid; width:34px; height:46px; margin:0 auto 5px; gap:2px; padding:2px; background:#fff; border:1px solid #C8D2E0; border-radius:3px; grid-template-columns:repeat(var(--cc),1fr); grid-template-rows:repeat(var(--rr),1fr); }
.fc-pp .ico i { background:linear-gradient(135deg,var(--c1),var(--c2)); border-radius:2px; }
.fc-pp small { display:block; font-weight:500; font-size:11px; color:#64748b; }
.fc-opts { display:grid; gap:8px; margin-bottom:16px; }
.fc-opts label { display:flex !important; gap:9px; align-items:flex-start; justify-content:flex-start; font-size:14px; cursor:pointer; line-height:1.35; width:auto; margin:0; text-align:left; font-weight:500; }
.fc-opts label span { flex:1 1 auto; text-align:left; }
.fc-opts label span small { display:block; color:#64748b; font-size:12.5px; }
.fc-opts input[type=radio], .fc-opts input[type=checkbox] { width:18px !important; height:18px; flex:none; margin:1px 0 0; padding:0; accent-color:var(--c1); }
.fc-printgo { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.fc-printgo .meta { color:#4b5d78; font-size:13.5px; }
.fc-prevwrap { background:#EEF2F8; border-radius:14px; padding:12px; text-align:center; }
.fc-prevtabs { display:flex; gap:6px; justify-content:center; margin-bottom:10px; }
.fc-prevtabs button { border:0; background:#fff; font:700 12px var(--font); padding:5px 12px; border-radius:99px; cursor:pointer; }
.fc-prevtabs button.on { background:var(--ink); color:#fff; }
.fc-prevbox { width:285px; height:403px; margin:0 auto; background:#fff; box-shadow:0 6px 18px rgba(11,37,69,.25); overflow:hidden; position:relative; max-width:100%; }
.fc-prevbox .fc-sheet { transform:scale(var(--ps,.36)); transform-origin:0 0; position:absolute; top:0; left:0; }
.fc-prevcap { font-size:12px; color:#64748b; margin:8px 0 0; }
@media (max-width:820px) { .fc-printbox { grid-template-columns:1fr; } .fc-card { width:100%; } .fc-nav { width:38px; height:38px; font-size:16px; } .fc-stage { gap:6px; } .fc-app { padding:12px; } }

/* ============ A4 print sheets (also used scaled for the preview) ============ */
.fc-sheet { width:210mm; height:297mm; box-sizing:border-box; padding:8mm; display:grid; background:#fff; overflow:hidden;
  grid-template-columns:repeat(var(--cols),1fr); grid-template-rows:repeat(var(--rows),1fr); page-break-after:always; break-after:page; }
.fc-sheet:last-child { page-break-after:auto; break-after:auto; }
.fc-cell { position:relative; padding:1.6mm; box-sizing:border-box; }
.fc-cut .fc-cell { outline:.25mm dashed #9aa6b8; outline-offset:-.1mm; }
.fc-pcard { position:relative; width:100%; height:100%; }
#fc-print-root { display:none; }
@media print {
  @page { size:A4 portrait; margin:0; }
  html, body { background:#fff !important; margin:0 !important; padding:0 !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  body.fc-printing > *:not(#fc-print-root) { display:none !important; }
  body.fc-printing #fc-print-root { display:block; }
  .fc-sheet { width:210mm; height:297mm; }
}

/* ============ listing cards ============ */
.fcl-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:20px; }
.fcl-card { display:block; text-decoration:none; color:var(--ink); background:#fff; border:1px solid var(--border,#E2E8F0); border-radius:18px; overflow:hidden; transition:transform .18s, box-shadow .18s; }
.fcl-card:hover { transform:translateY(-4px); box-shadow:0 14px 30px rgba(11,37,69,.16); }
.fcl-media { position:relative; height:158px; background:var(--soft); display:grid; place-items:center; overflow:hidden; }
.fcl-stack { position:absolute; width:62%; height:68%; border-radius:16px; background:linear-gradient(145deg,var(--c1),var(--c2)); opacity:.35; }
.fcl-s3 { transform:rotate(-9deg) translateX(-18px); } .fcl-s2 { transform:rotate(7deg) translateX(14px); opacity:.55; }
.fcl-face { position:relative; width:62%; height:68%; border-radius:16px; display:grid; place-items:center; color:#fff; font-size:56px; line-height:1; overflow:hidden;
  background:radial-gradient(circle at 85% 12%, rgba(255,255,255,.3) 0 14%, transparent 14.5%), linear-gradient(145deg,var(--c1),var(--c2)); box-shadow:0 8px 18px rgba(11,37,69,.25); }
.fcl-face b { font-weight:600; font-family:'Fredoka',var(--font); } .fcl-face img { width:100%; height:100%; object-fit:cover; }
.fcl-count { position:absolute; left:10px; bottom:10px; background:#fff; color:var(--ink); font:700 12px var(--font); padding:4px 10px; border-radius:99px; box-shadow:0 1px 4px rgba(11,37,69,.18); }
.fcl-body { padding:12px 14px 14px; }
.fcl-title { margin:0 0 4px; font-weight:700; font-size:15.5px; line-height:1.3; }
.fcl-sub { margin:0; color:#64748b; font-size:12.5px; }
.fcl-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.fcl-section-head a { font-weight:600; font-size:14px; }
.fcl-hero { background:linear-gradient(135deg,#0B2545,#1B4FD8 60%,#14B8A6); color:#fff; border-radius:20px; padding:30px 28px; margin-bottom:24px; position:relative; overflow:hidden; }
.fcl-hero h1 { color:#fff; margin:0 0 8px; } .fcl-hero p { margin:0; max-width:640px; opacity:.92; }
.fcl-hero::after { content:'\1F0CF'; position:absolute; right:24px; top:-10px; font-size:130px; opacity:.16; transform:rotate(12deg); }
.fcl-filter { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 18px; }
.fcl-filter input[type=search] { flex:1; min-width:220px; max-width:360px; }
.fcl-chip { text-decoration:none; font:600 13px var(--font); padding:7px 14px; border-radius:99px; border:1px solid var(--border,#E2E8F0); color:var(--ink); background:#fff; }
.fcl-chip.on { background:var(--ink); color:#fff; border-color:var(--ink); }
.fcs-ico { width:64px; height:36px; border-radius:8px; display:grid; place-items:center; font-size:20px; flex-shrink:0; }
.fc-cardtable { width:100%; border-collapse:collapse; font-size:14px; } .fc-cardtable th, .fc-cardtable td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--border,#E2E8F0); vertical-align:top; }
.fc-cardtable th { font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted,#64748b); }
.fc-section-cards { margin-top:24px; }