:root {
  --bg: #101012;
  --header: #17181c;
  --box: #17181c;
  --box2: #202022;
  --card: #232325;
  --line: #232325;
  --text: #fff;
  --muted: #a7a7a7;
  --y: #fbd506;
  --y2: #ffdd23;
  --grad: linear-gradient(93deg, #fbd506 0%, #ffdd23 50%, #fbd506 100%);
  --green: #9cff6a;
  --live: 148px;
  --font: "Exo 2", system-ui, sans-serif;
  --r: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ========== HEADER ========== */
.header {
  height: 64px;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: .06em; font-size: 18px; flex-shrink: 0;
  color: #fff;
}
.logo.sm { font-size: 14px; margin-bottom: 8px; }
.logo-mark { display: block; flex-shrink: 0; }
.hdr-stats { display: flex; gap: 16px; }
.st {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.st b { color: #fff; font-variant-numeric: tabular-nums; font-weight: 700; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--y); box-shadow: 0 0 8px var(--y); display: inline-block;
}
.up-ico { display: block; }

.hdr-promo {
  height: 38px; min-width: 190px; max-width: 280px; flex: 1;
  margin-left: 4px; border-radius: 10px;
  background: linear-gradient(90deg, #3a1560 0%, #7a1f6a 55%, #2b1240 100%);
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
}
.hdr-promo strong { color: var(--y); }

.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ico {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent;
  background: var(--card); color: #bbb; display: grid; place-items: center;
}
.ico.round { border-radius: 50%; }
.ico:hover { color: #fff; }
.bal {
  height: 36px; padding: 0 12px; border-radius: 999px; border: none;
  background: var(--card); display: inline-flex; align-items: center; gap: 8px; font-weight: 700;
}
.coin {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe56a, #fbd506 55%, #b8860b);
  display: inline-block; vertical-align: -2px;
  box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.25);
}
.coin.sm { width: 12px; height: 12px; }
.btn-yellow {
  height: 36px; padding: 0 16px; border-radius: 999px; border: none;
  background: var(--grad); color: #111; font-weight: 800;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 0 16px rgba(251,213,6,.35);
}
.btn-yellow.sm { height: 30px; font-size: 12px; }
.btn-yellow.wide { width: 100%; height: 42px; justify-content: center; border-radius: 12px; margin-top: 10px; }
.av {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(251,213,6,.4);
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.bell-wrap { position: relative; }
.bell-dd {
  position: absolute; right: 0; top: calc(100% + 8px); width: 300px;
  background: #1c1d22; border: 1px solid #2a2c33; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); z-index: 80; max-height: 340px; overflow: auto;
}
.bell-title { padding: 12px 14px 8px; font-weight: 800; }
#notify-list .ni { padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.05); }
#notify-list .t { font-size: 11px; color: var(--muted); }
#notify-list .h { font-weight: 700; margin-top: 2px; }
#notify-list .d { font-size: 12px; color: #aaa; margin-top: 2px; }

/* ========== LAYOUT ========== */
.layout { display: flex; flex: 1; min-height: 0; }
.workspace {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: radial-gradient(ellipse 55% 28% at 50% 8%, rgba(251,213,6,.05), transparent 65%), var(--bg);
}

/* LIVE SIDEBAR */
.live {
  width: var(--live);
  flex-shrink: 0;
  background: #121214;
  border-right: 1px solid var(--line);
  height: calc(100vh - 64px);
  position: sticky; top: 64px;
  overflow-y: auto; overflow-x: hidden;
  padding: 8px 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.live::-webkit-scrollbar { width: 0; }

.lc {
  position: relative;
  background: linear-gradient(180deg, #1c1d23 0%, #141518 100%);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 8px 6px 10px;
  min-height: 118px;
  overflow: hidden;
  animation: in .32s ease;
}
.lc.hot {
  border-color: rgba(251,213,6,.85);
  box-shadow: 0 0 0 1px rgba(251,213,6,.25), 0 0 18px rgba(251,213,6,.18);
}
.lc .pct {
  position: absolute; top: 7px; left: 8px; z-index: 2;
  font-size: 11px; font-weight: 800; color: #fff;
  display: inline-flex; align-items: center; gap: 3px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.lc .pct::before {
  content: "";
  width: 10px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23fbd506' d='M6 0l1.5 3.5H11L7.8 5.8 9 10 6 7.5 3 10l1.2-4.2L1 3.5h3.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.lc img {
  width: 100%; height: 64px; object-fit: contain; margin: 18px 0 2px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.45));
}
.lc .nm {
  text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 4px; text-transform: uppercase;
}
.lc .sub {
  text-align: center; font-size: 9px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 4px 4px;
}
.lc .bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  border-radius: 0 0 12px 12px;
  background: var(--rarity, #4b69ff);
  box-shadow: 0 0 10px var(--rarity, #4b69ff);
}
@keyframes in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}

/* ========== UPGRADE ========== */
.upgrade { width: min(1180px, 100%); margin: 0 auto; padding: 10px 16px 28px; flex: 1; }

.upgrade-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 8px;
  min-height: 40px;
}
.upgrade-title {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 22px; letter-spacing: .06em;
  justify-self: center;
}
.tool-icons {
  display: flex; gap: 6px; justify-self: start;
}
.tool-icons button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08);
  background: #1a1b20; color: #9a9a9a; display: grid; place-items: center;
}
.tool-icons button:hover,
.tool-icons button.on { color: var(--y); border-color: rgba(251,213,6,.4); }

.upgrade-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px minmax(0,1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .upgrade-row { grid-template-columns: 1fr; }
  .live { display: none; }
  .upgrade-head { grid-template-columns: auto 1fr; }
  .upgrade-title { justify-self: start; font-size: 18px; }
}

.box {
  background: var(--box);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 16px;
  min-height: 320px;
  display: flex; flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.box-h {
  text-align: center; padding: 16px 18px 0;
  font-size: 13px; font-weight: 600; line-height: 1.35; color: #d0d0d0;
}
.box-h small {
  display: block; margin-top: 6px; font-size: 11px; font-weight: 400; color: var(--muted);
}
.box-body {
  flex: 1; min-height: 180px;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 8px; padding: 10px 14px 14px; position: relative;
}

.placeholder {
  position: relative; width: 210px; height: 140px;
  display: grid; place-items: center;
}
.placeholder .ak {
  width: 170px; height: auto; opacity: .55;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.35));
}
.chevs {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0;
  pointer-events: none;
}
.chevs span {
  width: 28px; height: 16px;
  background: var(--y);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  opacity: .95;
  filter: drop-shadow(0 0 8px rgba(251,213,6,.55));
}
.chevs.down { bottom: 6px; }
.chevs.down span { clip-path: polygon(50% 100%, 0 0, 100% 0); }
.chevs.down span:nth-child(1) { opacity: .35; }
.chevs.down span:nth-child(2) { opacity: .65; margin-top: -4px; }
.chevs.down span:nth-child(3) { opacity: 1; margin-top: -4px; }
.chevs.up { top: 2px; }
.chevs.up span { clip-path: polygon(50% 0, 0 100%, 100% 100%); }
.chevs.up span:nth-child(1) { opacity: 1; }
.chevs.up span:nth-child(2) { opacity: .65; margin-top: -4px; }
.chevs.up span:nth-child(3) { opacity: .35; margin-top: -4px; }

.picked { width: 124px; text-align: center; z-index: 1; }
.picked img {
  width: 100px; height: 72px; object-fit: contain; margin: 0 auto 4px;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.45));
}
.picked .n { font-size: 11px; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picked .p { color: var(--y); font-weight: 800; font-size: 12px; margin-top: 2px; }

.bal-slider {
  padding: 10px 16px 16px; border-top: 1px solid rgba(255,255,255,.04);
}
.bal-slider-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
}
.bal-slider-top .bal-val { color: #ddd; }
.bal-slider-top b { color: var(--y); }
#bal-range {
  width: 100%; height: 6px; appearance: none; background: #2a2b31; border-radius: 999px; outline: none;
}
#bal-range::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--grad); border: 2px solid #111; box-shadow: 0 0 10px rgba(251,213,6,.5);
  cursor: pointer;
}

