/* ==========================================================================
   DJ Corn Official — trading terminal
   Aesthetic: industrial/utilitarian. Warm near-black substrate, corn-gold
   signal accent, mono numerals. Mobile-first; the navigation is a single
   prominent top bar — a scrollable strip on phones, compact and horizontal
   from 1024px up.
   ========================================================================== */

:root {
  /* Substrate — warm near-blacks, never pure #000 */
  --bg: #0b0b0a;
  --bg-1: #121210;
  --bg-2: #191917;
  --bg-3: #21211d;
  --line: #2b2b26;
  --line-soft: #201f1b;

  /* Ink */
  --ink: #ece9e0;
  --ink-2: #b3afa3;
  --ink-3: #837f74;

  /* Brand: corn gold, desaturated so it sits in the neutrals */
  --gold: #d9a72c;
  --gold-1: #f0c05a;
  --gold-dim: rgba(217, 167, 44, 0.14);
  --gold-line: rgba(217, 167, 44, 0.34);

  /* Signals */
  --up: #5aa97c;
  --up-dim: rgba(90, 169, 124, 0.14);
  --down: #c9603f;
  --down-dim: rgba(201, 96, 63, 0.14);
  --info: #6f8fa8;
  --warn: #d29740;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -18px rgba(0, 0, 0, 0.9);

  --f-display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;
  --f-mono: "Spline Sans Mono", ui-monospace, monospace;

  --topbar-h: 58px;
  /* No bottom tab bar any more: one top navigation owns every destination. */
  --nav-h: 0px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(217, 167, 44, 0.075), transparent 62%),
    radial-gradient(760px 480px at 4% 104%, rgba(111, 143, 168, 0.055), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fixed grain overlay for texture — non-interactive, never inside a scroller */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.12;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 90;
  background: var(--gold);
  color: #14130e;
  padding: 10px 16px;
  border-radius: 0 0 var(--r) 0;
  font-weight: 600;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--gold-1);
  outline-offset: 2px;
  border-radius: 3px;
}

.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
[hidden] { display: none !important; }

/* ======================= top bar + primary navigation =======================
   One prominent bar at the very top of every page: brand, the six primary
   destinations, then connection state and account / auth actions. On phones the
   bar wraps to two rows and the navigation becomes a horizontally scrollable
   strip — a single nav, so there is no second bottom bar to contradict it.
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 9px 12px 7px;
  background:
    linear-gradient(180deg, rgba(217, 167, 44, 0.05), transparent 70%),
    rgba(9, 9, 8, 0.93);
  backdrop-filter: blur(16px) saturate(1.25);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 34px -26px #000;
}
/* Gold hairline: reads as a trading terminal header rather than a website nav. */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line) 18%, var(--gold-line) 82%, transparent);
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 auto; }
.brand__mark { width: 27px; height: 27px; flex: none; }
.brand__mark .cob { fill: var(--gold); }
.brand__mark .kernels circle { fill: #100f0c; }
.brand__text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand__text strong {
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.055em;
}
.brand__text em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}

.topbar__right { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 0 0 auto; }

/* Connection pill */
.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px 5px 8px;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.conn:hover { border-color: var(--gold-line); color: var(--ink); }
.conn__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  flex: none;
}
.conn__label { display: none; }
.conn[data-state="open"] .conn__dot { background: var(--up); box-shadow: 0 0 0 3px var(--up-dim); }
.conn[data-state="open"] { color: var(--up); border-color: rgba(90, 169, 124, 0.3); }
.conn[data-state="connecting"] .conn__dot { background: var(--warn); animation: pulse 1.1s infinite; }
.conn[data-state="connecting"] { color: var(--warn); }
.conn[data-state="error"] .conn__dot,
.conn[data-state="closed"] .conn__dot { background: var(--down); }
.conn[data-state="error"], .conn[data-state="closed"] { color: var(--down); border-color: rgba(201, 96, 63, 0.3); }

@keyframes pulse { 50% { opacity: 0.25; } }

/* Account chip + switcher */
.account-slot { display: flex; align-items: center; gap: 8px; }

