/* ═══════════════════════════════════════════════════════════════
   tiger_web : สไตล์ตาม design system ของ Tiger Server
   - สีหลัก cyan #33c9e6 / พื้นหลัง navy #06141c
   - ฟอนต์ Orbitron (หัวข้อ/ตัวเลข) Chakra Petch (UI) Kanit (ข้อความไทย)
   - มุมตัดเฉียงด้วย clip-path + inset box-shadow (ห้าม outer shadow บน element ที่ clip)
   - ไม่ใช้ backdrop-filter / color-mix / flex gap ตามข้อกำหนดของเซิร์ฟเวอร์
   ═══════════════════════════════════════════════════════════════ */

:root {
    --cyan: #33c9e6;
    --cyan-rgb: 51, 201, 230;
    --navy: #06141c;
    --panel: rgba(9, 19, 32, 0.9);
    --text: #cfe9f2;
    --text-dim: #6f96a6;
    --good: #3de6a3;
    --bad: #ff5d5d;
    --warn: #ffb84d;
    /* สีเสริม: ใช้แยกประเภทข้อมูลไม่ให้ทั้งหน้าเป็นฟ้าโทนเดียว */
    --gold: #ffcf5c;
    --gold-rgb: 255, 207, 92;
    --violet: #a88bff;
    --violet-rgb: 168, 139, 255;
    --mint: #3de6a3;
    --mint-rgb: 61, 230, 163;
    --chamfer: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    --chamfer-sm: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--navy); }

/* พื้นหลัง: ทิ้งลายตารางที่ทำให้ลายตา เปลี่ยนเป็นแสงนุ่มๆ 3 จุด
   ฟ้าบนกลาง (แบรนด์) · ม่วงบนซ้าย · ทองล่างขวา — ตรึงไว้กับจอ ไม่เลื่อนตามเนื้อหา */
body {
    min-height: 100vh;
    background:
        radial-gradient(1100px 620px at 50% -14%, rgba(var(--cyan-rgb), 0.16), rgba(0, 0, 0, 0) 62%),
        radial-gradient(760px 540px at 4% 6%, rgba(var(--violet-rgb), 0.12), rgba(0, 0, 0, 0) 60%),
        radial-gradient(900px 620px at 96% 92%, rgba(var(--gold-rgb), 0.09), rgba(0, 0, 0, 0) 62%),
        linear-gradient(180deg, #09192a 0%, #061320 46%, #030a12 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
    letter-spacing: 0.2px;
}

/* ── จอกำลังโหลดตอนบูต ── */
.boot-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}
.boot-loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 15px;
    letter-spacing: 2px;
    color: var(--cyan);
    animation: bootPulse 1.2s ease-in-out infinite;
}
@keyframes bootPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

/* ── overlay ขอบมืดนุ่มๆ (เปลี่ยนจากเส้น scanline ที่ทำให้ลายตา) ── */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    background: radial-gradient(ellipse at center, transparent 62%, rgba(2, 8, 14, 0.42) 100%);
}

/* ── panel มุมตัดเฉียง ── */
.panel {
    background:
        linear-gradient(160deg, rgba(var(--cyan-rgb), 0.07) 0%, rgba(0, 0, 0, 0) 42%),
        var(--panel);
    clip-path: var(--chamfer);
    box-shadow:
        inset 0 0 0 1px rgba(var(--cyan-rgb), 0.24),
        inset 0 2px 0 rgba(var(--cyan-rgb), 0.5),
        inset 0 0 44px rgba(var(--cyan-rgb), 0.05);
}

/* ── ปุ่ม ── */
.btn {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    padding: 12px 22px;
    clip-path: var(--chamfer-sm);
    transition: filter 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.btn-primary {
    background: linear-gradient(180deg, #5adcf5 0%, var(--cyan) 55%, #1fa9c7 100%);
    color: #041018;
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.25);
}
.btn-primary:hover {
    filter: brightness(1.12);
    box-shadow:
        inset 0 0 18px rgba(255, 255, 255, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.btn-primary:disabled { filter: grayscale(0.6) brightness(0.7); cursor: wait; }

.btn-ghost {
    background: rgba(var(--cyan-rgb), 0.08);
    color: var(--cyan);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.45);
}
.btn-ghost:hover { background: rgba(var(--cyan-rgb), 0.16); }

.btn-small { padding: 8px 16px; font-size: 12px; }
.btn-block { display: block; width: 100%; margin-top: 16px; }

/* ── input ── */
.input {
    display: block;
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    border: none;
    padding: 12px 14px;
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.35);
}
.input:focus {
    outline: none;
    box-shadow:
        inset 0 0 0 1px rgba(var(--cyan-rgb), 0.9),
        inset 0 0 24px rgba(var(--cyan-rgb), 0.10);
}
.input::placeholder { color: var(--text-dim); }

.input-code {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 8px;
    text-transform: uppercase;
}

.field-label {
    display: block;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 18px 0 8px 0;
}

/* ── ข้อความสถานะ ── */
.msg {
    margin-top: 14px;
    padding: 10px 14px;
    font-size: 14px;
    clip-path: var(--chamfer-sm);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.25);
}
.msg.ok { color: var(--good); box-shadow: inset 0 0 0 1px rgba(61, 230, 163, 0.5); }
.msg.err { color: var(--bad); box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.5); }
.msg.info { color: var(--cyan); }

