/* =========================================================
   SubelJapan — Thẻ ghi nhớ (flashcards)
   giấy washi mềm, chồng thẻ có chiều sâu, lật 3D lò xo, vuốt có con dấu
   ========================================================= */
@property --ok { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --no { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --q { syntax: '<number>'; inherits: false; initial-value: 0; }

.fc-page, .fc-session, .fc-result, .fc-empty {
  --paper: color-mix(in srgb, var(--card) 94%, #ffe7d9);
  --grain:
    radial-gradient(circle at 20% 30%, rgba(120, 86, 110, .035) 0 .6px, transparent 1.2px) 0 0 / 5px 7px,
    radial-gradient(circle at 60% 70%, rgba(120, 86, 110, .045) 0 .55px, transparent 1.1px) 2px 3px / 11px 13px,
    radial-gradient(circle at 40% 50%, rgba(214, 120, 150, .055) 0 .9px, transparent 1.6px) 7px 1px / 17px 23px,
    radial-gradient(circle at 50% 50%, rgba(150, 110, 90, .04) 0 1.1px, transparent 2px) 13px 5px / 29px 31px;
  --fc-r: 28px;
}
[data-dark] :is(.fc-page, .fc-session, .fc-result, .fc-empty) { --paper: var(--card2); }

/* =========================================================
   TRANG CHỌN BỘ
   ========================================================= */
.fc-page { padding-bottom: 12px; }
.fc-page .section-label small { margin-left: 2px; }

/* --- thẻ đến hạn --- */
.fc-due {
  position: relative; display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: var(--r-xl); overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .8) 0 3px, transparent 4px),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, .7) 0 4px, transparent 5px),
    radial-gradient(circle at 62% 14%, rgba(255, 255, 255, .6) 0 2.5px, transparent 3.5px),
    linear-gradient(120deg, color-mix(in srgb, var(--lav) 16%, var(--card)), color-mix(in srgb, var(--pri) 11%, var(--card)));
  border-color: color-mix(in srgb, var(--lav) 22%, var(--line));
}
.fc-due.calm { background: linear-gradient(120deg, color-mix(in srgb, var(--mint) 12%, var(--card)), color-mix(in srgb, var(--sky) 9%, var(--card))); border-color: color-mix(in srgb, var(--mint) 22%, var(--line)); }
.fc-due-art { position: relative; flex: none; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 30px; background: var(--card); box-shadow: var(--sh-1); }
.fc-due-art .ic { transform: rotate(-4deg); }
.fc-due-dot { position: absolute; top: -6px; right: -8px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px; background: var(--red); color: #fff; font: 900 14px/30px var(--f-body); font-style: normal; text-align: center; box-shadow: 0 0 0 3px var(--card), 0 6px 12px -6px var(--red); }
.fc-due-txt { display: flex; flex-direction: column; gap: 2px; }
.fc-due-txt > b { font: 800 22px/1.15 var(--f-head); }
.fc-due-p { color: var(--ink2); font-weight: 700; }
.fc-due-p b { color: var(--ink); }
.fc-kicker { display: inline-flex; align-items: center; gap: 5px; font: 900 11.5px var(--f-body); text-transform: uppercase; letter-spacing: 1.2px; color: var(--lav-t); }
.fc-due.calm .fc-kicker { color: var(--mint-t); }
.fc-due-go { flex: none; }
.fc-due-mochi { flex: none; margin-right: 4px; }

/* --- tuỳ chọn --- */
.fc-opts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px; margin-top: 14px; padding: 12px 18px; border-radius: 22px; container-type: inline-size; }
.fc-opt span { display: inline-flex; align-items: center; gap: 6px; font: 800 14.5px var(--f-body); color: var(--ink); }
.fc-opt .gl { color: var(--pri-t); }
.fc-size { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.fc-size-l { font: 800 13.5px var(--f-body); color: var(--ink2); }
.fc-size .seg button { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
@container (max-width: 700px) {
  .fc-size { margin-left: 0; width: 100%; justify-content: space-between; padding-top: 10px; border-top: 1.5px dashed var(--line); }
}

/* --- lưới bộ thẻ --- */
.fc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 14px; }
.fc-deck {
  --tc: var(--pri); position: relative; display: flex; flex-direction: column; padding: 9px 9px 14px; border-radius: 24px; color: var(--ink);
  transition: transform .45s var(--spring), box-shadow .25s, border-color .25s;
}
.fc-deck:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--tc) 38%, var(--line)); }
.fc-deck:active { transform: translateY(-1px) scale(.97); box-shadow: var(--sh-1); transition-duration: .12s; }
.fc-deck:focus-visible { outline: 3px solid color-mix(in srgb, var(--tc) 70%, var(--sky)); outline-offset: 3px; border-radius: 24px; }