.acct {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  cursor: pointer;
  max-width: 62vw;
  transition: border-color 0.2s var(--ease);
}
.acct:hover { border-color: var(--gold-line); }
.acct__meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; min-width: 0; }
.acct__bal { font-family: var(--f-mono); font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.acct__id {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.acct__caret { color: var(--ink-3); flex: none; }

.tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: var(--r-sm);
  flex: none;
}
.tag--real { background: var(--down-dim); color: var(--down); border: 1px solid rgba(201, 96, 63, 0.36); }
.tag--demo { background: var(--gold-dim); color: var(--gold-1); border: 1px solid var(--gold-line); }
.tag--neutral { background: var(--bg-3); color: var(--ink-2); border: 1px solid var(--line); }

/* Auth actions — both routes go through Deriv: OAuth to log in, the DJ Corn
   partner link to open a Deriv account. No password is ever asked for here. */
.btn-login,
.btn-signup {
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}
.btn-login {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}
.btn-login:hover { border-color: var(--gold-line); color: var(--gold-1); }
.btn-signup {
  display: inline-flex;
  align-items: center;
  padding: 9px 15px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold));
  border: 1px solid var(--gold-1);
  color: #14130e;
  font-weight: 700;
  box-shadow: 0 8px 20px -12px rgba(217, 167, 44, 0.95);
}
.btn-signup:hover { transform: translateY(-1px); }
.btn-login:active,
.btn-signup:active { transform: translateY(0); }

/* ------------------------------ nav strip ------------------------------ */

.nav {
  flex: 1 0 100%;
  order: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 -12px -7px;
  padding: 2px 12px 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.nav::-webkit-scrollbar { display: none; }

.nav__item {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav__item svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.nav__item:hover { color: var(--ink); background: var(--bg-2); border-color: var(--line); }
.nav__item[aria-current="page"] {
  background: linear-gradient(180deg, var(--gold-1), var(--gold));
  border-color: var(--gold-1);
  color: #14130e;
  font-weight: 700;
  box-shadow: 0 8px 20px -13px rgba(217, 167, 44, 0.95);
}
/* The three Deriv platforms leave the site, so say so. */
.nav__item--ext > span::after {
  content: "\2197";
  margin-left: 5px;
  font-size: 10px;
  opacity: 0.6;
}

/* "More" folds into the strip on phones and becomes a menu on desktop. */
.nav__more { display: contents; }
.nav__menu { display: contents; }
.nav__more-btn { display: none; }

@media (min-width: 1024px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 16px;
    height: var(--topbar-h);
    padding: 0 22px;
  }
  .brand { flex: 0 0 auto; }
  .nav {
    flex: 1 1 auto;
    order: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    gap: 2px;
  }
  .nav__item { font-size: 13px; padding: 9px 13px; }
  .conn__label { display: inline; }

  .nav__more { display: block; position: relative; flex: none; margin-left: 4px; }
  .nav__more-btn { display: inline-flex; }
  .nav__menu {
    display: none;
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    z-index: 50;
    min-width: 178px;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: #171714;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: 0 24px 50px -24px #000;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu .nav__item { width: 100%; border-radius: var(--r-sm); }
}

@media (min-width: 1240px) {
  .nav__item { padding: 9px 15px; }
}

.view {
  position: relative;
  z-index: 2;
  padding: 14px 12px calc(env(safe-area-inset-bottom) + 34px);
  max-width: 1360px;
  margin: 0 auto;
  outline: none;
}

@media (min-width: 900px) {
  .view { padding: 22px 26px 64px; }
}

@media (min-width: 1500px) {
  .view { padding-left: 48px; padding-right: 48px; }
}

/* ============================ primitives ============================ */

.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
}
.card__title {
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.card__body { padding: 15px; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) {
  .grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
  .grid--split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
  flex-wrap: wrap;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: clamp(19px, 4.4vw, 25px); }
.section-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; max-width: 62ch; }

/* KPI tile */
.kpi { padding: 13px 14px; }
.kpi__label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi__value {
  font-family: var(--f-mono);
  font-size: clamp(20px, 5.4vw, 27px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.kpi__sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--r);
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.15s var(--ease);
}
.btn:hover:not(:disabled) { border-color: var(--gold-line); background: #262622; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn--primary { background: var(--gold); border-color: var(--gold); color: #14130e; font-weight: 600; }
.btn--primary:hover:not(:disabled) { background: var(--gold-1); border-color: var(--gold-1); }
.btn--stop { background: var(--down-dim); border-color: rgba(201, 96, 63, 0.45); color: #e88b68; }
.btn--stop:hover:not(:disabled) { background: rgba(201, 96, 63, 0.22); border-color: var(--down); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 10px; font-size: 12.5px; }
.btn--block { width: 100%; }
.btn--danger { color: #e88b68; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label {
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.input, select.input, textarea.input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 11px;
  font-family: var(--f-mono);
  font-size: 13.5px;
  width: 100%;
  transition: border-color 0.18s var(--ease);
  appearance: none;
}
textarea.input { font-family: var(--f-body); line-height: 1.5; resize: vertical; }
.input:focus { border-color: var(--gold-line); outline: none; }
.input:invalid { border-color: rgba(201, 96, 63, 0.5); }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 8.5 2 4h8z' fill='%23837f74'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}
.field__hint { font-size: 11px; color: var(--ink-3); }
.field-row { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 620px) { .field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
}
.switch-row input { accent-color: var(--gold); width: 16px; height: 16px; }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 560px;
}
table.data th {
  text-align: left;
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--bg-1);
  position: sticky;
  top: 0;
}
table.data td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
table.data tbody tr:hover { background: rgba(217, 167, 44, 0.045); }
table.data td.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; text-align: right; }
table.data th.num { text-align: right; }

