/* ===== HuyDino's Den — theme màu lấy từ avatar khủng long ===== */
:root {
  --green: #6cc94a;        /* xanh lá mạ (màu nhấn chính) */
  --green-light: #8fdc6c;
  --green-soft: #e3f7d6;
  --teal: #2a8a78;         /* xanh ngọc đậm (tiêu đề) */
  --mint: #bfe0f6;         /* viền: xanh trời nhạt (hợp nền bầu trời) */
  --mint-soft: #edf6fd;    /* nền nhạt: trắng ngọc pha xanh trời */
  --yellow: #ffe14d;       /* vàng chanh (điểm nhấn nhỏ) */
  --yellow-deep: #e8b800;
  --ink: #1f3d36;
  --ink-soft: #4d6d64;
  --glass: rgba(255, 255, 255, 0.62);      /* đục hơn một chút vì đã giảm độ mờ phía sau */
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.85);
  --radius-lg: 28px;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(25, 65, 115, 0.13);
  --font: "Nunito", "Zen Maru Gothic", system-ui, sans-serif;
  --font-round: "Baloo 2", "Zen Maru Gothic", "Nunito", sans-serif;
  --font-jp: "Zen Maru Gothic", "Baloo 2", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #3d9be9;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before { /* ảnh nền cố định (lớp fixed để chạy tốt cả trên điện thoại), không phủ trắng để ảnh trong và nét */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: url("../assets/bg.jpg") center 10% / cover no-repeat; /* ảnh dọc: trên máy tính canh phần có mặt trời */
  filter: saturate(1.08) contrast(1.05);
}
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

/* ===== Loader ===== */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: rgba(240, 252, 245, 0.55);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  transition: opacity .6s ease, visibility .6s;
}
#loader.hide { opacity: 0; visibility: hidden; }
.loader-text { margin: 0; font: 700 26px var(--font-round); color: var(--teal); letter-spacing: .5px; }
.loader-ring {
  position: relative; width: 120px; height: 120px; border-radius: 50%;
  border: 14px solid #fff; box-shadow: 0 6px 20px rgba(40,110,180,.25), inset 0 0 0 2px var(--mint);
  display: grid; place-items: center;
}
.loader-jp { font: 700 13px var(--font-jp); color: var(--teal); }
.loader-orbit { position: absolute; inset: -14px; animation: spin 1.6s linear infinite; }
.loader-orbit img {
  position: absolute; left: 50%; top: -12px; width: 44px; height: 44px; margin-left: -22px;
  border-radius: 50%; border: 3px solid #fff; object-fit: cover; box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Hiệu ứng bầu trời (máy bay giấy + nắng) ===== */
#sky-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* ===== Khung chính ===== */
.app {
  position: relative; z-index: 2; height: 100%;
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 24px;
}
.shell {
  position: relative;
  width: min(1180px, 100%); height: min(730px, 100%);
  border-radius: 34px; padding: 18px;
  background: rgba(255, 255, 255, 0.16); /* khung ngoài không làm mờ, để ảnh nền giữa các ô vẫn rõ */
  border: 2px solid rgba(255, 255, 255, 0.92); /* viền trắng ngọc như mây */
  box-shadow: 0 0 0 5px rgba(175, 215, 250, 0.3), 0 0 44px rgba(150, 205, 255, 0.35), 0 20px 60px rgba(20, 60, 110, 0.22);
  overflow: hidden;
}
.card {
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(190, 225, 250, 0.45);
  backdrop-filter: blur(6px) saturate(1.15); -webkit-backdrop-filter: blur(6px) saturate(1.15);
  padding: 16px 18px;
  min-width: 0;
}
.page {
  position: absolute; inset: 18px;
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.99);
  transition: opacity .45s ease, transform .45s ease, visibility .45s;
}
.page.active { opacity: 1; visibility: visible; transform: none; }
.page.scroll { overflow-y: auto; padding-right: 6px; display: flex; flex-direction: column; gap: 14px; }
.page.scroll > * { flex-shrink: 0; }

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(42, 138, 120, .35); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Nav ===== */
.side-nav {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  align-self: stretch; max-height: min(730px, 100%); margin: auto 0;
}
.nav-group {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--glass); border: 1.5px solid var(--glass-border); border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.nav-group a, .nav-group button {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: transparent;
  color: var(--ink-soft); text-decoration: none; font-size: 19px;
  transition: background .25s, color .25s, transform .2s;
}
.nav-group a:hover, .nav-group button:hover { background: var(--green-soft); color: var(--teal); transform: translateY(-1px); }
.nav-group a.active, .nav-group button.active {
  background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(108, 201, 74, .45);
}
.nav-group em { /* tooltip */
  position: absolute; right: 54px; white-space: nowrap; font-style: normal; font-size: 13px; font-weight: 700;
  background: var(--glass-strong); color: var(--teal); padding: 4px 10px; border-radius: 10px;
  opacity: 0; pointer-events: none; transform: translateX(6px); transition: .2s;
}
.nav-group a:hover em, .nav-group button:hover em { opacity: 1; transform: none; }
.nav-group.lang button { font: 700 13px var(--font-round); }
/* Tiếng Trung: ưu tiên font chữ giản thể của máy (font Nhật thiếu nhiều chữ giản thể nên chữ bị lẫn 2 kiểu) */
html[lang="zh"] {
  --font: "Nunito", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-round: "Baloo 2", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Nunito", sans-serif;
}

/* ===== Chung ===== */
/* Icon vẽ (Tabler Icons): tô bằng màu chữ, cỡ theo cỡ chữ */
.ico {
  display: inline-block; flex-shrink: 0; width: 1.15em; height: 1.15em; vertical-align: -0.2em; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.qc-icon.ico { width: 18px; height: 18px; vertical-align: middle; }
.section-label { font: 700 12px var(--font-round); letter-spacing: 1.2px; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; }
.page-intro { font-style: italic; color: var(--ink-soft); line-height: 1.6; font-size: 15px; }
.page-intro.center { text-align: center; }
/* Đầu trang Anime: lời giới thiệu + nút đổi theme / nhạc nền (khung hẹp thì nút chỉ còn icon) */
.page-head { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 22px; container-type: inline-size; }
.page-head .page-intro { flex: 1; min-width: 0; margin: 0; text-align: center; }
.page-tools { flex-shrink: 0; display: flex; gap: 8px; }
@container (max-width: 700px) {
  .page-tools .qc-label { display: none; }
  .page-tools .qc-btn { width: 40px; padding: 0; gap: 2px; justify-content: center; }
}
.icon-btn { border: 0; background: var(--mint-soft); color: var(--teal); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; }
.icon-btn:hover { background: var(--mint); }
.round-btn {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--glass-border); background: var(--glass-strong); color: var(--teal);
  display: grid; place-items: center; font-size: 14px; transition: transform .15s, background .2s;
}
.round-btn:hover { background: var(--green-soft); transform: translateY(-1px); }
.round-btn.play { background: var(--green); color: #fff; border-color: var(--green); }
.round-btn.play:hover { background: var(--green-light); }
.round-btn.big { width: 46px; height: 46px; font-size: 17px; }
.round-btn.on { background: var(--yellow); color: var(--ink); }

input[type=range] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px; flex: 1; min-width: 40px;
  background: linear-gradient(to right, var(--green) var(--p, 0%), rgba(42,138,120,.15) var(--p, 0%));
  outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }
input[type=range].volume { background: linear-gradient(to right, var(--yellow-deep) var(--p, 60%), rgba(42,138,120,.15) var(--p, 60%)); max-width: 110px; }
input[type=range].volume::-webkit-slider-thumb { border-color: var(--yellow-deep); }

/* ===== HOME ===== */
.home-grid {
  height: 100%; display: grid; gap: 14px;
  /* Trái: avatar + tên + giờ, giới thiệu, câu nói — Phải: banner cao, nhạc + mascot, mạng xã hội */
  grid-template-columns: 136px minmax(0, 1fr) minmax(0, 1fr) 220px;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "avatar name   banner banner"
    "avatar clock  banner banner"
    "intro  intro  banner banner"
    "intro  intro  player mascot"
    "quote  quote  social social";
}
.avatar-card { grid-area: avatar; padding: 7px; }
.avatar-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }

