/* Ký tự ngoài ASCII trong thuộc tính content phải viết dạng mã (B8…): file CSS phát ra không kèm charset, có
   trình duyệt / proxy đọc nó thành Windows-1252 và in ra chữ rác. */
/* Trang web người chơi. Một file, không framework. Không dùng style nội tuyến ở bất kỳ trang nào (CSP chặn). */
:root {
    /* Bảng màu lấy từ giao diện trong game (UiSkin / UiFrame / UiButton): kem giấy, nâu gỗ, vàng đồng, đỏ son.
       Trong game nền là gỗ đậm chữ kem; trang web đảo lại — nền kem chữ nâu — cho sáng sủa, dễ đọc ngoài trời. */
    --bg: #fbf3e0; --panel: #fffaf0; --panel-2: #f6e8c8; --line: #e3cc9c;
    --text: #40210a; --muted: #7a5f45; --gold: #c8923f; --gold-2: #f2c463; --edge: #8a5a1c;
    --wood: #54331a; --wood-dark: #33210e; --cream: #ffedc7; --red: #991712;
    --ok: #1f7a45; --warn: #9a5b00; --err: #b3261e; --link: #9a3412;
    --radius: 10px; --wrap: 1120px; --gutter: 20px;
    --shadow: 0 1px 2px rgba(84, 51, 26, .08), 0 6px 18px rgba(84, 51, 26, .07);
    /* Georgia thiếu chữ Việt có hai dấu (ế, ấ, ắ…): tiêu đề vỡ dấu. Chỉ dùng font có đủ chữ Việt. */
    --serif: Cambria, "Times New Roman", Times, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
    overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; margin: 0 0 .6em; color: var(--wood-dark); }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
h1, h2 { color: var(--red); }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
/* height: auto — ảnh có thuộc tính width/height (mã QR) vẫn co theo màn hẹp mà không méo. */
img { max-width: 100%; height: auto; display: block; }
ul { padding-left: 1.2em; }
/* .wrap chỉ đặt lề NGANG, section chỉ đặt lề DỌC: hai luật cùng nằm trên một thẻ mà không đè nhau. */
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.narrow { max-width: 460px; } .center { text-align: center; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .nowrap { white-space: nowrap; }
section { padding-top: 48px; padding-bottom: 48px; }
section.tight { padding-top: 24px; padding-bottom: 24px; }

/* đầu trang */
/* Thanh mục KHÔNG có nền, nằm đè lên mép trên của băng ảnh: logo lớn bên trái thò xuống, các mục dàn ngang. */
body { position: relative; }
.top { position: absolute; left: 0; right: 0; top: 0; z-index: 10; }
.bar { display: flex; align-items: flex-start; gap: 8px 28px; flex-wrap: wrap; padding-top: 4px; }
.brand { flex: none; } .brand img { height: 104px; width: auto; filter: drop-shadow(0 4px 8px rgba(51, 33, 14, .35)); }
/* Chữ nằm thẳng trên ảnh: viền sáng quanh chữ để đọc được trên mọi ảnh nền. */
.main, .user { text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg), 0 0 12px var(--bg); }
.main { display: flex; gap: 4px 26px; flex-wrap: wrap; flex: 1; padding-top: 14px; }
.main a { color: var(--wood-dark); font-weight: 700; font-size: .85rem; letter-spacing: .5px; text-transform: uppercase; padding: 6px 0;
    white-space: nowrap; border-bottom: 2px solid transparent; }
.main a::before { content: "\25C6"; margin-right: 8px; font-size: .7em; color: var(--gold); vertical-align: 1px; }
.main a:hover { color: var(--red); text-decoration: none; }
.main a.active { color: var(--red); border-bottom-color: var(--red); }
.user a { color: var(--wood-dark); font-weight: 600; font-size: .9rem; } .user a.active { color: var(--red); }
.user { display: flex; align-items: center; gap: 14px; padding-top: 18px; }
.user form { margin: 0; }
.user .name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* nút — nút vàng là nút chính của game: mặt vàng đồng, viền nâu, chữ mực nâu */
.btn, button { display: inline-block; border: 1px solid var(--gold); background: var(--panel); color: var(--text);
    padding: 9px 18px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.btn:hover, button:hover { border-color: var(--edge); background: var(--panel-2); text-decoration: none; }
.btn.gold, button.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--edge); color: var(--text);
    font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 0 var(--edge); }
