/* Giao diện chung của trang chủ, trang tin và trang tài khoản Nghịch Mệnh Tu Tiên.
   Dựng bằng chính ảnh giao diện của game (home/assets/ui, tách bởi tools/brand/extract_ui.py): thanh tiêu đề tím, khung popup, tab, nút vàng/xanh. */
@font-face { font-family: "Brush"; src: url("/home/fonts/VujahdayScript.woff2") format("woff2"); font-display: swap; }
:root { --sky: #dfe6f6; --paper: #f4f0fa; --ink: #4a3a2a; --ink2: #7b6a58; --purple: #5b4b8f; --navy: #3d4c86; --navy2: #26305e; --line: #d6cde6;
  --gold: #b7792b; --gold2: #ffe08a; --green: #3d9b5a; --red: #c0412f;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font: 16px/1.6 var(--font); overflow-x: hidden;
  background: var(--sky) linear-gradient(180deg, #b9c6ea 0, #e6ebf7 520px, #f2eef7 1100px) no-repeat; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.brush { font-family: "Brush", var(--font); font-weight: 400; }
.gold-text { color: var(--purple); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 28px); }
[hidden] { display: none !important; }

/* ---------- thanh menu ---------- */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; min-height: 60px; padding: 6px clamp(12px, 3vw, 40px);
  background: linear-gradient(180deg, #5666a8, #3d4c86); border-bottom: 2px solid #98a8e0; box-shadow: 0 3px 10px rgba(38, 48, 94, .35); }
.nav .mark { display: flex; align-items: center; gap: 8px; font-size: 31px; line-height: 1; color: #fff; text-shadow: 0 2px 0 var(--navy2), 0 0 6px var(--navy2); white-space: nowrap; padding: 2px 4px 0 0; }
.seal { display: inline-grid; place-items: center; padding: 4px 8px; border-radius: 12px; background: radial-gradient(circle at 40% 35%, #e8412f, #a3150e);
  color: #fff; font: 700 11px/1.1 var(--font); letter-spacing: .3px; text-shadow: none; box-shadow: 0 0 0 1.5px #fff; white-space: nowrap; }
.nav .links { display: flex; align-items: center; gap: 2px; margin-left: 8px; min-width: 0; }
.nav .links a { padding: 8px 13px; border-radius: 4px; color: #e6ebff; font-weight: 600; font-size: 15.5px; white-space: nowrap; text-shadow: 0 1px 0 var(--navy2); }
.nav .links a:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.nav .links a.on { color: var(--gold2); box-shadow: 0 -3px 0 var(--gold2) inset; border-radius: 4px 4px 0 0; }
.nav .act { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav .acc { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 13px; border: 1px solid #aebaf0; border-radius: 16px; color: #fff; font-weight: 600; font-size: 14px; background: rgba(255, 255, 255, .1); }
.nav .acc:hover { background: rgba(255, 255, 255, .2); }
@media (max-width: 860px) {
  .nav { padding-bottom: 0; }
  .nav { gap: 6px 8px; }
  .nav .mark { font-size: 25px; }
  .nav .acc { max-width: 104px; padding: 4px 10px; font-size: 13px; }
  .nav .act { gap: 6px; }
  .nav .gbtn.sm { min-width: 0; padding: 0 2px; border-width: 0 18px; border-image-width: 0 18px; font-size: 13.5px; }
  .nav .links { order: 3; flex: 0 0 100%; margin: 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid rgba(255, 255, 255, .18); }
  .nav .links::-webkit-scrollbar { display: none; }
  .nav .links a { padding: 8px 11px; font-size: 14.5px; }
}

@media (max-width: 430px) { .nav .mark .seal { display: none; } }

/* ---------- nút vàng / xanh của game ---------- */
.gbtn, .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 140px; height: 50px; padding: 0 22px; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 700 15.5px var(--font); color: #6a3608; text-shadow: 0 1px 0 #ffe9b8; border: 0 solid transparent; border-width: 0 26px;
  border-image: url("/home/assets/ui/btn_gold.png") 0 40 fill / 0 26px stretch; background: none; }
.gbtn.blue, .btn-ghost { color: #fff; text-shadow: 0 1px 2px #2b4a8c; border-image-source: url("/home/assets/ui/btn_blue.png"); }
.gbtn:hover, .btn:hover { filter: brightness(1.07); } .gbtn:active, .btn:active { transform: translateY(1px); }
.gbtn.sm { min-width: 104px; height: 40px; font-size: 14px; border-width: 0 21px; border-image-width: 0 21px; padding: 0 12px; }
.gbtn.lg { min-width: 220px; height: 66px; font-size: 21px; border-width: 0 34px; border-image-width: 0 34px; }
.gbtn:focus-visible, .btn:focus-visible, .nav a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- dải tiêu đề + khung popup đầu tím (9-slice) ---------- */
.cc-title { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 86px 0 22px; margin: 0 0 14px; color: #fff; font-size: 22px; font-weight: 700; letter-spacing: .5px;
  text-shadow: 0 2px 0 var(--navy2), 0 0 6px var(--navy2); background: url("/home/assets/ui/titlebar.png") right center / auto 100% no-repeat, linear-gradient(90deg, #3d4c86, #4f5f9e); border-radius: 6px 0 0 6px; }
.cc-title h1, .cc-title h2 { margin: 0; font: inherit; }
.cc-title small { font-size: 13px; font-weight: 400; opacity: .85; text-shadow: none; }
.cc-title .more { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--gold2); text-shadow: 0 1px 0 var(--navy2); white-space: nowrap; }
.cc-title .more:hover { text-decoration: underline; }
.cc-panel { border: 34px solid transparent; border-width: 34px 22px 22px; border-image: url("/home/assets/ui/panel.png") 34 22 22 fill / 34px 22px 22px stretch; padding: 0 6px 6px; position: relative; min-width: 0; }
.cc-panel > h2, .cc-panel > .ph { position: absolute; top: -29px; left: 2px; margin: 0; font-size: 17px; font-weight: 700; color: var(--purple); text-shadow: 0 1px 0 #fff; }
@media (max-width: 520px) { .cc-title { height: 50px; font-size: 18px; padding-left: 14px; } .cc-title small { display: none; } .cc-panel { border-left-width: 14px; border-right-width: 14px; } }

/* ---------- trang tin: đầu trang + tab ---------- */
.banner { position: relative; padding-top: 26px; }
.banner .cc-title { margin-bottom: 12px; }
.banner .kicker { display: none; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a, .ntabs button { display: inline-flex; align-items: center; justify-content: center; height: 44px; min-width: 96px; padding: 0 6px; cursor: pointer; font: 600 15px var(--font); color: #2f3a66;
  border: 0 solid transparent; border-width: 0 13px; border-image: url("/home/assets/ui/tab_off.png") 20 18 fill / 0 13px stretch; background: none; white-space: nowrap; }
.tabs a.on, .ntabs button[aria-selected="true"] { color: #6a3d10; border-image-source: url("/home/assets/ui/tab_on.png"); }

/* thẻ bài */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 20px 0; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; background: #fff; border: 2px solid #c9c0e6; border-radius: 10px; overflow: hidden; box-shadow: 0 3px 0 #b9b0dc; transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: #8f80c8; }
.card .img { aspect-ratio: 1200 / 630; background: #cfd8ef center / cover; position: relative; }
.card .img .chip { position: absolute; left: 10px; top: 10px; }
.chip { display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: #fff; background: #5b6db3; white-space: nowrap; }
.chip.pin, .chip.c-su-kien { background: #d0503a; } .chip.c-huong-dan { background: #3d9b5a; } .chip.c-cap-nhat { background: #b7792b; }
.card .b { padding: 13px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 18px; line-height: 1.4; color: #3a2c1e; }
.card p { margin: 0; color: var(--ink2); font-size: 14.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: #8c7f9e; font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.35fr 1fr; }
.feature .img { aspect-ratio: auto; min-height: 300px; }
.feature .b { padding: 24px 26px; justify-content: center; }
.feature h3 { font-size: clamp(22px, 2.4vw, 28px); }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; } .feature .img { min-height: 190px; } .feature .b { padding: 14px 16px 16px; } }
.empty { text-align: center; color: var(--ink2); padding: 60px 0; }
.pager { display: flex; justify-content: center; gap: 8px; padding: 6px 0 50px; }
.pager a, .pager span { min-width: 40px; text-align: center; padding: 6px 12px; border: 2px solid #c9c0e6; border-radius: 6px; background: #fff; color: var(--purple); font-weight: 600; }
.pager span.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* bài viết */
.crumb { font-size: 14px; color: var(--ink2); padding-top: 22px; }
.crumb a { color: var(--purple); } .crumb a:hover { text-decoration: underline; }
.post { max-width: 860px; margin: 14px auto 40px; padding: 8px clamp(16px, 4vw, 40px) 30px; background: #fff; border: 2px solid #c9c0e6; border-radius: 12px; box-shadow: 0 3px 0 #b9b0dc; }
.post .crumb { padding-top: 14px; }
.post h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.25; margin: 12px 0 12px; color: #33264a; font-weight: 700; }
.post .meta { margin: 0 0 20px; }
.post .cover { width: 100%; border-radius: 8px; border: 2px solid #c9c0e6; margin-bottom: 22px; }
.post .lead { font-size: 18px; color: #5a4a3a; border-left: 4px solid #8f80c8; background: var(--paper); padding: 10px 16px; margin: 0 0 22px; border-radius: 0 6px 6px 0; }
.toc { border: 2px solid var(--line); background: var(--paper); border-radius: 8px; padding: 12px 18px; margin: 0 0 24px; font-size: 15.5px; }
.toc b { color: var(--purple); letter-spacing: 1px; } .toc ul { margin: 6px 0 0; padding: 0; list-style: none; } .toc li { padding: 2px 0; } .toc li::before { content: "◆ "; color: #8f80c8; font-size: 10px; } .toc li.l3 { margin-left: 20px; } .toc li.l3::before { content: "◇ "; }
.toc a:hover { color: var(--purple); text-decoration: underline; }
.content { font-size: 17px; line-height: 1.75; }
.content h2 { font-size: 25px; color: var(--navy); margin: 34px 0 12px; line-height: 1.3; scroll-margin-top: 110px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.content h3 { font-size: 21px; color: #33264a; margin: 26px 0 10px; scroll-margin-top: 110px; }
.content h4 { font-size: 18px; color: #33264a; margin: 22px 0 8px; }
.content p { margin: 0 0 16px; }
.content a { color: #3f55b5; border-bottom: 1px solid rgba(63, 85, 181, .4); }
.content img { margin: 20px auto; border-radius: 8px; border: 2px solid var(--line); height: auto; }
.content ul, .content ol { padding-left: 24px; margin: 0 0 16px; } .content li { margin: 4px 0; }
.content blockquote { margin: 20px 0; padding: 12px 18px; border-left: 4px solid #d0503a; background: #fdf1ec; color: #5a4a3a; border-radius: 0 6px 6px 0; }
.content code { background: #ece8f6; padding: 1px 6px; border-radius: 3px; font-size: .9em; }
.content hr { border: 0; height: 42px; background: url("/home/assets/ui/divider.png") center / contain no-repeat; margin: 26px 0; opacity: .8; }
.content .video { position: relative; aspect-ratio: 16 / 9; margin: 20px 0; } .content .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.content .cta-line { text-align: center; margin: 24px 0; } .content .cta-line a { border-bottom: 0 solid transparent; color: #6a3608; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-top: 2px dashed var(--line); padding-top: 18px; margin-top: 26px; }
.share span { color: var(--ink2); font-size: 14px; margin-right: 6px; }
.share a, .share button { font: 600 14px var(--font); padding: 7px 14px; border: 2px solid #c9c0e6; border-radius: 18px; color: var(--purple); background: #fff; cursor: pointer; }
.share a:hover, .share button:hover { background: var(--paper); border-color: #8f80c8; }
.playbox { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 26px; padding: 6px 4px; border: 16px solid transparent; border-image: url("/home/assets/ui/panel_ink.png") 24 fill / 16px stretch; }
.playbox b { font-size: 21px; line-height: 1.2; color: #33264a; } .playbox p { margin: 2px 0 0; color: var(--ink2); font-size: 14.5px; }
.related { padding: 6px 0 40px; }

/* ---------- chân trang ---------- */
footer { margin-top: 30px; padding: 26px 16px 34px; text-align: center; color: #c5cdea; font-size: 13.5px; line-height: 1.9; background: linear-gradient(180deg, #3d4c86, #2b3563); border-top: 2px solid #98a8e0; }
footer .mark { font-size: 34px; line-height: 1.2; color: #fff; text-shadow: 0 2px 0 var(--navy2); }
footer a { color: #e6ebff; } footer a:hover { color: var(--gold2); }
footer .sys { font-size: 12.5px; opacity: .75; }

/* trang tài khoản ngắn: đẩy chân trang xuống đáy màn hình */
body.cc .cc-wrap { min-height: calc(100vh - 250px); }