/* Status / empty / loading */
.empty { padding: 34px 20px; text-align: center; color: var(--ink-3); }
.empty__mark {
  width: 38px;
  height: 38px;
  margin: 0 auto 12px;
  border-radius: 11px;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-3);
}
.empty h4 { font-size: 14.5px; color: var(--ink-2); margin-bottom: 5px; }
.empty p { margin: 0; font-size: 12.5px; max-width: 44ch; margin-inline: auto; }

.skel {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 220% 100%;
  animation: shimmer 1.35s infinite linear;
  border-radius: var(--r-sm);
  height: 12px;
}
.skel--lg { height: 26px; }
.skel--pill { height: 32px; border-radius: 999px; }
@keyframes shimmer { to { background-position: -120% 0; } }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 13px;
  color: var(--ink-2);
}
.notice svg { width: 17px; height: 17px; fill: currentColor; flex: none; margin-top: 1px; }
.notice--error { border-color: rgba(201, 96, 63, 0.4); background: var(--down-dim); color: #e79b7d; }
.notice--warn { border-color: rgba(210, 151, 64, 0.4); background: rgba(210, 151, 64, 0.1); color: #dbab62; }
.notice--info { border-color: var(--gold-line); background: var(--gold-dim); color: #dcbc74; }
.notice strong { color: var(--ink); display: block; margin-bottom: 2px; }
.notice__body { min-width: 0; }
.notice__body p { margin: 0; }

.boot { padding: 90px 20px; text-align: center; color: var(--ink-3); }
.boot__mark {
  width: 34px;
  height: 34px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* Toasts */
.toasts {
  position: fixed;
  z-index: 70;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 900px) {
  .toasts { left: auto; right: 22px; bottom: 22px; width: 370px; }
}
.toast {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #1c1c19;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: var(--r);
  padding: 11px 13px;
  font-size: 13px;
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.95);
  animation: toast-in 0.28s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.toast--error { border-left-color: var(--down); }
.toast--success { border-left-color: var(--up); }
.toast--info { border-left-color: var(--gold); }
.toast__body { min-width: 0; flex: 1; }
.toast__title { font-weight: 600; margin-bottom: 2px; }
.toast__msg { color: var(--ink-2); overflow-wrap: anywhere; }
.toast__x { background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 0 2px; font-size: 16px; line-height: 1; }

/* Contact buttons */
.contact {
  position: fixed;
  z-index: 45;
  right: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 900px) { .contact { bottom: 22px; right: 22px; } }
.contact__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1c1c19;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px;
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.9);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.contact__btn svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
.contact__btn span {
  font-size: 12.5px;
  font-weight: 500;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.28s var(--ease);
}
.contact__btn:hover { transform: translateX(-2px); border-color: currentColor; }
.contact__btn:hover span { max-width: 92px; }
.contact__btn--wa { color: #63b77f; }
.contact__btn--tg { color: #6aa6cf; }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 30px;
  text-align: center;
}

/* ============================ landing ============================ */

.hero {
  position: relative;
  padding: 26px 0 20px;
  display: grid;
  gap: 24px;
}
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); align-items: center; gap: 48px; padding: 48px 0 34px; }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-line);
  background: var(--gold-dim);
  padding: 6px 11px;
  border-radius: 999px;
}
.hero h1 {
  font-size: clamp(34px, 10.5vw, 74px);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 16px 0 0;
  line-height: 0.98;
}
.hero h1 .accent {
  color: var(--gold);
  font-style: italic;
  letter-spacing: -0.04em;
}
.hero__lede {
  margin: 15px 0 0;
  font-size: clamp(14.5px, 3.6vw, 17px);
  color: var(--ink-2);
  max-width: 54ch;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero__cta .btn { padding: 12px 20px; font-size: 14.5px; }
.hero__note { margin: 14px 0 0; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.hero__note svg { width: 14px; height: 14px; fill: var(--up); flex: none; }

/* Live ticker panel — real public Deriv ticks, no auth needed */
.ticker { position: relative; }
.ticker__rows { display: flex; flex-direction: column; }
.tick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line-soft);
}
.tick-row:last-child { border-bottom: 0; }
.tick-row__sym { min-width: 0; }
.tick-row__sym b { font-size: 13.5px; font-weight: 600; display: block; }
.tick-row__sym span { font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.05em; }
.tick-row__px {
  font-family: var(--f-mono);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  transition: color 0.5s var(--ease);
}
.tick-row__px[data-dir="up"] { color: var(--up); }
.tick-row__px[data-dir="down"] { color: var(--down); }
.tick-row__digit {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.tick-row__digit[data-parity="even"] { color: var(--info); border-color: rgba(111, 143, 168, 0.4); }
.tick-row__digit[data-parity="odd"] { color: var(--gold-1); border-color: var(--gold-line); }

.feature-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feature {
  display: flex;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
}
.feature__ix {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--gold);
  flex: none;
  padding-top: 2px;
  letter-spacing: 0.06em;
}
.feature h3 { font-size: 14.5px; margin-bottom: 4px; }
.feature p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