/* ═══════════ หน้าเข้าสู่ระบบ ═══════════ */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-panel {
    width: 100%;
    max-width: 420px;
    padding: 44px 36px 40px 36px;
    text-align: center;
    position: relative;
}
/* มุมกรอบแบบ HUD ที่มุมขวาบน/ซ้ายล่าง (มุมที่ไม่โดนตัดเฉียง) */
.login-panel::before,
.login-panel::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    pointer-events: none;
}
.login-panel::before {
    top: 8px;
    right: 8px;
    border-top: 2px solid rgba(var(--cyan-rgb), 0.8);
    border-right: 2px solid rgba(var(--cyan-rgb), 0.8);
}
.login-panel::after {
    bottom: 8px;
    left: 8px;
    border-bottom: 2px solid rgba(var(--cyan-rgb), 0.8);
    border-left: 2px solid rgba(var(--cyan-rgb), 0.8);
}

.eyebrow {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 32px;
    letter-spacing: 3px;
    color: var(--cyan);
    text-shadow: 0 0 24px rgba(var(--cyan-rgb), 0.5);
    margin-top: 8px;
    animation: logo-breathe 3.2s ease-in-out infinite;
}
@keyframes logo-breathe {
    0%, 100% { text-shadow: 0 0 18px rgba(var(--cyan-rgb), 0.35); }
    50% { text-shadow: 0 0 34px rgba(var(--cyan-rgb), 0.75), 0 0 70px rgba(var(--cyan-rgb), 0.25); }
}

.divider {
    height: 1px;
    margin: 20px auto;
    width: 70%;
    background: linear-gradient(90deg, transparent, rgba(var(--cyan-rgb), 0.6), transparent);
}

.login-desc { font-size: 15px; color: var(--text); line-height: 1.7; }
.login-desc .cmd {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    color: var(--cyan);
    background: rgba(var(--cyan-rgb), 0.1);
    padding: 2px 8px;
}
.login-panel .field-label { text-align: left; }

/* ═══════════ แถบบน ═══════════ */
.topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 18px 28px;
    background: linear-gradient(90deg, rgba(6, 16, 28, 0.95) 0%, rgba(4, 10, 16, 0.9) 55%, rgba(14, 10, 4, 0.92) 100%);
    box-shadow: inset 0 -8px 24px rgba(var(--cyan-rgb), 0.04);
}
/* เส้นใต้แถบบน: ไล่ฟ้า → ม่วง → ทอง (จุดสีเดียวที่พาดทั้งหน้า) */
.topbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan) 0%, var(--violet) 52%, var(--gold) 100%);
    opacity: 0.85;
}

.brand { display: flex; flex-direction: column; }
.brand-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 2px;
    color: var(--cyan);
    text-shadow: 0 0 18px rgba(var(--cyan-rgb), 0.5);
}
.brand-sub {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 10px;
    letter-spacing: 4px;
    color: var(--text-dim);
    margin-top: 2px;
}

.topbar-right { display: flex; align-items: center; }
.topbar-right .btn { margin-left: 14px; }

.points-chip {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    clip-path: var(--chamfer-sm);
    background: rgba(var(--gold-rgb), 0.09);
    box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.45), inset 0 0 26px rgba(var(--gold-rgb), 0.07);
}
.points-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-right: 10px;
}
.points-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--gold);
}