/* Banner chia đôi: 2 hình dựa lưng, chữ dọc ở giữa */
.banner-card { grid-area: banner; display: flex; overflow: hidden; padding: 0; background: #7fb8ea; }
.banner-half { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.banner-half img { width: 100%; height: 100%; object-fit: cover; transition: transform 6s ease; }
.banner-half.left img, .banner-half.right img { object-position: 50% 8%; } /* giữ phần trên: máy bay giấy + mặt + nửa người */
.banner-card:hover .banner-half img { transform: scale(1.04); }
img.mirror { transform: scaleX(-1); } /* lật gương để 2 hình chạm lưng */
.banner-card:hover .banner-half img.mirror { transform: scaleX(-1) scale(1.04); }

/* Bộ banner theo theme (mỗi bộ có 2 mặt, bấm dải băng để lật) */
.banner-set { flex: 1; min-width: 0; position: relative; perspective: 1600px; }
.banner-dark { display: none; }
html[data-theme="dark"] .banner-light { display: none; }
html[data-theme="dark"] .banner-dark { display: block; }
.banner-light .banner-half img.pos-bl { object-position: 50% 12%; }
.banner-light .banner-half img.pos-br { object-position: 50% 45%; }

/* Lật cả banner (bấm dải băng giữa) */
.flipper { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.45, .05, .25, 1); }
.flipper.flipped { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: flex; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.seam-btn { flex-direction: column; gap: 10px; border: 0; font: inherit; cursor: pointer; transition: background .25s, box-shadow .25s; }
.seam-btn:hover { filter: brightness(1.04); box-shadow: -3px 0 16px rgba(20, 60, 90, .2), 3px 0 16px rgba(20, 60, 90, .2); }
.seam-hint { font-size: 15px; line-height: 1; color: #5b6bb5; transition: transform .4s; }
.seam-btn:hover .seam-hint { transform: rotate(-180deg); }

/* Lật thẻ nửa phải (đổi hình A ⇄ B) */
.card-flip { padding: 0; border: 0; background: none; cursor: pointer; perspective: 1100px; }
.card-inner { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.45, .05, .25, 1); }
.card-inner.flipped { transform: rotateY(180deg); }
.cf-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cf-b { transform: rotateY(180deg); }
/* Lật xong (class rest do app.js gắn): mặt sau nằm phẳng như ảnh thường, không còn xoay 3D, nên rê chuột không bị giật */
.flipper.flipped.rest, .card-inner.flipped.rest { transform: none; transition: none; }
.flipper.rest > .face.front, .card-inner.rest > .cf-a { visibility: hidden; }
.flipper.rest > .face.back, .card-inner.rest > .cf-b { transform: none; }
.flip-hint {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; color: #fff;
  background: rgba(12, 20, 48, .55); border: 1px solid rgba(255, 255, 255, .45); transition: transform .35s;
}
.card-flip:hover .flip-hint { transform: rotate(180deg) scale(1.1); }

/* Khung cắt từng hình banner tối */
.banner-dark .banner-half img.pos-sk { object-position: 45% 50%; }
.banner-dark .banner-half img.pos-rf { object-position: 50% 24%; }
.banner-dark .banner-half img.pos-rm { object-position: 50% 30%; }
.banner-dark .banner-half img.pos-bs { object-position: 50% 40%; }
.banner-dark .banner-half img.pos-bp { object-position: 58% 50%; }
/* Dải băng giữa: theme sáng là giấy ngà, 2 đầu hồng phấn / xanh trời (màu tóc và trời của Aemeath), vệt sáng chạy dọc */
.banner-seam {
  position: relative; overflow: hidden;
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding: 14px 8px;
  background: linear-gradient(180deg, #f7c6d8 0 7px, #fbf6ec 7px calc(100% - 7px), #bcdcf6 calc(100% - 7px));
  box-shadow: -3px 0 12px rgba(20, 60, 90, .14), 3px 0 12px rgba(20, 60, 90, .14);
}
.banner-seam::after {
  content: ""; position: absolute; left: 0; right: 0; top: -45%; height: 45%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .85), transparent); animation: seamShine 7s ease-in-out infinite;
}
@keyframes seamShine { 0%, 55% { top: -45%; } 100% { top: 105%; } }
.seam-text {
  position: relative; z-index: 1; margin: 0; writing-mode: vertical-rl; white-space: pre-line; cursor: default;
  font: 700 13px/1.75 var(--font-jp); letter-spacing: 2px; color: #1d4f86;
}
/* Tiếng Anh (trang VI, EN): chữ Latin xoay dọc, đọc từ trên xuống */
html[lang="vi"] .seam-text, html[lang="en"] .seam-text { font: 700 12.5px/1.6 var(--font-round); letter-spacing: .6px; }
html[lang="zh"] .seam-text { font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif; letter-spacing: 3px; }

/* Phụ đề khi lật: chữ mờ nằm ngang giữa khung, từng cụm hiện dần rồi tan đi (các dòng chồng cùng chỗ để chuyển mượt) */
.banner-card { position: relative; }
.banner-sub { position: absolute; left: 50%; bottom: 13%; z-index: 6; display: grid; width: min(86%, 640px); transform: translateX(-50%); text-align: center; pointer-events: none; }
.bs-line {
  grid-area: 1 / 1; font: 700 18px/1.45 var(--font-round); letter-spacing: .3px; color: #fff;
  text-shadow: 0 1px 3px rgba(8, 28, 60, .75), 0 0 16px rgba(8, 28, 60, .5); transition: opacity .7s ease, filter .7s ease, transform .7s ease;
}
.bs-line span { opacity: 0; filter: blur(8px); transition: opacity .8s ease, filter .8s ease; }
.bs-line span.in { opacity: .95; filter: blur(0); }
.bs-line.out { opacity: 0; filter: blur(6px); transform: translateY(-8px); }

/* Ô đồng hồ + thời tiết */
.clock-card { grid-area: clock; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.clock-block { min-width: 0; }
.clock { font: 700 30px/1 var(--font-round); color: var(--teal); letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.date { margin-top: 4px; font-weight: 700; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.weather { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1.5px dashed rgba(70,140,200,.32); white-space: nowrap; }
.weather-icon { font-size: 28px; }
.weather-temp { font: 700 19px/1.1 var(--font-round); color: var(--teal); }
.weather-desc { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.weather-city { font-size: 11.5px; color: var(--ink-soft); }

.name-card { grid-area: name; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.name-row { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.site-name { margin: 0; font: 700 22px var(--font-round); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aka { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aka b { color: var(--ink); font-weight: 700; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-border); font-weight: 700; font-size: 14px;
}
.status-pill .dot { width: 12px; height: 12px; border-radius: 50%; background: #9aa5a1; }
.status-pill[data-s=online] .dot { background: #3fcf5b; box-shadow: 0 0 0 3px rgba(63,207,91,.2); }
.status-pill[data-s=idle] .dot { background: #f5b82e; }
.status-pill[data-s=dnd] .dot { background: #ef5350; }
.activity { flex-basis: 100%; font-size: 13px; color: var(--ink-soft); display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity.show { display: block; }

.intro-card { grid-area: intro; display: flex; flex-direction: column; overflow: hidden; }
.intro-text { flex: 1; overflow-y: auto; white-space: pre-line; line-height: 1.7; font-size: 15px; padding-right: 4px; }
.intro-text p { margin: 0 0 .6em; }
.intro-text p:last-child { margin-bottom: 0; }
.intro-sub { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed rgba(70,140,200,.32); font-style: italic; color: var(--ink-soft); font-size: 14px; }

.quote-card { grid-area: quote; display: flex; align-items: center; gap: 12px; position: relative; padding: 12px 16px; }
.quote-mark { font: 700 48px/1 var(--font-round); color: var(--mint); align-self: flex-start; margin-top: -4px; }
.quote-text { flex: 1; font-style: italic; font-size: 15px; line-height: 1.6; color: var(--ink); margin: 0; transition: opacity .3s; }
.quote-refresh { flex-shrink: 0; }

.mini-player { grid-area: player; display: flex; gap: 14px; align-items: center; padding: 12px; }
.mini-cover { width: 92px; height: 92px; border-radius: 14px; object-fit: cover; background: var(--mint-soft); flex-shrink: 0; }
.mini-info { flex: 1; min-width: 0; }
.mini-title { font: 700 16px var(--font-round); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-progress { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-soft); margin: 6px 0; }
.mini-controls { display: flex; gap: 8px; justify-content: center; }
.mini-controls .round-btn { width: 32px; height: 32px; font-size: 12px; }
.mini-player.single .mini-skip { display: none; } /* ô nhạc 1 bài (theme sáng): chỉ có nút play */

/* Ô liên lạc: mạng xã hội bên trái | nút đổi theme + nhạc nền bên phải (có vạch ngăn) */
.quick-ctrls { flex: 0 0 auto; display: flex; gap: 8px; padding-left: 12px; border-left: 1.5px dashed var(--mint); }
.qc-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--glass-border); background: var(--glass-strong); color: var(--teal);
  font-weight: 800; font-size: 13px; white-space: nowrap; transition: transform .2s, background .25s, color .25s;
}
.qc-btn:hover { transform: translateY(-2px); background: var(--green-soft); }
.qc-icon { font-size: 16px; line-height: 1; }
.bgm-toggle.off { color: var(--ink-soft); }
.bgm-eq { display: none; gap: 2px; align-items: flex-end; height: 12px; }
.bgm-toggle.on .bgm-eq { display: inline-flex; }
.bgm-eq i { width: 3px; border-radius: 2px; background: var(--green); animation: eqs 1s ease-in-out infinite; }
.bgm-eq i:nth-child(2) { animation-delay: -.3s; }
.bgm-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eqs { 0%, 100% { height: 3px; } 50% { height: 12px; } }

/* Gợi ý khi trình duyệt chặn nhạc có tiếng */
.sound-hint {
  position: fixed; left: 50%; bottom: 24px; z-index: 55; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; background: var(--glass-strong); color: var(--ink);
  border: 1.5px solid var(--glass-border); box-shadow: var(--shadow); font-size: 14px; font-weight: 700;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; animation: hintPulse 2.4s ease-in-out infinite;
}
@keyframes hintPulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.04); } }

/* ===== Máy gacha mini ===== */
.gacha-card {
  grid-area: mascot; position: relative; overflow: visible; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; transition: box-shadow .2s;
  --gm-top: #8fd3ff; --gm-bot: #56aeea; --gm-trim: #ffffff; --gm-glow: rgba(120, 190, 255, .35);
}
html[data-theme="dark"] .gacha-card { --gm-top: #4254b0; --gm-bot: #222c6e; --gm-trim: #cfe0ff; --gm-glow: rgba(120, 190, 255, .55); }
.gacha-card.drop-target { box-shadow: var(--shadow), 0 0 0 3px var(--yellow), 0 0 22px rgba(255, 225, 77, .6); }
.gacha-machine { position: relative; flex-shrink: 0; width: 78px; height: 118px; }
.gm-dome {
  position: absolute; top: 0; left: 4px; width: 70px; height: 62px; overflow: hidden; z-index: 1;
  border-radius: 35px 35px 12px 12px; border: 2px solid var(--gm-trim);
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.95), rgba(255,255,255,.35) 38%, rgba(170,220,255,.28));
  box-shadow: inset 0 -6px 12px rgba(60, 120, 190, .25), 0 0 14px var(--gm-glow);
}
.gm-ball { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(#fff 50%, var(--c) 50%); box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.08); }
.gm-ball.b1 { --c: #ff9fc6; left: 3px; top: 36px; }
.gm-ball.b2 { --c: #ffd66b; left: 47px; top: 38px; }
.gm-ball.b3 { --c: #8fe3c8; left: 9px; top: 16px; transform: rotate(40deg); }
.gm-ball.b4 { --c: #b69cff; left: 44px; top: 13px; transform: rotate(-30deg); }
.gm-ball.b5 { --c: #7cc3ff; left: 26px; top: 6px; transform: rotate(80deg); }
.gm-body {
  position: absolute; top: 56px; left: 0; width: 78px; height: 58px; z-index: 2;
  border-radius: 12px 12px 16px 16px; background: linear-gradient(180deg, var(--gm-top), var(--gm-bot));
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.1), inset 0 2px 0 rgba(255,255,255,.35), 0 6px 14px rgba(20, 50, 100, .2);
}
.gm-slot { position: absolute; left: 10px; bottom: 9px; width: 28px; height: 17px; border-radius: 4px 4px 9px 9px; background: rgba(8, 24, 56, .6); box-shadow: inset 0 3px 4px rgba(0,0,0,.35); }
.gm-crank {
  position: absolute; right: 9px; top: 12px; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  background: #fff; border: 3px solid var(--yellow-deep); cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.gm-crank::before { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 5px; margin: -2.5px 0 0 -8px; border-radius: 3px; background: var(--yellow-deep); }
.gm-crank:hover { transform: rotate(-25deg); }
.gacha-machine.spinning .gm-crank { animation: gmCrank .8s ease-in-out; }
.gacha-machine.spinning .gm-ball { animation: gmJiggle .26s ease-in-out 3; }
.gacha-machine.shake { animation: gmShake .4s ease; }
@keyframes gmCrank { to { transform: rotate(360deg); } }
@keyframes gmJiggle { 50% { translate: 0 -5px; } }
@keyframes gmShake { 20%, 60% { transform: translateX(-4px) rotate(-3deg); } 40%, 80% { transform: translateX(4px) rotate(3deg); } }
.gm-capsule { position: absolute; left: 13px; top: 92px; width: 22px; height: 22px; z-index: 3; --cap: #a07bff; --capglow: rgba(160,123,255,.8); }
.gm-capsule.r5 { --cap: #ffc93c; --capglow: rgba(255,201,60,.95); }
.gm-capsule .cap-top, .gm-capsule .cap-bottom { position: absolute; left: 0; right: 0; height: 11px; transition: transform .35s ease, opacity .35s; }
.gm-capsule .cap-top { top: 0; border-radius: 11px 11px 0 0; background: var(--cap); box-shadow: 0 0 10px var(--capglow); }
.gm-capsule .cap-bottom { bottom: 0; border-radius: 0 0 11px 11px; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.gm-capsule.drop { animation: gmDrop .6s cubic-bezier(.3, 1.5, .5, 1); }
.gm-capsule.open .cap-top { transform: translate(-6px, -12px) rotate(-35deg); opacity: 0; }
.gm-capsule.open .cap-bottom { transform: translate(6px, 8px) rotate(25deg); opacity: 0; }
@keyframes gmDrop { from { transform: translateY(-16px) scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.gm-burst { position: absolute; left: 24px; top: 103px; width: 0; height: 0; z-index: 4; pointer-events: none; }
.gm-burst::before {
  content: ""; position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,170,255,.95), rgba(160,123,255,.4) 40%, transparent 70%); animation: gmBurst .9s ease-out forwards;
}
.gm-burst.r5::before { left: -90px; top: -90px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(255,245,200,1), rgba(255,205,70,.6) 40%, transparent 70%); animation-duration: 1.4s; }
.gm-burst.r5::after {
  content: ""; position: absolute; left: -110px; top: -110px; width: 220px; height: 220px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,215,90,.75) 0 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: gmRays 1.6s ease-out forwards;
}
@keyframes gmBurst { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@keyframes gmRays { from { transform: scale(.3) rotate(0); opacity: 1; } to { transform: scale(1.2) rotate(60deg); opacity: 0; } }
.gacha-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gacha-title { font: 800 14px var(--font-round); color: var(--teal); white-space: nowrap; }
.gacha-stats { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); line-height: 1.45; white-space: nowrap; }
.btn.gacha-pull { padding: 7px 10px; font-size: 13px; border-radius: 12px; white-space: nowrap; }

/* Bé chibi quay ra (vị trí đặt bằng JS) */
.gacha-chibi {
  position: fixed; left: 0; top: 0; z-index: 42; cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.28));
}
.gacha-chibi.gold { filter: drop-shadow(0 0 12px rgba(255,205,70,.95)) drop-shadow(0 6px 8px rgba(0,0,0,.28)); }
.gacha-chibi.dragging { cursor: grabbing; }
.gacha-chibi.pop { animation: chibiPop .45s ease-out; }
.gacha-chibi.returning { transition: transform .35s ease-in, opacity .35s; opacity: 0; }
@keyframes chibiPop { from { scale: .3; } 60% { scale: 1.15; } to { scale: 1; } }
.chibi-bubble {
  position: fixed; left: 0; top: 0; z-index: 43; max-width: 220px; padding: 8px 12px; border-radius: 14px;
  font-size: 13px; line-height: 1.45; text-align: center; background: #fff; color: var(--ink);
  box-shadow: var(--shadow); border: 1.5px solid var(--mint); pointer-events: none; opacity: 0; scale: .85; transition: opacity .2s, scale .2s;
}
.chibi-bubble.show { opacity: 1; scale: 1; }
.gacha-flash {
  position: fixed; inset: 0; z-index: 41; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), rgba(255,240,180,.95), rgba(255,205,70,.35) 28%, transparent 62%);
}
.gacha-flash.go { animation: gachaFlash 1.4s ease-out; }
@keyframes gachaFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

.social-card {
  grid-area: social; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  container-type: inline-size; /* để nút bên phải tự thu gọn theo độ rộng của ô */
}
.socials { flex: 1 1 auto; min-width: 0; display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
.social {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--glass-strong); border: 1.5px solid var(--glass-border); color: var(--teal);
  transition: transform .2s, background .2s, color .2s;
}
.social svg { width: 20px; height: 20px; fill: currentColor; }
.social:hover { transform: translateY(-3px); background: var(--green); color: #fff; }
/* Ô hẹp: 2 nút bên phải chỉ còn biểu tượng (tên hiện khi rê chuột) để vẫn nằm cùng hàng */
@container (max-width: 560px) {
  .quick-ctrls .qc-label { display: none; }
  .quick-ctrls .qc-btn { width: 40px; padding: 0; gap: 2px; justify-content: center; }
}
@container (max-width: 400px) {
  .socials { gap: 6px; }
  .socials .social { width: 36px; height: 36px; border-radius: 12px; }
  .quick-ctrls { gap: 6px; padding-left: 10px; }
  .quick-ctrls .qc-btn { width: 36px; height: 36px; }
}
@container (max-width: 330px) {
  .socials { gap: 4px; }
  .socials .social { width: 32px; height: 32px; border-radius: 10px; }
  .quick-ctrls { gap: 4px; padding-left: 8px; }
  .quick-ctrls .qc-btn { width: 32px; height: 32px; }
  .quick-ctrls .qc-icon { font-size: 14px; }
}

/* ===== MUSIC ===== */
.music-grid {
  height: 100%; display: grid; gap: 14px;
  grid-template-columns: 360px 1fr; grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "side now" "bar bar";
}
.music-side { grid-area: side; display: flex; flex-direction: column; gap: 14px; min-height: 0; }

/* Danh sách: các nút mục (tự xuống dòng để thấy hết) + các bài */
.playlist-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 8px 8px 10px; }
.music-cats { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 10px 0; margin-bottom: 8px; border-bottom: 1.5px dashed var(--mint); }
.mcat {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px 5px 11px; border-radius: 999px;
  border: 1.5px solid var(--mint); background: var(--glass-strong); color: var(--teal);
  font-weight: 800; font-size: 12px; white-space: nowrap; transition: transform .2s, background .25s, box-shadow .25s;
}
.mcat small { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--mint-soft); font-size: 10.5px; text-align: center; }
.mcat:hover { transform: translateY(-1px); background: var(--green-soft); }
.mcat.active { background: linear-gradient(135deg, var(--green), var(--teal)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(108, 201, 74, .35); }
.mcat.active small { background: rgba(255, 255, 255, .28); }
.playlist { flex: 1; overflow-y: auto; padding: 0 4px 4px 0; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.pl-group {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px;
  border-radius: 12px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 800 12.5px var(--font-round); letter-spacing: .3px; color: var(--teal); box-shadow: 0 2px 8px rgba(25, 65, 115, .08);
}
.pl-group:first-child { margin-top: 0; }
.pl-group small { margin-left: auto; font-size: 11px; color: var(--ink-soft); }
.song {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 6px; border-radius: 16px; cursor: pointer; text-align: left;
  background: var(--glass-strong); border: 1.5px solid transparent; transition: .2s; width: 100%; flex-shrink: 0;
}
.song:hover { border-color: var(--mint); transform: translateX(3px); }
.song.active { border-color: var(--green); background: #fff; box-shadow: 0 4px 14px rgba(108,201,74,.2); }
.song .s-num { width: 22px; flex-shrink: 0; text-align: center; font: 800 12px var(--font-round); color: var(--ink-soft); }
.song.active .s-num { color: var(--green); }
.song img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--mint-soft); flex-shrink: 0; transition: transform .25s; }
.song:hover img { transform: scale(1.06) rotate(-2deg); }
.song .s-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song.active .s-title { color: var(--teal); }
.song .s-artist { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song > div { min-width: 0; flex: 1; }
.eq { display: none; gap: 2px; align-items: flex-end; height: 16px; }
.song.active.playing .eq { display: flex; }
.eq i { width: 3px; background: var(--green); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 16px; } }

/* Đang phát: nền mờ theo ảnh bìa, đĩa than xoay, nốt nhạc bay lên */
.now-playing { grid-area: now; position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; min-height: 0; padding: 20px 24px 14px; container-type: inline-size; }
.np-bg {
  position: absolute; inset: -60px; z-index: -1; pointer-events: none;
  background: center / cover no-repeat; filter: blur(42px) saturate(1.5); opacity: .26; transition: background-image .6s ease;
}
.np-head { display: flex; align-items: center; gap: 20px; padding-bottom: 14px; border-bottom: 1.5px dashed rgba(70,140,200,.3); }
.np-disc {
  position: relative; flex-shrink: 0; width: 108px; height: 108px; padding: 5px; border-radius: 50%;
  background: conic-gradient(from 20deg, var(--green), var(--yellow), #8fd3ff, var(--green));
  box-shadow: var(--shadow), 0 0 0 4px rgba(255, 255, 255, .55); transition: box-shadow .4s;
}
.np-disc::after { /* lỗ giữa đĩa */
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--glass-strong); border: 3px solid rgba(255, 255, 255, .85); box-shadow: inset 0 0 4px rgba(0, 0, 0, .25);
}
.np-cover { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--mint-soft); animation: discSpin 14s linear infinite paused; }
.now-playing.playing .np-cover { animation-play-state: running; }
.now-playing.playing .np-disc { animation: discGlow 2.6s ease-in-out infinite; }
@keyframes discSpin { to { transform: rotate(360deg); } }
@keyframes discGlow {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 4px rgba(255, 255, 255, .55), 0 0 14px rgba(108, 201, 74, .35); }
  50% { box-shadow: var(--shadow), 0 0 0 4px rgba(255, 255, 255, .7), 0 0 30px rgba(108, 201, 74, .6); }
}
.np-notes { position: absolute; inset: 0; pointer-events: none; }
.np-notes i { position: absolute; left: 72%; top: 18%; font-style: normal; font-weight: 800; font-size: 17px; color: var(--green); opacity: 0; text-shadow: 0 2px 6px rgba(255, 255, 255, .8); }
.np-notes i:nth-child(2) { left: 12%; top: 26%; color: var(--teal); }
.np-notes i:nth-child(3) { left: 48%; top: 4%; color: var(--yellow-deep); font-size: 14px; }
.np-notes i:nth-child(4) { left: 86%; top: 52%; color: #7cc6f2; font-size: 12px; }
.now-playing.playing .np-notes i { animation: noteUp 3.4s ease-out infinite; }
.now-playing.playing .np-notes i:nth-child(2) { animation-delay: .9s; }
.now-playing.playing .np-notes i:nth-child(3) { animation-delay: 1.8s; }
.now-playing.playing .np-notes i:nth-child(4) { animation-delay: 2.6s; }
@keyframes noteUp {
  0% { opacity: 0; transform: translate(0, 10px) scale(.6) rotate(-12deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(16px, -62px) scale(1.15) rotate(14deg); }
}
.np-info { flex: 1; min-width: 0; }
.np-cat { display: inline-block; margin-bottom: 4px; padding: 2px 10px; border-radius: 999px; background: var(--green-soft); color: var(--teal); font-size: 11.5px; font-weight: 800; }
.np-cat:empty { display: none; }
.np-title { font: 700 26px/1.2 var(--font-round); color: var(--ink); overflow-wrap: anywhere; }
.np-artist { font-style: italic; color: var(--ink-soft); }
.np-quick { flex-shrink: 0; align-self: flex-start; display: flex; gap: 8px; }
@container (max-width: 640px) { /* khung hẹp: 2 nút chỉ còn biểu tượng */
  .np-quick .qc-label { display: none; }
  .np-quick .qc-btn { width: 40px; padding: 0; gap: 2px; justify-content: center; }
}
@container (max-width: 440px) { /* điện thoại: đĩa + 2 nút ở hàng trên, tên bài xuống hàng dưới */
  .np-head { flex-wrap: wrap; gap: 12px; }
  .np-disc { width: 88px; height: 88px; padding: 4px; }
  .np-quick { margin-left: auto; }
  .np-info { order: 3; flex-basis: 100%; }
  .np-title { font-size: 20px; }
}

/* Lời: dòng đang hát tô màu chuyển sắc, 2 đầu khung mờ dần */
.lyrics {
  position: relative;
  flex: 1; overflow-y: auto; padding: 30% 4px; margin-top: 8px; scroll-behavior: smooth;
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
.lyrics p {
  width: fit-content; max-width: 100%; margin: 0; padding: 9px 0; font: 600 21px/1.45 var(--font-round); color: rgba(31,61,54,.38);
  transition: color .3s, transform .3s, filter .3s; transform-origin: left center; cursor: pointer;
}
.lyrics p:hover { color: rgba(31,61,54,.7); }
.lyrics p.active {
  color: transparent; background: linear-gradient(90deg, var(--teal), var(--green) 70%, #9ad94a); -webkit-background-clip: text; background-clip: text;
  transform: scale(1.05); filter: drop-shadow(0 2px 8px rgba(255, 255, 255, .9));
}
.lyrics p.past { color: rgba(31,61,54,.55); }
.lyrics.static p { color: var(--ink); cursor: default; }
.lyrics .empty { width: auto; text-align: center; color: var(--ink-soft); font-style: italic; font-weight: 400; font-size: 15px; font-family: var(--font); cursor: default; }
.lyrics .empty.loading { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.lyrics-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; font-size: 11.5px; color: var(--ink-soft); }
.lyrics-foot[hidden] { display: none; }
.lf-src { color: inherit; opacity: .8; text-decoration: none; }
.lf-src:hover { color: var(--teal); opacity: 1; }
.lf-tune { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.lf-tune b { min-width: 42px; text-align: center; color: var(--teal); font-variant-numeric: tabular-nums; }
.lf-btn { border: 0; border-radius: 999px; padding: 3px 9px; background: var(--mint-soft); color: var(--teal); font-size: 11.5px; font-weight: 800; }
.lf-btn:hover { background: var(--green-soft); }

.player-bar { grid-area: bar; display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.player-bar .time { font-size: 12px; color: var(--ink-soft); min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.vol-icon { margin-left: 8px; }

/* ===== ANIME ===== */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-title { margin: 0; font: 700 18px var(--font-round); color: var(--teal); }
.section-sub { font-size: 12.5px; font-style: italic; color: var(--ink-soft); }

/* Ô số liệu */
.stat-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.stat-tile {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px;
  border-radius: 16px; background: var(--glass-strong); border: 1.5px solid var(--glass-border);
}
.st-icon { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; font-size: 19px; color: var(--teal); background: var(--green-soft); }
.stat-tile:nth-child(even) .st-icon { background: var(--mint-soft); }
.st-text { min-width: 0; }
.st-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-value { font: 700 22px/1.2 var(--font-round); color: var(--ink); }
.st-value small { font: 700 11.5px var(--font); color: var(--ink-soft); white-space: nowrap; }

/* Biểu đồ: một màu (xanh ngọc), thanh mảnh, đầu bo 4px */
.charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; margin-top: 12px; }
.chart-box { display: flex; flex-direction: column; min-width: 0; padding: 14px 16px; border-radius: 16px; background: var(--glass-strong); border: 1.5px solid var(--glass-border); }
.chart-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; font-size: 13.5px; font-weight: 800; color: var(--ink); }
.chart-hint { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.genre-chart { display: flex; flex-direction: column; gap: 2px; }
.gbar {
  display: grid; grid-template-columns: 124px minmax(0, 1fr) 70px; align-items: center; gap: 10px;
  padding: 5px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 12.5px; color: var(--ink);
}
.gbar:hover, .gbar.on { background: var(--green-soft); }
.gname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtrack { display: block; height: 10px; }
.gfill { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--teal); transition: opacity .2s; }
.gval { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gval small { font-weight: 600; color: var(--ink-soft); }
.genre-chart.has-on .gbar:not(.on) .gfill, .year-chart.has-on .ycol:not(.on) .ybar { opacity: .3; }

.year-chart { position: relative; display: flex; gap: 2px; flex: 1; min-height: 176px; }
.year-chart::after { content: ""; position: absolute; left: 0; right: 0; bottom: 20px; height: 1px; background: rgba(31, 61, 54, .16); pointer-events: none; }
.ycol { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 6px; background: transparent; }
.ycol:hover, .ycol.on { background: var(--green-soft); }
.ybar-wrap { position: relative; flex: 1; }
.ybar { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(18px, 70%); border-radius: 4px 4px 0 0; background: var(--teal); transition: opacity .2s; }
.ycap { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--ink); }
.ytick { height: 20px; line-height: 22px; font-size: 10.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: visible; }

.format-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }
.fr-label { font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--teal); }
.fr-item b { color: var(--ink); }

.chart-tip {
  position: fixed; z-index: 70; pointer-events: none; padding: 6px 10px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: var(--shadow);
}

/* Spotlight: bộ recommend lớn ở đầu trang (ảnh nền phóng chậm, chữ trượt vào, hàng ảnh nhỏ có thanh chạy) */
.spotlight { position: relative; overflow: hidden; isolation: isolate; padding: 0; }
.spotlight[hidden] { display: none; }
.sp-bg { position: absolute; inset: 0; z-index: -2; background: center 28% / cover no-repeat; }
.sp-bg.poster-bg { inset: -40px; filter: blur(22px) saturate(1.35); }
.sp-bg.kb { animation: kenBurns 9s ease-out both; }
@keyframes kenBurns { from { transform: scale(1.14); opacity: .35; } 12% { opacity: 1; } to { transform: scale(1.02); opacity: 1; } }
.spotlight::before { /* phủ sáng bên trái để chữ dễ đọc */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .82) 36%, rgba(255, 255, 255, .25) 72%, rgba(255, 255, 255, .05) 100%),
    linear-gradient(0deg, rgba(255, 255, 255, .92) 0%, transparent 42%);
}
.sp-body { display: flex; align-items: center; gap: 28px; min-height: 250px; padding: 24px 70px 6px 64px; }
.sp-info { flex: 1; min-width: 0; }
.sp-info.in > * { animation: spIn .55s ease both; }
.sp-info.in > :nth-child(2) { animation-delay: .06s; } .sp-info.in > :nth-child(3) { animation-delay: .12s; }
.sp-info.in > :nth-child(4) { animation-delay: .18s; } .sp-info.in > :nth-child(5) { animation-delay: .24s; } .sp-info.in > :nth-child(n+6) { animation-delay: .3s; }
@keyframes spIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.sp-label { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: linear-gradient(135deg, var(--teal), var(--green)); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 4px 12px rgba(42, 138, 120, .3); }
.sp-label small { opacity: .85; }
.sp-title { margin: 10px 0 2px; font: 800 30px/1.15 var(--font-round); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-en { font-size: 14px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sp-meta span { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .78); border: 1px solid var(--mint); color: var(--teal); font-size: 12px; font-weight: 800; }
.sp-meta .sp-score { background: var(--yellow); border-color: transparent; color: #5c4a00; }
.sp-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.sp-genres span + span::before { content: "·"; margin-right: 6px; }
.sp-note { max-width: 62ch; margin: 10px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sp-actions a.btn { text-decoration: none; }
.sp-poster {
  flex-shrink: 0; width: 158px; aspect-ratio: 3 / 4.2; overflow: hidden; padding: 0; border-radius: 18px; cursor: pointer;
  border: 3px solid #fff; background: var(--mint-soft); box-shadow: 0 18px 40px rgba(20, 60, 110, .35);
  transform: rotate(3deg); transition: transform .35s ease, box-shadow .35s ease; animation: floaty 5s ease-in-out infinite;
}
.sp-poster:hover { transform: rotate(0) scale(1.04); box-shadow: 0 22px 46px rgba(20, 60, 110, .45); }
.sp-poster img { width: 100%; height: 100%; object-fit: cover; }
@keyframes floaty { 50% { translate: 0 -6px; } }
.sp-nav {
  position: absolute; top: 42%; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--glass-border); background: var(--glass-strong); color: var(--teal); font-size: 24px; line-height: 1; box-shadow: var(--shadow); transition: transform .2s, background .2s;
}
.sp-nav:hover { transform: scale(1.1); background: var(--green-soft); }
.sp-nav.prev { left: 14px; } .sp-nav.next { right: 14px; }
.sp-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 22px 14px; scrollbar-width: none; }
.sp-thumbs::-webkit-scrollbar { display: none; }
.sp-thumb {
  position: relative; flex-shrink: 0; width: 44px; aspect-ratio: 3 / 4.2; overflow: hidden; padding: 0; border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, .85); background: var(--mint-soft); opacity: .55; transition: opacity .25s, transform .25s, border-color .25s;
}
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7px; font-weight: 800; color: var(--teal); text-align: center; }
.sp-thumb:hover { opacity: .9; transform: translateY(-2px); }
.sp-thumb.active { opacity: 1; border-color: var(--green); transform: translateY(-3px); box-shadow: 0 6px 14px rgba(108, 201, 74, .35); }
.sp-prog { position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: var(--green); }
.sp-thumb.active .sp-prog { animation: spProg 7s linear forwards; }
.spotlight:hover .sp-prog, .page:not(.active) .sp-prog { animation-play-state: paused; }
@keyframes spProg { to { width: 100%; } }

/* Thanh lọc (dính ở trên khi cuộn danh sách) */
.list-card { padding: 16px; }
.filter-sticky {
  position: sticky; top: 0; z-index: 6; margin: -16px -16px 14px; padding: 14px 16px 4px; border-radius: var(--radius) var(--radius) 16px 16px;
  background: rgba(255, 255, 255, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1.5px dashed var(--mint);
}
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.search-box {
  flex: 1 1 200px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border-radius: 12px; background: #fff; border: 1.5px solid var(--mint); cursor: text;
}
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(108, 201, 74, .18); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.seg { order: 3; flex: 1 1 100%; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--mint-soft); border: 1.5px solid var(--glass-border); overflow-x: auto; }
.seg-btn { flex-shrink: 0; padding: 7px 11px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.seg-btn small { margin-left: 5px; font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.seg-btn:hover { background: rgba(255, 255, 255, .7); color: var(--teal); }
.seg-btn.active { background: #fff; color: var(--teal); box-shadow: 0 2px 8px rgba(42, 138, 120, .15); }
.seg-btn.active small { color: var(--teal); }
.sort-select { height: 40px; padding: 0 10px; border-radius: 12px; border: 1.5px solid var(--mint); background: #fff; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.genre-scroller {
  overflow-x: auto; margin: 0 -4px 8px; padding: 2px 4px 8px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.genre-scroller .chips { flex-wrap: nowrap; margin: 0; padding-right: 24px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.active-filters:empty { display: none; }
.af-count { font-size: 13px; font-weight: 800; color: var(--teal); }
.af-chip { padding: 5px 11px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 12.5px; font-weight: 700; }
.af-chip:hover { background: #ffd21f; }
.af-clear { border: 0; background: none; color: var(--ink-soft); font-size: 12.5px; text-decoration: underline; }
/* Cuối lưới: đang tải thêm / hết */
.grid-loader { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 56px; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.grid-loader .spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--mint); border-top-color: var(--green); animation: spin .8s linear infinite; }
.grid-loader .end { color: var(--teal); letter-spacing: .5px; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips:last-child { margin-bottom: 0; }
.chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--mint); background: var(--glass-strong);
  font-weight: 700; font-size: 13px; color: var(--teal); white-space: nowrap; transition: .2s;
}
.chip:hover { background: var(--mint-soft); }
.chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip small { margin-left: 5px; font-size: 11px; font-weight: 800; }

/* Thẻ anime */
.anime-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 18px 16px; }
.a-card { min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; animation: cardIn .5s ease both; animation-delay: var(--d, 0ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.a-poster {
  position: relative; aspect-ratio: 3 / 4.2; border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, var(--mint-soft), var(--green-soft)); box-shadow: var(--shadow);
  border: 2px solid #fff; transition: transform .25s, box-shadow .25s;
}
.a-card:hover .a-poster, .a-card:focus-visible .a-poster { transform: translateY(-5px); box-shadow: 0 16px 32px rgba(25, 65, 115, .26); }
.a-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.a-card:hover .a-poster img { transform: scale(1.07); }
/* Rê chuột: thể loại + nút xem chi tiết trượt lên từ đáy poster */
.a-hover {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 40px 10px 10px;
  background: linear-gradient(transparent, rgba(8, 28, 36, .9)); color: #fff; opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .3s;
}
.a-card:hover .a-hover, .a-card:focus-visible .a-hover { opacity: 1; transform: none; }
.a-card:hover .badges-bottom { opacity: 0; }
.ah-genres { font-size: 11.5px; font-weight: 700; line-height: 1.45; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.ah-cta { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: var(--green); color: #fff; font-size: 11px; font-weight: 800; }
.a-poster .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font: 700 15px var(--font-round); color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.badges-top, .badges-bottom { position: absolute; z-index: 1; left: 6px; right: 6px; display: flex; justify-content: space-between; align-items: center; gap: 4px; pointer-events: none; transition: opacity .25s; }
.badges-top { top: 6px; }
.badges-bottom { bottom: 6px; }
.badge { padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.badge.hot { background: #ffe3c2; color: #8a3a00; }
.badge.award { background: var(--yellow); color: #5c4a00; }
.badge.score { background: rgba(255, 255, 255, .94); color: var(--ink); }
.badge.plan { background: #fff; color: var(--teal); }
.badge.rec { background: var(--teal); color: #fff; }
.a-title { margin-top: 8px; font-weight: 800; font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.a-en { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-meta { margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--teal); }
.empty-note { color: var(--ink-soft); font-style: italic; padding: 10px; }

/* ===== GAME ===== */
/* Nền riêng trang Game (chỉ hiện khi đang ở trang Game): ảnh game đang rê chuột phóng to làm mờ, lưới chạy, vạch quét */
.game-ambient { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
body.on-game .game-ambient { opacity: 1; }
.gam-art {
  position: absolute; inset: -60px; background: center / cover no-repeat; filter: blur(34px) saturate(1.35);
  opacity: 0; transform: scale(1.08); transition: opacity 1s ease, transform 6s ease;
}
.gam-art.on { opacity: .42; transform: scale(1); }
.gam-grid { /* lưới pastel chạy chậm như sàn màn hình game */
  position: absolute; inset: 0; opacity: .5; animation: gridRun 14s linear infinite;
  background-image: linear-gradient(rgba(42, 138, 120, .1) 1px, transparent 1px), linear-gradient(90deg, rgba(42, 138, 120, .1) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 60%, #000 30%, transparent 78%); mask-image: radial-gradient(ellipse at 50% 60%, #000 30%, transparent 78%);
}
@keyframes gridRun { to { background-position: 0 44px, 44px 0; } }
.gam-scan { position: absolute; inset: 0; opacity: 0; }
html[data-theme="dark"] .gam-art.on { opacity: .5; }
html[data-theme="dark"] .gam-grid { /* theme tối: lưới neon xanh tím */
  opacity: .75;
  background-image: linear-gradient(rgba(92, 200, 245, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(157, 140, 255, .14) 1px, transparent 1px);
}
html[data-theme="dark"] .gam-scan { /* vạch quét mờ như màn hình CRT */
  opacity: .35; background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 4px);
}
/* Ảnh game dùng chung: ảnh bìa lấp đầy, logo thì hiện trọn trên nền màu */
.ga-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ga-img.contain { object-fit: contain; padding: 12px 18px; }
.ga-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font: 800 17px var(--font-round); letter-spacing: 1.5px; text-transform: uppercase; color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
/* Vệt sáng quét qua khi rê chuột */
.gt-art::after, .gr-art::after, .a-poster::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform .75s ease;
}
.gt-card:hover .gt-art::after, .gr-card:hover .gr-art::after, .a-card:hover .a-poster::after { transform: translateX(130%); }
/* Thẻ nghiêng theo chuột (JS đặt --rx / --ry) */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s ease, box-shadow .3s ease; }
.tilt:hover { transition: transform .12s ease-out, box-shadow .3s ease; }

/* Thẻ người chơi: khung kiểu HUD game (lưới mờ + 4 góc ngắm), avatar có level, thanh EXP */
.player-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; padding: 20px 24px; }
.player-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(42, 138, 120, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(42, 138, 120, .08) 1px, transparent 1px);
  background-size: 22px 22px; -webkit-mask-image: linear-gradient(90deg, #000, transparent 75%); mask-image: linear-gradient(90deg, #000, transparent 75%);
}
.player-card::after {
  --c: var(--green); content: ""; position: absolute; inset: 9px; border-radius: 14px; pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / 20px 3px no-repeat, linear-gradient(var(--c), var(--c)) top left / 3px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 20px 3px no-repeat, linear-gradient(var(--c), var(--c)) top right / 3px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 20px 3px no-repeat, linear-gradient(var(--c), var(--c)) bottom left / 3px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 20px 3px no-repeat, linear-gradient(var(--c), var(--c)) bottom right / 3px 20px no-repeat;
}
.pc-avatar { position: relative; z-index: 1; flex-shrink: 0; width: 88px; height: 88px; padding: 4px; border-radius: 24px; background: conic-gradient(from 30deg, var(--green), var(--yellow), #8fd3ff, var(--green)); box-shadow: var(--shadow); }
.pc-avatar img { width: 100%; height: 100%; border-radius: 20px; object-fit: cover; background: #fff; }
.pc-lv {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--ink); color: var(--yellow); border: 2px solid #fff; font: 800 12px var(--font-round); letter-spacing: .5px;
}
.pc-main { position: relative; z-index: 1; flex: 1; min-width: 0; }
.pc-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 800 24px/1.2 var(--font-round); color: var(--ink); }
.pc-tag { padding: 2px 9px; border-radius: 999px; background: var(--green-soft); color: var(--teal); font: 800 11px var(--font); }
.pc-intro { margin: 4px 0 10px; font-style: italic; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.pc-exp { display: flex; align-items: center; gap: 10px; max-width: 380px; font: 800 11.5px var(--font-round); color: var(--teal); cursor: help; }
.pc-exp-bar { flex: 1; height: 10px; overflow: hidden; border-radius: 999px; background: var(--mint-soft); border: 1.5px solid var(--glass-border); }
.pc-exp-bar i { position: relative; display: block; height: 100%; overflow: hidden; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--yellow)); }
.pc-exp-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: shimmer 2.6s ease-in-out infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.pc-side { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.pc-side .page-tools .qc-btn { height: 36px; }
/* Danh hiệu dưới thanh EXP: huy hiệu nhỏ hiện lần lượt */
.pc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pc-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border-radius: 8px; font-size: 11.5px; font-weight: 800; color: var(--teal);
  background: linear-gradient(135deg, rgba(255, 255, 255, .9), var(--green-soft)); border: 1.5px solid var(--mint);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); /* góc vát kiểu huy hiệu game */
  animation: badgeIn .5s ease both; animation-delay: var(--d, 0ms);
}
.pc-badge em { font-style: normal; }
@keyframes badgeIn { from { opacity: 0; transform: translateY(6px) scale(.9); } }
.pc-stats { display: flex; gap: 8px; }
.pc-stats div { min-width: 76px; padding: 8px 10px; border-radius: 14px; text-align: center; background: var(--glass-strong); border: 1.5px solid var(--glass-border); }
.pc-stats b { display: block; font: 800 22px/1.1 var(--font-round); color: var(--teal); }
.pc-stats span { font-size: 11px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.pc-steam {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 14px; text-decoration: none;
  background: linear-gradient(135deg, #171a21, #2a475e); color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 16px rgba(23, 26, 33, .35); transition: transform .2s, box-shadow .2s;
}
.pc-steam:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(42, 71, 94, .5); }
.pc-steam .si { width: 20px; height: 20px; background: currentColor; }

/* Tiêu đề mỗi mục */
.game-sec { padding: 16px 18px 18px; }
.g-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.g-sec-head::after { /* vạch đứt chạy như đèn LED */
  content: ""; order: 1; flex: 1; min-width: 20px; height: 2px; animation: dashRun 1.6s linear infinite;
  background: repeating-linear-gradient(90deg, var(--mint) 0 8px, transparent 8px 14px); background-size: 14px 2px;
}
@keyframes dashRun { to { background-position: 14px 0; } }
.g-sec-head h2 { margin: 0; font: 800 18px var(--font-round); color: var(--teal); white-space: nowrap; letter-spacing: .4px; text-transform: uppercase; }
.g-sec-head small { padding: 2px 9px; border-radius: 999px; background: var(--mint-soft); color: var(--teal); font-size: 12px; font-weight: 800; }
/* Icon mục trong khung hình thoi xoay chậm, rê vào tiêu đề thì chữ nhiễu nhẹ như màn hình game */
.gs-icon { position: relative; width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; color: var(--teal); font-size: 18px; }
.gs-icon::before {
  content: ""; position: absolute; inset: 4px; border-radius: 7px; transform: rotate(45deg); z-index: -1;
  background: var(--green-soft); border: 1.5px solid var(--mint); transition: transform .5s ease;
}
.game-sec:hover .gs-icon::before { transform: rotate(225deg); }
.game-sec:hover .gs-title { animation: glitch .45s steps(2) 1; }
@keyframes glitch {
  0% { text-shadow: 2px 0 rgba(255, 0, 110, .55), -2px 0 rgba(0, 200, 255, .55); transform: translateX(1px); }
  50% { text-shadow: -2px 0 rgba(255, 0, 110, .55), 2px 0 rgba(0, 200, 255, .55); transform: translateX(-1px); }
  100% { text-shadow: none; transform: none; }
}
.gs-hint { order: 2; font-size: 12px; font-style: italic; color: var(--ink-soft); }

/* Đang chơi: thẻ lớn, bấm để copy ID */
.play-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 16px; }
.gp-card {
  position: relative; overflow: hidden; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; text-align: left; cursor: copy;
  border-radius: 20px; border: 2px solid rgba(255, 255, 255, .9); background: #0c1a2a; box-shadow: var(--shadow);
}
.gp-card:hover { box-shadow: 0 18px 36px rgba(25, 65, 115, .3); }
.gp-art { position: absolute; inset: 0; }
.gp-art .ga-img.contain { padding: 34px 44px 74px; } /* logo nằm phần trên, chừa chỗ cho tên + ID */
.gp-card:hover .ga-img { transform: scale(1.06); }
.gp-card::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(5, 15, 30, .15) 0%, transparent 35%, rgba(5, 15, 30, .88) 100%); }
.gp-card::after { /* đốm sáng chạy theo chuột */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .3), transparent 45%);
}
.gp-card:hover::after { opacity: 1; }
.gp-live, .gp-server {
  position: absolute; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: rgba(5, 15, 30, .6); color: #fff; font-size: 11px; font-weight: 800; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.gp-live { left: 10px; }
.gp-server { right: 10px; }
.gp-live i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; animation: livePulse 1.6s ease-out infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .7); } 70%, 100% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); } }
.gp-info { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; color: #fff; }
.gp-name { font: 800 18px/1.2 var(--font-round); text-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.gp-id {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 7px; padding: 4px 5px 4px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 13px; transition: background .2s;
}
.gp-card:hover .gp-id { background: rgba(255, 255, 255, .28); }
.gp-label { font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; opacity: .85; }
.gp-id b { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .6px; }
.gp-copy { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--green); color: #fff; font-size: 14px; transition: .2s; }
.gp-card.copied { animation: copiedFlash .6s ease; }
.gp-card.copied .gp-copy { background: var(--yellow); color: var(--ink); }
.gp-card.copied .gp-copy .ico { --ico: url(https://cdn.jsdelivr.net/npm/@tabler/icons@3.48.0/icons/outline/check.svg) !important; }
/* "+1 EXP" bay lên khi copy ID */
.exp-pop {
  position: absolute; left: 50%; top: 42%; z-index: 5; display: inline-flex; align-items: center; gap: 5px; pointer-events: none;
  font: 800 16px var(--font-round); color: var(--yellow); text-shadow: 0 2px 6px rgba(0, 0, 0, .6); animation: expUp 1.1s ease-out forwards;
}
@keyframes expUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }
@keyframes copiedFlash { 40% { box-shadow: 0 0 0 4px var(--yellow), 0 0 28px rgba(255, 225, 77, .7); } }

/* Recommend: ảnh bìa + dải "Recommend" */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 16px; }
.gr-card { padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.gr-art { position: relative; overflow: hidden; aspect-ratio: 460 / 215; border-radius: 16px; border: 2px solid #fff; background: var(--mint-soft); box-shadow: var(--shadow); transition: box-shadow .3s; }
.gr-card:hover .gr-art { box-shadow: 0 16px 32px rgba(25, 65, 115, .28); }
.gr-card:hover .ga-img { transform: scale(1.07); }
.gr-ribbon {
  position: absolute; top: 9px; left: 0; z-index: 2; padding: 3px 11px 3px 9px; border-radius: 0 999px 999px 0;
  background: linear-gradient(135deg, #ffd84d, #ff9f43); color: #4a2c00; font-size: 11px; font-weight: 800; box-shadow: 0 3px 8px rgba(0, 0, 0, .22);
}
.gr-name { margin-top: 8px; font-weight: 800; font-size: 14px; }

/* Đã chơi qua: lưới ảnh header Steam */
.played-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px 12px; }
.gt-card { min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; animation: cardIn .45s ease both; animation-delay: var(--d, 0ms); }
.gt-art {
  position: relative; overflow: hidden; aspect-ratio: 460 / 215; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .9);
  background: var(--mint-soft); box-shadow: 0 4px 12px rgba(25, 65, 115, .12); transition: transform .25s, box-shadow .25s;
}
.gt-card:hover .gt-art { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(25, 65, 115, .22); }
.gt-card:hover .ga-img { transform: scale(1.06); }
.gt-name { margin-top: 6px; font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Nút ▶ hiện giữa ảnh khi rê chuột, giống thư viện game */
.gt-play {
  position: absolute; left: 50%; top: 50%; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(8, 20, 36, .6); color: #fff; font-size: 20px; border: 1.5px solid rgba(255, 255, 255, .7); backdrop-filter: blur(4px);
  opacity: 0; transform: translate(-50%, -50%) scale(.6); transition: opacity .25s, transform .25s;
}
.gt-card:hover .gt-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.gt-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(8, 20, 36, 0); transition: background .25s; }
.gt-card:hover .gt-art::before { background: rgba(8, 20, 36, .25); }
.gt-card:hover .gt-name { color: var(--teal); }
.gm-art { position: relative; overflow: hidden; aspect-ratio: 460 / 215; margin: -4px 0 14px; border-radius: 16px; background: var(--mint-soft); }
.uid {
  margin: 4px 0 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--green-soft); color: var(--teal); font-size: 13px; font-weight: 800; border: 0;
}
.uid:hover { background: var(--yellow); color: var(--ink); }
.more { font-size: 11px; font-weight: 800; color: var(--teal); background: var(--mint-soft); padding: 2px 10px; border-radius: 999px; border: 0; }
.more:hover { background: var(--mint); }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(20, 60, 45, .25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-box {
  position: relative; width: min(560px, 100%); max-height: min(86vh, 760px); overflow-y: auto;
  background: rgba(255,255,255,.9); border: 2px solid var(--mint); border-radius: 26px; padding: 26px;
  box-shadow: 0 30px 80px rgba(20,60,45,.3); animation: pop .3s ease;
}
.modal-box.wide { width: min(880px, 100%); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--mint-soft); color: var(--teal); font-size: 15px; z-index: 2; }
.modal-close:hover { background: var(--mint); }
.modal h2 { margin: 0 0 6px; font: 700 24px var(--font-round); color: var(--teal); }
.modal p.sub { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }

.detail { display: flex; gap: 20px; }
.detail .a-poster { width: 170px; flex-shrink: 0; align-self: flex-start; }
.detail-body { flex: 1; min-width: 0; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--mint-soft); color: var(--teal); font-size: 12px; font-weight: 700; }
.tag.green { background: var(--green-soft); color: #2f6b18; }
.tag.hot { background: #ffe3c2; color: #8a3a00; }
.tag.gold { background: #fff6c2; color: #5c4a00; }
.tag.soft { background: #fff; border: 1px solid var(--mint); color: var(--ink); }
.award-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.award-list .section-label { margin-bottom: 2px; }
.award-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #fffbe6; border: 1px solid #ffe98a; }
.award-item b { display: block; font-size: 13.5px; color: var(--ink); }
.award-item small { font-size: 12.5px; color: var(--ink-soft); }
.aw-ic { font-size: 20px; }
.detail .note { white-space: pre-line; line-height: 1.65; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.set-search { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.set-search input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--mint); font: inherit; font-size: 14px; outline: none; }
.set-search input:focus { border-color: var(--green); }

/* form */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label, .lbl { font-size: 12px; font-weight: 800; color: var(--teal); letter-spacing: .3px; }
.field input, .field textarea, .field select, .row-edit input, .row-edit select, .row-edit textarea {
  font: inherit; font-size: 14px; color: var(--ink); padding: 9px 12px; border-radius: 12px;
  border: 1.5px solid var(--mint); background: #fff; outline: none; width: 100%;
}
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .row-edit input:focus, .row-edit select:focus, .row-edit textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(108,201,74,.18); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  padding: 10px 20px; border-radius: 14px; border: 0; font-weight: 800; font-size: 14px;
  background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(108,201,74,.35); transition: .2s;
}
.btn:hover { background: var(--green-light); }
.btn.ghost { background: var(--mint-soft); color: var(--teal); box-shadow: none; }
.btn.ghost:hover { background: var(--mint); }
.btn.danger { background: #fde8e8; color: #c0392b; box-shadow: none; }
.err { color: #c0392b; font-size: 13px; font-weight: 700; min-height: 18px; margin: 6px 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }

.set-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.set-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed var(--mint); position: sticky; bottom: -26px; background: rgba(255,255,255,.95); padding-bottom: 14px; }
.row-edit {
  position: relative; display: grid; gap: 8px; padding: 12px; padding-right: 48px; border-radius: 16px; margin-bottom: 10px;
  background: var(--mint-soft); border: 1.5px solid var(--glass-border);
}
.row-edit .cols { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.row-edit .cols > div { display: flex; flex-direction: column; justify-content: flex-end; } /* nhãn dài ngắn khác nhau thì ô nhập vẫn thẳng hàng */
.row-edit .del { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fde8e8; color: #c0392b; }
.row-edit textarea { min-height: 70px; resize: vertical; }
.row-edit .mini-lbl { font-size: 11px; font-weight: 800; color: var(--teal); display: block; margin-bottom: 3px; }
/* Cài đặt → Nhạc: 1 hàng = 1 mục (biểu tượng | tên VI | tên EN | số bài | ↑ | ✕) */
.cat-row { display: grid; grid-template-columns: 52px repeat(4, minmax(0, 1fr)) auto 30px 30px; gap: 8px; align-items: center; }
.cat-row .cat-icon { text-align: center; font-size: 18px; padding-left: 4px; padding-right: 4px; }
.cat-count { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.cat-row .more { height: 28px; padding: 0; }
.more.danger { background: #fde8e8; color: #c0392b; }
@media (max-width: 560px) { .cat-row { grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr); } .cat-count { display: none; } }
.hint { font-size: 12.5px; color: var(--ink-soft); margin: -4px 0 12px; line-height: 1.5; }
.hint code { background: var(--mint-soft); padding: 1px 6px; border-radius: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px);
  padding: 10px 20px; border-radius: 999px; background: var(--teal); color: #fff; font-weight: 700; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

#yt-wrap { position: fixed; width: 1px; height: 1px; left: -10px; top: -10px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 116px minmax(0, 1fr) minmax(0, 1fr) 190px; }
  .clock { font-size: 24px; }
  .weather-city { display: none; }
  .site-name { font-size: 18px; }
  .name-card { row-gap: 6px; }
  .name-row { flex: 1 0 auto; } /* không đủ chỗ thì nút trạng thái xuống dòng, tên không bị cắt */
  .status-pill { padding: 5px 10px; font-size: 13px; gap: 6px; }
  .seam-text { font-size: 11.5px; line-height: 1.55; letter-spacing: 1px; }
  .banner-seam { padding: 8px 5px; }
  .stat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .social-card { padding: 10px; }
  body::before { background-position: center 25%; }
  .name-row { flex-wrap: wrap; row-gap: 2px; }
  .aka { white-space: normal; }
  html, body { height: auto; min-height: 100%; }
  .app { display: block; padding: 12px 12px 96px; min-height: 100vh; }
  .shell { height: auto; min-height: calc(100vh - 110px); padding: 12px; border-radius: 26px; }
  .page { position: static; display: none; opacity: 1; visibility: visible; transform: none; }
  .page:not(.active) { display: none !important; }
  .page.active { display: flex; flex-direction: column; gap: 12px; animation: pop .35s ease; }
  .page.scroll { overflow: visible; padding-right: 0; }
  .home-grid, .music-grid { display: flex; flex-direction: column; gap: 12px; height: auto; }
  .avatar-card { width: 120px; height: 120px; margin: 0 auto; }
  .banner-card { height: 230px; }
  .banner-sub { bottom: 8%; width: 92%; }
  .bs-line { font-size: 13.5px; }
  .banner-half.left img, .banner-half.right img { object-position: 50% 30%; }
  .seam-text { font-size: 10.5px; line-height: 1.5; letter-spacing: .5px; }
  .banner-seam { padding: 6px 4px; }
  .clock-card { flex-wrap: wrap; justify-content: center; }
  .weather { border-left: 0; padding-left: 0; }
  .clock { font-size: 34px; }
  .weather-city { display: block; }
  .intro-text { overflow: visible; }
  .gacha-card { justify-content: center; gap: 24px; }
  .music-side { display: contents; }
  .playlist-card { max-height: 460px; }
  .now-playing { min-height: 440px; padding: 16px 16px 12px; }
  .np-title { font-size: 20px; }
  .lyrics p { font-size: 18px; }
  .player-bar { flex-wrap: wrap; justify-content: center; }
  .player-bar #seek { flex-basis: 60%; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-value { font-size: 19px; }
  .st-label { white-space: normal; line-height: 1.25; }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .gbar { grid-template-columns: 100px minmax(0, 1fr) 62px; gap: 8px; }
  .year-chart .ytick { font-size: 9.5px; }
  .filter-bar > .search-box, .filter-bar > .sort-select { flex: 1 1 100%; }
  .anime-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px 12px; }
  /* Spotlight: bỏ nút mũi tên (vuốt hàng ảnh nhỏ), poster nhỏ lại */
  .sp-body { gap: 14px; min-height: 0; padding: 18px 16px 4px; }
  .sp-nav { display: none; }
  .sp-poster { width: 96px; border-width: 2px; border-radius: 14px; align-self: flex-start; margin-top: 30px; }
  .sp-title { font-size: 21px; }
  .sp-note { display: none; }
  .sp-thumbs { padding: 8px 14px 12px; }
  .sp-actions .btn { padding: 9px 16px; }
  .spotlight::before { background: linear-gradient(90deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .75)), linear-gradient(0deg, rgba(255, 255, 255, .9), transparent 50%); }
  /* Thẻ người chơi: xếp dọc */
  .player-card { flex-wrap: wrap; gap: 16px; padding: 18px 16px; }
  .pc-avatar { width: 68px; height: 68px; align-self: flex-start; }
  .pc-main { flex: 1 1 190px; }
  .pc-name { font-size: 20px; }
  .pc-side { flex-basis: 100%; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .pc-side .page-tools .qc-label { display: none; } /* điện thoại: 2 nút chỉ còn icon */
  .pc-side .page-tools .qc-btn { width: 40px; padding: 0; gap: 2px; justify-content: center; }
  .pc-stats { flex: 1 1 100%; order: 3; }
  .pc-stats div { flex: 1; min-width: 0; padding: 8px 4px; }
  .pc-stats span { white-space: normal; font-size: 10.5px; }
  .pc-steam { margin-left: auto; }
  .gs-hint { display: none; }
  .played-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .detail { flex-direction: column; align-items: center; }
  .two { grid-template-columns: 1fr; }

  .side-nav {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; flex-direction: row; margin: 0; max-height: none;
  }
  .side-nav { gap: 8px; }
  .sound-hint { bottom: 80px; max-width: calc(100% - 32px); white-space: normal; text-align: center; }
  .nav-group { flex-direction: row; flex: 1; justify-content: space-around; gap: 2px; padding: 5px; }
  .nav-group.lang { flex: 0 0 auto; }
  .nav-group a, .nav-group button { width: 34px; height: 34px; font-size: 16px; }
  /* Chọn tiếng: 1 nút tiếng đang chọn, bấm thì 3 tiếng còn lại bung lên thành cột phía trên */
  .nav-group.lang { position: relative; padding: 5px; }
  .nav-group.lang button:not(.active) {
    display: none; position: absolute; right: 5px; bottom: calc(100% + 8px + var(--i, 0) * 42px);
    background: var(--glass-strong); border: 1.5px solid var(--glass-border); box-shadow: var(--shadow);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .nav-group.lang.open button:not(.active) { display: grid; animation: pop .2s ease both; }
  .nav-group.lang button.active::after { /* mũi tên nhỏ báo là bấm được */
    content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.5 6l2.5-2.5L7.5 6' fill='none' stroke='%231f3d36' stroke-width='1.6'/%3E%3C/svg%3E") center / 10px no-repeat;
  }
  .nav-group.lang button { font-size: 12px; }
  .nav-group em { display: none; }
}

/* ================= THEME TỐI (đêm cực quang) ================= */
body::after { /* ảnh nền tối, chồng lên ảnh sáng và hiện dần khi đổi theme */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: url("../assets/dark/bg-night.jpg") center 50% / cover no-repeat;
  filter: saturate(1.08) contrast(1.05);
  opacity: 0; transition: opacity .8s ease;
}
html[data-theme="dark"] body::after { opacity: 1; }
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .7s ease, border-color .7s ease, color .7s ease, box-shadow .7s ease, opacity .8s ease !important;
}

html[data-theme="dark"] {
  --green: #5cc8f5;                      /* màu nhấn: xanh cực quang */
  --green-light: #8adcff;
  --green-soft: rgba(92, 200, 245, 0.16);
  --teal: #a5e4ff;                       /* tiêu đề, biểu đồ */
  --mint: rgba(170, 185, 255, 0.34);     /* viền: xanh bạc pha lavender */
  --mint-soft: rgba(150, 165, 255, 0.14);
  --yellow: #ffe28a;                     /* vàng ánh sao */
  --yellow-deep: #f2c14e;
  --ink: #e9f0ff;
  --ink-soft: #a8b6d9;
  --glass: rgba(14, 22, 54, 0.58);
  --glass-strong: rgba(24, 34, 78, 0.72);
  --glass-border: rgba(185, 200, 255, 0.28);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --on-accent: #06243a;                  /* chữ đặt trên nền màu nhấn */
}
html[data-theme="dark"] body { background: #0b1330; }

/* Khung + ô: viền bạc phát sáng như cực quang */
html[data-theme="dark"] .shell {
  background: rgba(8, 14, 40, 0.24);
  border-color: rgba(190, 205, 255, 0.5);
  box-shadow: 0 0 0 5px rgba(140, 160, 255, 0.12), 0 0 46px rgba(100, 190, 255, 0.28), 0 0 110px rgba(160, 120, 255, 0.16), 0 20px 60px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .card { box-shadow: var(--shadow), inset 0 0 0 1px rgba(170, 190, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .banner-card { background: #0c1434; }
/* Dải băng theme tối: kính xanh đêm hơi trong, 2 đầu xanh / tím, viền sáng như cực quang, sao nhỏ lấp lánh, chữ bạc phát sáng */
html[data-theme="dark"] .banner-seam {
  background: linear-gradient(180deg, #3f63d8 0 6px, rgba(9, 20, 54, .84) 6px calc(100% - 6px), #7a5fe0 calc(100% - 6px));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: -1px 0 0 rgba(165, 228, 255, .5), 1px 0 0 rgba(165, 228, 255, .5), -5px 0 18px rgba(92, 200, 245, .35), 5px 0 18px rgba(92, 200, 245, .35);
}
html[data-theme="dark"] .banner-seam::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; animation: seamTwinkle 3.2s ease-in-out infinite;
  background: radial-gradient(1.6px 1.6px at 28% 16%, #fff, transparent), radial-gradient(1.4px 1.4px at 74% 38%, #bfe9ff, transparent),
    radial-gradient(1.2px 1.2px at 36% 64%, #fff, transparent), radial-gradient(1.5px 1.5px at 68% 86%, #d9ccff, transparent);
}
@keyframes seamTwinkle { 50% { opacity: .35; } }
html[data-theme="dark"] .banner-seam::after { background: linear-gradient(180deg, transparent, rgba(140, 210, 255, .32), transparent); }
html[data-theme="dark"] .seam-text { color: #e3f3ff; text-shadow: 0 0 8px rgba(120, 200, 255, .75); }
html[data-theme="dark"] .seam-hint { color: #a5e4ff; }
html[data-theme="dark"] .seam-btn:hover { filter: brightness(1.15); }
html[data-theme="dark"] .bs-line { color: #e6f4ff; text-shadow: 0 0 10px rgba(92, 200, 245, .85), 0 0 24px rgba(92, 200, 245, .45), 0 1px 3px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .a-poster { border-color: rgba(200, 215, 255, 0.35); }

/* Chữ trên nền màu nhấn (xanh cực quang sáng) phải là màu tối */
html[data-theme="dark"] .nav-group a.active, html[data-theme="dark"] .nav-group button.active,
html[data-theme="dark"] .round-btn.play, html[data-theme="dark"] .btn:not(.ghost):not(.danger),
html[data-theme="dark"] .social:hover, html[data-theme="dark"] .toast, html[data-theme="dark"] .badge.rec { color: var(--on-accent); }
html[data-theme="dark"] .nav-group a.active, html[data-theme="dark"] .nav-group button.active { box-shadow: 0 4px 14px rgba(92, 200, 245, .45); }
html[data-theme="dark"] .chip.active { background: var(--green); border-color: var(--green); color: var(--on-accent); }
html[data-theme="dark"] .btn:not(.ghost):not(.danger) { box-shadow: 0 4px 14px rgba(92, 200, 245, .3); }
html[data-theme="dark"] .badge.rec { background: var(--green); }
html[data-theme="dark"] .round-btn.on, html[data-theme="dark"] .af-chip, html[data-theme="dark"] .uid:hover { color: #3a2f00; }
html[data-theme="dark"] .badge.plan { color: #1f5f8a; }
html[data-theme="dark"] .badge.score { color: #1a2440; }

/* Ô nhập liệu và các nền trắng */
html[data-theme="dark"] .search-box, html[data-theme="dark"] .sort-select, html[data-theme="dark"] .set-search input,
html[data-theme="dark"] .field input, html[data-theme="dark"] .field textarea, html[data-theme="dark"] .field select,
html[data-theme="dark"] .row-edit input, html[data-theme="dark"] .row-edit select, html[data-theme="dark"] .row-edit textarea {
  background: rgba(255, 255, 255, 0.06); color: var(--ink);
}
html[data-theme="dark"] select option { background: #16224a; color: var(--ink); }
html[data-theme="dark"] .seg-btn:hover { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .seg-btn.active { background: rgba(255, 255, 255, .14); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
html[data-theme="dark"] .song.active { background: rgba(92, 200, 245, .14); box-shadow: 0 4px 14px rgba(92, 200, 245, .18); }
html[data-theme="dark"] .tag.green { color: var(--teal); }
html[data-theme="dark"] .tag.soft { background: transparent; }
html[data-theme="dark"] .award-item { background: rgba(255, 226, 138, .08); border-color: rgba(255, 226, 138, .3); }
html[data-theme="dark"] .chibi-bubble { background: #16224a; color: var(--ink); }
html[data-theme="dark"] .err { color: #ff8a80; }

/* Nhạc, biểu đồ, thanh trượt */
html[data-theme="dark"] .lyrics p { color: rgba(233, 240, 255, .34); }
html[data-theme="dark"] .lyrics p:hover { color: rgba(233, 240, 255, .7); }
html[data-theme="dark"] .lyrics p.past { color: rgba(233, 240, 255, .55); }
html[data-theme="dark"] .lyrics p.active { /* ánh sáng cực quang: xanh băng → tím nhạt, phát sáng */
  color: transparent; background-image: linear-gradient(90deg, #a5e4ff, #7fd4ff 45%, #c9b8ff);
  filter: drop-shadow(0 0 10px rgba(92, 200, 245, .55));
}
html[data-theme="dark"] .lyrics.static p { color: var(--ink); }

@media (max-width: 560px) { .sp-poster { display: none; } } /* điện thoại nhỏ: nhường chỗ cho chữ, poster đã có ở hàng ảnh nhỏ */

/* Trang Anime theme tối: spotlight phủ màu đêm, thẻ phát sáng xanh băng khi rê chuột */
html[data-theme="dark"] .spotlight::before {
  background: linear-gradient(90deg, rgba(10, 16, 44, .95) 0%, rgba(10, 16, 44, .82) 36%, rgba(10, 16, 44, .3) 72%, rgba(10, 16, 44, .08) 100%),
    linear-gradient(0deg, rgba(10, 16, 44, .92) 0%, transparent 42%);
}
html[data-theme="dark"] .sp-title { text-shadow: 0 0 18px rgba(92, 200, 245, .45); }
html[data-theme="dark"] .sp-label { background: linear-gradient(135deg, var(--green), #9d8cff); color: var(--on-accent); box-shadow: 0 4px 14px rgba(92, 200, 245, .35); }
html[data-theme="dark"] .sp-meta span { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .sp-meta .sp-score { background: var(--yellow); color: #3a2f00; }
html[data-theme="dark"] .sp-poster { border-color: rgba(200, 215, 255, .6); box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 0 26px rgba(92, 200, 245, .3); }
html[data-theme="dark"] .sp-thumb { border-color: rgba(200, 215, 255, .35); }
html[data-theme="dark"] .sp-thumb.active { border-color: var(--green); box-shadow: 0 0 14px rgba(92, 200, 245, .55); }
html[data-theme="dark"] .filter-sticky { background: rgba(16, 24, 60, .82); }
html[data-theme="dark"] .a-card:hover .a-poster { box-shadow: 0 16px 32px rgba(0, 0, 0, .45), 0 0 0 2px rgba(92, 200, 245, .7), 0 0 26px rgba(92, 200, 245, .35); }
html[data-theme="dark"] .ah-cta { color: var(--on-accent); }
@media (max-width: 860px) {
  html[data-theme="dark"] .spotlight::before { background: linear-gradient(90deg, rgba(10, 16, 44, .95), rgba(10, 16, 44, .78)), linear-gradient(0deg, rgba(10, 16, 44, .9), transparent 50%); }
}

/* Trang Game theme tối: khung HUD neon, thẻ phát sáng */
html[data-theme="dark"] .pc-badge { background: linear-gradient(135deg, rgba(92, 200, 245, .16), rgba(157, 140, 255, .18)); border-color: rgba(165, 228, 255, .45); color: #bfe9ff; }
html[data-theme="dark"] .gs-icon::before { background: rgba(92, 200, 245, .14); border-color: rgba(165, 228, 255, .5); box-shadow: 0 0 12px rgba(92, 200, 245, .35); }
html[data-theme="dark"] .g-sec-head h2 { text-shadow: 0 0 12px rgba(92, 200, 245, .45); }
html[data-theme="dark"] .player-card::before { background-image: linear-gradient(rgba(92, 200, 245, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(92, 200, 245, .09) 1px, transparent 1px); }
html[data-theme="dark"] .player-card::after { --c: #5cc8f5; filter: drop-shadow(0 0 4px rgba(92, 200, 245, .8)); }
html[data-theme="dark"] .pc-avatar { background: conic-gradient(from 30deg, #5cc8f5, #9d8cff, #ffe28a, #5cc8f5); box-shadow: var(--shadow), 0 0 22px rgba(92, 200, 245, .35); }
html[data-theme="dark"] .pc-lv { background: #06102a; border-color: rgba(200, 215, 255, .6); box-shadow: 0 0 10px rgba(255, 226, 138, .35); }
html[data-theme="dark"] .pc-exp-bar i { background: linear-gradient(90deg, #5cc8f5, #9d8cff); box-shadow: 0 0 10px rgba(92, 200, 245, .6); }
html[data-theme="dark"] .gp-card { border-color: rgba(200, 215, 255, .4); }
html[data-theme="dark"] .gp-card:hover { box-shadow: 0 18px 36px rgba(0, 0, 0, .5), 0 0 0 2px rgba(92, 200, 245, .7), 0 0 30px rgba(92, 200, 245, .4); }
html[data-theme="dark"] .gp-copy { color: var(--on-accent); }
html[data-theme="dark"] .gr-art, html[data-theme="dark"] .gt-art { border-color: rgba(200, 215, 255, .3); }
html[data-theme="dark"] .gr-card:hover .gr-art, html[data-theme="dark"] .gt-card:hover .gt-art { box-shadow: 0 12px 26px rgba(0, 0, 0, .45), 0 0 0 2px rgba(92, 200, 245, .6), 0 0 22px rgba(92, 200, 245, .3); }
html[data-theme="dark"] .gt-card:hover .gt-name { color: var(--green); }

/* Trang Nhạc theme tối: đĩa + mục + nốt nhạc theo màu cực quang */
html[data-theme="dark"] .np-bg { opacity: .34; filter: blur(42px) saturate(1.3) brightness(.85); }
html[data-theme="dark"] .np-disc { background: conic-gradient(from 20deg, #5cc8f5, #9d8cff, #ffe28a, #5cc8f5); box-shadow: var(--shadow), 0 0 0 4px rgba(170, 190, 255, .25); }
html[data-theme="dark"] .np-disc::after { border-color: rgba(200, 215, 255, .6); }
html[data-theme="dark"] .now-playing.playing .np-disc { animation-name: discGlowDark; }
@keyframes discGlowDark {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 4px rgba(170, 190, 255, .25), 0 0 16px rgba(92, 200, 245, .4); }
  50% { box-shadow: var(--shadow), 0 0 0 4px rgba(170, 190, 255, .4), 0 0 36px rgba(157, 140, 255, .65); }
}
html[data-theme="dark"] .np-notes i { color: #8adcff; text-shadow: 0 0 8px rgba(92, 200, 245, .9); }
html[data-theme="dark"] .np-notes i:nth-child(2) { color: #c9b8ff; text-shadow: 0 0 8px rgba(157, 140, 255, .9); }
html[data-theme="dark"] .np-notes i:nth-child(3) { color: var(--yellow); text-shadow: 0 0 8px rgba(255, 226, 138, .9); }
html[data-theme="dark"] .mcat.active { background: linear-gradient(135deg, var(--green), #9d8cff); color: var(--on-accent); box-shadow: 0 4px 16px rgba(92, 200, 245, .4); }
html[data-theme="dark"] .mcat.active small { background: rgba(6, 36, 58, .18); }
html[data-theme="dark"] .pl-group { background: rgba(20, 30, 70, .9); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
html[data-theme="dark"] .year-chart::after { background: rgba(200, 215, 255, .2); }
html[data-theme="dark"] .chart-tip { background: #0c1434; color: var(--ink); border: 1px solid var(--mint); }
html[data-theme="dark"] input[type=range] { background: linear-gradient(to right, var(--green) var(--p, 0%), rgba(200, 215, 255, .18) var(--p, 0%)); }
html[data-theme="dark"] input[type=range].volume { background: linear-gradient(to right, var(--yellow-deep) var(--p, 60%), rgba(200, 215, 255, .18) var(--p, 60%)); }

/* Popup, màn hình chờ, thanh cuộn */
html[data-theme="dark"] .modal { background: rgba(2, 6, 20, .5); }
html[data-theme="dark"] .modal-box { background: rgba(14, 22, 54, .95); box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 40px rgba(100, 190, 255, .15); }
html[data-theme="dark"] .set-footer { background: rgba(14, 22, 54, .97); }
html[data-theme="dark"] #loader { background: rgba(6, 10, 30, .6); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(170, 190, 255, .35); }

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