.landing-foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-3);
  display: grid;
  gap: 8px;
}
.landing-foot p { margin: 0; max-width: 92ch; }

/* ============================ analysis ============================ */

.digits {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
@media (min-width: 640px) { .digits { grid-template-columns: repeat(10, minmax(0, 1fr)); } }

.digit {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  padding: 8px 5px 6px;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.25s var(--ease);
}
.digit__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gold-dim);
  transform-origin: bottom;
  transition: height 0.4s var(--ease);
}
.digit__n {
  position: relative;
  font-family: var(--f-mono);
  font-size: 16px;
  font-weight: 600;
}
.digit__p {
  position: relative;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 1px;
}
.digit[data-rank="high"] { border-color: var(--gold-line); }
.digit[data-rank="high"] .digit__bar { background: rgba(217, 167, 44, 0.26); }
.digit[data-rank="high"] .digit__n { color: var(--gold-1); }
.digit[data-rank="low"] { border-color: rgba(111, 143, 168, 0.34); }
.digit[data-rank="low"] .digit__bar { background: rgba(111, 143, 168, 0.2); }
.digit[data-rank="low"] .digit__n { color: var(--info); }
.digit--current { box-shadow: 0 0 0 2px var(--gold) inset; }

/* Two-sided probability meter */
.meter { margin-top: 4px; }
.meter__head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 6px;
  font-family: var(--f-mono);
}
.meter__track {
  height: 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
}
.meter__fill { transition: width 0.45s var(--ease); }
.meter__fill--a { background: linear-gradient(90deg, rgba(90, 169, 124, 0.55), var(--up)); }
.meter__fill--b { background: linear-gradient(90deg, var(--down), rgba(201, 96, 63, 0.55)); }
.meter__foot { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 6px; }

