/* ZeusVN – "Bé Zeus" (trợ lý AI: nút rồng nổi + khung chat) và trình phát nhạc nền. Dùng biến màu của zv.css. */

@keyframes bzBob { 50% { transform: translateY(-5px); } }
@keyframes bzJump { 30% { transform: translateY(-14px) rotate(-8deg) scale(1.08); } 60% { transform: translateY(2px) scale(.96); } }
@keyframes bzRing { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes bzSpin { to { transform: rotate(360deg); } }
@keyframes bzcIn { from { opacity: 0; transform: translateY(10px) scale(.95); } }
@keyframes bzcDot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes bzcPulse { 50% { box-shadow: 0 0 0 5px rgba(88, 214, 141, 0); } }
@keyframes bzcGlow { 50% { box-shadow: 0 10px 28px -6px rgba(255, 217, 138, .9); } }
@keyframes bzcZap { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes eq { 0%, 100% { transform: scaleY(var(--h0, .3)); } 50% { transform: scaleY(1); } }   /* scaleY: không tính lại bố cục */

/* ---------- nút nhạc trên đầu trang ---------- */
.hbtn { position: relative; display: grid; place-items: center; width: 42px; height: 40px; padding: 10px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--mut); transition: border-color .25s, color .25s; }
.hbtn:hover { border-color: var(--line2); color: var(--dong2); }
.hbtn svg { width: 100%; height: 100%; }
.js-music .eq { display: none; align-items: flex-end; justify-content: center; gap: 3px; width: 18px; height: 16px; }
.js-music .eq i { width: 3px; height: 100%; --h0: .3; transform-origin: 50% 100%; border-radius: 2px; background: var(--dong2); animation: eq 1s ease-in-out infinite; }
.js-music .eq i:nth-child(2) { animation-delay: -.3s; } .js-music .eq i:nth-child(3) { animation-delay: -.6s; } .js-music .eq i:nth-child(4) { animation-delay: -.15s; }
.js-music.playing { border-color: var(--line2); color: var(--dong2); }
.js-music.playing .eq { display: flex; }
.js-music.playing .mnote { display: none; }

/* ---------- trình phát nhạc ---------- */
.mp { --sc: var(--dong); position: fixed; right: 20px; top: 80px; z-index: 95; width: 350px; max-width: calc(100vw - 24px); padding: 18px; border-radius: 24px; background: rgba(9, 13, 26, .96); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--line); box-shadow: 0 40px 90px -30px #000, 0 0 0 1px rgba(232, 176, 79, .12); opacity: 0; transform: translateY(-12px) scale(.96); transform-origin: 90% 0; transition: opacity .35s, transform .45s var(--ease); }
.mp.open { opacity: 1; transform: none; }
.mp::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(80% 60% at 20% 0%, color-mix(in srgb, var(--sc) 22%, transparent), transparent 70%); pointer-events: none; transition: background .8s; }
.mp > * { position: relative; }
.mp-grip { display: none; }
.mp-now { display: flex; gap: 14px; align-items: center; }
.mp-disc { position: relative; flex: none; width: 66px; height: 66px; border-radius: 50%; background: repeating-radial-gradient(circle, #0c1122 0 2px, #161d33 2px 3px); box-shadow: 0 0 0 1px rgba(232, 176, 79, .3), 0 10px 24px -8px #000; animation: bzSpin 6s linear infinite paused; }
.mp-disc::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 30deg, transparent 0 10%, rgba(255, 255, 255, .16) 14%, transparent 20% 60%, rgba(255, 255, 255, .1) 64%, transparent 70%); }
.mp-disc i { position: absolute; inset: 32%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff6df, var(--sc) 70%); transition: background .8s; }
.mp-disc i::after { content: ''; position: absolute; inset: 42%; border-radius: 50%; background: var(--bg); }
.mp.playing .mp-disc { animation-play-state: running; }
.mp-meta { min-width: 0; }
.mp-meta small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut2); }
.mp-title { display: block; margin: 4px 0 2px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--sc); transition: color .8s; }
.mp-sub { font-size: 12.5px; color: var(--mut); }
.mp-bar { height: 3px; margin: 14px 2px 0; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.mp-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sc); box-shadow: 0 0 8px var(--sc); transition: width .25s linear; }
.mp-ctrl { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 16px 0 10px; }
.mp-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--tx); font-size: 13px; transition: transform .25s var(--ease), border-color .25s; }
.mp-btn:hover { border-color: var(--line2); }
.mp-btn:active { transform: scale(.88); }
.mp-main { width: 58px; height: 58px; border: 0; background: var(--grad); color: #160d02; font-size: 17px; box-shadow: 0 10px 26px -10px rgba(232, 176, 79, .9); }
.mp-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 3px; }
.mp-song { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 14px; background: none; text-align: left; color: var(--tx); transition: background .3s; -webkit-tap-highlight-color: transparent; }
.mp-song:hover { background: rgba(255, 255, 255, .05); }
.mp-song.on { background: linear-gradient(90deg, color-mix(in srgb, var(--sc) 22%, transparent), transparent); }
.mp-song > span:nth-child(2) { flex: 1; min-width: 0; }
.mp-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 10px var(--sc); }
.mp-song b { display: block; font-size: 14px; font-weight: 600; }
.mp-song small { display: block; font-size: 11.5px; color: var(--mut2); }
.mp-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.mp-eq i { width: 3px; height: 100%; --h0: .4; transform-origin: 50% 100%; border-radius: 2px; background: var(--sc); animation: eq 1s ease-in-out infinite; }
.mp-eq i:nth-child(2) { animation-delay: -.35s; } .mp-eq i:nth-child(3) { animation-delay: -.7s; }
.mp.playing .mp-song.on .mp-eq { display: flex; }
.mp-vol { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 4px; font-size: 13px; color: var(--mut); }
.mp-vol input { flex: 1; max-width: 190px; accent-color: var(--dong); }
.mp-note { margin: 4px 4px 0; font-size: 11.5px; color: var(--mut2); }

