:root {
  --text: #fff; --icon: #fff; --bg: #080808; --card: rgba(27, 27, 27, .4); --box: rgba(8, 8, 8, .6);
  --blur: 10px; --radius: 22px; --bw: 1px; --bc: rgba(255, 255, 255, .15); --fx: #fff;
  --font: "JetBrains Mono", ui-monospace, monospace; --cur: auto; --curp: pointer;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } /* iPhone xoay ngang không tự phóng to chữ */
/* cuộn bằng chính trang (profile.js thêm .docScroll, trừ bố cục Phân cảnh): trên điện thoại thật thanh địa chỉ thu lại,
   phần đáy không nằm sau thanh công cụ, không bị kẹt / nảy như khi cuộn trong một khung cao 100% */
html.docScroll, html.docScroll body { height: auto; }
html.docScroll body { overflow-x: hidden; overflow-y: auto; }
body { background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; cursor: var(--cur); }
a, button, #enter, input { cursor: var(--curp); }

#bg { position: fixed; inset: 0; background-size: cover; background-position: center; }
#bg.blurred { filter: blur(14px); transform: scale(1.08); }
#bg video { width: 100%; height: 100%; object-fit: cover; }
#bg { overflow: hidden; }
#bg .bgFill { position: absolute; inset: 0; width: 100%; height: 100%; background-size: cover; background-position: center;
  filter: blur(32px) brightness(0.6); transform: scale(1.25); }
#bg video.fit, #bg .bgImg { position: absolute; inset: 0; object-fit: contain; }
#bg .bgImg { background-size: contain; background-position: center; background-repeat: no-repeat; }
#fxcss, #fx { position: fixed; inset: 0; pointer-events: none; }
#fx { width: 100%; height: 100%; }
#card.anim-motion { opacity: 0; }
/* m-glitch (fx5.js): tách màu đỏ / xanh trong lúc giật hình */
.mGlitch { text-shadow: 2px 0 rgba(255, 42, 109, .85), -2px 0 rgba(45, 226, 230, .85); box-shadow: 4px 0 0 rgba(255, 42, 109, .35), -4px 0 0 rgba(45, 226, 230, .35); } /* hiệu ứng "m-..." (fx5.js) tự hiện thẻ */
/* độ đậm hiệu ứng nền (Giao diện › Nền › Độ đậm hiệu ứng): làm sáng nét vẽ mảnh, cộng sáng (screen) lên ảnh nền */
#fxcss, .shaderBg { filter: brightness(var(--fxB, 1.5)) saturate(1.15); }
#fx, #fxcss, .shaderBg { opacity: var(--fxO, 1); } /* canvas #fx được làm đậm trong profile.js (vẽ cộng sáng) */
#cfx { position: fixed; inset: 0; pointer-events: none; z-index: 30; width: 100%; height: 100%; }

.fx-oldtv { background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px); animation: flicker .12s infinite; }
@keyframes flicker { 50% { opacity: .82; } }
.fx-dither { background: repeating-conic-gradient(rgba(0, 0, 0, .4) 0 25%, transparent 0 50%) 0 0 / 3px 3px; }
/* Vignette: tối dần ở mép, đứng yên */
.fx-vignette { background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%); }
.fx-aurora { overflow: hidden; }
.fx-aurora span { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(90px); opacity: .5;
  background: var(--fx); mix-blend-mode: screen; animation: drift 18s ease-in-out infinite alternate; left: -10%; top: -20%; }