.streak { display: flex; gap: 3px; flex-wrap: wrap; }
.streak__cell {
  width: 15px;
  height: 22px;
  border-radius: 3px;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.streak__cell[data-dir="up"] { background: var(--up-dim); border-color: rgba(90, 169, 124, 0.45); }
.streak__cell[data-dir="down"] { background: var(--down-dim); border-color: rgba(201, 96, 63, 0.45); }

.spark { display: block; width: 100%; height: 70px; }
.spark path { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark .area { fill: var(--gold-dim); stroke: none; }

.stat-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.stat-line:last-child { border-bottom: 0; }
.stat-line dt { color: var(--ink-3); font-size: 12px; }
.stat-line dd { margin: 0; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Market selector */
.market-bar {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 14px;
}
.market-bar .field { flex: 1 1 168px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; -webkit-overflow-scrolling: touch; }
.chip {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink-2);
  transition: all 0.18s var(--ease);
}
.chip:hover { border-color: var(--gold-line); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--gold-dim); border-color: var(--gold-line); color: var(--gold-1); font-weight: 500; }

/* ============================ bots ============================ */

.bot-list { display: grid; gap: 13px; }
@media (min-width: 1140px) { .bot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.bot { border-color: var(--line); }
.bot[data-running="true"] { border-color: rgba(90, 169, 124, 0.5); }
.bot[data-running="true"] .card__head { background: var(--up-dim); }

.bot__head { display: flex; align-items: flex-start; gap: 11px; }
.bot__id { min-width: 0; flex: 1; }
.bot__id h3 { font-size: 15.5px; }
.bot__id p { margin: 3px 0 0; font-size: 12px; color: var(--ink-3); }

.run-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--ink-3);
  flex: none;
}
.run-state__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.run-state[data-state="running"] { color: var(--up); border-color: rgba(90, 169, 124, 0.45); background: var(--up-dim); }
.run-state[data-state="running"] .run-state__dot { animation: pulse 1.1s infinite; }
.run-state[data-state="starting"], .run-state[data-state="stopping"] { color: var(--warn); border-color: rgba(210, 151, 64, 0.45); }
.run-state[data-state="error"] { color: var(--down); border-color: rgba(201, 96, 63, 0.45); background: var(--down-dim); }

.bot__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 13px;
}
.bot__stat { background: var(--bg-1); padding: 9px 10px; }
.bot__stat dt { font-size: 9.5px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3); }
.bot__stat dd {
  margin: 3px 0 0;
  font-family: var(--f-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.bot__actions { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.bot__actions .btn { flex: 1 1 auto; min-width: 108px; }

.bot__log {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
  max-height: 188px;
  overflow-y: auto;
  font-family: var(--f-mono);
  font-size: 11.5px;
}
.log-line {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line-soft);
  align-items: baseline;
}
.log-line:last-child { border-bottom: 0; }
.log-line time { color: var(--ink-3); }
.log-line span { overflow-wrap: anywhere; }
.log-line[data-kind="win"] b { color: var(--up); }
.log-line[data-kind="loss"] b { color: var(--down); }
.log-line[data-kind="error"] { color: #e79b7d; }
.log-line[data-kind="info"] { color: var(--ink-2); }

details.disclose { border-top: 1px solid var(--line-soft); margin-top: 12px; padding-top: 10px; }
details.disclose > summary {
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid currentColor;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform 0.2s var(--ease);
}
details.disclose[open] > summary::before { transform: rotate(90deg) translateX(1px); }
details.disclose > summary:hover { color: var(--ink-2); }
.disclose__body { padding-top: 12px; display: grid; gap: 11px; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 6, 5, 0.76);
  backdrop-filter: blur(4px);
  animation: fade 0.2s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal__panel {
  width: 100%;
  max-width: 430px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -30px #000;
  overflow: hidden;
  animation: rise 0.26s var(--ease);
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal__body { padding: 17px; display: grid; gap: 13px; }
.modal__body h3 { font-size: 17px; }
.modal__body p { margin: 0; font-size: 13px; color: var(--ink-2); }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 17px 17px; }

/* Account picker list */
.acct-list { display: grid; gap: 7px; }
.acct-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color 0.18s var(--ease);
}
.acct-option:hover { border-color: var(--gold-line); }
.acct-option[aria-current="true"] { border-color: var(--gold); background: var(--gold-dim); }
.acct-option__id { flex: 1; min-width: 0; }
.acct-option__id b { display: block; font-family: var(--f-mono); font-size: 13.5px; }
.acct-option__id span { font-size: 11px; color: var(--ink-3); }
.acct-option__bal { font-family: var(--f-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* Admin */
.admin-grid { display: grid; gap: 13px; }
@media (min-width: 1080px) { .admin-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; } }
.code {
  font-family: var(--f-mono);
  font-size: 11.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  color: var(--gold-1);
  overflow-wrap: anywhere;
}
pre.code-block {
  font-family: var(--f-mono);
  font-size: 11.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  overflow-x: auto;
  margin: 0;
  color: var(--ink-2);
  line-height: 1.6;
}

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