/* =====================================================================
   JK'FCO — giao diện "Warm Night": nền than ấm, chữ kem, ô pastel.
   Một file CSS duy nhất. Biến cũ (--text-dim, --primary, ...) được giữ
   làm bí danh vì JS còn dùng trong style inline.
   ===================================================================== */

/* ---------------- TOKENS ---------------- */
:root {
    --bg: #17140f; --bg-dot: rgba(241, 233, 218, .045);
    --surface: #201c16; --surface-2: #2a251e; --surface-3: #342e25;
    --line: rgba(241, 233, 218, .1); --line-2: rgba(241, 233, 218, .2); --cream: #efe6d2;
    --text: #f1e9da; --muted: #a99e8a; --dim: #7c7262;
    --ink: #1c170f; --ink-soft: rgba(28, 23, 15, .66);
    --mustard: #e9bb48; --rose: #e98fb4; --sky: #73b6e2; --mint: #a9dcc2; --peach: #f2a77d;
    --ok: #74d39c; --warn: #f0a94e; --bad: #ef7462; --info: #73b6e2;
    --tab-accent: var(--mustard);
    --term-bg: #100e0a;
    --shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 22px 44px -28px rgba(0, 0, 0, .7);
    --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
    --display: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
    --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    /* bí danh cho style inline trong JS cũ */
    --text-main: var(--text); --text-muted: var(--muted); --text-dim: var(--dim);
    --border-color: var(--line); --border-glow: var(--line-2);
    --bg-base: var(--term-bg); --bg-surface: var(--surface); --bg-elevated: var(--surface-2); --bg-hover: var(--surface-3);
    --primary: var(--mustard); --accent: var(--ok); --warning: var(--warn); --danger: var(--bad);
    --radius: var(--r-lg);
}
:root[data-theme="light"] {
    --bg: #f5efe3; --bg-dot: rgba(40, 30, 15, .06);
    --surface: #fffcf5; --surface-2: #f1e9da; --surface-3: #e6dbc6;
    --line: rgba(40, 30, 15, .1); --line-2: rgba(40, 30, 15, .2); --cream: #2b2418;
    --text: #231d14; --muted: #6b6150; --dim: #958a76;
    --ok: #2c9a5f; --warn: #b8700f; --bad: #cc4633; --info: #2f7fb5;
    --mustard: #e0ac2c;
    --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 36px -26px rgba(60, 40, 10, .35);
}
/* JS cũ còn ghi color:#fff inline — đổi theo theme sáng */
:root[data-theme="light"] [style*="color:#fff"], :root[data-theme="light"] [style*="color: #fff"] { color: var(--text) !important; }

