/* Vocabulary card (double-click a word) and the My words notebook. */
::highlight(bv-word) { background-color: rgba(242, 182, 50, .45); text-decoration: underline wavy var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.vocab-card {
  position: fixed; z-index: 140; width: min(370px, calc(100vw - 20px)); max-height: min(78vh, 640px); overflow-y: auto;
  padding: 14px 16px 16px; background: var(--card); color: var(--ink); border: 3px solid #2a1d14; border-radius: 20px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .35); animation: vcpop .28s cubic-bezier(.3, 1.5, .5, 1) both;
}
@keyframes vcpop { from { opacity: 0; transform: translateY(8px) scale(.94) rotate(-1deg); } to { opacity: 1; transform: none; } }
.vocab-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.vocab-card .sticker { padding: 1px 10px; font-size: .68rem; }
.vocab-card .lang-pick { flex: 1; min-width: 0; height: 34px; padding: 0 8px; border: 2.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: 800 .8rem var(--font-ui); }
.vocab-card .icon-btn.close { width: 34px; height: 34px; font: 900 1.3rem/1 var(--font-ui); }
.vc-word { display: flex; align-items: center; gap: 10px; margin: 0 0 2px; font: 900 2rem/1.1 var(--font-display); letter-spacing: -.01em; word-break: break-word; }
.vc-word .speak { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 2.5px solid var(--line); border-radius: 50%; background: var(--mustard); color: #2a1d14; cursor: pointer; box-shadow: 2px 2px 0 var(--shadow-c); transition: transform .12s; }
.vc-word .speak:hover { transform: translate(-1px, -1px) rotate(-6deg); }
.vc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 8px; color: var(--ink-2); font-weight: 700; font-size: .88rem; }
.vc-meta i { font-family: var(--font-read); }
.vc-meta .ipa { font-family: var(--font-read); letter-spacing: .02em; }
.vc-meaning { margin: 0 0 8px; font: 600 1.02rem/1.45 var(--font-ui); }
.vc-ctx { margin: 0 0 10px; padding: 7px 10px; border-left: 5px solid var(--mustard); background: var(--paper-2); border-radius: 0 10px 10px 0; font-size: .92rem; font-weight: 600; }
.vc-ctx b { font: 800 .7rem var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.vc-tr { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; padding: 10px 12px; background: #cfe9d9; color: #12452e; border: 2.5px solid var(--line); border-radius: 14px; box-shadow: 3px 3px 0 var(--shadow-c); transform: rotate(-.6deg); }
html[data-theme="dark"] .vc-tr { background: #1d3b29; color: #bfe5cd; }
.vc-tr .tr-lang { font: 800 .66rem var(--font-ui); text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.vc-tr .tr-word { font: 900 1.7rem/1.5 var(--font-display), "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; }
.vc-tr[lang="ur"] .tr-word, .vc-tr[lang="ur"] .tr-mean { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; line-height: 2.1; }
.vc-tr[lang="ar"] .tr-word, .vc-tr[lang="fa"] .tr-word, .vc-tr[lang="ar"] .tr-mean, .vc-tr[lang="fa"] .tr-mean { font-family: "Noto Naskh Arabic", serif; line-height: 1.9; }
.vc-tr .tr-mean { font: 700 .95rem/1.6 var(--font-ui); }
.vc-ex { margin: 0 0 10px; font-size: .95rem; }
.vc-ex q { display: block; font-family: var(--font-read); font-style: italic; }
.vc-ex .tr { display: block; margin-top: 3px; color: var(--ink-2); font-weight: 600; }
.vc-ex .tr[lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; line-height: 2; }
.vocab-card .chips.small { align-items: center; margin: 0 0 8px; }
.vocab-card .chips b { font: 800 .75rem var(--font-ui); color: var(--ink-2); }
.vc-note { margin: 0 0 8px; padding: 6px 10px; border-radius: 10px; background: #fbe3a6; color: #5c3d03; font-weight: 700; font-size: .85rem; }
.vc-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--line); }
.vc-foot a { font-weight: 800; font-size: .88rem; }
.vc-foot .report { margin-left: auto; }
.vocab-card .thinking .char { width: 90px; }

@media (max-width: 700px) {
  .vocab-card { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-height: 72dvh; border-radius: 22px 22px 0 0; border-bottom: 0; box-shadow: 0 -6px 0 rgba(0, 0, 0, .25); animation: vcsheet .3s cubic-bezier(.3, 1.2, .5, 1) both; }
  @keyframes vcsheet { from { transform: translateY(100%); } to { transform: none; } }
}

/* ---------- My words notebook ---------- */
.words-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.words-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); }
.words-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.words-tools select { height: 42px; padding: 0 12px; border: 2.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 800 .88rem var(--font-ui); }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.note { position: relative; padding: 18px 16px 14px; background: #fbe3a6; color: #2a1d14; border: 3px solid #2a1d14; border-radius: 6px 6px 18px 6px; box-shadow: 5px 5px 0 rgba(0, 0, 0, .3); transition: transform .2s; }
.note:nth-child(4n+1) { transform: rotate(-1.2deg); background: #fbe3a6; }
.note:nth-child(4n+2) { transform: rotate(.9deg); background: #cfe9d9; }
.note:nth-child(4n+3) { transform: rotate(-.6deg); background: #ffd7c9; }
.note:nth-child(4n) { transform: rotate(1.2deg); background: #cfe2f2; }
.note:hover { transform: rotate(0) translateY(-4px); }
.note::before { content: ""; position: absolute; top: -12px; left: 50%; width: 54px; height: 20px; margin-left: -27px; background: rgba(255, 250, 240, .75); border: 2px solid rgba(42, 29, 20, .35); transform: rotate(-3deg); }
.note h3 { margin: 0 0 2px; font: 900 1.5rem var(--font-display); }
.note .meta { margin: 0 0 6px; color: rgba(42, 29, 20, .7); }
.note .m { margin: 0 0 8px; font-weight: 600; font-size: .95rem; }
.note .t { margin: 0 0 8px; padding: 6px 10px; background: rgba(255, 255, 255, .55); border-radius: 10px; font: 900 1.25rem/1.6 var(--font-display), "Noto Nastaliq Urdu", serif; }
.note .t[lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; line-height: 2; }
.note .t[lang="ar"], .note .t[lang="fa"] { font-family: "Noto Naskh Arabic", serif; }
.note .src { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 700; color: rgba(42, 29, 20, .7); }
.note .src a { color: #7a2a14; }
.note .acts { display: flex; gap: 8px; }
.note .acts button { padding: 3px 12px; border: 2px solid #2a1d14; border-radius: 999px; background: #fffaf0; color: #2a1d14; font: 800 .75rem var(--font-ui); cursor: pointer; }
.note .acts button:hover { background: #fff; }
.words-empty { text-align: center; padding: 30px 0; }
.words-empty .char { width: 170px; margin: 0 auto 10px; }
.drill { max-width: 520px; margin: 0 auto; }
.drill .flip { height: 260px; }
.drill .flip .front { font-size: 2rem; flex-direction: column; }
.drill .flip .back { flex-direction: column; gap: 6px; }
.drill .flip .back .tr { font: 900 1.6rem/1.6 var(--font-display), "Noto Nastaliq Urdu", serif; }
.drill .flip .back .tr[lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; line-height: 2; }