/* ═══════════ เมนูหลัก: หมวด (ปุ่มใหญ่) + แท็บย่อย ═══════════ */
.nav {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 28px 0 28px;
}
.nav-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 12px;
}
.nav-group {
    display: flex;
    align-items: center;
    text-align: left;
    min-height: 66px;
    padding: 12px 14px;
    background: rgba(8, 16, 28, 0.85);
    color: var(--text-dim);
    border: none;
    cursor: pointer;
    clip-path: var(--chamfer);
    box-shadow:
        inset 0 0 0 1px rgba(var(--cyan-rgb), 0.18),
        inset 0 2px 0 rgba(var(--cyan-rgb), 0.18);
    transition: color 0.15s ease, box-shadow 0.15s ease;
}
.nav-group:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.45), inset 0 2px 0 rgba(var(--cyan-rgb), 0.6); }
.nav-group:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ng-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-right: 12px;
    clip-path: var(--chamfer-sm);
    background: rgba(var(--cyan-rgb), 0.08);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.25);
    color: var(--cyan);
}
.ng-text { display: flex; flex-direction: column; min-width: 0; }
.ng-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.15;
    color: var(--text);
}
.ng-sub {
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
    font-size: 11.5px;
    line-height: 1.3;
    margin-top: 3px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* หมวดที่เลือกอยู่ */
.nav-group.active {
    color: var(--text);
    background: rgba(var(--cyan-rgb), 0.12);
    box-shadow:
        inset 0 0 0 1px rgba(var(--cyan-rgb), 0.7),
        inset 0 3px 0 var(--cyan),
        inset 0 0 40px rgba(var(--cyan-rgb), 0.12);
}
.nav-group.active .ng-icon { background: var(--cyan); color: #041018; box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.35); }

/* ── ร้านค้า & โดเนท: ปุ่มเด่นที่สุดในแถว (ไล่สีฟ้า→ทอง) ── */
.nav-store {
    background: linear-gradient(118deg, rgba(var(--cyan-rgb), 0.20) 0%, rgba(var(--gold-rgb), 0.16) 62%, rgba(9, 19, 32, 0.92) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(var(--gold-rgb), 0.5),
        inset 0 2px 0 rgba(var(--gold-rgb), 0.8),
        inset 0 0 44px rgba(var(--gold-rgb), 0.08);
}
.nav-store:hover { box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.8), inset 0 2px 0 var(--gold), inset 0 0 44px rgba(var(--gold-rgb), 0.14); }
.nav-store .ng-icon { background: rgba(var(--gold-rgb), 0.16); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.55); }
.nav-store .ng-title { color: #ffe29a; }
.nav-store.active {
    background: linear-gradient(118deg, #7ae6ff 0%, #ffe08a 42%, #ffcf5c 68%, #f0a022 100%);
    box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.nav-store.active .ng-title, .nav-store.active .ng-sub { color: #2a1800; }
.nav-store.active .ng-icon { background: rgba(42, 24, 0, 0.82); color: #ffe08a; box-shadow: none; }

/* ── แท็บย่อยของหมวดที่เลือก ── */
.nav-subs {
    display: flex;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-bottom: 2px;
    box-shadow: inset 0 -1px 0 rgba(var(--cyan-rgb), 0.18);
}
.tab {
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    font-size: 14.5px;
    background: none;
    color: var(--text-dim);
    border: none;
    cursor: pointer;
    padding: 10px 4px 12px 4px;
    margin-right: 26px;
    position: relative;
    transition: color 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tab.active { color: var(--cyan); font-weight: 500; }
.tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: var(--cyan);
    box-shadow: 0 0 12px rgba(var(--cyan-rgb), 0.7);
}
/* หมวดที่มีแท็บย่อยเดียว → ซ่อนแถวแท็บย่อยไปเลย */
.nav-subs.single { display: none; }

/* ── แท็บย่อยแบบชิป (หมวดร้านค้า & โดเนท) ──
   ตั้งใจให้เล็กและเบากว่าปุ่มหมวดด้านบนชัดเจน: กว้างตามเนื้อหา ไม่ยืดเต็มแถว
   ตัวที่เลือกอยู่เท่านั้นที่ติดสี ตัวอื่นเป็นเส้นขอบจางๆ */
.nav-subs.chips {
    display: flex;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-bottom: 0;
    box-shadow: none;
}
.tab-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    margin: 0 8px 8px 0;
    padding: 7px 14px;
    clip-path: var(--chamfer-sm);
    background: rgba(7, 15, 26, 0.7);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.16);
}
.tab-chip .tc-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    font-size: 13.5px;
    line-height: 1.2;
    color: var(--text-dim);
}
.tab-chip .tc-sub {
    font-size: 10px;
    font-weight: 300;
    color: var(--text-dim);
    opacity: 0.7;
    margin-top: 1px;
    line-height: 1.25;
}
.tab-chip::after { display: none; }
.tab-chip:hover { box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.4); }
.tab-chip:hover .tc-title { color: var(--text); }
.tab-chip.active .tc-title { font-weight: 500; }
.tab-chip.active .tc-sub { opacity: 0.9; }

.tab-chip-donate.active {
    background: rgba(var(--gold-rgb), 0.1);
    box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.55), inset 0 2px 0 var(--gold);
}
.tab-chip-donate.active .tc-title { color: #ffe29a; }
.tab-chip-shop.active {
    background: rgba(var(--cyan-rgb), 0.1);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.55), inset 0 2px 0 var(--cyan);
}
.tab-chip-shop.active .tc-title { color: #8eeaff; }
.tab-chip-reward.active {
    background: rgba(var(--violet-rgb), 0.1);
    box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb), 0.55), inset 0 2px 0 var(--violet);
}
.tab-chip-reward.active .tc-title { color: #d3c4ff; }

/* ═══════════ ปุ่มโล่ / แถบโหมดแอดมิน ═══════════ */
.icon-btn.icon-btn-admin { color: var(--text-dim); background: rgba(111, 150, 166, 0.08); box-shadow: inset 0 0 0 1px rgba(111, 150, 166, 0.25); }
.icon-btn.icon-btn-admin:hover { background: rgba(255, 93, 93, 0.14); color: #ff9b9b; }
.icon-btn.icon-btn-admin.on {
    color: #1a0505;
    background: var(--bad);
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.3);
}

.admin-bar {
    max-width: 1080px;
    margin: 14px auto 0 auto;
    padding: 0 28px;
}
.admin-bar-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 9px 14px;
    clip-path: var(--chamfer-sm);
    background: linear-gradient(100deg, rgba(255, 93, 93, 0.16) 0%, rgba(9, 19, 32, 0.9) 70%);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.5);
}
.admin-bar-tag {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 2px;
    color: #1a0505;
    background: var(--bad);
    padding: 4px 10px;
    margin-right: 12px;
    clip-path: var(--chamfer-sm);
}
.admin-bar-text { flex: 1; font-size: 13.5px; color: var(--text-dim); min-width: 180px; }
.admin-bar .btn { margin-left: 8px; margin-top: 3px; }