/* ---------------- BASE ---------------- */
.web-user-menu { position: relative; flex: none; }
.web-user-menu summary { list-style: none; cursor: pointer; display: block; border-radius: 50%; }
.web-user-menu summary::-webkit-details-marker { display: none; }
.avatar.me { width: 38px; height: 38px; font-size: 13px; background: var(--mustard); border: 1.5px solid var(--line-2); transition: box-shadow .2s; }
.web-user-menu summary:hover .avatar.me, .web-user-menu[open] summary .avatar.me { box-shadow: 0 0 0 3px color-mix(in oklab, var(--mustard) 35%, transparent); }
.web-user-actions {
    position: absolute; right: 0; top: calc(100% + 12px); z-index: 40; padding: 8px; width: 236px; display: grid; gap: 2px;
    border-radius: 20px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .6);
    animation: rise .18s ease;
}
.wu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.wu-head .avatar.me { width: 34px; height: 34px; }
.wu-head > div { min-width: 0; }
.wu-head b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wu-head small { color: var(--muted); font-size: 12px; }
.wu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; cursor: pointer; text-align: left;
    padding: 9px 10px; border-radius: 12px; font-size: 13.5px; font-weight: 500; color: var(--text);
}
.wu-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.wu-item:hover, .wu-item.active { background: var(--surface-2); }
.wu-out { color: var(--bad); margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; padding-top: 11px; }
.wu-out svg { color: var(--bad); }
.table-scroll { max-width: 100%; overflow-x: auto; }
#web-password, #web-users-card { margin-bottom: 18px; }
.bot-busy-notice { color: var(--warn); padding: 12px; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
body {
    font-family: var(--body); color: var(--text); font-size: 14px; line-height: 1.5; min-height: 100vh;
    background: var(--bg) radial-gradient(var(--bg-dot) 1px, transparent 1px) 0 0 / 22px 22px;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
pre { font-family: var(--mono); }
strong, b { font-weight: 600; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); font-size: 12.5px; }
.dim { color: var(--dim); }
.hidden { display: none !important; }
::selection { background: color-mix(in oklab, var(--mustard) 40%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- PER-TAB DYNAMIC FRAME THEME ---------------- */
:root[data-active-tab="tab-overview"] { --tab-accent: var(--mustard); }
:root[data-active-tab="tab-players"] { --tab-accent: var(--mint); }
:root[data-active-tab="tab-craft"] { --tab-accent: var(--peach); }
:root[data-active-tab="tab-glxh"], :root[data-active-tab="tab-glxh-stats"] { --tab-accent: var(--mustard); }
:root[data-active-tab="tab-insert"] { --tab-accent: var(--rose); }
:root[data-active-tab="tab-ttcn"], :root[data-active-tab="tab-market"] { --tab-accent: var(--sky); }
:root[data-active-tab="tab-events"] { --tab-accent: var(--ok); }
:root[data-active-tab="tab-catalog"] { --tab-accent: var(--mint); }
:root[data-active-tab="tab-account"] { --tab-accent: var(--peach); }
:root[data-active-tab="tab-settings"], :root[data-active-tab="tab-logs"] { --tab-accent: var(--cream); }

/* ---------------- APP VIEWPORT FRAME (NỘI DUNG CHỈ HIỆN TRÊN DOCK, KHÔNG GHI ĐÈ) ---------------- */
body:has(> .app-viewport) {
    height: 100dvh; min-height: 0;
    display: flex; flex-direction: column; overflow: hidden;
}
.app-viewport {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    background: radial-gradient(820px 280px at 50% 0%, color-mix(in oklab, var(--tab-accent) 12%, transparent), transparent 72%);
    transition: background .35s ease;
}

/* ---------------- SHELL / LEFT MINI-RAIL (KIỂU 3) ---------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.shell { max-width: 1280px; margin: 0 auto; padding: 18px 24px 40px; }
.shell.rail-layout {
    max-width: 1320px;
    display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; align-items: start;
}
.rail-main { min-width: 0; position: relative; z-index: 1; }
.rail-main .lobby-hero { margin-top: 0; }
.rail-main .page-head { margin-top: 8px; }

.left-rail {
    position: sticky; top: 18px; z-index: 60;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 12px 10px; border-radius: 26px;
    background: color-mix(in oklab, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1.5px solid color-mix(in oklab, var(--tab-accent) 36%, var(--line-2));
    box-shadow: var(--shadow), 0 0 24px -12px color-mix(in oklab, var(--tab-accent) 40%, transparent);
    transition: border-color .3s ease, box-shadow .3s ease;
}
.rail-brand {
    position: relative;
    width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink);
    background: var(--tab-accent); color: var(--ink);
    display: grid; place-items: center; cursor: pointer;
    box-shadow: 0 3px 0 var(--ink);
    transition: transform .16s cubic-bezier(.2, .8, .2, 1), background .3s ease, box-shadow .16s;
}
.rail-brand svg { width: 20px; height: 20px; stroke-width: 2.2; }
.rail-brand:hover { transform: translateY(-2px) scale(1.04); }
.rail-brand:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.rail-brand.active { box-shadow: 0 3px 0 var(--ink), 0 0 0 3px color-mix(in oklab, var(--tab-accent) 38%, transparent); }
.rail-sep { width: 28px; height: 1px; background: var(--line-2); margin: 2px 0; }

.rail-dock {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.rail-dock-item {
    --app-c: var(--mustard);
    position: relative; border: 0; background: none; padding: 0; cursor: pointer;
    display: grid; place-items: center;
    transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.rail-dock-item .dock-ico { width: 42px; height: 42px; border-radius: 14px; }
.rail-dock-item:hover .dock-ico {
    transform: translateY(-2px) scale(1.07);
    background: var(--app-c); color: var(--ink); border-color: var(--ink);
    box-shadow: 0 4px 0 var(--ink), 0 10px 20px -8px color-mix(in oklab, var(--app-c) 65%, transparent);
}
.rail-dock-item.active .dock-ico {
    background: var(--app-c); color: var(--ink); border-color: var(--ink);
    transform: scale(1.05);
    box-shadow: 0 3px 0 var(--ink), 0 8px 18px -6px color-mix(in oklab, var(--app-c) 72%, transparent);
}
.rail-dock-item.active::before {
    content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
    width: 3.5px; height: 18px; border-radius: 0 99px 99px 0; background: var(--app-c);
}

.rail-tip {
    position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%) translateX(-4px);
    padding: 5px 11px; border-radius: 10px; white-space: nowrap; pointer-events: none; z-index: 90;
    background: color-mix(in oklab, var(--surface) 96%, #000);
    border: 1px solid color-mix(in oklab, var(--app-c, var(--tab-accent)) 45%, var(--line-2));
    color: var(--text); font-size: 12px; font-weight: 600;
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6);
    opacity: 0; transition: opacity .15s ease, transform .15s ease;
}
.rail-brand:hover .rail-tip, .rail-brand:focus-visible .rail-tip,
.rail-dock-item:hover .rail-tip, .rail-dock-item:focus-visible .rail-tip {
    opacity: 1; transform: translateY(-50%) translateX(0);
}

.rail-user-menu { position: relative; }
.rail-dots-btn {
    width: 42px; height: 42px; border-radius: 50%;
    border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--muted);
    display: grid; place-items: center; cursor: pointer;
    transition: transform .16s, background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.rail-dots-btn svg { width: 20px; height: 20px; }
.rail-user-menu > summary:hover .rail-dots-btn,
.rail-user-menu[open] > summary .rail-dots-btn {
    color: var(--ink); background: var(--tab-accent); border-color: var(--ink);
    box-shadow: 0 3px 0 var(--ink); transform: translateY(-1px);
}
.rail-user-menu .web-user-actions {
    left: calc(100% + 14px); right: auto; top: auto; bottom: 0; z-index: 80;
    border-color: color-mix(in oklab, var(--tab-accent) 35%, var(--line-2));
}
.web-user-actions .wu-item .conn {
    width: 9px; height: 9px; flex: none; margin: 0 3px;
}

@media (max-width: 760px) {
    .shell.rail-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .left-rail {
        position: sticky; top: 8px; flex-direction: row; justify-content: space-between; gap: 8px;
        padding: 8px 10px; border-radius: 20px; width: 100%;
    }
    .rail-sep { display: none; }
    .rail-brand { width: 38px; height: 38px; flex: none; }
    .rail-brand svg { width: 18px; height: 18px; }
    .rail-dock {
        flex-direction: row; flex: 1 1 auto; min-width: 0; gap: 6px;
        overflow-x: auto; scrollbar-width: none; padding: 2px 0; justify-content: center;
    }
    .rail-dock::-webkit-scrollbar { display: none; }
    .rail-dock-item .dock-ico { width: 36px; height: 36px; border-radius: 11px; }
    .rail-dock-item .dock-ico svg { width: 17px; height: 17px; }
    .rail-dock-item.active::before {
        left: 50%; top: auto; bottom: -5px; transform: translateX(-50%);
        width: 14px; height: 3px; border-radius: 99px;
    }
    .rail-tip { display: none; }
    .rail-dots-btn { width: 38px; height: 38px; flex: none; }
    .rail-user-menu .web-user-actions { left: auto; right: 0; top: calc(100% + 10px); bottom: auto; }
}

.topbar {
    position: sticky; top: 14px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 7px 8px 7px 16px; border: 1px solid color-mix(in oklab, var(--tab-accent) 34%, var(--line-2)); border-radius: 999px;
    background: color-mix(in oklab, var(--surface) 86%, transparent); backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    box-shadow: var(--shadow), 0 0 0 1px color-mix(in oklab, var(--tab-accent) 14%, transparent) inset;
    transition: border-color .3s ease, box-shadow .3s ease;
}
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 20px; white-space: nowrap; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--tab-accent); color: var(--ink); font-size: 13px; letter-spacing: -.02em; border: 1.5px solid var(--ink); transition: background .3s ease; }
.brand small { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--dim); letter-spacing: .06em; }
.nav { display: flex; gap: 2px; margin: 0 auto; padding: 4px; border-radius: 999px; background: var(--surface-2); min-width: 0; }
.nav .nav-item {
    border: 0; background: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px;
    color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; transition: color .2s, background .2s;
}
.nav .nav-item svg { width: 16px; height: 16px; flex: none; }
.nav .nav-item:hover { color: var(--text); }
.brand { cursor: pointer; }
.nav > .nav-item, .nav > .more-wrap { flex: none; }
/* Menu chính giữ đủ chỗ cho các nút (không tràn đè ô tài khoản); ô tài khoản co tên lại trước. */
.topbar > .nav { flex: none; }
.topbar > .top-right { flex: 0 1 auto; }
.nav .nav-item { position: relative; }
/* Menu "Thêm" */
.more-wrap { position: relative; display: flex; }
.more-wrap .nav-more { flex: 1; }
.more-menu {
    position: absolute; top: calc(100% + 12px); right: 0; z-index: 50; min-width: 200px; padding: 6px;
    display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line-2); border-radius: 18px;
    background: var(--surface); box-shadow: var(--shadow);
}
.more-menu[hidden] { display: none; }
.more-wrap .more-menu .nav-item {
    display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; width: 100%;
    padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--text);
    font-size: 13.5px; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer;
}
.more-wrap .more-menu .nav-item svg { width: 16px; height: 16px; flex: none; }
.more-wrap .more-menu .nav-item:hover { background: var(--surface-2); }
.more-wrap .more-menu .nav-item.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--mustard); }
.more-wrap .more-menu .live-pip { position: static; }
.nav .nav-item.active { background: var(--cream); color: var(--bg); }
.live-pip { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 25%, transparent); display: none; flex: none; }
.live-pip.show { display: inline-block; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; justify-content: flex-end; }
.acct-chip { display: flex; align-items: center; gap: 8px; height: 38px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; max-width: 210px; min-width: 0; }
.acct-chip .avatar { width: 30px; height: 30px; }
.acct-chip:hover { border-color: var(--line-2); }
.acct-chip .nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; text-transform: uppercase; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.conn.ok { background: var(--ok); } .conn.warn { background: var(--warn); } .conn.bad { background: var(--bad); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; transition: border-color .2s; color: var(--text); flex: none; }
.icon-btn:hover, .icon-btn.active { border-color: var(--cream); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------------- PAGES ---------------- */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 36px 4px 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.05; letter-spacing: -.02em; margin-top: 6px; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 620px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------- LAYOUT ---------------- */
.grid { display: grid; gap: 16px; }
.g-hero { grid-template-columns: 1.65fr 1fr; }
.g-main { grid-template-columns: 1.4fr 1fr; align-items: start; }
.g-side { grid-template-columns: 1fr 1.4fr; align-items: start; }
.g-2, .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.g-3, .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 .grid-2 { gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mt { margin-top: 16px; }
.grid > *, .g-2 > *, .grid-2 > * { min-width: 0; }

/* ---------------- CARDS ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 0; }
.card.outlined { border: 1.5px solid var(--cream); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.15; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.section-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 16px 0 8px; }
.banner { border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 16px; font-size: 13.5px; line-height: 1.55; }
.banner-bad, .trade-guard-banner { border: 1.5px solid var(--bad) !important; background: color-mix(in oklab, var(--bad) 12%, var(--surface)) !important; }
.banner-warn { border: 1.5px solid var(--warn); background: color-mix(in oklab, var(--warn) 12%, var(--surface)); }
.trade-guard-banner { margin-bottom: 16px; }

/* ---------------- BUTTONS ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; cursor: pointer;
    font-weight: 600; font-size: 13.5px; padding: 9px 17px; border: 1.5px solid var(--line-2); background: transparent;
    color: var(--text); transition: border-color .18s, transform .12s, background .18s, box-shadow .18s; white-space: nowrap; text-decoration: none; line-height: 1.3;
}
.btn:hover:not(:disabled) { border-color: var(--cream); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: transparent; }
.btn-primary, .btn-accent { background: var(--mustard); color: var(--ink); border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.btn-primary:hover:not(:disabled), .btn-accent:hover:not(:disabled) { border-color: var(--ink); filter: brightness(1.05); }
.btn-danger { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 45%, transparent); }
.btn-danger:hover:not(:disabled) { border-color: var(--bad); background: color-mix(in oklab, var(--bad) 10%, transparent); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--line); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
/* Nút hành động chính: viên thuốc vàng + nút tròn mực, icon vẽ bằng CSS để JS đổi chữ thoải mái */
.btn-cta { padding: 7px 7px 7px 20px; font-size: 14.5px; font-weight: 700; gap: 12px; box-shadow: 0 3px 0 var(--ink); }
.btn-cta::after {
    content: ""; width: 32px; height: 32px; border-radius: 50%; flex: none;
    background: var(--ink) no-repeat center / 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e9bb48' d='M6 3.8v16.4L20 12z'/%3E%3C/svg%3E");
}
.btn-cta.btn-danger { background: var(--surface-3); color: var(--text); border-color: var(--line-2); box-shadow: none; }
.btn-cta.btn-danger::after { background-color: var(--bad); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect fill='%23fff' x='5' y='5' width='14' height='14' rx='2.5'/%3E%3C/svg%3E"); }
.btn-cta.plus::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath stroke='%23e9bb48' stroke-width='3.4' stroke-linecap='round' d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.btn-cta.arrow::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e9bb48' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
/* nút nhỏ trong bảng (JS đặt style font-size:11px inline) */
td .btn, .row-actions .btn { margin: 2px 2px 2px 0; }
.link-btn { background: none; border: 0; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; }
.link-btn:hover { color: var(--text); }

/* ---------------- PILLS ---------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; line-height: 1.45; }
.pill .d, .pill.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-success { color: var(--ok); background: color-mix(in oklab, var(--ok) 13%, transparent); border-color: color-mix(in oklab, var(--ok) 32%, transparent); }
.pill-danger { color: var(--bad); background: color-mix(in oklab, var(--bad) 13%, transparent); border-color: color-mix(in oklab, var(--bad) 32%, transparent); }
.pill-warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 13%, transparent); border-color: color-mix(in oklab, var(--warn) 32%, transparent); }
.pill-info { color: var(--info); background: color-mix(in oklab, var(--info) 13%, transparent); border-color: color-mix(in oklab, var(--info) 32%, transparent); }
.pill-muted { color: var(--muted); }
.tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--mustard); color: var(--ink); font-weight: 600; }

/* ---------------- TILES (ô pastel) ---------------- */
.tile { border-radius: var(--r-lg); padding: 16px 18px; border: 1.5px solid var(--ink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); min-height: 116px; display: flex; flex-direction: column; min-width: 0; }
.tile .eyebrow { color: var(--ink-soft); }
.tile .val { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1.05; margin-top: auto; padding-top: 8px; overflow-wrap: anywhere; }
.tile .sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; overflow-wrap: anywhere; }
.t-mustard { background: var(--mustard); } .t-rose { background: var(--rose); } .t-sky { background: var(--sky); } .t-peach { background: var(--peach); } .t-mint { background: var(--mint); }
.tile .wld { margin: 6px 0 0; }
.tile .wld i { width: 16px; height: 16px; font-size: 9px; border-radius: 5px; border: 1px solid rgba(28, 23, 15, .3); background: rgba(255, 255, 255, .5); color: var(--ink); }
.tile .wld i.w { background: #1f7a4a; color: #fff; } .tile .wld i.l { background: #b23a2a; color: #fff; }
.tile .muted, .tile small { color: var(--ink-soft) !important; }

/* ---------------- HERO (Tổng quan) ---------------- */
.hero { position: relative; overflow: hidden; min-height: 320px; display: flex; flex-direction: column; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--bg-dot) 1px, transparent 1px); background-size: 14px 14px; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-status { margin-top: 20px; display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.big-line { font-family: var(--display); font-weight: 800; font-size: 52px; line-height: 1.08; letter-spacing: -.025em; }
.big-line .hl { background: color-mix(in oklab, var(--mustard) 24%, transparent); color: var(--mustard); padding: 0 10px; border-radius: 12px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
:root[data-theme="light"] .big-line .hl { color: #8a5d00; }
.big-clock { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big-clock small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
.hero-sub { margin-top: 14px; color: var(--muted); max-width: 640px; }
.hero-foot { margin-top: auto; padding-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-foot .progress { flex: 1; min-width: 160px; }
.phases { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.phase { font-size: 12px; padding: 4px 11px; border-radius: 999px; border: 1px dashed var(--line-2); color: var(--dim); }
.phase.done { border-style: solid; color: var(--muted); }
.phase.now { border: 1.5px solid var(--mustard); color: var(--mustard); font-weight: 600; }

/* ---------------- SẢNH GAME (Tổng quan) ---------------- */
.lobby-hero {
    position: relative; overflow: hidden; margin-top: 22px; border-radius: 30px; border: 1.5px solid var(--line-2);
    display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(340px, 440px); gap: 32px; align-items: center; padding: 34px 36px;
    min-height: 360px; color: var(--cream);
    background:
        radial-gradient(520px 340px at 12% 18%, color-mix(in oklab, var(--mint) 20%, transparent), transparent 70%),
        radial-gradient(460px 320px at 70% 90%, color-mix(in oklab, var(--mustard) 16%, transparent), transparent 70%),
        radial-gradient(380px 260px at 95% 5%, color-mix(in oklab, var(--rose) 12%, transparent), transparent 70%),
        var(--surface);
}
.lobby-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--bg-dot) 1px, transparent 1px); background-size: 16px 16px; pointer-events: none; }
.lobby-hero > * { position: relative; z-index: 1; }
.hero-art { position: absolute !important; z-index: 0 !important; left: 18%; top: 50%; width: 62%; max-width: 760px; transform: translateY(-46%); pointer-events: none; color: var(--cream); }
.hero-ball { animation: ballfloat 3.2s ease-in-out infinite; transform-origin: 470px 300px; transform-box: view-box; }
@keyframes ballfloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(14deg); } }
.lobby-copy { color: var(--text); max-width: 600px; }
.lobby-tag { margin-bottom: 16px; }
.headline { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 4.3vw, 54px); line-height: 1.05; letter-spacing: -.025em; }
.headline .hl { color: var(--mustard); background: none; padding: 0; }
:root[data-theme="light"] .headline .hl { color: #9a6700; }
.lobby-sub { margin: 16px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 500px; }
/* thẻ người chơi */
.player-card {
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(139, 208, 255, .36) 0%, transparent 55%),
        radial-gradient(90% 80% at 0% 100%, rgba(246, 196, 69, .24) 0%, transparent 58%),
        linear-gradient(145deg, #aee8cc 0%, var(--mint) 54%, #8dd9b6 100%);
    color: var(--ink); border: 1.5px solid var(--ink); border-radius: 24px; padding: 18px 20px;
    box-shadow: 0 5px 0 var(--ink), 0 18px 36px -18px rgba(155, 224, 192, .45);
    display: flex; flex-direction: column; gap: 11px; min-width: 0; container-type: inline-size; font-variant-numeric: tabular-nums;
}
.player-card .eyebrow, .player-card .sub { color: #3d5a4b; }
.player-card .sub { font-size: 12.5px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pc-main { display: flex; gap: 14px; align-items: center; }
.pc-main[hidden], .pc-actions[hidden], .pc-guest-login[hidden] { display: none !important; }
.pc-main .rank-icon { line-height: 0; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.pc-main .rank-icon svg, .pc-main .rank-icon .rank-img { width: 58px; height: 58px; object-fit: contain; display: block; }
.pc-main .profile-name { font-size: 22px; font-weight: 800; line-height: 1.15; }
.pc-elo { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .42); border: 1px solid rgba(28, 23, 15, .15); }
.pc-elo .elo { font-size: 38px; }
.player-card .mini-stats { margin-top: 0; }
.player-card code, #no-admin-notice code { background: rgba(28, 23, 15, .1); color: var(--ink); border: 1px solid rgba(28, 23, 15, .2); white-space: nowrap; }
.pc-switch { align-self: flex-start; border-color: rgba(28, 23, 15, .35); color: var(--ink); }
.pc-switch:hover:not(:disabled) { border-color: var(--ink); }
.player-card .profile-name, .player-card .mono { overflow-wrap: anywhere; }
.pc-summary { display: grid; gap: 9px; }
.pc-level, .pc-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.pc-level small, .pc-metric small { color: #3d5a4b; }
.pc-summary progress { appearance: none; width: 100%; height: 5px; border: 0; border-radius: 5px; background: #21916435; }
.pc-summary progress::-webkit-progress-bar { background: #21916435; border-radius: 5px; }
.pc-summary progress::-webkit-progress-value { background: #27614c; border-radius: 5px; }
.pc-summary progress::-moz-progress-bar { background: #27614c; border-radius: 5px; }
.pc-currencies, .pc-ranks { display: grid; gap: 7px; }
.pc-currencies { grid-template-columns: minmax(0, 1.8fr) repeat(2, minmax(0, 1fr)); }
.pc-ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-metric { min-width: 0; padding: 8px 10px; display: grid; align-content: start; gap: 3px; background: rgba(255, 255, 255, .52); border: 1px solid rgba(28, 23, 15, .15); border-radius: 13px; overflow-wrap: anywhere; }
.pc-currencies .pc-metric:nth-child(1) { background: linear-gradient(135deg, rgba(255, 248, 220, .72), rgba(255, 255, 255, .52)); border-color: rgba(180, 130, 20, .28); }
.pc-currencies .pc-metric:nth-child(2) { background: linear-gradient(135deg, rgba(218, 242, 255, .72), rgba(255, 255, 255, .52)); border-color: rgba(40, 120, 180, .24); }
.pc-currencies .pc-metric:nth-child(3) { background: linear-gradient(135deg, rgba(255, 228, 234, .72), rgba(255, 255, 255, .52)); border-color: rgba(185, 70, 95, .24); }
.pc-ranks .pc-metric:nth-child(1) { background: linear-gradient(135deg, rgba(220, 252, 238, .75), rgba(255, 255, 255, .54)); border-color: rgba(30, 130, 90, .26); }
.pc-ranks .pc-metric:nth-child(2) { background: linear-gradient(135deg, rgba(255, 244, 210, .75), rgba(255, 255, 255, .54)); border-color: rgba(185, 135, 25, .26); }
.pc-metric > span { font-size: 12px; font-weight: 700; }
.pc-rank-label { display: flex; gap: 5px; align-items: center; }
.pc-rank-label svg { flex: none; color: #27614c; }

/* Ở trang Home (tab-overview): luôn ẩn khay menu dưới để không bao giờ bị nháy/hiện khi F5; vào tab chức năng thì Dock tự hiện */
:root[data-garena="linked"] .lobby-guest-copy { display: none; }
:root[data-garena="guest"] .home-apps { display: none; }
:root[data-active-tab="tab-overview"] .dock-tray { display: none; }
:root[data-garena="linked"] .ov-extra-modes { display: none; }

/* Lưới App Launcher bên trái Sảnh khi đã login Garena */
.home-apps { width: 100%; }
.home-app-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 12px;
}
.home-app {
    --app-c: var(--mustard);
    border: 0; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 8px 4px; border-radius: 18px; color: var(--text);
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .18s;
}
.home-app:hover { background: color-mix(in oklab, var(--surface-2) 65%, transparent); transform: translateY(-4px); }
.home-app:active { transform: translateY(-1px) scale(.97); }
.home-app-ico {
    position: relative; width: 60px; height: 60px; border-radius: 18px;
    display: grid; place-items: center;
    background: color-mix(in oklab, var(--app-c) 18%, var(--surface-2));
    border: 1.5px solid color-mix(in oklab, var(--app-c) 52%, var(--ink));
    color: var(--app-c);
    box-shadow: 0 4px 0 var(--ink), 0 12px 22px -10px color-mix(in oklab, var(--app-c) 45%, rgba(0, 0, 0, .6)), inset 0 1px 0 rgba(255, 255, 255, .14);
    transition: transform .18s, box-shadow .18s, background .18s;
}
:root[data-theme="light"] .home-app-ico {
    background: color-mix(in oklab, var(--app-c) 26%, #ffffff);
    color: var(--ink);
    box-shadow: 0 4px 0 var(--ink), 0 10px 18px -10px rgba(40, 30, 15, .28), inset 0 1px 0 rgba(255, 255, 255, .85);
}
.home-app:hover .home-app-ico {
    background: var(--app-c); color: var(--ink); border-color: var(--ink);
    box-shadow: 0 5px 0 var(--ink), 0 14px 26px -10px color-mix(in oklab, var(--app-c) 65%, transparent);
}
.home-app-ico svg { width: 25px; height: 25px; }
.home-app-ico .live-pip { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border: 2px solid var(--surface); }
.home-app-lbl { font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.25; color: var(--text); }
@media (max-width: 760px) {
    .home-app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
    .home-app-ico { width: 52px; height: 52px; border-radius: 16px; }
    .home-app-ico svg { width: 22px; height: 22px; }
}

/* Đăng nhập 2 chế độ trực tiếp trên thẻ Người chơi khi chưa log Garena */
.pc-guest-login { display: grid; gap: 10px; }
.pc-login-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(28, 23, 15, .1); }
.pc-login-seg button { border: 0; background: transparent; color: var(--ink); padding: 7px 6px; border-radius: 9px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.pc-login-seg button.on { background: var(--ink); color: var(--mint); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.pc-login-form { display: grid; gap: 8px; }
.pc-login-note { font-size: 12px; line-height: 1.45; color: #2b4538; }
.pc-input { width: 100%; min-width: 0; padding: 8px 11px; border-radius: 11px; border: 1px solid rgba(28, 23, 15, .2); background: rgba(255, 255, 255, .72); color: var(--ink); font-size: 13px; outline: none; transition: border-color .15s, background .15s; }
.pc-input::placeholder { color: #5c7568; }
.pc-input:focus { background: #fffdf7; border-color: var(--ink); }
.pc-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-login-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-submit { flex: 1; border: 1.5px solid var(--ink); background: var(--mustard); color: var(--ink); padding: 8px 14px; border-radius: 11px; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 0 var(--ink); transition: transform .1s, filter .15s; white-space: nowrap; }
.pc-submit:hover:not(:disabled) { filter: brightness(1.05); }
.pc-submit:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.pc-submit:disabled { opacity: .6; cursor: not-allowed; }
.pc-sso-steps { margin: 0 0 2px 16px; padding: 0; font-size: 11.5px; line-height: 1.5; color: #243c30; display: grid; gap: 3px; }
.pc-sso-steps a { color: #0f3f29; text-decoration: underline; text-underline-offset: 2px; }
.pc-login-msg { font-size: 12px; font-weight: 600; color: #1b4332; line-height: 1.4; }
.pc-login-msg.err { color: #9c2924; }
.pc-rank-label svg, .pc-rank-label .rank-img { flex: none; object-fit: contain; display: block; }
.pc-bp-short { display: none; }
.pc-dot[data-state]:not([data-state=""]) { display: inline-block; vertical-align: middle; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #806015; }
.pc-dot[data-state="VERIFIED"]:not([data-state=""]), .pc-positive { color: #215d3e; }
.pc-dot[data-state="VERIFIED"]:not([data-state=""]) { background: #215d3e; }
.pc-dot[data-state="EXPIRED"]:not([data-state=""]) { background: #9b2e2d; }
.pc-error, .pc-negative { color: #8f2b2a; }
.pc-error { margin: 0; font-size: 13px; }
.pc-summary summary { cursor: pointer; font-size: 12px; }
.pc-summary dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; font-size: 12px; margin: 6px 0 0; overflow-wrap: anywhere; }
.pc-summary dd { margin: 0; text-align: right; }
.pc-skeleton { display: grid; gap: 7px; }
.pc-skeleton div { height: 1.5rem; border-radius: 8px; background: #233b3326; }
@container (max-width: 320px) {
    .pc-bp-full { display: none; }
    .pc-bp-short { display: block; }
}
/* bảng điểm trận */
.match-center {
    margin-top: 16px; display: grid; grid-template-columns: 1fr auto minmax(200px, 300px); gap: 24px; align-items: center;
    padding: 18px 24px; border-radius: 26px; background: var(--surface); border: 1.5px solid var(--cream); box-shadow: var(--shadow);
}
.mc-title { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.15; margin-top: 6px; }
.mc-title .hl { color: var(--mustard); }
:root[data-theme="light"] .mc-title .hl { color: #9a6700; }
.mc-sub { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.match-center .phases { margin-top: 10px; }
.mc-clock { text-align: center; padding: 6px 22px; border-left: 1px dashed var(--line-2); border-right: 1px dashed var(--line-2); }
.mc-clock span { display: block; font-family: var(--mono); font-size: 36px; font-weight: 600; color: var(--mustard); font-variant-numeric: tabular-nums; }
.mc-clock small { font-size: 11px; color: var(--dim); }
.mc-right { display: flex; flex-direction: column; gap: 8px; }
.mc-count { display: flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.mc-count b { font-size: 26px; }
.mc-count small { color: var(--dim); }
/* lưới chế độ */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 4px 14px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); font-weight: 800; font-size: 26px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mode {
    --c: var(--mustard); position: relative; overflow: hidden; text-align: left; cursor: pointer; color: var(--text); font: inherit;
    display: flex; flex-direction: column; gap: 8px; padding: 22px 18px 16px; border-radius: 22px; min-height: 196px;
    background: radial-gradient(240px 140px at 0% 0%, color-mix(in oklab, var(--c) 14%, transparent), transparent 70%), var(--surface);
    border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s, border-color .18s;
}
.mode::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.mode:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--c) 60%, transparent); }
.mode:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.mode-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in oklab, var(--c) 18%, transparent); color: var(--c); border: 1px solid color-mix(in oklab, var(--c) 35%, transparent); }
.mode-ico svg { width: 20px; height: 20px; }
:root[data-theme="light"] .mode-ico { color: var(--ink); }
.mode-name { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.mode-name .pill { font-family: var(--body); font-size: 11px; padding: 1px 8px; }
.mode-desc { color: var(--muted); font-size: 13px; line-height: 1.45; flex: 1; overflow-wrap: anywhere; }
.mode-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; flex-wrap: wrap; }
.mode-foot .wld i { width: 16px; height: 16px; font-size: 9px; }
.mode-go { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--ink); font-weight: 700; }

/* ---------------- PROFILE / RANK (thẻ bạc hà) ---------------- */
.profile { background: var(--mint); color: var(--ink); border: 1.5px solid var(--ink); display: flex; flex-direction: column; }
.profile .eyebrow, .profile .sub { color: #3d5a4b; }
.profile .sub { font-size: 13px; }
.profile-name { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.rank-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 12px; }
.rank-row .rank-icon { line-height: 0; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.elo { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: .95; }
.elo-d { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.up, b.up, .elo-d.up { color: #1f7a4a; } .down, b.down, .elo-d.down { color: #b23a2a; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.mini-stats > div { background: rgba(255, 255, 255, .45); border: 1px solid rgba(28, 23, 15, .15); border-radius: 14px; padding: 8px 10px; min-width: 0; }
.mini-stats b { display: block; font-family: var(--display); font-size: 18px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stats span { font-size: 11px; color: #3d5a4b; }
.profile .rank-ladder { margin: 4px 0 12px; }

/* ---------------- FORMS ---------------- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.form-group label, .field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form-control {
    width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; padding: 10px 14px;
    outline: none; transition: border-color .15s, background .15s; color: var(--text); font-size: 14px; min-width: 0;
}
.form-control::placeholder { color: var(--dim); }
.form-control:focus { border-color: var(--mustard); background: var(--surface); }
.form-control:disabled, select:disabled, input:disabled { opacity: .55; cursor: not-allowed; }
select.form-control { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a99e8a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select.form-control option { background: var(--surface); color: var(--text); }
textarea.form-control { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
input[type=number].form-control { font-family: var(--mono); }
.hint { font-size: 12px; color: var(--dim); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
/* checkbox dạng công tắc iOS */
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13.5px; line-height: 1.45; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check > span { flex: 1; }
.check input[type=checkbox], .switch-input {
    appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3);
    position: relative; flex: none; cursor: pointer; transition: background .2s; order: 2; margin: 0;
}
.check input[type=checkbox]::after, .switch-input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.check input[type=checkbox]:checked, .switch-input:checked { background: var(--ok); }
.check input[type=checkbox]:checked::after, .switch-input:checked::after { transform: translateX(18px); }
.check input:disabled { opacity: .4; }
.checks { margin: 4px 0 12px; }
/* hàng cài đặt kiểu iOS */
.setting { display: flex; align-items: center; gap: 16px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .grow { flex: 1; min-width: 0; }
.setting .t { font-weight: 600; }
.setting .s { font-size: 12.5px; color: var(--muted); }
.setting .form-control { width: 150px; text-align: right; }
.setting .form-control.wide { width: 200px; }
/* segmented */
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button:hover:not(.on):not(:disabled) { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.seg button:disabled { cursor: not-allowed; opacity: .6; }
/* mở rộng */
details.more { border-top: 1px dashed var(--line-2); margin-top: 16px; padding-top: 12px; }
details.more > summary { cursor: pointer; list-style: none; color: var(--muted); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; user-select: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 13px; flex: none; }
details.more[open] > summary::before { content: "–"; }
details.more > summary:hover { color: var(--text); }
details.more .more-body { margin-top: 14px; }
details.card > summary { cursor: pointer; list-style: none; font-family: var(--display); font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 14px; font-family: var(--body); flex: none; }
details.card[open] > summary::before { content: "–"; }
details.card[open] > summary { margin-bottom: 14px; }
.explain { font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.explain strong { color: var(--text); }

/* ---------------- TABLES → danh sách nhẹ ---------------- */
.table-responsive { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th { text-align: left; padding: 0 12px 10px; color: var(--dim); font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tbody tr { transition: background .15s; }
table.data-table tbody tr:hover td { background: color-mix(in oklab, var(--surface-2) 55%, transparent); }
table.data-table td:first-child { border-radius: 12px 0 0 12px; } table.data-table td:last-child { border-radius: 0 12px 12px 0; }
table.data-table td.num, table.data-table th.num { text-align: right; }
table.data-table small { font-size: 12px; }
.scroll-y { max-height: 520px; overflow-y: auto; }

/* ---------------- LIST ROWS ---------------- */
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 600; }
.list-row .s { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; color: var(--dim); padding: 26px 10px; font-size: 13.5px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; font-size: 13.5px; }
.kv > span { color: var(--muted); }
.kv > b, .kv > div { font-family: var(--mono); font-weight: 600; text-align: right; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.stat-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-cell { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.stat-cell small { display: block; font-size: 11.5px; color: var(--muted); }
.stat-cell > div { margin-top: 4px; font-weight: 600; overflow-wrap: anywhere; }

/* ---------------- ACCOUNTS ---------------- */
.acc { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--surface-2); margin-bottom: 10px; transition: border-color .2s; }
.acc:last-child { margin-bottom: 0; }
.acc:hover { border-color: var(--line-2); }
.acc.active { border-color: var(--mustard); background: color-mix(in oklab, var(--mustard) 8%, var(--surface-2)); }
.acc .avatar { width: 42px; height: 42px; font-size: 16px; }
.acc .grow { flex: 1; min-width: 0; }
.acc .nm { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.acc .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.acc .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; cursor: pointer; background: none; }
.acc.active .radio { border: 7px solid var(--mustard); }
.alert-box { border-radius: 16px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 14px; }
#login-attention { border-radius: 16px !important; padding: 12px 16px !important; }
#login-paste { border-radius: 18px !important; padding: 16px !important; background: var(--surface); }

/* ---------------- FEED / LOGS ---------------- */
.terminal-body { font-family: var(--mono); font-size: 12px; line-height: 1.65; overflow-y: auto; display: flex; flex-direction: column; }
.term { background: var(--term-bg); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; height: 480px; color: #d5ccba; }
.term .log-row { display: flex; gap: 10px; padding: 2px 0; word-break: break-word; }
.term .log-time { color: #6f6656; flex: none; }
.term .log-msg { color: #ddd4c2; }
:root[data-theme="light"] .term { background: #fbf7ee; color: var(--text); }
:root[data-theme="light"] .term .log-msg { color: var(--text); }
.log-tag { font-weight: 600; flex: none; padding: 0 6px; border-radius: 5px; font-size: 10.5px; line-height: 1.7; align-self: flex-start; margin-top: 1px; }
.tag-INFO { background: color-mix(in oklab, var(--info) 18%, transparent); color: var(--info); }
.tag-HTTP_REQ { background: color-mix(in oklab, var(--sky) 15%, transparent); color: var(--sky); }
.tag-HTTP_RES, .tag-SUCCESS { background: color-mix(in oklab, var(--ok) 18%, transparent); color: var(--ok); }
.tag-WARN { background: color-mix(in oklab, var(--warn) 20%, transparent); color: var(--warn); }
.tag-ERROR { background: color-mix(in oklab, var(--bad) 20%, transparent); color: var(--bad); }
/* feed dễ đọc ở Tổng quan */
.feed { font-family: var(--body); font-size: 13.5px; max-height: 380px; margin: 0 -6px; padding: 0 6px; }
.feed .log-row { display: grid; grid-template-columns: 62px 1fr; gap: 4px 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.feed .log-row:last-child { border-bottom: 0; }
.feed .log-time { font-family: var(--mono); font-size: 11.5px; color: var(--dim); grid-row: span 2; padding-top: 2px; }
.feed .log-tag { justify-self: start; }
.feed .log-msg { color: var(--text); overflow-wrap: anywhere; }
.feed[data-f="glxh"] .log-row:not(.k-glxh), .feed[data-f="trade"] .log-row:not(.k-trade), .feed[data-f="warn"] .log-row:not(.k-warn),
.act-feed[data-f="glxh"] .log-row:not(.k-glxh), .act-feed[data-f="trade"] .log-row:not(.k-trade), .act-feed[data-f="warn"] .log-row:not(.k-warn) { display: none; }
.feed:empty::before, .act-feed:empty::before { content: "Chưa có hoạt động nào."; color: var(--dim); display: block; padding: 26px 0; text-align: center; font-size: 13.5px; }

/* Hoạt động gần đây dạng thẻ phân màu rõ ràng theo trạng thái & chức năng (Home) */
.act-feed { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.act-row {
    --act-c: var(--mint);
    display: flex; align-items: center; gap: 14px;
    padding: 13px 16px; border-radius: 16px;
    background: color-mix(in oklab, var(--act-c) 9%, var(--surface-2));
    border: 1px solid color-mix(in oklab, var(--act-c) 28%, var(--line));
    border-left: 4px solid var(--act-c);
    transition: border-color .15s, background .15s, transform .15s;
}
.act-row:hover {
    border-color: color-mix(in oklab, var(--act-c) 60%, var(--line-2));
    background: color-mix(in oklab, var(--act-c) 15%, var(--surface-2));
    transform: translateX(2px);
}
.act-row.act-alert { border-color: color-mix(in oklab, var(--act-c) 50%, var(--line)); }
.act-ico {
    width: 40px; height: 40px; border-radius: 12px; flex: none;
    display: grid; place-items: center;
    background: color-mix(in oklab, var(--act-c) 22%, var(--surface));
    border: 1.5px solid color-mix(in oklab, var(--act-c) 55%, var(--line));
    color: var(--act-c);
    box-shadow: 0 4px 12px -6px color-mix(in oklab, var(--act-c) 60%, transparent);
}
.act-ico svg { width: 19px; height: 19px; }
.act-body { flex: 1; min-width: 0; }
.act-msg { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
.act-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 4px; }
.act-badge {
    display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 1.45;
    background: color-mix(in oklab, var(--act-c) 22%, var(--surface));
    color: var(--act-c);
    border: 1px solid color-mix(in oklab, var(--act-c) 45%, transparent);
}
.act-time { font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
.act-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
    .act-row { padding: 11px 12px; gap: 10px; }
    .act-ico { width: 34px; height: 34px; border-radius: 10px; }
    .act-ico svg { width: 16px; height: 16px; }
    .act-msg { font-size: 13px; }
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; color: var(--muted); font-weight: 500; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--surface-3); color: var(--text); border-color: var(--line-2); }
.inspector-box, .result-box { background: var(--term-bg); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; max-height: 300px; overflow: auto; white-space: pre-wrap; color: var(--sky); word-break: break-word; }
:root[data-theme="light"] .inspector-box, :root[data-theme="light"] .result-box { background: #fbf7ee; color: var(--info); }
.result-box:empty { display: none; }

/* ---------------- PROGRESS ---------------- */
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > div, .progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mustard), var(--peach)); border-radius: 99px; transition: width .5s ease; }
.progress.running > div { background-image: linear-gradient(135deg, rgba(255, 255, 255, .22) 25%, transparent 25% 50%, rgba(255, 255, 255, .22) 50% 75%, transparent 75%), linear-gradient(90deg, var(--mustard), var(--peach)); background-size: 26px 26px, 100% 100%; animation: stripes .9s linear infinite; }
.progress.searching > div { width: 35% !important; background: linear-gradient(90deg, transparent, var(--mustard), transparent); animation: slide 1.4s ease-in-out infinite; }
@keyframes stripes { to { background-position: 26px 0, 0 0; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes bounce { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }

/* ---------------- GLXH ---------------- */
.glxh-controls { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ctl { min-width: 0; }
.ctl > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.ctl-actions { margin-left: auto; }
.glxh-lock-hint { margin-top: 12px; padding: 9px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; color: var(--warn); background: color-mix(in oklab, var(--warn) 12%, transparent); border: 1px solid color-mix(in oklab, var(--warn) 30%, transparent); }
.live-card { display: grid; grid-template-columns: 60px 1fr auto; gap: 18px; align-items: center; position: relative; overflow: hidden; }
.live-card.active { border-color: var(--mustard); }
.live-card.active::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px 140px at 0% 50%, color-mix(in oklab, var(--mustard) 10%, transparent), transparent 70%); }
.live-main { min-width: 0; }
.live-phase { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); flex: none; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ok) 20%, transparent); }
.live-detail { font-size: 13px; color: var(--muted); margin: 4px 0 12px; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); margin-top: 6px; font-family: var(--mono); }
.live-clock { text-align: right; padding-left: 18px; border-left: 1px dashed var(--line-2); }
.live-clock b { display: block; font-family: var(--mono); font-size: 32px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.live-clock span { font-size: 11px; color: var(--dim); }
.live-clock.ticking b { color: var(--mustard); }
.live-icon { width: 56px; height: 56px; border-radius: 50%; position: relative; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--line-2); }
.live-icon span { font-size: 24px; line-height: 1; position: relative; z-index: 1; }
.live-icon.idle span::before { content: "❚❚"; font-size: 14px; color: var(--dim); letter-spacing: -2px; }
.live-icon.search { overflow: hidden; }
.live-icon.search::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, color-mix(in oklab, var(--mustard) 60%, transparent), transparent 28%); animation: spin 1.6s linear infinite; }
.live-icon.search::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--mustard); animation: ping 1.6s ease-out infinite; }
.live-icon.search span::before { content: ""; display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--mustard); }
.live-icon.connect::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 3px solid color-mix(in oklab, var(--mustard) 22%, transparent); border-top-color: var(--mustard); animation: spin .8s linear infinite; }
.live-icon i { display: none; }
.live-icon.play {
    border-color: color-mix(in oklab, var(--mint) 46%, transparent);
    background: radial-gradient(ellipse at 50% 14%, #3b6151, #24362c 72%);
    box-shadow: inset 0 1px 2px #b1f0cd40, inset 0 -5px 14px #0c191680, 0 4px 12px #0004;
}
.live-icon.play::before {
    content: ""; position: absolute; width: 49%; height: 13%; bottom: 8px;
    border-radius: 50%; background: #0c1c17bf; filter: blur(2px);
}
.live-icon.play span {
    width: 64%; aspect-ratio: 1; overflow: hidden; border-radius: 50%; transform: rotate(-15deg);
    background: radial-gradient(circle at 29% 22%, #fffef3 8%, #e2e9d8 44%, #90b39d 70%, #2e5248 94%);
    box-shadow: inset 0 0 0 1px #dae7cf5c, 0 4px 6px #08150f99;
}
.live-icon.play span::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: radial-gradient(circle at 26% 21%, #fff7, transparent 36%, transparent 56%, #152d297d);
    box-shadow: inset -2px -3px 5px #19362a70; pointer-events: none;
}
.live-icon.play i {
    display: block; position: absolute; width: 40%; height: 40%;
    clip-path: polygon(50% 0, 100% 36%, 81% 98%, 19% 98%, 0 36%);
    background: linear-gradient(145deg, #48735d, #162f29 80%);
}
.live-icon.play i:nth-child(1) { top: 27%; left: 27%; }
.live-icon.play i:nth-child(2) { top: -10%; right: -2%; transform: rotate(33deg); }
.live-icon.play i:nth-child(3) { left: -14%; top: 42%; transform: rotate(-28deg); }
.live-icon.play i:nth-child(4) { bottom: -12%; right: 3%; transform: rotate(52deg); }
.live-icon.done { border-color: color-mix(in oklab, var(--ok) 55%, transparent); }
.live-icon.done span::before { content: "✓"; color: var(--ok); font-weight: 700; display: inline-block; animation: pop .4s ease-out; }
.live-icon.error { border-color: color-mix(in oklab, var(--bad) 55%, transparent); }
.live-icon.error span::before { content: "!"; color: var(--bad); font-weight: 800; }
.rank-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.rank-cells > div { background: rgba(255, 255, 255, .45); border: 1px solid rgba(28, 23, 15, .15); border-radius: 14px; padding: 8px 12px; min-width: 0; }
.rank-cells span { display: block; font-size: 11px; color: #3d5a4b; }
.rank-cells b { font-family: var(--display); font-size: 18px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rank-ladder { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.rank-ladder .rung { display: flex; flex-direction: column; align-items: center; gap: 1px; opacity: .4; filter: grayscale(.7); transition: .2s; cursor: default; }
.rank-ladder .rung svg, .rank-ladder .rung .rank-img { width: 26px; height: 26px; object-fit: contain; display: block; }
.rank-ladder .rung span { display: none; }
.rank-ladder .rung.on { opacity: 1; filter: none; transform: scale(1.15); }
.rank-ladder:hover .rung { opacity: .85; filter: none; }
.ladder-note { flex-basis: 100%; font-size: 11px; color: #3d5a4b; margin-top: 4px; }
.choice-summary { padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13px; margin-bottom: 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.pitch-wrap { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 20px; align-items: start; }
svg.pitch { width: 100%; aspect-ratio: 68 / 105; display: block; border-radius: 18px; border: 1.5px solid var(--line-2); }
.pitch-empty { display: grid; place-items: center; aspect-ratio: 68 / 105; border-radius: 18px; border: 1.5px dashed var(--line-2); color: var(--dim); font-size: 13px; text-align: center; padding: 20px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.subs { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 4px 9px; border-radius: 9px; background: var(--surface-2); font-family: var(--mono); }
.grade { display: inline-grid; place-items: center; min-width: 20px; height: 16px; padding: 0 4px; border-radius: 5px; font-size: 10px; font-weight: 700; background: #4b4a45; color: #f1ead9; font-family: var(--mono); }
.grade.g5 { background: #6b6a62; } .grade.g6 { background: #a16207; color: #fff7ed; } .grade.g7 { background: #ca8a04; color: #1c1917; }
.grade.g8 { background: #eab308; color: #1c1917; } .grade.g9 { background: #facc15; color: #1c1917; } .grade.g10 { background: #fde047; color: #1c1917; }
.grade.g11, .grade.g12, .grade.g13 { background: linear-gradient(135deg, #e0f2fe, #a5f3fc); color: #0c4a6e; }
.param { display: grid; grid-template-columns: 1fr 90px 30px; gap: 10px; align-items: center; font-size: 12.5px; margin-bottom: 8px; color: var(--muted); }
.param .bar { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.param .bar > div { height: 100%; background: var(--mustard); border-radius: 6px; }
.param b { font-family: var(--mono); font-weight: 600; text-align: right; color: var(--text); }
.res { display: inline-block; min-width: 50px; text-align: center; padding: 3px 9px; border-radius: 9px; font-size: 12px; font-weight: 700; border: 1.5px solid var(--ink); color: var(--ink); }
.res.win { background: var(--mint); } .res.loss { background: var(--rose); }
.res.draw { background: var(--surface-3); color: var(--text); border-color: var(--line-2); }
.score { font-family: var(--mono); font-weight: 600; font-size: 14px; white-space: nowrap; }
.wld { display: flex; gap: 3px; flex-wrap: wrap; }
.wld i { font-style: normal; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--surface-2); color: var(--dim); }
.wld i.w { background: color-mix(in oklab, var(--ok) 22%, transparent); color: var(--ok); }
.wld i.d { background: var(--surface-3); color: var(--muted); }
.wld i.l { background: color-mix(in oklab, var(--bad) 22%, transparent); color: var(--bad); }
#glxh-terminal { height: 340px; }
#glxh-pitch-box, #glxh-pitch-box + .legend { max-width: 330px; margin-left: auto; margin-right: auto; }

/* ---------------- CATALOG / INSERT ---------------- */
.search-results { margin-top: 6px; max-height: 220px; overflow: auto; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.search-results > div { border-bottom-color: var(--line) !important; }
.search-results > div:hover { background: var(--surface-3); }
.changes-list > div { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.changes-list > div:last-child { border-bottom: 0; }
#cat-detail .card-header { margin-bottom: 10px; }
#cat-detail svg { background: var(--surface-2) !important; border-radius: 14px !important; }
#cat-detail polyline { stroke: var(--mustard); }
.inline-num { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.inline-num .form-control { width: 100px; }

/* ---------------- SHEET + TOAST ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 8, 5, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; }
.scrim.on { display: flex; }
.sheet { width: min(580px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1.5px solid var(--cream); border-radius: 28px; padding: 14px 24px 24px; animation: up .3s cubic-bezier(.2, .9, .3, 1); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.grab { width: 42px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h3 { font-family: var(--display); font-size: 26px; font-weight: 800; }
.sheet > p { color: var(--muted); margin: 2px 0 18px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
/* ---------------- NOTIFICATION TOAST WIDGET (CARD BO TRÒN ĐỔI MÀU THEO TRẠNG THÁI) ---------------- */
.toast {
    --toast-c: var(--sky);
    position: fixed; right: 20px; top: 18px; left: auto; bottom: auto; z-index: 110;
    width: min(390px, calc(100vw - 24px));
    padding: 15px 16px; border-radius: 22px;
    display: flex; align-items: flex-start; gap: 13px; text-align: left;
    background: color-mix(in oklab, var(--toast-c) 10%, var(--surface));
    backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border: 1.5px solid color-mix(in oklab, var(--toast-c) 48%, var(--line));
    color: var(--text);
    box-shadow: 0 22px 46px -14px rgba(0, 0, 0, .72), 0 0 24px -12px color-mix(in oklab, var(--toast-c) 50%, transparent);
    transform: translateY(-14px) scale(.97); opacity: 0; pointer-events: none;
    transition: transform .24s cubic-bezier(.2, .8, .2, 1), opacity .22s ease, border-color .22s ease;
    max-height: calc(100dvh - 36px); overflow-y: auto;
}
.toast.on { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.toast[data-type="ok"], .toast[data-type="run"] { --toast-c: var(--ok); }
.toast[data-type="warn"] { --toast-c: var(--warn); }
.toast[data-type="error"] { --toast-c: var(--bad); }
.toast[data-type="info"] { --toast-c: var(--sky); }

.toast-ico {
    width: 36px; height: 36px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: color-mix(in oklab, var(--toast-c) 18%, var(--surface-2));
    color: var(--toast-c);
    border: 1px solid color-mix(in oklab, var(--toast-c) 35%, transparent);
    margin-top: 1px;
}
.toast-ico svg { width: 18px; height: 18px; }
.toast-spin { animation: toastSpin 1.1s linear infinite; }
@keyframes toastSpin { to { transform: rotate(360deg); } }

.toast-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.toast-title { font-family: var(--display); font-weight: 800; font-size: 16px; line-height: 1.25; color: var(--text); }
.toast-msg { font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; white-space: pre-line; }
.toast-close {
    flex: none; width: 26px; height: 26px; border-radius: 50%; border: 0;
    background: transparent; color: var(--dim); font-size: 18px; line-height: 1;
    display: grid; place-items: center; cursor: pointer; margin: -2px -4px 0 0;
    transition: background .15s, color .15s;
}
.toast-close:hover { background: var(--surface-2); color: var(--text); }
.toast-close:focus-visible { outline: 2px solid var(--toast-c); outline-offset: 2px; }

@media (max-width: 640px) {
    .toast { right: 12px; left: 12px; top: 12px; width: auto; }
}

/* ---------------- MODAL THÔNG BÁO TOÀN MÁY CHỦ ---------------- */
.ann-scrim {
    position: fixed; inset: 0; z-index: 120;
    background: rgba(10, 8, 6, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: grid; place-items: center; padding: 18px;
}
.ann-scrim[hidden] { display: none; }
.ann-dialog {
    width: min(560px, 100%); border-radius: 24px;
    background: var(--surface); border: 1.5px solid var(--line-2);
    box-shadow: 0 32px 64px -20px rgba(0, 0, 0, .82);
    padding: 20px 22px; display: grid; gap: 14px;
    animation: rise .22s ease;
}
.ann-head { display: flex; align-items: center; gap: 10px; }
.ann-head-ico {
    width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
    background: color-mix(in oklab, var(--mustard) 18%, var(--surface-2));
    border: 1px solid color-mix(in oklab, var(--mustard) 42%, var(--line));
    color: var(--mustard); flex: none;
}
.ann-head-ico svg { width: 17px; height: 17px; }
.ann-head h3 { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1.1; }
.ann-box {
    padding: 16px 18px; border-radius: 16px;
    background: var(--surface-2); border: 1px solid var(--line);
    display: grid; gap: 8px;
}
.ann-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ann-tag {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 8px;
    background: color-mix(in oklab, var(--sky) 18%, var(--surface));
    border: 1px solid color-mix(in oklab, var(--sky) 42%, var(--line));
    color: var(--sky); font-size: 11.5px; font-weight: 700;
}
.ann-time { font-size: 12px; color: var(--muted); }
.ann-title { font-size: 16.5px; font-weight: 700; color: var(--text); line-height: 1.35; }
.ann-body { font-size: 13.5px; color: var(--muted); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 45vh; overflow-y: auto; }
.ann-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.ann-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.ann-check input { width: 16px; height: 16px; accent-color: var(--mustard); cursor: pointer; }

/* ---------------- FLOATING 3D APP-ICON DOCK (ĐỒNG BỘ VỚI SẢNH) ---------------- */
.dock-tray {
    flex: none; position: relative; z-index: 45;
    display: flex; justify-content: center; align-items: center;
    padding: 8px 16px 12px;
    background: color-mix(in oklab, var(--bg) 94%, transparent);
    border-top: 1px solid color-mix(in oklab, var(--tab-accent) 28%, var(--line));
    box-shadow: 0 -16px 34px -20px color-mix(in oklab, var(--tab-accent) 32%, rgba(0, 0, 0, .55));
    transition: border-color .3s ease, box-shadow .3s ease;
}
.tabbar.dock-3d {
    display: flex; align-items: flex-end; gap: 8px;
    position: relative; max-width: 100%; padding: 8px 14px 7px;
    border-radius: 26px; border: 1.5px solid color-mix(in oklab, var(--tab-accent) 38%, var(--line-2));
    background: color-mix(in oklab, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px) saturate(1.35); -webkit-backdrop-filter: blur(18px) saturate(1.35);
    box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .55), 0 0 24px -12px color-mix(in oklab, var(--tab-accent) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .1);
    transition: border-color .3s ease, box-shadow .3s ease;
}
:root[data-theme="light"] .tabbar.dock-3d {
    box-shadow: 0 12px 26px -12px rgba(40, 30, 15, .24), 0 0 20px -10px color-mix(in oklab, var(--tab-accent) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .92);
}
.tabbar.dock-3d > .nav-item, .tabbar.dock-3d > .more-wrap { flex: none; position: relative; }
.tabbar.dock-3d > .nav-item,
.tabbar.dock-3d > .more-wrap > .nav-more {
    --app-c: var(--mustard);
    border: 0; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 2px 6px 4px; border-radius: 16px; color: var(--muted); white-space: nowrap;
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), color .2s;
}
.dock-ico {
    position: relative; width: 42px; height: 42px; border-radius: 14px;
    display: grid; place-items: center;
    background: color-mix(in oklab, var(--app-c) 17%, var(--surface-2));
    border: 1.5px solid color-mix(in oklab, var(--app-c) 48%, var(--ink));
    color: var(--app-c);
    box-shadow: 0 3px 0 var(--ink), 0 8px 16px -8px color-mix(in oklab, var(--app-c) 42%, rgba(0, 0, 0, .6)), inset 0 1px 0 rgba(255, 255, 255, .14);
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .2s, color .2s, box-shadow .2s, border-color .2s;
}
:root[data-theme="light"] .dock-ico {
    background: color-mix(in oklab, var(--app-c) 24%, #ffffff);
    color: var(--ink);
    box-shadow: 0 3px 0 var(--ink), 0 8px 14px -8px rgba(40, 30, 15, .26), inset 0 1px 0 rgba(255, 255, 255, .85);
}
.dock-ico svg { width: 19px; height: 19px; flex: none; }
.dock-ico .live-pip { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border: 2px solid var(--surface); }
.tabbar.dock-3d > .nav-item .lbl,
.tabbar.dock-3d > .more-wrap > .nav-more .lbl { font-size: 11px; font-weight: 600; line-height: 1.1; }

.tabbar.dock-3d > .nav-item:hover,
.tabbar.dock-3d > .more-wrap > .nav-more:hover { color: var(--text); }
.tabbar.dock-3d > .nav-item:hover .dock-ico,
.tabbar.dock-3d > .more-wrap > .nav-more:hover .dock-ico {
    transform: translateY(-5px) scale(1.06);
    background: var(--app-c); color: var(--ink); border-color: var(--ink);
    box-shadow: 0 5px 0 var(--ink), 0 12px 22px -8px color-mix(in oklab, var(--app-c) 65%, transparent);
}
.tabbar.dock-3d > .nav-item.active,
.tabbar.dock-3d > .more-wrap > .nav-more.active { color: var(--text); font-weight: 700; }
.tabbar.dock-3d > .nav-item.active .dock-ico,
.tabbar.dock-3d > .more-wrap > .nav-more.active .dock-ico {
    background: var(--app-c); color: var(--ink); border-color: var(--ink);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 4px 0 var(--ink), 0 10px 22px -6px color-mix(in oklab, var(--app-c) 70%, transparent);
}
.tabbar.dock-3d > .nav-item.active::after {
    content: ""; width: 16px; height: 3px; border-radius: 99px;
    background: var(--app-c); margin-top: 1px;
}
.tabbar.dock-3d .more-menu {
    top: auto; bottom: calc(100% + 14px); right: 0; min-width: 214px;
    border-color: color-mix(in oklab, var(--tab-accent) 35%, var(--line-2));
    animation: dockMenuUp .16s cubic-bezier(.2, .8, .2, 1);
}
.tabbar.dock-3d .more-menu .nav-item.active {
    background: var(--surface-2); color: var(--text); border-color: transparent;
    box-shadow: inset 3px 0 0 var(--tab-accent); transform: none;
}
@keyframes dockMenuUp { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1020px) {
    .tabbar.dock-3d { gap: 4px; padding: 7px 10px 6px; }
    .dock-ico { width: 38px; height: 38px; border-radius: 12px; }
}
@media (max-width: 1180px) {
    .mode-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1020px) {
    .lobby-hero { grid-template-columns: 1fr; padding: 28px 24px; min-height: 0; }
    .hero-art { left: 20%; width: 90%; top: 30%; }
    .match-center { grid-template-columns: 1fr auto; }
    .mc-right { grid-column: 1 / -1; }
    .mc-count { justify-content: flex-start; }
    .g-hero, .g-main, .g-side, .g-2, .grid-2 { grid-template-columns: 1fr; }
    .grid-2 .grid-2 { grid-template-columns: 1fr 1fr; }
    .pitch-wrap { grid-template-columns: 1fr; }
    .pitch-wrap > div:first-child { max-width: 360px; margin: 0 auto; width: 100%; }
    .acct-chip .nm { max-width: 140px; }
}
@media (max-width: 760px) {
    .shell { padding: 10px 16px 28px; }
    .topbar { top: 8px; gap: 8px; }
    .top-right { margin-left: auto; }
    .acct-chip .nm { display: none; }
    .acct-chip { padding: 4px 8px 4px 4px; }
    .g-3, .grid-3 { grid-template-columns: 1fr 1fr; }
    .g-3 > :last-child:nth-child(odd), .grid-3 > :last-child:nth-child(odd) { grid-column: span 2; }
    .stat-cells { grid-template-columns: 1fr 1fr; }
    .mode-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .mode-grid > :last-child:nth-child(odd) { grid-column: span 2; }
    .mode { min-height: 0; padding: 18px 14px 14px; }
    .mode-desc { font-size: 12px; }
    .lobby-hero { padding: 24px 18px; border-radius: 24px; margin-top: 16px; }
    .pc-input-row { grid-template-columns: 1fr; }
    .match-center { grid-template-columns: 1fr; padding: 16px 18px; gap: 12px; }
    .match-center .phases:empty { display: none; }
    .mc-clock { border: 0; border-top: 1px dashed var(--line-2); text-align: left; padding: 10px 0 0; }
    .mc-title { font-size: 24px; }
    .page-head { margin-top: 24px; flex-direction: column; align-items: flex-start; }
    .page-head h1 { font-size: 32px; }
    .big-line { font-size: 38px; }
    .tile .val { font-size: 24px; }
    .card { padding: 18px; border-radius: 24px; }
    .live-card { grid-template-columns: 48px 1fr; }
    .live-icon { width: 48px; height: 48px; }
    .live-clock { grid-column: 1 / -1; text-align: left; border-left: 0; padding-left: 0; border-top: 1px dashed var(--line-2); padding-top: 10px; }
    .live-phase { font-size: 24px; }
    .ctl-actions { margin-left: 0; width: 100%; }
    .ctl-actions .btn { width: 100%; justify-content: space-between; }
    .setting { flex-wrap: wrap; }
    .setting .form-control, .setting .form-control.wide { width: 100%; text-align: left; }
    .dock-tray { padding: 6px 8px 8px; }
    .tabbar.dock-3d {
        width: 100%; justify-content: space-around; padding: 6px 4px 5px; border-radius: 20px; gap: 2px;
    }
    .tabbar.dock-3d > .nav-item, .tabbar.dock-3d > .more-wrap { flex: 1 1 0; min-width: 0; }
    .tabbar.dock-3d > .nav-item,
    .tabbar.dock-3d > .more-wrap > .nav-more { width: 100%; padding: 2px 1px; gap: 3px; }
    .dock-ico { width: 34px; height: 34px; border-radius: 11px; }
    .dock-ico svg { width: 16px; height: 16px; }
    .tabbar.dock-3d > .nav-item .lbl,
    .tabbar.dock-3d > .more-wrap > .nav-more .lbl { font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .tabbar.dock-3d > .nav-item:hover .dock-ico { transform: none; }
    .tabbar.dock-3d > .nav-item.active .dock-ico { transform: translateY(-2px) scale(1.03); }
}
@media (max-width: 420px) {
    .grid-2 .grid-2 { grid-template-columns: 1fr; }
    .big-line { font-size: 34px; }
}

/* Tab Cầu thủ của tôi */
/* ---------------- QUẢN LÝ CẦU THỦ ---------------- */
.pm-shell { padding: 8px 8px 18px; }
.pm-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 22px; background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.pm-tabs::-webkit-scrollbar { display: none; }
.pm-tabs button {
    flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; cursor: pointer;
    padding: 11px 16px; border-radius: 18px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s;
}
.pm-tabs button svg { width: 16px; height: 16px; }
.pm-tabs button:hover:not(.on) { color: var(--text); }
.pm-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--line-2) inset, 0 6px 16px -10px rgba(0, 0, 0, .6); }
.pm-badge { min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: color-mix(in oklab, var(--ok) 22%, transparent); color: var(--ok); }
.pm-badge.zero { background: var(--surface-3); color: var(--dim); }
.pm-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 10px 6px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.pm-bar-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-bar-txt b { font-size: 15px; }
#pl-note { margin: 0 12px; }
#pl-note:empty { display: none; }
.pm-view { padding: 10px 10px 0; }
.pm-view[hidden] { display: none; }
.pm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.pm-panel { border: 1px solid var(--line); border-radius: 22px; background: color-mix(in oklab, var(--surface-2) 45%, var(--surface)); min-width: 0; overflow: hidden; }
.pm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; }
.pm-head h3 { font-family: var(--display); font-size: 20px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.pm-head small { color: var(--muted); font-size: 12px; }
.pm-count { text-align: right; white-space: nowrap; }
.pm-count b { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1; }
.pm-count small { margin-left: 4px; }
.pm-search { display: flex; align-items: center; gap: 8px; margin: 0 14px 12px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--dim); }
.pm-search:focus-within { border-color: var(--line-2); }
.pm-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 10px 0; color: var(--text); font-size: 13.5px; }
.pm-row, .pm-thead { display: grid; grid-template-columns: 52px minmax(0, 1fr) 46px 44px 70px; align-items: center; gap: 8px; padding: 0 16px; }
.pm-thead { position: sticky; top: 0; z-index: 1; padding-top: 9px; padding-bottom: 9px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pm-thead button { border: 0; background: none; cursor: pointer; padding: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; }
.pm-thead button:hover { color: var(--text); }
.pm-thead button.on { color: var(--ok); }
.pm-thead button.on::after { content: " ↓"; }
.pm-thead button.on.asc::after { content: " ↑"; }
.pm-thead .r, .pm-row .r { text-align: right; justify-self: end; }
.pm-thead .c, .pm-row .c { text-align: center; justify-self: center; }
#ttcn-panel .ttcn-row { grid-template-columns: minmax(0, 1.4fr) 1.6rem repeat(3, minmax(0, 1fr)); min-height: 2.75rem; overflow-wrap: anywhere; gap: 6px; }
#ttcn-panel .ttcn-price { grid-template-columns: 2.25rem repeat(2, minmax(0, 1fr)); min-height: 2.5rem; overflow-wrap: anywhere; }
#ttcn-panel .pm-thead button { white-space: normal; }
#ttcn-panel .pm-row button { display: flex; white-space: normal; max-width: 100%; margin: 4px 0; }
#ttcn-panel .seg { display: flex; flex-wrap: wrap; }
.ttcn-write-description { margin: 12px 0; white-space: pre-line; overflow-wrap: anywhere; }
.ttcn-write-price { display: block; margin-bottom: 12px; }
.ttcn-write-price[hidden] { display: none; }
.ttcn-favorite { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.ttcn-favorite summary { cursor: pointer; overflow-wrap: anywhere; }
.ttcn-favorite button { margin: 8px 0; }
.pm-list { max-height: 560px; overflow-y: auto; }
.pm-list .empty { padding: 28px 16px; }
.pm-row { padding-top: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--line); transition: background .15s; }
.pm-row:last-child { border-bottom: 0; }
.pm-row:hover { background: color-mix(in oklab, var(--surface-3) 45%, transparent); }
.pos { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-weight: 600; font-size: 12px; white-space: nowrap; }
.pos::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: var(--pc, var(--dim)); }
.pos.g-gk { --pc: var(--mustard); } .pos.g-def { --pc: var(--sky); } .pos.g-mid { --pc: var(--ok); } .pos.g-att { --pc: var(--bad); }
.pm-name { min-width: 0; }
.pm-name b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-name small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-name .tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; font-size: 10.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); vertical-align: 1px; }
.pm-name .tag.lock { color: var(--warn); } .pm-name .tag.new { color: var(--info); } .pm-name .tag.sold { color: var(--ok); }
.pm-ovr { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1; }
.pm-ovr small { display: block; font-family: var(--body); font-size: 10px; font-weight: 600; color: var(--ok); }
.grade { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 7px; font-size: 12px; font-weight: 800; color: var(--ink); background: #b9b2a5; }
.grade.g2 { background: #d0915f; } .grade.g5 { background: #d9dde3; } .grade.g8 { background: var(--mustard); }
.grade.g11 { background: linear-gradient(135deg, #f08b74, #d24f8a); color: #fff; }
.pm-price { font-family: var(--mono); font-weight: 600; font-size: 13px; white-space: nowrap; }
.pm-squad-pick { margin-bottom: 14px; }
.pm-squad-pick .seg { max-width: 100%; }
.pm-squad { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pm-pitch {
    position: relative; border-radius: 22px; padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; min-height: 420px; justify-content: space-around;
    background: repeating-linear-gradient(180deg, #2f5b3e 0 48px, #2a5338 48px 96px); border: 1px solid rgba(255, 255, 255, .12); overflow: hidden;
}
.pm-pitch::before { content: ""; position: absolute; inset: 12px; border: 1.5px solid rgba(255, 255, 255, .22); border-radius: 12px; pointer-events: none; }
.pm-pitch::after { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; border-top: 1.5px solid rgba(255, 255, 255, .22); pointer-events: none; }
.pm-line { position: relative; z-index: 1; display: flex; justify-content: space-evenly; gap: 6px; flex-wrap: wrap; }
.pm-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 86px; text-align: center; }
.pm-slot { background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
.pm-slot-changed { outline: 2px solid var(--mustard); }
.pm-pitch-empty { color: #fff; }
.pm-squad-modes { margin: 8px 4px 0; }
.pm-dot .shirt { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--ink); background: var(--pc, #efe6d2); border: 2px solid rgba(0, 0, 0, .35); }
.pm-dot.g-gk { --pc: var(--mustard); } .pm-dot.g-def { --pc: var(--sky); } .pm-dot.g-mid { --pc: var(--mint); } .pm-dot.g-att { --pc: var(--peach); }
.pm-dot .nm { font-size: 11.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-dot .grade { height: 17px; min-width: 24px; font-size: 10.5px; border-radius: 5px; }
.pm-subs .pm-head { padding-bottom: 8px; }
/* ---- Đội hình (đội giả lập): thanh chọn, sân, các bảng ---- */
.pm-tac-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 20px; background: color-mix(in oklab, var(--surface-2) 45%, var(--surface)); }
.pm-tac-team { display: grid; gap: 2px; margin-right: auto; min-width: 0; }
.pm-tac-team b { font-family: var(--display); font-size: 20px; font-weight: 800; line-height: 1.1; }
.pm-tac-team small { color: var(--muted); font-size: 12px; }
.pm-tac-row { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.pm-tac-lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pm-tac-abc button { min-width: 40px; }
.pm-tac-slots { display: grid; grid-template-columns: repeat(10, 34px); gap: 4px; }
.pm-tac-slot { position: relative; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-family: var(--mono); font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; }
.pm-tac-slot:hover:not(:disabled):not(.on) { border-color: var(--line-2); }
.pm-tac-slot.on { background: var(--mustard); color: var(--ink); border-color: var(--mustard); }
.pm-tac-slot.used::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok, #6fcf97); box-shadow: 0 0 0 2px var(--surface-2); }
.pm-tac-slot.on.used::after { box-shadow: 0 0 0 2px var(--mustard); }
.pm-tac-slot:disabled { opacity: .35; cursor: not-allowed; }
.pm-tac-slot:focus-visible, .pm-tac-dot:focus-visible { outline: 2px solid var(--mustard); outline-offset: 2px; }
.pm-tac-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.pm-tac-field { padding: 14px; }
.pm-tac-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pm-tac-name { display: grid; gap: 1px; min-width: 0; }
.pm-tac-name small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pm-tac-name b { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.pm-tac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-tac-pitch {
    position: relative; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 68 / 90; border-radius: 16px; overflow: hidden;
    background: repeating-linear-gradient(180deg, #2f5b3e 0 10%, #2a5338 10% 20%); border: 1px solid rgba(255, 255, 255, .12);
    display: flex; flex-direction: column; justify-content: space-around; padding: 10px 4px;
}
.pm-tac-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; fill: none; stroke: rgba(255, 255, 255, .24); stroke-width: .35; vector-effect: non-scaling-stroke; }
.pm-tac-pitch .pm-line { position: relative; z-index: 1; display: flex; justify-content: space-evenly; gap: 4px; }
.pm-tac-dot { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 76px; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: center; color: inherit; }
.pm-tac-dot.abs { position: absolute; transform: translate(-50%, -34%); }
.pm-tac-dot .shirt { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--ink); background: var(--pc, #efe6d2); border: 2px solid rgba(0, 0, 0, .35); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .12s; }
.pm-tac-dot:hover .shirt { transform: scale(1.08); }
.pm-tac-dot.on .shirt { box-shadow: 0 0 0 3px var(--mustard), 0 2px 8px rgba(0, 0, 0, .4); }
.pm-tac-dot.g-gk { --pc: var(--mustard); } .pm-tac-dot.g-def { --pc: var(--sky); } .pm-tac-dot.g-mid { --pc: var(--mint); } .pm-tac-dot.g-att { --pc: var(--peach); }
.pm-tac-dot .nm { font-size: 11px; font-weight: 700; line-height: 1.15; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pm-tac-dot .grade { height: 16px; min-width: 24px; font-size: 10px; border-radius: 5px; }
.pm-tac-side { display: grid; gap: 12px; min-width: 0; }
.pm-tac-side .pm-head { align-items: center; padding: 14px 16px 6px; }
.pm-tac-side .pm-head h3 { font-size: 17px; }
.pm-tac-side .pm-count b { font-size: 22px; }
.pm-tac-body { padding: 4px 16px 14px; display: grid; gap: 6px; }
.pm-tac-body .param { grid-template-columns: minmax(0, 1fr) 96px 26px; margin: 0; }
.pm-tac-body .param .bar { background: var(--surface-3); }
.pm-tac-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); padding: 2px 0; }
.pm-tac-kv b { color: var(--text); text-align: right; }
.pm-tac-ment { padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px dashed var(--line); }
.pm-tac-ment b { font-family: var(--display); font-size: 15px; color: var(--mustard); }
.pm-tac-who { display: flex; align-items: center; gap: 8px; font-size: 14px; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px dashed var(--line); min-width: 0; }
.pm-tac-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-tac-hint { color: var(--muted); font-size: 13px; }
.pm-tac-note { font-size: 11.5px; color: var(--dim); margin-top: 4px; line-height: 1.4; }
.pm-tac-sub { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.pm-tac-sub:last-child { border-bottom: 0; }
.pm-tac-subnm { display: grid; min-width: 0; }
.pm-tac-subnm b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-tac-subnm small { color: var(--muted); font-size: 11.5px; }
.pm-tac-subovr { font-family: var(--mono); font-weight: 700; }
/* Chế độ Sửa */
.pm-tac-editnote { margin: -4px 0 10px; padding: 8px 12px; border-radius: 12px; font-size: 12.5px; color: var(--text); background: color-mix(in oklab, var(--mustard) 14%, transparent); border: 1px dashed color-mix(in oklab, var(--mustard) 55%, transparent); }
.pm-tac-wrap.editing .pm-tac-pitch { box-shadow: 0 0 0 2px color-mix(in oklab, var(--mustard) 45%, transparent); }
.pm-tac-dot .shirt { position: relative; }
.pm-tac-off { position: absolute; top: -5px; right: -7px; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 800; color: var(--ink); background: var(--mustard); border: 1.5px solid rgba(0, 0, 0, .4); }
.pm-tac-dot.chg .shirt { box-shadow: 0 0 0 3px var(--peach), 0 2px 6px rgba(0, 0, 0, .35); }
.pm-tac-dot.chg.on .shirt { box-shadow: 0 0 0 3px var(--mustard), 0 0 0 6px var(--peach); }
.pm-tac-namein { display: flex; gap: 6px; align-items: center; }
.pm-tac-namein input { min-width: 0; width: 200px; max-width: 100%; }
.pm-tac-save { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: color-mix(in oklab, var(--peach) 12%, transparent); }
.pm-tac-save span { margin-right: auto; font-size: 13px; font-weight: 600; }
.pm-tac-cand { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px dashed var(--line); color: inherit; cursor: pointer; font: inherit; font-size: 13px; border-radius: 8px; }
.pm-tac-cand:hover { background: var(--surface-2); }
.pm-tac-cand.on { background: color-mix(in oklab, var(--mustard) 18%, transparent); }
.pm-tac-cand.chg .pm-tac-subnm b { color: var(--peach); }
.pm-tac-cands { display: grid; max-height: 300px; overflow-y: auto; margin-top: 6px; }
.pm-tac-sel { width: auto; min-width: 0; max-width: 60%; padding: 4px 8px; font-size: 13px; height: auto; }
.pm-tac-body .param input[type="range"] { width: 96px; accent-color: var(--mustard); }
.pm-tac-body .param.chg span, .pm-tac-kv.chg span { color: var(--peach); font-weight: 600; }
.pm-tac-diff { margin: 6px 0 10px; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
/* ---- Đội hình + kho chung một trang (27/11/2026): kho trái · sân giữa · chi tiết phải. Giữ màu / font sẵn có. ---- */
.pm-merge { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.pm-merge > #pl-squads { min-width: 0; }
.pm-merge .pm-tac-wrap { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); }
.pm-kho .pm-head { padding-bottom: 10px; }
.pm-kho .pm-list { max-height: 820px; }
.pm-kho-seg { display: flex; margin: 0 14px 10px; }
.pm-kho-seg button { flex: 1; }
.pm-kho-seg em { font-style: normal; font-family: var(--mono); font-size: 11px; opacity: .7; margin-left: 4px; }
.pm-kho-pos { display: flex; flex-wrap: wrap; gap: 5px; margin: -2px 14px 12px; }
.pm-kho-pos button { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: none; color: var(--muted); font: 600 12px var(--body); cursor: pointer; }
.pm-kho-pos button:hover:not(.on) { color: var(--text); }
.pm-kho-pos button.on { background: var(--text); color: var(--ink); border-color: var(--text); }
.pm-kho .pm-row, .pm-kho .pm-thead { grid-template-columns: 42px minmax(0, 1fr) 38px 40px 56px; gap: 8px; padding-left: 12px; padding-right: 12px; }
.pm-kho .pm-row { padding-top: 8px; padding-bottom: 8px; }
.pm-kho .pm-row.pm-can-put { cursor: grab; box-shadow: inset 3px 0 0 color-mix(in oklab, var(--mustard) 70%, transparent); }
.pm-kho .pm-row.pm-can-put:active { cursor: grabbing; }
/* ảnh mặt nhỏ (khung kho, dự bị, người thay): viền dưới theo màu nhóm vị trí, nhãn vị trí góc dưới */
.pm-face { --pc: var(--dim); position: relative; width: 42px; height: 42px; border-radius: 12px; overflow: hidden; flex: none;
    background: linear-gradient(160deg, var(--surface-3), var(--surface)); box-shadow: inset 0 -3px 0 var(--pc); }
.pm-face img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.pm-face i { position: absolute; left: 0; bottom: 3px; padding: 0 4px; border-radius: 0 5px 5px 0; font: 700 8.5px/13px var(--mono); font-style: normal; color: var(--ink); background: var(--pc); }
.pm-face.sm { width: 36px; height: 36px; border-radius: 10px; }
.pm-face.g-gk, .pm-pc.g-gk, .pm-tac-dot.g-gk .pm-pc { --pc: var(--mustard); }
.pm-face.g-def, .pm-pc.g-def, .pm-tac-dot.g-def .pm-pc { --pc: var(--sky); }
.pm-face.g-mid, .pm-pc.g-mid, .pm-tac-dot.g-mid .pm-pc { --pc: var(--ok); }
.pm-face.g-att, .pm-pc.g-att, .pm-tac-dot.g-att .pm-pc { --pc: var(--bad); }
/* Dòng cầu thủ dạng thẻ (27/11, người dùng: cột Thẻ và Giá đè nhau): ảnh · tên/mùa/trạng thái · OVR+cấp / giá */
.pm-kho .pm-row.pm-card-row { grid-template-columns: 46px minmax(0, 1fr) auto 10px; gap: 10px; padding: 9px 12px; align-items: center; }
.pm-card-row .pm-face { width: 46px; height: 46px; }
.pm-card-row .pm-name { display: grid; gap: 2px; }
.pm-card-row .pm-name b { font-size: 14px; }
.pm-card-row .pm-name small { display: flex; align-items: center; gap: 0; }
.pm-status { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.pm-status:empty { display: none; }
.pm-status .tag { margin: 0; }
.pm-st { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; line-height: 16px; white-space: nowrap;
    color: var(--c); background: color-mix(in oklab, var(--c) 16%, transparent); }
.pm-st.st-start { --c: var(--ok); } .pm-st.st-bench { --c: var(--pm-sky, var(--sky)); } .pm-st.st-free { --c: var(--pm-gold, var(--mustard)); }
.pm-right { display: grid; justify-items: end; gap: 4px; }
.pm-right-top { display: flex; align-items: center; gap: 6px; }
.pm-right .pm-ovr { font-size: 20px; }
.pm-right .grade { height: 20px; min-width: 28px; font-size: 11px; }
.pm-right .pm-price { font-size: 12px; color: var(--muted); }
.pm-chev { color: var(--dim); font-size: 18px; line-height: 1; transition: transform .15s; }
.pm-row.pl-open .pm-chev { transform: rotate(90deg); color: var(--pm-gold, var(--mustard)); }
.pm-sortbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 12px; }
.pm-sortbar > span { font-size: 11.5px; color: var(--muted); margin-right: 4px; }
.pm-sortbar button { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.pm-sortbar button.on { border-color: var(--pm-gold, var(--mustard)); color: var(--pm-gold, var(--mustard)); }
.pm-sea { height: 13px; width: auto; margin-right: 5px; vertical-align: -2px; border-radius: 2px; }
.pm-tac-sub { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
/* thẻ cầu thủ trên sân: ảnh mặt, OVR, vị trí, mùa, cấp; viền trên theo nhóm vị trí, nền theo cấp thẻ */
.pm-pc { --pc: var(--dim); position: relative; display: block; width: 60px; height: 74px; border-radius: 10px 10px 16px 16px; overflow: hidden;
    background: linear-gradient(165deg, var(--surface-3), var(--surface) 78%); border: 1px solid var(--line-2); box-shadow: inset 0 3px 0 var(--pc), 0 8px 16px -8px rgba(0, 0, 0, .75); transition: transform .12s; }
.pm-pc.g5 { background: linear-gradient(165deg, color-mix(in oklab, #d9dde3 30%, var(--surface-3)), var(--surface) 78%); }
.pm-pc.g8 { background: linear-gradient(165deg, color-mix(in oklab, var(--mustard) 45%, var(--surface-3)), var(--surface) 80%); border-color: color-mix(in oklab, var(--mustard) 60%, transparent); }
.pm-pc.g11 { background: linear-gradient(165deg, color-mix(in oklab, #e0607e 45%, var(--surface-3)), var(--surface) 80%); border-color: color-mix(in oklab, #f08b74 65%, transparent); }
.pm-pc-face { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; height: 80%; object-fit: cover; object-position: top; }
.pm-pc-ovr { position: absolute; left: 5px; top: 4px; z-index: 1; font-family: var(--display); font-size: 17px; font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.pm-pc-pos { position: absolute; left: 5px; top: 21px; z-index: 1; font-family: var(--mono); font-size: 8.5px; font-weight: 700; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 2px #000; }
.pm-pc-sea { position: absolute; right: 4px; top: 5px; z-index: 1; height: 11px; width: auto; border-radius: 2px; }
.pm-pc .grade { position: absolute; right: 3px; bottom: 3px; z-index: 1; height: 15px; min-width: 22px; padding: 0 4px; font-size: 9.5px; border-radius: 5px; }
.pm-tac-dot { width: 84px; gap: 3px; }
/* Thẻ trên sân co theo bề ngang sân (container query) để 11 người không đè nhau khi cột sân hẹp. */
.pm-stage .pm-tac-pitch { container-type: inline-size; }
.pm-stage .pm-tac-dot { width: clamp(46px, 17cqw, 86px); }
.pm-stage .pm-pc { width: clamp(36px, 12.5cqw, 64px); height: clamp(45px, 15.5cqw, 80px); }
.pm-stage .pm-pc-ovr { font-size: clamp(11px, 3.6cqw, 18px); left: 4px; top: 3px; }
.pm-stage .pm-pc-pos { font-size: clamp(6.5px, 1.8cqw, 9px); top: clamp(14px, 4.4cqw, 21px); left: 4px; }
.pm-stage .pm-pc-sea { height: clamp(8px, 2.3cqw, 11px); }
.pm-stage .pm-pc .grade { height: clamp(11px, 3cqw, 15px); min-width: clamp(16px, 4.4cqw, 22px); font-size: clamp(7.5px, 2cqw, 9.5px); padding: 0 2px; }
.pm-stage .pm-tac-dot .nm { font-size: clamp(8.5px, 2.4cqw, 11px); }
.pm-tac-dot.abs { transform: translate(-50%, -50%); }
.pm-tac-dot:hover .pm-pc { transform: translateY(-2px); }
.pm-tac-dot.on .pm-pc { box-shadow: inset 0 3px 0 var(--pc), 0 0 0 3px var(--mustard), 0 8px 16px -8px rgba(0, 0, 0, .75); }
.pm-tac-dot.chg .pm-pc { box-shadow: inset 0 3px 0 var(--pc), 0 0 0 3px var(--peach), 0 8px 16px -8px rgba(0, 0, 0, .75); }
.pm-tac-dot.chg.on .pm-pc { box-shadow: inset 0 3px 0 var(--pc), 0 0 0 3px var(--mustard), 0 0 0 6px var(--peach); }
.pm-tac-dot.pm-drop .pm-pc { outline: 2px dashed var(--ok); outline-offset: 3px; }
.pm-tac-dot .nm { padding: 1px 5px; border-radius: 5px; background: rgba(12, 10, 6, .62); text-shadow: none; -webkit-line-clamp: 1; }
.pm-pc .pm-tac-off { top: 22px; right: 3px; left: auto; z-index: 2; }
#pl-squads.pm-dragging .pm-tac-dot .pm-pc { box-shadow: inset 0 3px 0 var(--pc), 0 0 0 1px color-mix(in oklab, var(--ok) 50%, transparent); }
.pm-tac-sub.pm-drop { background: color-mix(in oklab, var(--ok) 16%, transparent); }
/* thẻ chi tiết cầu thủ đang chọn (cột phải) */
.pm-hero-in { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; padding: 16px 16px 12px;
    background: radial-gradient(260px 140px at 15% 0, color-mix(in oklab, var(--mustard) 16%, transparent), transparent 70%); }
.pm-pc.big { width: 96px; height: 120px; border-radius: 14px 14px 22px 22px; }
.pm-pc.big .pm-pc-ovr { font-size: 30px; left: 8px; top: 7px; }
.pm-pc.big .pm-pc-pos { font-size: 12px; left: 9px; top: 37px; }
.pm-pc.big .pm-pc-sea { height: 15px; right: 6px; top: 8px; }
.pm-pc.big .grade { height: 20px; min-width: 28px; font-size: 11.5px; right: 5px; bottom: 5px; }
.pm-hero-txt { display: grid; gap: 3px; min-width: 0; }
.pm-hero-txt > b { font-family: var(--display); font-size: 21px; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.pm-hero-txt > small { color: var(--muted); font-size: 12px; }
.pm-hero-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.pm-hero-kv span { padding: 5px 8px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.pm-hero-kv small { display: block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pm-hero-kv b { font-family: var(--display); font-size: 16px; font-weight: 800; white-space: nowrap; }
.pm-hero .pl-bar { background: none; border: 0; padding: 0 16px 14px; }
/* ---- Màu nhấn + 3D (theo cách tab GLXH làm: nền tối có quầng màu, sân nghiêng, thẻ đứng) ---- */
#tab-players {
    --pm-gold: #f2c35b; --pm-sky: #7cc0ee; --pm-violet: #b49cf6; --pm-rose: #f08fbd; --pm-mint: #7fd8b4; --pm-hot: #ef6a5a;
    --pm-tilt: 26deg;
}
:root[data-theme="light"] #tab-players {
    --pm-gold: #b7861a; --pm-sky: #2f7fc0; --pm-violet: #7352d4; --pm-rose: #c8467f; --pm-mint: #1f8f69; --pm-hot: #d23f2c;
}
.pm-title { background: linear-gradient(90deg, var(--text) 35%, var(--pm-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pm-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pm-actions .muted { font-size: 12.5px; }
.pm-tac-bar {
    background:
        radial-gradient(70% 140% at 0% 0%, color-mix(in oklab, var(--pm-violet) 20%, transparent), transparent 62%),
        radial-gradient(60% 140% at 100% 100%, color-mix(in oklab, var(--pm-sky) 14%, transparent), transparent 60%),
        var(--surface);
    border-color: var(--line-2); box-shadow: var(--shadow);
}
.pm-tac-team b { background: linear-gradient(90deg, var(--text) 30%, var(--pm-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pm-tac-abc button.on, .pm-kho-seg button.on { background: color-mix(in oklab, var(--pm-mint) 24%, var(--surface)); color: var(--text); box-shadow: inset 0 -2px 0 var(--pm-mint); }
.pm-tac-slot { box-shadow: 0 3px 0 color-mix(in oklab, var(--surface-3) 80%, #000); transition: transform .12s, box-shadow .12s; }
.pm-tac-slot:hover:not(:disabled) { transform: translateY(-1px); }
.pm-tac-slot.on { background: linear-gradient(180deg, color-mix(in oklab, var(--pm-gold) 90%, #fff), var(--pm-gold)); border-color: var(--pm-gold);
    box-shadow: 0 3px 0 color-mix(in oklab, var(--pm-gold) 45%, #000), 0 8px 18px -8px color-mix(in oklab, var(--pm-gold) 70%, transparent); }
.pm-tac-slot.on.used::after { box-shadow: 0 0 0 2px var(--pm-gold); }
.pm-kho {
    background: radial-gradient(90% 40% at 0% 0%, color-mix(in oklab, var(--pm-sky) 16%, transparent), transparent 70%), var(--surface);
    border-color: var(--line-2); box-shadow: var(--shadow);
}
.pm-kho .pm-head h3 { color: var(--pm-sky); }
.pm-kho-pos button.on { background: var(--pm-sky); color: var(--ink); border-color: var(--pm-sky); }
.pm-kho .pm-row { transition: background .15s, transform .15s; }
.pm-kho .pm-row:hover { transform: translateX(2px); }
.pm-face { box-shadow: inset 0 -3px 0 var(--pc), 0 4px 10px -6px rgba(0, 0, 0, .8); }
.pm-tac-field {
    background: radial-gradient(90% 50% at 50% 0%, color-mix(in oklab, var(--pm-mint) 16%, transparent), transparent 70%), var(--surface);
    border-color: var(--line-2); box-shadow: var(--shadow);
}
.pm-tone-violet, .pm-tone-mint, .pm-tone-sky, .pm-tone-rose, .pm-hero { --tone: var(--pm-gold);
    background: radial-gradient(100% 70% at 100% 0%, color-mix(in oklab, var(--tone) 18%, transparent), transparent 65%), var(--surface);
    border-color: var(--line-2); box-shadow: var(--shadow); }
.pm-tone-violet { --tone: var(--pm-violet); } .pm-tone-mint { --tone: var(--pm-mint); } .pm-tone-sky { --tone: var(--pm-sky); } .pm-tone-rose { --tone: var(--pm-rose); }
.pm-tac-side .pm-head h3 { color: var(--tone, var(--text)); }
.pm-tac-body .param .bar > div { background: linear-gradient(90deg, var(--pm-mint), var(--pm-gold)); }
.pm-tac-ment b { color: var(--pm-mint); }
.pm-hero .pm-hero-txt > b { background: linear-gradient(90deg, var(--text) 40%, var(--pm-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pm-hero-kv span { background: color-mix(in oklab, var(--pm-gold) 10%, var(--surface-2)); }
.pl-sheet-face { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; object-position: top; background: var(--surface-3); }
/* sân 3D: mặt sân nghiêng ra sau, viền dày phía trước, thẻ cầu thủ đứng thẳng trên sân */
.pm-stage { perspective: 1100px; perspective-origin: 50% 15%; padding: 54px 0 26px; }
.pm-stage .pm-tac-pitch {
    overflow: visible; transform: rotateX(var(--pm-tilt)); transform-origin: 50% 100%; transform-style: preserve-3d;
    background:
        radial-gradient(70% 45% at 50% 100%, rgba(255, 255, 255, .10), transparent 70%),
        linear-gradient(180deg, rgba(0, 0, 0, .22), transparent 35%),
        repeating-linear-gradient(180deg, #2f5b3e 0 10%, #2a5338 10% 20%);
    box-shadow: 0 12px 0 #16301f, 0 13px 0 rgba(0, 0, 0, .5), 0 52px 40px -26px rgba(0, 0, 0, .7);
}
.pm-stage .pm-tac-dot { transform-origin: 50% 100%; }
.pm-stage .pm-tac-dot.abs { transform: translate(-50%, -100%) rotateX(calc(var(--pm-tilt) * -1)); }
.pm-stage .pm-tac-dot:not(.abs) { transform: rotateX(calc(var(--pm-tilt) * -1)); }
.pm-stage .pm-tac-dot::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 46px; height: 10px; transform: translateX(-50%);
    border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .5), transparent); z-index: -1; }
.pm-stage .pm-tac-dot:hover .pm-pc { transform: translateY(-5px); }
.pm-pc::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
    background: linear-gradient(125deg, rgba(255, 255, 255, .22) 0%, transparent 32%, transparent 70%, rgba(255, 255, 255, .06) 100%); }
.pm-pc.g8, .pm-pc.g11 { animation: pm-shine 4.5s ease-in-out infinite; }
@keyframes pm-shine { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
@media (prefers-reduced-motion: reduce) { .pm-pc.g8, .pm-pc.g11 { animation: none; } .pm-kho .pm-row:hover { transform: none; } }
@media (max-width: 1320px) {
    .pm-merge { grid-template-columns: minmax(0, 1fr); }
    .pm-kho { order: 2; }
    .pm-kho .pm-list { max-height: 560px; }
}
@media (max-width: 1020px) { .pm-tac-wrap, .pm-merge .pm-tac-wrap { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    .pm-kho .pm-row, .pm-kho .pm-thead { grid-template-columns: 38px minmax(0, 1fr) 34px 38px 52px; gap: 6px; padding-left: 10px; padding-right: 10px; }
    .pm-face { width: 38px; height: 38px; }
    .pm-kho-seg, .pm-kho-pos { margin-left: 10px; margin-right: 10px; }
    .pm-kho .pm-list { max-height: none; }
    .pm-tac-dot { width: 56px; gap: 2px; }
    .pm-pc { width: 42px; height: 52px; border-radius: 8px 8px 12px 12px; }
    .pm-pc-ovr { font-size: 12.5px; left: 3px; top: 3px; }
    .pm-pc-pos { font-size: 7px; left: 3px; top: 15px; }
    .pm-pc-sea { display: none; }
    .pm-pc .grade { height: 12px; min-width: 17px; font-size: 8px; padding: 0 2px; right: 2px; bottom: 2px; }
    .pm-pc .pm-tac-off { width: 12px; height: 12px; font-size: 8px; top: 14px; right: 2px; }
    .pm-tac-dot .nm { font-size: 9px; padding: 0 3px; }
    #tab-players { --pm-tilt: 18deg; }
    .pm-stage { padding: 40px 0 18px; }
    .pm-stage .pm-tac-dot::after { width: 32px; height: 7px; }
    .pm-pc.big { width: 84px; height: 106px; }
    .pm-hero-in { grid-template-columns: 84px minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .pm-tac-bar { padding: 12px; gap: 10px; }
    .pm-tac-team { margin-right: 0; width: 100%; }
    .pm-tac-row { width: 100%; display: grid; grid-template-columns: 1fr; gap: 6px; }
    .pm-tac-row > div { min-width: 0; }
    .pm-tac-abc { display: flex; }
    .pm-tac-abc button { flex: 1; }
    .pm-tac-slots { grid-template-columns: repeat(10, minmax(0, 1fr)); width: 100%; gap: 3px; }
    .pm-tac-slot { height: 32px; font-size: 12px; }
    .pm-tac-field { padding: 10px; }
    .pm-tac-name b { font-size: 19px; }
    /* Điện thoại: chấm gọn (tên 1 dòng, cấp thẻ nhỏ) để 11 người không đè nhau */
    .pm-tac-dot { width: 54px; gap: 1px; }
    .pm-tac-dot .shirt { width: 26px; height: 26px; font-size: 8.5px; }
    .pm-tac-dot .nm { font-size: 9px; -webkit-line-clamp: 1; }
    .pm-tac-dot .grade { height: 12px; min-width: 18px; font-size: 8.5px; padding: 0 3px; }
}
@media (max-width: 1020px) { .pm-cols, .pm-squad { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    .pm-shell { padding: 6px 6px 14px; }
    .pm-tabs button { padding: 10px 10px; font-size: 13px; gap: 6px; }
    .pm-tabs button svg { display: none; }
    .pm-list { max-height: none; }
    .pm-bar { margin: 12px 4px 4px; }
    .pm-view { padding: 10px 4px 0; }
    .pm-row, .pm-thead { grid-template-columns: 44px minmax(0, 1fr) 36px 40px 62px; gap: 6px; padding-left: 12px; padding-right: 12px; }
    .pm-pitch { min-height: 360px; padding: 14px 6px; }
    .pm-dot { width: 64px; }
    .pm-dot .shirt { width: 32px; height: 32px; font-size: 10px; }
}

/* Cầu thủ của tôi: bấm dòng → thanh thao tác (Đăng ký bán / Huỷ đăng ký bán / Nâng cấp thẻ) */
.pl-hint { padding: 8px 16px 0; font-size: 11.5px; color: var(--dim); }
.pm-name .tag.selling { color: var(--mustard); }
.pm-row.pl-row-act { cursor: pointer; }
.pm-row.pl-row-act:focus-visible { outline: 2px solid var(--mustard); outline-offset: -2px; }
.pm-row.pl-open { background: var(--surface-2); border-bottom-color: transparent; }
.pl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
    padding: 0 16px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); animation: pl-fade .15s ease-out; }
@keyframes pl-fade { from { opacity: 0; } to { opacity: 1; } }
/* nhãn trạng thái (mới / khoá / đang bán…) nằm đầu dòng phụ để không bị cắt khi tên dài */
#tab-players .pm-name small .tag { margin: 0 6px 0 0; }
.pl-bar-note { flex: 1 1 200px; min-width: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pl-bar-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
#pl-msg.pl-msg-ok { border: 1.5px solid var(--ok); background: color-mix(in oklab, var(--ok) 12%, var(--surface)); }
/* hộp đăng bán / huỷ bán */
.pl-sheet .pl-sheet-card { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; color: var(--text); }
.pl-sheet .pl-sheet-sum { margin: 14px 0 4px; color: var(--text); font-size: 14.5px; line-height: 1.5; }
.pl-sheet .pl-sheet-dim { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pl-sheet .pl-sheet-note { margin: 10px 0 0; font-size: 13px; line-height: 1.45; }
.pl-sheet .pl-sheet-note:empty { display: none; }
.pl-sheet .pl-sheet-note.bad { color: var(--bad); }
.pl-sheet .pl-sheet-note.warn { color: var(--warn); }
.pl-opts { display: grid; gap: 8px; }
.pl-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 14px;
    border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, background .15s; }
.pl-opt:hover { border-color: var(--muted); }
.pl-opt.on { border-color: var(--mustard); background: color-mix(in oklab, var(--mustard) 10%, var(--surface)); }
.pl-opt input { accent-color: var(--mustard); margin: 0; }
.pl-opt-label { display: grid; font-weight: 600; font-size: 14px; }
.pl-opt-label small { font-weight: 400; font-size: 12px; color: var(--muted); }
.pl-opt-price { font-family: var(--mono); font-size: 14.5px; white-space: nowrap; }
@media (max-width: 640px) {
    .pl-hint { padding: 8px 12px 0; }
    .pl-bar { padding: 0 12px 12px; }
    .pl-bar-btns { width: 100%; margin-left: 0; }
    .pl-bar-btns .btn { flex: 1 1 auto; }
    .pl-opt { padding: 10px 12px; }
}

/* GLXH: đổi tinh thần giữa trận */
.glxh-rules { margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.glxh-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); font-size: 13px; }
.glxh-rule .gr-min { width: 64px; padding: 4px 6px; }
.glxh-rule select { width: auto; max-width: 100%; padding: 4px 6px; }
.glxh-rule .gr-lbl { color: var(--muted); }
.glxh-rule .gr-btns { margin-left: auto; display: flex; gap: 4px; }
.glxh-rule .gr-btns button { min-width: 28px; padding: 2px 6px; line-height: 1.2; }
.glxh-rules-empty { color: var(--muted); font-size: 13px; }
.live-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; margin: 14px 0 18px; color: var(--text); }
.live-team { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.live-team-opponent { text-align: right; }
.live-scorers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin: -8px 0 14px; font-size: 12px; color: var(--muted); }
.live-scorers[hidden] { display: none; }
.live-scorers > div > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin: 3px 0; }
.live-scorers > div:last-child > div { justify-content: flex-end; text-align: right; }
.live-scorers span { overflow-wrap: anywhere; }
.live-scorers time { white-space: nowrap; font-family: var(--mono); color: var(--text); }
.live-match-stats { margin-top: 16px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.live-match-stat { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 4px 0; font-size: 12px; }
.live-match-stat span { color: var(--muted); text-align: center; }
.live-match-stat b { font-family: var(--mono); font-weight: 600; }
.live-match-stat b:last-child { text-align: right; }
.live-match-stats small { display: block; color: var(--muted); margin-top: 6px; font-size: 11px; }
.live-scoreline { font: 700 34px var(--mono); white-space: nowrap; color: var(--cream); letter-spacing: -.04em; }
@media (max-width: 640px) {
    .live-score { gap: 8px; }
    .live-scoreline { font-size: 28px; }
    .live-team { font-size: 13px; }
}
.glxh-history { min-width: 0; }
.glxh-history-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.glxh-history-list { max-height: 610px; overflow-y: auto; }
.glxh-match { min-width: 0; border-top: 1px solid var(--line-2); }
.glxh-match summary { display: flex; list-style: none; align-items: center; gap: 12px; padding: 12px 8px; cursor: pointer; }
.glxh-match summary:hover, .glxh-match[open] { background: var(--surface-2); }
.glxh-match summary::-webkit-details-marker { display: none; }
.glxh-match summary:focus-visible { outline-offset: -3px; }
.glxh-match summary::after { content: ''; flex: none; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.glxh-match[open] summary::after { transform: rotate(225deg); }
.glxh-match-summary { flex: 1; min-width: 0; }
.glxh-match-summary b { display: block; overflow-wrap: anywhere; }
.glxh-match-summary small { color: var(--muted); font-size: 12px; }
.glxh-match-result { flex: none; display: flex; align-items: center; gap: 10px; }
.glxh-match-score { font: 600 18px var(--mono); font-variant-numeric: tabular-nums; }
.glxh-match-details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px 8px 12px; }
.glxh-match-details section { min-width: 0; }
.glxh-match-details h4 { margin: 0 0 6px; font-size: 13px; }
.glxh-match-details p { margin: 0 0 4px; font-size: 12px; overflow-wrap: anywhere; }
.glxh-match-details ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 12px; overflow-wrap: anywhere; }
.glxh-match-goal { display: grid; grid-template-columns: 3.6em minmax(0, 1fr); gap: 5px; }
.glxh-match-goal time { color: var(--muted); font-variant-numeric: tabular-nums; }
.glxh-match-commands { grid-column: 1 / -1; }
@media (max-width: 640px) {
    .glxh-match-details { grid-template-columns: 1fr; }
    .glxh-match summary { gap: 8px; }
    .glxh-match-result { display: grid; justify-items: end; gap: 3px; }
}
@media (max-width: 640px) {
    .glxh-rule .gr-min { width: 56px; }
    .glxh-rule select { flex: 1 1 120px; }
}

/* GLXH: luật giữa trận (hành động + tham số) */
.glxh-rule .gr-params { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.glxh-rule .gr-params select { max-width: 100%; min-width: 0; }
.glxh-rule .gr-hint { flex-basis: 100%; color: var(--muted); font-size: 12px; }
/* Nhãn + ô luôn đi cùng nhau; trên màn hẹp cụm giãn ra để ô chọn chiếm phần còn lại. */
.glxh-rule .gr-pair { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
    .glxh-rule .gr-pair { flex: 1 1 auto; }
    .glxh-rule .gr-pair select { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 640px) {
    .glxh-rule .gr-params { flex: 1 1 100%; }
    .glxh-rule .gr-params select { flex: 1 1 130px; }
    .glxh-rule .gr-btns { margin-left: 0; }
}

/* ===== Tab "Acc Garena": đăng nhập + quản lý acc, bản đơn giản cho người dùng ===== */
.lg-seg { display: flex; width: 100%; margin-bottom: 16px; }
.lg-seg button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.lg-seg-sm { margin-bottom: 14px; }
.lg-seg-sm button { font-size: 12.5px; padding: 7px 10px; }
.lg-tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: color-mix(in oklab, var(--ok) 22%, transparent); color: var(--ok); }
.lg-lead { margin-bottom: 14px; }
.lg-steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: lg; display: grid; gap: 10px; }
.lg-steps li { counter-increment: lg; position: relative; padding-left: 32px; min-height: 22px; font-size: 13.5px; line-height: 1.5; }
.lg-steps li::before { content: counter(lg); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; line-height: 1; }
.lg-steps a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.lg-relogin:not(:empty) { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.lg-warn { margin: 10px 0 14px; font-size: 12.5px; color: var(--warn); }
.lg-status:empty { display: none; }
.lg-status { margin-bottom: 10px; }
.lg-paste { margin-bottom: 14px; padding: 16px; border-radius: 18px; border: 1.5px dashed var(--warn); background: color-mix(in oklab, var(--warn) 7%, var(--surface)); font-size: 13.5px; display: grid; gap: 10px; }
.lg-paste-title { font-weight: 700; color: var(--warn); }
.lg-paste .lg-steps { margin-bottom: 0; }
.lg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lg-row .form-control { flex: 1 1 220px; min-width: 0; }
.lg-note { font-size: 12px; }

#tab-account .acc { align-items: center; }
.acc-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acc-line + .acc-line { margin-top: 4px; }
.acc-line .meta { margin-top: 0; }
.acc-side { display: flex; gap: 6px; align-items: center; flex: none; }
.acc-menu { position: relative; }
.acc-menu > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 18px; line-height: 1; color: var(--muted); user-select: none; }
.acc-menu > summary::-webkit-details-marker { display: none; }
.acc-menu > summary:hover, .acc-menu[open] > summary { color: var(--text); background: var(--surface); }
.acc-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; max-width: min(320px, calc(100vw - 32px)); padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); display: grid; }
.acc-menu-list button { text-align: left; border: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.acc-menu-list button:hover, .acc-menu-list button:focus-visible { background: var(--surface-2); outline: none; }
.acc-menu-list button.danger { color: var(--bad); }

@media (max-width: 1020px) {
    /* Màn hẹp (1 cột): danh sách acc lên trước, khung "Thêm acc" xuống dưới. */
    .lg-page > #login-panel { order: 2; }
}
@media (max-width: 520px) {
    #tab-account .acc { flex-wrap: wrap; }
    #tab-account .acc .grow { flex: 1 1 calc(100% - 110px); }
    .acc-side { width: 100%; justify-content: flex-end; }
    .lg-seg button { white-space: normal; }
}
/* Garena: các mảng màu cùng bảng pastel với GLXH / săn JP. */
#tab-account { --lg-accent: var(--mint); }
.lg-hero {
    position: relative; isolation: isolate; overflow: hidden; align-items: center; gap: 20px;
    padding: 26px 28px; border: 1px solid color-mix(in oklab, var(--mint) 30%, var(--line));
    border-radius: var(--r-xl); box-shadow: var(--shadow);
    background: radial-gradient(ellipse at 100% 0%, color-mix(in oklab, var(--sky) 22%, transparent), transparent 60%),
        linear-gradient(115deg, color-mix(in oklab, var(--mint) 12%, var(--surface)), var(--surface));
}
.lg-hero .eyebrow { color: var(--lg-accent); }
.lg-hero h1 { margin-top: 4px; }
.lg-hero-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.lg-hero-tags span, .lg-section-tag {
    padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 650;
    color: var(--text); background: color-mix(in oklab, var(--mint) 12%, var(--surface));
    border: 1px solid color-mix(in oklab, var(--mint) 22%, var(--line));
}
.lg-hero-tags span:nth-child(2) { background: color-mix(in oklab, var(--sky) 14%, var(--surface)); }
.lg-hero-tags span:nth-child(3) { background: color-mix(in oklab, var(--peach) 14%, var(--surface)); }
.lg-emblem {
    flex: none; display: grid; place-items: center; width: 88px; height: 94px; margin: 0 12px;
    border-radius: 24px; color: var(--mint); transform: perspective(420px) rotateY(-16deg) rotateZ(8deg);
    background: linear-gradient(145deg, color-mix(in oklab, var(--mint) 28%, var(--surface)), var(--surface));
    border: 1px solid color-mix(in oklab, var(--mint) 48%, var(--line));
    box-shadow: 5px 6px 0 color-mix(in oklab, var(--mint) 18%, var(--surface)), 12px 18px 28px -14px #0008, inset 0 1px 0 #fff3;
}
#tab-account #login-panel {
    border-color: color-mix(in oklab, var(--mint) 32%, var(--line));
    background: linear-gradient(155deg, color-mix(in oklab, var(--mint) 7%, var(--surface)), var(--surface) 45%);
    box-shadow: inset 0 3px 0 color-mix(in oklab, var(--mint) 65%, var(--surface)), var(--shadow);
}
#tab-account .lg-accounts-card {
    border-color: color-mix(in oklab, var(--sky) 25%, var(--line));
    background: radial-gradient(ellipse at 100% 0%, color-mix(in oklab, var(--sky) 8%, transparent), transparent 55%), var(--surface);
    box-shadow: inset 0 3px 0 color-mix(in oklab, var(--sky) 65%, var(--surface)), var(--shadow);
}
#tab-account .lg-seg { padding: 4px; border-radius: 16px; gap: 4px; background: var(--surface-2); }
#login-kind-seg, #ov-login-mode-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; background: transparent; border: 0; }
#login-kind-seg button, #ov-login-mode-seg button {
    --method-color: var(--mint); position: relative; display: flex; flex-direction: column;
    align-items: flex-start; justify-content: flex-start; gap: 10px; min-width: 0;
    padding: 14px 12px; border-radius: 16px; text-align: left; white-space: normal;
    color: var(--muted); border: 1px solid var(--line-2); background: var(--surface-2);
    transition: border-color .18s, background .18s, box-shadow .18s;
}
#login-kind-seg button[data-kind="sso-key-login"], #ov-login-mode-seg button[data-ov-mode="sso"] { --method-color: var(--sky); }
#login-kind-seg button.on, #ov-login-mode-seg button.on {
    color: var(--text); border-color: var(--method-color);
    background: linear-gradient(145deg, color-mix(in oklab, var(--method-color) 19%, var(--surface)), var(--surface));
    box-shadow: inset 0 1px 0 #fff2, 0 3px 0 color-mix(in oklab, var(--method-color) 35%, var(--surface)), 0 8px 16px -12px #0008;
}
#login-kind-seg button:hover, #ov-login-mode-seg button:hover { border-color: var(--method-color); }
#login-kind-seg button:focus-visible, #ov-login-mode-seg button:focus-visible { outline: 2px solid var(--method-color); outline-offset: 3px; }
.lg-method-icon { display: block; flex: 0 0 30px; width: 30px; height: 30px; max-width: 30px; max-height: 30px; padding: 5px; border-radius: 9px; color: var(--method-color); background: color-mix(in oklab, var(--method-color) 14%, var(--surface)); }
.lg-method-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; line-height: 1.5; }
.lg-method-name .lg-tag { font-size: 9px; padding: 1px 6px; }
.lg-extension-link { display: inline-flex; align-items: center; min-height: 32px; padding: 3px 10px; border: 1px solid color-mix(in oklab, var(--sky) 45%, var(--line)); border-radius: 9px; color: var(--text) !important; background: color-mix(in oklab, var(--sky) 12%, var(--surface)); font-weight: 700; text-decoration: none !important; }
.lg-extension-link:hover { background: color-mix(in oklab, var(--sky) 23%, var(--surface)); }
.lg-extension-link:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
#tab-account .btn-primary { background: var(--mint); color: var(--ink); box-shadow: 0 3px 0 color-mix(in oklab, var(--mint) 55%, var(--ink)); }
#tab-account .form-control:focus { border-color: var(--mint); box-shadow: 0 0 0 3px color-mix(in oklab, var(--mint) 12%, transparent); }
#tab-account .acc { transition: transform .18s ease, box-shadow .18s ease; }
#tab-account .acc.active { border-color: var(--mint); background: linear-gradient(120deg, color-mix(in oklab, var(--mint) 13%, var(--surface)), var(--surface)); box-shadow: inset 3px 0 0 var(--mint), 0 6px 14px -10px #0008; }
#tab-account .acc.active .radio { border-color: var(--mint); }
#tab-account .acc .avatar { background: color-mix(in oklab, var(--sky) 22%, var(--surface)); color: var(--text); border-color: color-mix(in oklab, var(--sky) 35%, var(--line)); box-shadow: inset 0 2px 0 #fff2, 0 3px 0 #0002; }
#tab-account .acc.active .avatar { background: var(--mint); color: var(--ink); }
.pc-login-seg .lg-tag { color: inherit; background: color-mix(in oklab, currentColor 14%, transparent); font-size: 10px; white-space: nowrap; }
:root[data-garena="guest"] .player-card {
    color: var(--text); border-color: color-mix(in oklab, var(--mint) 32%, var(--line));
    background: linear-gradient(155deg, color-mix(in oklab, var(--mint) 7%, var(--surface)), var(--surface) 45%);
    box-shadow: inset 0 3px 0 color-mix(in oklab, var(--mint) 65%, var(--surface)), var(--shadow);
}
#ov-guest-login { gap: 18px; min-width: 0; }
#ov-guest-login .pc-login-form { gap: 0; min-width: 0; }
#ov-guest-login .form-control { width: 100%; min-width: 0; }
#ov-guest-login .form-control:focus { border-color: var(--mint); box-shadow: 0 0 0 3px color-mix(in oklab, var(--mint) 12%, transparent); }
#ov-guest-login .btn-primary { background: var(--mint); color: var(--ink); white-space: normal; box-shadow: 0 3px 0 color-mix(in oklab, var(--mint) 55%, var(--ink)); }
#ov-guest-login .check, #ov-guest-login .lg-steps { color: var(--muted); }
#ov-guest-login code { color: var(--text); background: var(--surface-2); border-color: var(--line-2); }
#ov-guest-login .pc-login-msg { color: var(--text); }
#ov-guest-login .pc-login-msg.err { color: var(--bad); }
:root[data-theme="light"] #ov-guest-login { --mint: #2c896b; --sky: #347fb1; }
:root[data-theme="light"] #ov-guest-login .btn-primary { color: #fff; }
:root[data-theme="light"] #tab-account { --mint: #2c896b; --sky: #347fb1; }
:root[data-theme="light"] #tab-account .btn-primary, :root[data-theme="light"] #tab-account .acc.active .avatar { color: #fff; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    #tab-account .acc:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -12px #0009; }
}
@media (max-width: 600px) {
    .lg-hero { padding: 20px; gap: 10px; }
    .lg-emblem { width: 54px; height: 62px; border-radius: 16px; margin: 0 4px; }
    .lg-emblem svg { width: 30px; height: 30px; }
    .lg-hero-tags { gap: 5px; }
    .lg-hero-tags span { font-size: 10px; padding: 4px 7px; }
}
@media (prefers-reduced-motion: reduce) { #tab-account .acc, #login-kind-seg button, #ov-login-mode-seg button { transition: none; } }
