:root {
  --bg: #0c0d10;
  --panel: #14161b;
  --border: #262932;
  --text: #e6e7ea;
  --muted: #9aa0aa;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #f59e0b;
  --ring: #2563eb;
  --tile-bg-neutral: #131a26;
  --tile-border: #1e2a3d;
  --tile-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  --tile-w: 224px;
  --tile-h: 95px;
  --grid-gap: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  background: #000000;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 14px/1.4 'BloHunter Sans', 'Selawik', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

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

/* === Coin Icon === */
.coin-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.coin-icon {
  display: inline-block;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}
/* 3.294.0: a builder-dex coin's letter icon (showcase.js createCoinIcon): the first letter of its own name in a ring;
   its icon is never looked up by its bare ticker (xyz:CVX is not CVX) */
.coin-icon.coin-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1.5px solid currentColor;
  color: #cbd5e1;
  font-weight: 700;
  line-height: 1;
}

/* === Layout & Header === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: #080c14;
  border-bottom: 1px solid var(--border-card, rgba(255, 255, 255, 0.11));
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.brand-badge {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.5);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: box-shadow 0.15s ease, filter 0.15s ease;
}

.brand-badge:hover,
.brand-badge:focus-visible {
  filter: brightness(1.12);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.75);
  outline: none;
}

.brand-pro {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

#feedPill.delivery-pill[data-state='red'] {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

#feedPill.delivery-pill[data-state='red'] .feed-label {
  color: #fcd34d;
}

#feedPill.delivery-pill[data-state='red'] .pulse-dot {
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

#showcaseTape .tape-item {
  cursor: pointer;
  transition: filter 0.15s ease;
}

#showcaseTape .tape-item:hover {
  filter: brightness(1.18);
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  z-index: 1;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  border-radius: 6px;
  background: #121824;
  border: 1px solid #1f2a3a;
  color: #93a4b2;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.icon-btn:hover {
  filter: brightness(1.1);
}

.sound-btn {
  position: relative;
  border-color: #1f2a3a;
  background: #121824;
  color: #9aa4b2;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.sound-btn[data-state='on'],
.sound-btn[data-state='locked'] {
  border-color: rgba(34, 197, 94, 0.38);
  background: #14302c;
  color: #bbf7d0;
}

.sound-btn-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f59e0b;
}

.sound-btn[data-state='locked'] {
  animation: soundLockedPulse 1.8s ease-in-out infinite;
}

@keyframes soundLockedPulse {
  0%,
  100% {
    border-color: rgba(34, 197, 94, 0.38);
    background: #14302c;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    border-color: rgba(239, 68, 68, 0.7);
    background: #351f29;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sound-btn[data-state='locked'] {
    animation: none;
    border-color: rgba(239, 68, 68, 0.7);
  }
}

.signin-btn {
  height: 26px;
  padding: 0 12px;
  border-radius: 6px;
  background: #2563eb;
  border: 1px solid #3b82f6;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-text, 'BloHunter Sans', 'Selawik', sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.signin-btn:hover,
.signin-btn:focus-visible {
  background: #1d4ed8;
  border-color: #60a5fa;
  filter: brightness(1.06);
  outline: none;
}

/* === Main Container & Grid === */
main {
  flex: 1;
  padding: 4px 16px 8px;
  position: relative;
  z-index: 1;
}

.grid-split {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.btc-chart-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.btc-tick-chart-wrap {
  position: absolute;
  top: 0;
  left: -10px;
  right: -10px;
  bottom: 0;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.95) 15%,
    rgba(0, 0, 0, 0.95) 85%,
    rgba(0, 0, 0, 0.15) 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.95) 15%,
    rgba(0, 0, 0, 0.95) 85%,
    rgba(0, 0, 0, 0.15) 100%
  );
}