.fd-art {
  position: relative; display: block; height: 112px; border-radius: 17px; overflow: hidden;
  background:
    radial-gradient(circle at 14% 24%, rgba(255, 255, 255, .8) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 86% 20%, rgba(255, 255, 255, .7) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 84%, rgba(255, 255, 255, .6) 0 3.5px, transparent 4.5px),
    radial-gradient(circle at 22% 86%, rgba(255, 255, 255, .5) 0 2px, transparent 3px),
    color-mix(in srgb, var(--tc) 17%, var(--card));
}
.fd-sheet {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 82px; margin: -43px 0 0 -32px; border-radius: 12px;
  background: var(--grain), var(--paper); border: 1.5px solid color-mix(in srgb, var(--tc) 30%, var(--line));
  box-shadow: 0 1px 1px rgba(58, 46, 77, .05), 0 8px 14px -8px rgba(58, 46, 77, .4);
  transition: transform .55s var(--spring);
}
.fd-sheet.s3 { transform: translate(-17px, 7px) rotate(-14deg); background: color-mix(in srgb, var(--tc) 34%, var(--card)); }
.fd-sheet.s2 { transform: translate(16px, 5px) rotate(11deg); background: color-mix(in srgb, var(--tc) 14%, var(--paper)); }
.fd-sheet.s1 { display: grid; place-items: center; transform: rotate(-2deg); }
.fd-sheet.s1::before { content: ""; position: absolute; inset: 4px; border-radius: 8px; border: 1.2px dashed color-mix(in srgb, var(--tc) 35%, transparent); }
.fc-deck:hover .fd-sheet.s3 { transform: translate(-29px, 9px) rotate(-21deg); }
.fc-deck:hover .fd-sheet.s2 { transform: translate(28px, 6px) rotate(17deg); }
.fc-deck:hover .fd-sheet.s1 { transform: translateY(-5px) rotate(2deg); }
.fd-glyph { position: relative; font-size: 42px; line-height: 1; color: var(--ink); }
.fd-ico { position: relative; display: grid; place-items: center; }
.fd-ico .ic { width: 46px; height: 46px; }
.fd-sticker { position: absolute; right: 9px; bottom: 7px; transform: rotate(10deg); transition: transform .55s var(--spring); filter: drop-shadow(0 3px 3px rgba(58, 46, 77, .16)); }
.fc-deck:hover .fd-sticker { transform: rotate(-8deg) scale(1.14); }
.fd-hanko {
  position: absolute; left: 9px; top: 9px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2.2px solid #e24a4a; color: #e24a4a; font-size: 15px; line-height: 1; transform: rotate(-14deg);
  background: rgba(255, 255, 255, .72); box-shadow: inset 0 0 0 1.6px rgba(255, 255, 255, .7), inset 0 0 0 2.8px #e24a4a;
}
.fd-body { display: flex; flex-direction: column; gap: 1px; padding: 11px 6px 0; min-width: 0; }
.fd-title { font: 800 16px/1.2 var(--f-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-sub { font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px; font: 800 12px var(--f-body); color: var(--ink2); }
.fd-known { display: inline-flex; align-items: center; gap: 3px; color: var(--mint-t); white-space: nowrap; }
.fd-known.none { color: var(--ink3); }
.fd-bar { position: relative; display: block; height: 7px; margin-top: 6px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.fd-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--mint); }
.fc-deck.done .fd-bar i { background: linear-gradient(90deg, var(--mint), color-mix(in srgb, var(--mint) 60%, var(--sun))); }

.view-in .fc-grid > * { animation: viewIn .5s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: calc(min(var(--i, 0), 8) * .035s); }

/* =========================================================
   PHIÊN HỌC
   ========================================================= */
.fc-session {
  --tc: var(--pri); --ch: clamp(300px, calc(100dvh - 292px), 470px);
  position: relative; display: flex; flex-direction: column; max-width: 560px; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); user-select: none; -webkit-user-select: none;
}
.fc-session::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 380px at 12% 18%, color-mix(in srgb, var(--tc) 13%, transparent), transparent 70%),
    radial-gradient(520px 420px at 88% 88%, color-mix(in srgb, var(--sun) 12%, transparent), transparent 70%);
}
.fc-top { display: flex; align-items: center; gap: 12px; }
.fc-topmid { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fc-deckname { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; font: 800 13.5px var(--f-body); color: var(--ink2); }
.fc-deckname .ic { width: 22px; height: 22px; }
.fc-deckname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-prog { height: 12px; background: color-mix(in srgb, var(--tc) 15%, var(--card)); }
.fc-prog > i { background: var(--tc); }
.fc-count { min-width: 52px; justify-content: flex-end; }
.fc-count span { color: var(--ink3); }

.fc-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 50px 0 30px; }
.fc-stack { position: relative; width: min(100%, 360px); height: var(--ch); touch-action: none; }

