/* Miu Karaoke – giao diện chọn bài (máy tính bảng + điện thoại). Nền sáng, hồng Miu. */
:root {
  --hong: #d6337a; --hongDam: #b9256a; --hongNhat: #fdeef4; --hongVien: #f6d3e3;
  --chu: #231a24; --mo: #6f6370; --nen: #f5f1f3; --trang: #fff; --ke: #ece4e8; --do: #b3261e;
  --gr: linear-gradient(135deg, #ec5a9a 0%, #d6337a 60%, #b9256a 100%);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--nen); color: var(--chu); font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 15px; line-height: 1.4; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--hong); outline-offset: 2px; }
[hidden] { display: none !important; }
img { display: block; }
.an { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gian { flex: 1; }
.kaCho { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--mo); font-size: 18px; }

/* ---------- nút chung */
.nutChinh { min-height: 52px; border: 0; border-radius: 14px; background: var(--gr); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .03em; padding: 0 16px; }
.nutChinh.vien { background: #fff; color: var(--hong); box-shadow: inset 0 0 0 2px var(--hong); }
.nutChinh.xoa { background: #fff; color: var(--do); box-shadow: inset 0 0 0 2px #e7a6a1; }
.nutVien { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--hongVien); border-radius: 999px; background: #fff; color: var(--hong); font-weight: 700; font-size: 14px; }
.nutVien.nho { min-height: 40px; font-size: 13.5px; }
.nutVuong { width: 48px; height: 48px; flex: none; border: 0; border-radius: 12px; background: var(--hong); color: #fff; display: flex; align-items: center; justify-content: center; }
.nutDong { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: var(--hongNhat); color: var(--hong); display: flex; align-items: center; justify-content: center; }
.nutNho { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--hongVien); background: #fff; color: var(--hong); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.nutNho.dam { background: var(--hong); border-color: var(--hong); color: #fff; }
.chipPhong { flex: none; min-width: 92px; height: 48px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--gr); color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .04em; display: inline-flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; }
.logoM { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--gr); color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; }

/* ---------- ô tìm + gạt KARAOKE */
.oTim { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 48px; margin: 0; padding: 0 4px 0 12px; border-radius: 12px; background: #fff; border: 1.5px solid #ddd2d8; color: var(--mo); }
.oTim:focus-within { border-color: var(--hong); }
.oTim input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--chu); }
.oTim input::-webkit-search-cancel-button { display: none; }
.xoaQ { width: 40px; height: 40px; flex: none; border: 0; background: transparent; color: var(--hong); font-size: 26px; line-height: 1; }
.nutTim { height: 40px; flex: none; padding: 0 14px; border: 0; border-radius: 9px; background: var(--hong); color: #fff; font-weight: 800; }
.gatKara { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border-radius: 12px; border: 1.5px solid #ddd2d8; background: #fff; color: var(--mo); font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.gat { width: 40px; height: 22px; border-radius: 11px; background: #cbbfc5; position: relative; flex: none; transition: background .15s; }
.gat::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.gatKara.on { color: var(--hong); border-color: var(--hongVien); }
.gatKara.on .gat { background: #2e9e57; }
.gatKara.on .gat::after { transform: translateX(18px); }

/* ---------- MÀN MỞ ĐẦU (máy bảng) */
.kn { min-height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 18px 24px 24px; background: linear-gradient(180deg, #fff 0%, var(--hongNhat) 100%); }
.knTren { display: flex; align-items: center; gap: 12px; }
.knAnh { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; flex: none; box-shadow: 0 4px 12px rgba(122,26,66,.15); user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; touch-action: none; }
.knM { background: var(--gr); color: #fff; font-weight: 800; font-size: 28px; display: flex; align-items: center; justify-content: center; }
.knTen { display: flex; flex-direction: column; min-width: 0; }
.knTen b { font-size: 22px; font-weight: 800; }
.knTen small { color: var(--mo); font-size: 14px; }
.knHai { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; min-height: 0; }
.oLon { border: 0; border-radius: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; box-shadow: 0 16px 40px rgba(122,26,66,.14); min-height: 300px; }
.oLon b { font-size: 40px; font-weight: 800; letter-spacing: .03em; line-height: 1.1; }
.oLon small { font-size: 17px; line-height: 1.35; max-width: 360px; }
.oTron { width: 112px; height: 112px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.oYt { background: #fff; color: var(--chu); border: 2px solid var(--hongVien); }
.oYt .oTron { background: #e53935; color: #fff; }
.oYt small { color: var(--mo); }
.oChon { background: var(--gr); color: #fff; }
.oChon .oTron { background: #fff; color: var(--hong); }
.knDang { min-height: 56px; display: flex; align-items: center; gap: 12px; align-self: flex-start; max-width: calc(100% - 260px); padding: 8px 20px 8px 10px; border-radius: 999px; background: #fff; box-shadow: 0 6px 18px rgba(122,26,66,.10); color: var(--mo); }
.knDang:empty { display: none; }
.knDang .dangTrong { padding-left: 10px; font-weight: 600; }
.dangSong { width: 40px; height: 40px; border-radius: 50%; background: var(--hongNhat); color: var(--hong); display: flex; align-items: center; justify-content: center; flex: none; }
.dangChu { display: flex; flex-direction: column; min-width: 0; }
.dangChu small { font-size: 11px; font-weight: 800; letter-spacing: .05em; color: var(--hong); }
.dangChu b { color: var(--chu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- CHỌN BÀI – màn rộng (máy bảng, giống Smart Karaoke Player) */
.kc.rong { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.rong .tren { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--ke); }
.nutVe { width: 48px; height: 48px; flex: none; border: 0; border-radius: 12px; background: var(--hongNhat); color: var(--hong); display: flex; align-items: center; justify-content: center; }
.rong .than { flex: 1; min-height: 0; display: flex; }
.rong .trai { flex: 1; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.luoi { padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-content: start; }
.the { display: flex; flex-direction: column; border: 0; padding: 0; background: #fff; border-radius: 12px; overflow: hidden; text-align: left; box-shadow: 0 2px 8px rgba(35,26,36,.06); }
.the:active { transform: scale(.98); }
.theAnh, .dongAnh, .hopAnh, .dangAnh, .hbAnh { position: relative; background: #e7dfe3; overflow: hidden; }
.theAnh { aspect-ratio: 16 / 9; }
.theAnh img, .dongAnh img, .hopAnh img, .dangAnh img, .hbAnh img { width: 100%; height: 100%; object-fit: cover; }
.tg { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(20,14,18,.78); color: #fff; font-size: 12px; font-weight: 700; }
.theTen { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.theTen b, .dongTen b, .hbTen b { font-size: 14px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.theTen small, .dongTen small, .hbTen small { font-size: 12px; color: var(--mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kqChan { grid-column: 1 / -1; padding: 18px 8px 90px; text-align: center; color: var(--mo); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.kqChan.loi { color: var(--do); }

.rong .phai { width: 380px; flex: none; display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--ke); min-height: 0; }
.rong .oDang { flex: none; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 8px; }
.dangAnh { aspect-ratio: 16 / 9; border-radius: 12px; }
.dangNhan { position: absolute; left: 8px; top: 8px; padding: 3px 10px; border-radius: 999px; background: var(--gr); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; }
.dangTen { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dangTen b { font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dangTen small { font-size: 12px; color: var(--mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dangTrong { padding: 14px 4px; color: var(--mo); font-weight: 600; text-align: center; }
.rong .phim { flex: none; padding: 6px 8px 8px; border-bottom: 1px solid var(--ke); }
.pkHang { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.pk { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: transparent; padding: 4px 0; min-height: 66px; }
.pkTron { width: 46px; height: 46px; border-radius: 50%; background: var(--gr); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(214,51,122,.25); }
.pk:active .pkTron { transform: scale(.92); }
.pkChu { font-size: 10.5px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.amLuong { display: flex; align-items: center; gap: 10px; padding: 6px 6px 2px; font-size: 13px; color: var(--mo); }
.amThanh { flex: 1; height: 8px; border-radius: 999px; background: var(--ke); overflow: hidden; }
.amThanh span { display: block; height: 100%; background: var(--gr); border-radius: 999px; }
.amLuong b { min-width: 36px; text-align: right; color: var(--chu); }
.hangCho { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 96px; -webkit-overflow-scrolling: touch; }
.hangTieu { font-size: 13px; font-weight: 800; letter-spacing: .03em; padding: 4px 2px 8px; }
.hangTrong { color: var(--mo); padding: 8px 2px; font-size: 14px; }
.dsHang { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hb { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; border-radius: 12px; background: var(--nen); text-align: left; }
.hbSo { width: 26px; flex: none; text-align: center; font-weight: 800; color: var(--hong); }
.hbAnh { width: 80px; height: 45px; flex: none; border-radius: 8px; }
.hbTen { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hbTen b { font-size: 13px; }

/* ---------- CHỌN BÀI – điện thoại */
.kc.hep { min-height: 100vh; padding-bottom: 104px; }
.hep .dau { position: relative; z-index: 5; background: var(--gr); color: #fff; padding: 12px 14px 12px; border-radius: 0 0 22px 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 18px rgba(185,37,106,.25); }
.hep .dauHang { display: flex; align-items: center; gap: 10px; }
.hep .logoM { background: #fff; color: var(--hong); }
.dauTen { display: flex; flex-direction: column; }
.dauTen b { font-size: 17px; }
.dauTen small { font-size: 12.5px; opacity: .92; }
.hep .oDang { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px; border-radius: 14px; background: rgba(255,255,255,.95); color: var(--chu); }
.hep .dangAnh { width: 72px; height: 40px; flex: none; border-radius: 8px; aspect-ratio: auto; }
.hep .dangNhan { display: none; }
.hep .dangTrong { padding: 6px; font-size: 13.5px; text-align: left; }
.tabs { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 10px 12px 8px; background: var(--nen); }
.tabs button { min-height: 46px; border: 1.5px solid var(--ke); border-radius: 12px; background: #fff; font-weight: 700; color: var(--mo); }
.tabs button.on { background: var(--hongNhat); border-color: var(--hongVien); color: var(--hong); }
.soNho { font-weight: 800; }
.hepThan { padding: 4px 12px 0; }
.hangTim { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.hep .gatKara { padding: 0 10px; font-size: 12.5px; gap: 6px; }
.hep .gat { width: 34px; height: 20px; }
.hep .gat::after { width: 14px; height: 14px; }
.hep .gatKara.on .gat::after { transform: translateX(14px); }
.hep .nutTim { display: none; }
.dsKq { display: flex; flex-direction: column; gap: 10px; }
.dong { background: #fff; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 2px 8px rgba(35,26,36,.05); }
.dongBam { display: flex; gap: 10px; align-items: flex-start; border: 0; background: transparent; padding: 0; text-align: left; }
.dongAnh { width: 128px; height: 72px; flex: none; border-radius: 10px; }
.dongTen { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dongNut { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hep .hangCho { padding: 0 0 20px; overflow: visible; }
.hep .hb { background: #fff; box-shadow: 0 2px 8px rgba(35,26,36,.05); }
.phim.duoi { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: #fff; border-top: 1px solid var(--ke); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 18px rgba(35,26,36,.08); }
.phim.duoi .pkTron { width: 42px; height: 42px; }
.phim.duoi .pkChu { font-size: 9.5px; }
.phim.duoi .amLuong { padding: 2px 8px 0; font-size: 12px; }

/* ---------- hộp (bảng nhỏ) */
.nenHop { position: fixed; inset: 0; z-index: 50; background: rgba(35,26,36,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.hop { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 22px; box-shadow: 0 24px 60px rgba(35,26,36,.3); display: flex; flex-direction: column; }
.hopTieu { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; }
.hopTieu b { flex: 1; min-width: 0; font-size: 16px; line-height: 1.3; }
.hopAnh { aspect-ratio: 16 / 9; }
.hopNut { padding: 14px; display: grid; gap: 12px; }
.hopNut.hai { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hopNut.ba { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hopQr { width: min(420px, 100%); align-items: center; padding-bottom: 18px; text-align: center; }
.hopQr .hopTieu { align-self: stretch; }
.qrKhung { position: relative; padding: 14px; border-radius: 24px; background: #fff; box-shadow: 0 14px 30px rgba(214,51,122,.22); margin: 8px 0 6px; }
.qrKhung canvas { display: block; width: 240px; height: 240px; image-rendering: pixelated; }
.qrPhong { position: absolute; top: -12px; right: -12px; padding: 5px 12px; border-radius: 999px; background: var(--gr); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .05em; }
.qrChu { margin: 12px 22px 4px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.qrPhu { margin: 0 22px 12px; font-size: 13px; color: var(--mo); }
.hopMk { width: min(420px, 100%); padding-bottom: 16px; }
.mkChu { margin: 0 18px; color: var(--mo); text-align: center; }
.mkDong { display: flex; justify-content: center; gap: 14px; margin: 14px 0 4px; min-height: 22px; }
.mkO { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--hong); }
.mkO.co { background: var(--hong); }
.mkLoi { min-height: 20px; margin: 4px 18px; text-align: center; color: var(--do); font-weight: 600; font-size: 14px; }
.mkLuoi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 6px 18px 0; }
.mkPhim { min-height: 60px; border: 0; border-radius: 16px; background: var(--hongNhat); color: var(--chu); font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.mkPhim.phu { background: #f1ecee; color: var(--mo); }
.mkPhim.ok { background: var(--gr); color: #fff; font-size: 20px; }
.hopPhong { width: min(640px, 100%); padding-bottom: 4px; }
.pLuoi { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 4px 18px 14px; }
.pPhong { min-height: 72px; border: 2px solid var(--hongVien); border-radius: 16px; background: #fff; font-weight: 800; font-size: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pPhong small { font-size: 11px; font-weight: 600; color: var(--mo); }
.pPhong.dang { background: #f1ecee; border-color: #e2d8dd; opacity: 1; }
.pPhong.chon { background: var(--gr); border-color: transparent; color: #fff; }
.hopPhong .mkChu { margin-bottom: 4px; font-size: 14px; }

/* ---------- báo nhanh */
.bao { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: #2b2028; color: #fff; font-weight: 600; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; text-align: center; }
.bao.hien { opacity: 1; transform: translate(-50%, 0); }
.bao.loi { background: var(--do); }
.hep ~ .bao, .hep .bao { bottom: 120px; }

/* ---------- lỗi lớn (mã QR hết hạn…) */
.kaLoi { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(180deg, #fff, var(--hongNhat)); }
.kaLoiThe { width: min(420px, 100%); background: #fff; border-radius: 24px; padding: 26px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 18px 40px rgba(122,26,66,.15); }
.kaLoiDau { width: 64px; height: 64px; border-radius: 50%; background: var(--hongNhat); color: var(--hong); display: flex; align-items: center; justify-content: center; }
.kaLoiThe b { font-size: 20px; }
.kaLoiThe p { margin: 0; color: var(--mo); }

@media (max-width: 380px) {
  .dongAnh { width: 104px; height: 58px; }
  .hep .gatKara { font-size: 0; gap: 0; padding: 0 8px; }
}
