/* Trang chủ Kỷ Nguyên Yêu Quái — v2 (27/11/2026): cùng phong cách bảng đăng nhập mới trong game (nhánh login-ux).
   Số liệu lấy từ client/Assets/Scripts/UI/Login: LoginCardLayout.cs (thẻ / ô nhập / nút), LoginScreenController.cs
   (tab, màu trạng thái, nút "Thoát Game", dải 4 hệ), LoginSoftSprites.cs (ô tick, mắt), LoginSpiritFx.cs (hiệu ứng Thần Hồn).
   Thẻ trong suốt bo góc thay cho sprite 9-slice pixel cũ; chữ M PLUS 1p, logo Dela Gothic One (design_tokens: font.family.logo). */

@font-face { font-family: "Dela Gothic One"; src: url(../assets/fonts/dela-gothic-one.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "M PLUS 1p"; src: url(../assets/fonts/mplus1p-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "M PLUS 1p"; src: url(../assets/fonts/mplus1p-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Ark Pixel"; src: url(../assets/fonts/ark-pixel-12.woff2) format("woff2"); font-display: swap; }

:root {
  /* Chữ (LoginScreenController / LoginCardLayout) */
  --washi: #ece7da;            /* TextWashi */
  --label: #d6d0c4;            /* LabelColor */
  --muted: #9e98b2;            /* TextMuted / RuleNoteColor */
  --placeholder: rgba(158, 152, 178, .75);
  --gold: #e8c676;             /* FeedbackInfo, viền focus, tiêu đề bảng */
  --ok: #72da8a;               /* FeedbackSuccess */
  --bad: #f46a5e;              /* FeedbackError */
  --dot-online: #5ed67a;
  --dot-check: #f0c84b;
  --dot-offline: #e25246;
  --outline: #0e0a14;          /* color.ui.outline */

  /* Logo (design_tokens font.family.logo) */
  --logo-red: #d9442f;

  /* Thẻ / ô nhập / nút (LoginCardLayout v2) */
  --card-fill: rgba(20, 18, 42, .6);         /* CardFill #14122A, alpha 0,6 */
  --card-fill-solid: rgba(20, 18, 42, .92);  /* dự phòng khi không có backdrop-filter */
  --card-border: rgba(232, 198, 118, .31);   /* CardBorder (232,198,118,80) */
  --card-line: rgba(232, 198, 118, .24);     /* gạch dưới tiêu đề bảng (alpha 60) */
  --input-fill: rgba(8, 7, 18, .5);          /* InputFill alpha 0,5 */
  --input-border: rgba(236, 231, 218, .22);  /* InputBorder (236,231,218,56) */
  --input-focus: rgba(232, 198, 118, .9);    /* InputBorderFocus */
  --tab-idle: rgba(34, 31, 52, .55);         /* TabInactiveBg (34,31,52,140) */
  --son: #c0392b;                            /* nút gửi / tab đang chọn */
  --son-hover: #d1452f;
  --son-press: #a52f23;
  --r-card: 12px;   /* CardRadius */
  --r-input: 7px;   /* InputRadius, nút "Thoát Game" */
  --r-btn: 8px;     /* ButtonRadius */

  /* color.element */
  --el-mizuchi: #3fa7ff;
  --el-homura: #f0542c;
  --el-raiju: #f0e23a;
  --el-komainu: #d69234;

  /* color.quality */
  --q-thuong: #9a968c;
  --q-tinh: #5ab85a;
  --q-cuc: #a86ae0;
  --q-hoang: #f2c84a;

  /* Nền đêm chàm của màn đăng nhập */
  --bg: #0f0d1f;
  --bg-2: #14122a;
  --night: #221a36;

  --f-text: "M PLUS 1p", "Segoe UI", system-ui, sans-serif;
  --f-logo: "Dela Gothic One", "M PLUS 1p", sans-serif;
  --f-pixel: "Ark Pixel", ui-monospace, monospace;

  --wrap: 1760px;
  --gutter: clamp(16px, 4.5vw, 96px);
  --header-h: 68px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% 30%, rgba(60, 46, 110, .35), transparent 70%),
    radial-gradient(900px 700px at 10% 75%, rgba(40, 30, 80, .35), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--washi);
  font: 400 16px/1.65 var(--f-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: #fff0c0; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
b { font-weight: 700; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--gold); color: var(--outline); padding: 6px 12px; border-radius: var(--r-input); }
.skip:focus { left: 8px; }

/* Chữ nhỏ in hoa kiểu nhãn ô nhập trong game */
.kicker { font-weight: 700; font-size: 13px; line-height: 18px; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }

/* ---------- Thẻ trong suốt bo góc (CardFill + CardBorder) ---------- */
.glass {
  background: var(--card-fill-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background: var(--card-fill); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 20px;
  border: 1px solid transparent; border-radius: var(--r-btn);
  font: 700 15px/1.2 var(--f-text); letter-spacing: .04em;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.btn-lg { min-height: 54px; padding: 10px 30px; font-size: 17px; }
.btn-block { width: 100%; }

/* Son đỏ — thao tác chính (nút gửi của bảng đăng nhập) */
.btn-primary { background: var(--son); color: var(--washi); text-transform: uppercase; box-shadow: 0 6px 18px rgba(192, 57, 43, .28); }
.btn-primary:hover { background: var(--son-hover); color: #fff; }
.btn-primary:active { background: var(--son-press); }

/* Nút phụ kiểu "Thoát Game": nền chàm trong, viền mảnh vàng nhạt, chữ giấy dó */
.btn-ghost { background: var(--card-fill); border-color: var(--card-border); color: var(--washi); font-weight: 400; letter-spacing: .02em; }
.btn-ghost:hover { border-color: rgba(232, 198, 118, .75); color: #fff; background: rgba(34, 31, 60, .7); }
.btn-ghost:active { background: rgba(10, 8, 22, .7); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn.is-soon { opacity: .7; cursor: default; box-shadow: none; }
.btn.is-soon:hover { background: var(--son); color: var(--washi); }
a.is-soon:not(.btn) { cursor: default; opacity: .75; }

.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-align: left; }
.link:hover { color: var(--gold); }

/* ---------- Thông báo bảo trì ---------- */
.notice {
  background: rgba(192, 57, 43, .9); border-bottom: 1px solid var(--card-border);
  color: #fff0d8; text-align: center; padding: 8px var(--gutter); font-size: 14px;
}
.notice b { color: #ffe39a; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 13, 31, .9);
  border-bottom: 1px solid var(--card-line);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header { background: rgba(15, 13, 31, .7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.header-row { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--washi); }
.brand:hover { color: var(--washi); }
.brand-crest { width: 36px; height: 36px; flex: none; }
.brand-name {
  font-family: var(--f-logo); font-size: 17px; line-height: 1.3; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 2px 0 var(--outline);
}
.brand-name em, .logo .red { font-style: normal; color: var(--logo-red); }

.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.site-nav > a {
  color: var(--label); font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: var(--r-input);
  transition: color .15s ease, background-color .15s ease;
}
.site-nav > a:hover { color: var(--washi); background: rgba(255, 255, 255, .05); }
.site-nav > a.is-active { color: var(--gold); background: rgba(232, 198, 118, .08); }
.nav-side { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.guest-only, .user-only { display: flex; gap: 8px; }
.guest-only[hidden], .user-only[hidden] { display: none; }
.hero-cta .guest-only, .cta-actions .guest-only, .footer-col .guest-only, .footer-col .user-only { display: inline-flex; }

/* Cụm trạng thái máy chủ: viên thuốc bo tròn + chấm tròn (như góc trên phải màn đăng nhập) */
.server-dot {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; margin-right: 4px;
  border: 1px solid var(--card-border); border-radius: 999px; background: var(--card-fill);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.server-dot i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot-check); flex: none; }
.server-dot[data-state="checking"] i { animation: blink 1s steps(2, jump-none) infinite; }
.server-dot[data-state="online"] i { background: var(--dot-online); box-shadow: 0 0 8px rgba(94, 214, 122, .6); }
.server-dot[data-state="online"] { color: var(--label); }
.server-dot[data-state="offline"] i { background: var(--dot-offline); }
.server-dot[data-state="offline"] { color: var(--bad); }
.server-dot[data-state="maintenance"] i { background: var(--dot-check); }
.server-dot[data-state="maintenance"] { color: var(--dot-check); }
@keyframes blink { 50% { opacity: .35; } }

.user-menu { position: relative; }
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.user-drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 60; background: var(--card-fill-solid); }
.user-drop button { background: none; border: 0; border-radius: var(--r-input); text-align: left; padding: 10px 12px; cursor: pointer; color: var(--washi); font-size: 15px; }
.user-drop button:hover { background: rgba(192, 57, 43, .35); }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; cursor: pointer; padding: 13px 11px;
  background: var(--card-fill); border: 1px solid var(--card-border); border-radius: var(--r-input);
  flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; border-radius: 1px; background: var(--washi); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(86vh, 760px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; isolation: isolate; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(15,13,31,.94) 0%, rgba(15,13,31,.7) 32%, rgba(15,13,31,.1) 60%, rgba(15,13,31,0) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(15,13,31,0) 28%),
    url(../assets/img/hero.webp) right center / cover no-repeat, var(--night);
  image-rendering: pixelated;
}
.hero-inner { padding-top: 64px; padding-bottom: 36px; }
.hero-inner > * { max-width: 660px; }

.pill-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 12px;
  border: 1px solid var(--card-border); border-radius: 999px; background: var(--card-fill);
  font-size: 13px; color: var(--label);
}
.pill-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--son); box-shadow: 0 0 8px rgba(217, 68, 47, .8); }

/* Logo: Dela Gothic One, "KỶ NGUYÊN" giấy dó + "YÊU QUÁI" đỏ son, viền / bóng tối mỏng (material Logo trong game) */
.logo-row { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 20px); margin-top: 22px; max-width: none; }
.logo-crest { width: clamp(52px, 6vw, 76px); height: auto; flex: none; filter: drop-shadow(0 3px 0 rgba(14, 10, 20, .8)); }
.logo {
  font-family: var(--f-logo); font-weight: 400; text-transform: uppercase;
  font-size: clamp(34px, 4.6vw, 70px); line-height: 1.3; letter-spacing: .03em; color: var(--washi);
  text-shadow:
    1px 1px 0 var(--outline), -1px 1px 0 var(--outline), 1px -1px 0 var(--outline), -1px -1px 0 var(--outline),
    0 4px 0 rgba(14, 10, 20, .85), 0 0 28px rgba(0, 0, 0, .55);
}
/* Hai dòng (KỶ NGUYÊN / YÊU QUÁI) để không đè lên tranh nền bên phải */
.logo span { display: block; white-space: nowrap; }
.hero-sub {
  margin-top: 6px; padding-bottom: 12px; font-size: clamp(16px, 1.6vw, 20px); color: var(--gold); letter-spacing: .02em;
  background: linear-gradient(90deg, var(--son), rgba(192, 57, 43, .9) 70%, transparent) left bottom / 100% 2px no-repeat;
  text-shadow: 0 1px 0 var(--outline);
}
.hero-lead { margin-top: 20px; font-size: 18px; color: var(--washi); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* Dải 4 hệ: khung trong bo tròn, chấm tròn màu hệ, chữ mịn */
.strip-wrap { padding-bottom: 36px; }
.element-strip {
  list-style: none; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; margin: 0; padding: 8px 20px;
  border: 1px solid var(--card-border); border-radius: 22px; background: var(--card-fill);
}
.element-strip li { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; color: var(--washi); }
.element-strip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* ---------- Section ---------- */
.section { padding: 96px 0; position: relative; }
.section-alt { background: rgba(20, 18, 42, .55); border-top: 1px solid var(--card-line); border-bottom: 1px solid var(--card-line); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head h2 { margin-top: 8px; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.25; color: var(--washi); }
.section-head h2::after { content: ""; display: block; width: 96px; height: 2px; margin-top: 14px; background: linear-gradient(90deg, var(--son) 0 60%, var(--card-border) 60%); border-radius: 1px; }
.section-lead { margin-top: 16px; color: var(--label); font-size: 17px; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { padding: 22px 22px 24px; }
.card h3, .news h3 { font-size: 18px; color: var(--gold); margin-bottom: 8px; line-height: 1.4; }
.card p { color: var(--label); font-size: 15px; }
.q-thuong { color: var(--q-thuong); } .q-tinh { color: var(--q-tinh); } .q-cuc { color: var(--q-cuc); } .q-hoang { color: var(--q-hoang); }

/* Hệ phái */
.class-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.class-card { padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.class-card::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: var(--c); opacity: .85; }
.class-art {
  height: 220px; display: grid; place-items: center; margin: 0 -20px 6px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 20%, transparent), transparent 80%);
}
.spirit { position: relative; animation: float 4s ease-in-out infinite; }
.spirit img { position: relative; }
.spirit-fx { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.class-card:nth-child(2) .spirit { animation-delay: -1s; }
.class-card:nth-child(3) .spirit { animation-delay: -2s; }
.class-card:nth-child(4) .spirit { animation-delay: -3s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.class-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label); }
.class-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.class-card h3 { font-size: 26px; line-height: 1.3; color: var(--washi); }
.class-motto { color: var(--gold); font-size: 14px; }
.class-role { font-weight: 700; font-size: 14px; color: var(--washi); padding-bottom: 10px; border-bottom: 1px solid var(--card-line); }
.class-card > p:not([class]) { color: var(--label); font-size: 14.5px; padding-top: 4px; }
.skills { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; }
.skills li {
  font-size: 12.5px; padding: 3px 10px; border-radius: 999px; color: var(--washi);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent);
}

/* Thế giới: ảnh lớn 2×2 bên trái, hai ảnh nhỏ bên phải, hàng dưới ba ảnh */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.shot { margin: 0; position: relative; border: 1px solid var(--card-border); border-radius: var(--r-card); overflow: hidden; background: var(--bg-2); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.shot-wide { grid-column: span 2; grid-row: span 2; }
.shot img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; transition: transform .5s ease; }
.shot:hover img { transform: scale(1.03); }
.shot figcaption {
  position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px);
  background: rgba(20, 18, 42, .82); border: 1px solid var(--card-border); border-radius: var(--r-input);
  padding: 4px 12px; font-size: 14px; color: var(--washi);
}

/* Tin tức */
.news-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.news h3 { color: var(--washi); margin: 0; }
.news p:not(.news-meta) { color: var(--label); font-size: 15px; }
.news-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.tag { font-size: 12px; line-height: 18px; padding: 1px 10px; border-radius: 999px; border: 1px solid var(--input-border); color: var(--label); }
.tag-update { color: var(--ok); border-color: rgba(114, 218, 138, .5); }
.tag-event { color: var(--gold); border-color: rgba(232, 198, 118, .55); }

/* CTA */
.cta-band { padding: 80px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px; }
.cta-inner h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.3; }
.cta-inner p { color: var(--label); margin-top: 6px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: rgba(10, 8, 22, .85); border-top: 1px solid var(--card-line); padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-brand p { margin-top: 14px; color: var(--muted); font-size: 14px; max-width: 360px; }
.footer-col { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.footer-col h4 { font-size: 13px; line-height: 18px; color: var(--gold); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 6px; }
.footer-col a, .footer-col .link { color: var(--label); font-size: 14px; padding: 4px 0; }
.footer-col a:hover, .footer-col .link:hover { color: var(--gold); }
.server-line { color: var(--label); font-size: 14px; }
.footer-bottom { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--card-line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); }
/* Chữ pixel chỉ còn cho chi tiết trang trí rất nhỏ: số phiên bản (như góc trên trái màn đăng nhập) */
.version { font-family: var(--f-pixel); font-size: 12px; line-height: 16px; color: var(--muted); -webkit-font-smoothing: none; }

/* ---------- Hộp thoại (bảng "Cổng Trừ Tà Viện") ---------- */
.modal { padding: 0; border: 0; background: transparent; color: var(--washi); max-width: calc(100vw - 24px); width: 460px; max-height: calc(100vh - 24px); overflow: visible; }
.modal::backdrop { background: rgba(10, 8, 20, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-box { position: relative; padding: 20px 24px 24px; max-height: calc(100vh - 24px); overflow: auto; background: rgba(20, 18, 42, .88); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .modal-box { background: rgba(20, 18, 42, .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}
.modal-title {
  font-size: 22px; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); text-align: center;
  padding-bottom: 10px; margin: 0 40px 16px; border-bottom: 1px solid var(--card-line);
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; padding: 0; cursor: pointer;
  border: 1px solid var(--card-border); border-radius: var(--r-input); background: var(--card-fill);
  color: var(--label); font-size: 22px; line-height: 1;
}
.modal-close:hover { color: #fff; border-color: rgba(232, 198, 118, .75); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.tabs button {
  min-height: 44px; border: 0; border-radius: var(--r-input); background: transparent; cursor: pointer;
  color: var(--muted); font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase;
}
.tabs button:hover { background: rgba(255, 255, 255, .08); color: var(--label); }
.tabs button[aria-selected="true"] { background: var(--son); color: var(--washi); }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child, .field-head > span { font-weight: 700; font-size: 13px; line-height: 18px; letter-spacing: .08em; color: var(--label); text-transform: uppercase; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-head small { font-weight: 400; font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--muted); white-space: nowrap; }
.field small, .hint { font-size: 12.5px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field input {
  width: 100%; min-height: 46px; padding: 8px 14px;
  border: 1px solid var(--input-border); border-radius: var(--r-input); background: var(--input-fill);
  color: var(--washi); font: 400 16px/1.3 var(--f-text); caret-color: var(--gold);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--placeholder); }
.field input:hover { border-color: rgba(236, 231, 218, .35); }
.field input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px rgba(232, 198, 118, .12); }
.field input:user-invalid { border-color: rgba(244, 106, 94, .8); }

/* Nút mắt nằm TRONG mép phải ô mật khẩu */
.pw { position: relative; display: block; }
.pw input { padding-right: 50px; }
.pw-toggle {
  position: absolute; top: 1px; right: 1px; bottom: 1px; width: 46px; padding: 0; border: 0; border-radius: 0 6px 6px 0;
  background: transparent; color: var(--label); cursor: pointer; display: grid; place-items: center;
}
.pw-toggle:hover { color: #fff; }
.pw-toggle:focus-visible { outline-offset: -3px; }
.pw-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Đang ẩn mật khẩu → mắt gạch (như game); bấm để hiện → mắt mở */
.pw-toggle .slash { display: inline; }
.pw-toggle[aria-pressed="true"] .slash { display: none; }

/* Ô tick nét mịn (LoginSoftSprites.Checkbox): tắt = chàm mờ viền nhạt, bật = son đỏ viền vàng + dấu ✓ giấy dó */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--label); cursor: pointer; }
.check input {
  -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0; cursor: pointer;
  border: 1px solid rgba(237, 230, 217, .55); border-radius: 5px; background: rgba(10, 8, 23, .55);
  transition: background-color .12s ease, border-color .12s ease;
}
.check input:checked {
  background: rgba(191, 56, 43, .95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.3l3.4 3.6L15.3 6' fill='none' stroke='%23ece7da' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  border-color: var(--gold);
}
.check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.form-msg { min-height: 1.4em; font-size: 14px; color: var(--bad); }
.form-msg:empty { min-height: 0; margin-top: -14px; }
.form-msg.ok { color: var(--ok); }
.form-foot { font-size: 13px; color: var(--muted); text-align: center; }

.info { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 16px; font-size: 15px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; text-align: right; color: var(--washi); overflow-wrap: anywhere; }
.info .ok { color: var(--ok); } .info .warn { color: var(--dot-check); }
.sub { border-top: 1px solid var(--card-line); padding: 12px 0; }
.sub:last-of-type { margin-bottom: 16px; border-bottom: 1px solid var(--card-line); }
.sub summary { cursor: pointer; font-weight: 700; color: var(--washi); list-style: none; padding: 4px 0; }
.sub summary::-webkit-details-marker { display: none; }
.sub summary::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 10px 2px 2px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: rotate(-45deg); transition: transform .15s ease; }
.sub[open] summary::before { transform: rotate(45deg); }
.sub .form { margin-top: 12px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  background: rgba(20, 18, 42, .95); border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 18px;
  color: var(--washi); font-size: 15px; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.toast.bad { border-color: rgba(244, 106, 94, .8); }

/* ---------- Tải game ---------- */
.dl-version { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 1100px; }
.dl-android-first [data-dl="android"] { order: -1; }
.dl-card { padding: 24px 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.dl-head { display: flex; align-items: center; gap: 16px; }
.dl-icon { flex: none; width: 48px; height: 48px; padding: 10px; border-radius: 12px; border: 1px solid var(--card-border); background: rgba(8, 7, 18, .45); fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dl-head h3 { font-size: 20px; color: var(--washi); line-height: 1.3; }
.dl-meta { margin-top: 2px; font-size: 14px; color: var(--muted); }
.dl-steps { flex: 1; margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--label); font-size: 15px; }
.dl-steps li::marker { color: var(--gold); font-weight: 700; }
.dl-steps b { color: var(--washi); }
.dl-steps code { font-size: 14px; padding: 1px 6px; border-radius: 5px; background: rgba(8, 7, 18, .5); color: var(--washi); }
.dl-note { margin-top: 18px; max-width: 1100px; font-size: 14px; color: var(--muted); }
.dl-note b { color: var(--label); }

/* ---------- Đáp ứng ---------- */
@media (max-width: 1240px) {
  .server-dot span { display: none; }
  .server-dot { padding: 0 13px; }
}
@media (max-width: 1100px) {
  .feature-grid, .class-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --gutter: 16px; --header-h: 60px; }
  /* backdrop-filter tạo khối chứa cho phần tử fixed → menu bị cắt theo header; trên điện thoại dùng nền đặc */
  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 12px var(--gutter) 24px;
    background: var(--bg); overflow-y: auto;
    opacity: 0; transform: translateY(-8px); visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .site-nav.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity .2s ease, transform .2s ease; }
  .site-nav > a { padding: 14px 8px; border-radius: 0; border-bottom: 1px solid var(--card-line); font-size: 17px; }
  .nav-side { margin: 18px 0 0; flex-direction: column; align-items: stretch; gap: 12px; }
  .nav-side .guest-only { display: grid; grid-template-columns: 1fr 1fr; }
  .nav-side .guest-only[hidden] { display: none; }
  .nav-side .btn { min-height: 48px; }
  .server-dot { justify-content: center; height: 44px; margin: 0; }
  .server-dot span { display: inline; }
  .user-drop { position: static; margin-top: 6px; }
  .news-list, .dl-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .shot-wide { grid-column: 1 / -1; grid-row: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .brand-name { font-size: 15px; }
  .brand-crest { width: 32px; height: 32px; }
  .hero { min-height: auto; }
  .hero-bg {
    background:
      linear-gradient(0deg, var(--bg) 0%, rgba(15,13,31,.84) 45%, rgba(15,13,31,.4) 100%),
      url(../assets/img/hero.webp) 78% center / cover no-repeat, var(--night);
  }
  .hero-inner { padding-top: 36px; }
  .logo-row { align-items: flex-start; }
  .logo-crest { margin-top: 6px; }
  .hero-lead { font-size: 16px; }
  .hero-cta .btn { width: 100%; }
  .element-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 10px 18px; border-radius: 14px; }
  .section { padding: 64px 0; }
  .feature-grid, .class-grid, .gallery { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-inner { padding: 22px 20px; }
  .cta-actions, .cta-actions .btn { width: 100%; }
  .modal-box { padding: 16px 16px 20px; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 13px; letter-spacing: .01em; }
}
