/* DCCK web theme: registration page (body.reg), admin login (body.auth) and admin panel (body.adm).
   Dark ink night + gold / crimson accents taken from the client's login screen. Mobile first; no web fonts
   (system serif/sans with Vietnamese glyphs); served as one static file so the CSP can stay style-src 'self'. */
:root {
  --ink-0: #0b0807; --ink-1: #141010; --ink-2: #1d1715; --ink-3: #2a211d;
  --line: rgba(217, 178, 107, .18); --line-2: rgba(217, 178, 107, .32);
  --gold: #d9b26b; --gold-hi: #f2d594; --crimson: #9e1f27; --crimson-hi: #d43c45; --jade: #4fb38a;
  --text: #f3eadb; --text-2: #c9b89c; --text-3: #a3927a;
  --radius: 12px; --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, Consolas, "Cascadia Mono", Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--sans); color: var(--text); background: var(--ink-0); }
a { color: var(--gold-hi); text-underline-offset: 3px; }
a:hover { color: #fff3cf; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.25; }

/* ---------- shared controls ---------- */
input, select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; font: inherit; font-size: 16px; color: var(--text);
  background: rgba(0, 0, 0, .38); border: 1px solid #4a3b30; border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: var(--text-3); }
input:hover { border-color: #6a5541; }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 178, 107, .22); background: rgba(0, 0, 0, .5); }
input:user-invalid { border-color: var(--crimson-hi); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  font: 600 15px/1 var(--sans); color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 10px;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { border-color: var(--gold); color: #fff3cf; }
.btn:active { transform: translateY(1px); }
.btn-primary { /* the client's "Vào game" button: deep crimson, gold rim */
  color: #fff4e2; background: linear-gradient(180deg, #b52a33, #7c161d); border-color: #c89a4e;
  box-shadow: inset 0 1px 0 rgba(255, 214, 150, .35), 0 6px 18px rgba(158, 31, 39, .35); text-shadow: 0 1px 1px rgba(0, 0, 0, .4);
}
.btn-primary:hover { background: linear-gradient(180deg, #cc3640, #8f1c24); border-color: var(--gold-hi); }
.btn-ghost { background: transparent; color: var(--gold-hi); }
.btn-ghost:hover { background: rgba(217, 178, 107, .1); }
.btn-danger { background: rgba(212, 60, 69, .08); color: #ff9a9a; border-color: rgba(255, 107, 107, .45); }
.btn-danger:hover { background: #a3222b; color: #fff; border-color: #ff7b7b; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.alert { margin: 0 0 18px; padding: 12px 14px 12px 16px; border-radius: 10px; border-left: 3px solid; font-size: 14.5px; }
.alert-err { background: rgba(212, 60, 69, .14); border-color: var(--crimson-hi); color: #ffd9d6; }
.alert-ok { background: rgba(79, 179, 138, .14); border-color: var(--jade); color: #d6f5e6; }
.eyebrow { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.beta-tag { display: inline-block; margin-right: 8px; padding: 2px 9px; border-radius: 999px; letter-spacing: .08em;
  color: #fff; background: linear-gradient(180deg, var(--crimson-hi), var(--crimson)); }
.card-title { margin: 0 0 4px; font-size: 26px; color: var(--gold-hi); }
.req { color: var(--crimson-hi); }
.opt, .muted { color: var(--text-3); font-weight: 400; }

/* ---------- registration page + admin login ---------- */
body.reg, body.auth {
  min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(11, 8, 7, .1), rgba(11, 8, 7, .88) 80%),
    linear-gradient(180deg, rgba(11, 8, 7, .45), rgba(11, 8, 7, .7) 60%, rgba(11, 8, 7, .92)),
    url(bg-login-art.jpg) center 30% / cover no-repeat var(--ink-0);
}
.reg-shell { flex: 1; width: 100%; max-width: 1140px; margin: 0 auto; padding: 24px 18px 8px; display: grid; gap: 24px; align-content: center; }
.reg-hero { text-align: center; }
.reg-logo { width: 230px; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .7)); }
.reg-title { margin: 6px 0 8px; font-size: 30px;
  background: linear-gradient(180deg, #fff1cc, var(--gold) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reg-lead { margin: 0 auto; max-width: 34em; color: var(--text-2); }
.steps { display: none; }
.reg-card, .auth-card {
  position: relative; width: 100%; max-width: 460px; margin: 0 auto; padding: 26px 22px;
  background: linear-gradient(180deg, rgba(29, 23, 21, .9), rgba(16, 12, 11, .92)); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.reg-card::before, .auth-card::before { /* gold rim on top, like the client's window frames */
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.card-sub { margin: 0 0 18px; color: var(--text-3); font-size: 13.5px; }
.reg-form .field, .auth-form .field { margin-bottom: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: 14px; font-weight: 600; color: var(--text); }
.hint { margin: 0; font-size: 13px; color: var(--text-3); }
.pw { position: relative; display: block; }
.pw input { padding-right: 78px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); min-width: 62px; height: 36px; padding: 0 10px;
  font: 600 13px var(--sans); color: var(--gold-hi); background: rgba(217, 178, 107, .08); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer;
}
.pw-toggle:hover { background: rgba(217, 178, 107, .18); }
.reg-form .btn-block, .auth-form .btn-block { margin-top: 6px; min-height: 50px; font-size: 16px; letter-spacing: .02em; }
.reg-foot { padding: 18px; text-align: center; font-size: 12.5px; color: var(--text-3); }
.done { text-align: center; }
.done-emblem { /* ink emblem on a parchment seal */
  width: 132px; height: 132px; margin: 0 auto 10px; padding: 8px; border-radius: 50%;
  background: radial-gradient(circle, #f4ead2 0, #e8d8b4 58%, rgba(232, 216, 180, 0) 72%);
}
.done .ok { margin: 6px 0 16px; color: var(--text-2); }
.acct { color: var(--gold-hi); font-size: 18px; }
.next { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: n; text-align: left; }
.next li { position: relative; padding: 10px 0 10px 44px; border-top: 1px solid rgba(255, 255, 255, .06); color: var(--text-2); }
.next li::before {
  counter-increment: n; content: counter(n); position: absolute; left: 0; top: 9px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 700 14px var(--serif); color: var(--gold-hi); border: 1px solid var(--gold);
}
.next .btn { margin-top: -4px; }
.auth-card { margin: auto; text-align: left; }
.auth-logo { display: block; width: 190px; margin: -8px auto 6px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .7)); }
body.auth .eyebrow, body.auth .card-title { text-align: center; }
body.auth .card-title { margin-bottom: 18px; }
body.auth { padding: 20px 16px 0; }

@media (min-width: 960px) {
  .reg-shell { grid-template-columns: 1fr 440px; gap: 64px; align-items: center; padding: 48px 32px 16px; }
  .reg-hero { text-align: left; }
  .reg-logo { width: 330px; margin-left: -12px; }
  .reg-title { font-size: 44px; }
  .reg-lead { margin: 0; font-size: 17px; }
  .reg-card { padding: 34px 32px; margin: 0; }
  .steps { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; counter-reset: s; max-width: 30em; }
  .steps li { position: relative; padding: 2px 0 2px 56px; min-height: 42px; }
  .steps li::before {
    counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; font: 700 17px var(--serif); color: var(--gold-hi);
    background: rgba(11, 8, 7, .6); border: 1px solid var(--gold); box-shadow: 0 0 0 4px rgba(217, 178, 107, .08);
  }
  .steps b { display: block; font-family: var(--serif); font-size: 17px; color: var(--text); }
  .steps span { font-size: 14px; color: var(--text-2); }
}

/* ---------- admin panel ---------- */
body.adm {
  background: radial-gradient(60% 50% at 0 0, rgba(217, 178, 107, .07), transparent 70%),
              radial-gradient(50% 40% at 100% 100%, rgba(158, 31, 39, .1), transparent 70%) fixed, var(--ink-0);
}
.side { background: rgba(20, 16, 16, .96); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--text); }
.brand img { width: 40px; height: 40px; padding: 3px; border-radius: 50%; background: radial-gradient(circle, #f4ead2 40%, #d9c69c); }
.brand b { display: block; font: 700 16px var(--serif); color: var(--gold-hi); }
.brand small { display: block; font-size: 12px; color: var(--text-3); }
.nav { display: flex; gap: 4px; padding: 0 10px 10px; overflow-x: auto; scrollbar-width: thin; }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 10px; white-space: nowrap;
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--ink-2); color: var(--text); }
.nav-link.is-active { color: var(--gold-hi); background: linear-gradient(90deg, rgba(217, 178, 107, .18), rgba(217, 178, 107, .04)); box-shadow: inset 0 -2px 0 var(--gold); }
.ico { flex: none; }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; font: 700 12px/18px var(--sans); text-align: center;
  font-style: normal; color: #fff; background: #3d7bdc; box-shadow: 0 0 0 3px rgba(61, 123, 220, .2); }
.main { min-width: 0; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.page-title { margin: 0; font-size: 22px; color: var(--gold-hi); word-break: break-word; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--serif); color: #fff4e2;
  background: linear-gradient(160deg, var(--crimson-hi), var(--crimson)); border: 1px solid #c89a4e; }
.who { display: grid; line-height: 1.25; font-size: 14px; }
.role { font-size: 12px; color: var(--text-3); }
.role-admin { color: var(--gold); }
.role-gm { color: #8fc7ff; }
.content { padding: 18px; max-width: 1320px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; display: grid; gap: 2px; padding: 16px 18px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1)); border: 1px solid var(--line); }
.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--tone, var(--gold)); }
.stat-gold { --tone: var(--gold); } .stat-jade { --tone: var(--jade); } .stat-blue { --tone: #4f8fe8; } .stat-crimson { --tone: var(--crimson-hi); }
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.stat-value { font: 700 30px/1.15 var(--serif); color: var(--text); font-variant-numeric: tabular-nums; }
.stat-jade .stat-value { color: #8fe0bb; }
.stat-sub { font-size: 13px; color: var(--text-2); }
.stat-link { text-decoration: none; color: inherit; border-radius: 14px; }
.stat-link .stat { transition: transform .15s, border-color .15s; height: 100%; }
.stat-link:hover .stat { transform: translateY(-2px); border-color: var(--line-2); }

.panel { margin: 0 0 16px; padding: 18px; border-radius: 14px; background: rgba(20, 16, 16, .92); border: 1px solid var(--line); min-width: 0; }
.panel-title { margin: 0 0 12px; font-size: 16px; color: var(--gold-hi); }
.panel .table-wrap { margin: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 18px; color: var(--text); }
.section-title::before { content: ""; width: 18px; height: 2px; background: var(--gold); }
.grid-2, .grid-3 { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-2 > .panel, .grid-3 > .panel, .grid-2 > div > .panel:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(20, 16, 16, .92); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); background: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; vertical-align: top; border-top: 1px solid rgba(255, 255, 255, .05); overflow-wrap: break-word; }
.tbl tbody tr:nth-child(even) { background: rgba(255, 255, 255, .025); }
.tbl tbody tr:hover { background: rgba(217, 178, 107, .06); }
.tbl td a { font-weight: 600; }
.tbl .empty { padding: 22px; text-align: center; color: var(--text-3); }
.tbl .form-inline { margin: 0; }
.tbl .btn { min-height: 34px; padding: 0 12px; font-size: 13px; }

.kv { margin: 0; display: grid; }
.kv div { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(217, 178, 107, .12); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--text-3); font-size: 13.5px; }
.kv dd { margin: 0; word-break: break-word; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; border: 1px solid; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-blue { color: #8fbaff; background: rgba(79, 143, 232, .14); border-color: rgba(79, 143, 232, .4); }
.pill-amber { color: #f5c46a; background: rgba(240, 180, 76, .13); border-color: rgba(240, 180, 76, .4); }
.pill-green { color: #7ddcaa; background: rgba(79, 179, 138, .14); border-color: rgba(79, 179, 138, .4); }
.pill-grey { color: #b9ae9f; background: rgba(163, 154, 140, .12); border-color: rgba(163, 154, 140, .35); }
.pill-red { color: #ff9a9a; background: rgba(212, 60, 69, .14); border-color: rgba(212, 60, 69, .45); }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; color: var(--text-2); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--gold-hi); border-color: var(--gold); }

.form { display: grid; gap: 12px; }
.form .btn { justify-self: start; }
.form-inline { display: inline-block; margin: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.panel .btn-row + .form, .panel .form + .btn-row { margin-top: 10px; }
.search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 18px; }
.search .field { flex: 1 1 260px; }
.pre { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.shot { display: block; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.mono { font-family: var(--mono); }

@media (max-width: 899px) {
  .tbl { min-width: 760px; } .panel .tbl { min-width: 0; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; } .tab { white-space: nowrap; }
}
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh;
    background: linear-gradient(90deg, rgba(20, 16, 16, .96) 251px, var(--line) 251px, var(--line) 252px, transparent 252px); }
  .side { background: transparent; }
  .side { position: sticky; top: 0; height: 100vh; border-bottom: 0; }
  .brand { padding: 22px 20px 18px; }
  .nav { flex-direction: column; padding: 8px 12px; overflow: visible; }
  .nav-link.is-active { box-shadow: inset 3px 0 0 var(--gold); }
  .topbar { padding: 20px 28px; }
  .page-title { font-size: 26px; }
  .content { padding: 24px 28px 40px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .form .field { max-width: 560px; }
}
@media (min-width: 1200px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* ---------- admin charts (server-rendered SVG, admin_svg.py) and compact row controls ---------- */
.chart { margin: 0 0 16px; padding: 14px 16px 10px; border-radius: 14px; background: rgba(20, 16, 16, .92); border: 1px solid var(--line); min-width: 0; }
.chart figcaption { margin: 0 0 6px; font: 700 15px var(--serif); color: var(--gold-hi); }
.chart svg { display: block; width: 100%; height: auto; }
.chart-grid { stroke: rgba(217, 178, 107, .14); stroke-width: 1; }
.chart-tick { fill: var(--text-3); font: 13px var(--sans); }
.chart-label { fill: var(--text-2); font: 13px var(--sans); }
.chart-empty { fill: var(--text-3); font: 14px var(--sans); }
.chart-bar { fill: var(--gold); opacity: .88; }
.chart-bar:hover { opacity: 1; fill: var(--gold-hi); }
.chart-line { stroke: var(--jade); stroke-width: 2.2; stroke-linejoin: round; }
.chart-area { fill: rgba(79, 179, 138, .16); }
.grid-2 > .chart { margin-bottom: 0; }
.tbl select { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13px; margin-right: 6px; }
.tbl .form-inline { display: inline-flex; align-items: center; }
.pager { align-items: center; margin: 0 0 16px; }

/* ---------- players list and player detail (admin_players_list_pages.py, admin_players_pages.py) ---------- */
.filters .field-wide { flex: 2 1 320px; } .filters .field-sm { flex: 0 1 170px; } .filters .field-xs { flex: 0 1 100px; }
.filters select { min-height: 46px; padding: 10px 12px; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.cell-sub { display: block; font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th .sort { color: inherit; text-decoration: none; } .tbl th .sort:hover { color: var(--gold-hi); }
.tbl th[aria-sort], .tbl th[aria-sort] .sort { color: var(--gold-hi); }
.pager .btn-primary { cursor: default; }
.tbl-list td { white-space: nowrap; } .tbl-list .btn-row { flex-wrap: nowrap; }
@media (min-width: 900px) { .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hero { padding: 20px 22px; } .hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.hero-name { font: 700 24px var(--serif); color: var(--gold-hi); word-break: break-all; } .hero .tags { margin: 0; }
.hero .kv { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 28px; }
.detail { display: grid; gap: 18px; align-items: start; } .detail-main, .detail-actions { min-width: 0; }
.detail-actions .section-title { margin-top: 0; }
.char-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 16px; }
.char-card { margin: 0; } .char-name { margin: 0 0 6px; font-size: 18px; color: var(--gold-hi); word-break: break-word; }
.char-card .kv div { grid-template-columns: minmax(90px, 42%) 1fr; padding: 5px 0; }
.char-card .btn-row { margin-top: 10px; }
@media (min-width: 1200px) { .detail { grid-template-columns: minmax(0, 1fr) 340px; } }
