/* OKARA Pad RC (PWA) — dựng 1:1 theo MainVC storyboard iOS.
   Toạ độ dùng đơn vị điểm (pt) của iPad; #stage cao tối thiểu 768pt, rộng co giãn
   (giống autoresizing trên iPad) rồi scale vừa màn hình. */
@font-face { font-family: Roboto; src: url(/assets/fonts/Roboto-Regular.ttf); font-weight: 400; }
@font-face { font-family: Roboto; src: url(/assets/fonts/Roboto-Bold.ttf); font-weight: 700; }
@font-face { font-family: MyriadPro; src: url(/assets/fonts/MyriadPro-Regular.otf); }

:root { --W: 1024px; --H: 768px; --img: url(/assets/img/); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; overscroll-behavior: none; }
body { font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; color: #000; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; border: 0; padding: 0; margin: 0; background: transparent no-repeat center / 100% 100%; cursor: pointer; color: inherit; }
img { display: block; -webkit-user-drag: none; }
[hidden] { display: none !important; }

#stage { position: absolute; left: 0; top: 0; width: var(--W); height: var(--H); transform-origin: 0 0; overflow: hidden; background: #fff; }

/* ───────── Vùng trên ───────── */
#top { position: absolute; left: 0; top: 0; right: 0; bottom: 87px; background: url(/assets/img/bg_page.png) 0 0 / 100% 100%; }
#header { position: absolute; left: 0; right: 0; top: 1px; height: 57px; z-index: 3; }
#tabbar { position: absolute; left: 32px; right: 32px; top: 0; bottom: 0; }
.badge { position: absolute; top: 0; width: 37px; height: 37px; background-image: url(/assets/img/bg_selected_song_number.png); color: #fff; font: 14px Arial, sans-serif; z-index: 4; pointer-events: none; }

.tabFrame { position: absolute; top: 0; bottom: 0; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.5); border-radius: 8px; }
.tab { position: absolute; top: 5px; background-image: url(/assets/img/bg_topbar_normal_long.png); color: #aeaeae; font: 12px Arial, sans-serif; white-space: nowrap; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tab.sel { background-image: url(/assets/img/bg_topbar_selected_long.png); color: #46044c; font: bold 13px Arial, sans-serif; }
.tab.group { font: bold 14px Arial, sans-serif; color: #aeaeae; }
.tab.group.label { background-image: none; pointer-events: none; }
.tab.group svg { width: 15px; height: 15px; fill: #e6e6e6; flex: none; }
.tab .uline { position: absolute; height: 3px; border-radius: 1.5px; bottom: 10px; }
.tab.anim { animation: tabIn .2s ease-out both; }
.tabFrame.anim { animation: frameIn .22s ease-out both; }
@keyframes tabIn { from { opacity: 0; transform: translateX(-12px); } }
@keyframes frameIn { from { opacity: 0; transform: scaleX(.92); } }

#searchBand { position: absolute; left: 0; right: 0; top: 51px; height: 81px; z-index: 2; }
#searchBand::before { content: ""; position: absolute; left: 6px; right: 6px; top: 0; height: 81px; background: url(/assets/img/bg_list_song_search.png) 0 0 / 100% 100%; }
#viewSearch { position: absolute; left: 16px; right: 16px; top: 6px; height: 69px; background: url(/assets/img/bg_tab_search_song_normal.png) 0 0 / 100% 100%; }
#viewSearch.focus { background-image: url(/assets/img/bg_tab_search_song_select.png); }
#viewSearch .searchIcon { position: absolute; left: 23px; top: 19px; width: 32px; height: 32px; }
#txtSearch { position: absolute; left: 82px; right: 80px; top: 11px; height: 47px; border: 0; outline: 0; background: transparent; font-size: 19px; color: #000; text-transform: uppercase; }
#phSearch { position: absolute; left: 82px; top: 11px; height: 47px; line-height: 47px; font-size: 19px; color: #b4b4b4; pointer-events: none; white-space: nowrap; }
#phSearch b { color: #000; font-weight: 400; }
#btnClearSearch { position: absolute; right: 13px; top: 12px; width: 45px; height: 45px; background-image: url(/assets/img/item_del_search_song.png); background-size: 34px 34px; }

#listFrame { position: absolute; left: 6px; right: 6px; top: 131px; bottom: 0; background: url(/assets/img/bg_list_song.png) 0 0 / 100% 100%; }
#content { position: absolute; left: 12px; right: 16px; top: 131px; bottom: 0; background: #fff; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
#top.withPaging #content { bottom: 52px; }
#top.withTags #content { top: 186px; }
#viewAllTag { position: absolute; left: 12px; right: 12px; top: 132px; height: 55px; background: #eff9fb; display: flex; align-items: center; z-index: 1; }
#viewAllTag .lbl { width: 100px; padding-left: 21px; font-weight: bold; font-size: 20px; flex: none; }
#viewAllTag .tags { flex: 1; display: flex; gap: 10px; overflow-x: auto; padding-right: 10px; scrollbar-width: none; }
#viewAllTag .tags::-webkit-scrollbar { display: none; }
#viewAllTag .tags button { flex: none; height: 36px; padding: 0 16px; border-radius: 18px; background: #fff; border: 1px solid #c8d4d8; font-size: 16px; color: #333; }
#viewAllTag .tags button.on { background: #46044c; color: #fff; border-color: #46044c; }

#viewPaging { position: absolute; left: 6px; right: 6px; bottom: 0; height: 52px; background: url(/assets/img/bg_list_song_paging.png) 0 0 / 100% 100%; display: none; }
#top.withPaging #viewPaging { display: block; }
#optSelected { position: absolute; left: 34px; top: 4px; height: 38px; display: flex; }
.optBtn { height: 38px; color: #000; font-size: 16px; }
#btnOptSelected { width: 99px; background-image: url(/assets/img/btn_paging_da_chon_normal.png); }
#btnOptSelected.sel { background-image: url(/assets/img/btn_paging_da_chon_highlight.png); }
#btnOptPlayed { width: 86px; margin-left: 1px; background-image: url(/assets/img/btn_paging_da_hat_normal.png); }
#btnOptPlayed.sel { background-image: url(/assets/img/btn_paging_da_hat_highlight.png); }
#btnChooseDai { position: absolute; right: 52px; top: 4px; width: 140px; height: 38px; color: #fff; font: 700 16px Roboto, sans-serif; border-style: solid; border-width: 0 25px; border-image: url(/assets/img/btn_ok_admin_popup_active.png) 0 50 fill / 0 25px stretch; background: none; }

#viewSuggestConnect { position: absolute; left: 0; bottom: 0; width: 269px; height: 128px; background: url(/assets/img/bg_mat_ket_noi_popup.png) 0 0 / 269px 117px no-repeat; z-index: 5; }
#viewSuggestConnect span { position: absolute; left: 24px; top: 17px; width: 221px; height: 74px; display: flex; align-items: center; font: bold 16px -apple-system, "Helvetica Neue", sans-serif; }

/* ───────── Danh sách bài (SongViewCell 1000x61) ───────── */
.row { position: relative; height: 61px; background: url(/assets/img/bg_song_item_normal_blue.png) 0 0 / 100% 100%; display: flex; align-items: center; }
.row:active, .row.sel { background-image: url(/assets/img/bg_list_song_selected.png); }
.row::after { content: ""; position: absolute; left: 12px; right: 13px; bottom: 0; height: 1px; background: #e4e7e8; }
.row .div { position: absolute; left: 63.3%; top: 0; width: 2px; height: 61px; background: #e4e7e8; }
.row .pick { position: absolute; left: 9px; top: 11px; width: 67px; height: 39px; background: url(/assets/img/bg_select_normal_list_song.png) 0 0 / 100% 100%; font: 16px Roboto, sans-serif; color: #000; }
.row .picked { position: absolute; left: 9px; top: 11px; width: 67px; height: 39px; background: url(/assets/img/bg_selected_list_song.png) 0 0 / 100% 100%; text-align: center; }
.row .picked .n { display: block; font: 700 20px/21px Roboto, sans-serif; margin-top: 4px; }
.row .picked .t { display: block; font-size: 10px; line-height: 13px; }
.row .picked img { width: 26px; height: 24px; margin: 3px auto 0; }
.row .up { position: absolute; left: 9px; top: 11px; width: 67px; height: 39px; background-image: url(/assets/img/bg_selected_list_song.png); }
.row .up img { width: 24px; height: 24px; margin: auto; }
.row .name { position: absolute; left: 92px; right: calc(36.7% + 10px); top: 8px; height: 45px; line-height: 45px; font: 700 22px/45px Roboto, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .singer { position: absolute; left: calc(63.3% + 27px); right: 40px; top: 9px; height: 43px; font: 22px/43px MyriadPro, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.hasAct .singer { right: 90px; }
.row .del { position: absolute; right: 9px; top: 11px; width: 67px; height: 39px; color: #fff; font: 700 17px Roboto, sans-serif; background-image: url(/assets/img/bg_select_list_song_huy_normal.png); }
.row .del:active { background-image: url(/assets/img/bg_select_list_song_huy_active.png); }
.row .del.confirm { background-image: url(/assets/img/bg_select_delete_normal_list_song.png); }
.row .listen { position: absolute; right: 11px; top: 11px; width: 90px; height: 40px; background-image: url(/assets/img/btn_try_music_soundcloud_normal.png); font: 16px Roboto, sans-serif; }
.row.online .singer { right: 110px; }
.empty { padding: 90px 40px; text-align: center; font: 27px Roboto, sans-serif; color: #000; }
.empty .btnBlue { display: block; margin: 28px auto 0; width: 257px; height: 106px; color: #fff; font: 700 25px Roboto, sans-serif; background-image: url(/assets/img/btn_popup_blue_normal.png); padding-bottom: 12px; }
.loadMore { height: 50px; display: flex; align-items: center; justify-content: center; color: #888; }

/* ───────── Lưới (ca sĩ / video / thể loại) ───────── */
.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 14px; padding: 16px 8px 32px; }
.singer-card { width: 200px; height: 244px; border-radius: 8px; background: #1f1436; position: relative; overflow: hidden; }
.singer-card img { position: absolute; left: 6px; top: 6px; width: 188px; height: 172px; border-radius: 5px; object-fit: cover; }
.singer-card .nm { position: absolute; left: 0; right: 0; bottom: 0; height: 66px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 8px; color: #fff; font-weight: bold; font-size: 13px; }
.grid.singers { gap: 8px; padding: 8px; }

.yt-card { width: 252px; height: 202px; border-radius: 8px; background: #1f1436; position: relative; overflow: hidden; color: #ebebeb; }
.yt-card.sel { background: linear-gradient(#fcf2c4, #edc759 50%, #c8973b); color: #1f1f1f; }
.yt-card .th { position: absolute; left: 6px; top: 6px; width: 240px; height: 128px; border-radius: 5px; object-fit: cover; background: #2b2146 url(/assets/img/bg_language_no_img.png) center / cover; }
.yt-card .ttl { position: absolute; left: 8px; right: 8px; top: 140px; height: 56px; font-weight: bold; font-size: 13px; line-height: 17px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-top: 4px; }
.pill { position: absolute; height: 20px; border-radius: 4px; color: #fff; font: bold 10px/20px -apple-system, sans-serif; text-align: center; }
.pill.k { left: 12px; top: 12px; width: 68px; background: #cc1a1a; }
.pill.r { left: 12px; top: 36px; width: 56px; background: #1a73d9; }
.pill.g { right: 12px; top: 12px; width: 44px; background: #338c33; }
.yt-card .selb { position: absolute; left: 12px; top: 98px; width: 52px; height: 30px; border-radius: 6px; background: #edc740; display: flex; align-items: center; }
.yt-card .selb img { width: 20px; height: 20px; margin-left: 4px; }
.yt-card .selb b { width: 22px; text-align: center; color: #fff; font-size: 16px; margin-left: 2px; }
.grid.yt { gap: 32px 16px; padding: 16px 12px 32px; }

.cat-card { width: 211px; height: 162px; position: relative; margin: 40px 19px 42px 20px; }
.cat-card img { width: 211px; height: 162px; object-fit: cover; }
.cat-card .nm { position: absolute; left: 0; right: 0; bottom: 0; height: 42px; background: rgba(0,0,0,.5); color: #fff; font: bold 17px/42px -apple-system, sans-serif; text-align: center; }
.grid.cats { gap: 0; padding: 0; justify-content: flex-start; }

/* ───────── Thanh điều khiển dưới ───────── */
#bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 94px; background: url(/assets/img/bg_bottom_normal.png) 0 0 / 100% 100%; z-index: 6; }
.ctl { position: absolute; top: 10px; width: 71px; height: 84px; }
.ctl.r { left: auto; right: calc(var(--r) - 71px); }
.ctl .rb { position: absolute; left: 0; top: 0; width: 71px; height: 71px; }
.ctl label { position: absolute; left: 0; top: 62px; width: 71px; height: 20px; text-align: center; color: #868686; font: bold 12px/20px "ProximaNova-Bold", -apple-system, "Helvetica Neue", sans-serif; pointer-events: none; }
#conn { left: 0; width: 142px; }
#btnConn { position: absolute; left: 0; top: 7px; width: 153px; height: 71px; background-image: url(/assets/img/btn_da_ket_noi_normal.png); }
#btnConn:active { background-image: url(/assets/img/btn_da_ket_noi_highlighted.png); }
#conn .ktv { position: absolute; left: 0; top: 26px; width: 35px; height: 13px; pointer-events: none; }
#imgStateSocket { position: absolute; left: 0; top: 40px; width: 37px; height: 33px; pointer-events: none; }
#lblStateConnect { position: absolute; left: 36px; top: 22px; width: 98px; height: 20px; text-align: center; color: #fff; font: bold 12px/20px -apple-system, "Helvetica Neue", sans-serif; pointer-events: none; }
#lblSsid { position: absolute; left: 35px; top: 43px; width: 99px; height: 20px; text-align: center; color: #868686; font: bold 11px/20px -apple-system, sans-serif; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#imgStateSocket.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#display { position: absolute; left: 370px; right: 302px; top: 0; height: 82px; }
#display .bg { position: absolute; inset: 8px 0 0 0; border-style: solid; border-width: 0 88px 0 12px; border-image: url(/assets/img/bg_bottom_display_song_normal.png) 0 176 0 24 fill / 0 88px 0 12px stretch; }
#lblNow { position: absolute; left: 16px; right: 93px; top: 23px; height: 21px; color: #fff; font-size: 18px; line-height: 21px; overflow: hidden; white-space: nowrap; }
#lblNow span { display: inline-block; }
#lblNow.run span { animation: marquee var(--dur, 10s) linear infinite; padding-right: 60px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
#lblNextTitle { position: absolute; left: 16px; top: 51px; color: #8f6098; font-size: 13px; line-height: 21px; }
#lblNext { position: absolute; left: 84px; right: 93px; top: 49px; height: 25px; color: #8f6098; font-size: 14px; line-height: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#display::after { content: ""; position: absolute; right: 84px; top: 17px; width: 3px; height: 54px; background: url(/assets/img/vach_am_luong.png) 0 0 / 100% 100%; }
#display .vol { position: absolute; right: 11px; top: 19px; width: 75px; height: 55px; text-align: center; }
#lblVolume { color: #fff; font: 900 32px/42px "Arial Black", Arial, sans-serif; margin-top: 2px; }
#display .vol .t { color: #8f6098; font-size: 12px; line-height: 13px; }

/* ───────── Popup (KLCPopup) ───────── */
#overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); z-index: 20; display: flex; align-items: center; justify-content: center; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.pop { position: relative; animation: popIn .25s cubic-bezier(.2,1.4,.5,1); }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } }
.pop-menu { width: 520px; height: 411px; background: url(/assets/img/bg_menu_popup.png) 0 0 / 100% 100%; }
.pop-menu .it { position: absolute; width: 100px; height: 140px; background-size: 100px auto; background-position: center 0; }
.pop-menu .cap { position: absolute; text-align: center; font: 17px Roboto, sans-serif; color: #000; pointer-events: none; }
.pop-menu .upd { position: absolute; left: 381px; top: 45px; width: 80px; height: 80px; pointer-events: none; }

.pop-std { width: 511px; background: url(/assets/img/bg_popup_mat_ket_noi.png) 0 0 / 100% 100%; padding: 59px 43px 30px; text-align: center; }
.pop-std .close { position: absolute; right: -1px; top: -17px; width: 72px; height: 72px; background-image: url(/assets/img/ic_popup_cancel.png); }
.pop-std h3 { margin: 0; height: 50px; font: 700 25px/50px Roboto, sans-serif; color: #000; }
.pop-std .icons { display: flex; justify-content: center; gap: 13px; margin: 32px 0 15px; height: 66px; }
.pop-std .icons img { height: 66px; }
.pop-std .msg { font-size: 24px; min-height: 103px; display: flex; align-items: center; justify-content: center; }
.pop-std .btnBlue { display: block; margin: 20px auto 0; width: 335px; height: 106px; color: #fff; font: 700 23px Roboto, sans-serif; background-image: url(/assets/img/btn_popup_blue_normal.png); padding-bottom: 12px; }
.pop-std .btnBlue:active { background-image: url(/assets/img/btn_popup_blue_select.png); }
.pop-std input { width: 100%; height: 56px; font-size: 22px; padding: 0 16px; border: 1px solid #bbb; border-radius: 8px; margin-top: 8px; }

#toast { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 12px 24px; border-radius: 10px; font-size: 18px; z-index: 30; max-width: 70%; text-align: center; }
.flyNote { position: absolute; width: 30px; height: 30px; z-index: 25; pointer-events: none; transition: transform .6s cubic-bezier(.4,0,.6,1), opacity .6s; }

#rotateHint { position: fixed; inset: 0; background: #000; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; z-index: 99; }