/* ═══════════ แถบโหมดแอดมิน (กำลังดูข้อมูลผู้เล่นคนอื่น) ═══════════ */
.admin-banner {
    max-width: 1080px;
    margin: 14px auto 0 auto;
    padding: 0 28px;
}
.admin-banner-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 14px;
    clip-path: var(--chamfer-sm);
    background: rgba(255, 93, 93, 0.10);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.6), inset 0 0 30px rgba(255, 93, 93, 0.08);
}
.admin-banner-tag {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 2px;
    color: #1a0505;
    background: var(--bad);
    padding: 4px 10px;
    margin-right: 12px;
    clip-path: var(--chamfer-sm);
}
.admin-banner-text { flex: 1; font-size: 14px; color: var(--text); min-width: 200px; }
.admin-banner-text b { color: #ffb3b3; font-weight: 500; }
.adm-ident { font-family: 'Chakra Petch', sans-serif; font-size: 11.5px; color: var(--text-dim); margin-left: 8px; letter-spacing: 0.5px; }
.adm-online-dot { font-size: 12px; margin-left: 8px; }
.adm-online-dot.on { color: var(--good); }
.adm-online-dot.off { color: var(--text-dim); }
.admin-banner .btn { margin-left: auto; margin-top: 4px; }

/* ═══════════ หน้าจัดการผู้เล่น (แอดมิน) ═══════════ */
.adm-count { font-family: 'Orbitron', sans-serif; font-size: 13px; color: var(--good); margin-left: 6px; }
.adm-list { display: flex; flex-direction: column; margin-top: 6px; }
.adm-list-tall { max-height: 420px; overflow-y: auto; }
.adm-row {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    margin-bottom: 6px;
    clip-path: var(--chamfer-sm);
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.16);
}
.adm-row-status {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 10px;
    background: rgba(111, 150, 166, 0.5);
}
.adm-row-status.on { background: var(--good); box-shadow: 0 0 8px rgba(61, 230, 163, 0.8); }
.adm-row-body { flex: 1; min-width: 0; }
.adm-row-name { font-size: 14.5px; font-weight: 400; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-row-meta { font-family: 'Chakra Petch', sans-serif; font-size: 11.5px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-row-sid { font-family: 'Orbitron', sans-serif; font-size: 11px; color: var(--cyan); margin-right: 8px; }
.adm-row .btn { margin-left: 10px; flex-shrink: 0; }

.panel.adm-inv-tools { margin-bottom: 18px; max-width: none; }
.adm-tools-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.adm-tools-head .panel-title { margin: 0; }
.adm-tools-head .btn { margin-left: auto; }
.adm-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    grid-gap: 12px;
    margin-top: 6px;
}
.adm-item-actions { display: flex; flex-wrap: wrap; margin-top: 14px; }
.adm-item-actions .btn { margin-right: 10px; margin-top: 6px; }
.adm-sub { font-family: 'Kanit', sans-serif; font-weight: 400; font-size: 14px; color: var(--text-dim); margin: 16px 0 8px 0; }
.adm-claims { display: flex; flex-direction: column; }
.adm-claim {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 7px 10px;
    margin-bottom: 4px;
    background: rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.12);
}
.adm-claim-at { color: var(--text-dim); font-family: 'Chakra Petch', sans-serif; font-size: 11.5px; margin-left: 10px; }
.inv-item.adm-pick { cursor: pointer; }
.inv-item.adm-pick:hover { box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.7), inset 0 0 24px rgba(255, 93, 93, 0.1); }
.adm-act-give { color: var(--good); }
.adm-act-remove { color: var(--bad); }
.adm-act-claim { color: var(--cyan); }
.adm-act-view { color: var(--text-dim); }
.adm-act-chat { color: var(--warn); }

/* ═══════════ แชทโลกบนเว็บ ═══════════ */
.wc-panel { padding: 0; display: flex; flex-direction: column; }
.wc-panel .chat-older { margin: 10px 14px 0 14px; }
.wc-msgs {
    flex: 1;
    max-height: 60vh;
    min-height: 320px;
    overflow-y: auto;
    padding: 14px 16px;
}
.wc-row {
    display: flex;
    align-items: flex-start;
    padding: 7px 0;
    box-shadow: inset 0 -1px 0 rgba(var(--cyan-rgb), 0.07);
}
.wc-av {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: var(--chamfer-sm);
    background: rgba(var(--cyan-rgb), 0.12);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.3);
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--cyan);
}
.wc-row.web .wc-av { background: rgba(61, 230, 163, 0.12); color: var(--good); box-shadow: inset 0 0 0 1px rgba(61, 230, 163, 0.35); }
.wc-row.anon .wc-av { background: rgba(255, 184, 77, 0.12); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(255, 184, 77, 0.4); }
.wc-body { flex: 1; min-width: 0; }
.wc-head { display: flex; align-items: baseline; flex-wrap: wrap; }
.wc-name { font-size: 14px; font-weight: 500; color: var(--text); margin-right: 8px; }
.wc-sid { font-family: 'Orbitron', sans-serif; font-size: 10px; color: var(--cyan); margin-right: 8px; }
.wc-tag {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 1px 6px;
    margin-right: 8px;
    color: var(--good);
    box-shadow: inset 0 0 0 1px rgba(61, 230, 163, 0.5);
}
.wc-tag.phone { color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.5); }
.wc-tag.anon { color: var(--warn); box-shadow: inset 0 0 0 1px rgba(255, 184, 77, 0.5); }
.wc-time { font-family: 'Chakra Petch', sans-serif; font-size: 11px; color: var(--text-dim); margin-left: auto; }
.wc-del {
    margin-left: 10px;
    padding: 0 7px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.35);
}
.wc-del:hover { color: #1a0505; background: var(--bad); }
.wc-del:disabled { cursor: wait; opacity: 0.5; }
.wc-admin-hint {
    margin: 0 14px;
    padding: 7px 10px;
    font-size: 12.5px;
    color: #ff9b9b;
    background: rgba(255, 93, 93, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.3);
}
.wc-text { font-size: 14.5px; margin-top: 2px; word-break: break-word; overflow-wrap: anywhere; }
.wc-text.mtype { color: var(--text-dim); font-style: italic; }
.wc-img { display: block; max-width: 260px; max-height: 200px; margin-top: 6px; clip-path: var(--chamfer-sm); cursor: zoom-in; }
.wc-inputrow {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-gap: 10px;
    padding: 12px 14px 8px 14px;
    box-shadow: inset 0 1px 0 rgba(var(--cyan-rgb), 0.18);
}
.wc-inputrow.with-name { grid-template-columns: 180px 1fr auto; }
.wc-foot {
    display: flex;
    justify-content: space-between;
    padding: 0 14px 12px 14px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11.5px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}
.wc-foot .free { color: var(--good); }

/* ═══════════ เนื้อหา ═══════════ */
.content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 28px 60px 28px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 16px 0;
}
.section-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    font-size: 22px;
    color: var(--text);
}
.sub-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    font-size: 17px;
    color: var(--text);
    margin: 28px 0 12px 0;
}
.empty-note { color: var(--text-dim); font-size: 14px; margin: 10px 0; }