/* Mochi nấp sau chồng thẻ, chỉ ló đôi tai + mắt */
.fc-buddy { position: absolute; z-index: 0; top: -50px; right: 26px; width: 74px; height: 74px; }
.fc-buddy .mascot { width: 74px; height: 74px; }
.fc-buddy .mascot > ellipse:first-of-type { display: none; }
.fc-buddy.hop { animation: fcHop .6s var(--spring); }
@keyframes fcHop { 30% { transform: translateY(-12px) scale(.97, 1.04); } 60% { transform: translateY(1px) scale(1.04, .96); } }
.fc-bubble {
  position: absolute; z-index: 6; top: -46px; right: 104px; padding: 6px 12px; border-radius: 15px 15px 4px 15px;
  background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--sh-2); color: var(--ink); font: 800 13px/1.3 var(--f-body); white-space: nowrap;
  opacity: 0; transform: translateY(8px) scale(.6); transform-origin: 100% 100%; transition: opacity .2s, transform .4s var(--spring); pointer-events: none;
}
.fc-bubble.show { opacity: 1; transform: none; }
.fc-bubble .jp { color: var(--pri-t); }

/* --- một thẻ trong chồng --- */
.fc-card {
  position: absolute; inset: 0; z-index: 1; outline: none; -webkit-tap-highlight-color: transparent;
  transition: transform .62s var(--spring), opacity .35s ease, --ok .3s ease, --no .3s ease, --q .5s var(--spring);
}
.fc-card[data-pos="0"] { z-index: 3; cursor: grab; }
.fc-card[data-pos="1"] { z-index: 2; pointer-events: none; transform: translate3d(0, calc((12px + var(--ch) * .03) * (1 - var(--q))), 0) scale(calc(.94 + .06 * var(--q))); }
.fc-card[data-pos="2"] { z-index: 1; pointer-events: none; opacity: .8; transform: translate3d(0, calc(24px + var(--ch) * .06), 0) scale(.88); }
.fc-card.rise { transition: transform .62s var(--spring), opacity .35s ease; }
.fc-card.enter { opacity: 0; transform: translate3d(0, calc(46px + var(--ch) * .09), 0) scale(.82); }
.fc-card.grab { cursor: grabbing; transition: none; }
.fc-card.leaving { z-index: 4; pointer-events: none; transition: none; }

.fc-lift { position: absolute; inset: 0; perspective: 1500px; }
.fc-lift.lift { animation: fcLift .72s var(--spring); }
@keyframes fcLift { 0% { transform: none; } 38% { transform: translateY(-10px) scale(1.035); } 100% { transform: none; } }
.fc-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .78s cubic-bezier(.3, 1.32, .44, 1); }
.fc-card.flipped .fc-flip { transform: rotateY(180deg); }

