@font-face {
  font-family: "Coinbase Sans";
  src: url("/assets/fonts/CoinbaseSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Coinbase Sans";
  src: url("/assets/fonts/CoinbaseSans-Medium.woff2") format("woff2");
  font-weight: 500 650;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Coinbase Sans";
  src: url("/assets/fonts/CoinbaseSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Coinbase Mono";
  src: url("/assets/fonts/CoinbaseMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Coinbase Mono";
  src: url("/assets/fonts/CoinbaseMono-Medium.woff2") format("woff2");
  font-weight: 500 650;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Coinbase Mono";
  src: url("/assets/fonts/CoinbaseMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: "Coinbase Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Coinbase Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 0px;      /* panels, inputs, structural chrome — sharp HL-style corners */
  --radius-sm: 0px;
  --radius-btn: 8px;  /* buttons stay rounded */
  font-family: var(--sans);
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1418;
  --surface: #101b21;
  --surface-2: #152229;
  --surface-3: #1d2e37;
  --ink: #eef6f4;
  --muted: #8ba3a0;
  --dim: #58707590;
  --line: #2b4450;
  --line-strong: #40616f;
  --shadow: rgba(0, 0, 0, 0.3);
  --overlay: rgba(12, 21, 26, 0.94);
  --bull: #4fd1b5;
  --bull-soft: rgba(79, 209, 181, 0.1);
  --bull-line: rgba(79, 209, 181, 0.35);
  --bear: #ef707f;
  --bear-soft: rgba(239, 112, 127, 0.1);
  --bear-line: rgba(239, 112, 127, 0.35);
  --accent: #4fd1b5;
  --accent-ink: #07211c;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f1;
  --surface: #ffffff;
  --surface-2: #f4f7f6;
  --surface-3: #e7eeec;
  --ink: #13211f;
  --muted: #5e7572;
  --dim: #94a6a3;
  --line: #c3d2ce;
  --line-strong: #9db3ae;
  --shadow: rgba(20, 35, 32, 0.08);
  --overlay: rgba(255, 255, 255, 0.94);
  --bull: #0d9e83;
  --bull-soft: rgba(13, 158, 131, 0.09);
  --bull-line: rgba(13, 158, 131, 0.35);
  --bear: #d8495f;
  --bear-soft: rgba(216, 73, 95, 0.09);
  --bear-line: rgba(216, 73, 95, 0.35);
  --accent: #0d9e83;
  --accent-ink: #ffffff;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

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

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 640px;
}

.panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 72px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand em { color: var(--accent); font-style: italic; }

.nav-tabs { display: flex; gap: 4px; }
.nav-tabs button {
  height: 40px;
  padding: 0 13px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.nav-tabs button:hover { color: var(--ink); }
.nav-tabs button.active { color: var(--accent); font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
a.x-link { text-decoration: none; }

.status-dot,
.live-pulse {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dim);
}
.status-dot.active,
.status-dot.live,
.live-pulse { background: var(--bull); }
.status-dot.result { background: var(--ink); }
.status-dot.reconnecting,
.status-dot.connecting { animation: pulse 1.4s ease-in-out infinite; }
.status-dot.offline { background: var(--bear); }

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.icon-button svg { width: 16px; fill: currentColor; }
.icon-button:hover { color: var(--ink); }

.wallet-button {
  height: 40px;
  max-width: 140px;
  padding: 0 16px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-btn);
  color: var(--accent-ink);
  background: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-button:hover { filter: brightness(1.08); }
.wallet-button.connected { border: 1px solid var(--bull-line); color: var(--accent); background: var(--bull-soft); }

.ca-chip {
  max-width: 150px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ca-chip:hover { color: var(--accent); }

.app-toast {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 320;
  max-width: 380px;
  padding: 13px 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 10px 26px var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.app-toast.visible { opacity: 1; transform: translateY(0); }

/* ---------- Views ---------- */

.view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.view[hidden] { display: none; }
.page-view { align-items: center; overflow: auto; padding: 24px 16px; scrollbar-width: thin; }

/* ---------- Market bar ---------- */

.market-bar {
  display: flex;
  align-items: stretch;
  gap: 14px;
  min-height: 72px;
  padding: 8px 16px 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.token-select-wrap { position: relative; display: flex; }
.token-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 6px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.token-select:hover { background: var(--surface-2); }
.token-select .chevron { width: 14px; color: var(--muted); }
.token-select-copy { display: grid; min-width: 0; gap: 2px; }
.token-select-copy span { overflow: hidden; max-width: 140px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.token-select-copy strong { font-size: 16px; letter-spacing: -.01em; }

.token-avatar-wrap {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}
.token-avatar-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.token-avatar-wrap img[hidden] { display: none; }

.token-dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: 380px;
  max-height: 420px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 44px var(--shadow);
  gap: 8px;
}
.token-dropdown[hidden] { display: none; }

.token-search { display: grid; grid-template-columns: 1fr auto; }
.token-search input,
.token-search button {
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
}
.token-search input { min-width: 0; padding: 0 10px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.token-search button { padding: 0 11px; border-left: 0; border-radius: 0 var(--radius-btn) var(--radius-btn) 0; color: var(--muted); cursor: pointer; }

.picker-message { margin: 0; color: var(--muted); font-size: 11px; }

.token-options { display: grid; min-height: 60px; align-content: start; gap: 2px; overflow: auto; scrollbar-width: thin; }
.token-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.token-option:hover { background: var(--surface-2); }
.token-option.active { border-color: var(--bull-line); background: var(--bull-soft); }
.token-option .option-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); }
.option-copy { display: grid; min-width: 0; gap: 2px; }
.option-copy strong,
.option-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.option-copy strong { font-size: 13px; }
.option-copy span { color: var(--muted); font-size: 11px; }
.token-option > small { color: var(--muted); font: 12px/1 var(--mono); }
.token-option.soon:hover { background: var(--surface-2); }
.token-option.soon .soon-badge {
  padding: 3px 8px;
  border: 1px solid var(--bull-line);
  border-radius: var(--radius-btn);
  color: var(--accent);
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.08em;
}

.token-dropdown-footer { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.token-link { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; text-decoration: none; }
.token-link span { overflow: hidden; font-family: var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.token-link strong { flex: 0 0 auto; color: var(--ink); font-weight: 500; }
.text-button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  color: var(--muted);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 12px;
}
.text-button:hover { color: var(--ink); border-color: var(--line-strong); }

.market-stats {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 22px;
  min-width: 0;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.market-stats > div { display: grid; flex: 0 0 auto; gap: 4px; }
.market-stats dt { color: var(--muted); font-size: 11px; }
.market-stats dd { display: flex; align-items: baseline; gap: 6px; margin: 0; font: 500 14px/1.1 var(--mono); }
.market-stats dd small { color: var(--dim); font-size: 11px; }
.stat-main dd { font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.stat-bull dd b { color: var(--bull); font-weight: 500; }
.stat-bear dd b { color: var(--bear); font-weight: 500; }
.price-change { font-family: var(--mono); font-size: 13px; }
.price-change.positive { color: var(--bull); }
.price-change.negative { color: var(--bear); }
.price-change.neutral { color: var(--muted); }
.round-cell b { font-family: var(--sans); font-size: 13px; font-weight: 600; }
.round-cell small { color: var(--dim); font-size: 11px; }
.clock-cell { font-weight: 600; }

/* ---------- Guide strip ---------- */

.guide-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}
.guide-strip[hidden] { display: none; }
.guide-strip ol { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; }
.guide-strip li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.guide-strip b {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--bull-soft);
  font-size: 11px;
}
.guide-strip > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-strip button { flex: 0 0 auto; border: 0; color: var(--dim); background: none; cursor: pointer; font-size: 17px; line-height: 1; }
.guide-strip button:hover { color: var(--ink); }

/* ---------- Trade grid ---------- */

.trade-grid {
  display: grid;
  flex: 1;
  grid-template-areas: "battle feed order";
  grid-template-columns: minmax(0, 1fr) 310px 350px;
  min-height: 0;
}

.feed-panel,
.order-panel { border-left: 1px solid var(--line); }

.battle-panel { display: grid; grid-area: battle; grid-template-rows: auto minmax(0, 1fr); }
.battle-header {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 320px) 1fr;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.army-score { display: grid; gap: 2px; padding-left: 10px; border-left: 3px solid currentColor; color: var(--bear); }
.army-score span { color: var(--muted); font-size: 12px; }
.army-score strong { font: 600 20px/1 var(--mono); }
.army-score small { color: var(--dim); font-size: 11px; }
.bull-score { justify-items: end; padding-right: 10px; padding-left: 0; border-right: 3px solid currentColor; border-left: 0; color: var(--bull); text-align: right; }

.pressure-center { display: grid; gap: 5px; }
.pressure-copy { display: flex; justify-content: space-between; gap: 10px; }
.pressure-copy strong { font-size: 12.5px; font-weight: 600; }
.pressure-copy small { overflow: hidden; color: var(--dim); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pressure-track { height: 6px; overflow: hidden; border-radius: 99px; background: var(--bear); }
.pressure-track > div { width: 50%; height: 100%; margin-left: auto; background: var(--bull); transition: width .3s ease; }
.pressure-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.pressure-labels span:first-child { color: var(--bear); }
.pressure-labels span:last-child { color: var(--bull); }

.battle-viewport { position: relative; min-height: 0; overflow: hidden; background: #858782; }
#battlefield { display: block; width: 100%; height: 100%; touch-action: none; }
.map-label {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgba(15, 24, 28, 0.66);
  font-size: 12px;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.deploy-label { top: auto; bottom: 12px; left: 50%; transform: translateX(-50%); animation: pulse 1.4s ease-in-out infinite; }
.deploy-label[hidden] { display: none; }

.result-banner {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: grid;
  min-width: 280px;
  justify-items: center;
  padding: 20px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  transform: translate(-50%, -50%);
  background: var(--overlay);
  box-shadow: 0 18px 50px var(--shadow);
  backdrop-filter: blur(12px);
  transition: opacity .2s, transform .2s;
}
.result-banner.hidden { visibility: hidden; opacity: 0; transform: translate(-50%, -46%) scale(.97); }
.result-banner span,
.result-banner small { color: var(--muted); font-size: 12px; }
.result-banner strong { margin: 8px 0; font-size: 30px; }
.result-banner.bull-result strong { color: var(--bull); }
.result-banner.bear-result strong { color: var(--bear); }

/* ---------- Trades feed ---------- */

.feed-panel { display: grid; grid-area: feed; grid-template-rows: auto auto minmax(0, 1fr); }
.feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 12px 9px;
  border-bottom: 1px solid var(--line);
}
.feed-header strong { font-size: 14px; font-weight: 650; }
.feed-header span { color: var(--muted); font-size: 11px; }
.feed-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr .8fr;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.feed-columns span:last-child { text-align: right; }
.trades-feed { display: block; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.feed-empty { margin: 14px 12px; color: var(--dim); font-size: 12px; }
.trade-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr .8fr;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  font: 500 12px/1 var(--mono);
}
.trade-row:hover { background: var(--surface-2); }
.trade-row .trade-price { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-row.buy .trade-price { color: var(--bull); }
.trade-row.sell .trade-price { color: var(--bear); }
.trade-row .trade-size { color: var(--ink); }
.trade-row time { color: var(--dim); text-align: right; }

/* ---------- Order panel ---------- */

.order-panel { display: flex; flex-direction: column; grid-area: order; gap: 10px; padding: 12px; overflow-y: auto; scrollbar-width: thin; }

.timeframe-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.timeframe-control button {
  height: 32px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12.5px;
}
.timeframe-control button.active { color: var(--ink); background: var(--surface-3); font-weight: 600; }
.timeframe-control button:disabled { cursor: default; opacity: .38; }

.side-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-button {
  height: 44px;
  border: 1px solid;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
}
.side-button.bear { color: var(--bear); border-color: var(--bear-line); background: var(--bear-soft); }
.side-button.bull { color: var(--bull); border-color: var(--bull-line); background: var(--bull-soft); }
.side-button.bull.selected { color: var(--accent-ink); border-color: var(--bull); background: var(--bull); }
.side-button.bear.selected { color: #fff; border-color: var(--bear); background: var(--bear); }
.side-button:disabled { cursor: default; opacity: .42; }

.join-caption { margin: 0; color: var(--muted); font-size: 11px; }

.order-info { display: grid; margin: 0; border-top: 1px solid var(--line); }
.order-info > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  border-bottom: 1px solid var(--line);
}
.order-info dt { color: var(--muted); font-size: 11px; }
.order-info dd { margin: 0; font: 500 12.5px/1 var(--mono); }

.stake-row { display: grid; gap: 5px; }
.stake-row label { color: var(--muted); font-size: 11px; }
.stake-row > div { display: grid; grid-template-columns: 1fr auto; }
.stake-row input,
.stake-row button { height: 40px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; }
.stake-row input { min-width: 0; padding: 0 9px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.stake-row button { padding: 0 11px; border-left: 0; border-radius: 0 var(--radius-btn) var(--radius-btn) 0; color: var(--muted); cursor: pointer; }

.primary-action,
.secondary-action {
  min-height: 50px;
  padding: 8px 10px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.primary-action { border: 0; color: var(--accent-ink); background: var(--accent); }
.primary-action:hover:not(:disabled) { filter: brightness(1.08); }
.secondary-action { border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface-2); }
.primary-action:disabled,
.secondary-action:disabled { cursor: default; opacity: .42; }

.fee-message { min-height: 22px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.fee-round-row { display: grid; min-width: 0; gap: 3px; }
.fee-round-row span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.fee-round-row small { color: var(--dim); font-size: 10px; }
.fee-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: var(--surface-2);
  font: 600 10px/1 var(--mono);
  text-transform: uppercase;
}
.fee-badge.eligible { color: var(--bull); border-color: var(--bull-line); background: var(--bull-soft); }
.fee-badge.ineligible { color: var(--bear); border-color: var(--bear-line); background: var(--bear-soft); }

/* ---------- Bottom panel ---------- */

.bottom-panel { display: grid; flex: 0 0 auto; grid-template-rows: auto minmax(0, 1fr) auto; height: 185px; border-top: 1px solid var(--line); }
.bottom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.bottom-header > strong { font-size: 13px; font-weight: 650; }
.profile-stats { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.profile-stats > strong { color: var(--accent); font-weight: 600; }
.profile-stats span { white-space: nowrap; }
.profile-stats b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.profile-stats time { color: var(--dim); font-family: var(--mono); }

.battle-log { display: block; overflow-y: auto; scrollbar-width: thin; }
.log-item {
  display: grid;
  grid-template-columns: 52px 5px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
}
.log-item:hover { background: var(--surface-2); }
.log-time { color: var(--dim); font-family: var(--mono); }
.log-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.log-item.bull .log-dot { background: var(--bull); }
.log-item.bear .log-dot { background: var(--bear); }
.log-text { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.bottom-note { padding: 6px 12px; border-top: 1px solid var(--line); color: var(--dim); font-size: 10px; }

/* ---------- Launchpad + docs pages ---------- */

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  width: min(1020px, 100%);
  gap: 10px;
}
.side-stack { display: grid; gap: 10px; }
.side-card { padding: 18px; border: 1px solid var(--line); }
.side-card h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: -.01em; }
.side-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.side-card ol { display: grid; margin: 0; padding-left: 18px; gap: 8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.side-facts { display: grid; margin: 0; gap: 0; }
.side-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
}
.side-facts div:last-child { border-bottom: 0; }
.side-facts dt { color: var(--muted); font-size: 12.5px; }
.side-facts dd { margin: 0; font: 500 12.5px/1 var(--mono); }

.launch-panel { width: 100%; padding: 20px; border: 1px solid var(--line); }

.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  width: min(1020px, 100%);
  gap: 10px;
}
.docs-nav {
  position: sticky;
  top: 0;
  display: grid;
  padding: 10px;
  border: 1px solid var(--line);
  gap: 2px;
}
.docs-nav a {
  padding: 9px 10px;
  border-radius: var(--radius-btn);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.docs-nav a:hover { color: var(--ink); background: var(--surface-2); }
.docs-panel { width: 100%; padding: 24px 28px; border: 1px solid var(--line); }

.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading > div { display: grid; gap: 3px; }
.panel-heading span { color: var(--muted); font-size: 11px; }
.panel-heading strong { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }

.launch-panel { display: grid; align-content: start; gap: 12px; }
.launch-note { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.launch-form { display: grid; gap: 11px; }
.launch-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.launch-form input,
.launch-form textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13.5px;
}
.launch-form textarea { resize: vertical; font-family: var(--sans); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 8px; }
.launch-form .image-field {
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.image-field input { display: none; }
.image-preview {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--dim);
  background: var(--surface-3) center / cover no-repeat;
  font-size: 21px;
}
.image-copy { display: grid; min-width: 0; gap: 3px; }
.image-copy strong { color: var(--ink); font-size: 12.5px; }
.image-copy small { overflow: hidden; color: var(--dim); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.launch-links { display: grid; gap: 8px; }
.launch-links summary { color: var(--muted); cursor: pointer; font-size: 12px; }
.sol-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.sol-input input { min-width: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.sol-input > span {
  display: grid;
  place-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
}
.link-preview {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.link-preview[hidden] { display: none; }

.launch-warning {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--bear-line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--bear-soft);
  font-size: 11px;
  line-height: 1.5;
}

.docs-panel { color: var(--muted); font-size: 14px; line-height: 1.7; }
.docs-panel h1 { margin: 0 0 12px; color: var(--ink); font-size: 24px; letter-spacing: -.02em; }
.docs-panel h2 { margin: 26px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink); font-size: 17px; }
.docs-panel p { margin: 0 0 10px; }
.docs-panel b { color: var(--ink); font-weight: 600; }
.docs-panel ol { display: grid; margin: 0 0 10px; padding-left: 20px; gap: 6px; }
.docs-panel table { width: 100%; margin: 6px 0 12px; border: 1px solid var(--line); border-collapse: collapse; }
.docs-panel th,
.docs-panel td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: left; }
.docs-panel th { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.docs-panel td { font-family: var(--mono); }
.docs-panel tr:last-child td { border-bottom: 0; }

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 10, 12, 0.58);
  backdrop-filter: blur(3px);
}
.intro-overlay[hidden] { display: none; }
.intro-panel {
  position: relative;
  width: min(620px, 100%);
  max-height: 92dvh;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 24px 60px var(--shadow);
  scrollbar-width: thin;
}
.intro-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  color: var(--dim);
  background: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.intro-close:hover { color: var(--ink); }
.intro-panel h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -.01em; }
.intro-lede { margin: 0 0 16px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.intro-lede[hidden] { display: none; }
.intro-steps { margin-bottom: 16px; }
.intro-steps figure { display: none; margin: 0; }
.intro-steps figure.active { display: grid; gap: 12px; }
.intro-steps img {
  display: block;
  width: 100%;
  max-width: 420px;
  justify-self: center;
  border: 1px solid var(--line);
  background: #0b1418;
}
.intro-steps figcaption { color: var(--ink); font-size: 16px; line-height: 1.55; }
.intro-note {
  margin: 0 0 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.55;
}
.intro-note[hidden] { display: none; }
.intro-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.intro-nav .primary-action,
.intro-nav .secondary-action { min-width: 88px; }
.intro-dots { display: flex; gap: 5px; }
.intro-dots button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}
.intro-dots button.active { color: var(--accent); border-color: var(--bull-line); background: var(--bull-soft); font-weight: 600; }

@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
  .trade-grid { grid-template-columns: minmax(0, 1fr) 280px 320px; }
  .market-stats { gap: 16px; }
}

@media (max-width: 1100px) {
  .trade-grid {
    grid-template-areas: "battle order" "feed order";
    grid-template-columns: minmax(0, 1fr) 330px;
    grid-template-rows: minmax(0, 1fr) 190px;
  }
  .feed-panel { border-top: 1px solid var(--line); border-left: 0; }
  .nav-tabs button { padding: 0 10px; }
}

@media (max-width: 880px) {
  html,
  body { height: auto; overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100dvh; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 8px 12px; }
  .topbar-actions { gap: 8px; }
  .view { display: block; }
  .view[hidden] { display: none; }
  .market-bar { flex-direction: column; gap: 10px; padding: 10px 12px; }
  .token-select { border-right: 0; padding: 4px; }
  .token-dropdown { width: min(330px, calc(100vw - 40px)); }
  .trade-grid { display: grid; grid-template-areas: "battle" "order" "feed"; grid-template-columns: 1fr; grid-template-rows: auto; }
  .feed-panel,
  .order-panel { border-top: 1px solid var(--line); border-left: 0; }
  .battle-viewport { min-height: 430px; aspect-ratio: 4 / 5; }
  .battle-header { grid-template-columns: 1fr 1fr; }
  .pressure-center { display: none; }
  .feed-panel { min-height: 240px; }
  .trades-feed { max-height: 240px; }
  .bottom-panel { height: auto; min-height: 185px; }
  .battle-log { max-height: 170px; }
  .guide-strip { align-items: flex-start; flex-direction: column; gap: 8px; }
  .guide-strip ol { flex-direction: column; gap: 6px; }
  .guide-strip > span { white-space: normal; }
  .guide-strip button { position: absolute; top: 8px; right: 10px; }
  .profile-stats { flex-wrap: wrap; }
  .page-view { padding: 12px; }
  .page-grid,
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
