/* ==========================================================================
   TradeX369 — base design system
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('2b764d8a8279dcc686f8.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Orbitron';
  src: url('adb7b8a00a949042b477.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('520cfb62269583a8ccba.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --primary: #dcae18;
  --primary-bright: #f5d259;
  --primary-deep: #956b08;
  --gold-text: #f5d259;
  --primary-ink: #191307;
  --gold-grad: linear-gradient(180deg, #f0cd45 0%, #e0b31f 55%, #d3a414 100%);
  --gold-soft: rgba(220, 174, 24, 0.12);
  --gold-line: rgba(220, 174, 24, 0.3);

  --bg: #050505;
  --bg-deep: #030303;
  --surface: #0c0d0f;
  --surface-2: #111214;
  --surface-3: #17181b;
  --surface-soft: rgba(255, 255, 255, 0.028);
  --input-bg: #0b0c0d;

  --text: #f4f5f6;
  --text-secondary: #b7bbc2;
  --muted: #92979f;
  --dim: #6b7079;

  --line: rgba(220, 174, 24, 0.22);
  --line-strong: rgba(220, 174, 24, 0.40);
  --line-soft: rgba(255, 255, 255, 0.075);
  --line-faint: rgba(255, 255, 255, 0.045);

  --green: #5cdd91;
  --green-soft: rgba(92, 221, 145, 0.12);
  --red: #ff7b7b;
  --red-soft: rgba(255, 123, 123, 0.11);
  --blue: #8bb9ff;
  --blue-soft: rgba(139, 185, 255, 0.11);
  --purple: #c1a5ff;
  --purple-soft: rgba(193, 165, 255, 0.11);
  --orange: #f0a04b;
  --orange-soft: rgba(240, 160, 75, 0.12);
  --cream: #faf6ea;
  --cream-deep: #f2ecdc;
  --ink: #17191d;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 14px 38px rgba(220, 174, 24, 0.18);
  --transition: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
  --max-width: 1200px;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f4f6;
  --bg-deep: #eceef1;
  --surface: #ffffff;
  --surface-2: #f7f8f9;
  --surface-3: #eef0f3;
  --surface-soft: rgba(22, 28, 36, 0.03);
  --input-bg: #ffffff;
  --text: #15191f;
  --text-secondary: #4d5762;
  --muted: #606a75;
  --dim: #7b848e;
  --line: rgba(170, 123, 10, 0.28);
  --line-strong: rgba(170, 123, 10, 0.48);
  --line-soft: rgba(31, 38, 48, 0.12);
  --line-faint: rgba(31, 38, 48, 0.07);
  --gold-soft: rgba(220, 174, 24, 0.13);
  --gold-text: #8a6a08;
  --shadow-lg: 0 24px 60px rgba(24, 31, 40, 0.13);
  --green-soft: rgba(0, 150, 80, 0.09);
  --red-soft: rgba(210, 45, 45, 0.08);
  --blue-soft: rgba(40, 100, 210, 0.08);
  --purple-soft: rgba(100, 65, 200, 0.08);
  --orange-soft: rgba(200, 120, 20, 0.1);
}

/* ------------------------------------------------------------------ reset */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: rgba(220, 174, 24, 0.35) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -18%, rgba(220, 174, 24, 0.16), transparent 37%),
    radial-gradient(circle at 96% 12%, rgba(216, 220, 225, 0.07), transparent 28%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.028em;
}
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: inline-block; max-width: 100%; }
img { height: auto; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }
::selection { background: rgba(245, 210, 89, 0.3); color: var(--text); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(220, 174, 24, 0.3); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(220, 174, 24, 0.55); background-clip: content-box; }

*:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- utilities */
.icon { flex: 0 0 auto; vertical-align: -0.16em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.secondary { color: var(--text-secondary); }
.gold { color: var(--gold-text); }
.green { color: var(--green); }
.red { color: var(--red); }
.blue { color: var(--blue); }
.purple { color: var(--purple); }
.strong { font-weight: 700; }
.small { font-size: 12px; }
.xsmall { font-size: 10.5px; }
.upper { text-transform: uppercase; letter-spacing: 0.12em; }
.lh-15 { line-height: 1.5; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- typography */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gold-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  line-height: 1.4;
}
.eyebrow--muted { color: var(--muted); }
.eyebrow--green { color: var(--green); }
.eyebrow .icon { opacity: 0.8; }

.page-title {
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 500;
  letter-spacing: -0.035em;
}
.section-title {
  font-size: clamp(26px, 2.9vw, 38px);
  font-weight: 500;
  letter-spacing: -0.035em;
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.lead {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.7;
}
.muted-copy {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}
.divider { height: 1px; background: var(--line-soft); border: 0; }

/* ----------------------------------------------------------------- buttons */
.btn {
  --btn-h: 42px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.005em;
  white-space: nowrap;
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
  user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn .icon { margin-top: -1px; }

.btn--primary {
  color: var(--primary-ink);
  background: var(--gold-grad);
  border-color: rgba(255, 229, 137, 0.35);
  box-shadow: 0 8px 24px rgba(220, 174, 24, 0.17), inset 0 1px rgba(255, 255, 255, 0.35);
}
.btn--primary:hover {
  box-shadow: 0 12px 32px rgba(220, 174, 24, 0.28), inset 0 1px rgba(255, 255, 255, 0.4);
}
.btn--ghost {
  color: var(--text);
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}
html[data-theme='light'] .btn--ghost { background: rgba(255, 255, 255, 0.7); }
.btn--ghost:hover {
  color: var(--gold-text);
  border-color: var(--line-strong);
  background: var(--gold-soft);
}
.btn--ghost-gold {
  color: var(--gold-text);
  border-color: var(--line-strong);
  background: rgba(220, 174, 24, 0.08);
}
.btn--ghost-gold:hover { background: rgba(220, 174, 24, 0.15); }
.btn--soft {
  color: var(--text-secondary);
  background: var(--surface-2);
  border-color: var(--line-soft);
}
.btn--soft:hover { color: var(--text); border-color: var(--line); }
.btn--danger {
  color: #ffd4d4;
  background: rgba(180, 40, 40, 0.16);
  border-color: rgba(255, 123, 123, 0.28);
}
.btn--danger:hover { background: rgba(180, 40, 40, 0.26); border-color: rgba(255, 123, 123, 0.5); }
.btn--success {
  color: #081b11;
  background: linear-gradient(135deg, #2fa968, #5cdd91);
  border-color: rgba(150, 255, 195, 0.25);
}
.btn--link {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gold-text);
  font-weight: 600;
  box-shadow: none;
}
.btn--link:hover { transform: none; color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; }
.btn--sm { --btn-h: 34px; padding: 0 13px; font-size: 11.5px; border-radius: 8px; }
.btn--xs { --btn-h: 28px; padding: 0 10px; font-size: 10.5px; border-radius: 7px; }
.btn--lg { --btn-h: 50px; padding: 0 24px; font-size: 14px; border-radius: 11px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--btn-h); padding: 0; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  transition: var(--transition);
}
.icon-btn:hover { color: var(--gold-text); border-color: var(--line); background: var(--gold-soft); }
.icon-btn--sm { width: 30px; height: 30px; border-radius: 7px; }
.icon-btn--plain { border-color: transparent; background: transparent; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 5px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
}
html[data-theme='light'] .theme-toggle { background: #fff; }
.theme-toggle:hover { color: var(--gold-text); border-color: var(--line); }
.theme-toggle__ball,
.theme-toggle .js-theme-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-text);
  background: radial-gradient(circle at 35% 30%, rgba(245, 210, 89, 0.24), rgba(220, 174, 24, 0.05));
  border: 1px solid rgba(220, 174, 24, 0.2);
}
.theme-toggle .js-theme-label { line-height: 1; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}
.badge--gold { color: var(--gold-text); background: var(--gold-soft); border-color: var(--line); }
.badge--green { color: var(--green); background: var(--green-soft); border-color: rgba(92, 221, 145, 0.26); }
.badge--blue { color: var(--blue); background: var(--blue-soft); border-color: rgba(139, 185, 255, 0.26); }
.badge--purple { color: var(--purple); background: var(--purple-soft); border-color: rgba(193, 165, 255, 0.26); }
.badge--red { color: var(--red); background: var(--red-soft); border-color: rgba(255, 123, 123, 0.26); }
.badge--orange { color: var(--orange); background: var(--orange-soft); border-color: rgba(240, 160, 75, 0.26); }
.badge--neutral { color: var(--muted); }
.badge--solid { color: #191307; background: var(--gold-grad); border-color: transparent; }
.badge--dot::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.badge--lg { min-height: 27px; padding: 5px 11px; font-size: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(92, 221, 145, 0.28);
  border-radius: 999px;
  background: rgba(30, 80, 51, 0.17);
  color: var(--green);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(92, 221, 145, 0.1), 0 0 10px rgba(92, 221, 145, 0.7);
  animation: pulse-dot 2s ease-in-out infinite;
}
html[data-theme='light'] .live-badge { background: rgba(220, 255, 235, 0.38); border-color: rgba(20, 140, 75, 0.3); color: #0d7a43; }

/* ------------------------------------------------------------------ cards */
.card {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}
.card--pad { padding: 22px; }
.card--lg { border-radius: var(--radius-lg); }
.card--flush { overflow: hidden; }
.card--glow {
  background:
    radial-gradient(circle at 92% -10%, rgba(220, 174, 24, 0.15), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
    var(--surface);
  border-color: rgba(220, 174, 24, 0.17);
}
html[data-theme='light'] .card {
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(24, 31, 40, 0.06), inset 0 1px rgba(255, 255, 255, 0.7);
}
html[data-theme='light'] .card--glow {
  background:
    radial-gradient(circle at 92% -10%, rgba(220, 174, 24, 0.13), transparent 36%),
    linear-gradient(145deg, #fff, #fbfaf6);
  border-color: rgba(170, 123, 10, 0.22);
}
.glass {
  border: 1px solid var(--line-soft);
  background: linear-gradient(135deg, rgba(12, 13, 15, 0.94), rgba(24, 26, 30, 0.9));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
html[data-theme='light'] .glass { background: rgba(255, 255, 255, 0.9); box-shadow: 0 16px 38px rgba(22, 30, 40, 0.12); }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-head__text { min-width: 0; }
.panel-head .eyebrow { margin-bottom: 6px; }
.panel-title { font-size: 18px; font-weight: 600; letter-spacing: -0.022em; }
.panel-sub { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.55; }

.icon-tile {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold-text);
}
.icon-tile--green { color: var(--green); border-color: rgba(92, 221, 145, 0.25); background: var(--green-soft); }
.icon-tile--blue { color: var(--blue); border-color: rgba(139, 185, 255, 0.25); background: var(--blue-soft); }
.icon-tile--purple { color: var(--purple); border-color: rgba(193, 165, 255, 0.25); background: var(--purple-soft); }
.icon-tile--red { color: var(--red); border-color: rgba(255, 123, 123, 0.25); background: var(--red-soft); }
.icon-tile--lg { width: 48px; height: 48px; border-radius: 12px; }

/* ------------------------------------------------------------------ fields */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid--1 { grid-template-columns: 1fr; }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.label .badge { margin-left: auto; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.3;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
textarea.input {
  height: auto;
  min-height: 100px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.6;
}
.input::placeholder { color: var(--dim); opacity: 1; }
.input:hover { border-color: var(--line); }
.input:focus {
  outline: none;
  border-color: rgba(245, 210, 89, 0.55);
  box-shadow: 0 0 0 3px rgba(220, 174, 24, 0.1);
  background: var(--input-bg);
}
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.input--lg { height: 52px; font-size: 15px; }
.input--no-pad { padding-left: 0; border: 0; background: transparent; }
.input--error { border-color: rgba(255, 123, 123, 0.55); }
.input-wrap--icon > .input { padding-left: 42px; }
.input-wrap--suffix > .input { padding-right: 62px; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
  display: inline-flex;
}
.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  pointer-events: none;
}
.input-wrap .password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
}
.input-wrap .password-toggle:hover { color: var(--gold-text); background: var(--gold-soft); }

.select-wrap { position: relative; }
.select-wrap .input { appearance: none; padding-right: 36px; cursor: pointer; }
.select-wrap::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--dim);
  border-bottom: 1.5px solid var(--dim);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select.input option { background: #0c0d0f; color: #f4f5f6; }
html[data-theme='light'] select.input option { background: #fff; color: #15191f; }

.field-note { color: var(--dim); font-size: 11px; line-height: 1.5; }
.field-note strong { color: var(--text-secondary); font-weight: 600; }
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 123, 123, 0.25);
  border-radius: 9px;
  background: var(--red-soft);
  color: #ffb4b4;
  font-size: 11.5px;
  line-height: 1.5;
}
html[data-theme='light'] .form-error { color: #9c2929; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  appearance: none;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--input-bg);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}
.checkbox input::before {
  content: '';
  width: 7px;
  height: 4px;
  border-left: 1.6px solid var(--primary-ink);
  border-bottom: 1.6px solid var(--primary-ink);
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: var(--transition);
}
.checkbox input:checked { background: var(--primary-bright); border-color: var(--primary-bright); }
.checkbox input:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
.checkbox input:focus-visible { outline: 2px solid var(--primary-bright); outline-offset: 2px; }
.checkbox strong { color: var(--text-secondary); font-weight: 600; }
.checkbox--card {
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.checkbox--card:has(input:checked) { border-color: var(--line); background: var(--gold-soft); }

/* --------------------------------------------------------------- data table */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 700px; border-collapse: separate; border-spacing: 0; }
.data-table thead th {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-faint);
  color: var(--text-secondary);
  font-size: 12.5px;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
html[data-theme='light'] .data-table tbody tr:hover { background: rgba(20, 28, 38, 0.025); }
.data-table .cell-strong { color: var(--text); font-weight: 650; }
.data-table .cell-gold { color: var(--gold-text); font-weight: 600; }
.data-table .cell-green { color: var(--green); font-weight: 600; }
.data-table .cell-mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: -0.02em; }
.data-table .cell-amount { color: var(--text); font-weight: 700; white-space: nowrap; }
.data-table th:last-child, .data-table td:last-child { text-align: right; }
.table-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
}
.table-empty .icon-tile { margin: 0 auto 12px; }
.table-empty strong { display: block; color: var(--text-secondary); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.table-note { padding: 12px 18px; color: var(--dim); font-size: 10.5px; border-top: 1px solid var(--line-faint); }
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.table-toolbar__filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-toolbar__search { display: flex; align-items: center; gap: 8px; min-width: 260px; }
.table-toolbar .input { height: 40px; }

/* ---------------------------------------------------------------- avatars */
.avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  background: rgba(220, 174, 24, 0.14);
  color: var(--gold-text);
  border: 1px solid rgba(220, 174, 24, 0.22);
}
.avatar--lg { width: 44px; height: 44px; font-size: 14px; }
.avatar--sm { width: 26px; height: 26px; font-size: 9px; }
.avatar--blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(139, 185, 255, 0.2); }
.avatar--green { background: var(--green-soft); color: var(--green); border-color: rgba(92, 221, 145, 0.2); }
.avatar--purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(193, 165, 255, 0.2); }
.avatar--rose { background: rgba(255, 150, 180, 0.1); color: #ff9ebb; border-color: rgba(255, 150, 180, 0.22); }
.avatar--teal { background: rgba(90, 220, 210, 0.1); color: #6fe0d6; border-color: rgba(90, 220, 210, 0.22); }

/* ------------------------------------------------------------------ misc */
.kbd {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
}
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(92, 221, 145, 0.6); }
.empty-state { text-align: center; padding: 42px 24px; }
.empty-state .empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--gold-soft);
  color: var(--gold-text);
}
.empty-state h3 { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.empty-state p { color: var(--dim); font-size: 12px; max-width: 360px; margin: 0 auto; line-height: 1.6; }
.info-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.info-strip .icon { color: var(--gold-text); flex: 0 0 auto; margin-top: 1px; }
.info-strip--green { border-color: rgba(92, 221, 145, 0.2); background: var(--green-soft); color: var(--green); }
.info-strip--danger { border-color: rgba(255, 123, 123, 0.2); background: var(--red-soft); color: var(--red); }

.progress {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme='light'] .progress { background: rgba(20, 28, 38, 0.08); }
.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a77a0a, var(--primary-bright));
  box-shadow: 0 0 10px rgba(245, 210, 89, 0.35);
  transition: width 0.6s ease;
}
.progress--thin { height: 3px; }
.progress--thick { height: 7px; }