.fc-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 15px 17px 16px; border-radius: var(--fc-r); overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: var(--grain), radial-gradient(130% 70% at 50% 0%, rgba(255, 255, 255, .7), transparent 70%), var(--paper);
  border: 1.5px solid color-mix(in srgb, var(--tc) 22%, var(--line));
  box-shadow: 0 1px 1px rgba(58, 46, 77, .04), 0 6px 14px -6px rgba(58, 46, 77, .12), 0 28px 46px -26px rgba(58, 46, 77, .42);
  transition: box-shadow .3s ease;
}
/* đường viền chỉ khâu bên trong — như thẻ giấy làm tay */
.fc-face::before { content: ""; position: absolute; inset: 8px; border-radius: calc(var(--fc-r) - 7px); border: 1.5px dashed color-mix(in srgb, var(--tc) 30%, transparent); pointer-events: none; }
.fc-back { transform: rotateY(180deg); background: var(--grain), radial-gradient(130% 70% at 50% 0%, rgba(255, 255, 255, .55), transparent 70%), color-mix(in srgb, var(--tc) 8%, var(--paper)); }
.fc-card:not(.flipped) .fc-back, .fc-card.flipped .fc-front { pointer-events: none; }
.fc-card[data-pos="1"] .fc-face, .fc-card[data-pos="2"] .fc-face { box-shadow: 0 1px 1px rgba(58, 46, 77, .04), 0 10px 22px -14px rgba(58, 46, 77, .3); }
.fc-card.grab .fc-face { box-shadow: 0 1px 1px rgba(58, 46, 77, .04), 0 10px 20px -8px rgba(58, 46, 77, .16), 0 40px 60px -30px rgba(58, 46, 77, .5); }

.fc-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 2px 2px 0 4px; }
.fc-label { display: inline-flex; align-items: center; max-width: 70%; padding: 4px 12px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: color-mix(in srgb, var(--tc) 17%, var(--card)); color: color-mix(in srgb, var(--tc) 55%, var(--ink)); font: 800 12.5px/1.4 var(--f-body); letter-spacing: .3px; }
.fc-mark { display: grid; place-items: center; transform: rotate(9deg); margin-right: 2px; }
.fc-main { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 9px; text-align: center; }
.fc-front .fc-main::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: min(66%, 210px); aspect-ratio: 1; transform: translate(-50%, -52%); border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 15%, transparent) 0 58%, color-mix(in srgb, var(--tc) 7%, transparent) 59% 66%, transparent 67%);
}
.fc-big { line-height: 1.05; color: var(--ink); white-space: nowrap; letter-spacing: 0; }
.fc-hint { position: relative; z-index: 1; align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--tc) 9%, var(--card)); color: var(--ink2); font: 800 12.5px var(--f-body); }
.fc-hint .gl { color: color-mix(in srgb, var(--tc) 70%, var(--ink)); }
.fc-hint .t-touch { display: none; }
@media (hover: none) { .fc-hint .t-touch { display: inline; } .fc-hint .t-mouse { display: none; } }