.right-col { display: flex; flex-direction: column; gap: 10px; }
.right-col .box { min-height: 268px; }

.center {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 0;
}

.wheel {
  width: 289px; height: 289px; position: relative; display: grid; place-items: center;
}
.wheel-svg { position: absolute; inset: 0; overflow: visible; }
.prog {
  transition: stroke-dasharray .45s ease, stroke-dashoffset .45s ease;
}
.wheel-core {
  width: 178px; height: 178px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #262730, #0e0f13 74%);
  border: 1px solid rgba(255,255,255,.05);
  display: grid; place-content: center; text-align: center; z-index: 1;
  box-shadow: inset 0 0 48px rgba(0,0,0,.6), 0 0 0 9px #121318;
  pointer-events: none;
}
.pct {
  font-size: 40px; font-weight: 800; line-height: 1;
  color: #9cff6a;
  text-shadow: 0 0 16px rgba(156,255,106,.35);
}
.sub {
  margin-top: 8px; font-size: 13px; font-weight: 700;
  color: #9cff6a; opacity: .85;
}
.wheel-labels {
  position: absolute; inset: 0; pointer-events: none;
  font-size: 12px; color: #7a7b82; font-weight: 700;
}
.tl { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); }
.ml { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); }
.mr { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }

/* pointer sits at 6 o'clock; rotor spins around center */
.pointer-rotor {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  transform: rotate(0deg);
  will-change: transform;
}
.pointer {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  display: grid;
  place-items: center;
}
.pointer-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251,213,6,.55), transparent 70%);
  filter: blur(2px);
}
.pointer-arrow {
  position: relative;
  width: 16px;
  height: 14px;
  background: linear-gradient(180deg, #ffe56a, #fbd506 40%, #ff9800);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 6px rgba(251,213,6,.95));
}

.btn-go {
  width: 100%; max-width: 280px; height: 50px; border: none; border-radius: 12px;
  background: var(--grad); color: #111; font-weight: 900; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 0 22px rgba(251,213,6,.45);
  letter-spacing: .02em;
}
.btn-go:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }

.quick {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start;
  padding: 0 2px;
}
.quick button {
  min-width: 44px; height: 32px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08); background: var(--box);
  font-weight: 700; font-size: 12px; color: #cfcfcf;
}
.quick button.on,
.quick button:hover {
  border-color: var(--y); color: var(--y);
  background: rgba(251,213,6,.08);
}
.quick .p35 { border-color: rgba(220,60,60,.55); }
.quick .p35.on { border-color: #e04545; color: #ff8a8a; background: rgba(224,69,69,.1); }
.quick .p55 { border-color: rgba(251,213,6,.45); }
.quick .p55.on { border-color: var(--y); color: var(--y); }
.quick .p75 { border-color: rgba(80,200,80,.55); }
.quick .p75.on { border-color: #4caf50; color: #8dff8d; background: rgba(76,175,80,.1); }
.quick .gear { min-width: 32px; padding: 0; display: grid; place-items: center; }

/* bottom panels */
.bottom-panels {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px;
}
@media (max-width: 900px) { .bottom-panels { grid-template-columns: 1fr; } }
.panel {
  background: var(--box); border: 1px solid rgba(255,255,255,.04); border-radius: 16px;
  min-height: 360px; display: flex; flex-direction: column; overflow: hidden;
}
.panel.grow { min-width: 0; }
.panel-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.04); flex-wrap: wrap;
}
.panel-title { font-weight: 800; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.flt { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.flt-lbl { font-weight: 600; }
.flt label {
  display: inline-flex; align-items: center; gap: 4px;
  background: #121214; border: 1px solid rgba(255,255,255,.06); border-radius: 8px; padding: 0 6px; height: 32px;
}
.flt input, .flt select {
  height: 32px; border: none; background: transparent; outline: none; font-size: 12px;
}
.flt label input { width: 58px; }
.search-wrap {
  display: inline-flex; align-items: center; gap: 6px; height: 32px;
  background: #121214; border: 1px solid rgba(255,255,255,.06); border-radius: 8px; padding: 0 8px;
}
.search-wrap input { width: 90px; height: 30px; border: none; background: transparent; outline: none; }
.flt select {
  width: 40px; border: 1px solid rgba(255,255,255,.06); border-radius: 8px; background: #121214; text-align: center;
}
.panel-b {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px; padding: 12px; overflow: auto; max-height: 440px; align-content: start; flex: 1;
}

.card {
  background: linear-gradient(180deg, #24252b, #17181c);
  border: 1px solid rgba(255,255,255,.04); border-radius: 12px;
  padding: 10px 8px 12px; text-align: center; cursor: pointer; position: relative; min-height: 128px;
  overflow: hidden;
  transition: border-color .15s, transform .12s;
}
.card:hover { border-color: rgba(251,213,6,.35); transform: translateY(-1px); }
.card.on { border-color: var(--y); box-shadow: 0 0 0 1px var(--y); }
.card .pr {
  color: var(--y); font-weight: 800; font-size: 12px; margin-bottom: 4px;
  display: inline-flex; align-items: center; gap: 4px; justify-content: center;
}
.card img { width: 92px; height: 62px; object-fit: contain; margin: 0 auto 6px; }
.card .nm { font-size: 10px; color: #c8c8c8; height: 26px; overflow: hidden; line-height: 1.25; }
.card::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--rarity, #4b69ff);
  box-shadow: 0 0 14px var(--rarity, #4b69ff);
}
.r-milspec { --rarity: #4b69ff; }
.r-restricted { --rarity: #8847ff; }
.r-classified { --rarity: #d32ce6; }
.r-covert { --rarity: #eb4b4b; }
.r-rare { --rarity: #e4ae39; }
.r-industrial { --rarity: #5e98d9; }
.r-base { --rarity: #b0c3d9; }

.empty {
  grid-column: 1 / -1; text-align: center; padding: 48px 12px; color: var(--muted);
  position: relative; min-height: 200px;
}
.hint {
  display: inline-block; margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: rgba(0,0,0,.75); border: 1px solid rgba(251,213,6,.4);
  color: var(--y); font-weight: 700; font-size: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.cta {
  display: inline-flex; height: 38px; padding: 0 14px; border-radius: 10px; border: none;
  background: var(--grad); color: #111; font-weight: 800; align-items: center;
}

/* profile */
.profile { width: min(1180px, 100%); margin: 0 auto; padding: 16px 14px 24px; flex: 1; }
.vip {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--box); border: 1px solid rgba(255,255,255,.04); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 12px; font-weight: 800;
}
.pcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .pcards { grid-template-columns: 1fr; } }
.pc {
  background: var(--box); border: 1px solid rgba(255,255,255,.04); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.pc:first-child { flex-direction: row; align-items: center; flex-wrap: wrap; }
.bigav { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(251,213,6,.35); }
.pn { font-size: 18px; font-weight: 800; }
.pid { font-size: 12px; color: var(--muted); }
.pbal { font-size: 32px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.pnum { font-size: 28px; font-weight: 800; color: var(--y); }
.ghost {
  height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.08);
  background: transparent; color: #ccc; font-weight: 700;
}

.footer {
  margin-top: auto; border-top: 1px solid var(--line); background: var(--header);
  padding: 24px 14px; color: var(--muted); font-size: 12px;
}
.fg {
  width: min(1180px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px;
}
@media (max-width: 800px) { .fg { grid-template-columns: 1fr; } }
.footer h4 { margin: 0 0 8px; color: #fff; font-size: 13px; }
.copy { opacity: .7; }

.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(251,213,6,.4);
}
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90;
  min-width: 240px; background: #1c1d22; border: 1px solid #2a2c33; border-radius: 12px;
  padding: 12px 16px; text-align: center;
}
.toast.win { border-color: rgba(251,213,6,.45); }
.toast.lose { border-color: rgba(194,0,0,.45); }
.modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.65);
  display: grid; place-items: center; padding: 16px;
}
.modal-card {
  width: min(400px, 100%); background: #1c1d22; border: 1px solid #2a2c33;
  border-radius: 16px; padding: 18px;
}
.modal-card h2 { margin: 0 0 6px; }
.modal-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.amts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.amts button {
  height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.06); background: #121214; font-weight: 700;
}
.amts button.on { border-color: var(--y); color: var(--y); }
.modal-card input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid #2a2c33; background: #121214; padding: 0 12px;
}
.macts { display: flex; gap: 8px; margin-top: 12px; }
.macts button { flex: 1; height: 42px; }
