/* Flashcard decks (/chinese/flashcards/) — loaded after /css/styles.css.
   Generated pages: deck_builder.py. Behaviour: /assets/js/flashcards.js */
.fc-wrap { max-width: 860px; margin: 0 auto; padding: 26px 20px 0; }
.fc-wrap h1 { font-size: clamp(27px, 4.6vw, 40px); margin-bottom: 10px; }
.fc-wrap h1 .h1-sub { display: block; font-size: .95rem; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-top: 6px; }
.fc-wrap h2 { font-size: 1.35rem; margin-top: 8px; }
.fc-syl { background: var(--bg-soft); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 10px; padding: 10px 14px; font-size: .95rem; margin: 6px 0 18px; }

/* ---------- trainer ---------- */
.fc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px; margin: 0 0 30px; }
.fc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.fc-setpick { font-weight: 700; font-size: .92rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.fc select { font: 600 .92rem 'Nunito', sans-serif; color: var(--ink); background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 8px; max-width: 100%; }
.fc-setpick select { font-weight: 700; }
.fc-progress { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex: 1 1 220px;
  font-weight: 700; font-size: .92rem; color: var(--muted); }
.fc-tally { display: inline-flex; gap: 12px; }
.fc-tally .k, .fc-score .k { color: var(--primary-dark); }
.fc-tally .m, .fc-score .m { color: #c0392b; }
.fc-track { flex: 1 1 100%; height: 6px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.fc-track span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .2s ease; }
.fc-cats { margin: 0 0 12px; }
.fc-cats .chip { font-size: .8rem; padding: 5px 11px; }

.fc-stage { position: relative; perspective: 1400px; }
.fc-card { cursor: pointer; outline: none; border-radius: var(--radius); -webkit-tap-highlight-color: transparent; user-select: none; }
.fc-card:focus-visible .fc-face { box-shadow: 0 0 0 3px rgba(52,168,83,.45); }
.fc-inner { display: grid; transition: transform .45s cubic-bezier(.3,.7,.3,1); transform-style: preserve-3d; }
.fc-card.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { grid-area: 1 / 1; min-height: 300px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius); border: 1px solid var(--border); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 28px 22px; overflow-wrap: anywhere; }
.fc-front { background: linear-gradient(160deg, #ffffff, #f2f8f4); }
.fc-back { background: #fff; transform: rotateY(180deg); justify-content: flex-start; padding-top: 22px; }
@media (prefers-reduced-motion: reduce) { .fc-inner { transition: none; } }

.fc-hz { font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  font-weight: 600; color: var(--ink); line-height: 1.15; }
.fc-hz[lang="zh-Hant"] { font-family: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', sans-serif; }
.fc-front .fc-hz.xl { font-size: clamp(76px, 18vw, 112px); }
.fc-front .fc-hz.l { font-size: clamp(56px, 13vw, 84px); }
.fc-front .fc-hz.m { font-size: clamp(40px, 9vw, 60px); }
.fc-front .fc-hz.s { font-size: clamp(30px, 7vw, 44px); }
.fc-hz-back { font-size: 2.6rem; }
.fc-hz-back.m, .fc-hz-back.s { font-size: 1.9rem; }
.fc-en { font-size: 1.45rem; font-weight: 700; max-width: 32ch; }
.fc-en-big { font-size: 3rem; }
.fc-hint { color: #9aa5b1; font-size: .82rem; font-weight: 600; margin: 18px 0 0; }
.fc-card.flipped .fc-hint { visibility: hidden; }
.fc-py { color: var(--primary-dark); font-size: 1.35rem; font-weight: 800; margin: 6px 0 0; }
.fc-zy { color: var(--muted); font-size: 1.15rem; margin: 2px 0 0; letter-spacing: .04em; }
.fc-def { font-size: 1.1rem; margin: 10px 0 0; max-width: 46ch; }
.fc-ex { margin: 14px 0 0; padding: 10px 14px; background: var(--bg-soft); border-radius: 12px; max-width: 520px; width: 100%; }
.fc-ex p { margin: 0; }
.fc-ex p[lang] { font-size: 1.12rem; }
.fc-ex b { color: var(--primary-dark); }
.fc-ex-zy { font-size: 1.05rem; }
.fc-ex-en { color: var(--muted); font-size: .92rem; margin-top: 2px !important; }
.fc-src { font-size: .82rem; color: var(--muted); margin-top: 6px !important; }
.fc-src a { font-weight: 700; }
.fc-tag { margin-top: 12px; display: inline-block; background: var(--primary-tint); color: var(--primary-dark);
  font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; }

.fc-say { position: absolute; top: 12px; right: 12px; z-index: 3; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; color: var(--primary-dark); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.fc-say:hover, .fc-say.playing { background: var(--primary); color: #fff; border-color: var(--primary); }

.fc-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.fc-btn { font: 800 1rem 'Nunito', sans-serif; padding: 13px 10px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s ease; }
.fc-no { background: #fff5f4; border-color: #f0c2bd; color: #b03a2e; }
.fc-no:hover, .fc-no.on { background: #fbe1de; }
.fc-yes { background: var(--primary-tint); border-color: #a9dbb8; color: var(--primary-dark); }
.fc-yes:hover, .fc-yes.on { background: #d3ecdc; }
.fc-btn kbd, .fc-keys kbd { font: 700 .72rem 'Nunito', sans-serif; border: 1px solid currentColor; border-radius: 5px;
  padding: 0 5px; opacity: .6; }
.fc-nav { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 10px; }
.fc-nb { font: 700 .95rem 'Nunito', sans-serif; padding: 10px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--ink); cursor: pointer; }
.fc-nb:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-dark); }
.fc-nb:disabled { opacity: .45; cursor: default; }
.fc.done .fc-grade, .fc.done .fc-nav, .fc.done .fc-stage { display: none; }

.fc-end { text-align: center; padding: 26px 10px 14px; }
.fc-end h3 { font-size: 1.5rem; margin-bottom: 6px; }
.fc-score { font-weight: 800; font-size: 1.1rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.fc-score .u { color: var(--muted); }
.fc-end-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.fc-end .btn, .fc-list .btn { font: 700 1rem 'Nunito', sans-serif; }
.btn-ghost { background: #fff; color: var(--primary-dark) !important; border: 1.5px solid var(--primary); box-shadow: none; }
.btn-ghost:hover { background: var(--primary-tint); }

.fc-note { margin: 12px 0 0; font-size: .88rem; color: #8a5a00; background: #fff8e6; border: 1px solid #f3e1b0;
  border-radius: 10px; padding: 8px 12px; }
.fc-opts { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 10px; }
.fc-opts summary { cursor: pointer; font-weight: 800; font-size: .92rem; color: var(--muted); }
.fc-optrow { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; }
.fc-optrow label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; font-weight: 800;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fc-optrow .fc-check { flex-direction: row; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0;
  font-size: .92rem; color: var(--ink); align-self: flex-end; padding-bottom: 6px; }
.fc-keys { font-size: .82rem; color: var(--muted); margin: 12px 0 0; }

/* ---------- page sections ---------- */
.fc-about p { font-size: 1.04rem; }
.fc-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.fc-links a { display: inline-block; background: var(--primary-tint); color: var(--primary-dark); font-weight: 700;
  font-size: .9rem; padding: 7px 13px; border-radius: 99px; }
.fc-links a:hover { background: #d3ecdc; }
.fc-how ol { margin: 0 0 24px 22px; }
.fc-how li { margin-bottom: 6px; }
.fc-list { margin: 10px 0 26px; }
.fc-tablewrap { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.fc-table { display: table; width: 100%; font-size: .95rem; }
.fc-table th { background: var(--bg-soft); text-align: left; padding: 9px 12px; border-bottom: 2px solid var(--border); }
.fc-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.fc-table tr:last-child td { border-bottom: none; }
.fc-table td.w { font-size: 1.25rem; white-space: nowrap; }
.fc-table .py { font-weight: 700; color: var(--primary-dark); }
.fc-table .zy, .fc-table .t { display: none; }
.fc-zyl .fc-table .zy { display: block; color: var(--muted); font-size: .88rem; }
.fc-trad .fc-table .t { display: inline; }
.fc-trad .fc-table .s { display: none; }
.fc-faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.fc-faq summary { cursor: pointer; font-weight: 800; }
.fc-faq p { margin: 8px 0 0; }
.fc-more { margin: 30px 0 0; }
.fc-more div { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-more a { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--ink); font-weight: 700; font-size: .9rem; padding: 7px 12px; border-radius: 10px; }
.fc-more a span { color: var(--muted); font-weight: 600; font-size: .8rem; }
.fc-more a:hover { border-color: var(--primary); }

/* ---------- hub ---------- */
.fc-hub-group { margin: 34px 0 0; }
.fc-hub-group + .fc-how { margin-top: 36px; }
.fc-hub-group > p { color: var(--muted); }
.fc-hub-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.fc-hub-grid li { display: flex; flex-direction: column; }
.fc-hub-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px;
  align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-sm); color: var(--ink); transition: border-color .15s ease, transform .15s ease; }
.fc-hub-card:hover { border-color: var(--primary); transform: translateY(-2px); color: var(--ink); }
.fc-hub-zh { grid-row: 1 / 3; white-space: nowrap; font-size: 1.9rem; font-weight: 600; color: var(--primary-dark); min-width: 1.6em; text-align: center; }
.fc-hub-name { font-weight: 800; line-height: 1.25; }
.fc-hub-count { color: var(--muted); font-size: .85rem; font-weight: 700; }
.fc-hub-sub { font-size: .82rem; color: var(--muted); padding: 5px 4px 0; }

@media (max-width: 600px) {
  .fc-wrap { padding-top: 18px; }
  .fc { padding: 12px; margin-left: -6px; margin-right: -6px; }
  .fc-face { min-height: 270px; padding: 24px 14px; }
  .fc-optrow label { flex: 1 1 40%; }
  .fc-optrow select { width: 100%; }
  .fc-keys { display: none; }
  .fc-btn kbd { display: none; }
  .fc-setpick { flex: 1 1 100%; }
  .fc-setpick select { flex: 1; }
  .fc-hub-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fc-hub-card { grid-template-columns: 1fr; padding: 10px 12px; }
  .fc-hub-zh { grid-row: auto; text-align: left; font-size: 1.5rem; line-height: 1.3; }
  .fc-table td.w { font-size: 1.1rem; }
}
@media (hover: none) { .fc-keys { display: none; } }
@media print {
  header, footer, .fc, .cta-box, .fc-more, .fc-links, #fc-showlist { display: none !important; }
}
.fc-swipe { display: none; font-size: .82rem; color: var(--muted); margin: 12px 0 0; }
@media (hover: none) { .fc-swipe { display: block; } }