/* ── การ์ดสถิติ ── */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    grid-gap: 14px;
}
.stat-card { padding: 20px 22px; display: flex; flex-direction: column; }
.stat-wide { grid-column: span 2; }
.stat-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-dim);
}
.stat-value {
    font-size: 22px;
    font-weight: 500;
    margin-top: 8px;
    color: var(--text);
    word-break: break-word;
}
.stat-num { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--cyan); }

/* ── โทนสีตามประเภทข้อมูล: กันทั้งหน้าเป็นฟ้าโทนเดียวจนดูจืด ── */
.tone-cash .stat-num { color: var(--mint); }
.tone-cash { box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.3), inset 0 2px 0 rgba(var(--mint-rgb), 0.7), inset 0 0 50px rgba(var(--mint-rgb), 0.06); }
.tone-bank { box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.3), inset 0 2px 0 rgba(var(--cyan-rgb), 0.75), inset 0 0 50px rgba(var(--cyan-rgb), 0.06); }
.tone-black .stat-num { color: var(--bad); }
.tone-black { box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.28), inset 0 2px 0 rgba(255, 93, 93, 0.6), inset 0 0 50px rgba(255, 93, 93, 0.05); }
.tone-gold .stat-num { color: var(--gold); }
.tone-gold { box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.35), inset 0 2px 0 rgba(var(--gold-rgb), 0.85), inset 0 0 55px rgba(var(--gold-rgb), 0.08); }
.tone-tiger .stat-num { color: var(--violet); }
.tone-tiger { box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb), 0.35), inset 0 2px 0 rgba(var(--violet-rgb), 0.85), inset 0 0 55px rgba(var(--violet-rgb), 0.08); }
.stat-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.stat-accent {
    box-shadow:
        inset 0 0 0 1px rgba(var(--cyan-rgb), 0.55),
        inset 0 2px 0 rgba(var(--cyan-rgb), 0.9),
        inset 0 0 60px rgba(var(--cyan-rgb), 0.12);
}
.ident-line { margin-top: 18px; font-size: 12px; color: var(--text-dim); font-family: 'Chakra Petch', sans-serif; letter-spacing: 1px; }

/* ── กระเป๋า ── */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-gap: 12px;
}
.inv-item {
    background: var(--panel);
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.22);
    padding: 14px 10px;
    text-align: center;
    position: relative;
}
.inv-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px auto;
}
.inv-fallback {
    width: 56px;
    height: 56px;
    margin: 0 auto 8px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--cyan);
    background: rgba(var(--cyan-rgb), 0.08);
    clip-path: var(--chamfer-sm);
}
.inv-label { font-size: 13px; color: var(--text); line-height: 1.4; word-break: break-word; }
.inv-count {
    position: absolute;
    top: 6px;
    right: 6px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 12px;
    color: #041018;
    background: var(--cyan);
    padding: 2px 7px;
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.weapon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-gap: 12px; }
.weapon-item {
    background: var(--panel);
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.22);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.weapon-name { font-family: 'Chakra Petch', sans-serif; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.weapon-ammo { font-family: 'Orbitron', sans-serif; font-size: 13px; color: var(--text-dim); }

.inv-ammo {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ── ช่องค้นหาไอเทม ── */
.inv-search {
    max-width: 360px;
    margin: 0 0 16px 0;
}

/* ── การ์ดเงินบนแท็บกระเป๋า ── */
.inv-money { margin-bottom: 16px; }

/* ── ปุ่มอันตราย (ลบบัญชี) ── */
.btn-danger {
    color: var(--bad);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.45);
    background: rgba(255, 93, 93, 0.06);
    margin-top: 10px;
}
.btn-danger:hover { background: rgba(255, 93, 93, 0.14); }

/* ── ยานพาหนะ ── */
.veh-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-gap: 14px; }
.veh-card {
    background: var(--panel);
    clip-path: var(--chamfer);
    box-shadow:
        inset 0 0 0 1px rgba(var(--cyan-rgb), 0.25),
        inset 0 2px 0 rgba(var(--cyan-rgb), 0.5);
    padding: 18px 22px;
}
.veh-img {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
    position: relative;
    z-index: 1000; /* เหนือ scanline overlay → รูปรถชัด */
}
.veh-name {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 4px;
    word-break: break-word;
}
.veh-plate {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 3px;
    color: var(--cyan);
}
.veh-label { font-size: 15px; margin-top: 6px; }
.veh-meta { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.veh-status {
    display: inline-block;
    margin-top: 10px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.veh-status.in { color: var(--good); background: rgba(61, 230, 163, 0.1); box-shadow: inset 0 0 0 1px rgba(61, 230, 163, 0.45); }
.veh-status.out { color: var(--warn); background: rgba(255, 184, 77, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 184, 77, 0.45); }

/* ── เติมเงิน ── */
.topup-panel { padding: 26px 28px; max-width: 640px; }
.topup-rate {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
}
.rate-num { color: var(--cyan); font-weight: 700; }
.topup-desc { font-size: 14px; line-height: 1.8; margin-top: 10px; color: var(--text); }

.table-wrap { padding: 6px 0; overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history-table th {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: left;
    padding: 12px 18px;
    box-shadow: inset 0 -1px 0 rgba(var(--cyan-rgb), 0.25);
}
.history-table td {
    padding: 11px 18px;
    box-shadow: inset 0 -1px 0 rgba(var(--cyan-rgb), 0.08);
}
.history-table .num { font-family: 'Orbitron', sans-serif; font-weight: 500; }
.st-ok { color: var(--good); }
.st-wait { color: var(--warn); }
.st-err { color: var(--bad); }

/* ── ปุ่มสลับโหมดหน้าเข้าสู่ระบบ ── */
.login-modes { display: flex; margin: 18px 0 16px 0; }
.mode-btn {
    flex: 1;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-dim);
    background: rgba(var(--cyan-rgb), 0.05);
    border: none;
    cursor: pointer;
    padding: 11px 8px;
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.18);
    transition: color 0.15s, background 0.15s;
}
.mode-btn + .mode-btn { margin-left: 10px; }
.mode-btn:hover { color: var(--text); }
.mode-btn.active {
    color: #041018;
    background: var(--cyan);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.9);
}

