/* ===== YourHomework — minigame từ vựng (bám sát giao diện gốc) ===== */
:root{--yhw-primary:#3B82F6;--yhw-secondary:#F97316;--yhw-accent:#22C55E;--yhw-bg-soft:#F3F4FF;--yhw-text:#0F172A}
body{margin:0;background:var(--yhw-bg-soft);color:var(--yhw-text)}

/* Header (xanh #3B82F6 như bản gốc) */
.yh-game-header{display:flex;align-items:center;gap:16px;height:64px;padding:0 24px;background:var(--yhw-primary);color:#fff;box-shadow:0 4px 12px rgba(15,23,42,.25);position:sticky;top:0;z-index:20}
.yh-game-logo{display:inline-flex;align-items:center;background:#fff;padding:5px 10px;border-radius:10px;box-shadow:0 2px 6px rgba(15,23,42,.18)}
.yh-game-logo img{height:30px;display:block}
.yh-game-title{font-weight:700;font-size:17px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.yh-game-progress{margin-left:auto;display:flex;align-items:center;gap:8px;font-size:13px;color:#e0f2ff}
.yh-bar{width:170px;height:9px;background:rgba(255,255,255,.35);border-radius:999px;overflow:hidden}
.yh-bar-fill{height:100%;width:0;background:#fff;transition:width .35s}
.yh-game-score{font-weight:700;color:#fff;background:rgba(255,255,255,.18);padding:4px 12px;border-radius:999px}
.yh-game-close{color:#fff;font-size:18px;text-decoration:none;width:34px;height:34px;border-radius:999px;background:rgba(255,255,255,.18);display:grid;place-items:center}
.yh-game-close:hover{background:rgba(255,255,255,.32)}

.yh-game-main{max-width:960px;margin:0 auto;padding:22px 16px 70px}
/* Thẻ trắng bao quanh khu chơi */
#yhStage{background:#fff;border-radius:16px;box-shadow:0 8px 24px rgba(15,35,95,.08);padding:24px 22px;min-height:300px}
.yh-game-actions{display:flex;justify-content:center;gap:12px;margin-top:20px;flex-wrap:wrap}

/* Prompt */
.yh-prompt{text-align:center;border-radius:12px;background:#f7f9ff;padding:18px 12px;margin-bottom:18px;display:flex;flex-direction:column;align-items:center;gap:8px;min-height:80px;justify-content:center}
.yh-prompt .word{font-size:34px;font-weight:700;color:var(--yhw-text)}
.yh-prompt .mean{font-size:30px;font-weight:700;color:var(--yhw-text)}
.yh-prompt .ph{color:rgba(0,0,0,.45);font-size:15px}
.yh-prompt img.cue{max-height:220px;border-radius:12px;object-fit:contain}

/* Nút loa (gradient vàng + sóng) */
.yh-sound{border:none;cursor:pointer;width:72px;height:72px;border-radius:999px;background:radial-gradient(circle at 30% 30%,#ffd666,#fa8c16);display:inline-flex;align-items:center;justify-content:center;position:relative;box-shadow:0 8px 18px rgba(0,0,0,.18);color:#fff;font-size:30px;transition:transform .15s}
.yh-sound:hover{transform:translateY(-1px) scale(1.03)}
.yh-sound:active{transform:scale(.97)}
.yh-sound .wave{position:absolute;inset:0;border-radius:inherit;border:2px solid rgba(250,140,22,.45);animation:yh-wave 1.4s ease-out infinite;pointer-events:none}
@keyframes yh-wave{0%{transform:scale(1);opacity:.9}100%{transform:scale(1.6);opacity:0}}

/* Quiz options (pastel theo vị trí + badge chữ ở góc) */
.yh-options{display:grid;grid-template-columns:1fr 1fr;gap:14px;max-width:680px;margin:0 auto}
.yh-opt{position:relative;border-radius:16px;padding:20px 40px;min-height:120px;display:flex;align-items:center;justify-content:center;text-align:center;cursor:pointer;font-size:24px;font-weight:600;color:var(--yhw-text);overflow:hidden;transition:transform .18s ease-out,box-shadow .18s ease-out,background-color .18s,color .18s}
.yh-options .yh-opt:nth-child(1){background:#e3f5ff}
.yh-options .yh-opt:nth-child(2){background:#fff4d8}
.yh-options .yh-opt:nth-child(3){background:#e6fffb}
.yh-options .yh-opt:nth-child(4){background:#ffe6fb}
.yh-opt:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(0,0,0,.08)}
.yh-opt .badge-letter{position:absolute;width:26px;height:26px;border-radius:999px;background:#fa8c16;color:#fff;font-size:13px;font-weight:600;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px rgba(255,255,255,.7)}
.yh-opt:nth-child(1) .badge-letter{right:14px;bottom:14px}
.yh-opt:nth-child(2) .badge-letter{left:14px;bottom:14px}
.yh-opt:nth-child(3) .badge-letter{right:14px;top:14px}
.yh-opt:nth-child(4) .badge-letter{left:14px;top:14px}
.yh-opt.correct{background:#52c41a!important;color:#fff;animation:yh-bounce .28s ease-out}
.yh-opt.wrong{background:#ff4d4f!important;color:#fff;animation:yh-shake .28s ease-out}
.yh-opt.disabled{pointer-events:none}
@keyframes yh-bounce{0%{transform:scale(1)}40%{transform:scale(1.06)}100%{transform:scale(1)}}
@keyframes yh-shake{0%{transform:translateX(0)}20%{transform:translateX(-4px)}40%{transform:translateX(4px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}100%{transform:translateX(0)}}

/* Fill-in slots (nét đứt, nền #cadeff) */
.yh-slots{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin:18px 0}
.yh-slot{min-width:50px;height:60px;border:1px dashed #d9d9d9;border-radius:4px;text-align:center;font-size:36px;font-weight:700;text-transform:lowercase;background:#cadeff;color:var(--yhw-text)}
.yh-slot:focus{outline:none;border-style:solid;border-color:var(--yhw-primary);box-shadow:0 0 0 2px rgba(59,130,246,.2)}
.yh-slot.space{border:0;background:transparent;width:14px;min-width:14px}
.yh-slot.ok{border-style:solid;border-color:#52c41a;background:rgba(82,196,26,.1)}
.yh-slot.bad{border-style:solid;border-color:#ff4d4f;background:rgba(255,77,79,.1)}

/* Unscramble tiles (xanh #1677ff) */
.yh-tiles{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:18px 0;min-height:60px}
.yh-tile{min-width:52px;height:60px;padding:0 8px;border:0;border-radius:6px;background:#1677ff;color:#fff;font-size:34px;font-weight:700;text-transform:uppercase;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;box-shadow:0 3px 8px rgba(22,119,255,.3)}
.yh-tile.placed{filter:brightness(1.08)}
.yh-drop{min-height:64px;border:2px dashed #d9d9d9;border-radius:10px;padding:8px;display:flex;gap:10px;justify-content:center;flex-wrap:wrap;align-items:center;margin:0 auto;max-width:640px;background:#fafcff}

/* Matching (thẻ trắng + active xanh) */
.yh-match-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;max-width:700px;margin:0 auto}
.yh-match-col{display:flex;flex-direction:column;gap:10px;background:#f7f9ff;border:1px dashed rgba(24,144,255,.3);border-radius:12px;padding:12px}
.yh-match-col:last-child{background:#fffdf5;border-color:rgba(250,173,20,.4)}
.yh-mcard{padding:14px 16px;background:#fff;border:2px solid transparent;border-radius:12px;cursor:pointer;text-align:center;font-weight:600;font-size:18px;box-shadow:0 1px 3px rgba(0,0,0,.04);transition:.15s}
.yh-mcard:hover{box-shadow:0 4px 12px rgba(0,0,0,.06);transform:translateY(-1px)}
.yh-mcard.sel{border-color:#1890ff;box-shadow:0 0 0 2px rgba(24,144,255,.25);background:#e6f7ff}
.yh-mcard.done{border-color:#52c41a;background:#f6ffed;color:#389e0d;pointer-events:none}
.yh-mcard.shake{animation:yh-shake .35s}

/* Memory (mặt cam #d46b08, lưng kem) */
.yh-mem-grid{display:grid;gap:14px;max-width:680px;margin:0 auto}
.yh-mem{aspect-ratio:1/1;perspective:800px;cursor:pointer}
.yh-mem-in{position:relative;width:100%;height:100%;transition:transform .35s ease;transform-style:preserve-3d}
.yh-mem.flip .yh-mem-in{transform:rotateY(180deg)}
.yh-mem-f,.yh-mem-b{position:absolute;inset:0;backface-visibility:hidden;border-radius:10px;display:grid;place-items:center;box-shadow:0 4px 12px rgba(0,0,0,.18);padding:6px;text-align:center}
.yh-mem-f{background:#d46b08;color:#fff;font-size:30px;font-weight:800;text-shadow:0 2px 8px rgba(0,0,0,.25)}
.yh-mem-b{background:#fffbe6;transform:rotateY(180deg);font-size:22px;font-weight:600}
.yh-mem.matched .yh-mem-b{background:#f6ffed}
.yh-mem.matched .yh-mem-in{animation:yh-bounce .4s ease-out}

/* Connect */
.yh-connect{position:relative;max-width:700px;margin:0 auto}
.yh-connect-cols{display:grid;grid-template-columns:1fr 1fr;gap:100px}
.yh-citem{padding:12px 14px;border:1px solid #d9d9d9;border-radius:10px;cursor:pointer;text-align:center;font-weight:600;margin-bottom:10px;min-height:52px;display:flex;align-items:center;justify-content:center;transition:.16s}
.yh-connect-cols>div:first-child .yh-citem{background:#fff7e6}
.yh-connect-cols>div:last-child .yh-citem{background:#f0f5ff}
.yh-citem:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(0,0,0,.06)}
.yh-citem.sel{border-color:#1677ff;box-shadow:0 0 0 2px rgba(22,119,255,.25)}
.yh-citem.linked{border-color:#52c41a;background:#f0ffe6!important}
#yhLines{position:absolute;inset:0;pointer-events:none;z-index:2}

/* Vowel (phím màu theo nguyên âm) */
.yh-vowel-word{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;font-size:40px;font-weight:700;letter-spacing:3px;margin:14px 0}
.yh-vchar{min-width:28px;text-align:center}
.yh-vchar.blank{border-bottom:3px solid #999;color:var(--yhw-primary)}
.yh-vkeys{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:8px}
.yh-vkey{min-width:52px;height:52px;border:0;border-radius:14px;font-size:28px;font-weight:700;cursor:pointer;color:#fff;box-shadow:0 3px 10px rgba(0,0,0,.15);transition:transform .1s}
.yh-vkey:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.2)}
.yh-vkey[data-v=a]{background:linear-gradient(135deg,#ff4d4f,#ff7875)}
.yh-vkey[data-v=e]{background:linear-gradient(135deg,#fa8c16,#ffa940)}
.yh-vkey[data-v=i]{background:linear-gradient(135deg,#fadb14,#ffd666);color:#473b00}
.yh-vkey[data-v=o]{background:linear-gradient(135deg,#52c41a,#73d13d)}
.yh-vkey[data-v=u]{background:linear-gradient(135deg,#13c2c2,#36cfc9)}
.yh-vkey[data-v=y]{background:linear-gradient(135deg,#597ef7,#85a5ff)}

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

/* Flashcard */
.yh-fc{max-width:520px;margin:0 auto}
.yh-fc-card{perspective:1400px;height:300px;cursor:pointer}
.yh-fc-in{position:relative;width:100%;height:100%;transition:transform .5s;transform-style:preserve-3d}
.yh-fc-card.flip .yh-fc-in{transform:rotateY(180deg)}
.yh-fc-face{position:absolute;inset:0;backface-visibility:hidden;border-radius:18px;display:grid;place-items:center;text-align:center;padding:20px;box-shadow:0 8px 24px rgba(15,35,95,.12);border:1px solid #eef;background:#fff}
.yh-fc-back{transform:rotateY(180deg);background:#eaf3ff}

/* Buttons (đồng bộ màu primary game) */
.yh-game-main .btn{background:var(--yhw-primary);border-color:var(--yhw-primary);border-radius:10px}
.yh-game-main .btn:hover{background:#2f6fe0;border-color:#2f6fe0}
.yh-game-main .btn-ghost{background:#fff;color:var(--yhw-text);border-color:#d9d9d9}
.yh-game-main .btn-ghost:hover{color:var(--yhw-primary);border-color:var(--yhw-primary)}

/* Màn hình hoàn thành */
.yh-done{position:fixed;inset:0;background:rgba(10,40,70,.55);display:none;place-items:center;z-index:50;padding:16px}
.yh-done.show{display:grid}
.yh-done-card{background:linear-gradient(135deg,#f6ffed,#e6f7ff,#fff0f6);border-radius:18px;padding:34px;text-align:center;max-width:460px;width:100%;box-shadow:0 12px 30px rgba(0,0,0,.18)}
.yh-done-emoji{font-size:54px}
.yh-done-card h2{background:linear-gradient(120deg,#ff7875,#ffa940,#95de64,#69c0ff,#b37feb);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:30px}
.yh-done-score{font-size:46px;font-weight:800;color:var(--yhw-primary);margin:6px 0}
.yh-done-max{font-size:24px;color:rgba(0,0,0,.45)}
.yh-done-sub{color:rgba(0,0,0,.55);margin-bottom:18px;font-size:15px}
.yh-done-btns{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}

@media(max-width:600px){
  #yhStage{padding:14px 10px}
  .yh-options,.yh-match-grid{grid-template-columns:1fr 1fr;gap:8px}
  .yh-opt{padding:14px 30px;min-height:80px;font-size:18px;border-radius:12px}
  .yh-connect-cols{gap:60px}
  .yh-prompt .word{font-size:28px}.yh-prompt .mean{font-size:24px}
  .yh-slot{min-width:34px;height:46px;font-size:26px}
  .yh-tile{min-width:34px;height:46px;font-size:26px}
  .yh-vkey{min-width:38px;height:46px;font-size:20px}
  .yh-game-title{display:none}
}

/* Samio vocab game polish - 2026-07-13 */
:root{--samio-game-blue:#235aae;--samio-game-green:#0f8b6f;--samio-game-ink:#101828;--samio-game-muted:#667085;--samio-game-line:#e4e7ec}
body.mode-game{background:#f4f7fb;color:var(--samio-game-ink)}
.yh-game-header{min-height:68px;height:auto;padding:10px clamp(12px,2.6vw,28px);gap:14px;background:linear-gradient(135deg,#113f7d,#235aae 55%,#0f8b6f);box-shadow:0 10px 30px -22px rgba(16,24,40,.75)}
.yh-game-logo{min-width:0;max-width:min(38vw,360px);background:rgba(255,255,255,.14)!important;color:#fff!important;border:1px solid rgba(255,255,255,.24);border-radius:8px!important;padding:8px 11px!important;box-shadow:none!important;font-size:.92rem!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.yh-game-title{font-size:.95rem;font-weight:800;letter-spacing:0;max-width:360px}
.yh-game-progress{color:rgba(255,255,255,.86);font-weight:700}
.yh-bar{height:8px;background:rgba(255,255,255,.25)}
.yh-bar-fill{background:#fff}
.yh-game-score{border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.14);border-radius:8px;padding:7px 12px}
.yh-game-close{border-radius:8px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.2)}
.yh-game-main{max-width:1040px;padding:26px 16px 76px}
body.mode-game #yhStage,.yhw-card,.yhw-memory-card-wrapper,.yhw-vowel-card,.ant-card{border:1px solid var(--samio-game-line);border-radius:8px!important;background:#fff!important;box-shadow:0 18px 44px -34px rgba(16,24,40,.65)!important}
.yhw-card,.yhw-memory-card-wrapper,.yhw-vowel-card,.ant-card-body{padding:clamp(16px,2.2vw,26px)!important}
.yh-prompt,.yhw-quiz-prompt,.yhw-match-top-section,.yhw-vowel-hint{border:1px solid #e6edf7;background:#f7faff;border-radius:8px}
.yh-prompt .word,.yh-prompt .mean,.yhw-unscramble-top h2,.yhw-unscramble-prompt h3{color:#172033;letter-spacing:0}
.yh-options{gap:12px;max-width:760px}
.yh-opt{border:1px solid transparent;border-radius:8px;min-height:112px;font-weight:800;box-shadow:0 10px 28px -24px rgba(16,24,40,.55)}
.yh-opt:hover{box-shadow:0 16px 34px -24px rgba(16,24,40,.62)}
.yh-options .yh-opt:nth-child(1){background:#eef4ff}.yh-options .yh-opt:nth-child(2){background:#fff7e8}.yh-options .yh-opt:nth-child(3){background:#ecfdf3}.yh-options .yh-opt:nth-child(4){background:#fff0f3}
.yh-opt .badge-letter{background:#235aae}
.yh-fc{max-width:580px}.yh-fc-card{height:320px}.yh-fc-face{border-radius:8px;border:1px solid #dfe8f5;box-shadow:0 18px 42px -30px rgba(16,24,40,.6)}
.yh-fc-back{background:#eef7f4}
.yh-game-main .btn,.yh-game-main button.btn,.yh-game-main a.btn{min-height:42px;border-radius:7px!important;padding:9px 15px;font-weight:800;background:var(--samio-game-blue);border-color:var(--samio-game-blue);box-shadow:0 12px 24px -18px rgba(35,90,174,.7)}
.yh-game-main .btn:hover,.yh-game-main button.btn:hover,.yh-game-main a.btn:hover{background:#174b9c;border-color:#174b9c;transform:translateY(-1px)}
.yh-game-main .btn-ghost{background:#fff!important;color:#235aae!important;border-color:#cdd8e8!important;box-shadow:none}
.yh-game-main .btn-ghost:hover{background:#eef4ff!important;color:#174b9c!important;border-color:#235aae!important}
.yh-sound,.yhw-sound-btn{background:linear-gradient(135deg,#235aae,#0f8b6f)!important;box-shadow:0 16px 34px -24px rgba(35,90,174,.85)!important}
.yh-match-col,.yhw-match-bottom-section{border-radius:8px}
.yh-mcard,.yhw-match-top-card,.yhw-match-bottom-card,.yh-citem,.yhw-match-item{border-radius:8px}
.yh-slot,.yhw-fillin-slot{border-radius:7px;background:#eef4ff}
.yh-tile,.yhw-unscramble-tile{border-radius:7px;background:#235aae;box-shadow:0 12px 24px -18px rgba(35,90,174,.75)}
.yh-done{background:rgba(16,24,40,.62);backdrop-filter:blur(6px)}
.yh-done-card{border:1px solid rgba(255,255,255,.7);border-radius:8px;background:#fff;box-shadow:0 24px 64px -28px rgba(16,24,40,.72)}
.yh-done-card h2{-webkit-text-fill-color:initial;background:none;color:#172033}
.yh-done-score{color:#235aae}
@media(max-width:720px){.yh-game-header{align-items:stretch;flex-wrap:wrap}.yh-game-logo{max-width:calc(100vw - 78px);order:1}.yh-game-close{margin-left:auto;order:2}.yh-game-progress{order:3;width:100%;margin-left:0}.yh-bar{flex:1}.yh-game-score{order:4}.yh-game-main{padding:18px 10px 58px}.yh-options{grid-template-columns:1fr}.yh-opt{min-height:78px;font-size:1rem}.yh-fc-card{height:260px}}
