/* Flashcards (js/flashcards.js). Uses the colour variables of style.css, so the dark theme works without extra rules. */
.fc{max-width:720px;margin:0 auto}
.fc h1{margin-bottom:6px}
.fc h2{margin:26px 0 10px}
.fc .sub{color:var(--muted)}
.fc-top{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:0 0 10px}
.fc-count{font-weight:700;margin-left:auto}
.fc-top .fc-count+.fc-tabs{margin-left:0}
.fc-pick{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;margin:14px 0}
.fc-pick label{font-size:.92rem;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.fc select{font:inherit;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--ink);max-width:100%}
.fc-tabs{display:inline-flex;border:1px solid var(--line);border-radius:99px;overflow:hidden}
.fc-tabs button{font:inherit;font-size:.9rem;background:var(--card);color:var(--ink);border:0;padding:7px 16px;cursor:pointer}
.fc-tabs button.on{background:var(--green);color:#fff;font-weight:700}
.fc-tabs.small button{font-size:.8rem;padding:5px 11px}
.fc-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:16px 0}
.fc-stats div{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px 8px;text-align:center}
.fc-stats b{display:block;font-size:1.7rem;line-height:1.1}
.fc-stats span{font-size:.8rem;color:var(--muted)}
.fc-stats .hot{border-color:var(--amber);background:rgba(249,171,0,.12)}
.fc-boxes{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;height:96px;align-items:end;margin:0 0 6px}
.fc-boxes div{position:relative;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;font-size:.75rem;color:var(--muted)}
.fc-boxes i{display:block;width:100%;min-height:3px;background:var(--green);border-radius:5px 5px 0 0;opacity:.75}
.fc-boxes span{position:absolute;top:0;font-weight:700;color:var(--ink)}
.fc-actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.fc-actions.two .btn{flex:1;padding:14px}
.fc-actions .btn.bad{background:var(--red)}
.fc-actions small,.fc-fb small{opacity:.75;font-weight:400}
.fc-note{font-size:.85rem;color:var(--muted);margin:0}
.fc-bar{height:7px;border-radius:99px;background:var(--line);overflow:hidden;margin-bottom:14px}
.fc-bar i{display:block;height:100%;background:var(--green);transition:width .25s}
/* the card */
.fc-card{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:0 2px 10px rgba(0,0,0,.06);min-height:260px;display:flex;align-items:center;justify-content:center;padding:26px 20px;text-align:center;cursor:pointer;outline-offset:3px;animation:fcin .18s ease-out}
.fc-card.flipped{cursor:default;align-items:flex-start;animation:none}
.fc-card.q{cursor:default;min-height:170px}
@keyframes fcin{from{opacity:.4;transform:scale(.98)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.fc-card{animation:none}}
.fc-face{width:100%}
.fc-front{font-size:2.3rem;font-weight:600;line-height:1.3;word-break:break-word}
.fc-front.big{font-size:5.5rem;line-height:1.1}
.fc-ja .fc-front,.fc-ja .fc-ex p:first-child{font-family:"Hiragino Sans","Yu Gothic","Noto Sans JP","Noto Sans CJK JP","Meiryo",system-ui,sans-serif}
.fc-reading{font-size:1.7rem;font-weight:600;color:var(--green-d)}
.fc-meaning{font-size:1.25rem;margin:6px 0}
.fc-meaning.big{font-size:1.9rem;font-weight:600}
.fc-hint{color:var(--muted);font-size:.9rem;margin-top:8px}
.fc-row{margin:2px 0;font-size:.95rem}.fc-row span{color:var(--muted)}
.fc-notetxt{font-size:.9rem;color:var(--muted);margin:6px 0}
.fc-ex{text-align:left;margin:14px 0 0;padding:10px 14px;background:var(--bg);border-radius:10px;font-size:.95rem}
.fc-ex b{display:block;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:4px}
.fc-ex p{margin:3px 0}
.fc-ex .fc-mean,.fc-mean{color:var(--muted);font-size:.9rem}
.fc-rd{color:var(--green-d)}
.fc-say{font-size:1.05rem;line-height:1;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:99px;width:34px;height:34px;cursor:pointer;vertical-align:middle;margin-left:6px}
.fc-say:hover{background:var(--green-l)}
.fc-front+.fc-say{display:block;margin:10px auto 0;width:44px;height:44px;font-size:1.3rem}
.fc-face>.fc-say{margin:10px auto 0;display:block}
.fc-stroke{font-size:.85rem;padding:6px 14px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--ink);cursor:pointer}
/* test */
.fc-opts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}
.fc-opt{font:inherit;font-size:1.1rem;text-align:left;background:var(--card);color:var(--ink);border:2px solid var(--line);border-radius:12px;padding:14px;cursor:pointer;min-height:56px}
.fc-opt:hover:not(:disabled){border-color:var(--green)}
.fc-opt .k{display:inline-block;width:1.5em;height:1.5em;line-height:1.5em;text-align:center;border-radius:6px;background:var(--bg);font-size:.8rem;margin-right:6px;color:var(--muted)}
.fc-opt.right{border-color:var(--green);background:var(--green-l)}
.fc-opt.wrong{border-color:var(--red);background:var(--red-l)}
.fc-opt:disabled{cursor:default;color:var(--ink)}
.fc-ja .fc-opts .fc-opt{font-family:"Hiragino Sans","Yu Gothic","Noto Sans JP","Noto Sans CJK JP","Meiryo",system-ui,sans-serif}
.fc-type{display:flex;gap:10px;margin:14px 0}
.fc-type input{flex:1;font:inherit;font-size:1.3rem;padding:12px 14px;border:2px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);min-width:0}
.fc-fb{margin:10px 0}
.fc-fb .good{color:var(--green-d);font-weight:700;margin:0 0 4px}
.fc-fb .bad{color:var(--red);font-weight:700;margin:0 0 4px}
.fc-fb .btn{margin:8px 8px 0 0}
@media(max-width:560px){
  .fc-front.big{font-size:4.2rem}
  .fc-front{font-size:1.9rem}
  .fc-stats{grid-template-columns:repeat(2,1fr)}
  .fc-opts{grid-template-columns:1fr}
  .fc-card{min-height:220px;padding:20px 14px}
  .fc-count{margin-left:0}
  .fc-actions .btn{flex:1 1 100%}
  .fc-pick label{width:100%}.fc-pick select{flex:1}
}
/* course page: module card button and the due badge in the course bar */
.fc-badge{display:inline-block;min-width:1.4em;padding:0 6px;margin-left:5px;border-radius:99px;background:var(--amber);color:#1f2a24;font-size:.72rem;font-weight:700;text-align:center;line-height:1.5}
.fc-modlink{font-size:.85rem;color:var(--green-d);text-decoration:none;align-self:flex-start}
.fc-modlink:hover{text-decoration:underline}
/* personal cards */
.fc-addform{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0}
.fc-addform input{font:inherit;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--ink);min-width:0}
.fc-addform input[name=n]{grid-column:1/-1}
.fc-mylist{list-style:none;margin:10px 0 0;padding:0;max-height:260px;overflow:auto;border:1px solid var(--line);border-radius:10px}
.fc-mylist li{display:flex;justify-content:space-between;gap:10px;padding:8px 12px;border-bottom:1px solid var(--line);font-size:.92rem}
.fc-mylist li:last-child{border:0}
.fc-mylist em{color:var(--muted)}
@media(max-width:560px){.fc-addform{grid-template-columns:1fr}.fc-addform .btn{width:100%}}