.btn.gold:hover, button.gold:hover { background: linear-gradient(180deg, #f8d27e, #d49f4b); }
.btn.big { padding: 14px 34px; font-size: 1.15rem; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 400; }
button.link:hover { color: var(--text); background: none; }
.dl-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* khối */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
/* min(100%, …): màn hẹp hơn cột tối thiểu thì cột co theo màn chứ không đẩy trang tràn ngang. */
.grid { display: grid; gap: 20px; }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; border: 1px solid var(--line); font-size: .8rem; color: var(--muted);
    background: var(--panel); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok); } .badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.err { color: var(--err); border-color: var(--err); } .badge.gold { color: var(--edge); border-color: var(--gold); white-space: normal; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--panel); padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; }
.notice.err { border-left-color: var(--err); background: #fdecea; } .notice.ok { border-left-color: var(--ok); background: #e9f6ee; }
.code { font: 700 4rem var(--serif); color: var(--gold); margin: 0; }

/* ảnh game + khung giữ chỗ */
.art { width: 100%; border-radius: var(--radius); object-fit: cover; background: var(--panel-2); }
.art.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--muted); text-align: center; padding: 12px; }
.art.placeholder small { font-family: Consolas, monospace; }
.card > .art { margin-bottom: 14px; }
/* Ảnh nghề là ảnh pixel nhỏ phóng lên: giữ nét điểm ảnh, không để trình duyệt làm mịn thành nhoè. */
#nghe img.art { image-rendering: pixelated; }
.ratio-16x9 { aspect-ratio: 16 / 9; } .ratio-3x4 { aspect-ratio: 3 / 4; } .ratio-4x3 { aspect-ratio: 4 / 3; }
.ratio-3x1 { aspect-ratio: 3 / 1; } .ratio-4x1 { aspect-ratio: 4 / 1; }