.btc-tick-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.tile-zone {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 68px;
  grid-auto-flow: dense;
  gap: 10px;
  width: 100%;
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.tile-zone > .tile,
.tile-zone > .tile-chart-wrapper {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 68px;
}

.tile-chart-wrapper > .tile {
  width: 100%;
  height: 100%;
}

@media (max-width: 960px) {
  .tile-zone {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .tile-zone {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .tile-zone {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* === Section Separators === */
.section-separator {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 0;
  margin: 2px 0 0;
  position: relative;
  z-index: 1;
}

.section-separator--first {
  margin-top: 2px;
}

.section-separator__title {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 auto;
  grid-column: 1;
  grid-row: 1;
  background: transparent;
  padding: 0 10px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-separator__img {
  height: 13px;
  width: auto;
  display: block;
  opacity: 0.92;
  user-select: none;
  pointer-events: none;
}

.section-separator__line {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  height: 2px;
  background: linear-gradient(90deg, rgba(100, 120, 160, 0.45), rgba(100, 120, 160, 0.25) 70%, transparent);
  border-radius: 1px;
}

/* === Tiles (ACTIVE SETUPS) === */
.tile {
  position: relative;
  height: 68px;
  box-sizing: border-box;
  border-radius: 12px;
  padding: 8px 10px 12px;
  background: var(--tile-bg-neutral);
  border: 1px solid var(--tile-border);
  box-shadow: var(--tile-shadow);
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
  overflow: hidden;
  cursor: pointer;
}

.tile:hover {
  border-color: #2b3545;
  transform: translateY(-1px);
}

.tile.active-card {
  position: relative;
  border-color: #2a8cff !important;
  box-shadow: 0 0 0 1px rgba(42, 140, 255, .35), 0 6px 18px rgba(0, 0, 0, .35);
}

.tile.active-card.long-A {
  background: radial-gradient(120% 120% at 100% 0%, rgba(22, 199, 132, 0.20) 0%, rgba(22, 199, 132, 0.08) 55%, rgba(19, 26, 38, 0.95) 100%);
  border-color: rgba(22, 199, 132, 0.55) !important;
}

.tile.active-card.short-A {
  background: radial-gradient(120% 120% at 100% 0%, rgba(239, 68, 68, 0.20) 0%, rgba(239, 68, 68, 0.08) 55%, rgba(19, 26, 38, 0.95) 100%);
  border-color: rgba(239, 68, 68, 0.55) !important;
}

/* Entry Transition Effects */
.long-entry-text,
.short-entry-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  z-index: 20;
}

.tile.long-entry-transition {
  position: relative;
  border-color: #22c55e !important;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4) !important;
}

.tile.long-entry-transition::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(34, 197, 94, 0.1),
      rgba(34, 197, 94, 0.1) 4px,
      rgba(22, 163, 74, 0.18) 4px,
      rgba(22, 163, 74, 0.18) 8px
    ),
    rgba(20, 83, 45, 0.65);
  z-index: 15;
  pointer-events: none;
}

.long-entry-text {
  color: #4ade80;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  animation: entryBlink 0.8s ease-in-out infinite;
}

.tile.short-entry-transition {
  position: relative;
  border-color: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4) !important;
}

.tile.short-entry-transition::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(239, 68, 68, 0.1),
      rgba(239, 68, 68, 0.1) 4px,
      rgba(220, 38, 38, 0.18) 4px,
      rgba(220, 38, 38, 0.18) 8px
    ),
    rgba(127, 29, 29, 0.65);
  z-index: 15;
  pointer-events: none;
}

.short-entry-text {
  color: #f87171;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: entryBlink 0.8s ease-in-out infinite;
}

@keyframes entryBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Tile Header */
.tile .head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
  position: relative;
  padding-right: 18px;
  margin: 0;
  padding-top: 2px;
  line-height: 1.06;
  z-index: 1;
}

.sym {
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text);
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
}

.bias {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 6px;
  border: 1px solid #223049;
  color: var(--text);
  opacity: .9;
}

.bias.long {
  border-color: #1e3a2f;
  color: var(--green);
}

.bias.short {
  border-color: #3a1e1e;
  color: var(--red);
}

/* Tile Actions Cluster */
.tile .actions-cluster {
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min-content;
  align-items: flex-start;
  gap: 6px;
  pointer-events: auto;
  height: auto;
  z-index: 10;
}

.tile .actions-cluster .heatbox-cluster {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, min-content);
  grid-auto-rows: min-content;
  gap: 2px;
  align-self: start;
  margin-top: 0;
}

.tile .actions-cluster .dial-cluster {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  row-gap: 3px;
  justify-content: flex-start;
  align-self: start;
  margin-top: 0;
}

/* Price Display */
.price-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.price {
  margin: 0;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.price.up {
  color: var(--green);
}

.price.down {
  color: var(--red);
}

.mini {
  line-height: 1;
  margin: 0;
  min-height: 14px;
}

.mini .pct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}

.mini .pct.up {
  color: #10b981;
}

.mini .pct.down {
  color: #ef4444;
}

.mini .pct .arrow {
  font-size: 0.85em;
  line-height: 1;
}

/* Heat Bar */
.heat {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 6px;
  background: rgba(255, 255, 255, .04);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.5rem;
  z-index: 1;
}

