/* =========================================================================
 * Trang tổng hợp của 3 đích Luyện tập (#/practice), Khám phá (#/explore), Tôi (#/me):
 * lưới ô ngắn (ô mạt chược có hình + tên + một dòng mô tả), đủ gọn để không phải kéo dài.
 * ========================================================================= */
.hub-page .station { padding: 16px 22px 14px; margin-bottom: 14px; }
.hub-page .station .plate-zh { font-size: 1.7rem; line-height: 1.45; }
.hub-page .station .plate-vi { font-size: 1.08rem; }
.hub-h { margin: 22px 2px 10px; font-size: 1.02rem; color: var(--muted); font-weight: 800; letter-spacing: .01em; }
.hub-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.hub-tile {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-bottom-width: 3px; color: var(--text); text-decoration: none !important;
  transition: transform .1s, border-color .1s;
}
.hub-tile:hover { border-color: color-mix(in oklab, var(--line) 55%, var(--border)); }
.hub-tile:active { transform: translateY(2px); border-bottom-width: 1px; margin-bottom: 2px; }
.hub-tile > .nav-tile { width: 44px; height: 46px; background: var(--plate); color: var(--hk-cream, var(--cream)); border-color: transparent; box-shadow: 0 2px 0 color-mix(in srgb, var(--plate) 65%, #000); }
.hub-tile > .nav-tile svg { width: 24px; height: 24px; }
.hub-tile .ht-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.hub-tile .ht-tx b { font-weight: 700; font-size: .98rem; }
.hub-tile .ht-tx small { font-size: .8rem; }
.hub-tile.has-meta .ht-tx b { padding-right: 76px; }
.hub-tile .ht-meta { position: absolute; top: 10px; right: 10px; font-family: var(--font-led); font-size: .74rem; color: var(--led-on); background: var(--led-bg); padding: 3px 7px; border-radius: 6px; }

/* ô lớn đầu trang Luyện tập: ôn thẻ đến hạn */
.hub-hero { --plate: color-mix(in oklab, var(--line) var(--plate-mix, 100%), var(--bg)); display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none !important; }
.hub-hero > .nav-tile { width: 54px; height: 56px; background: var(--plate); color: var(--hk-cream, var(--cream)); border-color: transparent; }
.hub-hero > .nav-tile svg { width: 28px; height: 28px; }
.hub-hero .hh-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.hub-hero .hh-tx b { font-size: 1.1rem; font-weight: 800; }
.hub-hero.is-due { border-color: color-mix(in oklab, var(--accent) 45%, var(--border)); }
.hub-hero:hover { text-decoration: none; }

/* thẻ trong lưới không cộng thêm khoảng cách trên của .card + .card */
.hub-page .grid > .card { margin: 0; }

/* Khám phá: bài hát hôm nay */
.song-today { display: flex; gap: 14px; align-items: center; color: var(--text); text-decoration: none !important; }
.hub-today > .card { margin: 0; }

/* Tôi: thành tích dạng bảng LED */
.me-kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.me-kpis .card { margin: 0; padding: 14px; }
.me-kpis small i { font-style: normal; opacity: .75; }
.me-look { margin-top: 14px; }
.me-acct { margin-top: 14px; }
.me-look .theme-chip { margin: 10px 0 0; }
.me-look .voice-chip { margin-top: 8px; }

@media (max-width: 560px) {
  .hub-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hub-tile { flex-direction: column; align-items: flex-start; gap: 8px; min-height: 0; padding: 12px; }
  .hub-tile .ht-tx small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hub-tile .ht-meta { top: 12px; }
  .hub-tile.has-meta .ht-tx b { padding-right: 0; }
  .hub-hero { flex-wrap: wrap; }
  .hub-hero .btn { width: 100%; justify-content: center; }
  .me-kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .me-kpis .card { padding: 10px; }
  .me-kpis .kpi { font-size: 1.5rem; }
}

/* Tiểu Cường mở đầu bài (màn đầu của học từng bước): hình bên trái, bong bóng bên phải */
.ses-host { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.ses-host .tc { width: 76px; }
:root:not([data-fx="less"]) .ses-host .tc-img { animation: tc-jump .7s cubic-bezier(.3, 1.5, .5, 1) .15s both; }
.tc-bubble.side { align-items: flex-start; text-align: left; max-width: min(100%, 420px); }
.tc-bubble.side::after { left: -7px; bottom: auto; top: 50%; margin-top: -7px; transform: rotate(135deg); }
/* đang có người dẫn ở đầu màn thì ẩn hình nhỏ ở thanh dưới cho khỏi lặp */
.ses:has(.ses-host) .ses-bar [data-slot="mascot"] { visibility: hidden; }

/* Luyện tập: Tiểu Cường thay ô hình ở ô ôn thẻ */
.hub-hero .hh-tc { flex: 0 0 auto; margin: -6px 0 -10px; }
.hub-hero .hh-tc .tc { width: 72px; }
:root:not([data-fx="less"]) .hub-hero.is-due .hh-tc .tc-img { animation: tc-bob 2.4s ease-in-out infinite; }

/* Tôi: Tiểu Cường của bạn (bộ đồ đang mặc trên phông nền phòng) */
.me-tc { display: flex; gap: 14px; align-items: center; padding: 0; overflow: hidden; margin-bottom: 14px; }
.me-tc-fig { flex: 0 0 150px; align-self: stretch; display: grid; place-items: end center; padding: 14px 0 8px; background: var(--tc-bg, var(--surface-2)); text-decoration: none !important; position: relative; }
.me-tc-fig::before { content: ''; position: absolute; inset: 0; background: var(--tc-pat, none); pointer-events: none; }
.me-tc-fig .tc { width: 118px; position: relative; }
:root:not([data-fx="less"]) .me-tc-fig .tc-img { animation: tc-bob 2.8s ease-in-out infinite; }
:root:not([data-fx="less"]) .me-tc-fig:hover .tc-img { animation: tc-wiggle .5s ease-in-out; }
.me-tc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 14px 0; }
@media (max-width: 560px) {
  .me-tc-fig { flex-basis: 120px; }
  .me-tc-fig .tc { width: 96px; }
}

/* màn "Ối, có lỗi": Tiểu Cường nằm giả chết */
.err-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.err-card .tc { margin: 0 auto 4px; }
.err-card .row { justify-content: center; }
.err-card details { width: 100%; text-align: left; margin-top: 8px; font-size: .82rem; }
.err-card pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Tôi: tổng quan 2×2 (biểu tượng + số lớn + nhãn), bấm được */
.me-ov { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.me-ov .card { margin: 0; padding: 12px 14px; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; border-bottom-width: 3px; }
.me-ov .card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.me-ov .mo-ic { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; }
.me-ov .mo-ic svg { width: 22px; height: 22px; }
.me-ov b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.me-ov b small { font-size: .62em; color: var(--muted); font-weight: 700; }
.me-ov span > small { font-size: .78rem; color: var(--muted); }
.me-ov-sk .mo-ic { color: var(--hk-warm, var(--warn)); background: color-mix(in srgb, var(--hk-warm, var(--warn)) 14%, var(--surface)); }
.me-ov-xp .mo-ic { color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.me-ov-ls .mo-ic { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.me-ov-wd .mo-ic { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, var(--surface)); }
.me-more { margin: 8px 2px 0; font-size: .8rem; color: var(--muted); }
/* Tôi: hàng thành tích — huy hiệu tròn, vòng tiến độ cho cái chưa đạt */
.me-bh { display: flex; justify-content: space-between; align-items: baseline; }
.me-bh a { font-size: .82rem; font-weight: 700; }
.me-badges { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.me-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text); text-decoration: none !important; }
.me-badge small { font-size: .72rem; font-weight: 600; color: var(--muted); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mb-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0); }
.mb-ic { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--surface); filter: grayscale(1); opacity: .55; }
.me-badge.got .mb-ring { background: var(--gold); box-shadow: 0 3px 0 color-mix(in srgb, var(--gold) 60%, #000); }
.me-badge.got .mb-ic { filter: none; opacity: 1; background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }
.me-badge.got small { color: var(--text); }
@media (max-width: 560px) {
  .me-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .me-ov b { font-size: 1.2rem; }
}

/* ---------- Album từ vựng: thẻ tóm tắt, bộ từ, danh sách từ có trạng thái ---------- */
.al-sum { display: flex; flex-direction: column; gap: 12px; }
.al-sum-h { display: flex; align-items: center; gap: 12px; }
.al-sum-h b { flex: 1; font-size: 1.05rem; }
.al-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.al-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.al-pill.new { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, var(--surface)); }
.al-pill.learning { color: var(--hk-warm, var(--warn)); background: color-mix(in srgb, var(--hk-warm, var(--warn)) 13%, var(--surface)); }
.al-pill.known { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, var(--surface)); }
.al-ring { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-3) 0); }
.al-ring b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: .7rem; font-weight: 800; }
.al-ic { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; font-size: 1.4rem; background: var(--surface-2); }
.al-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.al-mode { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--border); border-bottom-width: 3px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; text-decoration: none !important; }
.al-mode svg { width: 22px; height: 22px; color: var(--accent); }
.al-mode:hover { background: var(--surface-2); }
.al-mode[data-on="1"] svg { color: var(--bad); }
.al-search { width: 100%; margin: 14px 0 4px; }
.al-sets { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.al-set { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-bottom-width: 3px; color: var(--text); text-decoration: none !important; }
.al-set:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.al-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.al-tx b { font-size: 1rem; }
.al-tx small { color: var(--muted); font-size: .8rem; }
.al-foot { margin-top: 14px; }
.al-chips { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0 10px; scrollbar-width: none; }
.al-chips::-webkit-scrollbar { display: none; }
.al-chips .chip { cursor: pointer; font-size: .82rem; padding: 6px 12px; flex: 0 0 auto; }
.al-chips .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.al-words { padding: 4px 8px; }
.al-word { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.al-word:last-child { border-bottom: 0; }
.al-word.playing { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 10px; }
.al-say { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; border: 0; display: grid; place-items: center; cursor: pointer; color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 10%, var(--surface)); }
.al-say svg { width: 20px; height: 20px; }
.al-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.al-z { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.al-z .zh { font-size: 1.25rem; font-weight: 500; }
.al-j { font-size: .85rem; }
.al-main small { color: var(--muted); font-size: .86rem; }
.al-hid { letter-spacing: .2em; }
.al-fold { margin-top: 10px; }
.al-fold > summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.al-sent { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.al-sent:last-child { border-bottom: 0; }
@media (max-width: 560px) { .al-modes { gap: 6px; } .al-mode { font-size: .7rem; padding: 8px 2px; } }
