/* Krypton panel */

:root {
  --bg: #0e0f11;
  --panel: #151619;
  --panel-2: #1b1c20;
  --panel-3: #232429;
  --border: #2a2b30;
  --border-soft: #202125;
  --text: #e6e7e9;
  --text-2: #a3a5ac;
  --text-3: #6d7078;
  --accent: #7d6ff0;
  --accent-hover: #8e82f3;
  --accent-bg: rgba(125, 111, 240, 0.14);
  --high: #ef5f6b;
  --med: #eea63a;
  --low: #3db487;
  --high-bg: rgba(239, 95, 107, 0.13);
  --med-bg: rgba(238, 166, 58, 0.13);
  --low-bg: rgba(61, 180, 135, 0.13);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
  --radius: 8px;
  --sidebar: 220px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* Scrollbars hidden everywhere; content still scrolls. */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nowrap { white-space: nowrap; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 12px;
  border-right: 1px solid var(--border-soft);
  background: var(--bg);
}
.main-col { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 24px clamp(16px, 3vw, 36px) 32px; }
.site-footer { padding: 14px clamp(16px, 3vw, 36px) 20px; border-top: 1px solid var(--border-soft); color: var(--text-3); font-size: 12px; }
.site-footer-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer p { margin: 4px 0 0; max-width: 760px; }
.page { max-width: 1280px; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand img { width: 30px; height: 30px; border-radius: 6px; }
.brand b { font-size: 15px; font-weight: 600; }

/* Game picker: one line, truncated with an ellipsis; a transparent select sits on top. */
.game-select { position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.game-select:hover { border-color: var(--text-3); }
.game-select .name { flex: 1; min-width: 0; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-select .name small { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); }
.game-select svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.game-select select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.game-select:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label { margin: 10px 10px 4px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px; color: var(--text-2); font-weight: 500;
}
.nav a svg { width: 16px; height: 16px; flex: none; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--panel-3); color: var(--text); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: var(--high-bg); color: var(--high); }

.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--border-soft); }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who span { font-size: 12px; color: var(--text-3); text-transform: capitalize; }

.staff-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px clamp(16px, 3vw, 36px); background: var(--accent-bg); font-size: 13px; }
.staff-bar a { text-decoration: underline; }
.update-bar { display: flex; align-items: flex-start; gap: 12px; padding: 8px clamp(16px, 3vw, 36px); background: var(--med-bg); color: var(--med); font-size: 13px; }
.update-bar > div { flex: 1; min-width: 0; }
.update-bar p { margin: 2px 0; }
.update-bar a { color: inherit; text-decoration: underline; }
.update-bar .icon-btn { flex: none; height: 26px; width: 26px; color: inherit; }
.mobile-bar { display: none; }

/* ---- page header ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }
.subtitle { margin: 4px 0 0; color: var(--text-2); }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; margin-bottom: 10px; }
.crumb svg { width: 14px; height: 14px; }
.crumb:hover { color: var(--text); }

/* ---- primitives ---- */
.card { display: block; background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title { margin: 0; font-size: 14px; font-weight: 600; }
.card-link { font-size: 13px; color: var(--text-3); }
.card-link:hover { color: var(--text); }
a.card:hover { border-color: var(--border); }

.grid { display: grid; gap: 14px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-weight: 500; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--panel-3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--high); }
.btn-danger:hover { background: var(--high-bg); }
.btn-danger-solid { background: var(--high); border-color: var(--high); color: #fff; }
.btn-danger-solid:hover { background: #f27580; border-color: #f27580; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.icon-btn { width: 32px; padding: 0; }
.btn-sm.icon-btn { width: 26px; }

.seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 4px; color: var(--text-2); font-weight: 500; font-size: 12px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--panel-3); color: var(--text); }
.seg.sev button[aria-pressed='true'][data-v='High'] { color: var(--high); background: var(--high-bg); }
.seg.sev button[aria-pressed='true'][data-v='Medium'] { color: var(--med); background: var(--med-bg); }
.seg.sev button[aria-pressed='true'][data-v='Low'] { color: var(--low); background: var(--low-bg); }

.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
.select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.6; }
.input[aria-invalid='true'] { border-color: var(--high); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 32px; }

.field { display: grid; gap: 5px; align-content: start; }
.label { font-weight: 500; font-size: 13px; }
.hint { font-size: 12px; color: var(--text-3); }
.unit { position: relative; }
.unit .input { padding-right: 56px; }
.unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); pointer-events: none; }

.toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--border); }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-3); transition: transform 0.15s; }
.toggle input:checked + i { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + i::after { transform: translateX(16px); background: #fff; }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle input:disabled { cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 4px;
  font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--panel-3); color: var(--text-2);
}
.badge.sev-High { background: var(--high-bg); color: var(--high); }
.badge.sev-Medium { background: var(--med-bg); color: var(--med); }
.badge.sev-Low { background: var(--low-bg); color: var(--low); }
.badge.accent { background: var(--accent-bg); color: var(--accent-hover); }
.badge.outline { background: transparent; border: 1px solid var(--border); }
.badge.warn { background: var(--med-bg); color: var(--med); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.live { background: var(--low); }
.dot.High { background: var(--high); } .dot.Medium { background: var(--med); } .dot.Low { background: var(--low); }

.status { text-transform: capitalize; }
.status-watch { background: var(--med-bg); color: var(--med); }
.status-confirmed { background: var(--high-bg); color: var(--high); }
.status-cleared { background: var(--low-bg); color: var(--low); }
.review-open { background: var(--accent-bg); color: var(--accent-hover); }
.review-confirmed { background: var(--high-bg); color: var(--high); text-transform: capitalize; }
.review-dismissed { background: var(--panel-3); color: var(--text-3); text-transform: capitalize; }

.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 6px; overflow: hidden;
  background: var(--panel-3); display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--text-2);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; border-radius: 10px; font-size: 22px; }
.avatar.md { width: 36px; height: 36px; border-radius: 6px; }
.avatar.sm { width: 20px; height: 20px; border-radius: 4px; font-size: 9px; }

.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell .names { min-width: 0; }
.who-cell b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-cell small { display: block; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.who-cell:hover b { text-decoration: underline; }

.empty { padding: 32px 16px; text-align: center; color: var(--text-3); }
.empty b { display: block; color: var(--text-2); font-weight: 500; margin-bottom: 4px; }
.empty code { font-family: var(--mono); color: var(--text-2); }
.skeleton { background: var(--panel-2); border-radius: 6px; }

hr.sep { border: 0; border-top: 1px solid var(--border-soft); margin: 16px 0; }

/* ---- stats ---- */
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { margin-top: 6px; font-size: 26px; font-weight: 600; line-height: 1.1; }
.stat-value small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.stat-foot { margin-top: 6px; font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-size: 12px; font-weight: 500; }
.delta.up-bad { color: var(--high); }
.delta.down-good { color: var(--low); }
.delta.flat { color: var(--text-3); }

.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--text); font-weight: 600; }

/* ---- charts ---- */
.bars { position: relative; height: 220px; }
.bars svg { width: 100%; height: 100%; display: block; overflow: visible; }
.timeline { position: relative; height: 56px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border-soft); overflow: hidden; }
.timeline.tall { height: 96px; }
.timeline svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--text-3); pointer-events: none; }
.axis { position: relative; height: 20px; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; line-height: 20px; }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none; padding: 8px 10px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  font-size: 12px; min-width: 130px; transform: translate(-50%, calc(-100% - 10px));
}
.tooltip .t { color: var(--text-3); margin-bottom: 4px; }
.tooltip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .r span { display: flex; align-items: center; gap: 6px; color: var(--text-2); }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; font-size: 13px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .name a:hover { color: var(--text); text-decoration: underline; }
.hbar .v { font-weight: 500; }
.hbar .track { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: inherit; background: var(--accent); }