/* ---------- nút rồng nổi (mở Bé Zeus) ---------- */
.bz-fab { position: fixed; right: 26px; bottom: 26px; z-index: 70; display: grid; place-items: center; width: 68px; height: 68px; padding: 0; border-radius: 50%; border: 1px solid rgba(232, 176, 79, .55);
  background: radial-gradient(circle at 35% 30%, #1b2440, #070a14 70%); box-shadow: 0 18px 40px -12px #000, 0 0 24px -4px rgba(232, 176, 79, .45), inset 0 0 0 3px rgba(255, 217, 138, .06); cursor: pointer; transition: transform .5s cubic-bezier(.4, 1.6, .4, 1), opacity .3s; -webkit-tap-highlight-color: transparent; }
.bz-fab img { width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); animation: bzBob 3.4s ease-in-out infinite; }
.bz-fab:hover { transform: translateY(-4px) rotate(-6deg) scale(1.06); }
.bz-fab.jump img { animation: bzJump .7s cubic-bezier(.4, 1.8, .5, 1); }
.bz-fab em { position: absolute; right: -4px; top: 2px; padding: 1px 6px; border-radius: 99px; background: var(--grad); color: #160d02; font: 800 9.5px/1.5 var(--sans); font-style: normal; letter-spacing: .08em; }
.bz-ring { position: absolute; inset: -2px; border-radius: 50%; border: 2px solid rgba(255, 217, 138, .7); animation: bzRing 2.6s ease-out infinite; pointer-events: none; }
.bz-say { position: fixed; right: 106px; bottom: 44px; z-index: 70; max-width: 280px; margin: 0; padding: 12px 16px; border-radius: 18px 18px 4px 18px; background: #f7f3e8; color: #141a2c; font-size: 14px; line-height: 1.5; box-shadow: 0 18px 40px -14px #000;
  opacity: 0; transform: translateY(10px) scale(.85); transform-origin: 100% 100%; transition: opacity .4s, transform .45s cubic-bezier(.4, 1.6, .5, 1); pointer-events: none; cursor: pointer; }
.bz-say.show { opacity: 1; transform: none; pointer-events: auto; }
.bz-say b { color: #a8650f; }
html.bzc-on .bz-fab, html.bzc-on .bz-say { opacity: 0; pointer-events: none; transform: scale(.6); }

/* ---------- khung chat ---------- */
.bzc { position: fixed; right: 20px; bottom: 20px; z-index: 96; display: flex; flex-direction: column; width: 410px; height: min(690px, calc(100vh - 40px)); border-radius: 26px; overflow: hidden; background: var(--bg2); color: var(--tx);
  box-shadow: 0 50px 100px -30px #000, 0 0 0 1px rgba(232, 176, 79, .35), 0 0 60px -20px rgba(232, 176, 79, .35); opacity: 0; transform: translateY(24px) scale(.94); transform-origin: 90% 100%; transition: opacity .35s, transform .5s var(--ease); }
.bzc.open { opacity: 1; transform: none; }
.bzc::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(60% 40% at 30% 0%, rgba(255, 246, 216, .35), transparent 70%); }
.bzc.zap::after { animation: bzcZap .7s ease-out; }
.bzc-h { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: radial-gradient(120% 170% at 0% 0%, #2a2210, #0a0e1c 70%); }
.bzc-h::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--dong), transparent); }
.bzc-av { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #1b2440, #070a14 70%); border: 1px solid rgba(232, 176, 79, .5); }
.bzc-av img { width: 86%; height: 86%; object-fit: contain; animation: bzBob 3.4s ease-in-out infinite; }
.bzc-who { flex: 1; min-width: 0; }
.bzc-who b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bzc-who small { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-family: var(--mono); font-size: 11px; color: var(--mut); }
.bzc-who small i { width: 7px; height: 7px; border-radius: 50%; background: var(--lua); box-shadow: 0 0 0 0 rgba(88, 214, 141, .6); animation: bzcPulse 2s infinite; }
.bzc.busy .bzc-who small i { background: var(--dong2); }
.bzc-h button { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 9px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--tx); transition: border-color .3s, transform .3s; -webkit-tap-highlight-color: transparent; }
.bzc-h button:hover { border-color: var(--line2); }
.bzc-h button:active { transform: scale(.88); }
.bzc-h button svg { width: 100%; height: 100%; }
.bzc-log { flex: 1; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px 10px;
  background: radial-gradient(70% 40% at 100% 0%, rgba(91, 120, 255, .1), transparent 70%), radial-gradient(70% 40% at 0% 100%, rgba(232, 176, 79, .1), transparent 70%), var(--bg2); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.bzc-m { display: flex; align-items: flex-end; gap: 8px; animation: bzcIn .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.bzc-m.me { justify-content: flex-end; }
.bzc-mav { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #0a0e1c; border: 1px solid rgba(232, 176, 79, .4); }
.bzc-mav img { width: 86%; height: 86%; object-fit: contain; }
.bzc-bw { display: grid; gap: 8px; min-width: 0; max-width: 86%; }
.bzc-b { margin: 0; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: rgba(255, 255, 255, .055); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.bzc-b b { color: var(--dong2); font-weight: 700; }
.bzc-m.me .bzc-b { max-width: 82%; border: 0; border-radius: 18px 18px 6px 18px; background: var(--grad); color: #160d02; font-weight: 500; }
.bzc-m.me .bzc-b b { color: inherit; }
.bzc-typing { display: inline-flex; gap: 5px; padding: 5px 2px 1px; }
.bzc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--dong); animation: bzcDot 1.1s ease-in-out infinite; }
.bzc-typing i:nth-child(2) { animation-delay: .15s; } .bzc-typing i:nth-child(3) { animation-delay: .3s; }
.bzc-cards { display: grid; gap: 7px; }
.bzc-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, transparent), rgba(255, 255, 255, .02));
  animation: bzcIn .5s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--i) * 90ms); transition: transform .3s var(--ease), border-color .3s; }