.stat-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  color: var(--gold-text);
}
.stat-bars i {
  width: 3px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.35;
}
.stat-bars i:nth-child(1) { height: 5px; }
.stat-bars i:nth-child(2) { height: 9px; opacity: 0.55; }
.stat-bars i:nth-child(3) { height: 13px; opacity: 0.8; }
.stat-bars i:nth-child(4) { height: 16px; }

/* ------------------------------------------------------------------- toast */
.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(370px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(14, 15, 16, 0.97);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  color: var(--text);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
  backdrop-filter: blur(14px);
}
html[data-theme='light'] .toast { background: rgba(255, 255, 255, 0.98); border-color: rgba(24, 32, 42, 0.12); box-shadow: 0 18px 44px rgba(24, 32, 42, 0.16); }
.toast.is-visible { transform: translateY(0) scale(1); opacity: 1; }
.toast__icon { color: var(--green); margin-top: 1px; flex: 0 0 auto; }
.toast--error .toast__icon { color: var(--red); }
.toast--info .toast__icon { color: var(--blue); }
.toast__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.toast__body strong { color: var(--text); font-size: 12px; font-weight: 650; }
.toast__close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--dim);
  padding: 2px;
  display: grid;
  place-items: center;
}
.toast__close:hover { color: var(--text); }