/* ── หัวข้อย่อยในแผง ── */
.panel-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cyan);
}

/* ── เติมเงินแบบสองช่องทาง (QR / ซอง) ── */
.topup-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 18px;
    margin-top: 14px;
    align-items: start;
}
.topup-cols .topup-panel { max-width: none; }

/* ── กรอบ QR (พื้นขาวรอบโค้ดให้สแกนติดง่าย) ── */
#qr-box { margin-top: 16px; text-align: center; }
.qr-frame {
    background: #ffffff;
    clip-path: var(--chamfer-sm);
    padding: 14px;
    width: 240px;
    max-width: 100%;
    margin: 0 auto 14px auto;
}
#qr-img { display: block; width: 100%; height: auto; }
.qr-pay-line { font-size: 14px; color: var(--text); line-height: 1.7; }
.qr-pay-line strong { color: var(--warn); font-weight: 600; }
.qr-pay-amount {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--cyan);
    padding: 0 4px;
}
.qr-timer-line {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 6px 0 14px 0;
}
#qr-timer { color: var(--warn); font-weight: 700; }
#qr-cancel-btn { margin-top: 10px; }

/* ── ร้านค้าพ้อยท์ ── */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-gap: 14px;
    margin-top: 14px;
}
.shop-card {
    background: var(--panel);
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.22);
    padding: 18px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}
.shop-card:hover {
    box-shadow:
        inset 0 0 0 1px rgba(var(--cyan-rgb), 0.55),
        inset 0 0 30px rgba(var(--cyan-rgb), 0.08);
}
.shop-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px auto;
}
.shop-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}
.shop-desc {
    font-size: 12.5px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-top: 6px;
    flex: 1;
}
.shop-cost {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--cyan);
    margin: 12px 0;
}
.shop-card .btn { margin-top: auto; }

/* ── แผงตั้งรหัสผ่าน (ใช้โครง topup-panel) ── */
#pass-panel { margin-top: 20px; }
#pass-form { margin-top: 6px; }
#pass-current-id { color: var(--good); }

/* ── แชทเว็บ ↔ มือถือในเกม ── */
.chat-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-gap: 16px;
    margin-top: 14px;
    align-items: start;
}
.chat-side { padding: 14px; }
.chat-new { margin-bottom: 12px; }
.chat-new .btn { margin-top: 8px; }

.chat-room {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(var(--cyan-rgb), 0.04);
    border: none;
    cursor: pointer;
    color: var(--text);
    font-family: 'Kanit', sans-serif;
    padding: 10px 12px;
    margin-bottom: 8px;
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.18);
    transition: background 0.15s;
}
.chat-room:hover { background: rgba(var(--cyan-rgb), 0.10); }
.chat-room.active {
    background: rgba(var(--cyan-rgb), 0.16);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.6);
}
.chat-room-top { display: flex; align-items: center; justify-content: space-between; }
.chat-room-name {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--cyan);
}
.chat-unread {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #041018;
    background: var(--cyan);
    padding: 2px 8px;
    clip-path: var(--chamfer-sm);
    margin-left: 8px;
}
.chat-room-last {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main { padding: 0; min-height: 480px; display: flex; flex-direction: column; }
.chat-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 14px;
    padding: 40px 20px;
    text-align: center;
}
#chat-thread { display: flex; flex-direction: column; flex: 1; min-height: 480px; }
#chat-thread[hidden] { display: none; }
.chat-head {
    padding: 14px 18px;
    box-shadow: inset 0 -1px 0 rgba(var(--cyan-rgb), 0.25);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--cyan);
}
.chat-with-number { color: var(--text-dim); font-weight: 400; font-size: 12px; margin-left: 10px; }
.chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    max-height: 460px;
}
.chat-row { margin-bottom: 10px; }
.chat-row.mine { text-align: right; }
.chat-row.their { text-align: left; }
.chat-bubble {
    display: inline-block;
    max-width: 78%;
    padding: 9px 13px;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    word-break: break-word;
    clip-path: var(--chamfer-sm);
}
.chat-row.their .chat-bubble {
    background: rgba(var(--cyan-rgb), 0.08);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.25);
}
.chat-row.mine .chat-bubble {
    background: rgba(var(--cyan-rgb), 0.22);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.45);
}
.chat-img {
    display: block;
    max-width: 240px;
    max-height: 240px;
    position: relative;
    z-index: 1000; /* เหนือ scanline overlay → รูปชัดไม่มีลายขีด */
}
.chat-mtype { color: var(--text-dim); font-style: italic; }
.chat-time {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-top: 3px;
}
.chat-inputrow {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-gap: 10px;
    padding: 12px 14px;
    box-shadow: inset 0 1px 0 rgba(var(--cyan-rgb), 0.25);
}