.bzc-card:hover { transform: translateX(3px); border-color: var(--c); }
.bzc-ci { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.bzc-ci svg { width: 20px; height: 20px; }
.bzc-ct { min-width: 0; line-height: 1.25; }
.bzc-ct small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut2); }
.bzc-ct b { display: block; margin-top: 2px; font-size: 14.5px; font-weight: 700; color: var(--tx); }
.bzc-ct em { display: block; margin-top: 2px; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--dong2); }
.bzc-ctas { display: flex; flex-wrap: wrap; gap: 8px; }
.bzc-cta { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 700; animation: bzcIn .5s .2s both; -webkit-tap-highlight-color: transparent; transition: transform .2s; }
.bzc-cta svg { width: 17px; height: 17px; }
.bzc-cta:active { transform: scale(.95); }
.bzc-try { background: var(--grad); color: #160d02; box-shadow: 0 10px 22px -10px rgba(232, 176, 79, .9); animation: bzcIn .5s .2s both, bzcGlow 2.4s 1.2s ease-in-out infinite; }
.bzc-zl { border: 1px solid rgba(70, 224, 255, .45); background: rgba(70, 224, 255, .08); color: #bff3ff; }
.bzc-chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px 4px; background: var(--bg2); scrollbar-width: none; }
.bzc-chips::-webkit-scrollbar { display: none; }
.bzc-chips:empty { display: none; }
.bzc-chips button { flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line2); background: rgba(232, 176, 79, .06); color: var(--dong2); font-size: 13px; font-weight: 600; white-space: nowrap; animation: bzcIn .4s both; animation-delay: calc(var(--i) * 70ms); transition: background .25s, color .25s; -webkit-tap-highlight-color: transparent; }
.bzc-chips button:hover { background: var(--dong); color: #160d02; }
.bzc-f { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; background: var(--bg2); border-top: 1px solid var(--line); }
.bzc-f textarea { flex: 1; min-width: 0; max-height: 110px; padding: 11px 16px; resize: none; border-radius: 22px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--tx); font: 400 16px/1.4 var(--sans); outline: none; transition: border-color .25s; }
.bzc-f textarea::placeholder { color: var(--mut2); }
.bzc-f textarea:focus { border-color: var(--line2); }
.bzc-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 11px; border: 0; border-radius: 50%; background: var(--grad); color: #160d02; transition: transform .25s; }
.bzc-send svg { width: 100%; height: 100%; }
.bzc-send:active { transform: scale(.86) rotate(-12deg); }
.bzc.busy .bzc-send { opacity: .45; }
.bzc-note { margin: 0; padding: 2px 14px 10px; background: var(--bg2); font-size: 10.5px; text-align: center; color: var(--mut2); }