/* --- mặt sau --- */
.fc-back .fc-main { gap: 10px; }
.fc-pair { display: flex; align-items: center; justify-content: center; gap: 12px; }
.fc-arrow { color: var(--ink3); display: inline-flex; }
.fc-mini { display: grid; place-items: center; min-width: 62px; height: 62px; padding: 0 9px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line); font-size: 38px; line-height: 1; color: var(--ink); box-shadow: var(--sh-1); }
.fc-romaji { font: 900 42px/1 var(--f-body); letter-spacing: .5px; color: color-mix(in srgb, var(--tc) 60%, var(--ink)); }
.fc-romaji.sm { font-size: 19px; letter-spacing: .3px; }
.fc-read { font-weight: 700; color: var(--ink2); }
.fc-read b { color: var(--ink); }
.fc-tip { display: flex; align-items: flex-start; gap: 8px; max-width: 100%; padding: 9px 12px; border-radius: 15px; background: var(--sun-l); color: var(--ink); text-align: left; font: 700 13px/1.42 var(--f-body); }
.fc-tip .gl { flex: none; margin-top: 1px; color: var(--sun-t); }
.fc-tip span { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fc-ex { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px 8px 9px; border-radius: 17px; background: var(--card); border: 1.5px solid var(--line); text-align: left; }
.fc-ex-pic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--tc) 13%, var(--card)); }
.fc-ex-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.fc-ex-txt b { font-size: 19px; }
.fc-ex-txt em { font-style: normal; color: var(--pri-t); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--sun) 50%, transparent) 62%); border-radius: 2px; }
.fc-ex-txt small { color: var(--ink2); font: 700 12.5px var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-ex-txt .fc-ex-k { font: 900 10px var(--f-body); text-transform: uppercase; letter-spacing: 1px; color: var(--ink3); }
.fc-ex .say-btn { width: 36px; height: 36px; }
.fc-pic { display: grid; place-items: center; width: 108px; height: 108px; border-radius: 34px; background: color-mix(in srgb, var(--tc) 14%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tc) 20%, transparent); }
.fc-pic .kana { font-size: 48px; }
.fc-word { font-size: 30px; line-height: 1.1; color: var(--ink); }
.fc-mean { font: 800 26px/1.2 var(--f-head); color: var(--ink); text-wrap: balance; }
.fc-onkun { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fc-onkun span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-size: 14.5px; }
.fc-onkun i { font: 900 10.5px var(--f-body); font-style: normal; text-transform: uppercase; letter-spacing: .7px; color: var(--ink3); }
.fc-back .hv-badge { font-size: 16px; }
.fc-back .say-btn { box-shadow: var(--sh-1); }

/* --- vệt sáng & con dấu khi kéo --- */
.fc-glow { position: absolute; inset: 0; z-index: 5; border-radius: var(--fc-r); pointer-events: none; }
.fc-glow.ok { opacity: var(--ok); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--mint) 75%, transparent), 0 0 0 5px color-mix(in srgb, var(--mint) 16%, transparent); background: linear-gradient(110deg, color-mix(in srgb, var(--mint) 16%, transparent), transparent 58%); }
.fc-glow.no { opacity: var(--no); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--red) 70%, transparent), 0 0 0 5px color-mix(in srgb, var(--red) 13%, transparent); background: linear-gradient(250deg, color-mix(in srgb, var(--red) 13%, transparent), transparent 58%); }
.fc-stamp {
  position: absolute; z-index: 6; top: 62px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 15px 8px;
  border: 3.5px solid currentColor; border-radius: 16px; pointer-events: none; mix-blend-mode: multiply;
  background: color-mix(in srgb, var(--paper) 50%, transparent);
  box-shadow: inset 0 0 0 2.5px color-mix(in srgb, var(--paper) 85%, transparent), inset 0 0 0 4.2px currentColor;
}
.fc-stamp b { font: 700 25px/1.1 var(--f-jp); letter-spacing: 1.5px; }
.fc-stamp span { font: 900 11px/1 var(--f-body); text-transform: uppercase; letter-spacing: 1.8px; }
.fc-stamp.ok { left: 20px; color: var(--mint-d); opacity: var(--ok); transform: rotate(-13deg) scale(calc(1.4 - .4 * var(--ok))); }
.fc-stamp.no { right: 20px; color: var(--red-d); opacity: var(--no); transform: rotate(12deg) scale(calc(1.4 - .4 * var(--no))); }
.fc-card.to-ok .fc-stamp.ok { animation: fcThumpOk .42s var(--spring) both; }
.fc-card.to-no .fc-stamp.no { animation: fcThumpNo .42s var(--spring) both; }
@keyframes fcThumpOk { 0% { transform: rotate(-13deg) scale(1.5); } 100% { transform: rotate(-13deg) scale(1); } }
@keyframes fcThumpNo { 0% { transform: rotate(12deg) scale(1.5); } 100% { transform: rotate(12deg) scale(1); } }
[data-dark] .fc-stamp { mix-blend-mode: normal; }