/* ——— khung trang: băng ảnh đầu trang, bên dưới là cột bên 320px + cột chính, cả hai trồi lên đè mép dưới băng ảnh ——— */
.banner { --banner: 600px; position: relative; height: var(--banner); overflow: hidden;
    background: radial-gradient(120% 90% at 50% 0%, #fff3cf, var(--panel-2) 60%, var(--bg)); }
.banner .art { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; border-radius: 0; }
.banner .art.placeholder { background: none; align-items: flex-end; justify-content: flex-start;
    padding: 120px var(--gutter) 0; }
/* Ảnh tan vào nền kem của trang ở mép dưới — chỗ hai cột trồi lên. */
.banner::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; pointer-events: none;
    background: linear-gradient(180deg, rgba(251, 243, 224, 0), var(--bg)); }
/* Khẩu hiệu: dòng chữ lớn + ba nhãn, nằm bên trái băng ảnh ngay trên chỗ hai cột trồi lên. */
.slogan { position: relative; z-index: 1; padding-top: 200px; }
/* Cỡ chữ tính theo bề ngang màn để tên game LUÔN nằm trọn một dòng: dòng chữ rộng khoảng 13,8 lần cỡ chữ + 24px giãn chữ. */
.slogan h1, .slogan .title { margin: 0; font: 700 clamp(1.1rem, calc((100vw - 2 * var(--gutter) - 24px) / 13.8), 4rem)/1.1 var(--serif);
    text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
    color: var(--gold); -webkit-text-stroke: 1px var(--edge);
    text-shadow: 0 2px 0 var(--edge), 0 4px 0 var(--wood-dark), 0 8px 14px rgba(51, 33, 14, .35); }
.tags { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 18px 0 0; }
.tags a { padding: 5px 22px; border-radius: 99px; background: rgba(255, 250, 240, .9); border: 1px solid var(--gold); color: var(--edge);
    font: italic 700 1rem var(--serif); box-shadow: var(--shadow); }
.tags a:hover { background: var(--panel-2); color: var(--red); text-decoration: none; }

.frame { position: relative; z-index: 2; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start;
    margin-top: -205px; }
.side, .home .content { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.content { min-width: 0; }
/* Trang trong: cả nội dung nằm trong MỘT khung giấy; section bên trong không còn tự canh giữa theo --wrap. */
.inner .content { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 14px 0 8px; }
.content section { padding-top: 16px; padding-bottom: 16px; }
.content .wrap { padding-left: 24px; padding-right: 24px; }
.content .wrap:not(.narrow) { max-width: none; }
.crumbs { margin: 0; padding: 0 24px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .875rem; }

/* cột bên */
.play { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--edge); box-shadow: var(--shadow); }
.play-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100px; color: var(--cream);
    background: linear-gradient(180deg, #b8241d, var(--red)); text-shadow: 0 2px 0 rgba(51, 33, 14, .5); }
.play-main:hover { text-decoration: none; background: linear-gradient(180deg, #c93028, #a51a14); }
.play-main strong { font: 700 2rem/1.1 var(--serif); letter-spacing: 1px; text-transform: uppercase; color: var(--gold-2); }
.play-main span { max-width: 90%; font-size: .8rem; letter-spacing: 3px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-sub { display: flex; background: var(--wood-dark); }
.play-sub a { flex: 1; padding: 8px 6px; text-align: center; color: var(--cream); font-weight: 600; font-size: .9rem; }
.play-sub a + a { border-left: 1px solid var(--wood); }
.play-sub a:hover { background: var(--wood); text-decoration: none; }

.srv { background: var(--wood-dark); border: 1px solid var(--edge); border-radius: var(--radius); padding: 12px 16px 16px; box-shadow: var(--shadow); }
.srv h2 { margin: 0 0 8px; text-align: center; font: 400 .8rem system-ui, sans-serif; color: #c9ad84; }
.srv-new { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--cream);
    background: linear-gradient(180deg, #b8241d, var(--red)); border: 1px solid var(--gold); text-transform: uppercase; }
/* Lưới ba cột, cao tối đa năm hàng rồi cuộn — danh sách dài không đẩy cột bên dài theo. */
.srv ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
    max-height: 170px; overflow-y: auto; }
.srv li { padding: 4px 6px; border-radius: 4px; background: var(--wood); color: var(--cream); font-size: .8rem; font-weight: 600;
    text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Chấm trạng thái: xanh = đang mở, vàng = bảo trì. */
.srv .on::after, .srv .off::after { content: ""; display: inline-block; flex: none; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%;
    background: #5fd08a; }
.srv .off::after { background: #e0a23b; }
.srv-new::after { width: 9px; height: 9px; margin-left: 0; box-shadow: 0 0 0 2px rgba(51, 33, 14, .45); }
.srv-last { margin: 8px 0 0; text-align: center; }
.srv-last .badge { background: var(--wood); border-color: var(--gold); color: var(--cream); }

.big-links { display: grid; gap: 6px; }
.big-links a, .gallery a, .slide { position: relative; display: block; margin: 0; overflow: hidden; border-radius: var(--radius); }
.big-links a { border: 1px solid var(--edge); box-shadow: var(--shadow); }
.big-links .art { border-radius: 0; }
.big-links .art.placeholder { align-items: flex-start; }
.big-links a > span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: 700 1.7rem/1 var(--serif);
    text-transform: uppercase; color: var(--cream); text-shadow: 0 2px 0 rgba(51, 33, 14, .85), 0 0 8px rgba(51, 33, 14, .7); }
/* Chưa có ảnh nền (khung giữ chỗ màu kem): chữ đỏ viền sáng mới đọc được. */
.big-links .art.placeholder + span { color: var(--red); text-shadow: 0 0 6px var(--panel), 0 0 2px var(--panel); }
.big-links a:hover > span { color: var(--gold-2); }
.big-links a:hover > .art.placeholder + span { color: var(--edge); }
/* Nút tải game: bấm là xổ hai bản tải ngay bên dưới. */
.dl-side { border-radius: var(--radius); overflow: hidden; background: var(--wood-dark); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.dl-side summary { list-style: none; cursor: pointer; user-select: none; padding: 14px 16px; color: var(--gold-2);
    font: 700 1.35rem/1 var(--serif); text-transform: uppercase; text-align: center; }
.dl-side summary::-webkit-details-marker { display: none; }
.dl-side summary::after { content: " \25BE"; }
.dl-side[open] summary::after { content: " \25B4"; }
.dl-side summary:hover { background: var(--wood); }
.dl-side div { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 8px 8px; }
.dl-side a { padding: 9px 6px; border-radius: 6px; text-align: center; font-weight: 700; color: var(--text);
    background: linear-gradient(180deg, var(--gold-2), var(--gold)); border: 1px solid var(--edge); }
.dl-side a:hover { background: linear-gradient(180deg, #f8d27e, #d49f4b); text-decoration: none; }

/* trang chủ: băng ảnh trượt. Không JS vẫn vuốt ngang được; slider.js thêm nút số và tự chuyển. */
.slider { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius);
    border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.slides::-webkit-scrollbar { display: none; }
.slides > * { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; border-radius: 0; }
.slider .art { border-radius: 0; }
.dots { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; }
.dots button { width: 22px; height: 22px; padding: 0; border-radius: 3px; border: 1px solid var(--edge); background: var(--wood-dark);
    color: var(--cream); font-size: .75rem; line-height: 1; }
.dots button.active, .dots button:hover { background: var(--red); border-color: var(--gold); }
/* Chữ nằm THẲNG trên ảnh, không khung: dải tối dần ở đáy ảnh để chữ kem đọc được trên mọi ảnh. */
.cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 2px; padding: 36px 16px 12px;
    background: linear-gradient(180deg, rgba(51, 33, 14, 0), rgba(51, 33, 14, .82)); color: var(--cream);
    text-shadow: 0 1px 1px rgba(0, 0, 0, .5); pointer-events: none; }
.cap strong { font: 700 1.25rem/1.2 var(--serif); text-transform: uppercase; color: var(--gold-2); }
.cap small { font-size: .875rem; line-height: 1.4; }
/* Trong băng trượt: chừa góc phải dưới cho các nút số. */
.slider .cap { padding-right: 120px; }
a.slide { color: inherit; } a.slide:hover { text-decoration: none; }
a.slide[href]:hover .cap strong { color: #fff; }
/* Băng điểm nổi bật: ảnh rộng thấp. */
.features .art { aspect-ratio: 7 / 2; }

/* khối tin: tin đầu có ảnh, các tin sau mỗi tin một dòng kèm ngày */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 24px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; padding: 10px 0 8px; font: 600 .85rem system-ui, sans-serif; text-transform: uppercase; color: var(--text);
    border-bottom: 2px solid var(--red); margin-bottom: -1px; }
.panel-head .more { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line);
    color: var(--muted); position: relative; flex: none; }
/* Dấu cộng vẽ bằng hai thanh: ký tự "+" của font không nằm giữa ô chữ nên căn kiểu gì cũng lệch. */
.panel-head .more::before, .panel-head .more::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px;
    margin: -1px 0 0 -5px; background: currentColor; border-radius: 1px; }
.panel-head .more::after { transform: rotate(90deg); }
.panel-head .more:hover { background: var(--gold-2); color: var(--text); text-decoration: none; }
.panel-body { padding: 20px 24px; }
.panel-body > :last-child { margin-bottom: 0; }
.item { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.item .thumb { display: block; }
.item .thumb .art { border-radius: 6px; }
.item h3 { margin: 0 0 4px; font: 600 1.15rem/1.3 system-ui, sans-serif; text-transform: uppercase; color: var(--red); }
.item h3 a { color: inherit; }
.item p { margin: 0 0 6px; }
.item .text > :last-child { margin-bottom: 0; }
.items { display: grid; margin: 0 0 24px; }
.items .item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.items .item:first-child { padding-top: 4px; }
.headlines { list-style: none; margin: 18px 0 0; padding: 0; }
.headlines li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0 8px 18px; border-top: 1px solid var(--line);
    position: relative; }
.headlines li::before { content: "\25B8"; position: absolute; left: 2px; color: var(--gold); }
.headlines a, .headlines span { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.headlines a:hover { color: var(--red); }
.headlines time { flex: none; }
/* bài viết */
.article figure { margin: 20px 0; } .article img { border-radius: var(--radius); margin: 0 auto; }
.article h2 { margin-top: 1.4em; }
.pager { display: flex; justify-content: space-between; margin-top: 8px; }
/* Ảnh bìa trang một sự kiện: cùng ô ảnh với ảnh thu nhỏ ở danh sách. */
/* Hiện ĐỦ ảnh (không cắt theo khung), căn giữa cột. Khung giữ chỗ thì vẫn theo khung 4:3. */
.cover { margin: 16px 0 0; text-align: center; }
.cover img.art { display: inline-block; width: auto; max-width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.cover .art.placeholder { max-width: 400px; margin: 0 auto; }

/* ba ô thư viện: một ô rộng + hai ô hẹp, nhãn ở đáy */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; }
.gallery a { height: 150px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.gallery .art { height: 100%; aspect-ratio: auto; border-radius: 0; }
.gallery .art.placeholder { justify-content: flex-start; }
.gallery .cap { text-align: center; padding: 28px 8px 10px; }
.gallery .cap strong { font-size: .95rem; }
.gallery a:hover .cap strong { color: #fff; }

/* lối tắt nổi ở mép phải — chỉ hiện khi màn đủ rộng để không đè lên nội dung */
.float { display: none; }
@media (min-width: 1420px) {
    .float { position: fixed; right: 0; top: 40%; z-index: 9; display: grid; width: 130px; border: 1px solid var(--edge); border-right: 0;
        border-radius: 8px 0 0 8px; overflow: hidden; box-shadow: var(--shadow); }
    .float a { padding: 8px 10px; background: var(--wood); color: var(--cream); font-size: .85rem; font-weight: 600; text-align: center;
        border-bottom: 1px solid var(--wood-dark); }
    .float a:hover { background: var(--red); text-decoration: none; }
    .float .to-top { background: var(--wood-dark); border-bottom: 0; }
}

/* giới thiệu: hai giới */
.realms .long { border-top: 4px solid var(--gold); } .realms .ma { border-top: 4px solid #5b2a86; }
.realms .ma h3 { color: #5b2a86; } .realms .long h3 { color: var(--edge); }
.rule { border-left: 4px solid var(--red); }
.rule h3 { color: var(--red); }

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; }
.pills a { padding: 4px 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--panel); }
.pills a.active { color: var(--red); border-color: var(--gold); background: var(--panel-2); font-weight: 600; }

/* form */
form.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
label.check { flex-direction: row; align-items: center; font-weight: 400; gap: 8px; }
label .hint { font-weight: 400; color: var(--muted); font-size: .875rem; }
/* Chữ trong ô nhập giữ 16px: nhỏ hơn thì Safari trên iPhone tự phóng to trang khi chạm vào ô. */
input[type=text], input[type=password], input[type=email], select { width: 100%; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); }
.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline label { flex: 1; min-width: min(100%, 200px); }

/* tài khoản + nạp */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; min-width: 0; }
progress { width: 100%; height: 14px; accent-color: var(--gold); }
.pack { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.pack .gems { font: 700 1.6rem var(--serif); color: var(--red); }
.pack form { margin: 0; }
.order { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 24px; align-items: start; }
.order:not([data-status="pending"]) { grid-template-columns: 1fr; }
.order .qr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 0 auto; }
.order .content-code { font: 700 1.5rem Consolas, monospace; color: var(--red); letter-spacing: 1px; }
.clock { font: 700 1.3rem Consolas, monospace; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 16px;
    -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--wood); font-weight: 700; background: var(--panel-2); white-space: nowrap; }

/* chân trang — hàng sáng: logo bên trái, các mục gạch chân bên phải; dưới cùng là dải gỗ như chân khung bảng trong game */
.bottom { padding: 28px 0 20px; margin-top: 40px; }
.bottom .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.bottom .brand img { height: 64px; width: auto; }
.bottom nav { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.bottom nav a { color: var(--text); padding: 4px 12px; border-bottom: 2px solid var(--wood-dark); font-size: .9rem; }
.bottom nav a:hover { color: var(--red); border-color: var(--red); text-decoration: none; }
.bottom-2 { background: var(--wood-dark); border-top: 3px solid var(--gold); padding: 18px 0; }
.bottom-2 p { margin-top: 0; margin-bottom: 0; color: #c9ad84; text-align: center; font-size: .875rem; }

@media (max-width: 760px) {
    :root { --gutter: 16px; }
    h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; }
    section { padding-top: 28px; padding-bottom: 28px; }
    section.tight { padding-top: 16px; padding-bottom: 16px; }

    /* Đầu trang hai hàng: logo + tài khoản ở trên, thanh mục ở dưới vuốt ngang được. Không ghim: hai hàng ghim
       lại sẽ ăn mất một phần sáu màn hình điện thoại. */
    .top { position: static; background: var(--panel); border-bottom: 2px solid var(--gold); }
    .bar { gap: 4px 10px; align-items: center; padding-bottom: 4px; }
    .brand img { height: 48px; filter: none; }
    .main, .user { text-shadow: none; }
    .main { padding-top: 0; gap: 4px 22px; }
    .user { margin-left: auto; gap: 10px; font-size: .95rem; padding-top: 0; }
    .user .name { max-width: 9ch; }
    .main { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); -webkit-overflow-scrolling: touch; }
    .main::-webkit-scrollbar { display: none; }

    .grid { gap: 14px; } .card { padding: 16px; }
    .btn.big { padding: 13px 28px; }
    .order { grid-template-columns: 1fr; }
    th, td { padding: 8px 10px; }
    .bottom .wrap { flex-direction: column; align-items: flex-start; }

    /* Thanh mục không còn đè lên băng ảnh, nên băng ảnh thấp lại và chữ trong khung giữ chỗ không cần né thanh mục. */
    .banner { --banner: 260px; } .inner .banner { --banner: 120px; }
    .banner .art.placeholder { padding-top: 12px; }
    .slogan { padding-top: 84px; } .inner .slogan { display: none; }
    /* Chữ nhỏ: viền và bóng mỏng lại cho khỏi nhoè. */
    .slogan h1, .slogan .title { -webkit-text-stroke-width: .5px; text-shadow: 0 1px 0 var(--edge), 0 2px 0 var(--wood-dark), 0 4px 8px rgba(51, 33, 14, .35); }
    .tags { margin-top: 10px; } .tags a { padding: 3px 14px; font-size: .9rem; }
    .frame { margin-top: -40px; }
    .content .wrap, .panel-body { padding-left: 16px; padding-right: 16px; }
    .crumbs { padding-left: 16px; padding-right: 16px; }
    .item { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
    .item h3 { font-size: 1rem; }
    /* Màn hẹp: khung 3:1 quá thấp, chữ trên ảnh ăn gần hết ảnh. */
    .slider .art { aspect-ratio: 2 / 1; }
    .features .art { aspect-ratio: 16 / 9; }
    .slider .cap { padding-right: 16px; padding-bottom: 14px; } .cap strong { font-size: 1.05rem; } .cap small { font-size: .8rem; }
    .dots { bottom: auto; top: 10px; }
    .gallery { grid-template-columns: 1fr 1fr; } .gallery a { height: 110px; }
    .gallery a:first-child { grid-column: 1 / -1; height: 150px; }
}
@media (max-width: 960px) {
    /* Một cột: nút tải lên đầu, rồi nội dung, phần còn lại của cột bên xuống dưới. */
    .frame { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .side { display: contents; }
    .play { order: 1; } .content { order: 2; } .side > :not(.play) { order: 3; }
}
@media (max-width: 380px) {
    /* Máy rất hẹp: nhãn một cột trên, giá trị một cột dưới. */
    dl.kv { grid-template-columns: 1fr; gap: 0; }
    dl.kv dd { margin-bottom: 8px; }
    .user { gap: 8px; font-size: .9rem; }
}