/* nút "Hỏi Bé Zeus" trong trang */
.btn-bezeus { border-color: var(--line2) !important; }
.btn-bezeus img { width: 22px; height: 22px; object-fit: contain; }

@media (max-width: 960px) {
  /* điện thoại: Bé Zeus nằm trong thanh dưới (.mbar-ai) – bỏ nút nổi để không che chữ */
  .bz-fab { display: none; }
  .bz-say { left: 14px; right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: none; border-radius: 18px 18px 6px 18px; transform-origin: 62% 100%; }
  .mbar-ai { color: var(--dong2) !important; }
  .mbar-ai img { width: 26px; height: 26px; padding: 2px; border-radius: 50%; object-fit: contain; background: radial-gradient(circle at 35% 30%, #1b2440, #070a14 70%); border: 1px solid rgba(232, 176, 79, .55); box-shadow: 0 0 12px -2px rgba(232, 176, 79, .5); }
  .mbar-ai.jump img { animation: bzJump .7s cubic-bezier(.4, 1.8, .5, 1); }
  .mp { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; opacity: 1; transform: translateY(105%); }
  .mp.open { transform: none; }
  .mp-grip { display: block; width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 99px; background: rgba(255, 255, 255, .2); }
  .mp-song { padding: 11px 10px; }
  .bzc { left: 0; right: 0; top: var(--vvt, 0px); bottom: auto; width: auto; height: var(--vvh, 100dvh); border-radius: 0; transform: translateY(40px); transform-origin: 50% 100%; }
  .bzc.open { transform: none; }
  .bzc-h { padding-top: calc(10px + env(safe-area-inset-top)); }
  .bzc-note { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  html.bzc-on, html.bzc-on body { overflow: hidden; }
  html.bzc-on .mbar { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .bzc, .bzc-m, .bzc-card, .bzc-chips button, .bzc-cta, .bz-fab img, .bz-ring, .mp-disc { animation: none !important; transition: none !important; }
}