/* ------------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-backdrop.is-visible { opacity: 1; }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0, rgba(220, 174, 24, 0.09), transparent 32%),
    var(--surface);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.22s ease;
}
.modal-backdrop.is-visible .modal { transform: translateY(0) scale(1); }
html[data-theme='light'] .modal { box-shadow: 0 40px 100px rgba(15, 23, 32, 0.22); }
.modal--wide { max-width: 760px; }
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.modal__title { font-size: 19px; font-weight: 600; letter-spacing: -0.025em; }
.modal__subtitle { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.55; }
.modal__close { margin: -3px -3px 0 0; }
.modal__body { padding: 20px 22px; }
.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.015);
}
.modal-copy { color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.modal-copy strong { color: var(--text); }

/* --------------------------------------------------------------- spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
.btn--primary .spinner { border-color: rgba(25, 19, 7, 0.3); border-top-color: #191307; }

/* ------------------------------------------------------------- animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 50% { opacity: 0.45; transform: scale(0.82); } }
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.fade-up { animation: fade-up 0.5s ease both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 760px) {
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .toast-stack { right: 16px; bottom: 88px; }
  .modal__head { padding: 18px 18px 14px; }
  .modal__body { padding: 18px; }
  .modal__foot { padding: 14px 18px; }
  .data-table { min-width: 640px; }
  .page-title { font-size: 26px; }
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------ 3D gold coin
   Spinning coin shown on the member and admin route loaders. The faces are
   inline SVG; the rim is a stack of thin discs plus one edge plate, so the
   coin keeps a solid edge at every angle. */