.heat .threshold-50 {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 1;
}

.heat .fill {
  position: relative;
  height: 100%;
  width: 0%;
  background: #6e7bff;
  z-index: 2;
}

.heat .fill.long {
  background: rgba(0, 190, 120, .75);
}

.heat .fill.short {
  background: rgba(220, 40, 40, .75);
}

.heat .fill.neutral {
  background: #5b6a85;
}

.heat .afterglow {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 20%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15));
  opacity: var(--afterglow-alpha, 0);
  transition: opacity 0.3s ease;
  z-index: 4;
  pointer-events: none;
}

/* === Dial (Countdown) === */
.dial {
  width: 14px;
  height: 14px;
  opacity: .9;
  pointer-events: none;
}

.dial svg {
  width: 14px;
  height: 14px;
  transform: rotate(-90deg);
}

.dial-bg {
  stroke: rgba(255, 255, 255, .12);
  stroke-width: 2;
  fill: none;
}

.dial-fg {
  stroke: var(--ring);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  transition: stroke-dashoffset .3s linear;
}

.heat-dial .dial-fg {
  stroke: #66d1ff;
}

/* === Heat Boxes === */
.heatboxes {
  display: inline-grid;
  align-items: center;
  grid-gap: 3px;
}

.heatboxes.quincunx {
  grid-template-columns: repeat(2, 9px);
  grid-auto-rows: 9px;
  grid-auto-flow: row dense;
}

.heatboxes.quincunx > .heatbox:nth-child(5) {
  grid-column: 2;
  grid-row: 3;
}

.heatbox {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  box-sizing: border-box;
  background: transparent;
}

.heatbox--outline {
  border: 1.5px solid var(--ring);
  opacity: 0.65;
}

.heatbox--long {
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.heatbox--short {
  background: var(--red);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.heatbox--glow {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04), 0 0 10px 2px rgba(102, 178, 255, 0.35);
}

/* === Empty / Muted State === */
.showcase-empty {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
  opacity: 0.75;
}

/* === Open Positions Panel, Recent Exits Panel & 2x2 Rotating/Spotlight Chart Grid === */
.showcase-positions-panel,
.showcase-exits-panel {
  margin-top: 0;
}

.showcase-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 0;
  align-items: stretch;
}

.showcase-chart-card {
  min-width: 0;
  transition: border-color 180ms ease;
}

.showcase-chart-card[data-spotlight='long'] {
  border-color: rgba(34, 197, 94, 0.55);
}

.showcase-chart-card[data-spotlight='short'] {
  border-color: rgba(239, 68, 68, 0.55);
}

.showcase-chart-canvas {
  position: relative;
  width: 100%;
  height: 300px !important;
  min-height: 300px !important;
  border-radius: 8px;
  overflow: hidden;
  background: #0b0f19;
  transition: box-shadow 0.15s ease;
}

.showcase-chart-canvas[data-chart-active='true'] {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.showcase-chart-canvas .chart-rotate-pause {
  z-index: 6;
}

.showcase-sym-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

@media (max-width: 1024px) {
  .showcase-charts-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* === Responsive Adjustments === */
@media (max-width: 600px) {
  .topbar {
    gap: 6px !important;
    padding-top: 3px !important;
    flex-wrap: nowrap !important;
    z-index: 100;
  }

  .header-right {
    gap: 6px !important;
  }

  .showcase-chart-canvas {
    height: 260px !important;
    min-height: 260px !important;
  }
}

/* === Recent Exits 48h Expand Toggle === */
.showcase-exits-expand-wrap {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.showcase-exits-expand-wrap[hidden] {
  display: none !important;
}

.showcase-exits-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 16, 24, 0.9);
  color: #7dd3fc;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.showcase-exits-toggle:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.65);
  color: #e0f2fe;
}

/* === Live AI Intelligence Section (delegates card/badge palette to terminal.css .ai-intel-*) === */
.showcase-ai-panel {
  margin-top: 0;
}

/* 3.315.0: Single canonical Powered by ✦ Gemini header brand badge (1:1 normalized with app.blobrowser.com #userAiModel) */
.gemini-powered-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  white-space: nowrap;
  font-family: var(--font-text, 'BloHunter Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.gemini-powered-badge .gemini-powered-prefix {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.gemini-powered-badge .gemini-powered-spark {
  width: 13px;
  height: 13px;
  min-width: 13px;
  min-height: 13px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.gemini-powered-badge .gemini-powered-name {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