/* ── ปุ่มกลับในแชท (โชว์เฉพาะจอเล็ก) ── */
.chat-back {
    display: none;
    background: rgba(var(--cyan-rgb), 0.12);
    border: none;
    cursor: pointer;
    color: var(--cyan);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 12px;
    margin-right: 10px;
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.4);
}

/* ── ปุ่มโหลดข้อความเก่า ── */
.chat-older {
    display: block;
    width: calc(100% - 36px);
    margin: 10px auto 0 auto;
    background: rgba(var(--cyan-rgb), 0.06);
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    font-family: 'Kanit', sans-serif;
    font-size: 12.5px;
    padding: 8px;
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.2);
}
.chat-older:hover { color: var(--cyan); background: rgba(var(--cyan-rgb), 0.12); }
.chat-older:disabled { cursor: wait; filter: brightness(0.7); }

/* รูปในแชทกดดูได้ */
.chat-img { cursor: zoom-in; }

/* ── ตัวดูรูปเต็มจอ ── */
.img-viewer {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(2, 8, 12, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001; /* เหนือ scanline overlay → รูปเต็มจอชัด */
    cursor: zoom-out;
    padding: 24px;
}
.img-viewer img {
    max-width: 92%;
    max-height: 92%;
    box-shadow: 0 0 60px rgba(var(--cyan-rgb), 0.25);
}

/* ── คำเตือนตั้งรหัสผ่าน ── */
.pass-warn {
    font-size: 13px;
    color: var(--warn);
    line-height: 1.7;
    background: rgba(255, 184, 77, 0.07);
    padding: 10px 14px;
    margin: 10px 0 4px 0;
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(255, 184, 77, 0.35);
}

/* ── ตารางจัดอันดับ ── */
.rk-col { width: 64px; }
.rk {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--text-dim);
}
.rk.rk-1 { color: #ffd76a; }
.rk.rk-2 { color: #cfd8e3; }
.rk.rk-3 { color: #e0a06a; }

/* ── โหมด QR อัตโนมัติ ── */
.qr-auto-note {
    font-size: 13.5px;
    color: var(--good);
    line-height: 1.8;
    background: rgba(61, 220, 132, 0.07);
    padding: 12px 14px;
    margin-bottom: 10px;
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(61, 220, 132, 0.35);
}

/* ── ช่องค้นหา + แบ่งหน้า ── */
.search-input { margin-bottom: 14px; }
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding-top: 14px;
    box-shadow: inset 0 1px 0 rgba(var(--cyan-rgb), 0.15);
}
.pager-info {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    color: var(--text-dim);
    margin: 0 16px;
    min-width: 190px;
    text-align: center;
}
.pager .btn:disabled { opacity: 0.4; cursor: default; }

/* หลอดทักษะแบบ 10 ขีด (กว้างขึ้น อ่านง่ายขึ้น) */
.skill-seg { max-width: 34px; }

/* ── ปุ่มไอคอน (รูปคน / ปิด) ── */
.icon-btn {
    background: rgba(var(--cyan-rgb), 0.08);
    color: var(--cyan);
    border: none;
    cursor: pointer;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.3);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    margin-left: 8px;
    transition: background 0.15s;
}
.icon-btn:hover { background: rgba(var(--cyan-rgb), 0.18); }

/* ── แผงเลื่อน (ตั้งค่าบัญชี) + กล่องลอย ── */
.drawer { position: fixed; inset: 0; z-index: 800; }
.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 14, 0.75);
}
.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--navy);
    box-shadow: inset 1px 0 0 rgba(var(--cyan-rgb), 0.3);
    overflow-y: auto;
    padding: 18px;
}
.drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}
.drawer-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 15px;
    letter-spacing: 1.5px;
    color: var(--cyan);
}
.drawer-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.drawer-body .topup-panel { margin-bottom: 14px; }

/* ── กล่องส่งของขวัญ ── */
.gift-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 400px;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
}
.gift-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-gap: 8px;
    align-items: start;
}
.gift-row .input { margin-bottom: 8px; }
.gift-found {
    background: rgba(61, 220, 132, 0.08);
    box-shadow: inset 0 0 0 1px rgba(61, 220, 132, 0.35);
    clip-path: var(--chamfer-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
}
.gift-found-label { font-size: 11.5px; color: var(--text-dim); display: block; }
.gift-found-name {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    color: var(--good);
    font-size: 14px;
}
.gift-count { text-align: right; font-size: 11.5px; color: var(--text-dim); margin-bottom: 10px; }

/* ปุ่มในการ์ดร้านค้า: แลกเลย (หลัก) + ส่งของขวัญ (รอง) เรียงบนล่าง สูงเท่ากัน */
.shop-actions {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 8px;
    margin-top: auto;
}
.btn-buy { width: 100%; }
.btn-gift {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--cyan-rgb), 0.07);
    color: var(--cyan);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.4);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 12px;
    transition: background 0.15s;
}
.btn-gift:hover { background: rgba(var(--cyan-rgb), 0.16); }
.btn-gift svg { margin-right: 8px; flex-shrink: 0; }