.coin3d {
  --coin-size: 108px;
  --coin-spin: 2.8s;
  position: relative;
  width: 190px;
  height: 150px;
  display: grid;
  place-items: center;
  margin-top: 16px;
  perspective: 640px;
}
.coin3d__defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.coin3d__glow {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 156px;
  height: 156px;
  margin: -78px 0 0 -78px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 200, 66, 0.3), rgba(220, 174, 24, 0.08) 46%, transparent 70%);
  animation: coin3d-glow var(--coin-spin) ease-in-out infinite;
}
.coin3d__float {
  position: relative;
  width: var(--coin-size);
  height: var(--coin-size);
  margin-bottom: 18px;
  transform-style: preserve-3d;
  animation: coin3d-float 3.4s ease-in-out infinite;
}
.coin3d__spin {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: coin3d-spin var(--coin-spin) linear infinite;
}
.coin3d__edge { position: absolute; inset: 0; transform-style: preserve-3d; }
.coin3d__edge i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe08a 0%, #d9a420 32%, #a8760a 64%, #6b4703 100%);
}
.coin3d__edge i:nth-child(1) { transform: translateZ(-4.5px); }
.coin3d__edge i:nth-child(2) { transform: translateZ(-3.5px); }
.coin3d__edge i:nth-child(3) { transform: translateZ(-2.5px); }
.coin3d__edge i:nth-child(4) { transform: translateZ(-1.5px); }
.coin3d__edge i:nth-child(5) { transform: translateZ(-0.5px); }
.coin3d__edge i:nth-child(6) { transform: translateZ(0.5px); }
.coin3d__edge i:nth-child(7) { transform: translateZ(1.5px); }
.coin3d__edge i:nth-child(8) { transform: translateZ(2.5px); }
.coin3d__edge i:nth-child(9) { transform: translateZ(3.5px); }
.coin3d__edge i:nth-child(10) { transform: translateZ(4.5px); }
.coin3d__rim {
  position: absolute;
  top: 0;
  left: 50%;
  width: 10px;
  height: 100%;
  margin-left: -5px;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255, 244, 196, 0.4), transparent 38%, rgba(0, 0, 0, 0.38)),
    repeating-linear-gradient(180deg, #f2cb55 0 1.5px, #9c6b08 1.5px 3px);
  transform: rotateY(90deg);
}
.coin3d__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.coin3d__face svg { display: block; width: 100%; height: 100%; }
.coin3d__face--front { transform: translateZ(5px); }
.coin3d__face--back { transform: rotateY(180deg) translateZ(5px); }
.coin3d__face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 251, 230, 0.5) 48%, rgba(255, 255, 255, 0.08) 55%, transparent 62%);
  background-size: 260% 100%;
  animation: coin3d-shine var(--coin-spin) linear infinite;
}
/* The front face shines half a turn after the back face, as each one faces the viewer. */
.coin3d__face--front::after { animation-delay: calc(var(--coin-spin) / -2); }
.coin3d__shadow {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 92px;
  height: 13px;
  margin-left: -46px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(245, 200, 66, 0.16), rgba(0, 0, 0, 0.55) 38%, transparent 72%);
  animation: coin3d-shadow var(--coin-spin) linear infinite;
}
.is-hidden .coin3d *,
.is-hidden .coin3d__face::after { animation-play-state: paused; }
@keyframes coin3d-spin {
  from { transform: rotateX(10deg) rotateY(0deg); }
  to { transform: rotateX(10deg) rotateY(360deg); }
}
@keyframes coin3d-float {
  0%, 100% { transform: translateY(-4px); }
  50% { transform: translateY(5px); }
}
@keyframes coin3d-shine {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}
@keyframes coin3d-glow {
  0%, 100% { opacity: 0.7; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.04); }
}
@keyframes coin3d-shadow {
  0% { transform: scaleX(1); animation-timing-function: ease-in; }
  25% { transform: scaleX(0.34); animation-timing-function: ease-out; }
  50% { transform: scaleX(1); animation-timing-function: ease-in; }
  75% { transform: scaleX(0.34); animation-timing-function: ease-out; }
  100% { transform: scaleX(1); }
}
@media (max-width: 560px) {
  .coin3d { transform: scale(0.88); margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .coin3d__float, .coin3d__glow, .coin3d__shadow, .coin3d__face::after { animation: none !important; }
  .coin3d__spin { animation: none !important; transform: rotateX(10deg) rotateY(-24deg); }
}

/* --------------------------------------------------------------- text size
   A- / A+ in the top bar (ui.js) set --text-zoom on <html>. The page content
   and dialogs scale like browser zoom; the sidebar and top bar keep their
   size, and game windows stay at 100% because their animations measure
   positions on the screen. */
.text-size { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--m-border-strong, rgba(255, 255, 255, 0.12)); border-radius: 999px; }
.text-size__btn {
  min-width: 30px; height: 28px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent;
  color: inherit; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.text-size__btn:hover:not(:disabled) { background: rgba(245, 210, 89, 0.12); color: #f5d259; }
.text-size__btn:disabled { opacity: 0.35; cursor: default; }
.text-size__btn:focus-visible { outline: 2px solid #f5d259; outline-offset: 1px; }
.text-size__value { min-width: 38px; text-align: center; font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: 0.75; }
.member-body .member-main, .admin-body .admin-main, .member-body .modal, .admin-body .modal { zoom: var(--text-zoom, 1); }
.member-body .member-main .game-window { zoom: calc(1 / var(--text-zoom, 1)); }
@media (max-width: 640px) { .text-size__value { display: none; } .text-size__btn { min-width: 26px; } }
