:root {
  color-scheme: dark;
  --canvas: #a9a9a9;
  --surface: #1d1d1d;
  --surface-raised: #242424;
  --surface-soft: #151515;
  --line: rgba(255, 255, 255, .12);
  --line-blue: rgba(112, 199, 247, .35);
  --text: #f5f5f5;
  --muted: #aaa;
  --blue: #58b7ee;
  --blue-bright: #8fd2f7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-family: "Space Grotesk", sans-serif;
}
button, input { font: inherit; }
#dashboard-stars {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .16;
  filter: grayscale(1);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.dashboard-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 42px;
}
.side-panel {
  position: sticky;
  top: 18px;
  display: flex;
  height: calc(100vh - 36px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px 16px;
  background:
    radial-gradient(circle at 50% 0, rgba(63, 161, 226, .14), transparent 30%),
    #111;
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 18px 50px rgba(0,0,0,.17);
}
.dashboard-brand { display: grid; place-items: center; min-height: 76px; }
.dashboard-brand img { width: 150px; height: 68px; object-fit: contain; }
.side-panel nav { display: grid; gap: 6px; margin-top: 38px; }
.side-panel nav a, .back-link {
  border-radius: 12px;
  padding: 12px 14px;
  color: #999;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .2s, background .2s, transform .2s;
}
.side-panel nav a:hover { color: #fff; background: #292929; transform: translateX(3px); }
.side-panel nav a.active { color: #071827; background: var(--blue); }
.back-link {
  margin-top: auto;
  border: 1px solid var(--line);
  color: #bbb;
  font-size: 10px;
  text-align: center;
}
.back-link:hover { color: #fff; border-color: var(--line-blue); }

main { min-width: 0; padding-bottom: 50px; }
.dashboard-header {
  position: relative;
  display: flex;
  min-height: 270px;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: clamp(32px, 5vw, 64px);
  background:
    radial-gradient(circle at 16% 92%, rgba(47, 155, 234, .22), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(72, 168, 235, .12), transparent 28%),
    var(--surface);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 20px 55px rgba(0,0,0,.15);
}
.dashboard-header::after {
  position: absolute;
  right: -80px;
  bottom: -160px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(118, 201, 247, .2);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 80px rgba(52, 157, 226, .12);
}
.dashboard-header > * { position: relative; z-index: 1; }
.kicker {
  margin: 0 0 10px;
  color: var(--blue-bright);
  font: 500 10px "DM Mono", monospace;
  letter-spacing: .14em;
}
.dashboard-header h1, .terminal-panel h2 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  letter-spacing: .02em;
}
.dashboard-header h1 {
  max-width: 650px;
  font-size: clamp(46px, 6.2vw, 82px);
  line-height: .9;
  background: linear-gradient(175deg, #fff, #d5d5d5 62%, #888);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.status {
  margin: 14px 0 18px;
  border-radius: 14px;
  padding: 13px 17px;
  color: #383838;
  background: rgba(255,255,255,.32);
  font: 500 11px/1.5 "DM Mono", monospace;
}

.wallet-button, .secondary-button, .icon-button {
  border: 0;
  border-radius: 15px;
  padding: 14px 19px;
  color: #071827;
  background: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.wallet-button:hover {
  background: var(--blue-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(57, 161, 229, .22);
}
.wallet-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .42; transform: none; }
.secondary-button {
  border: 1px solid rgba(255,255,255,.27);
  color: #eee;
  background: rgba(255,255,255,.04);
}
.secondary-button:hover { border-color: var(--line-blue); background: rgba(83,177,236,.1); }
.icon-button { padding: 8px 12px; color: var(--blue-bright); background: #111; font-size: 19px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-grid article, .terminal-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 14px 35px rgba(0,0,0,.11);
}
.stat-grid article {
  min-height: 154px;
  padding: 22px;
  background: linear-gradient(145deg, #282828, #181818);
}
.stat-grid article::after {
  position: absolute;
  right: -28px;
  bottom: -55px;
  width: 125px;
  height: 125px;
  border: 1px solid rgba(103, 190, 241, .2);
  border-radius: 50%;
  content: "";
}
.stat-grid span, .stat-grid small { display: block; color: var(--muted); font-size: 11px; }
.stat-grid strong {
  display: block;
  margin: 20px 0 5px;
  color: #fff;
  font: 400 34px "Bebas Neue", sans-serif;
  letter-spacing: .03em;
}
.stat-grid article:nth-child(2) strong { color: var(--blue-bright); }

.terminal-panel { margin-top: 18px; padding: clamp(24px, 3vw, 38px); }
.terminal-panel::before {
  position: absolute;
  top: 0;
  left: 8%;
  width: 42%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(121, 202, 247, .65), transparent);
}
.panel-title { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.panel-title h2, .terminal-panel h2 { font-size: clamp(30px, 3.5vw, 42px); }
.live-dot {
  border: 1px solid var(--line-blue);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--blue-bright);
  font: 9px "DM Mono", monospace;
}
.asset-tabs {
  display: grid;
  max-width: 160px;
  margin-top: 28px;
  border-radius: 14px;
  padding: 4px;
  background: #0d0d0d;
}
.asset-tab {
  border: 0;
  border-radius: 10px;
  padding: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}
.asset-tab.active { color: #071827; background: var(--blue-bright); }
.deposit-panel {
  background:
    radial-gradient(circle at 90% 18%, rgba(50,153,224,.15), transparent 28%),
    var(--surface);
}
.deposit-panel label {
  display: grid;
  gap: 10px;
  max-width: 720px;
  margin-top: 27px;
  color: var(--muted);
  font: 11px "DM Mono", monospace;
}
.amount-input {
  display: flex;
  border-bottom: 1px solid rgba(137, 208, 247, .35);
  padding-bottom: 10px;
}
.amount-input input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: 400 56px "Bebas Neue", sans-serif;
  letter-spacing: .04em;
}
.amount-input b { align-self: end; padding-bottom: 9px; color: var(--blue-bright); font-size: 13px; }
.plan-result {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 17px;
  align-items: center;
  max-width: 720px;
  margin-top: 24px;
  border: 1px solid var(--line-blue);
  border-radius: 16px;
  padding: 17px;
  background: linear-gradient(100deg, rgba(53,153,220,.17), rgba(255,255,255,.025));
}
.plan-result span { color: #c5e8fa; font: 10px "DM Mono", monospace; }
.plan-result strong { color: var(--blue-bright); font: 400 36px "Bebas Neue", sans-serif; }
.plan-result small { font: 600 10px "Space Grotesk", sans-serif; }
.plan-result p { margin: 0; color: var(--muted); font-size: 11px; }
.deposit-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.form-message, .muted { color: var(--muted); font-size: 12px; line-height: 1.7; }

.position-list, .history-list { display: grid; gap: 10px; margin-top: 22px; }
.position {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-soft);
}
.position b, .position strong { color: #fff; }
.position small { display: block; margin-top: 5px; color: var(--muted); }
.position strong { color: var(--blue-bright); }
.empty-state { margin: 0; color: var(--muted); font-size: 13px; }
.lower-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 18px; }
.lower-grid .terminal-panel { margin-top: 18px; }
.rule {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.rule b { color: #fff; }
.rule strong, .team-metrics b { color: var(--blue-bright); }
.team-metrics { display: grid; gap: 10px; margin-top: 20px; }
.team-metrics span, .identity-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
  color: var(--muted);
  font-size: 12px;
}
.identity-row { margin-top: 18px; }
.identity-row b { color: var(--text); overflow-wrap: anywhere; text-align: right; }
.referral-link { display: flex; gap: 10px; margin-top: 18px; }
.referral-link input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  color: var(--text);
  background: #121212;
  font: 11px "DM Mono", monospace;
}
.history-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}
.history-row b { color: var(--text); text-align: right; }
.history-row span { min-width: 0; overflow-wrap: anywhere; }
.history-row a, .identity-row a {
  color: var(--blue-bright);
  text-decoration-color: rgba(143,210,247,.4);
  text-underline-offset: 3px;
}
.list-heading {
  margin: 25px 0 0;
  color: #ddd;
  font-size: 13px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.transaction-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

@media (max-width: 1050px) {
  .dashboard-shell { grid-template-columns: 1fr; width: min(100% - 24px, 900px); padding-top: 12px; }
  .side-panel {
    position: sticky;
    z-index: 10;
    top: 8px;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-radius: 20px;
    padding: 9px 13px;
  }
  .dashboard-brand { min-height: 46px; }
  .dashboard-brand img { width: 105px; height: 44px; }
  .side-panel nav, .back-link { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .dashboard-header { min-height: 350px; align-items: flex-start; flex-direction: column; border-radius: 27px; padding: 35px 25px; }
  .dashboard-header .wallet-button { width: 100%; margin-top: auto; }
  .terminal-panel { border-radius: 22px; padding: 24px 19px; }
  .transaction-columns { grid-template-columns: 1fr; }
  .plan-result { grid-template-columns: 1fr 1fr; }
  .plan-result p { grid-column: 1 / -1; }
  .identity-row { align-items: start; flex-direction: column; }
  .identity-row b { text-align: left; }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-grid article { min-height: 130px; }
  .panel-title { align-items: start; flex-direction: column; }
  .amount-input input { font-size: 46px; }
  .position { grid-template-columns: 1fr; }
  .position .secondary-button { width: 100%; }
  .referral-link, .history-row { align-items: start; flex-direction: column; }
  .history-row b { text-align: left; }
}
