/* ===== Style gốc cho các dạng game (trích từ trang gốc) ===== */
body.mode-game #yhStage{background:transparent!important;box-shadow:none!important;padding:0!important;min-height:0}
body.mode-game .yh-game-main{max-width:1000px}
.ant-card{box-sizing:border-box;background:#fff;border-radius:16px}
.ant-card-body{padding:24px}
.ant-typography{margin:0}
.muted-2{color:rgba(0,0,0,.45)}
.yhw-card{border-radius:16px;box-shadow:0 8px 24px rgba(15,35,95,.08);background:#fff;padding:24px}
.yhw-quiz-prompt{text-align:center;padding:16px 12px;border-radius:12px;background:#f7f9ff;display:flex;flex-direction:column;align-items:center;gap:8px;min-height:80px;justify-content:center;margin-bottom:18px}
.yhw-quiz-prompt h2{margin:0!important}
.yhw-quiz-feedback{margin-top:16px;display:flex;justify-content:flex-end;align-items:center;gap:12px}
.yhw-sound-btn{width:72px;height:72px;border-radius:999px;border:none;background:#1890ff;color:#fff;font-size:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 6px 16px rgba(24,144,255,.35)}

/* ----- Fill-in ----- */
.yhw-quiz-progress-bar{margin-top:20px}
.yh-prog-line{height:10px;background:#f0f0f0;border-radius:999px;overflow:hidden}
.yh-prog-fill{height:100%;width:0;background:#1677ff;border-radius:999px;transition:width .3s}
.yhw-quiz-progress-text{display:flex;justify-content:space-between;margin-top:6px;font-size:13px;color:rgba(0,0,0,.45)}
.yh-game-main .btn:disabled{opacity:.5;cursor:not-allowed;background:var(--yhw-primary);border-color:var(--yhw-primary)}
.yhw-fillin-input-wrapper{display:flex;flex-direction:column;align-items:center;gap:8px}
.yhw-fillin-input{font-size:35px!important;text-align:center;max-width:800px;width:100%;padding:8px 12px;border:1px solid #d9d9d9;border-radius:8px;transition:border-color .15s,box-shadow .15s}
.yhw-fillin-input:focus{border-color:#1677ff;box-shadow:0 0 0 2px rgba(22,119,255,.1);outline:none}
.yhw-fillin-input--correct{border-color:#52c41a!important;box-shadow:0 0 0 2px rgba(82,196,26,.18)}
.yhw-fillin-input--wrong{border-color:#ff4d4f!important;box-shadow:0 0 0 2px rgba(255,77,79,.18)}
.yhw-fillin-slots{display:flex;flex-wrap:wrap;gap:6px 8px;justify-content:center;margin-bottom:4px}
.yhw-fillin-slot{min-width:50px;height:60px;border-radius:4px;border:1px dashed #d9d9d9;display:inline-flex;align-items:center;justify-content:center;font-size:40px;line-height:1;text-align:center;background:#cadeff;padding:0;cursor:text}
.yhw-unscramble-answer .yhw-fillin-slots{cursor:text}
.yhw-fillin-slot:focus{outline:none;border-style:solid;border-color:#1677ff}
.yhw-fillin-slot-space{width:12px;min-width:12px;background:transparent;border:0}
.yhw-fillin-slot--filled{border-style:solid}
.yhw-fillin-slot--correct{border-color:#52c41a;background:rgba(82,196,26,.12)}
.yhw-fillin-slot--wrong{border-color:#ff4d4f;background:rgba(255,77,79,.12)}

/* ----- Unscramble ----- */
.yhw-unscramble-top{display:flex;flex-direction:column;gap:8px;align-items:center}
.yhw-unscramble-top h2{margin:0!important;font-size:45px;letter-spacing:4px;text-align:center}
.yhw-unscramble-prompt h3{margin:16px 0 0;text-align:center;font-size:35px}
.yhw-unscramble-answer{margin-top:16px;display:flex;flex-direction:column;align-items:center;gap:12px;width:100%}
.yhw-unscramble-tiles{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:4px;min-height:48px}
.yhw-unscramble-tile{min-width:50px;height:60px;border-radius:6px;background:#1677ff;color:#fff;display:flex;align-items:center;justify-content:center;font-size:40px;text-transform:uppercase;user-select:none;cursor:pointer;box-shadow:0 3px 8px rgba(22,119,255,.3);transition:.12s}
.yhw-unscramble-tile.sel{outline:3px solid #fa8c16;transform:translateY(-2px)}
.yhw-unscramble-tile--correct{background:#52c41a}
.yhw-unscramble-tile--wrong{background:#ff4d4f}

/* ----- Matching ----- */
.yhw-match-main{display:flex;flex-direction:column;gap:0}
.yhw-match-top-section{background:#f7f9ff;border-radius:12px;padding:12px;border:1px dashed rgba(24,144,255,.3);text-align:center}
.yhw-match-bottom-section{background:#fffdf5;border-radius:12px;padding:12px;border:1px dashed rgba(250,173,20,.4);text-align:center;margin-top:16px}
.yhw-match-top-grid{margin-top:8px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.yhw-match-top-card{background:#fff;border-radius:12px;padding:10px;display:flex;flex-direction:column;justify-content:space-between;cursor:pointer;border:2px solid transparent;transition:.15s;min-height:96px}
.yhw-match-top-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.06);transform:translateY(-1px)}
.yhw-match-top-card--active{border-color:#1890ff;box-shadow:0 0 0 2px rgba(24,144,255,.25);background:#e6f7ff}
.yhw-match-top-card--correct{border-color:#52c41a!important;background:#f6ffed}
.yhw-match-top-card--wrong{border-color:#ff4d4f!important;background:#fff1f0}
.yhw-match-top-word-text{font-weight:600;font-size:24px}
.yhw-match-top-answer{margin-top:8px}
.yhw-match-top-answer-pill{display:inline-flex;align-items:center;padding:4px 10px;border-radius:5px;background:#f6ffed;border:1px solid #b7eb8f}
.yhw-match-top-answer-text{font-size:18px;font-weight:500}
.yhw-match-top-placeholder{font-size:13px;color:rgba(0,0,0,.35);font-style:italic}
.yhw-match-bottom-list{margin-top:12px;display:flex;flex-wrap:wrap;gap:12px;justify-content:center}
.yhw-match-bottom-card{padding:6px 12px;border-radius:7px;background:#cadeff;box-shadow:0 2px 6px rgba(0,0,0,.06);cursor:pointer;min-height:32px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #f0f0f0;font-size:20px;font-weight:500;transition:.15s}
.yhw-match-bottom-card:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(0,0,0,.08)}
.yhw-match-bottom-card--used{opacity:.3;cursor:default;pointer-events:none}
.yhw-match-bottom-card--active{border-color:#1890ff;box-shadow:0 0 0 2px rgba(24,144,255,.3)}

/* ----- Memory ----- */
.yhw-memory-card-wrapper{border-radius:16px;box-shadow:0 8px 24px rgba(15,35,95,.08);padding:20px 24px 16px;background:#fff;max-width:760px;margin:0 auto}
.yhw-memory-stats{display:flex;gap:12px;justify-content:center;margin-bottom:16px;font-size:14px;color:rgba(0,0,0,.65)}
.yhw-memory-grid-wrapper{display:flex;justify-content:center}
.yhw-memory-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;width:100%;max-width:600px}
.yhw-memory-card{width:100%;aspect-ratio:1/1;border-radius:10px;border:none;padding:0;background:transparent;perspective:800px;cursor:pointer}
.yhw-memory-card-inner{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .35s}
.yhw-memory-card-face{position:absolute;inset:0;border-radius:10px;backface-visibility:hidden;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,0,0,.18)}
.yhw-memory-card-front{background:#d46b08}
.yhw-memory-card-back{background:#fffbe6;transform:rotateY(180deg)}
.yhw-memory-card.is-flipped .yhw-memory-card-inner{transform:rotateY(180deg)}
.yhw-memory-card.is-matched .yhw-memory-card-back{background:#f6ffed}
.yhw-memory-card-text{padding:6px 10px;text-align:center;font-size:22px;font-weight:600;word-break:break-word}
.yhw-memory-card-front-number{font-size:30px;font-weight:800;color:#fff;text-shadow:0 2px 8px rgba(0,0,0,.25);user-select:none}
.yhw-memory-card--just-matched .yhw-memory-card-inner{animation:yhw-mem-bounce .4s ease-out}
@keyframes yhw-mem-bounce{0%{transform:rotateY(180deg) scale(1)}40%{transform:rotateY(180deg) scale(1.06)}100%{transform:rotateY(180deg) scale(1)}}

/* ----- Connect ----- */
.yhw-match-board-wrapper{position:relative}
.yhw-match-board{display:grid;grid-template-columns:1fr 1.2fr 1fr;gap:50px;position:relative}
.yhw-match-column{display:flex;flex-direction:column;gap:10px;justify-content:center}
.yhw-match-item{padding:10px 12px;border-radius:10px;border:1px solid #d9d9d9;cursor:pointer;transition:.16s;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:52px;text-align:center}
.yhw-match-item:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(0,0,0,.06)}
.yhw-match-item--center{background:#f0f5ff}
.yhw-match-item--side{background:#fff7e6}
.yhw-match-item--pending{border-color:#1677ff;box-shadow:0 0 0 2px rgba(22,119,255,.25)}
.yhw-match-item--connected{border-color:#52c41a;background:#f0ffe6}
.yhw-match-item--correct{border-color:#52c41a;background:#f6ffed}
.yhw-match-item--wrong{border-color:#ff4d4f;background:#fff1f0}
.yhw-match-item-word{font-weight:600;font-size:20px}
.yhw-match-item-text{font-weight:600;font-size:20px}
#yhLines{position:absolute;inset:0;pointer-events:none;z-index:2}

/* ----- Vowel ----- */
.yhw-vowel-card{position:relative;border-radius:16px;box-shadow:0 8px 24px rgba(15,35,95,.08);padding:20px;background:#fff}
.yhw-vowel-main{display:flex;flex-direction:column;gap:12px}
.yhw-vowel-word-wrapper{text-align:center}
.yhw-vowel-word{margin-top:8px;display:flex;flex-wrap:wrap;justify-content:center;gap:6px;font-size:40px;font-weight:700;letter-spacing:3px}
.yhw-vowel-word-char{min-width:28px;text-align:center}
.yhw-vowel-word-char--blank{border-bottom:3px solid #999;color:#1677ff}
.yhw-vowel-hint{margin-top:4px;padding:12px;border-radius:12px;background:#f7f9ff;display:flex;flex-direction:column;gap:8px}
.yhw-vowel-hint-meaning h2{margin:0;text-align:center}
.yhw-vowel-letters-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px;justify-content:center}
.yhw-vowel-letter{min-width:52px;height:52px;border-radius:14px;border:none;font-size:30px;font-weight:700;cursor:pointer;color:#fff;box-shadow:0 3px 10px rgba(0,0,0,.15);transition:.1s}
.yhw-vowel-letter:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.2)}
.yhw-vowel-letter:disabled{opacity:.6;cursor:default}
.yhw-vowel-letter--a{background:linear-gradient(135deg,#ff4d4f,#ff7875)}
.yhw-vowel-letter--e{background:linear-gradient(135deg,#fa8c16,#ffa940)}
.yhw-vowel-letter--i{background:linear-gradient(135deg,#fadb14,#ffd666);color:#473b00}
.yhw-vowel-letter--o{background:linear-gradient(135deg,#52c41a,#73d13d)}
.yhw-vowel-letter--u{background:linear-gradient(135deg,#13c2c2,#36cfc9)}
.yhw-vowel-letter--y{background:linear-gradient(135deg,#597ef7,#85a5ff)}
.yhw-vowel-controls{margin-top:8px;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}

/* ----- Word Search ----- */
.yhw-ws-layout{display:flex;gap:32px;align-items:flex-start;justify-content:center;flex-wrap:wrap}
.yhw-ws-grid{display:inline-flex;flex-direction:column;gap:4px;padding:12px;border-radius:16px;background:#fff;box-shadow:0 8px 24px rgba(15,35,95,.06);user-select:none;touch-action:none}
.yhw-ws-row{display:flex;gap:4px}
.yhw-ws-cell{width:34px;height:34px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:18px;cursor:pointer;background:#fff;border:1px solid #f0f0f0;text-transform:uppercase;transition:.1s}
.yhw-ws-cell:hover{background:#e6f7ff;border-color:#91d5ff}
.yhw-ws-cell--preview{background:#e6f4ff;border-color:#91caff}
.yhw-ws-cell--found{border-color:#1890ff;color:#102a43;background:#eaf3ff}
.yhw-ws-wordlist{min-width:240px}
.yhw-ws-wordlist b{display:block;margin-bottom:6px}
.yhw-ws-wordlist-grid{margin-top:8px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px}
.yhw-ws-wordlist-item{padding:4px 10px;border-radius:999px;background:#f5f5f5;text-align:center;font-size:16px;font-weight:600}
.yhw-ws-wordlist-item--found{background:#e6fffb;color:#08979c;text-decoration:line-through}

@media (max-width:576px){
  .yhw-match-top-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .yhw-match-board{gap:24px}
  .yhw-unscramble-top h2{font-size:32px}
  .yhw-fillin-slot{min-width:34px;height:46px;font-size:28px}
  .yhw-vowel-letter{min-width:40px;height:46px;font-size:22px}
}