/* --- chia bài lúc mở & gợi ý vuốt --- */
.fc-stack.deal .fc-card { animation: fcDeal .72s var(--spring) both; }
.fc-stack.deal .fc-card[data-pos="1"] { animation-delay: .09s; }
.fc-stack.deal .fc-card[data-pos="2"] { animation-delay: .18s; }
.fc-stack.deal .fc-buddy { animation: fcPeek .8s var(--spring) both .45s; }
@keyframes fcDeal { from { opacity: 0; transform: translate3d(0, -40px, 0) rotate(-6deg) scale(.9); } }
@keyframes fcPeek { from { transform: translateY(46px); } }
.fc-card.nudge { animation: fcNudge 1.6s ease-in-out; }
@keyframes fcNudge {
  0%, 100% { transform: none; --ok: 0; --no: 0; }
  20% { transform: translate3d(-26px, 0, 0) rotate(-4deg); --no: .7; --ok: 0; }
  44% { transform: none; --no: 0; --ok: 0; }
  68% { transform: translate3d(26px, 0, 0) rotate(4deg); --ok: .7; --no: 0; }
  90% { transform: none; --ok: 0; --no: 0; }
}

/* --- nút chấm --- */
.fc-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; width: min(100%, 440px); margin: 0 auto; }
.fc-act { position: relative; min-height: 58px; padding: 10px 18px; gap: 8px; font-size: 16px; }
.fc-no { --b: var(--red-l); --bt: var(--red-t); --bs: color-mix(in srgb, var(--red) 50%, transparent); }
.fc-ok { --b: var(--mint-l); --bt: var(--mint-t); --bs: color-mix(in srgb, var(--mint) 55%, transparent); }
.fc-no:hover, .fc-no.hot { --b: var(--red); --bt: #fff; background: var(--red); }
.fc-ok:hover, .fc-ok.hot { --b: var(--mint); --bt: #fff; background: var(--mint); }
.fc-act.hot { transform: translateY(-3px) scale(1.04); }
.fc-flipbtn { padding: 10px 20px; }
.fc-flipbtn .gl { transition: transform .5s var(--spring); }
.fc-flipbtn.on .gl { transform: scaleX(-1); }
.fc-n {
  position: absolute; top: -8px; right: 12px; min-width: 25px; height: 25px; padding: 0 7px; border-radius: 13px; font: 900 12.5px/22px var(--f-body); font-style: normal;
  background: var(--card); color: var(--bt); border: 1.5px solid currentColor; box-shadow: var(--sh-1);
  opacity: 0; transform: scale(.4); transition: transform .4s var(--spring), opacity .2s;
}
.fc-no .fc-n { color: var(--red-t); }
.fc-ok .fc-n { color: var(--mint-t); }
.fc-n.on { opacity: 1; transform: none; }
.fc-n.bump { animation: fcBump .5s var(--spring); }
@keyframes fcBump { 35% { transform: scale(1.45); } }

.fc-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 14px; color: var(--ink3); font: 800 12.5px var(--f-body); }
.fc-keys kbd { margin-right: 3px; }
.fc-touchhint { display: none; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; color: var(--ink3); font: 800 12.5px var(--f-body); }
.fc-touchhint span { display: inline-flex; align-items: center; gap: 4px; }
.fc-touchhint i { width: 4px; height: 4px; border-radius: 50%; background: var(--line2); }
@media (hover: none) { .fc-keys { display: none; } .fc-touchhint { display: flex; } }

/* =========================================================
   TỔNG KẾT
   ========================================================= */
.fc-result { padding-top: 6px; }
.fc-result .result-mochi { margin-bottom: 0; }
.fc-hanamaru { position: absolute; right: -84px; top: 2px; animation: stamp .6s cubic-bezier(.3, 1.6, .5, 1) both .5s; filter: drop-shadow(0 3px 4px rgba(240, 80, 107, .18)); }
.fc-res-deck { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 6px; margin: 4px auto 10px; padding: 4px 14px 4px 8px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font: 800 13.5px var(--f-body); color: var(--ink2); }
.fc-res-deck .ic { width: 24px; height: 24px; }
.fc-res-sub { max-width: 460px; margin: 0 auto 4px; color: var(--ink2); font-weight: 700; }
.fc-res-sub b { color: var(--ink); }
.fc-result .rs.pink { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.fc-missed { max-width: 560px; margin: 4px auto 0; padding: 16px 18px; text-align: left; }
.fc-missed .card-title small { margin-left: auto; font: 800 12px var(--f-body); color: var(--ink3); }
.fc-mchip { padding: 6px 14px; min-height: 44px; }
.fc-mchip .kana { font-size: 21px; line-height: 1; color: var(--ink); }
.fc-mchip small { font-size: 12.5px; }
.fc-res-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
.fc-empty { padding-top: 24px; }
.fc-empty .card { padding: 34px 22px; }
.fc-empty .mascot { margin: 0 auto 8px; }

/* =========================================================
   MÀN HÌNH NHỎ
   ========================================================= */
@media (max-width: 760px) {
  .fc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .fd-art { height: 102px; }
  .fc-due { flex-wrap: wrap; gap: 12px 14px; padding: 16px; }
  .fc-due-art { width: 78px; height: 78px; border-radius: 24px; }
  .fc-due-art .ic { width: 62px; height: 62px; }
  .fc-due-txt > b { font-size: 19px; }
  .fc-due-p { font-size: 14px; }
  .fc-due-go { width: 100%; }
  .fc-due.calm .fc-due-txt { flex-basis: calc(100% - 92px); }
  .fc-due-mochi { display: none; }
  .fc-opts { gap: 12px 18px; padding: 12px 14px; }
  .fc-size { margin-left: 0; width: 100%; justify-content: space-between; }
  .fc-hanamaru { right: -58px; }
  .fc-hanamaru .ic { width: 76px; height: 76px; }
  .fc-res-btns .btn { flex: 1 1 100%; }
}
@media (max-width: 400px) {
  .fc-session { padding-left: 12px; padding-right: 12px; }
  .fc-actions { gap: 9px; }
  .fc-act { padding: 10px 12px; font-size: 15px; }
  .fc-flip-l { display: none; }
  .fc-flipbtn { width: 58px; padding: 0; }
  .fd-title { font-size: 15px; }
  .fc-stamp b { font-size: 22px; }
}
@media (max-height: 640px) { .fc-stage { padding: 46px 0 26px; } }

/* mặt sau dài hơn thẻ (màn hình thấp) — JS gắn .dense / .denser để thu gọn cho vừa */
.fc-card.dense .fc-back { padding-top: 12px; padding-bottom: 12px; }
.fc-card.dense .fc-back .fc-main { gap: 6px; }
.fc-card.dense .fc-back .fc-head { min-height: 36px; }
.fc-card.dense .fc-back .say-btn { width: 36px; height: 36px; }
.fc-card.dense .fc-mini { height: 50px; min-width: 50px; font-size: 30px; border-radius: 15px; }
.fc-card.dense .fc-romaji { font-size: 34px; }
.fc-card.dense .fc-romaji.sm { font-size: 17px; }
.fc-card.dense .fc-mean { font-size: 21px; }
.fc-card.dense .fc-word { font-size: 25px; }
.fc-card.dense .fc-pic { width: 82px; height: 82px; border-radius: 26px; }
.fc-card.dense .fc-pic .ic { width: 62px; height: 62px; }
.fc-card.dense .fc-tip { padding: 6px 10px; font-size: 12.5px; }
.fc-card.dense .fc-tip span { -webkit-line-clamp: 2; line-clamp: 2; }
.fc-card.dense .fc-ex { padding: 5px 6px 5px 7px; border-radius: 15px; }
.fc-card.dense .fc-ex-pic { width: 38px; height: 38px; border-radius: 12px; }
.fc-card.dense .fc-ex-pic .ic { width: 30px; height: 30px; }
.fc-card.dense .fc-ex-k { display: none; }
.fc-card.dense .fc-onkun span { padding: 2px 10px; }
.fc-card.denser .fc-tip { display: none; }
.fc-card.denser .fc-read { font-size: 13.5px; }

/* giảm chuyển động: thẻ không nghiêng, không chia bài, không lắc gợi ý */
html[data-motion="reduce"] .fc-card.nudge, html[data-motion="reduce"] .fc-stack.deal .fc-card { animation: none !important; }