.fx-aurora span:nth-child(2) { background: color-mix(in srgb, var(--fx), #00ffa3 65%); left: 40%; top: 20%; animation-duration: 23s; }
.fx-aurora span:nth-child(3) { background: color-mix(in srgb, var(--fx), #7a5cff 65%); left: 10%; top: 50%; animation-duration: 29s; }
@keyframes drift { to { transform: translate(18%, 12%) scale(1.25); } }

#enter { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: opacity .7s; }
#enter .enterInner { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 16px; }
#enterIcon { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; }
#enterText { font-weight: 500; font-size: 14px; color: color-mix(in srgb, var(--text) 75%, transparent); }
#enterSub { font-size: 12px; color: color-mix(in srgb, var(--text) 55%, transparent); max-width: 320px; }
#enter.gone { opacity: 0; pointer-events: none; }
/* Premium: chữ ký trên màn hình vào trang */
#enter .enterInner { position: relative; z-index: 1; }
.enterSig { display: block; width: min(340px, 72vw); aspect-ratio: 5 / 2; }
.enterRing { position: absolute; inset: 0; pointer-events: none; }
.enterVis { position: absolute; pointer-events: auto; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  opacity: .38; transition: opacity .2s, background-color .2s; animation: sigFloat 7s ease-in-out var(--d, 0s) infinite alternate; }
.enterVis canvas { display: block; width: 100%; height: 100%; }
.enterVis:hover, .enterVis:focus-visible { opacity: 1; background: rgba(255, 255, 255, .05); }
.enterVis:focus-visible { outline: 1px solid color-mix(in srgb, var(--text) 40%, transparent); outline-offset: 2px; }
@keyframes sigFloat { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .enterVis { animation: none; } }
.enterCard { position: fixed; z-index: 2; display: flex; gap: 10px; align-items: center; width: 240px; padding: 10px 12px; border-radius: 10px;
  background: #17171a; border: 1px solid rgba(255, 255, 255, .1); color: #ededed; text-decoration: none; font-size: 13px; }
.enterCard[hidden] { display: none; }
.enterCard .ecAv { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.enterCard .ecAvEmpty { display: grid; place-items: center; background: #26262b; font-weight: 600; }
.enterCard .ecText { display: flex; flex-direction: column; min-width: 0; }
.enterCard b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enterCard .ecUser { color: #8b8b92; font-size: 12px; }
.enterCard .ecDesc { color: #b4b4bb; font-size: 12px; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

#stage { position: relative; z-index: 5; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; perspective: 1000px; overflow-y: auto; }
/* lưới chỉ một cột theo bề rộng màn hình: không nội dung nào kéo trang rộng hơn màn hình */
#stage { overflow-x: hidden; } /* hiệu ứng mở thẻ trượt ngang (dash, drift) không làm hiện thanh cuộn ngang */
html.docScroll #stage { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; overflow-x: clip; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.page-scenes #stage { height: 100vh; height: 100dvh; }
#tilt { width: min(560px, 100%); transform-style: preserve-3d; transition: transform .15s ease-out; }

.card { position: relative; padding: 26px; border-radius: var(--radius); background: var(--card);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: var(--bw); background: var(--bc);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); pointer-events: none; }
.card.border-none::before { display: none; }
/* Bề mặt "đen bóng": vệt phản sáng mờ ở nửa trên + mép sáng mảnh, như mặt kính đen */
.card.finish-glossy { box-shadow: 0 20px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(0, 0, 0, .6); }
.card.finish-glossy::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(165deg, rgba(255, 255, 255, .11) 0%, rgba(255, 255, 255, .035) 30%, transparent 46%),
    radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, .06), transparent 60%); }
.card.border-gradient::before { background: linear-gradient(135deg, var(--bc), transparent 45%, transparent 55%, var(--bc)); }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.card.border-animated::before { background: conic-gradient(from var(--ang), var(--bc), transparent 25%, transparent 50%, var(--bc) 60%, transparent 85%);
  animation: spin 4s linear infinite; }
@keyframes spin { to { --ang: 360deg; } }
/* Dashed: viền thật (mask không vẽ nét đứt được) */
.card.border-dashed::before { display: none; }
.card.border-dashed { border: var(--bw) dashed var(--bc); }
/* Shimmer: vệt sáng chạy dọc viền */
.card.border-shimmer::before { background: linear-gradient(110deg, var(--bc) 0 40%, color-mix(in srgb, var(--bc), #fff 55%) 50%, var(--bc) 60% 100%);
  background-size: 250% 100%; animation: shimmer 3s linear infinite; }
@keyframes shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }
/* Pulse: viền đậm nhạt theo nhịp */
.card.border-pulse::before { animation: bpulse 2.4s ease-in-out infinite; }
@keyframes bpulse { 50% { opacity: .25; } }

.anim-unfold { animation: unfold 1s cubic-bezier(.2, .8, .2, 1); }
@keyframes unfold { 0% { transform: scale(.6, .02); opacity: 0; } 45% { transform: scale(1, .02); opacity: 1; } }
.anim-fade { animation: fade .9s ease; }
@keyframes fade { from { opacity: 0; } }
.anim-slide { animation: slide .9s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { opacity: 0; transform: translateY(40px); } }
.anim-zoom { animation: zoom .8s cubic-bezier(.2, .8, .2, 1); }
@keyframes zoom { from { opacity: 0; transform: scale(.85); } }
.anim-pop { animation: pop .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; } }
/* Rise / Blur In / Reveal: chuyển động ngắn, biên độ nhỏ, không nảy */
.anim-rise { animation: rise .7s cubic-bezier(.22, 1, .36, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.anim-blur { animation: blurIn .8s cubic-bezier(.22, 1, .36, 1); }
@keyframes blurIn { from { opacity: 0; filter: blur(10px); transform: scale(.98); } }
.anim-reveal { animation: reveal .9s cubic-bezier(.65, 0, .35, 1); }
@keyframes reveal { from { clip-path: inset(0 0 100% 0 round var(--radius)); } to { clip-path: inset(0 0 0 0 round var(--radius)); } }
/* sau màn hình vào trang: chờ lớp phủ mờ dần rồi mới chạy hiệu ứng mở thẻ, không thì bị che mất */
.card.afterEnter { animation-delay: .4s; animation-fill-mode: backwards; }

/* ---------- bố cục ---------- */
.side { display: contents; }
.links .lbl { display: none; }
/* Default: một cột căn giữa, avatar to ở trên */
.layout-default .head { flex-direction: column; text-align: center; }
.layout-default .avatar { width: 112px; height: 112px; }
.layout-default .nameRow, .layout-default .metaLine { justify-content: center; }
/* Simplistic: không nền thẻ, gọn */
.card.layout-simplistic { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 12px; }
.card.layout-simplistic::before { display: none; }
.layout-simplistic .head { flex-direction: column; text-align: center; gap: 12px; }
.layout-simplistic .avatar { width: 80px; height: 80px; }
.layout-simplistic .nameRow, .layout-simplistic .metaLine { justify-content: center; }
.layout-simplistic .badges { background: transparent; }
/* Sleek: avatar vuông bo góc, link thành nút có nhãn */
.layout-sleek .avatar .pic { border-radius: var(--avr, calc(var(--radius) * .6)); }
.layout-sleek .links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.layout-sleek .links a, .layout-portfolio .links a { display: flex; align-items: center; gap: 10px; font-size: 18px; padding: 10px 12px;
  border-radius: calc(var(--radius) * .5); background: var(--box); }
.layout-sleek .links a:hover, .layout-portfolio .links a:hover { transform: translateY(-1px); }
.layout-sleek .links .lbl, .layout-portfolio .links .lbl { display: block; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Portfolio: hai cột, thông tin bên trái, widget + link bên phải */
#tilt:has(.layout-portfolio) { width: min(860px, 100%); }
.card.layout-portfolio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.layout-portfolio .head { flex-direction: column; align-items: flex-start; }
.layout-portfolio .side { display: flex; flex-direction: column; gap: 12px; }
.layout-portfolio .side > * { margin-top: 0; }
.layout-portfolio .links { display: flex; flex-direction: column; gap: 8px; }
.layout-portfolio .foot { grid-column: 1 / -1; }
@media (max-width: 720px) { .card.layout-portfolio { grid-template-columns: minmax(0, 1fr); gap: 16px; } .layout-portfolio .foot { margin-top: 0; } }

/* ===== Bố cục trang (body.page-*) ===== */
/* Lưới: thẻ rộng hơn, liên kết thành ô 2 cột có icon + tên */
.page-grid #tilt { width: min(680px, 100%); }
.page-grid .links, .page-scenes .scene-links .links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.page-grid .links a, .page-scenes .scene-links .links a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; font-size: 20px;
  border-radius: calc(var(--radius) * .6); background: var(--box); }
.page-grid .links .lbl, .page-scenes .scene-links .links .lbl { display: block; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-grid .links a:hover, .page-scenes .scene-links .links a:hover { transform: translateY(-2px); }
/* điện thoại: vẫn 2 cột, ô dọc (icon trên, tên dưới) cho gọn */
@media (max-width: 460px) {
  .page-grid .links a, .page-scenes .scene-links .links a { flex-direction: column; justify-content: center; gap: 6px; min-height: 76px; padding: 12px 8px; text-align: center; }
  .page-grid .links .lbl, .page-scenes .scene-links .links .lbl { max-width: 100%; font-size: 12px; }
}

/* Ghim: 2 cột, phần giới thiệu dính ở cột trái khi cuộn, nội dung ở cột phải */
.page-pinned #stage { place-items: start center; padding: 40px 16px; }
.page-pinned #tilt { width: min(1040px, 100%); }
.page-pinned .card { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); column-gap: 32px; align-items: start; }
.page-pinned .card .head { grid-column: 1; grid-row: 1; position: sticky; top: 24px; flex-direction: column; align-items: flex-start; }
.page-pinned .card .lyrics, .page-pinned .card .foot { grid-column: 1; }
.page-pinned .card .side { display: flex; flex-direction: column; gap: 14px; grid-column: 2; grid-row: 1 / span 4; }
.page-pinned .card .side > * { margin-top: 0; }
.page-pinned .links { flex-direction: column; flex-wrap: nowrap; gap: 8px; }
.page-pinned .links a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 20px; border-radius: calc(var(--radius) * .6); background: var(--box); }
.page-pinned .links .lbl { display: block; font-size: 14px; color: var(--text); }
/* điện thoại: phần giới thiệu thu gọn thành thanh ngang dính ở đầu màn hình, nội dung cuộn bên dưới */
@media (max-width: 820px) {
  .page-pinned #stage { padding: 0 0 24px; }
  .page-pinned .card { grid-template-columns: minmax(0, 1fr); padding: 0 16px 20px; border-radius: 0 0 var(--radius) var(--radius); }
  .page-pinned .card .head { position: sticky; top: 0; z-index: 4; flex-direction: row; align-items: center; gap: 12px; margin: 0 -16px; padding: 14px 16px 12px;
    background: var(--card); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
  .page-pinned .card .head .avatar { width: 56px; height: 56px; }
  .page-pinned .card .head .desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .page-pinned .card .head .relations, .page-pinned .card .head .metaLine { display: none; } /* thanh ghim chỉ giữ ảnh, tên, badge, mô tả ngắn */
  .page-pinned .card .side { grid-column: 1; grid-row: auto; margin-top: 16px; }
}

/* Phân cảnh: mỗi cảnh cao một màn hình, cuộn hít từng cảnh, chấm chuyển cảnh bên phải */
.page-scenes #stage { display: block; padding: 0; scroll-snap-type: y mandatory; scroll-behavior: smooth; }
.page-scenes #tilt { width: 100%; }
.scene { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; scroll-snap-align: start; }
.scene[hidden] { display: none; }
.scene > .card { width: min(560px, 100%); }
.scene > .card > :first-child { margin-top: 0; }
.sceneDots { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 10px; }
.sceneDots[hidden] { display: none; }
.sceneDots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--text); opacity: .3; cursor: pointer; transition: opacity .2s, transform .2s; }
.sceneDots button.on { opacity: 1; transform: scale(1.3); }
@media (max-width: 600px) { .scene { padding-right: 30px; } .sceneDots { right: 10px; } } /* chừa chỗ cho chấm chuyển cảnh */
@media (prefers-reduced-motion: reduce) { .page-scenes #stage { scroll-behavior: auto; } }

.head { display: flex; gap: 18px; align-items: center; }
.avatar { position: relative; width: 96px; height: 96px; flex: none; }
.avatar .pic { width: 100%; height: 100%; border-radius: var(--avr, 50%); object-fit: cover; display: grid; place-items: center;
  background: var(--box); font-size: 40px; font-weight: 800; overflow: hidden; }
.avatar .deco { position: absolute; inset: -10%; width: 120%; height: 120%; pointer-events: none; }
.info { min-width: 0; flex: 1; }
.nameRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nameWrap { position: relative; }
.nameWrap.glow { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--text) 75%, transparent)); }
.name { font-size: 28px; font-weight: 500; letter-spacing: -.01em; min-height: 1.2em; min-width: .5em; word-break: break-word; }
.fx-rainbow { background: linear-gradient(90deg, #ff004c, #ffb800, #3dff6e, #00c8ff, #a64dff, #ff004c); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: rainbow 3s linear infinite; }
@keyframes rainbow { to { background-position: 200% 0; } }
.fx-fuzzy { animation: fuzz .18s steps(2) infinite; }
@keyframes fuzz {
  0% { text-shadow: 2px 0 rgba(255, 0, 80, .6), -2px 0 rgba(0, 220, 255, .6); filter: blur(.4px); }
  100% { text-shadow: -2px 0 rgba(255, 0, 80, .6), 2px 0 rgba(0, 220, 255, .6); filter: blur(.9px); }
}
/* Wave: từng chữ nhấp nhô 3px lần lượt rồi nghỉ */
.fx-wave span { display: inline-block; animation: wave 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms); }
@keyframes wave { 0%, 40%, 100% { transform: none; } 20% { transform: translateY(-3px); } }
/* Shine: một vệt sáng mảnh lướt qua mỗi vài giây, màu theo màu chữ */
.fx-shine { background: linear-gradient(100deg, var(--text) 0 42%, color-mix(in srgb, var(--text), #fff 70%) 50%, var(--text) 58% 100%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 4.5s ease-in-out infinite; }
@keyframes shine { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0 0; } }
/* Blinking Caret: con trỏ kiểu terminal sau tên */
.fx-caret::after { content: ""; display: inline-block; width: .08em; height: .9em; margin-left: .12em; vertical-align: -.08em;
  background: currentColor; animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
/* Glitch: hai lớp lệch đỏ / xanh, thỉnh thoảng giật cắt ngang (phần lớn thời gian đứng yên cho dễ đọc) */
.fx-glitch { position: relative; display: inline-block; }
.fx-glitch::before, .fx-glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; }
.fx-glitch::before { color: #ff3b6b; transform: translate(-1.5px, 0); clip-path: inset(0 0 100% 0); animation: glA 3.2s steps(1) infinite; mix-blend-mode: screen; }
.fx-glitch::after { color: #3bd8ff; transform: translate(1.5px, 0); clip-path: inset(100% 0 0 0); animation: glB 3.2s steps(1) infinite; mix-blend-mode: screen; }
@keyframes glA { 0%, 86%, 100% { clip-path: inset(0 0 100% 0); } 88% { clip-path: inset(10% 0 55% 0); transform: translate(-3px, -1px); }
  91% { clip-path: inset(60% 0 8% 0); transform: translate(2px, 0); } 94% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 1px); } }
@keyframes glB { 0%, 87%, 100% { clip-path: inset(100% 0 0 0); } 89% { clip-path: inset(50% 0 20% 0); transform: translate(3px, 1px); }
  92% { clip-path: inset(5% 0 70% 0); transform: translate(-2px, 0); } 95% { clip-path: inset(70% 0 5% 0); transform: translate(2px, -1px); } }
/* Neon: phát sáng theo màu chữ, thỉnh thoảng chớp như đèn neon */
.fx-neon { text-shadow: 0 0 4px currentColor, 0 0 12px color-mix(in srgb, currentColor 70%, transparent), 0 0 24px color-mix(in srgb, currentColor 40%, transparent);
  animation: neon 6s linear infinite; }
@keyframes neon { 0%, 90%, 93%, 96%, 100% { opacity: 1; } 91%, 94.5% { opacity: .45; text-shadow: none; } }
/* Chrome: chữ ánh kim, dải sáng trôi chậm */
.fx-chrome { background: linear-gradient(180deg, #fff 0%, #c9cbd1 38%, #6f737c 52%, #e6e8ec 64%, #9da1a8 100%), linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent);
  background-size: 100% 100%, 40% 100%; background-repeat: no-repeat; background-blend-mode: screen; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: chrome 5s ease-in-out infinite; }
@keyframes chrome { 0% { background-position: 0 0, -60% 0; } 60%, 100% { background-position: 0 0, 160% 0; } }
@media (prefers-reduced-motion: reduce) { .fx-glitch::before, .fx-glitch::after, .fx-neon, .fx-chrome { animation: none; } }
/* Lightning: thỉnh thoảng chớp trắng + quầng sáng như tia sét */
.fx-lightning { animation: nbolt 5s linear infinite; }
@keyframes nbolt { 0%, 88%, 92%, 96%, 100% { text-shadow: none; filter: none; } 89%, 94% { text-shadow: 0 0 6px #fff, 0 0 18px currentColor, 0 0 32px currentColor; filter: brightness(1.8); } }
/* Distort: một lớp chữ trùng bị kéo méo theo sóng ngang */
.fx-distort { position: relative; display: inline-block; }
.fx-distort::after { content: attr(data-text); position: absolute; inset: 0; color: currentColor; opacity: .55; pointer-events: none; animation: ndist 2.8s ease-in-out infinite; }
@keyframes ndist { 0%, 100% { transform: skewX(0) translateX(0); clip-path: inset(0 0 60% 0); } 25% { transform: skewX(-12deg) translateX(2px); clip-path: inset(30% 0 30% 0); }
  50% { transform: skewX(8deg) translateX(-2px); clip-path: inset(55% 0 5% 0); } 75% { transform: skewX(-4deg); clip-path: inset(10% 0 70% 0); } }
/* Stars: sao nhỏ lấp lánh quanh tên */
.fx-stars { position: relative; }
.nstar { position: absolute; pointer-events: none; line-height: 1; color: var(--fx, #fff); opacity: 0; animation: ntw 3s ease-in-out infinite; }
@keyframes ntw { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: .9; transform: scale(1) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) { .fx-lightning, .fx-distort::after, .nstar { animation: none; } }

/* ===== Đợt 1: tốc độ hiệu ứng mở thẻ, hiệu ứng mở mới, viền điện / sao chổi / theo nhạc, banner ===== */
.card.speed-fast { animation-duration: .45s !important; }
.card.speed-slow { animation-duration: 1.6s !important; }
.card.afterEnter { animation-delay: var(--enterDelay, .4s) !important; }
.anim-blossom { animation: blossom .9s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes blossom { from { opacity: 0; transform: scale(.7) rotate(-4deg); filter: blur(6px); } }
.anim-lens { animation: lens 1s cubic-bezier(.22, 1, .36, 1); }
@keyframes lens { from { opacity: 0; filter: blur(18px) saturate(0); transform: scale(1.08); } }
.anim-drift { animation: drift2 1s cubic-bezier(.22, 1, .36, 1); }
@keyframes drift2 { from { opacity: 0; transform: translateX(-60px); } }
.anim-curtain { animation: curtain 1s cubic-bezier(.65, 0, .35, 1); }
@keyframes curtain { from { clip-path: inset(0 50% 0 50% round var(--radius)); } to { clip-path: inset(0 0 0 0 round var(--radius)); } }
.anim-bounce { animation: bounceIn 1s cubic-bezier(.28, .84, .42, 1); }
@keyframes bounceIn { 0% { opacity: 0; transform: translateY(-60px); } 55% { opacity: 1; transform: translateY(8px); } 75% { transform: translateY(-4px); } 100% { transform: none; } }
.anim-toss { animation: toss .9s cubic-bezier(.22, 1, .36, 1); }
@keyframes toss { from { opacity: 0; transform: translateY(80px) rotate(8deg) scale(.9); } }
.anim-fold { animation: fold 1s cubic-bezier(.22, 1, .36, 1); transform-origin: top center; }
@keyframes fold { from { opacity: 0; transform: perspective(800px) rotateX(-70deg); } }
.anim-glide { animation: glide .9s cubic-bezier(.22, 1, .36, 1); }
@keyframes glide { from { opacity: 0; transform: translate(-40px, 30px); } }
.anim-zoomout { animation: zoomout .9s cubic-bezier(.22, 1, .36, 1); }
@keyframes zoomout { from { opacity: 0; transform: scale(1.25); } }
.anim-dash { animation: dash .6s cubic-bezier(.16, 1, .3, 1); }
@keyframes dash { from { opacity: 0; transform: translateX(120%) skewX(-12deg); } 70% { transform: translateX(-2%) skewX(2deg); } }

/* Viền điện: dải sáng gãy khúc chạy quanh viền, nhấp nháy như điện */
.card.border-electric::before { background: conic-gradient(from var(--ang), var(--bc) 0 6%, transparent 9% 30%, var(--bc) 32% 36%, transparent 40% 62%, var(--bc) 64% 70%, transparent 74%);
  animation: spin 2.2s linear infinite, zap .18s steps(2) infinite; filter: drop-shadow(0 0 3px var(--bc)); }
@keyframes zap { 50% { opacity: .7; } }
/* Sao chổi: một đốm sáng có đuôi chạy quanh viền */
.card.border-comet::before { background: conic-gradient(from var(--ang), transparent 0 78%, color-mix(in srgb, var(--bc), transparent 70%) 88%, var(--bc) 99%, transparent 100%);
  animation: spin 3.2s linear infinite; filter: drop-shadow(0 0 4px var(--bc)); }
/* Viền theo nhạc: quầng sáng + độ đậm viền theo nhịp (--lvl 0..1 do JS đặt khi nhạc phát) */
.card.audioBorder { box-shadow: 0 20px 60px rgba(0, 0, 0, .4), 0 0 calc(var(--lvl, 0) * 42px) calc(var(--lvl, 0) * 4px) color-mix(in srgb, var(--fx, #fff) 55%, transparent); transition: box-shadow .08s linear; }
.card.audioBorder::before { opacity: calc(.45 + var(--lvl, 0) * .55); }
@media (prefers-reduced-motion: reduce) { .card.border-electric::before, .card.border-comet::before { animation: none; } }

/* Hiệu ứng từng ô */
.ifx-tilt .links a, .ifx-tilt .discord, .ifx-tilt .gameCard, .ifx-tilt .widget, .ifx-tilt .rel { transition: transform .12s ease-out; will-change: transform; }
.ifx-comet .links a, .ifx-comet .discord, .ifx-comet .gameCard, .ifx-comet .widget { position: relative; }
.ifx-comet .links a::after, .ifx-comet .discord::after, .ifx-comet .gameCard::after, .ifx-comet .widget::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 80%, color-mix(in srgb, var(--fx, #fff), transparent 60%) 90%, var(--fx, #fff) 99%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: spin 3.6s linear infinite; }
.ifx-comet .links a:nth-child(2n)::after { animation-delay: -1.2s; } .ifx-comet .links a:nth-child(3n)::after { animation-delay: -2.4s; }
/* Mô tả: sóng chữ / ánh sáng chạy qua */
.dfx-wave span { display: inline-block; white-space: pre; animation: wave 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * 45ms); }
.dfx-shine { background: linear-gradient(100deg, currentColor 0 42%, color-mix(in srgb, currentColor, #fff 70%) 50%, currentColor 58% 100%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: shine 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ifx-comet *::after, .dfx-wave span, .dfx-shine { animation: none !important; } }
/* Banner trên đầu thẻ */
.banner { margin: -26px -26px 18px; height: var(--bh, 140px); overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner.fade { -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.page-pinned .card .banner { grid-column: 1 / -1; margin: -26px -26px 18px; }
.page-pinned .card:has(.banner) .head { grid-row: 2; }
.page-pinned .card:has(.banner) .side { grid-row: 2 / span 4; }
@media (max-width: 820px) { .page-pinned .card .banner { margin: 0 -16px 0; border-radius: 0; } }

/* Kiểu thoát màn hình vào trang */
#enter.ex-dissolve { animation: exDissolve .7s ease forwards; }
@keyframes exDissolve { to { opacity: 0; filter: blur(16px); } }
#enter.ex-split { animation: exSplit .8s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes exSplit { to { clip-path: inset(0 50% 0 50%); } }
#enter.ex-iris { animation: exIris .8s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes exIris { from { clip-path: circle(75% at 50% 50%); } to { clip-path: circle(0% at 50% 50%); } }
#enter.ex-slash { animation: exSlash .7s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes exSlash { from { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); } to { clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0); } }
#enter.ex-blink { animation: exBlink .6s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes exBlink { 40% { transform: scaleY(.04); opacity: 1; } to { transform: scaleY(0); opacity: 0; } }
#enter.ex-warp { animation: exWarp .7s cubic-bezier(.55, 0, .7, .2) forwards; }
@keyframes exWarp { to { transform: scale(2.2); opacity: 0; filter: blur(8px); } }
#enter.ex-glitch { animation: exGlitch .75s steps(1) forwards; }
@keyframes exGlitch { 0% { clip-path: inset(0); } 15% { clip-path: inset(10% 0 60% 0); transform: translateX(-12px); } 30% { clip-path: inset(50% 0 20% 0); transform: translateX(10px); }
  45% { clip-path: inset(0 0 80% 0); transform: translateX(-6px); } 60% { clip-path: inset(70% 0 0 0); transform: translateX(14px); } 80% { clip-path: inset(40% 0 45% 0); } 100% { opacity: 0; } }
#enter .exTerm { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); margin: 0; font: 13px/1.6 "Geist Mono", ui-monospace, monospace; color: var(--fx, #9ece6a); text-align: left; min-width: 220px; }
#enter.ex-terminal .enterInner, #enter.ex-loading .enterInner { opacity: .6; transition: opacity .3s; }
#enter .exBar { position: absolute; left: 50%; top: 60%; width: min(260px, 60vw); height: 3px; transform: translateX(-50%); background: color-mix(in srgb, var(--text) 15%, transparent); border-radius: 2px; overflow: hidden; }
#enter .exBar i { display: block; height: 100%; width: 0; background: var(--fx, #fff); animation: exLoad 1s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes exLoad { to { width: 100%; } }
#enter .exCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#enter.ex-focus { animation: exFocus .8s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes exFocus { 50% { filter: blur(6px); transform: scale(.97); } to { filter: blur(24px); transform: scale(1.04); opacity: 0; } }
#enter .exTerm2 { position: absolute; inset: 0; margin: 0; padding: 24px; overflow: hidden; background: rgba(5, 5, 6, .92); font: 12px/1.7 "Geist Mono", ui-monospace, monospace;
  color: color-mix(in srgb, var(--fx, #9ece6a) 85%, #fff); text-align: left; white-space: pre; }
#enter .exTerm2::after { content: "▌"; animation: caret 1s steps(1) infinite; }
.spark { position: absolute; pointer-events: none; line-height: 1; animation: spark 1.2s ease-out forwards; }
@keyframes spark { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-10px) scale(.4); } }

.badges { display: flex; gap: 7px; padding: 4px 8px; border-radius: 10px; background: var(--box); background: color-mix(in srgb, var(--box) var(--bbgf, 100%), transparent); }
/* nền sau huy hiệu (Hồ sơ › Huy hiệu › Nền) */
.badges.bbg-none, .badges.bbg-auto.bfx-marquee { background: transparent; }
.badges.bbg-color { background: var(--bbg); }
.badges:empty { display: none; }
.badges i { font-size: 14px; }
.badges.glow i { filter: drop-shadow(0 0 4px currentColor); }
/* Hiệu ứng chạy badge: mỗi badge trễ theo thứ tự (--i) nên chạy lần lượt từ trái sang phải */
.badges.bfx-wave .badge { animation: bWave 2.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .12s); }
@keyframes bWave { 0%, 55%, 100% { transform: translateY(0); } 25% { transform: translateY(-3px); } }
.badges.bfx-shine .badge > * { animation: bShine 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .14s); }
@keyframes bShine { 0%, 62%, 100% { filter: brightness(1); } 72% { filter: brightness(1.9) drop-shadow(0 0 3px currentColor); } }
.badges.bfx-pop .badge { animation: bPop .45s cubic-bezier(.2, .9, .3, 1.35) both; animation-delay: calc(.25s + var(--i, 0) * .07s); }
@keyframes bPop { from { opacity: 0; transform: translateY(4px) scale(.5); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .badges[class*="bfx-"] .badge, .badges[class*="bfx-"] .badge > * { animation: none; } }
/* Chạy ngang: khung giới hạn bề rộng, dải badge trượt vòng, mép mờ, badge phát sáng theo màu của nó */
/* bề rộng cố định (không dùng %): % trong min() bị bỏ qua khi trình duyệt tính bề rộng nội dung -> dải dài kéo giãn cả thẻ.
   contain: inline-size = bề rộng dải chạy không bao giờ đẩy thẻ rộng ra. */
.badges.bfx-marquee { width: 136px; max-width: 100%; min-width: 0; contain: inline-size; overflow: hidden; padding-left: 0; padding-right: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.badges.bfx-marquee.bfx-static { -webkit-mask-image: none; mask-image: none; padding: 4px 8px; }
/* padding phải = gap: hai nửa dải dài bằng nhau nên -50% khớp vòng, không giật */
.bTrack { display: flex; gap: 12px; width: max-content; padding: 0 12px 0 0; animation: bMarq var(--dur, 14s) linear infinite; }
.bfx-static .bTrack { animation: none; padding: 0; gap: 7px; }
.badges.bfx-marquee .badge i, .badges.bfx-marquee .badge .bimg { filter: none; } /* badge chạy: không phát sáng (kể cả khi bật "Phát sáng") */
.bfx-marquee:hover .bTrack { animation-play-state: paused; } /* dừng khi rê chuột để đọc tooltip */
@keyframes bMarq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .bTrack { animation: none; } }

.desc { margin-top: 6px; font-size: 13px; min-height: 1.4em; overflow-wrap: anywhere; }
.caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.metaLine { margin-top: 4px; font-size: 11px; opacity: .6; display: flex; gap: 12px; flex-wrap: wrap; }
.metaLine:empty { display: none; }
/* chấm LIVE + thời gian voice */
.liveBadge { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 7px; border-radius: 6px; background: #e5383b; color: #fff;
  font: 700 10px/1.4 var(--font, system-ui); letter-spacing: .06em; text-decoration: none; vertical-align: middle; flex: none; }
.liveBadge[hidden] { display: none; }
.liveDot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .liveDot { animation: none; } }
.dVoice { margin-top: 2px; font-size: 11px; opacity: .6; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.dVoice.on { opacity: .85; color: #3ba55d; }
/* thẻ game */
.games { display: grid; gap: 8px; }
.games:empty { display: none; }
.gameCard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: calc(var(--radius) * .6); background: var(--box); font-size: 12px; }
.gBody { flex: 1; min-width: 0; }
.gRankImg { width: 52px; height: 52px; object-fit: contain; flex: none; }
.gMains { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gLbl { opacity: .8; }
.gMain { display: inline-flex; align-items: center; gap: 4px; }
.gMainImg { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; }
.gHead { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.gName { flex: none; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .55; }
.gId { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gQueue { margin-left: auto; flex: none; font-size: 10px; opacity: .5; }
.gRank { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 5px; align-items: baseline; }
.gRank span:not(.gTier) { opacity: .7; }
.gTier { font-weight: 600; font-size: 13px; }
.gPeak { opacity: .55 !important; }
.gExtra { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; opacity: .6; }
/* lời bài hát chạy theo nhạc */
.lyrics { margin-top: 14px; text-align: center; min-height: 40px; }
.lyrics[hidden] { display: none; }
.lyrics p { margin: 0; overflow-wrap: anywhere; }
.lyrCur { font-size: 14px; font-weight: 500; color: var(--text); min-height: 1.4em; }
.lyrCur.in { animation: lyrIn .35s ease-out; }
.lyrNext { margin-top: 2px; font-size: 12px; opacity: .45; min-height: 1.3em; }
.lyrics[role="button"] { cursor: pointer; border-radius: 10px; outline: none; }
.lyrics[role="button"]:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }
.lyrFull { margin-top: 10px; max-height: 220px; overflow-y: auto; padding: 6px; border-radius: 12px; background: var(--box);
  display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; overscroll-behavior: contain; }
.lyrFull[hidden] { display: none; }
.lyrLine { border: 0; background: transparent; color: var(--text); opacity: .5; text-align: center; font: 13px/1.45 var(--font);
  padding: 5px 8px; border-radius: 8px; cursor: pointer; transition: opacity .2s, background-color .2s; overflow-wrap: anywhere; }
.lyrLine:hover { opacity: .85; background: rgba(255, 255, 255, .05); }
.lyrLine.on { opacity: 1; font-weight: 600; }

/* mô tả có định dạng */
.desc b { font-weight: 650; }
.desc code { font: 12px/1 ui-monospace, monospace; padding: 2px 5px; border-radius: 5px; background: rgba(255, 255, 255, .08); }
.desc a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(255, 255, 255, .35); }
.desc .spoiler { background: currentColor; border-radius: 4px; cursor: pointer; transition: background-color .2s; }
.desc .spoiler.shown { background: rgba(255, 255, 255, .08); }

/* thẻ liên kết có ảnh */
.lcards { display: grid; gap: 10px; margin-top: 14px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.lcards[hidden] { display: none; }
.lcards.cols-1 { --cols: 1; } .lcards.cols-2 { --cols: 2; } .lcards.cols-3 { --cols: 3; }
.lcard { display: flex; flex-direction: column; overflow: hidden; border-radius: calc(var(--radius) * .7); background: var(--box);
  color: var(--text); text-decoration: none; min-width: 0; transition: transform .2s cubic-bezier(.22, 1, .36, 1), background-color .2s; }
.lcard:hover { transform: translateY(-2px); }
.lcard:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }
.lcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.lcards.cols-1 .lcard { flex-direction: row; align-items: center; }
.lcards.cols-1 .lcard img { width: 96px; flex: none; aspect-ratio: 4 / 3; }
.lcText { padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.lcText b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcText small { font-size: 11px; opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .lcards.cols-3 { --cols: 2; } }

/* hỏi trước khi mở link ngoài */
.extDlg { border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 18px; width: min(360px, calc(100vw - 32px));
  background: #141416; color: #ededed; font: 13px/1.5 var(--font); }
.extDlg::backdrop { background: rgba(0, 0, 0, .55); }
.extDlg p { margin: 0 0 6px; }
.extDlg .extT { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.extDlg b { color: #e8a33d; font-weight: 600; }
.extDlg code { display: block; margin: 8px 0 14px; padding: 8px; border-radius: 8px; background: rgba(255, 255, 255, .05);
  font: 11px/1.4 ui-monospace, monospace; overflow-wrap: anywhere; opacity: .75; }
.extBtns { display: flex; gap: 8px; justify-content: flex-end; }
.extBtns > * { height: 34px; padding: 0 14px; border-radius: 9px; font: 500 13px/34px var(--font); cursor: pointer; text-decoration: none; }
.extNo { border: 1px solid rgba(255, 255, 255, .12); background: transparent; color: #ededed; }
.extGo { background: #e8a33d; color: #141416; border: 0; }
@keyframes lyrIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lyrCur.in { animation: none; } }
/* mối liên hệ: cặp đôi, bạn thân... */
.relations { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.relations:empty { display: none; }
.rel { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px 3px 3px; border-radius: 999px;
  background: var(--box); color: var(--text); text-decoration: none; font-size: 12px; line-height: 1; transition: background-color .15s; }
.rel:hover, .rel:focus-visible { background: color-mix(in srgb, var(--text) 12%, var(--box)); }
.rel img, .rel .relInit { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.rel .relInit { display: grid; place-items: center; background: color-mix(in srgb, var(--text) 14%, transparent); font-size: 10px; font-weight: 600; }
.rel i { font-size: 10px; opacity: .7; }
.rel .relKind { opacity: .6; }
.rel b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.rel-couple i { color: #e5738a; opacity: 1; }

/* ---------- chữ ký ---------- */
.sigBtn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 12px; opacity: .75; cursor: var(--curp); padding: 4px 6px; border-radius: 6px; }
.sigBtn:hover { opacity: 1; background: color-mix(in srgb, var(--text) 8%, transparent); }
.sigModal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); }
.sigBox { width: min(520px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: #141415; color: #ededed; border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px; padding: 16px; font-family: "Geist", system-ui, sans-serif; }
.sigHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sigIcon { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.sigIcon:hover { background: rgba(255, 255, 255, .06); }
.sigStack { position: relative; height: 230px; cursor: pointer; }
.sigCard { position: absolute; inset: 0 0 auto 0; height: 200px; border-radius: 12px; background: #1b1b1d; border: 1px solid rgba(255, 255, 255, .07);
  transform: translateY(calc(var(--d) * 9px)) scale(calc(1 - var(--d) * .04)); opacity: calc(1 - var(--d) * .25); transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .35s; display: flex; flex-direction: column; }
.sigCard.pinned { border-color: rgba(232, 163, 61, .35); }
.sigCanvas { flex: 1; width: 100%; min-height: 0; display: block; }
.sigMeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 12px; }
.sigMeta .fa-thumbtack { color: #e8a33d; }
.sigWho { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.sigWho img, .sigAv { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; }
.sigAv { display: grid; place-items: center; background: #2a2a2d; font-size: 11px; font-weight: 600; }
.sigWho small { opacity: .55; font-family: "Geist Mono", monospace; }
.sigEmpty { display: grid; place-items: center; height: 200px; opacity: .6; font-size: 13px; text-align: center; }
.sigNav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 12px; font: 12px "Geist Mono", monospace; opacity: .8; }
.sigSign { border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.sigPad { width: 100%; aspect-ratio: 5 / 2; display: block; border-radius: 10px; background: #0e0e0f; border: 1px dashed rgba(255, 255, 255, .15); touch-action: none; cursor: crosshair; }
.sigActions { display: flex; gap: 8px; justify-content: flex-end; }
.sigSign > .sigPrimary { align-self: flex-start; }
.sigPrimary, .sigGhost { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; font: 500 13px "Geist", system-ui, sans-serif; cursor: pointer; }
.sigPrimary { border: 0; background: #ededed; color: #141415; }
.sigPrimary:disabled { opacity: .45; cursor: default; }
.sigGhost { border: 1px solid rgba(255, 255, 255, .12); background: transparent; color: #ededed; }
.sigNote { font-size: 12px; opacity: .7; margin: 0; }
.sigNote.ok { opacity: 1; color: #9ece6a; }
.sigNote a { color: inherit; }
.inkPicker { display: flex; flex-direction: column; gap: 8px; }
.inkRow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inkDot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); flex: none; }
.inkSw { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .15); padding: 0; cursor: pointer; }
.inkSw[aria-pressed="true"] { outline: 2px solid #ededed; outline-offset: 2px; }
.inkHue, .inkLight { flex: 1; min-width: 120px; accent-color: #ededed; }
.customHtml { display: block; width: 100%; margin-top: 20px; border: 0; border-radius: calc(var(--radius) * .7); background: transparent; color-scheme: normal; }
.discord { margin-top: 20px; display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: calc(var(--radius) * .7); background: var(--box); }
.dAvatar { position: relative; width: 56px; height: 56px; flex: none; }
.dAvatar img { width: 100%; height: 100%; border-radius: 50%; }
.dAvatar i { position: absolute; right: 0; bottom: 0; width: 15px; height: 15px; border-radius: 50%; border: 3px solid #1b1b22; background: #747f8d; }
.dAvatar i.online { background: #23a55a; } .dAvatar i.idle { background: #f0b232; } .dAvatar i.dnd { background: #f23f43; }
.dText { min-width: 0; }
.dName { font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; }
.dName > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* server tag kiểu Discord: nhãn xám, icon 14px, chữ 11px; không glow, không gradient */
.dTag { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 5px; border-radius: 4px;
  background: rgba(255, 255, 255, .08); font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: .01em; }
.dTag img { width: 14px; height: 14px; display: block; }
/* huy hiệu Discord: icon gốc 16px xếp liền nhau như trong Discord, không khung, không hiệu ứng */
.dBadges { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.dBadges img { width: 16px; height: 16px; display: block; }
.dAct { font-size: 11px; opacity: .65; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.links { margin-top: 22px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.links:empty { display: none; }
.links.align-left { justify-content: flex-start; } .links.align-right { justify-content: flex-end; }
.links a { font-size: 22px; text-decoration: none; opacity: .85; transition: opacity .15s cubic-bezier(.22, 1, .36, 1), transform .15s cubic-bezier(.22, 1, .36, 1); }
.links a:hover { opacity: 1; transform: translateY(-2px); }
/* glow đặt trên <a> (logo SVG dùng mask nên bóng trên chính icon bị cắt) */
.links.glow a { filter: drop-shadow(0 0 6px currentColor); }
.bi { display: inline-block; width: 1em; height: 1em; background-color: currentColor; vertical-align: -0.125em;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }

.foot { margin-top: 16px; font-size: 12px; opacity: .8; display: flex; align-items: center; gap: 12px; }
/* bong bóng thông báo ngay trên nút thích */
.likeWrap { position: relative; margin-left: auto; display: inline-flex; }
.likeTip { position: fixed; z-index: 1000; width: max-content; max-width: min(260px, 78vw);
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; text-align: left;
  background: #111113; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  color: #ededed; font: 12px/1.45 var(--font); animation: likeTipIn .18s cubic-bezier(.22, 1, .36, 1); }
.likeTip[hidden] { display: none; }
.likeTip b { font-weight: 600; font-size: 13px; }
.likeTip small { opacity: .7; }
.likeTip a { color: #e8a33d; text-decoration: none; font-weight: 600; margin-top: 2px; }
.likeTip::after { content: ""; position: absolute; left: var(--ax, 80%); top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: #111113; }
@keyframes likeTipIn { from { transform: translateY(4px); } } /* chỉ trượt, không mờ: luôn đọc được ngay */
/* nút thích dạng viên thuốc, nằm bên phải chân thẻ: nhìn ra ngay là bấm được */
.likeBtn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text); font: inherit; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color .15s, border-color .15s, transform .15s; }
.likeBtn:active { transform: scale(.96); }
.likeBtn .likeNum { opacity: .7; padding-left: 6px; border-left: 1px solid color-mix(in srgb, var(--text) 20%, transparent); }
.likeBtn.on { border-color: rgba(229, 72, 77, .55); background: rgba(229, 72, 77, .14); }
.likeBtn.self { cursor: default; }
.likeBtn:hover { background: color-mix(in srgb, var(--text) 12%, transparent); }
.likeBtn:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }
.likeBtn.on i { color: #e5484d; }
.likeBtn.pop i { animation: likePop .35s cubic-bezier(.22, 1, .36, 1); }
@keyframes likePop { 40% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .likeBtn.pop i { animation: none; } }
.rel .relDays { font-size: 10px; opacity: .55; font-variant-numeric: tabular-nums; padding-left: 2px; }
.relNote { flex-basis: 100%; margin: 0; font-size: 12px; opacity: .7; font-style: italic; overflow-wrap: anywhere; }
.foot:empty { display: none; }

.layout-simple .head, .layout-simple .info { flex-direction: column; text-align: center; }
.layout-simple .nameRow, .layout-simple .metaLine { justify-content: center; }
/* Điện thoại: mỗi bố cục giữ dáng riêng (trước đây mọi bố cục đều bị ép thành cột giữa nên trông giống nhau) */
@media (max-width: 480px) {
  .card { padding: 24px 20px 20px; }
  .name { font-size: 24px; line-height: 1.25; }
  .badges { flex-wrap: wrap; justify-content: center; }
  /* Mọi bố cục (trừ thanh ghim): một cột căn giữa, nhịp dọc 8 / 12 / 16px.
     avatar -16- tên -8- huy hiệu (hàng riêng) -8- mô tả -8- dòng meta -12- chip mối liên hệ -16- các khối bên dưới */
  body:not(.page-pinned) .head { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  body:not(.page-pinned) .info { flex: none; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
  body:not(.page-pinned) .info > * { margin-top: 0; max-width: 100%; }
  /* tên (+ nhãn LIVE) một hàng, huy hiệu xuống hàng riêng ở giữa: ::after là dấu ngắt hàng của flex */
  body:not(.page-pinned) .nameRow { width: 100%; justify-content: center; gap: 0 8px; }
  body:not(.page-pinned) .nameRow::after { content: ""; flex-basis: 100%; height: 0; order: 1; }
  body:not(.page-pinned) .nameRow .badges { order: 2; margin-top: 8px; }
  body:not(.page-pinned) .nameRow .liveBadge { margin-left: 0; }
  body:not(.page-pinned) .badges.bfx-marquee:not(.bfx-static) { width: 168px; } /* hàng riêng nên dải chạy rộng hơn */
  /* không có mô tả: bỏ dòng trống giữ chỗ (kiểu gõ chữ có thêm con trỏ nên vẫn giữ) */
  body:not(.page-pinned) .desc:has(> span:only-child:empty) { display: none; }
  body:not(.page-pinned) .desc { line-height: 1.5; text-wrap: balance; }
  body:not(.page-pinned) .metaLine { justify-content: center; gap: 4px 12px; line-height: 1.5; }
  body:not(.page-pinned) .relations { justify-content: center; margin-top: 4px; }
  .relNote { text-align: center; }
  .foot > :only-child { margin-inline: auto; } /* chỉ có lượt xem (hoặc chỉ nút thích): đặt giữa */
  /* thanh ghim: hàng ngang, chữ căn trái */
  .page-pinned .card .head { text-align: left; }
  /* Sleek: avatar vuông bo, liên kết lưới 2 cột */
  .layout-sleek .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-sleek .avatar { width: 84px; height: 84px; }
}
/* Màn hình lớn: phóng cả thẻ theo tỉ lệ để trang không nhỏ xíu giữa màn hình rộng */
@media (min-width: 1600px) and (min-height: 820px) { #tilt { zoom: 1.12; } }
@media (min-width: 2000px) and (min-height: 1000px) { #tilt { zoom: 1.3; } }
@media (min-width: 2800px) and (min-height: 1400px) { #tilt { zoom: 1.6; } }

#audioCtl { position: fixed; top: 16px; left: 16px; z-index: 20; display: flex; gap: 8px; align-items: center; padding: 6px;
  border-radius: 12px; background: var(--card); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#audioCtl button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 15px; }
#vol { width: 90px; accent-color: var(--text); }
/* nút tim đặt ở góc trên: cùng hàng với thanh âm thanh */
#topCtl { position: fixed; top: 16px; left: 16px; z-index: 20; display: flex; gap: 8px; align-items: center; max-width: calc(100vw - 32px); }
#topCtl #audioCtl { position: static; min-width: 0; }
#topCtl .likeWrap { margin-left: 0; flex: none; }
#topCtl .likeBtn { height: 44px; padding: 0 14px; border-radius: 12px; font-size: 13px; background: var(--card); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#topCtl .likeBtn.on { background: color-mix(in srgb, #e5484d 22%, var(--card)); }
.uidPill { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 12px; flex: none;
  background: var(--card); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.uidPill i { font-size: 11px; opacity: .6; }
@media (max-width: 480px) { #topCtl { flex-wrap: wrap; } }
#trackCover { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
/* kiểu trình phát "thanh": ảnh bìa + tên bài + tiến trình kéo được */
#audioCtl.pbar { padding: 8px 10px; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
#audioCtl.pbar #trackCover { width: 40px; height: 40px; border-radius: 8px; }
#audioCtl.pbar .pInfo { display: flex; flex-direction: column; gap: 4px; min-width: 150px; flex: 1; }
#audioCtl.pbar #trackTitle { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
#audioCtl.pbar .pRow { display: flex; align-items: center; gap: 8px; }
#audioCtl .pSeek { flex: 1; min-width: 80px; height: 4px; appearance: none; -webkit-appearance: none; border-radius: 4px; cursor: pointer;
  background: linear-gradient(to right, var(--text) var(--p, 0%), rgba(255, 255, 255, .15) var(--p, 0%)); }
#audioCtl .pSeek::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text); }
#audioCtl .pSeek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--text); }
#audioCtl .pTime { font-size: 10px; opacity: .6; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 480px) { #audioCtl.pbar #vol { display: none; } }

/* huy hiệu / icon tự tải lên */
.badges .bimg { width: 16px; height: 16px; object-fit: contain; }
.badge { position: relative; display: inline-flex; align-items: center; outline: none; cursor: default; }
.badge::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 10;
  transform: translate(-50%, 4px); opacity: 0; pointer-events: none; white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; background: rgba(15, 15, 16, .94); border: 1px solid rgba(255, 255, 255, .1);
  color: #ededed; font: 500 12px/16px var(--font); letter-spacing: 0;
  transition: opacity .15s cubic-bezier(.22, 1, .36, 1), transform .15s cubic-bezier(.22, 1, .36, 1); }
.badge:hover::after, .badge:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.badge:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; border-radius: 3px; }
.links .limg { width: 1em; height: 1em; object-fit: contain; border-radius: 4px; }

/* widget */
.widget { margin-top: 16px; }
.wcard { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: calc(var(--radius) * .7); background: var(--box);
  color: var(--text); text-decoration: none; position: relative; min-width: 0; }
.wcard .wimg { width: 52px; height: 52px; flex: none; border-radius: 10px; object-fit: cover; }
.wcard-youtube .wimg { width: 92px; height: 52px; }
.wcard .wicon { display: grid; place-items: center; font-size: 22px; background: rgba(255, 255, 255, .06); }
.wcard .wtext { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wcard .wtext b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wcard .wtext small { font-size: 11px; opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcard .wgo { font-size: 11px; opacity: .45; }
/* khối Markdown */
.mdBlock { margin-top: 14px; text-align: left; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.mdBlock[hidden] { display: none; }
.mdBlock > :first-child { margin-top: 0; }
.mdBlock h3, .mdBlock h4, .mdBlock h5 { margin: 14px 0 6px; font-weight: 600; line-height: 1.3; }
.mdBlock h3 { font-size: 17px; } .mdBlock h4 { font-size: 15px; } .mdBlock h5 { font-size: 13px; opacity: .85; }
.mdBlock p { margin: 0 0 8px; }
.mdBlock ul, .mdBlock ol { margin: 0 0 8px; padding-left: 20px; }
.mdBlock blockquote { margin: 0 0 8px; padding: 2px 0 2px 12px; border-left: 2px solid color-mix(in srgb, var(--text) 30%, transparent); opacity: .85; }
.mdBlock pre { margin: 0 0 8px; padding: 10px; border-radius: 8px; background: rgba(0, 0, 0, .3); overflow-x: auto; font: 12px/1.5 ui-monospace, monospace; }
.mdBlock hr { border: 0; border-top: 1px solid color-mix(in srgb, var(--text) 15%, transparent); margin: 12px 0; }
.mdBlock code { font: 12px/1 ui-monospace, monospace; padding: 2px 5px; border-radius: 5px; background: rgba(255, 255, 255, .08); }
.mdBlock pre code { padding: 0; background: none; }
.mdBlock a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mdBlock .spoiler { background: currentColor; border-radius: 4px; cursor: pointer; }
.mdBlock .spoiler.shown { background: rgba(255, 255, 255, .08); }

/* kiểu liên kết: nhãn (icon + tên) / nút dài */
.links.ls-tags, .links.ls-list { flex-wrap: wrap; }
.links.ls-tags a .lbl, .links.ls-list a .lbl { display: inline; position: static; opacity: 1; transform: none; pointer-events: auto; background: none; border: 0; padding: 0; font-size: 13px; color: var(--text); white-space: nowrap; }
.links.ls-tags a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--box); font-size: 15px; }
.links.ls-list { flex-direction: column; align-items: stretch; }
.links.ls-list a { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: calc(var(--radius) * .6); background: var(--box); font-size: 16px; }
.links.ls-list a:hover, .links.ls-tags a:hover { filter: brightness(1.15); }

/* ẩn từng phần theo thiết bị */
@media (max-width: 640px) {
  body.mh-badges [data-sec="badges"], body.mh-desc [data-sec="desc"], body.mh-relations [data-sec="relations"], body.mh-discord [data-sec="discord"],
  body.mh-widget [data-sec="widget"], body.mh-widgets [data-sec="widgets"], body.mh-games [data-sec="games"], body.mh-links [data-sec="links"],
  body.mh-cards [data-sec="cards"], body.mh-markdown [data-sec="markdown"], body.mh-lyrics [data-sec="lyrics"], body.mh-html [data-sec="html"],
  body.mh-signatures [data-sec="signatures"], body.mh-foot [data-sec="foot"] { display: none !important; }
}
@media (min-width: 641px) {
  body.dh-badges [data-sec="badges"], body.dh-desc [data-sec="desc"], body.dh-relations [data-sec="relations"], body.dh-discord [data-sec="discord"],
  body.dh-widget [data-sec="widget"], body.dh-widgets [data-sec="widgets"], body.dh-games [data-sec="games"], body.dh-links [data-sec="links"],
  body.dh-cards [data-sec="cards"], body.dh-markdown [data-sec="markdown"], body.dh-lyrics [data-sec="lyrics"], body.dh-html [data-sec="html"],
  body.dh-signatures [data-sec="signatures"], body.dh-foot [data-sec="foot"] { display: none !important; }
}

/* widget thêm: lưới 2 cột (1 cột trên điện thoại), lưới GitHub chiếm cả hàng */
.wlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 10px; margin-top: 14px; }
.wlist[hidden] { display: none; }
.wlist .wcard-ghgraph { grid-column: 1 / -1; }
/* widget đứng một mình / lẻ ở cuối: kéo hết hàng, dài bằng thẻ Discord và các thẻ khác */
.wlist > :only-child, .wlist > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 480px) { .wlist { grid-template-columns: minmax(0, 1fr); } }
.wcard.st-on .wimg, .wcard.st-game .wimg { box-shadow: 0 0 0 2px #3ba55c; }
.wcard.st-game .wimg { box-shadow: 0 0 0 2px #e8a33d; }
.wcard-ghgraph { flex-direction: column; align-items: stretch; gap: 10px; }
.ghGrid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; width: 100%; }
.ghGrid i { aspect-ratio: 1; border-radius: 2px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.ghGrid i.pad { background: transparent; }
.ghGrid i[data-l="1"] { background: color-mix(in srgb, var(--fx, #e8a33d) 35%, transparent); }
.ghGrid i[data-l="2"] { background: color-mix(in srgb, var(--fx, #e8a33d) 55%, transparent); }
.ghGrid i[data-l="3"] { background: color-mix(in srgb, var(--fx, #e8a33d) 78%, transparent); }
.ghGrid i[data-l="4"] { background: var(--fx, #e8a33d); }
.wcard.big { flex-direction: column; align-items: stretch; padding: 0; background: transparent; }
.wcard.big .wimg { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: calc(var(--radius) * .6); }
.wcard-spotify.big .wimg, .wcard-discordserver.big .wimg { aspect-ratio: 1; max-width: 240px; align-self: center; }
.wcard.big .wtext b { font-size: 16px; white-space: normal; }
.wcard.big .wgo { position: absolute; top: 10px; right: 10px; }
.wload { font-size: 13px; opacity: .6; text-align: center; padding: 24px 0; }

/* second tab */
#tabs { display: flex; gap: 4px; justify-content: center; margin-bottom: 10px; }
#tabs button { border: 0; padding: 6px 14px; border-radius: 999px; background: var(--card); color: var(--text); opacity: .6; font: inherit; font-size: 12px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .15s; }
#tabs button.on { opacity: 1; background: var(--box); }
#tabPane { padding: 18px; }
#trackTitle { font-size: 12px; opacity: .75; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50; padding: 8px 14px; border-radius: 10px;
  background: rgba(0, 0, 0, .8); font-size: 12px; opacity: 0; transition: opacity .3s; pointer-events: none; }
#toast.show { opacity: 1; }

/* Điện thoại: các khối dưới đầu thẻ cách đều 16px, hàng icon liên kết 20px (đặt cuối file để thắng các luật gốc khai báo phía trên) */
@media (max-width: 480px) {
  .discord, .widget, .lcards, .wlist, .mdBlock, .lyrics, .customHtml { margin-top: 16px; }
  .links { margin-top: 20px; }
  .links.ls-tags, .links.ls-list, .layout-sleek .links, .page-grid .links { margin-top: 16px; }
  .links.ls-tags { gap: 8px; }
  .layout-portfolio .side > *, .page-pinned .card .side > * { margin-top: 0; }
  #tabs { margin-bottom: 12px; }
  #tabs button { padding: 8px 16px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* iPhone (Safari) tự phóng to khi chạm vào ô nhập có chữ < 16px và giữ nguyên mức phóng -> phải lướt qua lại. Ô nhập trên điện thoại luôn 16px. */
@media (max-width: 640px) { input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { font-size: 16px !important; } }

/* ===== bố cục thêm (Bố cục trang): stack / banner / stage / lockscreen / chat / folder ===== */
/* Stack: liên kết thành các hàng chồng nhau dưới hồ sơ */
.page-stack #card { width: min(520px, 100%); margin-bottom: 22px;
  /* hai lớp thẻ xếp chồng phía sau */
  box-shadow: 0 11px 0 -5px color-mix(in srgb, var(--card) 80%, #000), 0 22px 0 -10px color-mix(in srgb, var(--card) 60%, #000), 0 30px 40px -10px rgba(0, 0, 0, .45); }
.page-stack .links.ls-list a { transition: transform .2s ease; }
.page-stack .links.ls-list a:hover { transform: translateX(4px); }
.page-stack .links.ls-list a { justify-content: flex-start; padding: 13px 16px; }
.page-stack .links.ls-list a .lbl { margin-right: auto; }
/* Banner: thẻ rộng, dải banner lớn, avatar đè lên mép banner */
.page-banner #card { width: min(720px, 100%); padding-top: 0; overflow: hidden; }
.page-banner .banner { --bh: 180px; margin: 0 -26px 0; border-radius: var(--radius) var(--radius) 0 0; }
.page-banner .bannerAuto { height: 180px; background: radial-gradient(120% 140% at 20% 0%, color-mix(in srgb, var(--fx, #8a5cff) 75%, #fff 0%), transparent 60%),
  linear-gradient(135deg, color-mix(in srgb, var(--fx, #8a5cff) 55%, #000), #050507); }
.page-banner .head { flex-direction: row; align-items: flex-end; text-align: left; margin-top: -48px; position: relative; z-index: 2; }
.page-banner .avatar .pic { box-shadow: 0 0 0 5px var(--card); }
.page-banner .links.ls-list a, .page-banner .links a { justify-content: flex-start; }
/* Stage: trình phát nhạc lớn ở đầu thẻ, các mục bên dưới */
.page-stage #audioCtl.stageCtl { position: relative; inset: auto; z-index: 1; display: flex; width: 100%; max-width: none; margin: 0 0 20px; padding: 14px;
  border-radius: calc(var(--radius) * .8); background: var(--box); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.page-stage #audioCtl.stageCtl[hidden] { display: none; }
.page-stage #audioCtl.stageCtl #trackCover { width: 88px; height: 88px; border-radius: 12px; }
.page-stage #audioCtl.stageCtl .pInfo { min-width: 0; }
.page-stage #audioCtl.stageCtl #trackTitle { font-size: 16px; max-width: none; }
/* Lockscreen: đồng hồ lớn, liên kết như thông báo */
.page-lockscreen #card { width: min(440px, 100%); }
.lkClock { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0 22px; text-align: center; }
.lkClock .lkIcon { font-size: 14px; opacity: .7; margin-bottom: 6px; }
.lkTime { font-size: clamp(56px, 16vw, 84px); font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.lkDate { font-size: 15px; opacity: .75; text-transform: capitalize; }
.page-lockscreen .links.ls-list a { justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--box) 85%, transparent); }
.page-lockscreen .links.ls-list a::after { content: "now"; margin-left: auto; font-size: 11px; opacity: .55; }
/* Chat: bong bóng tin nhắn */
.page-chat #card { width: min(480px, 100%); }
.chatLog { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 16px 0 4px; }
.bub { max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--box); line-height: 1.45; font-size: 14px;
  opacity: 0; transform: translateY(6px) scale(.98); animation: bubIn .35s ease forwards; animation-delay: var(--d, 0s); overflow-wrap: anywhere; }
@keyframes bubIn { to { opacity: 1; transform: none; } }
.bubLinks { width: 86%; padding: 8px; }
.bubDesc .desc { margin: 0; text-align: left; max-width: none; }
.bubLinks .links { margin: 0; }
.bub.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.bub.typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; animation: bubDot 1.2s infinite; }
.bub.typing i:nth-child(2) { animation-delay: .15s; } .bub.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bubDot { 30% { opacity: 1; transform: translateY(-3px); } 60% { opacity: .5; transform: none; } }
/* Folder: tab trong thẻ */
.fTabs { display: flex; gap: 6px; margin: 14px 0 12px; padding: 4px; border-radius: 12px; background: var(--box); }
.fTabs button { flex: 1; min-width: 0; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text); opacity: .65; font: inherit; font-size: 13px; cursor: pointer; }
.fTabs button.on { opacity: 1; background: var(--card); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.page-folder #card { width: min(520px, 100%); }
/* trông như tab hồ sơ giấy: tab dính vào mép trên khung nội dung */
.page-folder .fTabs { gap: 4px; padding: 0 6px; margin: 16px 0 0; border-radius: 0; background: none; border-bottom: 1px solid color-mix(in srgb, var(--text) 14%, transparent); }
.page-folder .fTabs button { flex: 0 1 auto; padding: 8px 14px; border-radius: 10px 10px 0 0; margin-bottom: -1px; border: 1px solid transparent; }
.page-folder .fTabs button::before { content: "\f07b"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 7px; font-size: 12px; opacity: .8; }
.page-folder .fTabs button.on { background: var(--box); box-shadow: none; border-color: color-mix(in srgb, var(--text) 14%, transparent); border-bottom-color: var(--box); }
.page-folder .fTabs button.on::before { content: "\f07c"; }
.page-folder .fPane { padding: 14px; border-radius: 0 0 12px 12px; background: var(--box); }
.page-folder .fPane .links.ls-list a, .page-folder .fPane .links a { background: color-mix(in srgb, var(--card) 70%, transparent); }
@media (prefers-reduced-motion: reduce) { .bub { animation: none; opacity: 1; transform: none; } .bub.typing i { animation: none; } }
@media (max-width: 480px) { .page-banner .head { flex-direction: column; align-items: center; text-align: center; } .bub, .bubLinks { max-width: 100%; width: 100%; } }
/* ===== tuỳ chỉnh bố cục Lưới (Giao diện › Thẻ, khi chọn Lưới) ===== */
.page-grid.g-left #stage { place-items: center start; }                       /* căn thẻ sang trái */
@media (min-width: 900px) { .page-grid.g-left #stage { padding-left: max(24px, 6vw); } }
.page-grid.g-wide #tilt { width: min(900px, 100%); }                          /* mở rộng bio: thẻ rộng hơn */
.page-grid.g-info-col .head { flex-direction: column; align-items: center; text-align: center; }      /* thông tin xếp cột */
.page-grid.g-info-row .head { flex-direction: row; align-items: center; text-align: left; }           /* thông tin xếp hàng */
.page-grid.g-big .links { grid-template-columns: minmax(0, 1fr); }            /* liên kết lớn: mỗi liên kết một hàng to */
.page-grid.g-big .links a { min-height: 76px; font-size: 26px; padding: 16px 18px; }
.page-grid.g-big .links .lbl { font-size: 16px; }
@media (max-width: 480px) { .page-grid.g-info-row .head { flex-direction: column; text-align: center; } .page-grid.g-big .links a { flex-direction: row; justify-content: flex-start; text-align: left; } }
/* khối nội dung bị tắt (Sắp xếp mục) */
.secOff { display: none !important; }

/* ===== thẻ couple lớn ===== */
.coupleCard { position: relative; margin-top: 18px; padding: 18px 16px; border-radius: calc(var(--radius) * .8); background: var(--box); overflow: hidden; text-align: center; isolation: isolate; }
.coupleCard.hasBg::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--cpbg) center / cover; opacity: .55; }
.coupleCard.hasBg::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 20%, color-mix(in srgb, var(--card) 85%, transparent)); }
.cpRow { display: flex; align-items: center; justify-content: center; gap: 18px; }
.cpSide { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; max-width: 40%; color: var(--text); text-decoration: none; }
.cpSide b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cpAv { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--card); font-size: 24px; font-weight: 700;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx, #ff5c9a) 60%, transparent); }
.cpHeart { font-size: 26px; color: var(--fx, #ff5c9a); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--fx, #ff5c9a) 70%, transparent)); animation: cpBeat 1.6s ease-in-out infinite; }
@keyframes cpBeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.18); } 24% { transform: scale(.98); } 36% { transform: scale(1.1); } }
.cpDays { margin-top: 12px; font-size: 13px; opacity: .85; }
.cpDays b { font-size: 20px; margin-right: 2px; }
.cpNote { margin-top: 8px; font-size: 13px; line-height: 1.5; opacity: .9; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .cpHeart { animation: none; } }
/* trình phát dạng thanh trên màn hình hẹp: co phần thông tin, thời gian không lòi ra ngoài */
@media (max-width: 480px) { #audioCtl.pbar .pInfo { min-width: 0; } #audioCtl.pbar #trackTitle { max-width: 150px; } #audioCtl.pbar .pSeek { min-width: 40px; } #audioCtl.pbar .pTime { flex: none; } }
