/* Samio garden theme, adapted from the supplied vocabulary reference */
:root {
  --garden-bg: #fbf5eb;
  --garden-paper: #fffdf8;
  --garden-ink: #3d3229;
  --garden-muted: #8b7e6e;
  --garden-line: #e9dcc9;
  --garden-coral: #c96b54;
  --garden-coral-dark: #a9523f;
  --garden-coral-soft: #fbe2d8;
  --garden-green: #6e9e80;
  --garden-green-soft: #e8f2eb;
  --garden-gold: #d6a647;
}

body.mode-game {
  background: var(--garden-bg);
  color: var(--garden-ink);
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.mode-game .yh-game-header {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 8px 12px;
  color: var(--garden-ink);
  background: rgba(255, 253, 248, .96);
  border: 1px solid var(--garden-line);
  border-bottom: 3px solid #dfcfb9;
  border-radius: 0;
  box-shadow: 0 5px 0 rgba(86,65,43,.07);
  backdrop-filter: blur(8px);
}
.yh-game-logo { color: var(--garden-ink) !important; }
.yh-game-logo span:first-child { color: var(--garden-coral); }
.yh-game-title { color: var(--garden-coral); }
.yh-game-progress { color: var(--garden-muted); }
.yh-bar { background: #f0e8db; }
.yh-bar-fill { background: var(--garden-green); }
.yh-game-score { color: var(--garden-coral); background: var(--garden-coral-soft); border-color: #efc2b6; }
.yh-score-label { color: var(--garden-coral-dark); }
.yh-game-close { color: var(--garden-coral); background: #fff; border-color: var(--garden-line); }
.yh-game-close:hover, .yh-game-close:focus-visible { color: #fff; background: var(--garden-coral); }

.yh-game-main { padding-top: 26px; }
.yh-mode-intro {
  background: var(--garden-paper);
  border-color: var(--garden-line);
  border-left-color: var(--garden-coral);
  border-bottom: 3px solid #dfcfb9;
  box-shadow: none;
}
.yh-mode-number { color: #fff; background: var(--garden-coral); box-shadow: 0 3px 0 var(--garden-coral-dark); }
.yh-mode-kicker { color: var(--garden-green); }
.yh-mode-copy h1 { color: var(--garden-ink); }
.yh-mode-copy p, .yh-mode-count { color: var(--garden-muted); }
.yh-mode-count { border-left-color: var(--garden-line); }
.yh-mode-count strong { color: var(--garden-coral); }

body.mode-game .ant-card,
body.mode-game .yhw-card,
body.mode-game .yhw-memory-card-wrapper,
body.mode-game .yhw-vowel-card {
  background: var(--garden-paper) !important;
  border-color: var(--garden-line) !important;
  border-bottom: 3px solid #dfcfb9 !important;
  box-shadow: none !important;
}

.yh-game-main .btn,
.yh-game-main button.btn,
.yh-game-main a.btn,
.yh-done .btn {
  color: #fff;
  background: var(--garden-coral);
  border-color: var(--garden-coral);
  box-shadow: 0 3px 0 var(--garden-coral-dark);
}
.yh-game-main .btn:hover, .yh-done .btn:hover { background: var(--garden-coral-dark); border-color: var(--garden-coral-dark); box-shadow: 0 2px 0 #82402f; }
.yh-game-main .btn-ghost, .yh-done .btn-ghost { color: var(--garden-coral) !important; background: var(--garden-paper) !important; border-color: var(--garden-line) !important; box-shadow: 0 3px 0 rgba(86,65,43,.08); }
.yh-game-main .btn-ghost:hover, .yh-done .btn-ghost:hover { color: var(--garden-coral-dark) !important; background: var(--garden-coral-soft) !important; border-color: #e8a796 !important; }

/* Flashcards */
.mode-flashcard .yh-fc-face { color: var(--garden-ink); background: var(--garden-paper); border-color: var(--garden-line); border-top: 4px solid var(--garden-coral); box-shadow: 0 5px 0 rgba(86,65,43,.08); }
.mode-flashcard .yh-fc-back { background: var(--garden-green-soft); border-color: #bed7c7; border-top-color: var(--garden-green); }
.mode-flashcard .yh-fc-face h2 { color: var(--garden-ink); }

/* Quiz */
.mode-quiz .yhw-quiz-prompt,
.mode-fillin2 .yhw-quiz-prompt, .mode-fillin3 .yhw-quiz-prompt,
.mode-fillin5 .yhw-quiz-prompt, .mode-fillin6 .yhw-quiz-prompt {
  color: var(--garden-ink);
  background: #f7eddf;
  border-color: var(--garden-line);
}
.mode-quiz .yhw-quiz-option {
  min-height: 92px;
  background: #f5ebdc;
  border-color: var(--garden-line);
  border-bottom: 3px solid #dfcfb9;
  box-shadow: none;
}
.mode-quiz .yhw-quiz-option:hover { background: var(--garden-coral-soft); border-color: #e8a796; box-shadow: none; }
.mode-quiz .yhw-quiz-option-text { color: var(--garden-ink); }
.mode-quiz .yhw-quiz-option-letter-badge { color: #fff; background: var(--garden-coral); }
.mode-quiz .yhw-quiz-option--correct { background: var(--garden-green) !important; border-color: #58896d; }
.mode-quiz .yhw-quiz-option--wrong { background: #c9534c !important; border-color: #a83d37; }
.mode-quiz .yhw-quiz-audio-button, .mode-quiz .yhw-sound-btn,
.yhw-sound-btn { background: var(--garden-coral) !important; border-color: var(--garden-paper); box-shadow: 0 0 0 1px #e8a796, 0 5px 0 var(--garden-coral-dark) !important; }

/* Inputs and tiles */
.yhw-fillin-input { color: var(--garden-ink); background: var(--garden-paper); border-color: var(--garden-line); }
.yhw-fillin-input:focus { border-color: var(--garden-coral); box-shadow: 0 0 0 3px rgba(201,107,84,.13); }
.yhw-fillin-slot { color: var(--garden-ink); background: #f5ebdc; border-color: #d9c4aa; }
.yh-prog-line { background: #f0e8db; }
.yh-prog-fill { background: var(--garden-green); }
.yhw-quiz-progress-text { color: var(--garden-muted); }
.mode-unscramble1 .yhw-unscramble-top, .mode-unscramble2 .yhw-unscramble-top { background: #f7eddf; border-color: var(--garden-line); }
.mode-unscramble1 .yhw-unscramble-top h2, .mode-unscramble2 .yhw-unscramble-top h2 { color: var(--garden-coral-dark); }
.yhw-unscramble-tile { color: #fff; background: var(--garden-coral); box-shadow: 0 3px 0 var(--garden-coral-dark); }
.yhw-unscramble-tile.sel { color: var(--garden-coral-dark); background: var(--garden-paper); border-color: var(--garden-coral); outline-color: #f3c7bc; }

/* Matching and connecting */
.mode-matching1 .yhw-match-top-section { background: #fff7f3; border-color: #efcfc5; }
.mode-matching1 .yhw-match-bottom-section { background: #f1f7f2; border-color: #c9ddcf; }
.mode-matching1 .yhw-match-top-card { background: var(--garden-paper); border-color: var(--garden-line); border-bottom: 3px solid #dfcfb9; }
.mode-matching1 .yhw-match-bottom-card { background: var(--garden-paper); border-color: #bfd5c6; }
.mode-matching1 .yhw-match-bottom-card--active { color: #fff; background: var(--garden-green); border-color: var(--garden-green); }
.mode-connect2 .yhw-match-board-wrapper { background: #f8f0e5; border-color: var(--garden-line); }
.mode-connect2 .yhw-match-item { color: var(--garden-ink); background: var(--garden-paper); border-color: var(--garden-line); box-shadow: none; }
.mode-connect2 .yhw-match-item--center { background: var(--garden-coral-soft); border-color: #efc2b6; }
.mode-connect2 .yhw-match-item--side { background: var(--garden-green-soft); border-color: #c4dacb; }
.mode-connect2 .yhw-match-item--pending { border-color: var(--garden-coral); box-shadow: 0 0 0 3px rgba(201,107,84,.13); }
.mode-connect2 #cInfo { color: var(--garden-muted); background: var(--garden-paper); border-color: var(--garden-line); }

/* Memory, vowels and word search */
.mode-memory2 .yhw-memory-stats { color: var(--garden-coral-dark); background: var(--garden-coral-soft); border-color: #efc2b6; }
.mode-memory2 .yhw-memory-card-face { border-color: var(--garden-line); box-shadow: 0 4px 0 rgba(86,65,43,.1); }
.mode-memory2 .yhw-memory-card-front { background: var(--garden-coral); }
.mode-memory2 .yhw-memory-card-back { color: var(--garden-ink); background: var(--garden-paper); }
.mode-memory2 .yhw-memory-card.is-matched .yhw-memory-card-back { background: var(--garden-green-soft); border-color: #a8c9b4; }
.mode-vowel1 .yhw-vowel-word-char--blank, .mode-vowel2 .yhw-vowel-word-char--blank { color: var(--garden-coral); border-bottom-color: var(--garden-coral); }
.mode-vowel1 .yhw-vowel-hint { background: #f7eddf; border-color: var(--garden-line); }
.yhw-vowel-letter { color: var(--garden-ink) !important; background: var(--garden-paper) !important; border-color: var(--garden-line); }
.yhw-vowel-letter:hover { color: #fff !important; background: var(--garden-coral) !important; border-color: var(--garden-coral); }
.mode-wordsearch1 #yhStage { background: var(--garden-paper) !important; border-color: var(--garden-line) !important; border-bottom: 3px solid #dfcfb9 !important; }
.mode-wordsearch1 .yhw-ws-grid { background: #f7eddf; border-color: var(--garden-line); }
.mode-wordsearch1 .yhw-ws-cell { color: var(--garden-ink); background: var(--garden-paper); border-color: var(--garden-line); }
.mode-wordsearch1 .yhw-ws-cell--preview { color: #fff; background: var(--garden-coral); border-color: var(--garden-coral); }
.mode-wordsearch1 .yhw-ws-cell--found { color: #fff; background: var(--garden-green); border-color: var(--garden-green); }
.mode-wordsearch1 .yhw-ws-wordlist { background: var(--garden-green-soft); border-color: #c4dacb; }
.mode-wordsearch1 .yhw-ws-wordlist-item { background: var(--garden-paper); border-color: var(--garden-line); }
.mode-wordsearch1 .yhw-ws-wordlist-item--found { color: #fff; background: var(--garden-green); border-color: var(--garden-green); }

/* Completion */
.yh-done { background: rgba(61, 50, 41, .58); }
.yh-done-card { background: var(--garden-paper); border-color: #fff; border-top-color: var(--garden-coral); box-shadow: 0 8px 0 rgba(61,50,41,.13); }
.yh-done-mark { background: var(--garden-green); }
.yh-done-kicker, .yh-done-score { color: var(--garden-coral); }
.yh-done-card h2 { color: var(--garden-ink); }
.yh-done-sub { color: var(--garden-muted); }

@media (max-width: 620px) {
  body.mode-game .yh-game-header { top: 0; width: 100%; margin-top: 0; }
  .yh-game-main { padding-top: 16px; }
  .yh-mode-intro { border-bottom-width: 3px; }
  .mode-quiz .yhw-quiz-option { min-height: 66px; }
}

/* Matching 1 — visual matching board */
body.mode-game.mode-matching1 {
  background-color: #e8f3ea;
  background-image:
    linear-gradient(135deg,rgba(219,241,228,.76) 0%,rgba(248,251,238,.6) 48%,rgba(255,239,221,.68) 100%),
    url("vocab-adventure-world.jpg");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}

body.mode-game.mode-matching1::before {
  background:
    linear-gradient(180deg,rgba(247,253,248,.48),rgba(250,252,244,.66)),
    radial-gradient(circle at 50% 0,rgba(255,255,255,.72),rgba(255,255,255,0) 48%);
}

body.mode-game.mode-matching1::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 7% 18%,rgba(95,167,128,.16) 0 72px,transparent 74px),
    radial-gradient(circle at 92% 16%,rgba(237,176,116,.16) 0 96px,transparent 98px),
    radial-gradient(circle at 88% 88%,rgba(104,173,151,.12) 0 130px,transparent 132px),
    radial-gradient(circle at 12% 92%,rgba(248,203,154,.13) 0 105px,transparent 107px);
  filter: blur(1px);
}

body.mode-game.mode-matching1 .yh-game-main {
  width: 100% !important;
  max-width: none !important;
  padding-right: clamp(8px,1.25vw,20px) !important;
  padding-left: clamp(8px,1.25vw,20px) !important;
}

body.mode-game.mode-matching1 #yhStage,
body.mode-game.mode-matching1 .yh-game-stage,
body.mode-game.mode-matching1 .yh-game-stage > .yhw-quiz-card,
body.mode-game.mode-matching1 .yh-game-stage > .yhw-quiz-card > .ant-card-body {
  width: 100% !important;
  max-width: none !important;
}

body.mode-game.mode-matching1 .yh-game-stage > .card,
body.mode-game.mode-matching1 .yh-game-stage > .yhw-quiz-card {
  width: 100%;
  max-width: none;
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 26px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 60px rgba(45,78,58,.14);
  backdrop-filter: blur(14px);
}

body.mode-game.mode-matching1 .yhw-match-main {
  display: grid;
  gap: 18px;
}

body.mode-game.mode-matching1 .yhw-match-top-section,
body.mode-game.mode-matching1 .yhw-match-bottom-section {
  padding: clamp(16px, 2vw, 24px) !important;
  border: 1px solid #dce9df !important;
  border-radius: 22px !important;
  background: linear-gradient(145deg,rgba(247,252,248,.98),rgba(255,255,255,.98)) !important;
}

body.mode-game.mode-matching1 .yhw-match-top-section {
  position: relative;
  overflow: hidden;
}

body.mode-game.mode-matching1 .yhw-match-top-section::before {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -110px;
  top: -155px;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(101,181,139,.15),rgba(101,181,139,0) 70%);
  pointer-events: none;
}

.mode-matching1 .yhm-section-head,
.mode-matching1 .yhm-bank-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  text-align: left;
}

.mode-matching1 .yhm-section-head h2 {
  margin: 3px 0 2px;
  color: #26372e;
  font-size: clamp(22px,2.2vw,30px);
  line-height: 1.15;
}

.mode-matching1 .yhm-section-head p,
.mode-matching1 .yhm-bank-head p {
  margin: 0;
  color: #7c887f;
  font-size: 14px;
  font-weight: 650;
}

.mode-matching1 .yhm-eyebrow {
  display: block;
  color: #56806a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
}

.mode-matching1 .yhm-status {
  min-width: 132px;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid #d5e8dc;
  border-radius: 14px;
  background: #fff;
  color: #728077;
  box-shadow: 0 8px 20px rgba(44,84,61,.08);
  white-space: nowrap;
}

.mode-matching1 .yhm-status b { color: #397858; font-size: 23px; line-height: 1; }
.mode-matching1 .yhm-status span { font-size: 12px; font-weight: 800; }
.mode-matching1 .yhm-status.is-complete { color: #fff; border-color: #438361; background: #4f936f; }
.mode-matching1 .yhm-status.is-complete b { color: #fff; }

body.mode-game.mode-matching1 .yhw-match-top-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
  gap: 14px !important;
}

body.mode-game.mode-matching1 .yhw-match-top-card {
  --yhm-card-pastel: #fff0e6;
  --yhm-card-line: #f4c3a8;
  --yhm-card-edge: #e8aa89;
  --yhm-card-accent: #a95830;
  position: relative;
  min-width: 0;
  min-height: 172px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 16px 15px !important;
  overflow: hidden;
  color: #2d3a32 !important;
  border: 1px solid var(--yhm-card-line) !important;
  border-bottom: 4px solid var(--yhm-card-edge) !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg,var(--yhm-card-pastel) 0%,#fff 84%) !important;
  box-shadow: 0 10px 24px rgba(52,79,62,.08) !important;
  transition: transform .2s ease,border-color .2s ease,box-shadow .2s ease,background .2s ease;
}

body.mode-game.mode-matching1 .yhw-match-top-card:nth-child(8n + 1) {
  --yhm-card-pastel: #fff0e6; --yhm-card-line: #f4c3a8; --yhm-card-edge: #e8aa89; --yhm-card-accent: #a95830;
}
body.mode-game.mode-matching1 .yhw-match-top-card:nth-child(8n + 2) {
  --yhm-card-pastel: #e9f8ef; --yhm-card-line: #b9dfc7; --yhm-card-edge: #92cbaa; --yhm-card-accent: #397a54;
}
body.mode-game.mode-matching1 .yhw-match-top-card:nth-child(8n + 3) {
  --yhm-card-pastel: #eaf5ff; --yhm-card-line: #bbd8f2; --yhm-card-edge: #91bfe5; --yhm-card-accent: #3d6f9f;
}
body.mode-game.mode-matching1 .yhw-match-top-card:nth-child(8n + 4) {
  --yhm-card-pastel: #f3edff; --yhm-card-line: #d3c3ed; --yhm-card-edge: #b8a1df; --yhm-card-accent: #6d5596;
}
body.mode-game.mode-matching1 .yhw-match-top-card:nth-child(8n + 5) {
  --yhm-card-pastel: #fff8d9; --yhm-card-line: #eadb98; --yhm-card-edge: #d8c36a; --yhm-card-accent: #806a18;
}
body.mode-game.mode-matching1 .yhw-match-top-card:nth-child(8n + 6) {
  --yhm-card-pastel: #fff0f4; --yhm-card-line: #efc2ce; --yhm-card-edge: #dfa0b2; --yhm-card-accent: #a64f68;
}
body.mode-game.mode-matching1 .yhw-match-top-card:nth-child(8n + 7) {
  --yhm-card-pastel: #e8f8f7; --yhm-card-line: #b6ddda; --yhm-card-edge: #8fc8c4; --yhm-card-accent: #2f7c78;
}
body.mode-game.mode-matching1 .yhw-match-top-card:nth-child(8n + 8) {
  --yhm-card-pastel: #f7f1e7; --yhm-card-line: #ddcdb7; --yhm-card-edge: #c9b497; --yhm-card-accent: #765e40;
}

body.mode-game.mode-matching1 .yhw-match-top-card .yhm-card-number {
  min-width: 27px;
  min-height: 22px;
  display: grid;
  place-items: center;
  padding: 2px 6px;
  color: var(--yhm-card-accent);
  border: 1px solid var(--yhm-card-line);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
}

body.mode-game.mode-matching1 .yhw-match-top-card .yhw-match-top-placeholder {
  color: var(--yhm-card-accent);
  border-color: var(--yhm-card-line);
  background: rgba(255,255,255,.62);
}

body.mode-game.mode-matching1 .yhw-match-top-card:not(:disabled):hover {
  z-index: 2;
  transform: translateY(-3px);
  border-color: #a9cdb8 !important;
  box-shadow: 0 16px 30px rgba(52,108,75,.14) !important;
}

.mode-matching1 .yhm-card-number {
  position: absolute;
  top: 11px;
  left: 12px;
  color: #8b9990;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.mode-matching1 .yhm-card-media {
  display: none !important;
  width: 0;
  height: 0;
  place-items: center;
  padding: 7px;
  border: 1px solid #e2eee6;
  border-radius: 18px;
  background: linear-gradient(145deg,#f0f8f3,#fbfdfb);
}

body.mode-game.mode-matching1 .yh-match-thumb {
  width: 100% !important;
  height: 100% !important;
  display: block;
  margin: 0 !important;
  object-fit: contain;
  border-radius: 11px;
}

.mode-matching1 .yhm-card-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 11px;
  color: #4a8665;
  background: #e3f3e9;
  font-size: 38px;
  font-weight: 900;
}

body.mode-game.mode-matching1 .yhw-match-top-main {
  min-width: 0;
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 4px 6px;
}

body.mode-game.mode-matching1 .yhw-match-top-word-text {
  color: #29362f;
  font-size: clamp(27px,2.5vw,38px) !important;
  font-weight: 900 !important;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

body.mode-game.mode-matching1 .yhm-card-long .yhw-match-top-word-text { font-size: clamp(23px,2.1vw,31px) !important; }
body.mode-game.mode-matching1 .yhm-card-very-long .yhw-match-top-word-text { font-size: clamp(20px,1.8vw,27px) !important; }

body.mode-game.mode-matching1 .yhw-match-top-answer {
  width: 100%;
  min-height: 39px;
  display: grid;
  place-items: center;
  margin-top: auto;
}

.mode-matching1 .yhw-match-top-placeholder,
.mode-matching1 .yhw-match-top-answer-pill {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.mode-matching1 .yhw-match-top-placeholder {
  color: #9ba59f;
  border: 1px dashed #d2ddd5;
  background: #fafcfb;
}

.mode-matching1 .yhw-match-top-placeholder svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mode-matching1 .yhw-match-top-answer-pill {
  color: #2f7350;
  border: 1px solid #b9dec8;
  background: #eaf8ef;
}

body.mode-game.mode-matching1 .yhw-match-top-card--active {
  border-color: #72b38e !important;
  border-bottom-color: #4a936a !important;
  background: linear-gradient(180deg,#fff,#f5fcf7) !important;
  box-shadow: 0 0 0 3px rgba(78,151,108,.13),0 16px 30px rgba(52,108,75,.13) !important;
}

.mode-matching1 .yhm-bank-head { margin-bottom: 14px; }
.mode-matching1 .yhm-bank-head > div { display: grid; gap: 3px; }
.mode-matching1 .yhm-bank-head strong { color: #2d3d34; font-size: 20px; }
.mode-matching1 .yhm-bank-head p { padding: 7px 11px; border-radius: 10px; background: #edf7f0; }

body.mode-game.mode-matching1 .yhw-match-bottom-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

body.mode-game.mode-matching1 .yhw-match-bottom-card {
  min-height: 58px !important;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px 8px 9px !important;
  color: #34443a !important;
  border: 1px solid #bed8c7 !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 7px 16px rgba(51,91,66,.07) !important;
  font-size: clamp(17px,1.45vw,21px) !important;
  font-weight: 800;
  transition: transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease;
}

body.mode-game.mode-matching1 .yhw-match-bottom-card:not(.yhw-match-bottom-card--used):hover {
  transform: translateY(-2px);
  border-color: #76b18d !important;
  box-shadow: 0 11px 20px rgba(51,105,72,.12) !important;
}

.mode-matching1 .yhm-choice-number {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #3f7858;
  background: #e8f4ec;
  font-size: 12px;
  font-weight: 900;
}

.mode-matching1 .yhm-choice-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-left: 1px;
  border-radius: 50%;
  color: #fff;
  background: #58a878;
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .18s ease,transform .18s ease;
}

body.mode-game.mode-matching1 .yhw-match-bottom-card--active {
  color: #fff !important;
  border-color: #3f7e5c !important;
  background: linear-gradient(135deg,#4f966e,#3f7e5c) !important;
  box-shadow: 0 0 0 4px rgba(63,126,92,.15),0 11px 22px rgba(47,104,72,.2) !important;
}

.mode-matching1 .yhw-match-bottom-card--active .yhm-choice-number { color: #397451; background: #fff; }

body.mode-game.mode-matching1 .yhw-match-bottom-card--used {
  color: #688074 !important;
  border-color: #d5e7dc !important;
  background: #f1f8f3 !important;
  box-shadow: none !important;
  cursor: default;
  opacity: .7;
}

.mode-matching1 .yhw-match-bottom-card--used .yhm-choice-number { color: #769484; background: #e2efe7; }
.mode-matching1 .yhw-match-bottom-card--used .yhm-choice-check { opacity: 1; transform: scale(1); }

body.mode-game.mode-matching1 .yhw-match-top-card--correct {
  border-color: #62ad80 !important;
  background: #effaf3 !important;
}

body.mode-game.mode-matching1 .yhw-match-top-card--wrong {
  border-color: #df7b75 !important;
  background: #fff3f2 !important;
}

body.mode-game.mode-matching1 .yh-game-actions .yhm-check-btn {
  min-width: 230px;
  min-height: 54px;
  border-radius: 15px !important;
  background: linear-gradient(135deg,#4f936e,#397653) !important;
  box-shadow: 0 6px 0 #2f6245,0 14px 25px rgba(47,98,69,.18) !important;
  font-size: 16px;
}

body.mode-game.mode-matching1 .yh-game-actions .yhm-check-btn:disabled {
  color: #8c9991 !important;
  border-color: #dfe7e1 !important;
  background: #edf1ee !important;
  box-shadow: none !important;
  opacity: 1;
}

@media (max-width: 900px) {
  body.mode-game.mode-matching1 .yhw-match-top-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  body.mode-game.mode-matching1 .yhw-match-top-card { min-height: 158px !important; }
}

@media (max-width: 600px) {
  body.mode-game.mode-matching1 .yh-game-stage > .card,
  body.mode-game.mode-matching1 .yh-game-stage > .yhw-quiz-card { padding: 9px; border-radius: 18px; }
  body.mode-game.mode-matching1 .yhw-match-main { gap: 10px; }
  body.mode-game.mode-matching1 .yhw-match-top-section,
  body.mode-game.mode-matching1 .yhw-match-bottom-section { padding: 12px !important; border-radius: 16px !important; }
  .mode-matching1 .yhm-section-head { align-items: flex-start; margin-bottom: 13px; }
  .mode-matching1 .yhm-section-head p { display: none; }
  .mode-matching1 .yhm-status { min-width: 98px; padding: 8px 9px; }
  .mode-matching1 .yhm-status b { font-size: 19px; }
  .mode-matching1 .yhm-status span { font-size: 10px; }
  body.mode-game.mode-matching1 .yhw-match-top-grid { gap: 8px !important; }
  body.mode-game.mode-matching1 .yhw-match-top-card { min-height: 148px !important; padding: 20px 8px 9px !important; border-radius: 14px !important; }
  .mode-matching1 .yhm-card-media { width: 72px; height: 72px; padding: 5px; border-radius: 14px; }
  body.mode-game.mode-matching1 .yhw-match-top-word-text { font-size: 23px !important; }
  body.mode-game.mode-matching1 .yhm-card-long .yhw-match-top-word-text { font-size: 19px !important; }
  body.mode-game.mode-matching1 .yhm-card-very-long .yhw-match-top-word-text { font-size: 17px !important; }
  body.mode-game.mode-matching1 .yhw-match-top-main { min-height: 66px; }
  .mode-matching1 .yhw-match-top-placeholder,
  .mode-matching1 .yhw-match-top-answer-pill { min-height: 37px; padding: 6px; font-size: 14px; }
  .mode-matching1 .yhm-bank-head { display: block; margin-bottom: 10px; }
  .mode-matching1 .yhm-bank-head p { margin-top: 7px; font-size: 12px; }
  body.mode-game.mode-matching1 .yhw-match-bottom-list { justify-content: stretch; gap: 7px; }
  body.mode-game.mode-matching1 .yhw-match-bottom-card { width: calc(50% - 4px); min-height: 52px !important; padding: 6px 8px !important; font-size: 15px !important; text-align: left; }
  .mode-matching1 .yhm-choice-number { width: 28px; height: 28px; flex-basis: 28px; }
  .mode-matching1 .yhm-choice-check { display: none; }
  body.mode-game.mode-matching1 .yh-game-actions .yhm-check-btn { width: calc(100% - 18px); min-width: 0; }
}

/* Quiz 3: lively answer choices without changing the game engine. */
body.mode-quiz3 {
  --quiz3-coral: #c96b54;
  --quiz3-coral-soft: #fff0ec;
  --quiz3-gold: #b9852d;
  --quiz3-gold-soft: #fff7df;
  --quiz3-green: #598c70;
  --quiz3-green-soft: #edf8f1;
  --quiz3-blue: #527e9c;
  --quiz3-blue-soft: #eef7fc;
}

.mode-quiz3 .yhw-quiz-card {
  border-color: #e5d8c5;
  box-shadow: 0 8px 0 rgba(86, 65, 43, .08);
}

.mode-quiz3 .yhw-quiz-main {
  gap: 18px;
}

.mode-quiz3 .yhw-quiz-prompt {
  position: relative;
  min-height: 150px;
  padding: 24px 20px;
  overflow: hidden;
  background: var(--garden-paper);
  border-color: #dfcbb2;
  border-top: 5px solid var(--quiz3-coral);
  box-shadow: 0 5px 0 rgba(86, 65, 43, .07);
  animation: quiz3-prompt-in .38s ease-out both;
}

.mode-quiz3 .yhw-quiz-prompt::before,
.mode-quiz3 .yhw-quiz-prompt::after {
  position: absolute;
  top: 18px;
  width: 10px;
  height: 10px;
  content: "";
  background: var(--quiz3-gold);
  border-radius: 50%;
  box-shadow: 0 18px 0 var(--quiz3-green), 0 36px 0 var(--quiz3-blue);
  opacity: .58;
}

.mode-quiz3 .yhw-quiz-prompt::before { left: 22px; }
.mode-quiz3 .yhw-quiz-prompt::after { right: 22px; }

.mode-quiz3 .yhw-quiz-word-prompt-button {
  min-width: 220px;
  padding: 8px 22px;
  border-radius: 8px;
  transition: color .18s ease, transform .18s ease, background-color .18s ease;
}

.mode-quiz3 .yhw-quiz-word-prompt-button:hover {
  color: var(--quiz3-coral);
  background: var(--quiz3-coral-soft);
  transform: scale(1.03);
}

.mode-quiz3 .yhw-quiz-prompt h2 {
  color: #2f2924;
  font-size: 44px !important;
  letter-spacing: 0;
}

.mode-quiz3 .yhw-quiz-prompt .muted-2 {
  color: #78695c;
  font-size: 16px;
  font-weight: 650;
}

.mode-quiz3 .yhw-quiz-grid {
  row-gap: 14px !important;
}

.mode-quiz3 .yhw-quiz-grid > .ant-col {
  animation: quiz3-answer-in .36s ease-out both;
}

.mode-quiz3 .yhw-quiz-grid > .ant-col:nth-child(1) { animation-delay: .05s; }
.mode-quiz3 .yhw-quiz-grid > .ant-col:nth-child(2) { animation-delay: .10s; }
.mode-quiz3 .yhw-quiz-grid > .ant-col:nth-child(3) { animation-delay: .15s; }
.mode-quiz3 .yhw-quiz-grid > .ant-col:nth-child(4) { animation-delay: .20s; }

.mode-quiz3 .yhw-quiz-option {
  min-height: 110px;
  border-width: 2px;
  border-bottom-width: 5px;
  box-shadow: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.mode-quiz3 .yhw-quiz-option-slot-0 { background: var(--quiz3-coral-soft); border-color: #edb5a7; border-bottom-color: #d98c79; }
.mode-quiz3 .yhw-quiz-option-slot-1 { background: var(--quiz3-gold-soft); border-color: #ead59f; border-bottom-color: #d1aa52; }
.mode-quiz3 .yhw-quiz-option-slot-2 { background: var(--quiz3-green-soft); border-color: #b9d7c4; border-bottom-color: #7eaf90; }
.mode-quiz3 .yhw-quiz-option-slot-3 { background: var(--quiz3-blue-soft); border-color: #bdd8e8; border-bottom-color: #79a8c2; }

.mode-quiz3 .yhw-quiz-option:hover {
  background: var(--garden-paper);
  transform: translateY(-4px);
  box-shadow: 0 9px 16px rgba(86, 65, 43, .11);
}

.mode-quiz3 .yhw-quiz-option-slot-0 .yhw-quiz-option-letter-badge { background: var(--quiz3-coral); }
.mode-quiz3 .yhw-quiz-option-slot-1 .yhw-quiz-option-letter-badge { background: var(--quiz3-gold); }
.mode-quiz3 .yhw-quiz-option-slot-2 .yhw-quiz-option-letter-badge { background: var(--quiz3-green); }
.mode-quiz3 .yhw-quiz-option-slot-3 .yhw-quiz-option-letter-badge { background: var(--quiz3-blue); }

.mode-quiz3 .yhw-quiz-option-letter-badge {
  width: 30px;
  height: 30px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 7px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .76);
}

/* Quiz 3 uses colour-coded answer panels; the A/B/C/D badge is redundant. */
.mode-quiz3 .yhw-quiz-option-letter {
  display: none;
}

.mode-quiz3 .yhw-quiz-option-text {
  padding: 0 20px;
  color: #342e29;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.mode-quiz3 .yhw-quiz-option--correct {
  color: #fff;
  background: #4f956b !important;
  border-color: #347a52;
  border-bottom-color: #2e6847;
  box-shadow: 0 0 0 4px rgba(79, 149, 107, .16);
}

.mode-quiz3 .yhw-quiz-option--wrong {
  color: #fff;
  background: #d45d57 !important;
  border-color: #ad433e;
  border-bottom-color: #923732;
  box-shadow: 0 0 0 4px rgba(212, 93, 87, .14);
}

.mode-quiz3 .yhw-quiz-option--correct .yhw-quiz-option-letter-badge,
.mode-quiz3 .yhw-quiz-option--wrong .yhw-quiz-option-letter-badge {
  color: #3d3229;
  background: #fff;
}

@keyframes quiz3-prompt-in {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes quiz3-answer-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .mode-quiz3 .yhw-quiz-main { gap: 11px; }
  .mode-quiz3 .yhw-quiz-prompt { min-height: 112px; padding: 16px 12px; border-top-width: 4px; }
  .mode-quiz3 .yhw-quiz-prompt::before, .mode-quiz3 .yhw-quiz-prompt::after { display: none; }
  .mode-quiz3 .yhw-quiz-word-prompt-button { min-width: 0; padding: 5px 14px; }
  .mode-quiz3 .yhw-quiz-prompt h2 { font-size: 32px !important; }
  .mode-quiz3 .yhw-quiz-prompt .muted-2 { font-size: 14px; }
  .mode-quiz3 .yhw-quiz-grid { row-gap: 10px !important; }
  .mode-quiz3 .yhw-quiz-option { min-height: 72px; border-bottom-width: 4px; }
  .mode-quiz3 .yhw-quiz-option:hover { transform: translateY(-2px); }
  .mode-quiz3 .yhw-quiz-option-text { padding: 0 16px; font-size: 19px; }
  .mode-quiz3 .yhw-quiz-option-letter-badge { width: 25px; height: 25px; font-size: 12px; border-radius: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .mode-quiz3 .yhw-quiz-prompt,
  .mode-quiz3 .yhw-quiz-grid > .ant-col,
  .mode-quiz3 .yhw-quiz-option { animation: none !important; transition: none !important; }
}

/* Flashcard learning room */
.mode-flashcard {
  --fc-blue: #527e9c;
  --fc-blue-soft: #eaf4f8;
  --fc-leaf: #598c70;
  --fc-sun: #e1ad46;
}

.mode-flashcard .yh-mode-intro { display: none; }
.mode-flashcard .yh-game-main { max-width: 980px; padding-top: clamp(16px, 3vw, 34px); }
.mode-flashcard #yhStage { padding: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.mode-flashcard .yhw-quiz-card {
  width: min(860px, 100%);
  margin: 0 auto;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.mode-flashcard .yhw-quiz-card > .ant-card-body { padding: 0 !important; }
.mode-flashcard .yh-fc-shell { width: 100%; }

.mode-flashcard .yh-fc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(740px, calc(100% - 24px));
  margin: 0 auto 14px;
  color: var(--garden-muted);
  font-size: 14px;
  font-weight: 800;
}
.mode-flashcard .yh-fc-meta strong { color: var(--garden-coral); font-size: 18px; }
.mode-flashcard .yh-fc-autoread {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 11px;
  color: var(--garden-muted);
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
  background: var(--garden-paper);
  border: 1px solid var(--garden-line);
  border-radius: 7px;
}
.mode-flashcard .yh-fc-autoread span { color: #b7aa99; font-size: 18px; line-height: 1; }
.mode-flashcard .yh-fc-autoread.is-on { color: var(--fc-leaf); border-color: #b8d0c0; background: #f2f8f4; }
.mode-flashcard .yh-fc-autoread.is-on span { color: var(--fc-leaf); }

.mode-flashcard .yh-fc { position: relative; width: min(740px, calc(100% - 24px)); max-width: none; margin: 0 auto; }
.mode-flashcard .yh-fc-stack,
.mode-flashcard .yh-fc-stack::before,
.mode-flashcard .yh-fc-stack::after {
  position: absolute;
  inset: 0;
  content: "";
  background: #f1e6d6;
  border: 1px solid #ddcbb3;
  border-radius: 8px;
}
.mode-flashcard .yh-fc-stack { transform: translate(9px, 10px) rotate(1.1deg); opacity: .74; }
.mode-flashcard .yh-fc-stack::before { transform: translate(-16px, -4px) rotate(-1.7deg); background: #e5f0e8; }
.mode-flashcard .yh-fc-stack::after { transform: translate(5px, -5px) rotate(.5deg); background: #f9e8df; }

.mode-flashcard .yh-fc-card {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: clamp(390px, 54vh, 500px);
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 8px;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
}
.mode-flashcard .yh-fc-card:focus-visible { outline: 4px solid rgba(82, 126, 156, .28); outline-offset: 7px; }
.mode-flashcard .yh-fc-in { display: block; position: relative; width: 100%; height: 100%; transition: transform .62s cubic-bezier(.2,.72,.22,1); transform-style: preserve-3d; }
.mode-flashcard .yh-fc-card.flip .yh-fc-in { transform: rotateY(180deg); }

.mode-flashcard .yh-fc-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(220px, 44%) 1fr;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(32px, 5vw, 58px);
  overflow: hidden;
  color: var(--garden-ink);
  text-align: left;
  backface-visibility: hidden;
  background: var(--garden-paper);
  border: 1px solid #dfcbb2;
  border-top: 6px solid var(--garden-coral);
  border-bottom: 6px solid #ddc9af;
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(92, 70, 46, .15);
}
.mode-flashcard .yh-fc-front::before,
.mode-flashcard .yh-fc-back::before {
  position: absolute;
  right: -55px;
  bottom: -76px;
  width: 210px;
  height: 155px;
  content: "";
  background: repeating-linear-gradient(118deg, transparent 0 20px, rgba(201,107,84,.08) 21px 32px);
  transform: rotate(-8deg);
}
.mode-flashcard .yh-fc-back { transform: rotateY(180deg); grid-template-columns: 1fr; background: #f1f8f3; border-color: #b8d0c0; border-top-color: var(--fc-leaf); border-bottom-color: #9fbea9; }
.mode-flashcard .yh-fc-back::before { background: repeating-linear-gradient(118deg, transparent 0 20px, rgba(89,140,112,.09) 21px 32px); }

.mode-flashcard .yh-fc-face-label {
  position: absolute;
  top: 20px;
  left: 24px;
  padding: 5px 10px;
  color: var(--garden-coral-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--garden-coral-soft);
  border-radius: 6px;
}
.mode-flashcard .yh-fc-face-label.is-back { color: #3f7458; background: #dcece1; }
.mode-flashcard .yh-fc-visual,
.mode-flashcard .yh-fc-back-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
  background: var(--fc-blue-soft);
  border: 1px solid #cadde5;
  border-bottom: 5px solid #b3d0dc;
  border-radius: 8px;
}
.mode-flashcard .yh-fc-visual::after {
  position: absolute;
  right: 15px;
  bottom: 13px;
  width: 30px;
  height: 19px;
  content: "";
  border-radius: 50% 50% 12% 12%;
  background: #d6a647;
  box-shadow: -22px 3px 0 #6e9e80, -43px -1px 0 #c96b54;
  opacity: .38;
}
.mode-flashcard .yh-fc-animal { display: block; width: min(210px, 82%); height: min(210px, 82%); object-fit: contain; filter: drop-shadow(0 12px 8px rgba(61,50,41,.12)); animation: fc-animal-in .45s cubic-bezier(.2,.8,.2,1) both; }
.mode-flashcard .yh-fc-emoji { width: auto; height: auto; font-size: clamp(112px, 15vw, 170px); line-height: 1; }
.mode-flashcard .yh-fc-copy { min-width: 0; }
.mode-flashcard .yh-fc-copy h2 { margin: 0; color: var(--garden-ink); font-size: clamp(42px, 6vw, 66px); line-height: 1.05; overflow-wrap: anywhere; letter-spacing: 0; }
.mode-flashcard .yh-fc-phonetic { display: block; margin-top: 14px; color: var(--fc-blue); font-size: clamp(18px, 2.6vw, 24px); font-weight: 700; }

.mode-flashcard .yh-fc-back-grid { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: clamp(24px, 5vw, 48px); width: min(620px, 100%); margin: 0 auto; }
.mode-flashcard .yh-fc-back-visual { min-height: 180px; background: #e4f0e8; border-color: #bfd4c5; border-bottom-color: #a5c3ae; }
.mode-flashcard .yh-fc-animal.is-small { width: 145px; height: 145px; font-size: 118px; }
.mode-flashcard .yh-fc-definition { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
.mode-flashcard .yh-fc-word-small { margin-bottom: 9px; color: var(--fc-leaf); font-size: 15px; font-weight: 900; text-transform: uppercase; }
.mode-flashcard .yh-fc-definition strong { color: var(--garden-ink); font-size: clamp(32px, 5vw, 48px); line-height: 1.17; overflow-wrap: anywhere; }
.mode-flashcard .yh-fc-example { margin-top: 18px; color: #6f655a; font-size: 17px; font-weight: 700; line-height: 1.55; }
.mode-flashcard .yh-fc-flip-cue { position: absolute; right: 22px; bottom: 18px; display: inline-flex; align-items: center; gap: 7px; color: var(--garden-muted); font-size: 13px; font-weight: 800; }
.mode-flashcard .yh-fc-flip-cue span { color: var(--garden-coral); font-size: 19px; }
.mode-flashcard .yh-fc-back .yh-fc-flip-cue span { color: var(--fc-leaf); }

.mode-flashcard .yh-game-actions {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) minmax(190px, 1.45fr) minmax(120px, 1fr);
  gap: 10px;
  width: min(650px, calc(100% - 24px));
  margin: 26px auto 0;
}
.mode-flashcard .yh-game-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 50px; margin: 0; }
.mode-flashcard .yh-game-actions .btn:disabled { cursor: not-allowed; opacity: .42; transform: none; }
.mode-flashcard .yh-fc-listen { background: var(--fc-leaf) !important; border-color: var(--fc-leaf) !important; box-shadow: 0 3px 0 #3e7055 !important; }
.mode-flashcard .yh-fc-listen:hover { background: #477b5d !important; border-color: #477b5d !important; }
.mode-flashcard .yh-fc-listen-icon { display: inline-grid; width: 28px; height: 28px; place-items: center; font-size: 20px; }
.mode-flashcard .yh-fc-listen.is-speaking .yh-fc-listen-icon { animation: fc-sound-pulse .68s ease-in-out infinite alternate; }

.yh-celebrate-piece { position: absolute; top: -24px; left: var(--x); z-index: 51; width: 9px; height: 20px; pointer-events: none; background: var(--c); border-radius: 2px; animation: fc-celebrate 1.45s var(--d) cubic-bezier(.2,.7,.25,1) both; transform: rotate(var(--r)); }

@keyframes fc-animal-in { from { opacity: 0; transform: translateY(12px) scale(.88); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fc-sound-pulse { from { transform: scale(1); } to { transform: scale(1.18) rotate(-5deg); } }
@keyframes fc-celebrate { 0% { opacity: 0; transform: translateY(0) rotate(0); } 12% { opacity: 1; } 100% { opacity: 0; transform: translateY(105vh) rotate(var(--r)); } }

@media (max-width: 700px) {
  .mode-flashcard .yh-game-main { padding: 14px 6px 50px; }
  .mode-flashcard .yh-fc-meta, .mode-flashcard .yh-fc { width: calc(100% - 14px); }
  .mode-flashcard .yh-fc-card { height: 480px; }
  .mode-flashcard .yh-fc-face { grid-template-columns: 1fr; grid-template-rows: minmax(210px, 1fr) auto; gap: 18px; padding: 56px 20px 46px; text-align: center; }
  .mode-flashcard .yh-fc-visual { width: min(260px, 86%); min-height: 220px; margin: 0 auto; }
  .mode-flashcard .yh-fc-animal { width: 180px; height: 180px; }
  .mode-flashcard .yh-fc-emoji { width: auto; height: auto; font-size: 132px; }
  .mode-flashcard .yh-fc-copy h2 { font-size: clamp(38px, 12vw, 52px); }
  .mode-flashcard .yh-fc-back { display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .mode-flashcard .yh-fc-back-grid { grid-template-columns: 1fr; gap: 16px; text-align: center; }
  .mode-flashcard .yh-fc-back-visual { width: 150px; min-height: 130px; margin: 0 auto; }
  .mode-flashcard .yh-fc-animal.is-small { width: 112px; height: 112px; font-size: 92px; }
  .mode-flashcard .yh-fc-definition { align-items: center; }
  .mode-flashcard .yh-fc-definition strong { font-size: clamp(31px, 9.5vw, 42px); }
  .mode-flashcard .yh-fc-example { margin-top: 11px; font-size: 15px; }
  .mode-flashcard .yh-fc-flip-cue { right: 50%; bottom: 14px; transform: translateX(50%); white-space: nowrap; }
  .mode-flashcard .yh-game-actions { grid-template-columns: 1fr 1.5fr 1fr; width: calc(100% - 14px); margin-top: 22px; }
  .mode-flashcard .yh-game-actions .btn { min-height: 48px; padding: 8px 10px; font-size: 14px; }
  .mode-flashcard .yh-fc-nav span:nth-child(2):not(:last-child) { display: none; }
}

@media (max-width: 430px) {
  .mode-flashcard .yh-fc-meta { margin-bottom: 10px; }
  .mode-flashcard .yh-fc-autoread { font-size: 12px; }
  .mode-flashcard .yh-fc-card { height: min(475px, 63vh); min-height: 410px; }
  .mode-flashcard .yh-fc-face { padding-top: 52px; }
  .mode-flashcard .yh-fc-visual { min-height: 190px; }
  .mode-flashcard .yh-fc-animal { width: 155px; height: 155px; }
  .mode-flashcard .yh-fc-emoji { width: auto; height: auto; font-size: 118px; }
  .mode-flashcard .yh-fc-listen span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mode-flashcard .yh-fc-in,
  .mode-flashcard .yh-fc-animal,
  .mode-flashcard .yh-fc-listen-icon,
  .yh-celebrate-piece { animation: none !important; transition-duration: .01ms !important; }
}

/* Vocabulary Adventure: shared world and learning system */
body.mode-game {
  --adventure-accent: #c96b54;
  --adventure-deep: #994835;
  --adventure-soft: #fff0e9;
  --adventure-blue: #4f86a6;
  --adventure-green: #4f8a68;
  --adventure-yellow: #d9a536;
  min-height: 100vh;
  background-color: #edf6e8;
  background-image: url("vocab-adventure-world.jpg");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}
body.mode-game::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background: rgba(248, 252, 244, .76);
}
body.mode-game .yh-game-header,
body.mode-game .yh-game-main,
body.mode-game .yh-done { position: relative; z-index: 1; }

body.mode-quiz4, body.mode-fillin3, body.mode-fillin6 { --adventure-accent: #4f86a6; --adventure-deep: #356882; --adventure-soft: #eaf5fa; }
body.mode-quiz5, body.mode-vowel1, body.mode-wordsearch1 { --adventure-accent: #c6912d; --adventure-deep: #93671e; --adventure-soft: #fff7dc; }
body.mode-quiz7, body.mode-matching1, body.mode-connect2 { --adventure-accent: #4f8a68; --adventure-deep: #35684b; --adventure-soft: #e9f5ed; }
body.mode-unscramble1, body.mode-unscramble2, body.mode-memory2 { --adventure-accent: #8a6fac; --adventure-deep: #665087; --adventure-soft: #f3edf9; }

body.mode-game .yh-game-header {
  background: rgba(255, 255, 255, .94);
  border-color: rgba(255, 255, 255, .94);
  border-bottom-color: rgba(124, 102, 72, .18);
  box-shadow: 0 8px 24px rgba(55, 82, 50, .12);
}
.yh-game-title, .yh-game-score { color: var(--adventure-accent); }
.yh-bar-fill { background: var(--adventure-accent); }
.yh-game-score { background: var(--adventure-soft); border-color: color-mix(in srgb, var(--adventure-accent) 34%, #fff); }
.yh-score-label { color: var(--adventure-deep); }

.yh-learning-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #354132;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255,255,255,.9);
  border-bottom: 3px solid rgba(92, 111, 73, .17);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(50, 78, 46, .11);
}
.yh-learning-world { display: flex; align-items: center; gap: 10px; min-width: 0; }
.yh-learning-world > span:last-child { display: grid; min-width: 0; }
.yh-learning-world strong { font-size: 14px; line-height: 1.25; }
.yh-learning-world small { color: #71806d; font-size: 12px; line-height: 1.3; }
.yh-learning-compass {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #fff;
  font-size: 20px;
  background: var(--adventure-accent);
  border: 3px solid var(--adventure-soft);
  border-radius: 50%;
  box-shadow: 0 2px 0 var(--adventure-deep);
}
.yh-learning-stats { display: flex; align-items: center; gap: 7px; }
.yh-learning-stats > span { min-width: 82px; padding: 6px 9px; color: #687563; font-size: 11px; font-weight: 800; text-align: center; background: #f6f8f3; border: 1px solid #e5eadf; border-radius: 7px; }
.yh-learning-stats b { display: block; color: var(--adventure-deep); font-size: 16px; line-height: 1; }

.yh-mode-intro {
  margin-bottom: 14px;
  background: rgba(255,255,255,.93);
  border-color: rgba(255,255,255,.9);
  border-left-color: var(--adventure-accent);
  border-bottom-color: rgba(90, 75, 53, .16);
  box-shadow: 0 12px 30px rgba(55, 82, 50, .1);
}
.yh-mode-number { background: var(--adventure-accent); box-shadow: 0 3px 0 var(--adventure-deep); }
.yh-mode-kicker, .yh-mode-count strong { color: var(--adventure-accent); }

body.mode-game .ant-card,
body.mode-game .yhw-card,
body.mode-game .yhw-memory-card-wrapper,
body.mode-game .yhw-vowel-card,
body.mode-game .yhw-ws-layout {
  background: rgba(255,255,255,.96) !important;
  border: 1px solid rgba(255,255,255,.94) !important;
  border-bottom: 4px solid rgba(80, 98, 64, .18) !important;
  border-radius: 8px !important;
  box-shadow: 0 20px 48px rgba(45, 75, 42, .14) !important;
}
.yh-game-main .btn,
.yh-game-main button.btn,
.yh-game-main a.btn,
.yh-done .btn { background: var(--adventure-accent); border-color: var(--adventure-accent); box-shadow: 0 3px 0 var(--adventure-deep); }
.yh-game-main .btn:hover, .yh-done .btn:hover { background: var(--adventure-deep); border-color: var(--adventure-deep); }
.yh-game-main .btn-ghost, .yh-done .btn-ghost { color: var(--adventure-deep) !important; background: #fff !important; border-color: color-mix(in srgb, var(--adventure-accent) 35%, #ddd) !important; }

.yh-recall-toast {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(330px, calc(100vw - 28px));
  padding: 11px 13px;
  color: #274633;
  pointer-events: none;
  background: #f0faF3;
  border: 1px solid #bcd8c5;
  border-bottom: 4px solid #86b294;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(36, 67, 42, .2);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .2s ease, transform .2s ease;
}
.yh-recall-toast[data-tone="review"] { color: #7f4b37; background: #fff3ed; border-color: #efc1ad; border-bottom-color: #d98768; }
.yh-recall-toast.is-show { opacity: 1; transform: translateY(0); }
.yh-recall-toast > span:last-child { display: grid; min-width: 0; }
.yh-recall-toast strong { font-size: 14px; }
.yh-recall-toast small { overflow: hidden; color: inherit; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; opacity: .82; }
.yh-recall-mark { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; color: #fff; font-weight: 900; background: #4f8a68; border-radius: 50%; }
.yh-recall-toast[data-tone="review"] .yh-recall-mark { background: #c96b54; }

/* Recall and listening prompts */
.mode-quiz .yhw-quiz-prompt,
.mode-fillin2 .yhw-quiz-prompt, .mode-fillin3 .yhw-quiz-prompt,
.mode-fillin5 .yhw-quiz-prompt, .mode-fillin6 .yhw-quiz-prompt {
  min-height: 150px;
  background: var(--adventure-soft);
  border-color: color-mix(in srgb, var(--adventure-accent) 30%, #ddd);
  border-top: 5px solid var(--adventure-accent);
}
.yh-recall-prompt-image { display: block; width: 104px; height: 104px; margin: 0 auto 8px; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(42,62,39,.11)); animation: adventure-pop .34s ease-out both; }
.mode-quiz .yhw-quiz-word-prompt-button { color: #2f392e; }
.mode-quiz .yhw-quiz-option { width: 100%; min-height: 88px; padding: 0; color: #343d33; font: inherit; letter-spacing: 0; text-align: left; cursor: pointer; }
.mode-quiz .yhw-quiz-option-slot-0 { background: #fff0eb; border-color: #efc5b5; border-bottom-color: #d99174; }
.mode-quiz .yhw-quiz-option-slot-1 { background: #fff8df; border-color: #ead79a; border-bottom-color: #d6ad43; }
.mode-quiz .yhw-quiz-option-slot-2 { background: #edf8f0; border-color: #bfd9c6; border-bottom-color: #79aa88; }
.mode-quiz .yhw-quiz-option-slot-3 { background: #edf6fb; border-color: #bdd7e5; border-bottom-color: #72a6c0; }
.mode-quiz .yhw-quiz-option:hover { transform: translateY(-3px); box-shadow: 0 9px 18px rgba(55, 76, 48, .12); }
.mode-quiz .yhw-quiz-option-letter-badge { background: var(--adventure-accent); }

.yhw-quiz-feedback { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
.yhw-quiz-feedback .btn { min-width: 120px; }
.yhw-fillin-input { color: #2f392e; background: #fff; border: 2px solid #dce7d7; border-bottom-width: 4px; }
.yhw-fillin-input:focus { border-color: var(--adventure-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--adventure-accent) 18%, transparent); }
.yhw-fillin-slot { background: #fff; border-color: color-mix(in srgb, var(--adventure-accent) 42%, #ddd); border-bottom-width: 4px; }

/* Spelling and arranging */
.mode-unscramble1 .yhw-unscramble-top,
.mode-unscramble2 .yhw-unscramble-top { position: relative; overflow: hidden; background: var(--adventure-soft); border-top: 5px solid var(--adventure-accent); }
.yh-mini-prompt-image { display: block; width: 90px; height: 90px; margin: 0 auto 8px; object-fit: contain; filter: drop-shadow(0 7px 7px rgba(42,62,39,.11)); }
.yhw-unscramble-tile { color: #fff; background: var(--adventure-accent); border-color: var(--adventure-deep); box-shadow: 0 4px 0 var(--adventure-deep); }
.yhw-unscramble-tile:hover { transform: translateY(-3px) rotate(-2deg); }
.yhw-unscramble-tile.sel { color: var(--adventure-deep); background: #fff; border-color: var(--adventure-accent); }

/* Matching, connecting and memory */
.mode-matching1 .yhw-match-top-section,
.mode-matching1 .yhw-match-bottom-section { background: rgba(248,252,246,.9); border-color: #dce8d7; }
.mode-matching1 .yhw-match-top-card,
.mode-matching1 .yhw-match-bottom-card { color: #343d33; font: inherit; letter-spacing: 0; cursor: pointer; background: #fff; }
.yh-match-thumb { display: block; width: 52px; height: 52px; margin: 0 auto 5px; object-fit: contain; }
.mode-matching1 .yhw-match-top-card--active,
.mode-matching1 .yhw-match-bottom-card--active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--adventure-accent) 20%, transparent); }

.mode-memory2 .yhw-memory-card-wrapper { position: relative; overflow: hidden; }
.mode-memory2 .yhw-memory-card-front { background: var(--adventure-accent); border-color: var(--adventure-deep); }
.mode-memory2 .yhw-memory-card-back { color: #354132; background: #fff; border-color: #dce8d7; }
.yh-memory-thumb {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 7px 8px rgba(42,62,39,.12));
}
.mode-memory2 .yhw-memory-card-text {
  display: grid;
  align-content: center;
  padding: 10px;
  font-size: clamp(22px, 2.7vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.mode-memory2 .yhw-memory-card--word .yhw-memory-card-text { font-size: clamp(32px, 4vw, 46px); font-weight: 900; }
.mode-memory2 .yhw-memory-card--image .yhw-memory-card-text {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 9px;
  overflow: hidden;
  background: linear-gradient(145deg,#f7fbf4 0%,#fffaf1 100%);
}
.mode-memory2 .yhw-memory-card--long .yhw-memory-card-text { font-size: clamp(20px, 2.35vw, 26px); }
.mode-memory2 .yhw-memory-card--very-long .yhw-memory-card-text { font-size: clamp(17px, 2vw, 22px); }
.mode-memory2 .yhw-memory-card.is-matched .yhw-memory-card-back { background: #e6f5ea; border-color: #75aa85; box-shadow: 0 0 0 3px rgba(79,138,104,.14); }
.mode-memory2 .yhw-memory-empty { display: grid; min-height: 240px; place-content: center; gap: 7px; padding: 28px; color: #354132; text-align: center; }
.mode-memory2 .yhw-memory-empty strong { font-size: clamp(20px,3vw,28px); }
.mode-memory2 .yhw-memory-empty span { color: #687164; }

@media (max-width: 640px) {
  .mode-memory2 .yhw-memory-card-text { padding: 5px; font-size: clamp(19px, 6vw, 24px); }
  .mode-memory2 .yhw-memory-card--word .yhw-memory-card-text { font-size: clamp(27px, 9vw, 36px); }
  .mode-memory2 .yhw-memory-card--image .yhw-memory-card-text { padding: 5px; }
  .mode-memory2 .yhw-memory-card--long .yhw-memory-card-text { font-size: clamp(17px, 5vw, 21px); }
  .mode-memory2 .yhw-memory-card--very-long .yhw-memory-card-text { font-size: clamp(14px, 4.2vw, 18px); }
}

.yh-connect-thumb { width: 38px; height: 38px; flex: 0 0 38px; object-fit: contain; }
.mode-connect2 .yhc-connect-item { min-height: 64px; background: rgba(255,255,255,.97); }
.mode-connect2 .yhc-connect-item.is-correct { background: #edf8f0; }

/* Vowels and word search */
.yh-vowel-learning-hint { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; background: var(--adventure-soft) !important; border-top: 5px solid var(--adventure-accent) !important; }
.yh-vowel-learning-hint .yh-mini-prompt-image { margin: 0; }
.yh-inline-sound { display: grid; width: 48px; height: 48px; place-items: center; cursor: pointer; background: #fff; border: 2px solid color-mix(in srgb, var(--adventure-accent) 45%, #ddd); border-radius: 50%; font-size: 23px; }
.yhw-vowel-letter { color: var(--adventure-deep) !important; background: #fff !important; border-color: color-mix(in srgb, var(--adventure-accent) 38%, #ddd); border-bottom-width: 4px; }
.yhw-vowel-letter:hover { color: #fff !important; background: var(--adventure-accent) !important; border-color: var(--adventure-deep); transform: translateY(-3px); }

.mode-wordsearch1 .yhw-ws-layout { padding: clamp(12px, 2vw, 22px); }
.mode-wordsearch1 .yhw-ws-grid { background: #f6f1df; border-color: #e5d7a4; }
.mode-wordsearch1 .yhw-ws-cell { color: #3a4338; background: #fff; border-color: #e2e9de; }
.mode-wordsearch1 .yhw-ws-cell--preview { color: #fff; background: var(--adventure-yellow); border-color: #b98725; }
.mode-wordsearch1 .yhw-ws-cell--found { color: #fff; background: var(--adventure-green); border-color: #35684b; }
.mode-wordsearch1 .yhw-ws-wordlist-item { display: grid; gap: 2px; min-width: 0; text-align: left; background: #fff; }
.mode-wordsearch1 .yhw-ws-wordlist-item strong { font-size: 14px; }
.mode-wordsearch1 .yhw-ws-wordlist-item small { overflow: hidden; color: #778373; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mode-wordsearch1 .yhw-ws-wordlist-item--found small { color: rgba(255,255,255,.82); }

/* Flashcard confidence controls */
.mode-flashcard .yh-game-actions { grid-template-columns: 90px 118px minmax(130px,1fr) minmax(130px,1fr); width: min(720px, calc(100% - 24px)); }
.mode-flashcard .yh-fc-rate--review { color: #85452f !important; background: #fff1ea !important; border-color: #e8ae95 !important; box-shadow: 0 3px 0 #ce8566 !important; }
.mode-flashcard .yh-fc-rate--known { color: #fff !important; background: #4f8a68 !important; border-color: #4f8a68 !important; box-shadow: 0 3px 0 #35684b !important; }

.yh-done-card { position: relative; overflow: hidden; border-top: 6px solid var(--adventure-accent); }
.yh-done-mark { background: var(--adventure-green); box-shadow: 0 4px 0 #35684b; }
.yh-done-kicker, .yh-done-score { color: var(--adventure-accent); }

@keyframes adventure-pop { from { opacity: 0; transform: scale(.85) translateY(7px); } to { opacity: 1; transform: scale(1) translateY(0); } }

@media (max-width: 720px) {
  body.mode-game { background-position: 42% top; background-attachment: scroll; }
  body.mode-game::before { background: rgba(248, 252, 244, .82); }
  .yh-learning-hud { align-items: stretch; flex-direction: column; gap: 8px; }
  .yh-learning-stats { display: grid; grid-template-columns: repeat(3,1fr); }
  .yh-learning-stats > span { min-width: 0; }
  .yh-recall-toast { top: auto; right: 14px; bottom: 14px; }
  .yh-recall-prompt-image { width: 82px; height: 82px; }
  .mode-quiz .yhw-quiz-prompt { min-height: 120px; }
  .mode-quiz .yhw-quiz-option { min-height: 72px; }
  .yh-match-thumb { width: 42px; height: 42px; }
  .mode-flashcard .yh-game-actions { grid-template-columns: 1fr 1fr; width: calc(100% - 14px); }
  .mode-flashcard .yh-game-actions .btn { min-height: 46px; }
  .mode-wordsearch1 .yhw-ws-wordlist-item small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .yh-recall-toast,
  .yh-recall-prompt-image,
  .yhw-unscramble-tile,
  .yhw-vowel-letter { animation: none !important; transition: none !important; }
}

/* Flashcard: vocabulary journey lives in the game topbar. */
.mode-flashcard .yh-game-header {
  grid-template-columns: minmax(250px, 1fr) auto minmax(190px, 300px) minmax(300px, auto) auto 40px;
  gap: 12px;
}
.mode-flashcard .yh-learning-hud--topbar {
  display: flex;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 8px;
  color: var(--garden-ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.mode-flashcard .yh-learning-hud--topbar .yh-learning-world { gap: 7px; }
.mode-flashcard .yh-learning-hud--topbar .yh-learning-compass {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-width: 2px;
  font-size: 16px;
  box-shadow: none;
}
.mode-flashcard .yh-learning-hud--topbar .yh-learning-world strong { font-size: 12px; white-space: nowrap; }
.mode-flashcard .yh-learning-hud--topbar .yh-learning-world small { max-width: 126px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mode-flashcard .yh-learning-hud--topbar .yh-learning-stats { display: flex; gap: 5px; }
.mode-flashcard .yh-learning-hud--topbar .yh-learning-stats > span {
  min-width: 52px;
  padding: 4px 6px;
  line-height: 1;
  background: #f6f8f3;
}
.mode-flashcard .yh-learning-hud--topbar .yh-learning-stats b { font-size: 14px; }
.mode-flashcard .yh-learning-hud--topbar .yh-learning-stats small { display: block; margin-top: 3px; color: #687563; font-size: 9px; }

@media (max-width: 1180px) {
  .mode-flashcard .yh-game-header { grid-template-columns: minmax(180px,1fr) auto minmax(160px,240px) auto auto 38px; gap: 9px; }
  .mode-flashcard .yh-learning-hud--topbar .yh-learning-world { display: none; }
  .mode-flashcard .yh-learning-hud--topbar .yh-learning-stats > span { min-width: 47px; padding-inline: 4px; }
}

@media (max-width: 840px) {
  .mode-flashcard .yh-game-header { grid-template-columns: minmax(0,1fr) minmax(150px,220px) auto auto 38px; }
}

@media (max-width: 620px) {
  .mode-flashcard .yh-game-header { grid-template-columns: minmax(0,1fr) auto; }
  .mode-flashcard .yh-learning-hud--topbar { order: 4; grid-column: 1 / -1; width: 100%; }
  .mode-flashcard .yh-learning-hud--topbar .yh-learning-stats { display: grid; grid-template-columns: repeat(3,1fr); width: 100%; }
  .mode-flashcard .yh-learning-hud--topbar .yh-learning-stats > span { min-width: 0; }
}

/* Flashcard visual refresh. */
.mode-flashcard .yh-game-main { width: min(1040px,100%); max-width: 1040px; padding-top: 22px; }
.mode-flashcard #yhStage,
.mode-flashcard .yhw-quiz-card,
.mode-flashcard .yhw-quiz-card > .ant-card-body {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.mode-game.mode-flashcard .ant-card.yhw-quiz-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.mode-flashcard .yhw-quiz-card { width: min(920px,100%); }
.mode-flashcard .yh-fc-shell { padding: 0 12px; }
.mode-flashcard .yh-fc-meta {
  width: min(820px,100%);
  min-height: 44px;
  margin-bottom: 13px;
  padding: 5px 7px 5px 13px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(52,74,45,.1);
  backdrop-filter: blur(10px);
}
.mode-flashcard .yh-fc-counter { display: flex; min-width: 0; align-items: center; gap: 13px; }
.mode-flashcard .yh-fc-counter > span { white-space: nowrap; }
.mode-flashcard .yh-fc-counter > i {
  width: clamp(90px,16vw,180px);
  height: 7px;
  overflow: hidden;
  background: #e9e2d7;
  border-radius: 4px;
}
.mode-flashcard .yh-fc-counter > i > b { display: block; height: 100%; background: var(--garden-coral); border-radius: inherit; transition: width .3s ease; }
.mode-flashcard .yh-fc-round { padding: 4px 7px; color: #4f8a68; font-size: 10px; font-style: normal; font-weight: 900; white-space: nowrap; background: #e8f3ea; border-radius: 5px; }
.mode-flashcard .yh-fc-autoread { min-height: 32px; padding: 4px 10px; background: rgba(255,255,255,.9); }
.mode-flashcard .yh-fc { width: min(820px,100%); }
.mode-flashcard .yh-fc-stack { transform: translate(10px,9px) rotate(.8deg); opacity: .72; }
.mode-flashcard .yh-fc-stack::before { transform: translate(-10px,-5px) rotate(-.9deg); background: #e3efe6; }
.mode-flashcard .yh-fc-stack::after { transform: translate(5px,-3px) rotate(.35deg); background: #f9e8df; }
.mode-flashcard .yh-fc-card { height: clamp(400px,58vh,460px); animation: fc-card-enter .38s cubic-bezier(.2,.76,.25,1) both; }
.mode-flashcard .yh-fc-face {
  grid-template-columns: minmax(270px,42%) minmax(0,1fr);
  gap: clamp(28px,5vw,64px);
  padding: 48px clamp(42px,6vw,68px);
  background: rgba(255,253,248,.98);
  border: 1px solid #ddc7ac;
  border-top: 7px solid #527e9c;
  border-bottom: 7px solid #d8bea0;
  box-shadow: 0 26px 58px rgba(74,58,39,.2);
}
.mode-flashcard .yh-fc-front::before {
  right: -25px;
  bottom: -44px;
  width: 180px;
  height: 130px;
  background: repeating-linear-gradient(118deg,transparent 0 17px,rgba(82,126,156,.08) 18px 28px);
}
.mode-flashcard .yh-fc-face-label { top: 21px; left: 24px; padding: 6px 11px; box-shadow: 0 3px 0 rgba(169,82,63,.1); }
.mode-flashcard .yh-fc-visual {
  min-height: 285px;
  background: #e9f4f8;
  border: 2px solid #c6dfe8;
  border-bottom: 7px solid #aacbd8;
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.34);
}
.mode-flashcard .yh-fc-visual::before {
  position: absolute;
  inset: 13px;
  content: "";
  pointer-events: none;
  border: 1px dashed rgba(82,126,156,.2);
  border-radius: 6px;
}
.mode-flashcard .yh-fc-animal { width: min(245px,84%); height: min(245px,84%); filter: drop-shadow(0 15px 10px rgba(61,50,41,.16)); }
.mode-flashcard .yh-fc-copy { position: relative; padding: 22px 0; }
.mode-flashcard .yh-fc-copy::before {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 8px;
  color: #4d755d;
  content: "TỪ VỰNG";
  font-size: 10px;
  font-weight: 900;
  background: #e6f1e9;
  border-radius: 5px;
}
.mode-flashcard .yh-fc-copy h2 { color: #342b24; font-size: clamp(48px,6vw,72px); }
.mode-flashcard .yh-fc-phonetic { display: inline-flex; margin-top: 13px; padding: 7px 11px; color: #426d8b; background: #edf6fa; border: 1px solid #d2e5ed; border-radius: 6px; }
.mode-flashcard .yh-fc-flip-cue { right: 24px; bottom: 19px; padding: 7px 10px; background: rgba(255,255,255,.72); border: 1px solid #eee3d5; border-radius: 6px; }
.mode-flashcard .yh-fc-back {
  grid-template-columns: minmax(0,1fr);
  border-top-color: var(--fc-leaf);
  border-bottom-color: #8db29a;
  background: #f1f8f3;
}
.mode-flashcard .yh-fc-back-grid {
  grid-template-columns: minmax(210px,260px) minmax(0,1fr);
  width: min(700px,100%);
  gap: clamp(32px,5vw,56px);
}
.mode-flashcard .yh-fc-back-visual { min-height: 220px; border-width: 2px; border-bottom-width: 7px; }
.mode-flashcard .yh-fc-definition { width: 100%; }
.mode-flashcard .yh-fc-definition strong {
  max-width: 100%;
  color: #304137;
  overflow-wrap: normal;
  word-break: normal;
}
.mode-flashcard .yh-fc-example { max-width: 360px; }
.mode-flashcard .yh-game-actions {
  grid-template-columns: 84px 116px minmax(160px,1fr) minmax(160px,1fr);
  width: min(760px,calc(100% - 24px));
  gap: 9px;
  margin-top: 22px;
  padding: 8px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(49,72,43,.12);
  backdrop-filter: blur(9px);
}
.mode-flashcard .yh-game-actions .btn { min-height: 46px; border-radius: 7px !important; }
.mode-flashcard .yh-fc-nav { color: #766b5f !important; background: #fffdf9 !important; border-color: #ddd2c5 !important; }
.mode-flashcard .yh-fc-rate--review { color: #8b4934 !important; background: #fff1ea !important; border-color: #e5aa91 !important; }
.mode-flashcard .yh-fc-rate--known { background: #4f8a68 !important; border-color: #4f8a68 !important; }
@keyframes fc-card-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 700px) {
  .mode-flashcard .yh-game-main { padding-top: 12px; }
  .mode-flashcard .yh-fc-shell { padding: 0 5px; }
  .mode-flashcard .yh-fc-meta { width: 100%; }
  .mode-flashcard .yh-fc-counter { gap: 8px; }.mode-flashcard .yh-fc-counter > i { width: 72px; }
  .mode-flashcard .yh-fc { width: 100%; }
  .mode-flashcard .yh-fc-card { height: min(500px,62vh); min-height: 420px; }
  .mode-flashcard .yh-fc-face { grid-template-columns: 1fr; grid-template-rows: minmax(220px,1fr) auto; gap: 12px; padding: 56px 18px 48px; }
  .mode-flashcard .yh-fc-visual { width: min(280px,88%); min-height: 230px; }
  .mode-flashcard .yh-fc-copy { padding: 0; text-align: center; }.mode-flashcard .yh-fc-copy::before { margin-bottom: 7px; }
  .mode-flashcard .yh-fc-copy h2 { font-size: clamp(40px,12vw,54px); }
  .mode-flashcard .yh-fc-phonetic { margin-top: 8px; }
  .mode-flashcard .yh-fc-flip-cue { right: 50%; bottom: 12px; max-width: calc(100% - 36px); transform: translateX(50%); white-space: nowrap; }
  .mode-flashcard .yh-fc-back { grid-template-columns: 1fr; }
  .mode-flashcard .yh-fc-back-grid { grid-template-columns: 1fr; width: 100%; gap: 14px; justify-items: center; }
  .mode-flashcard .yh-fc-back-visual { width: 170px; min-height: 140px; }
  .mode-flashcard .yh-fc-definition { align-items: center; text-align: center; }
  .mode-flashcard .yh-fc-example { max-width: 300px; margin-top: 10px; font-size: 14px; line-height: 1.4; }
  .mode-flashcard .yh-game-actions { grid-template-columns: 64px 84px 1fr 1fr; width: 100%; padding: 6px; }
  .mode-flashcard .yh-game-actions .btn { min-height: 44px; padding: 6px 7px; }
}

@media (max-width: 460px) {
  .mode-flashcard .yh-fc-autoread { font-size: 11px; }.mode-flashcard .yh-fc-autoread span { font-size: 15px; }
  .mode-flashcard .yh-fc-counter > i { display: none; }
  .mode-flashcard .yh-fc-card { height: min(480px,59vh); min-height: 405px; }
  .mode-flashcard .yh-fc-visual { min-height: 195px; }
  .mode-flashcard .yh-fc-animal { width: 165px; height: 165px; }
  .mode-flashcard .yh-game-actions { grid-template-columns: 52px 62px 1fr 1fr; gap: 5px; }
  .mode-flashcard .yh-game-actions .btn { font-size: 12px; }.mode-flashcard .yh-fc-listen-icon { width: 22px; font-size: 17px; }
  .mode-flashcard .yh-fc-listen span:last-child, .mode-flashcard .yh-fc-nav span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mode-flashcard .yh-fc-card { animation: none !important; }
}

/* Completion celebration must stay above the game world. */
body.mode-game .yh-done {
  position: fixed !important;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  padding: 20px;
  background: rgba(40,49,38,.64);
  backdrop-filter: blur(8px);
}
body.mode-game .yh-done.show { display: grid; }
body.mode-game .yh-done-card {
  position: relative;
  z-index: 53;
  box-sizing: border-box;
  width: min(500px,calc(100vw - 32px));
  max-width: 500px;
  padding: 32px 30px 28px;
  overflow: visible;
  background: #fffdf8;
  border: 1px solid rgba(255,255,255,.92);
  border-top: 7px solid #d19a33;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(25,34,23,.34), 0 7px 0 rgba(65,83,55,.18);
  animation: yh-finish-card-in .48s cubic-bezier(.18,.82,.24,1.12) both;
}
body.mode-game .yh-done-mark {
  display: grid;
  width: 70px;
  height: 70px;
  margin: -4px auto 14px;
  place-items: center;
  color: #fff;
  font-size: 34px;
  background: #4f8a68;
  border: 6px solid #e8f3e9;
  border-radius: 50%;
  box-shadow: 0 5px 0 #35684b, 0 0 0 7px rgba(79,138,104,.12);
  animation: yh-finish-check-in .58s .18s cubic-bezier(.18,.82,.24,1.18) both;
}
body.mode-game .yh-done-kicker { margin-bottom: 5px; color: #a26343; font-size: 12px; font-weight: 900; text-transform: uppercase; }
body.mode-game .yh-done-card h2 { margin: 0; color: #2f392e; font-size: clamp(28px,5vw,38px); letter-spacing: 0; }
body.mode-game .yh-done-score { display: flex; align-items: baseline; justify-content: center; margin: 8px 0 4px; color: #c96b54; font-size: 52px; line-height: 1; }
body.mode-game .yh-done-max { color: #867a6d; font-size: 24px; }
body.mode-game .yh-done-sub { max-width: 410px; margin: 12px auto 22px; color: #685f55; font-size: 15px; font-weight: 700; line-height: 1.55; }
body.mode-game .yh-done-btns { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
body.mode-game .yh-done-btns .btn { min-height: 46px; padding: 9px 16px; border-radius: 7px !important; }
body.mode-journey .yh-game-title, body.mode-random-review .yh-game-title { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
body.mode-game .yh-journey-step { padding: 4px 7px; border: 1px solid #e2cbbf; border-radius: 5px; color: #8f5c49; background: #fff4ee; font-size: 10px; font-weight: 900; line-height: 1; white-space: nowrap; }
body.mode-game .yh-next-mode { min-width: 220px; justify-content: center; color: #fff; background: #4f8a68; border-color: #4f8a68; box-shadow: 0 4px 0 #35684b; font-weight: 900; }
body.mode-game .yh-next-mode:hover { color: #fff; background: #42795a; transform: translateY(1px); box-shadow: 0 3px 0 #35684b; }
body.mode-random-review .yh-journey-step { color: #365f78; background: #edf6fb; border-color: #b9d2e1; }
.yh-celebrate-piece {
  position: absolute;
  top: -30px;
  left: var(--x);
  z-index: 52;
  width: var(--s);
  height: calc(var(--s) * 1.75);
  pointer-events: none;
  background: var(--c);
  border-radius: 2px;
  animation: yh-confetti-fall 2.35s var(--d) cubic-bezier(.15,.62,.22,1) both;
}
.yh-celebrate-piece.is-round { height: var(--s); border-radius: 50%; }
@keyframes yh-finish-card-in { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes yh-finish-check-in { from { opacity: 0; transform: scale(.35) rotate(-18deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes yh-confetti-fall {
  0% { opacity: 0; transform: translate3d(0,-20px,0) rotate(0); }
  8% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift),105vh,0) rotate(var(--r)); }
}

@media (max-width: 560px) {
  body.mode-game .yh-done { padding: 14px; }
  body.mode-game .yh-done-card { padding: 26px 18px 22px; }
  body.mode-game .yh-done-mark { width: 60px; height: 60px; font-size: 29px; }
  body.mode-game .yh-done-score { font-size: 44px; }
  body.mode-game .yh-done-sub { margin-bottom: 18px; font-size: 13px; }
  body.mode-game .yh-done-btns { display: grid; grid-template-columns: 1fr; }
  body.mode-game .yh-done-btns .btn { width: 100%; }
  body.mode-game .yh-next-mode { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.mode-game .yh-done-card,
  body.mode-game .yh-done-mark,
  .yh-celebrate-piece { animation: none !important; }
}

.mode-flashcard .yh-review-empty {
  width: min(620px,calc(100% - 24px));
  margin: 26px auto 0;
  padding: 44px 30px 40px;
  text-align: center;
  background: rgba(255,253,248,.94);
  border: 1px solid #d8e4d8;
  border-top: 7px solid #4f8a68;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(45,75,42,.14);
}
.mode-flashcard .yh-review-empty-icon { display: grid; width: 66px; height: 66px; margin: 0 auto 16px; place-items: center; color: #fff; font-size: 31px; font-weight: 900; background: #4f8a68; border: 6px solid #e7f2e8; border-radius: 50%; box-shadow: 0 4px 0 #35684b; }
.mode-flashcard .yh-review-kicker { margin: 0; color: #4f8a68; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.mode-flashcard .yh-review-empty h1 { margin: 6px 0 10px; color: #2f392e; font-size: clamp(25px,4vw,34px); letter-spacing: 0; }
.mode-flashcard .yh-review-empty > p:not(.yh-review-kicker) { max-width: 470px; margin: 0 auto; color: #6d7469; line-height: 1.55; }
.mode-flashcard .yh-review-empty > div { display: flex; justify-content: center; gap: 9px; margin-top: 22px; flex-wrap: wrap; }

@media (max-width: 460px) {
  .mode-flashcard .yh-fc-round { display: none; }
  .mode-flashcard .yh-review-empty { padding: 34px 18px 30px; }
  .mode-flashcard .yh-review-empty > div { display: grid; grid-template-columns: 1fr; }
}

/* Flashcard React reference parity — 2026-07-17. */
body.mode-game.mode-flashcard {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  color: #334155;
  background: linear-gradient(180deg,#dbeafe 0%,#e0f2fe 48%,#f0fdf4 100%);
  font-family: Inter,"Segoe UI",Arial,sans-serif;
}
.mode-flashcard .yh-game-header { display: none !important; }
.mode-flashcard .yh-game-main {
  width: min(1024px,calc(100% - 32px));
  max-width: 1024px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 32px 0;
}
.mode-flashcard #yhStage,
.mode-flashcard .yhw-quiz-card,
.mode-flashcard .yhw-quiz-card > .ant-card-body { width: 100%; }
.mode-flashcard .yhw-quiz-card { max-width: none; }
.mode-flashcard .yh-fc-shell { width: 100%; padding: 0; }
.mode-flashcard .yh-fc-meta {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
  padding: 16px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(30,64,175,.08);
  backdrop-filter: blur(14px);
}
.mode-flashcard .yh-fc-counter { flex: 1 1 auto; max-width: 440px; gap: 16px; color: #374151; font-weight: 800; }
.mode-flashcard .yh-fc-counter > span { font-size: 15px; }
.mode-flashcard .yh-fc-counter strong { color: #c26d5a; font-size: 19px; }
.mode-flashcard .yh-fc-counter > i {
  width: auto;
  height: 12px;
  flex: 1 1 180px;
  background: #ffedd5;
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(154,52,18,.08);
}
.mode-flashcard .yh-fc-counter > i > b { background: #e57d6b; border-radius: 999px; }
.mode-flashcard .yh-fc-meta-controls { display: inline-flex; align-items: center; gap: 12px; }
.mode-flashcard .yh-fc-autoread {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  color: #047857;
  font-size: 13px;
  font-weight: 700;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
}
.mode-flashcard .yh-fc-autoread:hover { background: #d1fae5; }
.mode-flashcard .yh-fc-autoread-dot { position: relative; width: 12px; height: 12px; display: inline-block; background: #94a3b8; border-radius: 50%; }
.mode-flashcard .yh-fc-autoread.is-on .yh-fc-autoread-dot { background: #10b981; }
.mode-flashcard .yh-fc-autoread.is-on .yh-fc-autoread-dot::before { position: absolute; inset: 0; content: ""; background: #34d399; border-radius: inherit; animation: fc-reference-ping 1.35s cubic-bezier(0,0,.2,1) infinite; }
.mode-flashcard .yh-fc-settings {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.mode-flashcard .yh-fc-settings:hover { color: #334155; background: #fff; box-shadow: 0 3px 10px rgba(15,23,42,.08); }
.mode-flashcard .yh-fc-settings svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mode-flashcard .yh-fc { width: 100%; margin: 0; perspective: 1000px; }
.mode-flashcard .yh-fc-stack,
.mode-flashcard .yh-fc-stack::before,
.mode-flashcard .yh-fc-stack::after { inset: 0; border: 1px solid rgba(255,255,255,.25); border-radius: 32px; box-shadow: 0 18px 36px rgba(30,41,59,.16); }
.mode-flashcard .yh-fc-stack { background: #172554; transform: translateY(8px) scale(.99); opacity: 1; }
.mode-flashcard .yh-fc-stack::before { background: #e6d5c3; transform: translateY(16px) scale(.98); }
.mode-flashcard .yh-fc-stack::after { display: none; }
.mode-flashcard .yh-fc-card {
  height: 600px;
  min-height: 600px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 32px;
  cursor: pointer;
  animation: fc-card-enter .38s cubic-bezier(.2,.76,.25,1) both;
}
.mode-flashcard .yh-fc-card:focus-visible { outline: 4px solid rgba(37,99,235,.28); outline-offset: 6px; }
.mode-flashcard .yh-fc-in { width: 100%; height: 100%; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.mode-flashcard .yh-fc-face {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: center;
  gap: 32px;
  padding: 48px;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-top: 8px solid #2563eb;
  border-radius: 32px;
  box-shadow: 0 28px 70px rgba(15,23,42,.22);
}
.mode-flashcard .yh-fc-front::before {
  right: -48px;
  bottom: -48px;
  width: 270px;
  height: 270px;
  background: repeating-linear-gradient(45deg,rgba(15,23,42,.035) 0 5px,transparent 5px 14px);
}
.mode-flashcard .yh-fc-face-label {
  top: 30px;
  left: 32px;
  padding: 7px 16px;
  color: #c26d5a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(185,28,28,.06);
}
.mode-flashcard .yh-fc-visual {
  width: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  margin: 28px 0 0;
  padding: 16px;
  background: #f0f7f9;
  border: 2px dashed #bfdbfe;
  border-radius: 12px;
  box-shadow: inset 0 2px 8px rgba(30,64,175,.06);
}
.mode-flashcard .yh-fc-visual::before,
.mode-flashcard .yh-fc-visual::after { display: none; }
.mode-flashcard .yh-fc-polaroid {
  position: relative;
  width: 100%;
  height: 330px;
  display: block;
  padding: 12px 12px 48px;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15,23,42,.14);
  transition: transform .3s ease;
}
.mode-flashcard .yh-fc-card:hover .yh-fc-polaroid { transform: scale(1.025); }
.mode-flashcard .yh-fc-media { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; background: #f8fafc; border-radius: 6px; }
.mode-flashcard .yh-fc-animal { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; filter: none; animation: fc-animal-in .45s cubic-bezier(.2,.8,.2,1) both; }
.mode-flashcard .yh-fc-emoji { width: auto; height: auto; font-size: clamp(112px,15vw,180px); line-height: 1; }
.mode-flashcard .yh-fc-swatches { position: absolute; right: 16px; bottom: 10px; display: flex; }
.mode-flashcard .yh-fc-swatches i { width: 32px; height: 32px; margin-left: -8px; background: #fecaca; border: 2px solid #fff; border-radius: 50%; opacity: .86; }
.mode-flashcard .yh-fc-swatches i:nth-child(2) { background: #99f6e4; }
.mode-flashcard .yh-fc-swatches i:nth-child(3) { background: #fef08a; }
.mode-flashcard .yh-fc-copy { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 38px 0 0; }
.mode-flashcard .yh-fc-copy::before { display: none; }
.mode-flashcard .yh-fc-vocab-label { display: inline-block; margin-bottom: 16px; padding: 6px 12px; color: #047857; font-size: 11px; font-weight: 900; letter-spacing: .13em; background: #ecfdf5; border-radius: 6px; }
.mode-flashcard .yh-fc-copy h2 { margin: 0; color: #3d342b; font-family: Nunito,Inter,sans-serif; font-size: clamp(52px,7vw,76px); font-weight: 900; line-height: 1.03; letter-spacing: -.035em; overflow-wrap: anywhere; }
.mode-flashcard .yh-fc-phonetic { display: inline-flex; align-items: center; gap: 12px; margin-top: 24px; padding: 14px 20px; color: #2c5282; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: clamp(18px,2.4vw,24px); font-weight: 800; background: #f0f7f9; border: 1px solid #dbeafe; border-radius: 16px; box-shadow: 0 3px 10px rgba(30,64,175,.05); }
.mode-flashcard .yh-fc-inline-sound { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; color: #60a5fa; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.mode-flashcard .yh-fc-inline-sound:hover { color: #2563eb; background: #dbeafe; }
.mode-flashcard .yh-fc-inline-sound svg,
.mode-flashcard .yh-fc-flip-cue svg,
.mode-flashcard .yh-game-actions svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mode-flashcard .yh-fc-flip-cue { right: 32px; bottom: 28px; display: inline-flex; align-items: center; gap: 9px; padding: 12px 24px; color: #64748b; font-size: 13px; font-weight: 700; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 5px 14px rgba(15,23,42,.08); }
.mode-flashcard .yh-fc-back {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 72px 56px;
  text-align: center;
  background: #fff;
  border: 0;
  border-top: 8px solid #10b981;
}
.mode-flashcard .yh-fc-back::before { display: none; }
.mode-flashcard .yh-fc-face-label.is-back { color: #047857; background: #ecfdf5; border-color: #d1fae5; }
.mode-flashcard .yh-fc-back-grid { width: min(680px,100%); display: block; margin: 0 auto; }
.mode-flashcard .yh-fc-definition { width: 100%; display: flex; align-items: center; text-align: center; }
.mode-flashcard .yh-fc-word-small { display: none; }
.mode-flashcard .yh-fc-definition strong { color: #3d342b; font-size: clamp(42px,6vw,64px); font-weight: 800; line-height: 1.15; }
.mode-flashcard .yh-fc-example { width: 100%; max-width: 680px; margin-top: 44px; padding: 24px; color: #374151; font-size: 18px; font-weight: 600; font-style: italic; line-height: 1.55; text-align: left; background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 16px; }
.mode-flashcard .yh-fc-back .yh-fc-flip-cue { color: #64748b; }
.mode-flashcard .yh-game-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 120px minmax(130px,1fr) minmax(160px,1fr) minmax(220px,2fr);
  gap: 16px;
  margin: 24px 0 0;
  padding: 16px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15,23,42,.12);
  backdrop-filter: blur(14px);
}
.mode-flashcard .yh-game-actions .btn { min-height: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 12px 24px; font-size: 17px; font-weight: 800; border-radius: 12px !important; transition: transform .15s ease,background .15s ease,box-shadow .15s ease; }
.mode-flashcard .yh-fc-nav { color: #4b5563 !important; background: #fff !important; border: 2px solid #e5e7eb !important; box-shadow: none !important; }
.mode-flashcard .yh-fc-nav:hover { background: #f9fafb !important; border-color: #d1d5db !important; }
.mode-flashcard .yh-fc-listen { color: #fff !important; background: #5c8a73 !important; border-color: #5c8a73 !important; box-shadow: 0 4px 0 #3f6050 !important; }
.mode-flashcard .yh-fc-listen:hover { background: #4a725f !important; border-color: #4a725f !important; }
.mode-flashcard .yh-fc-rate--review { color: #d45d3c !important; background: #fff1ec !important; border: 2px solid #fcd5c9 !important; box-shadow: none !important; }
.mode-flashcard .yh-fc-rate--review:hover { background: #ffe4db !important; }
.mode-flashcard .yh-fc-rate--known { color: #fff !important; background: #4f8a66 !important; border-color: #4f8a66 !important; box-shadow: 0 6px 0 #2e523c !important; }
.mode-flashcard .yh-game-actions .btn:active { transform: translateY(4px); box-shadow: none !important; }
.mode-flashcard .yh-fc-listen-icon { width: 28px; height: 28px; display: grid; place-items: center; }
@keyframes fc-reference-ping { 75%,100% { opacity: 0; transform: scale(2); } }

@media (max-width: 760px) {
  .mode-flashcard .yh-game-main { width: min(100% - 20px,600px); padding: 18px 0 26px; justify-content: flex-start; }
  .mode-flashcard .yh-fc-meta { min-height: 62px; gap: 10px; margin-bottom: 16px; padding: 11px; }
  .mode-flashcard .yh-fc-counter { gap: 8px; }.mode-flashcard .yh-fc-counter > i { display: block; flex-basis: 70px; }
  .mode-flashcard .yh-fc-autoread { min-height: 38px; padding: 7px 10px; font-size: 11px; }
  .mode-flashcard .yh-fc-settings { width: 38px; height: 38px; }
  .mode-flashcard .yh-fc-card { height: 650px; min-height: 650px; }
  .mode-flashcard .yh-fc-face { grid-template-columns: 1fr; grid-template-rows: minmax(290px,1fr) auto; gap: 16px; padding: 60px 22px 66px; }
  .mode-flashcard .yh-fc-face-label { top: 22px; left: 22px; }
  .mode-flashcard .yh-fc-visual { width: min(350px,100%); margin: 0 auto; padding: 11px; }
  .mode-flashcard .yh-fc-polaroid { height: 300px; }
  .mode-flashcard .yh-fc-copy { align-items: center; padding: 0; text-align: center; }
  .mode-flashcard .yh-fc-vocab-label { margin-bottom: 9px; }
  .mode-flashcard .yh-fc-copy h2 { font-size: clamp(42px,12vw,58px); }
  .mode-flashcard .yh-fc-phonetic { margin-top: 12px; padding: 10px 14px; font-size: 17px; }
  .mode-flashcard .yh-fc-flip-cue { right: 50%; bottom: 18px; padding: 10px 16px; transform: translateX(50%); white-space: nowrap; }
  .mode-flashcard .yh-fc-back { display: grid; grid-template-rows: 1fr; padding: 76px 24px; }
  .mode-flashcard .yh-fc-definition strong { font-size: clamp(38px,10vw,52px); }
  .mode-flashcard .yh-fc-example { margin-top: 28px; padding: 18px; font-size: 16px; }
  .mode-flashcard .yh-game-actions { grid-template-columns: 72px 1fr 1fr; gap: 9px; margin-top: 18px; padding: 10px; }
  .mode-flashcard .yh-game-actions .btn { min-height: 52px; padding: 9px 12px; font-size: 14px; }
  .mode-flashcard .yh-fc-rate--known { grid-column: 1 / -1; }
  .mode-flashcard .yh-fc-nav span { display: none; }
}

@media (max-width: 460px) {
  .mode-flashcard .yh-game-main { width: calc(100% - 12px); }
  .mode-flashcard .yh-fc-meta { border-radius: 12px; }
  .mode-flashcard .yh-fc-counter > i { display: none; }
  .mode-flashcard .yh-fc-autoread { padding-inline: 8px; }
  .mode-flashcard .yh-fc-card { height: 590px; min-height: 590px; }
  .mode-flashcard .yh-fc-face { grid-template-rows: minmax(250px,1fr) auto; padding-inline: 15px; border-radius: 24px; }
  .mode-flashcard .yh-fc-stack,.mode-flashcard .yh-fc-stack::before { border-radius: 24px; }
  .mode-flashcard .yh-fc-polaroid { height: 258px; }
  .mode-flashcard .yh-fc-swatches i { width: 26px; height: 26px; }
  .mode-flashcard .yh-fc-copy h2 { font-size: clamp(38px,13vw,50px); }
  .mode-flashcard .yh-game-actions { grid-template-columns: 58px 1fr 1fr; gap: 6px; }
  .mode-flashcard .yh-game-actions .btn { min-height: 48px; padding: 8px; font-size: 12px; }
  .mode-flashcard .yh-fc-listen span:last-child { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .mode-flashcard .yh-fc-card,
  .mode-flashcard .yh-fc-polaroid,
  .mode-flashcard .yh-fc-autoread.is-on .yh-fc-autoread-dot::before { animation: none !important; transition: none !important; }
}

/* Flashcard visual refinement v2 — tighter, calmer and more premium. */
body.mode-game.mode-flashcard {
  background:
    radial-gradient(circle at 12% 12%,rgba(255,255,255,.88),transparent 28%),
    radial-gradient(circle at 88% 82%,rgba(167,243,208,.32),transparent 30%),
    linear-gradient(145deg,#eff8f8 0%,#eef8f3 54%,#f8fbf4 100%);
}
body.mode-game.mode-flashcard .yh-game-main {
  width: min(980px,calc(100% - 32px));
  max-width: 980px;
  min-height: 100vh;
  padding: 24px 0 30px;
}
body.mode-game.mode-flashcard .yh-fc-meta {
  min-height: 64px;
  margin-bottom: 18px;
  padding: 12px 18px;
  border-color: rgba(219,234,229,.9);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(48,79,70,.08);
}
body.mode-game.mode-flashcard .yh-fc-counter { max-width: 500px; }
body.mode-game.mode-flashcard .yh-fc-counter > i {
  height: 10px;
  background: #f8e7d5;
}
body.mode-game.mode-flashcard .yh-fc-counter > i > b {
  background: linear-gradient(90deg,#eb7b68,#ef9d78);
  box-shadow: 0 2px 8px rgba(229,125,107,.3);
}
body.mode-game.mode-flashcard .yh-fc-autoread {
  min-height: 38px;
  background: rgba(244,251,247,.92);
  border-color: #c8ded2;
}
body.mode-game.mode-flashcard .yh-fc-stack,
body.mode-game.mode-flashcard .yh-fc-stack::before,
body.mode-game.mode-flashcard .yh-fc-stack::after { border-radius: 28px; }
body.mode-game.mode-flashcard .yh-fc-stack {
  background: #244d67;
  transform: translateY(7px) scale(.992);
  box-shadow: 0 20px 44px rgba(30,64,78,.18);
}
body.mode-game.mode-flashcard .yh-fc-stack::before {
  background: #d9c7b1;
  transform: translateY(13px) scale(.982);
}
body.mode-game.mode-flashcard .yh-fc-card {
  height: 510px;
  min-height: 510px;
  border-radius: 28px;
}
body.mode-game.mode-flashcard .yh-fc-face {
  grid-template-columns: minmax(330px,1.03fr) minmax(0,.97fr);
  gap: 44px;
  padding: 38px 42px;
  background: linear-gradient(135deg,#fff 0%,#fff 72%,#fbfdfc 100%);
  border-top-width: 6px;
  border-radius: 28px;
  box-shadow: 0 24px 54px rgba(32,64,66,.16);
}
body.mode-game.mode-flashcard .yh-fc-face-label {
  top: 22px;
  left: 26px;
  padding: 6px 13px;
  border-radius: 9px;
}
body.mode-game.mode-flashcard .yh-fc-front::before {
  right: -64px;
  bottom: -76px;
  width: 245px;
  height: 245px;
  opacity: .72;
}
body.mode-game.mode-flashcard .yh-fc-visual {
  width: 100%;
  margin: 23px 0 0;
  padding: 10px;
  background: linear-gradient(145deg,#f4fafb,#edf6f7);
  border: 1px solid #d8e8ed;
  border-radius: 18px;
  box-shadow: inset 0 1px 0 #fff,0 10px 28px rgba(37,99,105,.08);
}
body.mode-game.mode-flashcard .yh-fc-polaroid {
  height: 300px;
  padding: 9px 9px 40px;
  border-radius: 13px;
  box-shadow: 0 14px 28px rgba(30,53,61,.16);
}
body.mode-game.mode-flashcard .yh-fc-media {
  background: #edf2ee;
  border-radius: 9px;
}
body.mode-game.mode-flashcard .yh-fc-media .yh-fc-animal {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
}
body.mode-game.mode-flashcard .yh-fc-swatches { right: 15px; bottom: 8px; }
body.mode-game.mode-flashcard .yh-fc-swatches i {
  width: 27px;
  height: 27px;
  border-width: 2px;
  box-shadow: 0 2px 5px rgba(15,23,42,.08);
}
body.mode-game.mode-flashcard .yh-fc-copy {
  align-items: flex-start;
  padding: 26px 0 12px;
}
body.mode-game.mode-flashcard .yh-fc-vocab-label {
  margin-bottom: 12px;
  padding: 6px 11px;
  color: #23755e;
  background: #e9f8f1;
}
body.mode-game.mode-flashcard .yh-fc-copy h2 {
  max-width: 100%;
  color: #302b26;
  font-size: clamp(48px,6.4vw,68px);
  line-height: .98;
  text-wrap: balance;
}
body.mode-game.mode-flashcard .yh-fc-phonetic {
  margin-top: 20px;
  padding: 12px 17px;
  color: #315c83;
  font-size: clamp(17px,2vw,21px);
  background: #f2f8fa;
  border-color: #d6e9ef;
  border-radius: 14px;
}
body.mode-game.mode-flashcard .yh-fc-inline-sound {
  color: #438fce;
  background: #e4f1fb;
}
body.mode-game.mode-flashcard .yh-fc-flip-cue {
  right: 25px;
  bottom: 20px;
  padding: 10px 17px;
  background: rgba(255,255,255,.92);
  border-color: #dce5e8;
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(30,53,61,.09);
}
body.mode-game.mode-flashcard .yh-fc-back {
  grid-template-columns: 1fr;
  padding: 64px 62px;
  border-top-width: 6px;
}
body.mode-game.mode-flashcard .yh-fc-back-grid { width: min(620px,100%); }
body.mode-game.mode-flashcard .yh-fc-definition strong {
  color: #302b26;
  font-size: clamp(40px,5.3vw,58px);
}
body.mode-game.mode-flashcard .yh-fc-example {
  margin-top: 32px;
  padding: 20px 22px;
  background: #f4f8f6;
  border-color: #e2ece7;
  border-left: 5px solid #79aa91;
  border-radius: 14px;
}
body.mode-game.mode-flashcard .yh-game-actions {
  grid-template-columns: 110px minmax(130px,1fr) minmax(150px,1fr) minmax(190px,1.65fr);
  gap: 12px;
  margin-top: 18px;
  padding: 12px;
  border-color: rgba(219,234,229,.9);
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(47,78,68,.11);
}
body.mode-game.mode-flashcard .yh-game-actions .btn {
  min-height: 54px;
  padding: 11px 18px;
  font-size: 16px;
  border-radius: 13px !important;
}
body.mode-game.mode-flashcard .yh-fc-listen {
  background: #4f806d !important;
  border-color: #4f806d !important;
  box-shadow: 0 4px 0 #36594c !important;
}
body.mode-game.mode-flashcard .yh-fc-rate--known {
  background: #468762 !important;
  border-color: #468762 !important;
  box-shadow: 0 5px 0 #2e5b41 !important;
}

@media (max-width: 760px) {
  body.mode-game.mode-flashcard .yh-game-main { width: min(100% - 18px,600px); padding-top: 14px; }
  body.mode-game.mode-flashcard .yh-fc-card { height: 610px; min-height: 610px; }
  body.mode-game.mode-flashcard .yh-fc-face {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(250px,1fr) auto;
    gap: 12px;
    padding: 54px 20px 62px;
  }
  body.mode-game.mode-flashcard .yh-fc-visual { width: min(340px,100%); margin: 0 auto; }
  body.mode-game.mode-flashcard .yh-fc-polaroid { height: 265px; }
  body.mode-game.mode-flashcard .yh-fc-copy { align-items: center; padding: 0; text-align: center; }
  body.mode-game.mode-flashcard .yh-fc-copy h2 { font-size: clamp(40px,12vw,56px); }
  body.mode-game.mode-flashcard .yh-fc-flip-cue { right: 50%; bottom: 16px; transform: translateX(50%); }
  body.mode-game.mode-flashcard .yh-game-actions { grid-template-columns: 68px 1fr 1fr; gap: 8px; }
  body.mode-game.mode-flashcard .yh-fc-rate--known { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
  body.mode-game.mode-flashcard .yh-fc-card { height: 560px; min-height: 560px; }
  body.mode-game.mode-flashcard .yh-fc-face { grid-template-rows: minmax(225px,1fr) auto; padding-inline: 13px; border-radius: 22px; }
  body.mode-game.mode-flashcard .yh-fc-stack,
  body.mode-game.mode-flashcard .yh-fc-stack::before { border-radius: 22px; }
  body.mode-game.mode-flashcard .yh-fc-polaroid { height: 235px; }
  body.mode-game.mode-flashcard .yh-game-actions { grid-template-columns: 54px 1fr 1fr; gap: 6px; }
}

/* Flashcard React source lock v3 — exact component geometry and 3D flip. */
body.mode-game.mode-flashcard {
  min-height: 100vh;
  color: #1e293b;
  background: linear-gradient(to bottom,#dbeafe,#e0f2fe,#f0fdf4);
}
body.mode-game.mode-flashcard .yh-game-main {
  width: min(1024px,calc(100% - 32px));
  max-width: 1024px;
  min-height: 100vh;
  justify-content: center;
  padding: 32px 0;
}
body.mode-game.mode-flashcard .yh-fc-shell { display: flex; flex-direction: column; gap: 0; }
body.mode-game.mode-flashcard .yh-fc-meta {
  min-height: 72px;
  margin: 0 0 24px;
  padding: 16px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.mode-game.mode-flashcard .yh-fc-counter {
  max-width: 448px;
  gap: 16px;
  color: #374151;
  font-weight: 700;
}
body.mode-game.mode-flashcard .yh-fc-counter > span { font-size: 16px; }
body.mode-game.mode-flashcard .yh-fc-counter strong { color: #c26d5a; font-size: 18px; }
body.mode-game.mode-flashcard .yh-fc-counter > i {
  height: 12px;
  background: #ffedd5;
  border-radius: 9999px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.06);
}
body.mode-game.mode-flashcard .yh-fc-counter > i > b {
  background: #e57d6b;
  border-radius: 9999px;
  box-shadow: none;
  transition: width .5s ease-out;
}
body.mode-game.mode-flashcard .yh-fc-meta-controls { gap: 12px; }
body.mode-game.mode-flashcard .yh-fc-autoread {
  min-height: 40px;
  gap: 8px;
  padding: 8px 16px;
  color: #047857;
  font-size: 14px;
  font-weight: 500;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
}
body.mode-game.mode-flashcard .yh-fc-settings {
  width: 40px;
  height: 40px;
  color: #6b7280;
  border-radius: 12px;
}
body.mode-game.mode-flashcard .yh-fc {
  position: relative;
  width: 100%;
  height: 600px;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}
body.mode-game.mode-flashcard .yh-fc-stack,
body.mode-game.mode-flashcard .yh-fc-stack::before,
body.mode-game.mode-flashcard .yh-fc-stack::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 32px;
}
body.mode-game.mode-flashcard .yh-fc-stack {
  z-index: 0;
  background: #1e3a8a;
  transform: translateY(8px) scale(.99);
  box-shadow: 0 20px 25px -5px rgba(15,23,42,.1),0 8px 10px -6px rgba(15,23,42,.1);
}
body.mode-game.mode-flashcard .yh-fc-stack::before {
  z-index: -1;
  display: block;
  background: #e6d5c3;
  transform: translateY(8px) scale(.99);
  box-shadow: 0 10px 15px -3px rgba(15,23,42,.1),0 4px 6px -4px rgba(15,23,42,.1);
}
body.mode-game.mode-flashcard .yh-fc-stack::after { display: none; }
body.mode-game.mode-flashcard .yh-fc-card {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 600px;
  min-height: 600px;
  border-radius: 32px;
  animation: none;
  transform: none;
  transform-style: preserve-3d;
}
body.mode-game.mode-flashcard .yh-fc-in {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(0deg);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(.4,0,.2,1);
  transform-origin: 50% 50%;
  will-change: transform;
}
body.mode-game.mode-flashcard .yh-fc-card.flip .yh-fc-in { transform: rotateY(180deg); }
body.mode-game.mode-flashcard .yh-fc-card.is-flipping { cursor: grabbing; pointer-events: none; }
body.mode-game.mode-flashcard .yh-fc-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: center;
  gap: 32px;
  padding: 48px;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-top: 8px solid #2563eb;
  border-radius: 32px;
  box-shadow: 0 25px 50px -12px rgba(15,23,42,.25);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
body.mode-game.mode-flashcard .yh-fc-front { transform: rotateY(0deg) translateZ(1px); }
body.mode-game.mode-flashcard .yh-fc-back { transform: rotateY(180deg) translateZ(1px); }
body.mode-game.mode-flashcard .yh-fc-card.flip .yh-fc-front { pointer-events: none; }
body.mode-game.mode-flashcard .yh-fc-card:not(.flip) .yh-fc-back { pointer-events: none; }
body.mode-game.mode-flashcard .yh-fc-front::before {
  right: 0;
  bottom: 0;
  width: 256px;
  height: 256px;
  opacity: .05;
  background-color: transparent;
  background-image:
    repeating-linear-gradient(45deg,#000 25%,transparent 25%,transparent 75%,#000 75%,#000),
    repeating-linear-gradient(45deg,#000 25%,transparent 25%,transparent 75%,#000 75%,#000);
  background-position: 0 0,10px 10px;
  background-size: 20px 20px;
}
body.mode-game.mode-flashcard .yh-fc-face-label {
  top: 32px;
  left: 32px;
  padding: 6px 16px;
  color: #c26d5a;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
body.mode-game.mode-flashcard .yh-fc-visual {
  width: 100%;
  margin: 48px 0 0;
  padding: 16px;
  background: #f0f7f9;
  border: 2px dashed #bfdbfe;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(15,23,42,.06);
}
body.mode-game.mode-flashcard .yh-fc-polaroid {
  width: 100%;
  height: 330px;
  padding: 5px 5px 5px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(15,23,42,.1),0 2px 4px -2px rgba(15,23,42,.1);
  transition: transform 300ms ease;
}
body.mode-game.mode-flashcard .yh-fc-card:hover .yh-fc-polaroid { transform: scale(1.05); }
body.mode-game.mode-flashcard .yh-fc-media { background: #f3f4f6; border-radius: 4px; }
body.mode-game.mode-flashcard .yh-fc-media .yh-fc-animal {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
body.mode-game.mode-flashcard .yh-fc-swatches { right: 16px; bottom: 12px; }
body.mode-game.mode-flashcard .yh-fc-swatches i {
  width: 32px;
  height: 32px;
  margin-left: -8px;
  border: 2px solid #fff;
  box-shadow: none;
  opacity: .8;
}
body.mode-game.mode-flashcard .yh-fc-copy {
  align-items: flex-start;
  justify-content: center;
  padding: 32px 0 0;
  text-align: left;
}
body.mode-game.mode-flashcard .yh-fc-vocab-label {
  margin-bottom: 16px;
  padding: 4px 12px;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  background: #ecfdf5;
  border-radius: 6px;
}
body.mode-game.mode-flashcard .yh-fc-copy h2 {
  color: #3d342b;
  font-family: Nunito,Inter,sans-serif;
  font-size: clamp(48px,7vw,72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.025em;
  text-wrap: wrap;
  overflow-wrap: anywhere;
}
body.mode-game.mode-flashcard .yh-fc-phonetic {
  margin-top: 24px;
  padding: 16px 24px;
  color: #2c5282;
  font-size: 24px;
  font-weight: 700;
  background: #f0f7f9;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
body.mode-game.mode-flashcard .yh-fc-inline-sound {
  margin-left: 8px;
  color: #60a5fa;
  background: transparent;
}
body.mode-game.mode-flashcard .yh-fc-flip-cue {
  right: 32px;
  bottom: 32px;
  gap: 8px;
  padding: 12px 24px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
  animation: none;
}
body.mode-game.mode-flashcard .yh-fc-back {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 48px;
  text-align: center;
  border-top-color: #10b981;
}
body.mode-game.mode-flashcard .yh-fc-back::before { display: none; }
body.mode-game.mode-flashcard .yh-fc-face-label.is-back {
  color: #047857;
  background: #ecfdf5;
  border-color: #d1fae5;
}
body.mode-game.mode-flashcard .yh-fc-back-grid { width: min(672px,100%); }
body.mode-game.mode-flashcard .yh-fc-definition { text-align: center; }
body.mode-game.mode-flashcard .yh-fc-definition strong {
  color: #3d342b;
  font-size: clamp(36px,6vw,60px);
  font-weight: 700;
  line-height: 1.15;
}
body.mode-game.mode-flashcard .yh-fc-example {
  width: 100%;
  max-width: 672px;
  margin-top: 48px;
  padding: 24px;
  color: #374151;
  font-size: 18px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.55;
  text-align: left;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-left: 1px solid #f3f4f6;
  border-radius: 16px;
}
body.mode-game.mode-flashcard .yh-fc-back .yh-fc-flip-cue { animation: none; }
body.mode-game.mode-flashcard .yh-game-actions {
  grid-template-columns: auto minmax(120px,1fr) minmax(150px,1fr) minmax(200px,2fr);
  gap: 16px;
  margin-top: 24px;
  padding: 16px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(15,23,42,.1),0 4px 6px -4px rgba(15,23,42,.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.mode-game.mode-flashcard .yh-game-actions .btn {
  min-height: 60px;
  gap: 8px;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px !important;
}
body.mode-game.mode-flashcard .yh-fc-nav { color: #4b5563 !important; border: 2px solid #e5e7eb !important; }
body.mode-game.mode-flashcard .yh-fc-listen {
  background: #5c8a73 !important;
  border-color: #5c8a73 !important;
  box-shadow: 0 4px 0 #3f6050 !important;
}
body.mode-game.mode-flashcard .yh-fc-rate--review {
  color: #d45d3c !important;
  background: #fff1ec !important;
  border: 2px solid #fcd5c9 !important;
}
body.mode-game.mode-flashcard .yh-fc-rate--known {
  color: #fff !important;
  background: #4f8a66 !important;
  border-color: #4f8a66 !important;
  box-shadow: 0 6px 0 #2e523c !important;
}
@keyframes fc-source-bounce {
  0%,100% { transform: translateY(-4px); animation-timing-function: cubic-bezier(.8,0,1,1); }
  50% { transform: translateY(0); animation-timing-function: cubic-bezier(0,0,.2,1); }
}

@media (max-width: 760px) {
  body.mode-game.mode-flashcard .yh-game-main { width: min(100% - 20px,600px); padding: 18px 0 26px; justify-content: flex-start; }
  body.mode-game.mode-flashcard .yh-fc-meta { min-height: 62px; margin-bottom: 16px; padding: 11px; }
  body.mode-game.mode-flashcard .yh-fc { height: 650px; }
  body.mode-game.mode-flashcard .yh-fc-card { height: 650px; min-height: 650px; }
  body.mode-game.mode-flashcard .yh-fc-face { grid-template-columns: 1fr; grid-template-rows: minmax(290px,1fr) auto; gap: 16px; padding: 60px 22px 66px; }
  body.mode-game.mode-flashcard .yh-fc-visual { width: min(350px,100%); margin: 0 auto; padding: 11px; }
  body.mode-game.mode-flashcard .yh-fc-polaroid { height: 300px; }
  body.mode-game.mode-flashcard .yh-fc-copy { align-items: center; padding: 0; text-align: center; }
  body.mode-game.mode-flashcard .yh-fc-copy h2 { font-size: clamp(42px,12vw,58px); }
  body.mode-game.mode-flashcard .yh-fc-phonetic { margin-top: 12px; padding: 10px 14px; font-size: 17px; }
  body.mode-game.mode-flashcard .yh-fc-flip-cue { right: 50%; bottom: 18px; padding: 10px 16px; transform: translateX(50%); white-space: nowrap; }
  body.mode-game.mode-flashcard .yh-fc-back { padding: 76px 24px; }
  body.mode-game.mode-flashcard .yh-game-actions { grid-template-columns: 72px 1fr 1fr; gap: 9px; margin-top: 18px; padding: 10px; }
  body.mode-game.mode-flashcard .yh-game-actions .btn { min-height: 52px; padding: 9px 12px; font-size: 14px; }
  body.mode-game.mode-flashcard .yh-fc-rate--known { grid-column: 1 / -1; }
  body.mode-game.mode-flashcard .yh-fc-nav span { display: none; }
}

@media (max-width: 460px) {
  body.mode-game.mode-flashcard .yh-game-main { width: calc(100% - 12px); }
  body.mode-game.mode-flashcard .yh-fc { height: 590px; }
  body.mode-game.mode-flashcard .yh-fc-card { height: 590px; min-height: 590px; }
  body.mode-game.mode-flashcard .yh-fc-face { grid-template-rows: minmax(250px,1fr) auto; padding-inline: 15px; border-radius: 24px; }
  body.mode-game.mode-flashcard .yh-fc-stack,
  body.mode-game.mode-flashcard .yh-fc-stack::before { border-radius: 24px; }
  body.mode-game.mode-flashcard .yh-fc-polaroid { height: 258px; }
  body.mode-game.mode-flashcard .yh-game-actions { grid-template-columns: 58px 1fr 1fr; gap: 6px; }
  body.mode-game.mode-flashcard .yh-game-actions .btn { min-height: 48px; padding: 8px; font-size: 12px; }
}

/* Rotation-only interaction: no zoom, shrink, pulse or hover scaling. */
body.mode-game.mode-flashcard .yh-fc-polaroid {
  width: 100%;
  height: 330px;
  padding: 5px 5px 5px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(15,23,42,.1),0 2px 4px -2px rgba(15,23,42,.1);
  transform: none !important;
  transition: transform 300ms ease !important;
}
body.mode-game.mode-flashcard .yh-fc-card:hover .yh-fc-polaroid,
body.mode-game.mode-flashcard .yh-fc-card:active .yh-fc-polaroid {
  transform: none !important;
}
body.mode-game.mode-flashcard .yh-fc-animal {
  transform: none !important;
  animation: none !important;
}
body.mode-game.mode-flashcard .yh-fc-card,
body.mode-game.mode-flashcard .yh-fc-card:hover,
body.mode-game.mode-flashcard .yh-fc-card:active {
  scale: 1 !important;
}
body.mode-game.mode-flashcard .yh-fc-card[role="button"]:active {
  transform: none !important;
}
body.mode-game.mode-flashcard .yh-fc-stack {
  background: #e6d5c3 !important;
  border-color: transparent !important;
}

/* Restore the shared navigation topbar and add fullscreen control. */
body.mode-game.mode-flashcard .yh-game-header {
  display: grid !important;
}
body.mode-game.mode-flashcard .yh-game-main {
  min-height: calc(100vh - 61px);
  padding-top: 24px;
}
body.mode-game.mode-flashcard .yh-fc-fullscreen {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: color .18s ease,background-color .18s ease,box-shadow .18s ease;
}
body.mode-game.mode-flashcard .yh-fc-fullscreen:hover,
body.mode-game.mode-flashcard .yh-fc-fullscreen.is-active {
  color: #047857;
  background: #ecfdf5;
  box-shadow: 0 3px 10px rgba(15,23,42,.08);
}
body.mode-game.mode-flashcard .yh-fc-fullscreen svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 760px) {
  body.mode-game.mode-flashcard .yh-game-main { min-height: calc(100vh - 61px); padding-top: 16px; }
  body.mode-game.mode-flashcard .yh-fc-fullscreen { width: 38px; height: 38px; }
}

/* Flashcard display settings and explicit next navigation. */
body.mode-game.mode-flashcard .yh-fc-shell { position: relative; }
body.mode-game.mode-flashcard .yh-fc-settings {
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color .18s ease,background-color .18s ease,box-shadow .18s ease;
}
body.mode-game.mode-flashcard .yh-fc-settings:hover,
body.mode-game.mode-flashcard .yh-fc-settings.is-active {
  color: #047857;
  background: #ecfdf5;
  box-shadow: 0 3px 10px rgba(15,23,42,.08);
}
body.mode-game.mode-flashcard .yh-fc-settings svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.mode-game.mode-flashcard .yh-fc-settings-panel {
  position: absolute;
  top: 78px;
  right: 0;
  z-index: 60;
  width: min(370px,calc(100vw - 32px));
  padding: 18px;
  color: #1f2937;
  background: #fff;
  border: 1px solid #dbe4ea;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15,23,42,.2);
}
body.mode-game.mode-flashcard .yh-fc-settings-panel[hidden] { display: none !important; }
body.mode-game.mode-flashcard .yh-fc-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 18px;
}
body.mode-game.mode-flashcard .yh-fc-settings-head button {
  width: 32px;
  height: 32px;
  padding: 0;
  color: #64748b;
  font-size: 24px;
  line-height: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  cursor: pointer;
}
body.mode-game.mode-flashcard .yh-fc-settings-group { margin-top: 14px; }
body.mode-game.mode-flashcard .yh-fc-settings-group > strong {
  display: block;
  margin-bottom: 8px;
  color: #475569;
  font-size: 13px;
}
body.mode-game.mode-flashcard .yh-fc-settings-choices {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 7px;
}
body.mode-game.mode-flashcard .yh-fc-settings-group:nth-of-type(3) .yh-fc-settings-choices { grid-template-columns: 1fr 1fr; }
body.mode-game.mode-flashcard .yh-fc-settings-choices label,
body.mode-game.mode-flashcard .yh-fc-settings-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 9px;
  font-size: 13px;
  font-weight: 650;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
}
body.mode-game.mode-flashcard .yh-fc-settings-choices label:has(input:checked),
body.mode-game.mode-flashcard .yh-fc-settings-toggle:has(input:checked) {
  color: #047857;
  background: #ecfdf5;
  border-color: #86efac;
}
body.mode-game.mode-flashcard .yh-fc-settings-panel input { accent-color: #059669; }
body.mode-game.mode-flashcard .yh-fc-settings-toggle { margin-top: 14px; }
body.mode-game.mode-flashcard .yh-fc-card.is-term-only .yh-fc-front,
body.mode-game.mode-flashcard .yh-fc-card.is-image-only .yh-fc-front { grid-template-columns: 1fr; }
body.mode-game.mode-flashcard .yh-fc-card.is-term-only .yh-fc-visual { display: none; }
body.mode-game.mode-flashcard .yh-fc-card.is-term-only .yh-fc-copy {
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
}
body.mode-game.mode-flashcard .yh-fc-card.is-term-only .yh-fc-copy h2 { font-size: clamp(64px,9vw,104px); }
body.mode-game.mode-flashcard .yh-fc-card.is-image-only .yh-fc-copy { display: none; }
body.mode-game.mode-flashcard .yh-fc-card.is-image-only .yh-fc-visual {
  width: min(520px,100%);
  margin: 0 auto;
}
body.mode-game.mode-flashcard .yh-game-actions {
  grid-template-columns: auto minmax(110px,1fr) minmax(135px,1fr) minmax(170px,1.5fr) auto;
}
body.mode-game.mode-flashcard .yh-fc-next { flex-direction: row; }
body.mode-game.mode-flashcard .yh-fc-next svg { order: 2; }

@media (max-width: 760px) {
  body.mode-game.mode-flashcard .yh-fc-settings-panel {
    top: 70px;
    right: 0;
    left: 0;
    width: auto;
    max-height: calc(100vh - 96px);
    overflow: auto;
  }
  body.mode-game.mode-flashcard .yh-fc-settings-choices { grid-template-columns: 1fr; }
  body.mode-game.mode-flashcard .yh-fc-settings-group:nth-of-type(3) .yh-fc-settings-choices { grid-template-columns: 1fr 1fr; }
  body.mode-game.mode-flashcard .yh-fc-card.is-term-only .yh-fc-front,
  body.mode-game.mode-flashcard .yh-fc-card.is-image-only .yh-fc-front { grid-template-rows: 1fr; }
  body.mode-game.mode-flashcard .yh-fc-card.is-term-only .yh-fc-copy h2 { font-size: clamp(54px,17vw,82px); }
  body.mode-game.mode-flashcard .yh-game-actions { grid-template-columns: 1fr 1fr; }
  body.mode-game.mode-flashcard .yh-fc-rate--known { grid-column: 1 / -1; }
  body.mode-game.mode-flashcard .yh-fc-nav span { display: inline; }
}

body.mode-game.mode-flashcard .yh-fc-settings-toggle + .yh-fc-settings-toggle { margin-top: 8px; }
body.mode-game.mode-flashcard .yh-game-main:fullscreen,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen {
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: clamp(14px,2vw,28px) !important;
  overflow: auto;
  background: linear-gradient(to bottom,#dbeafe,#e0f2fe,#f0fdf4);
}
body.mode-game.mode-flashcard .yh-game-main:fullscreen #yhStage,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen #yhStage {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}
body.mode-game.mode-flashcard .yh-game-main:fullscreen .yhw-quiz-card,
body.mode-game.mode-flashcard .yh-game-main:fullscreen .yhw-quiz-card > .ant-card-body,
body.mode-game.mode-flashcard .yh-game-main:fullscreen .yh-fc-shell,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yhw-quiz-card,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yhw-quiz-card > .ant-card-body,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yh-fc-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}
body.mode-game.mode-flashcard .yh-game-main:fullscreen .yh-fc,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yh-fc {
  flex: 1 1 auto;
  height: auto;
  min-height: 420px;
}
body.mode-game.mode-flashcard .yh-game-main:fullscreen .yh-fc-card,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yh-fc-card {
  height: 100%;
  min-height: 100%;
}
body.mode-game.mode-flashcard .yh-game-main:fullscreen .yh-game-actions,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yh-game-actions {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 16px;
}

/* Flashcard pronunciation recording and GemTech scoring */
body.mode-game.mode-flashcard .yh-game-actions {
  grid-template-columns: minmax(82px,.75fr) minmax(105px,.9fr) minmax(125px,1fr) minmax(130px,1fr) minmax(155px,1.25fr) minmax(82px,.75fr);
  gap: 10px;
}

body.mode-game.mode-flashcard .yh-fc-record {
  color: #9f3340 !important;
  border: 2px solid #f4b8c0 !important;
  background: #fff2f4 !important;
  box-shadow: 0 4px 0 #dda0a9 !important;
}

body.mode-game.mode-flashcard .yh-fc-record:hover {
  border-color: #e9909d !important;
  background: #ffe6ea !important;
}

body.mode-game.mode-flashcard .yh-fc-record.is-recording {
  color: #fff !important;
  border-color: #dc4054 !important;
  background: #dc4054 !important;
  box-shadow: 0 4px 0 #a92335 !important;
  animation: yh-fc-record-pulse 1.2s ease-in-out infinite;
}

body.mode-game.mode-flashcard .yh-fc-record.is-processing {
  color: #5c6370 !important;
  border-color: #d9dee7 !important;
  background: #f4f6f9 !important;
  box-shadow: none !important;
}

.yh-fc-record-spinner {
  width: 20px;
  height: 20px;
  display: inline-block;
  border: 3px solid #d7dce5;
  border-top-color: #5c8a73;
  border-radius: 50%;
  animation: yh-fc-record-spin .8s linear infinite;
}

.yh-fc-pron-result {
  position: relative;
  width: min(980px,100%);
  display: grid;
  grid-template-columns: 130px minmax(0,1fr);
  gap: 22px;
  margin: 18px auto 0;
  padding: 20px 24px;
  border: 1px solid #dce8e1;
  border-left: 7px solid #5c8a73;
  border-radius: 20px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 16px 38px rgba(31,65,48,.13);
  animation: yh-fc-pron-in .24s ease both;
}

.yh-fc-pron-result[hidden] { display: none !important; }
.yh-fc-pron-result.is-great { border-left-color: #2f9d69; background: linear-gradient(115deg,#effcf5,#fff 44%); }
.yh-fc-pron-result.is-good { border-left-color: #d49a32; background: linear-gradient(115deg,#fff9e9,#fff 44%); }
.yh-fc-pron-result.is-practice,
.yh-fc-pron-result.is-error { border-left-color: #d85e58; background: linear-gradient(115deg,#fff2f1,#fff 44%); }
.yh-fc-pron-result.is-info { display: block; padding-right: 52px; }
.yh-fc-pron-result.is-info p,
.yh-fc-pron-result.is-error p { margin: 0; color: #5b6470; font-weight: 700; line-height: 1.55; }

.yh-fc-pron-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e1e6eb;
  border-radius: 10px;
  background: #fff;
  color: #6b7280;
  font-size: 22px;
  cursor: pointer;
}

.yh-fc-pron-score {
  width: 118px;
  height: 118px;
  display: grid;
  place-content: center;
  align-self: center;
  border: 9px solid rgba(255,255,255,.78);
  border-radius: 50%;
  background: linear-gradient(145deg,#4f8a66,#63b68c);
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 24px rgba(56,126,86,.24),inset 0 0 0 1px rgba(255,255,255,.35);
}

.is-good .yh-fc-pron-score { background: linear-gradient(145deg,#e1a13a,#f1bd54); }
.is-practice .yh-fc-pron-score { background: linear-gradient(145deg,#d45450,#ed8176); }
.yh-fc-pron-score strong { display: block; font-size: 34px; line-height: 1; }
.yh-fc-pron-score span { display: block; margin-top: 5px; font-size: 13px; font-weight: 800; opacity: .9; }
.yh-fc-pron-copy { min-width: 0; padding-right: 30px; }
.yh-fc-pron-copy > em { color: #4f8a66; font-size: 11px; font-style: normal; font-weight: 900; letter-spacing: .13em; }
.yh-fc-pron-copy h3 { margin: 4px 0 10px; color: #25332d; font-size: 21px; }
.yh-fc-pron-copy p { margin: 5px 0; color: #5c6670; font-size: 14px; line-height: 1.5; }
.yh-fc-pron-copy p b { color: #34413b; }

.yh-fc-pron-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.yh-fc-pron-metrics span {
  min-width: 104px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #e1e9e4;
  border-radius: 10px;
  background: #fff;
}
.yh-fc-pron-metrics b { color: #347553; font-size: 17px; }
.yh-fc-pron-metrics small { color: #737d77; font-size: 11px; font-weight: 800; }

.yh-fc-pron-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.yh-fc-pron-words i {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #eef7f1;
  color: #347553;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.yh-fc-pron-words i.is-close { background: #fff5db; color: #9a6818; }
.yh-fc-pron-words i.is-wrong { background: #ffe8e6; color: #b2413c; }
.yh-fc-pron-words small { opacity: .72; font-size: 10px; }

@keyframes yh-fc-record-pulse { 50% { box-shadow: 0 4px 0 #a92335,0 0 0 7px rgba(220,64,84,.14) !important; } }
@keyframes yh-fc-record-spin { to { transform: rotate(360deg); } }
@keyframes yh-fc-pron-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 920px) {
  body.mode-game.mode-flashcard .yh-game-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 620px) {
  body.mode-game.mode-flashcard .yh-game-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.mode-game.mode-flashcard .yh-game-actions .btn { min-height: 48px; padding: 8px 10px; }
  .yh-fc-pron-result { grid-template-columns: 82px minmax(0,1fr); gap: 13px; padding: 16px 14px; border-radius: 16px; }
  .yh-fc-pron-score { width: 76px; height: 76px; border-width: 6px; }
  .yh-fc-pron-score strong { font-size: 24px; }
  .yh-fc-pron-copy { padding-right: 20px; }
  .yh-fc-pron-copy h3 { font-size: 17px; }
  .yh-fc-pron-metrics span { min-width: 90px; }
}

/* Word Search — mission board refresh */
body.mode-game.mode-wordsearch1 .yh-game-main { width: min(1220px,100%); max-width: 1220px !important; }
body.mode-game.mode-wordsearch1 #yhStage {
  min-height: 0 !important;
  padding: 0 !important;
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.mode-wordsearch1 .yhw-ws-shell {
  width: min(1120px,100%);
  margin: 0 auto;
  padding: clamp(14px,2vw,24px);
  overflow: hidden;
  background: rgba(255,253,248,.97);
  border: 1px solid rgba(255,255,255,.94);
  border-bottom: 6px solid rgba(69,100,72,.2);
  border-radius: 24px;
  box-shadow: 0 24px 58px rgba(39,75,45,.17);
  backdrop-filter: blur(10px);
}
.mode-wordsearch1 .yhw-ws-hero {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr) minmax(135px,190px);
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(115deg,#315f49 0%,#4f8a68 55%,#679b74 100%);
  border: 1px solid #2f694a;
  border-bottom: 5px solid #28553f;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(44,91,61,.22);
}
.mode-wordsearch1 .yhw-ws-hero-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #315f49;
  background: #fff4c8;
  border: 3px solid rgba(255,255,255,.78);
  border-radius: 16px;
  box-shadow: 0 4px 0 #d6ad43;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-5deg);
}
.mode-wordsearch1 .yhw-ws-hero-copy { display: grid; min-width: 0; gap: 2px; }
.mode-wordsearch1 .yhw-ws-hero-copy > small { color: #dff4e5; font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.mode-wordsearch1 .yhw-ws-hero-copy > strong { font-size: clamp(21px,2.5vw,30px); line-height: 1.15; }
.mode-wordsearch1 .yhw-ws-hero-copy > span { color: rgba(255,255,255,.83); font-size: 13px; line-height: 1.45; }
.mode-wordsearch1 .yhw-ws-counter { display: grid; gap: 7px; padding: 10px 12px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.24); border-radius: 13px; }
.mode-wordsearch1 .yhw-ws-counter > span { display: flex; align-items: baseline; justify-content: center; gap: 3px; font-size: 13px; font-weight: 800; }
.mode-wordsearch1 .yhw-ws-counter strong { font-size: 27px; line-height: 1; }
.mode-wordsearch1 .yhw-ws-counter i { height: 7px; overflow: hidden; background: rgba(255,255,255,.2); border-radius: 99px; }
.mode-wordsearch1 .yhw-ws-counter i > b { display: block; width: 0; height: 100%; background: #ffe89a; border-radius: inherit; transition: width .35s ease; }

body.mode-game.mode-wordsearch1 .yhw-ws-layout {
  display: grid;
  grid-template-columns: minmax(520px,1fr) minmax(300px,350px);
  align-items: start;
  gap: clamp(16px,2.3vw,28px);
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.mode-wordsearch1 .yhw-ws-board {
  min-width: 0;
  padding: clamp(12px,1.7vw,20px);
  background: linear-gradient(145deg,#fff8df 0%,#f7efd8 100%);
  border: 1px solid #e5d39c;
  border-bottom: 5px solid #d7bd72;
  border-radius: 20px;
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.35),0 14px 30px rgba(97,78,31,.12);
}
.mode-wordsearch1 .yhw-ws-grid {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  background: rgba(255,255,255,.5);
  border: 1px dashed rgba(128,103,40,.26);
  border-radius: 15px;
  box-shadow: none;
}
.mode-wordsearch1 .yhw-ws-row { gap: 4px; }
.mode-wordsearch1 .yhw-ws-cell {
  width: clamp(38px,4vw,46px);
  height: clamp(38px,4vw,46px);
  color: #344139;
  cursor: crosshair;
  background: rgba(255,255,255,.96);
  border: 1px solid #dce6d8;
  border-bottom: 3px solid #cbd7c8;
  border-radius: 10px;
  box-shadow: 0 3px 7px rgba(57,74,51,.08);
  font-size: clamp(18px,2vw,22px);
  font-weight: 900;
  transition: transform .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease;
}
.mode-wordsearch1 .yhw-ws-cell:hover { z-index: 2; border-color: #8bb59a; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(57,98,65,.16); }
.mode-wordsearch1 .yhw-ws-cell--preview { color: #5f4610 !important; background: #ffe59a !important; border-color: #d5a832 !important; box-shadow: 0 0 0 3px rgba(225,174,48,.18),0 4px 0 #c99524 !important; transform: translateY(-2px) scale(1.04); }
.mode-wordsearch1 .yhw-ws-cell--found { color: #fff !important; background: var(--ws-tone,#4f8a68) !important; border-color: color-mix(in srgb,var(--ws-tone,#4f8a68) 76%,#263b2d) !important; box-shadow: 0 3px 0 color-mix(in srgb,var(--ws-tone,#4f8a68) 72%,#263b2d) !important; animation: ws-found-pop .38s ease both; }
.mode-wordsearch1 .yhw-ws-cell--wrong { color: #fff !important; background: #d85e58 !important; border-color: #a9413d !important; animation: ws-wrong-shake .38s ease both; }
.mode-wordsearch1 [data-tone="0"] { --ws-tone:#4f8a68; --ws-soft:#e7f3ea; }
.mode-wordsearch1 [data-tone="1"] { --ws-tone:#c96b54; --ws-soft:#fff0eb; }
.mode-wordsearch1 [data-tone="2"] { --ws-tone:#527e9c; --ws-soft:#e9f4f8; }
.mode-wordsearch1 [data-tone="3"] { --ws-tone:#8a68a8; --ws-soft:#f3edf8; }
.mode-wordsearch1 [data-tone="4"] { --ws-tone:#c28b28; --ws-soft:#fff7dc; }
.mode-wordsearch1 [data-tone="5"] { --ws-tone:#b75978; --ws-soft:#fcecf2; }
.mode-wordsearch1 [data-tone="6"] { --ws-tone:#3c8e8a; --ws-soft:#e6f6f4; }
.mode-wordsearch1 [data-tone="7"] { --ws-tone:#8c7352; --ws-soft:#f5eee5; }
.mode-wordsearch1 .yhw-ws-selection { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 8px 12px; color: #657063; background: rgba(255,255,255,.72); border: 1px solid #e0d7bb; border-radius: 12px; font-size: 13px; text-align: center; }
.mode-wordsearch1 .yhw-ws-selection > span { color: #9b8b64; font-size: 10px; }
.mode-wordsearch1 .yhw-ws-selection[data-tone="selecting"] { color: #745515; background: #fff5d2; border-color: #e3c66d; }
.mode-wordsearch1 .yhw-ws-selection[data-tone="success"] { color: #2f704d; background: #e9f7ed; border-color: #a9d1b5; }
.mode-wordsearch1 .yhw-ws-selection[data-tone="wrong"] { color: #a43c38; background: #fff0ee; border-color: #efb1ad; }
.mode-wordsearch1 .yhw-ws-selection[data-tone="guide"] { color: #426d8b; background: #edf6fa; border-color: #bfdbe6; }

.mode-wordsearch1 .yhw-ws-wordlist {
  min-width: 0;
  padding: 16px;
  background: linear-gradient(145deg,#edf7ef 0%,#e4f0e8 100%);
  border: 1px solid #bdd5c4;
  border-bottom: 5px solid #98b8a1;
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(49,91,61,.11);
}
.mode-wordsearch1 .yhw-ws-wordlist-title { display: grid; gap: 1px; margin-bottom: 12px; padding: 0 2px 10px; border-bottom: 1px dashed #afc8b6; }
.mode-wordsearch1 .yhw-ws-wordlist-title small { color: #6a9477; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.mode-wordsearch1 .yhw-ws-wordlist-title strong { color: #31463a; font-size: 19px; }
.mode-wordsearch1 .yhw-ws-wordlist-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.mode-wordsearch1 .yhw-ws-wordlist-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 76px;
  padding: 9px 8px;
  overflow: hidden;
  color: #37433b;
  background: rgba(255,255,255,.94);
  border: 1px solid color-mix(in srgb,var(--ws-tone) 28%,#dce6df);
  border-left: 4px solid var(--ws-tone);
  border-radius: 13px;
  box-shadow: 0 5px 12px rgba(49,78,56,.07);
  transition: transform .2s ease,opacity .2s ease,background .2s ease;
}
.mode-wordsearch1 .yhw-ws-wordlist-item:hover { transform: translateY(-2px); }
.mode-wordsearch1 .yhw-ws-word-number { display: grid; width: 23px; height: 23px; place-items: center; color: var(--ws-tone); background: var(--ws-soft); border-radius: 7px; font-size: 11px; font-weight: 900; }
.mode-wordsearch1 .yhw-ws-word-thumb { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(49,67,54,.12)); }
.mode-wordsearch1 .yhw-ws-word-copy { display: grid; min-width: 0; gap: 2px; }
.mode-wordsearch1 .yhw-ws-wordlist-item strong { overflow: hidden; color: #2e3932; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.mode-wordsearch1 .yhw-ws-wordlist-item small { display: block; overflow: hidden; color: #718078; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mode-wordsearch1 .yhw-ws-word-check { display: grid; width: 25px; height: 25px; place-items: center; color: #fff; background: var(--ws-tone); border-radius: 50%; font-size: 14px; font-weight: 900; opacity: 0; transform: scale(.5) rotate(-12deg); transition: opacity .2s ease,transform .25s ease; }
.mode-wordsearch1 .yhw-ws-wordlist-item--found { color: #31533f; background: var(--ws-soft); border-color: var(--ws-tone); opacity: .78; }
.mode-wordsearch1 .yhw-ws-wordlist-item--found strong { color: var(--ws-tone); text-decoration: line-through; text-decoration-thickness: 2px; }
.mode-wordsearch1 .yhw-ws-wordlist-item--found small { color: #61776a; }
.mode-wordsearch1 .yhw-ws-wordlist-item--found .yhw-ws-word-check { opacity: 1; transform: scale(1) rotate(0); }
.mode-wordsearch1 .yhw-ws-finish { min-width: 210px; min-height: 52px; gap: 8px; border-radius: 14px !important; font-size: 16px; }
.mode-wordsearch1 .yhw-ws-finish > span { display: grid; width: 24px; height: 24px; place-items: center; color: #3e714e; background: #fff; border-radius: 50%; font-size: 13px; }
@keyframes ws-found-pop { 0% { transform: scale(.8); } 65% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes ws-wrong-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

@media (max-width: 940px) {
  body.mode-game.mode-wordsearch1 .yhw-ws-layout { grid-template-columns: 1fr; }
  .mode-wordsearch1 .yhw-ws-wordlist { width: 100%; }
  .mode-wordsearch1 .yhw-ws-wordlist-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .mode-wordsearch1 .yhw-ws-wordlist-item { min-height: 70px; }
  .mode-wordsearch1 .yhw-ws-word-number { display: none; }
}
@media (max-width: 700px) {
  .mode-wordsearch1 .yhw-ws-shell { padding: 10px; border-radius: 18px; }
  .mode-wordsearch1 .yhw-ws-hero { grid-template-columns: 46px minmax(0,1fr) 82px; gap: 10px; margin-bottom: 12px; padding: 11px; border-radius: 14px; }
  .mode-wordsearch1 .yhw-ws-hero-icon { width: 42px; height: 42px; border-width: 2px; border-radius: 12px; font-size: 28px; }
  .mode-wordsearch1 .yhw-ws-hero-copy > strong { font-size: 18px; }
  .mode-wordsearch1 .yhw-ws-hero-copy > span { display: none; }
  .mode-wordsearch1 .yhw-ws-counter { padding: 7px; }
  .mode-wordsearch1 .yhw-ws-counter strong { font-size: 21px; }
  .mode-wordsearch1 .yhw-ws-counter > span { font-size: 11px; }
  .mode-wordsearch1 .yhw-ws-board { padding: 7px; border-radius: 15px; }
  .mode-wordsearch1 .yhw-ws-grid { display: block; width: 100%; max-width: 100%; padding: 5px; overflow-x: auto; border-radius: 11px; }
  .mode-wordsearch1 .yhw-ws-row { width: max-content; margin: 0 auto 3px; gap: 3px; }
  .mode-wordsearch1 .yhw-ws-row:last-child { margin-bottom: 0; }
  .mode-wordsearch1 .yhw-ws-cell { width: 29px; height: 29px; border-bottom-width: 2px; border-radius: 7px; font-size: 14px; }
  .mode-wordsearch1 .yhw-ws-selection { min-height: 38px; margin-top: 8px; padding: 6px 8px; font-size: 11px; }
  .mode-wordsearch1 .yhw-ws-wordlist { padding: 11px; border-radius: 15px; }
  .mode-wordsearch1 .yhw-ws-wordlist-title { margin-bottom: 9px; padding-bottom: 7px; }
  .mode-wordsearch1 .yhw-ws-wordlist-title strong { font-size: 16px; }
  .mode-wordsearch1 .yhw-ws-wordlist-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .mode-wordsearch1 .yhw-ws-wordlist-item { min-height: 60px; padding: 7px 6px; border-left-width: 3px; border-radius: 10px; }
  .mode-wordsearch1 .yhw-ws-word-thumb { width: 31px; height: 31px; }
  .mode-wordsearch1 .yhw-ws-wordlist-item strong { font-size: 12px; }
  .mode-wordsearch1 .yhw-ws-wordlist-item small { display: block; font-size: 9px; }
  .mode-wordsearch1 .yhw-ws-word-check { width: 20px; height: 20px; font-size: 11px; }
  .mode-wordsearch1 .yhw-ws-finish { width: min(280px,100%); min-height: 48px; }
}
@media (max-width: 380px) {
  .mode-wordsearch1 .yhw-ws-cell { width: 26px; height: 26px; font-size: 12px; }
  .mode-wordsearch1 .yhw-ws-word-thumb { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mode-wordsearch1 .yhw-ws-cell--found,
  .mode-wordsearch1 .yhw-ws-cell--wrong { animation: none !important; }
}

/* Flashcard fullscreen: always show the complete source image. */
body.mode-game.mode-flashcard .yh-game-main:fullscreen .yh-fc-media,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yh-fc-media {
  display: grid;
  place-items: center;
  padding: clamp(8px, 1vw, 14px);
  overflow: hidden;
  background: linear-gradient(145deg, #f7fbf9 0%, #edf5f1 100%);
}

body.mode-game.mode-flashcard .yh-game-main:fullscreen .yh-fc-media .yh-fc-animal,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yh-fc-media .yh-fc-animal {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center !important;
}

body.mode-game.mode-flashcard .yh-game-main:fullscreen .yh-fc-card:hover .yh-fc-polaroid,
body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yh-fc-card:hover .yh-fc-polaroid {
  transform: none;
}

@media (min-width: 761px) {
  body.mode-game.mode-flashcard .yh-game-main:fullscreen .yh-fc-polaroid,
  body.mode-game.mode-flashcard .yh-game-main:-webkit-full-screen .yh-fc-polaroid {
    height: clamp(340px, 47vh, 540px);
  }
}

/* Flashcard images use FIT everywhere: never crop the illustration. */
body.mode-game.mode-flashcard .yh-fc-media {
  display: grid;
  place-items: center;
  padding: clamp(5px, .55vw, 9px);
  overflow: hidden;
  background: linear-gradient(145deg, #f8fbf9 0%, #edf5f1 100%);
}

body.mode-game.mode-flashcard .yh-fc-media > img.yh-fc-animal {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center !important;
}

body.mode-game.mode-flashcard .yh-fc-card:hover .yh-fc-polaroid {
  transform: none;
}

/* Flashcard vocabulary: keep long English terms readable without splitting letters. */
body.mode-game.mode-flashcard .yh-fc-copy h2.yh-fc-word-title {
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

body.mode-game.mode-flashcard .yh-fc-copy h2.yh-fc-word-long {
  font-size: clamp(38px, 4.8vw, 52px);
  line-height: 1.04;
  letter-spacing: -.02em;
}

body.mode-game.mode-flashcard .yh-fc-copy h2.yh-fc-word-xlong {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: -.015em;
}

body.mode-game.mode-flashcard .yh-fc-card.is-term-only .yh-fc-copy h2.yh-fc-word-long {
  font-size: clamp(48px, 7vw, 74px);
}

body.mode-game.mode-flashcard .yh-fc-card.is-term-only .yh-fc-copy h2.yh-fc-word-xlong {
  font-size: clamp(40px, 6vw, 62px);
}

@media (max-width: 760px) {
  body.mode-game.mode-flashcard .yh-fc-copy h2.yh-fc-word-long { font-size: clamp(34px, 9.5vw, 46px); }
  body.mode-game.mode-flashcard .yh-fc-copy h2.yh-fc-word-xlong { font-size: clamp(29px, 8vw, 39px); }
}