/* ── SKILL MATRIX ── */
.skill-panel { padding: 20px; margin-top: 16px; }
.skill-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}
.skill-kicker {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--text-dim);
}
.skill-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    color: var(--text);
    margin: 4px 0 0 0;
}
.skill-overall { text-align: right; }
.skill-overall-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--cyan);
    line-height: 1.1;
}
.skill-row {
    display: grid;
    grid-template-columns: 150px 1fr 74px;
    align-items: center;
    margin-bottom: 12px;
}
.skill-name-en {
    font-family: 'Orbitron', sans-serif;
    font-size: 12.5px;
    letter-spacing: 1px;
    color: var(--text);
}
.skill-name-th { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.skill-bar {
    display: flex;
    align-items: center;
    height: 20px;
    overflow: hidden;
}
.skill-seg {
    display: block;
    width: 100%;
    max-width: 16px;
    height: 18px;
    margin-right: 3px;
    background: rgba(var(--cyan-rgb), 0.10);
    transform: skewX(-18deg);
}
.skill-seg.on { background: var(--cyan); }
.skill-value {
    text-align: right;
    font-family: 'Orbitron', sans-serif;
    color: var(--text);
}
.skill-value-int { font-size: 19px; font-weight: 700; }
.skill-value-dec { font-size: 11px; color: var(--text-dim); }
.skill-foot {
    font-size: 12.5px;
    color: var(--text-dim);
    margin: 14px 0 0 0;
    padding-top: 12px;
    box-shadow: inset 0 1px 0 rgba(var(--cyan-rgb), 0.15);
}

/* ── กันลาก/ก็อปรูป ── */
img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* จอเล็ก: แถวทักษะซ้อนกัน */
@media (max-width: 620px) {
    .skill-row { grid-template-columns: 110px 1fr 60px; }
    .skill-seg { max-width: 22px; margin-right: 2px; }
    .skill-title { font-size: 19px; }
    .skill-overall-num { font-size: 24px; }
}

/* ── หน้าใส่รหัส PIN (ขั้นที่ 2) ── */
.pin-gate {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 12, 18, 0.92);
    padding: 20px;
}
.pin-box {
    width: 100%;
    max-width: 340px;
    padding: 26px 24px;
}
.pin-input {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    letter-spacing: 8px;
}
#pin-panel .input, #rename-panel .input { margin-bottom: 10px; }
.rename-row { grid-template-columns: 1fr 1fr; }
.sub-title-first { margin-top: 0; }
.shop-card-done { opacity: 0.55; }

/* ── ของมีเวลาหมดอายุ ── */
.exp-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 12px;
}
.exp-item {
    background: var(--panel);
    clip-path: var(--chamfer-sm);
    box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.22);
    padding: 14px 16px;
    display: flex;
    align-items: center;
}
.exp-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin-right: 12px;
    flex-shrink: 0;
}
.exp-body { flex: 1; min-width: 0; }
.exp-label {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exp-left {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--warn);
    margin: 3px 0 5px 0;
}
.exp-left.exp-ended { color: var(--bad); }
.exp-bar {
    height: 6px;
    background: rgba(var(--cyan-rgb), 0.10);
    clip-path: var(--chamfer-sm);
    overflow: hidden;
}
.exp-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--warn), var(--cyan));
    transition: width 1s linear;
}
.exp-until {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 5px;
}

/* ── ฟุตเตอร์ ── */
.footer {
    text-align: center;
    padding: 26px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ── จอเล็ก ── */
@media (max-width: 900px) {
    .nav-groups { grid-template-columns: repeat(3, 1fr); }
    .ng-sub { display: none; }
}
@media (max-width: 700px) {
    .nav-groups { grid-template-columns: 1fr 1fr; }
    .nav-store { grid-column: span 2; }
    .tab-chip { flex: 1 1 auto; margin-right: 6px; padding: 7px 10px; }
    .tab-chip .tc-sub { display: none; }
}
@media (max-width: 640px) {
    .stat-wide { grid-column: span 1; }
    .topbar { padding: 14px 16px; }
    .nav { padding: 14px 16px 0 16px; }
    .nav-group { min-height: 56px; padding: 10px 10px; }
    .ng-icon { width: 34px; height: 34px; margin-right: 9px; }
    .ng-title { font-size: 14.5px; }
    .ng-sub { display: none; }
    .content { padding: 6px 16px 50px 16px; }
    .tab { padding: 9px 2px 11px 2px; font-size: 13.5px; margin-right: 18px; }
    .admin-banner, .admin-bar { padding: 0 16px; }
    .adm-item-row { grid-template-columns: 1fr; }
    .wc-inputrow.with-name { grid-template-columns: 1fr; }
    .wc-msgs { max-height: 55vh; min-height: 260px; padding: 10px 12px; }
    .brand-name { font-size: 17px; }
    .points-value { font-size: 15px; }
    /* แถบบนจอแคบ: ปุ่มไม่ตกบรรทัด */
    .topbar-right .btn { padding: 9px 13px; font-size: 12px; margin-left: 8px; }
    .topbar-right .icon-btn { margin-left: 8px; width: 34px; height: 34px; }
    .points-chip { padding: 6px 10px; }
    .points-label { margin-right: 7px; letter-spacing: 1px; }
    .topup-panel { padding: 20px 18px; }
    .topup-cols { grid-template-columns: 1fr; }
    .chat-wrap { grid-template-columns: 1fr; }
    .chat-back { display: inline-block; }
    .chat-wrap.show-thread .chat-side { display: none; }
    .chat-wrap:not(.show-thread) .chat-main { display: none; }
    /* กรอบขนาดพอดีจอ: ข้อความเลื่อนในกรอบ ไม่ดันหน้ายาว */
    .chat-main { min-height: 0; }
    #chat-thread { min-height: 0; }
    .chat-msgs { max-height: 52vh; min-height: 240px; }
    .chat-bubble { max-width: 88%; }
    .shop-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ── ผู้ใช้ที่ปิดการเคลื่อนไหว ── */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