/* ---- tables & lists ---- */
.table-wrap { overflow-x: auto; margin: 0 -18px -16px; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th { text-align: left; padding: 8px 12px; font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--panel-2); }
.table tbody tr.selected { background: var(--accent-bg); }
.table tr:last-child td { border-bottom: 0; }
.table .msg { max-width: 420px; }
.table .msg b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .msg small { display: block; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table input[type='checkbox'] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.list { display: flex; flex-direction: column; }
.list-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.list-item:last-child { border-bottom: 0; }
.activity .list-item { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
.activity .list-item time { padding-top: 2px; }
.list-item .body { min-width: 0; }
.list-item .body b { font-weight: 500; }
.list-item .body p { margin: 1px 0 0; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
a.list-item:hover .body b { text-decoration: underline; }
.list-item .n { font-size: 16px; font-weight: 600; text-align: right; }
.list-item .n small { display: block; font-size: 11px; font-weight: 400; color: var(--high); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .search { flex: 1 1 240px; max-width: 340px; }
.filters .select { width: auto; min-width: 150px; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); }
.load-more { display: flex; justify-content: center; padding: 14px 0 2px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-soft); margin: -4px 0 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 12px; color: var(--text-3); font-weight: 500; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---- drawer / modal / toast ---- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); }
.drawer {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(540px, 100vw);
  background: var(--panel); border-left: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column;
}
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); background: var(--panel); }
.drawer-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.drawer-foot { position: sticky; bottom: 0; margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border-soft); background: var(--panel); }
.modal {
  position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(500px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal-head { padding: 16px 18px 0; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-body { padding: 14px 18px; display: grid; gap: 12px; }
.modal-foot { padding: 0 18px 16px; display: flex; justify-content: flex-end; gap: 8px; }

.toasts { position: fixed; z-index: 90; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; min-width: 220px; max-width: 380px; background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.toast .dot { background: var(--low); }
.toast.error .dot { background: var(--high); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.code { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border-soft); font: 12px/1.6 var(--mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.detail-title { margin: 0; font-size: 18px; font-weight: 600; }
.section-label { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }

/* ---- player profile ---- */
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.profile-head .handle { margin-top: 2px; color: var(--text-2); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.profile-head .badges { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--border); font-size: 12px; }
a.chip:hover { border-color: var(--text-3); }
.bio { margin: 0; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }

/* ---- servers ---- */
.server { display: flex; flex-direction: column; gap: 12px; }
.server.closed { opacity: 0.6; }
.meter { height: 4px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* ---- settings ---- */
.rules-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.rules-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 1px; }
.rules-nav a { padding: 6px 10px; border-radius: 6px; color: var(--text-2); font-size: 13px; }
.rules-nav a:hover { color: var(--text); background: var(--panel-2); }
.rule-section { scroll-margin-top: 16px; }
.rule-section > header { margin-bottom: 14px; }
.rule-section h2 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.rule-section > header p { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.rule-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.rule-line:first-of-type { border-top: 0; padding-top: 0; }
.rule-line .txt { min-width: 0; }
.rule-line .txt b { display: block; font-weight: 500; }
.rule-line .txt span { font-size: 12px; color: var(--text-3); }
.notice { padding: 8px 10px; border-radius: 6px; background: var(--med-bg); color: var(--med); font-size: 13px; margin-bottom: 14px; }
.notice.widespread p { margin: 0 0 8px; }
.notice.widespread ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.notice.widespread li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.notice.widespread li .actions { display: flex; gap: 6px; flex-shrink: 0; }

.kw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 12px; }
.kw-row { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border-soft); }
.kw-row .k { flex: 1; min-width: 0; font: 12.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-row .seg button { padding: 2px 7px; font-size: 11px; }
.kw-add { display: flex; gap: 8px; margin-top: 10px; max-width: 520px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 9px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); font: 12.5px var(--mono); }
.tag button { border: 0; background: none; color: var(--text-3); cursor: pointer; width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; }
.tag button:hover { background: var(--high-bg); color: var(--high); }
.tag button svg { width: 11px; height: 11px; }
.x-btn { border: 0; background: none; color: var(--text-3); cursor: pointer; width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; flex: none; }
.x-btn:hover { background: var(--high-bg); color: var(--high); }
.x-btn svg { width: 12px; height: 12px; }

.save-bar {
  position: sticky; bottom: 12px; z-index: 20; margin-top: 16px;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.save-bar .input { max-width: 280px; height: 32px; }
.key-box { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); font: 13px var(--mono); overflow-wrap: anywhere; }

.history { display: flex; flex-direction: column; }
.history-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.history-item:last-child { border-bottom: 0; }
.history-item .v { font: 500 13px var(--mono); color: var(--text-2); }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 24px 0 0; }
.login .site-footer { width: 100%; }
.login-box { width: 100%; max-width: 340px; }
.login-box .logo { width: 96px; height: 96px; border-radius: 14px; margin: 0 auto 16px; }
.login-box h1 { margin: 0 0 20px; font-size: 20px; font-weight: 600; text-align: center; }
.login-box form { display: grid; gap: 14px; }
.form-error { padding: 8px 10px; border-radius: 6px; background: var(--high-bg); color: var(--high); font-size: 13px; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .rules-layout { grid-template-columns: minmax(0, 1fr); }
  .rules-nav { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; left: 0; width: 250px; transform: translateX(-100%); transition: transform 0.2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5); }
  .mobile-bar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border-soft); }
  .mobile-bar img { width: 24px; height: 24px; border-radius: 4px; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .profile-head { grid-template-columns: auto minmax(0, 1fr); }
  .profile-head > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .save-bar { flex-wrap: wrap; }
  .save-bar .input { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; }
}

/* ---- accounts ---- */
.login-alt { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--text-3); }
.login-alt + .login-alt { margin-top: 6px; }
.login-alt a { color: var(--text-2); text-decoration: underline; }
.login-alt a:hover { color: var(--text); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { margin: 2px 0 0; flex: none; }
.check a { color: var(--text); text-decoration: underline; }
.login-text { margin: 0 0 16px; font-size: 13px; color: var(--text-2); text-align: center; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.nav .count.accent { background: var(--accent-bg); color: var(--accent-hover); }

/* Recent activity scrolls inside its card instead of stretching the page. */
.activity-scroll { max-height: 520px; overflow-y: auto; margin-right: -8px; padding-right: 8px; overscroll-behavior: contain; }

.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--border-soft); }
.step:first-child { border-top: 0; padding-top: 4px; }
.step:last-child { padding-bottom: 0; }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--panel-3); color: var(--text-2); }
.step.done .step-n { background: var(--low-bg); color: var(--low); }
.step h3 { margin: 2px 0 4px; font-size: 14px; font-weight: 600; }
.step p { margin: 0 0 10px; color: var(--text-2); font-size: 13px; }
.step .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.verify-code { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 4px 0 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); font: 13px var(--mono); overflow-wrap: anywhere; }
.verify-code span { flex: 1; }
.slot-meter { display: flex; gap: 4px; margin-top: 8px; }
.slot-meter i { width: 22px; height: 6px; border-radius: 99px; background: var(--panel-3); }
.slot-meter i.used { background: var(--accent); }
.game-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.game-row:last-child { border-bottom: 0; }
.game-row b { font-weight: 500; }
.game-row small { display: block; color: var(--text-3); font-size: 12px; }
.game-row .row { justify-content: flex-end; }
