/* =====================================================================
   PADDOCK · Carbon theme · foundation
   Loads after tradingfloor.css and crypto.css. It restyles the app without
   editing those files: every rule here is scoped to .tf.cb (carbon.js adds
   the "cb" class to the #tf root), which out-ranks the original rules.
   Area files (shell, cockpit, screens, compete) build on the tokens below.
   ===================================================================== */

/* ---------- tokens: remap the original --t* variables (dark only) ---------- */
.tf.cb,
.tf.cb[data-tfth] {
  /* surfaces */
  --tbg: #050505; --tp0: #08090A; --tpan: #0C0D0F; --tpan2: #121316; --tp3: #121316; --tp4: #1A1C20;
  --tline: rgba(226, 232, 240, .08); --tline2: rgba(226, 232, 240, .14); --tline3: rgba(255, 90, 31, .45);
  /* text */
  --tink: #EDF0F4; --tt1: #D5DAE1; --tt2: #AAB2BD; --tmut: #808893;
  /* the old gold accent becomes molten orange everywhere */
  --tgold: #FF5A1F; --tgold2: #FF814A; --tgold3: #C2410C; --tgoldink: #0B0603;
  /* profit / loss and buy / sell only */
  --tup: #2EE59D; --tdn: #FF3355;
  /* secondary signals */
  --twarn: #FFB547; --thot: #FF814A; --tblue: #8D9BB0; --tviolet: #B9A6FF;
  --tselbg: #1A1C20; --tselfg: #EDF0F4; --ttag: #050505; --tsh: 1;
  --tglow: radial-gradient(120% 140% at 100% 0%, rgba(255, 90, 31, .10), transparent 55%);
  --thero: linear-gradient(160deg, #121316, #08090A 60%, #050505);
  /* type: no serif anywhere */
  --tsans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tmono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --tserif: "Space Grotesk", system-ui, sans-serif;
  --tcaps: "Michroma", "Arial Black", sans-serif;

  /* ---- Carbon extras (cb-*), shared by the area files ---- */
  --cb-accent: #FF5A1F; --cb-accent-hi: #FF814A; --cb-accent-lo: #EE4E14; --cb-ember: #C2410C; --cb-ember-deep: #4A1504;
  --cb-accent-a10: rgba(255, 90, 31, .10); --cb-accent-a25: rgba(255, 90, 31, .25); --cb-accent-a50: rgba(255, 90, 31, .5);
  --cb-ink: #0B0603;            /* text on orange */
  --cb-steel: #8D9BB0;          /* neutral telemetry colour */
  --cb-focus: #DCE6FF;
  --cb-glass: rgba(12, 13, 15, .82);
  --cb-line-3: rgba(226, 232, 240, .26);
  --cb-cf-0: #0B0B0C; --cb-cf-1: #080808; --cb-cf-2: #0F0F10; --cb-cf-3: #141415; --cb-cf-4: #19191B;
  --cb-gloss: rgba(255, 255, 255, .05); --cb-shade: rgba(0, 0, 0, .5); --cb-clear: rgba(255, 255, 255, .018);
  --cb-brand: "Michroma", "Arial Black", sans-serif;
  --cb-skew: -12deg;
  --cb-ease: cubic-bezier(.2, .8, .2, 1);
  /* layout contract: the shell sets the real HUD height; other areas read it */
  --cb-hud-h: 64px;

  background: var(--tbg);
  color: var(--tink);
  font: 400 14px/1.45 var(--tsans);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  scrollbar-color: var(--tp4) transparent;
}
.tf.cb *::selection { background: var(--cb-accent-a50); color: #fff; }

/* ---------- utilities the area files can use ---------- */
/* carbon-fibre weave under a clear-coat gloss */
.tf.cb .cbcf {
  background-color: var(--cb-cf-0);
  background-image:
    linear-gradient(180deg, var(--cb-gloss), transparent 45%, var(--cb-shade)),
    repeating-linear-gradient(115deg, transparent 0 18px, var(--cb-clear) 18px 19px),
    linear-gradient(27deg, var(--cb-cf-1) 5px, transparent 5px),
    linear-gradient(207deg, var(--cb-cf-1) 5px, transparent 5px),
    linear-gradient(27deg, var(--cb-cf-3) 5px, transparent 5px),
    linear-gradient(207deg, var(--cb-cf-3) 5px, transparent 5px),
    linear-gradient(90deg, var(--cb-cf-2) 10px, transparent 10px),
    linear-gradient(var(--cb-cf-2) 25%, var(--cb-cf-1) 25%, var(--cb-cf-1) 50%, transparent 50%, transparent 75%, var(--cb-cf-4) 75%, var(--cb-cf-4));
  background-size: 100% 100%, 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
  background-position: 0 0, 0 0, 0 5px, 10px 0, 0 10px, 10px 5px, 0 0, 0 0;
}
/* small engineering label */
.tf.cb .cblbl { font: 400 8.5px/1.25 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tmut); white-space: nowrap; }
/* angled (skewed) shape with upright content */
.tf.cb .cbsk { transform: skewX(var(--cb-skew)); }
.tf.cb .cbsk > * { transform: skewX(calc(var(--cb-skew) * -1)); }
.tf.cb .up { color: var(--tup); }
.tf.cb .dn { color: var(--tdn); }

/* ---------- base ---------- */
.tf.cb :focus-visible { outline: 2px solid var(--cb-focus); outline-offset: 2px; }
.tf.cb h1, .tf.cb h2, .tf.cb h3, .tf.cb h4 { font-family: var(--tsans); letter-spacing: -.01em; }
.tf.cb .tfk,
.tf.cb .tfahead .tfk {
  font: 400 10px/1.3 var(--cb-brand); letter-spacing: .14em; text-transform: uppercase; color: var(--cb-accent);
}
.tf.cb input, .tf.cb select, .tf.cb textarea { font-family: var(--tsans); }
.tf.cb input[type="number"], .tf.cb .tfticket input { font-family: var(--tmono); font-variant-numeric: tabular-nums; }

/* the thin band at the very top: gold strip becomes a hairline of orange */
.tf.cb .tfband {
  height: calc(2px + env(safe-area-inset-top, 0px));
  background: linear-gradient(90deg, transparent, var(--cb-accent-lo) 20%, var(--cb-accent-hi) 50%, var(--cb-accent-lo) 80%, transparent);
}

/* ---------- buttons ---------- */
.tf.cb .tfbtn {
  height: 40px; padding: 0 18px; border-radius: 4px; border: 1px solid var(--tline2);
  background: var(--tpan2); color: var(--tink);
  font: 600 13.5px/1 var(--tsans); letter-spacing: .01em;
  transition: background .2s, border-color .2s, color .2s, transform .12s;
}
.tf.cb .tfbtn:hover:not(:disabled) { border-color: var(--cb-line-3); background: var(--tp4); }
.tf.cb .tfbtn:active:not(:disabled) { transform: translateY(1px); }
/* the main call to action: molten orange, chamfered corners */
.tf.cb .tfbtn.gold {
  background: linear-gradient(135deg, var(--cb-accent-hi), var(--cb-accent) 45%, var(--cb-accent-lo));
  border-color: transparent; color: var(--cb-ink); font-weight: 700;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow: none;
}
.tf.cb .tfbtn.gold:hover:not(:disabled) { background: linear-gradient(135deg, #FF9A6A, var(--cb-accent-hi) 45%, var(--cb-accent)); color: var(--cb-ink); }
.tf.cb .tfbtn.ghost { background: transparent; border-color: var(--tline2); color: var(--tt1); }
.tf.cb .tfbtn.ghost:hover:not(:disabled) { border-color: var(--cb-accent-a50); color: var(--tink); background: var(--cb-accent-a10); }
.tf.cb .tfbtn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 3px; }
.tf.cb .tfbtn.xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 3px; }
.tf.cb .tfbtn.gold.sm, .tf.cb .tfbtn.gold.xs { clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.tf.cb .tfbtn:disabled { opacity: .4; }
.tf.cb .tfib { border-radius: 4px; border-color: var(--tline2); background: var(--tpan2); color: var(--tt1); }
.tf.cb .tfib:hover { border-color: var(--cb-accent-a50); color: var(--tink); }

/* ---------- segmented controls: angled chips, orange when active ---------- */
.tf.cb .tfseg { gap: 3px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.tf.cb .tfseg button {
  height: 28px; min-width: 34px; padding: 0 11px; border-radius: 0;
  background: var(--tpan2); border: 1px solid var(--tline);
  color: var(--tmut); font: 600 12px/1 var(--tsans);
  transform: skewX(var(--cb-skew));
  transition: background .2s, color .2s, border-color .2s;
}
.tf.cb .tfseg button > * { transform: skewX(calc(var(--cb-skew) * -1)); }
.tf.cb .tfseg button:hover { color: var(--tink); border-color: var(--tline2); }
.tf.cb .tfseg button[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--cb-accent-a25), var(--cb-accent-a10));
  border-color: var(--cb-accent); color: var(--tink);
}

/* ---------- menus, cards, headers ---------- */
.tf.cb .tfmenu summary { border-radius: 3px; background: var(--tpan2); border-color: var(--tline); color: var(--tt1); font: 600 12px/1 var(--tsans); }
.tf.cb .tfmenu[open] summary { border-color: var(--cb-accent-a50); color: var(--tink); }
.tf.cb .tfmenub { border-radius: 6px; background: var(--tp3); border-color: var(--tline2); box-shadow: 0 18px 44px rgba(0, 0, 0, .7); }
.tf.cb .tfcard {
  border-radius: 6px; background: var(--tpan); border: 1px solid var(--tline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.tf.cb .tfcard h3 { font: 600 15px/1.25 var(--tsans); }
.tf.cb .tfcard h3 .tfi { color: var(--cb-accent); }
.tf.cb .tfahead {
  border-radius: 6px; border: 1px solid var(--tline);
  background:
    radial-gradient(90% 140% at 100% 0%, var(--cb-accent-a10), transparent 55%),
    linear-gradient(160deg, var(--tpan), var(--tp0));
  position: relative; overflow: hidden;
}
/* thin orange edge on hero headers, like a livery stripe */
.tf.cb .tfahead::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--cb-accent-hi), var(--cb-accent) 50%, var(--cb-ember));
}
.tf.cb .tfahead h1 { font: 700 clamp(26px, 3.4vw, 40px)/1.06 var(--tsans); letter-spacing: -.02em; }
.tf.cb .tfstats div { border-radius: 4px; background: var(--tpan2); border-color: var(--tline); }
.tf.cb .tfstats span { font: 400 8.5px/1.3 var(--cb-brand); letter-spacing: .1em; color: var(--tmut); }
.tf.cb .tfstats b { font: 600 22px/1.15 var(--tmono); font-variant-numeric: tabular-nums; }

/* ---------- toasts and modals ---------- */
.tf.cb .tftoast { border-radius: 4px; background: rgba(18, 19, 22, .96); border: 1px solid var(--tline2); border-left: 3px solid var(--cb-accent); box-shadow: 0 16px 40px rgba(0, 0, 0, .7); }
.tf.cb .tftoast.up { border-left-color: var(--tup); }
.tf.cb .tftoast.dn { border-left-color: var(--tdn); }
.tf.cb .tftoast .tfi { color: var(--cb-accent); }
.tf.cb .tfmodal { background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---------- XP and progress bars ---------- */
.tf.cb .tfxpb { border-radius: 0; background: var(--tp4); }
.tf.cb .tfxpb i { border-radius: 0; background: linear-gradient(90deg, var(--cb-ember), var(--cb-accent) 70%, var(--cb-accent-hi)); }

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