/* add a card from a lesson */
.fc-modal{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:1000;display:flex;align-items:center;justify-content:center;padding:14px}
.fc-dialog{background:var(--card);color:var(--ink);border-radius:16px;padding:20px;max-width:520px;width:100%;max-height:92vh;overflow:auto;box-shadow:0 10px 40px rgba(0,0,0,.35)}
.fc-dialog h2{margin:0 0 10px}
.fc-dialog label{display:block;font-size:.82rem;color:var(--muted);margin:8px 0 0}
.fc-dialog input{display:block;width:100%;font:inherit;font-size:1rem;color:var(--ink);padding:9px 11px;border:1px solid var(--line);border-radius:9px;background:var(--bg);margin-top:3px}
.fc-bubble{position:fixed;z-index:999;background:var(--green);color:#fff;border:0;border-radius:99px;padding:8px 14px;font:inherit;font-weight:700;font-size:.9rem;box-shadow:0 3px 12px rgba(0,0,0,.3);cursor:pointer}
#fc-cardmode.on{background:var(--green);color:#fff;border-color:var(--green)}
body.fc-cardmode #body button[onclick*="say("],body.fc-cardmode #body .kbtn{outline:2px dashed var(--green);outline-offset:2px;cursor:copy}
.fc-src{font-size:.85rem;color:var(--muted);margin:8px 0 0}
.fc-srcs{color:var(--muted)}
.fc-pickbox{font-size:1.5rem;line-height:1.7;padding:14px;margin:10px 0;border:1px dashed var(--green);border-radius:12px;background:var(--bg);user-select:text;-webkit-user-select:text;word-break:break-word}
.fc-pickbox::selection{background:var(--green);color:#fff}
.fc-ja .fc-pickbox{font-family:"Hiragino Sans","Yu Gothic","Noto Sans JP","Meiryo",system-ui,sans-serif}
/* the voiced words and sentences of a lesson are buttons: let the learner select a part of them (the "+ My card" bubble) */
body.fc-sel #body button[onclick*="say("]{user-select:text;-webkit-user-select:text}
