:root {
  --bg-0: #05070e;
  --bg-1: #0b0f1c;
  --panel: rgba(7, 12, 25, 0.76);
  --panel-border: rgba(69, 255, 199, 0.38);
  --panel-border-soft: rgba(88, 154, 255, 0.26);
  --text-main: #ebf7ff;
  --text-soft: #89a1c5;
  --neon-cyan: #45ffc7;
  --neon-blue: #58a9ff;
  --neon-hot: #52d5ff;
  --neon-red: #ff5f8f;
  --shadow-neon: 0 0 0.8rem rgba(82, 213, 255, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text-main);
  background: radial-gradient(circle at 15% 20%, #111932 0%, var(--bg-0) 45%),
    radial-gradient(circle at 85% 20%, #171339 0%, transparent 55%),
    radial-gradient(circle at 50% 100%, #082934 0%, var(--bg-0) 55%);
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

.bg-noise,
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-noise {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0.6px, transparent 0.6px);
  background-size: 6px 6px;
  opacity: 0.15;
}

.bg-grid {
  background-image: linear-gradient(rgba(95, 141, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 141, 255, 0.1) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at 50% 40%, black 45%, transparent 92%);
}

.war-room-wrap {
  position: relative;
  z-index: 1;
  width: min(1220px, 100% - 2rem);
  margin: 1rem auto 2.5rem;
}

.panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(14, 19, 35, 0.88), var(--panel));
  border: 1px solid var(--panel-border-soft);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 0 0.8rem rgba(47, 179, 255, 0.24), inset 0 0 0.4rem rgba(69, 255, 199, 0.2);
}

.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(84, 255, 209, 0.08) 50%, transparent 70%);
  transform: translateX(-140%);
  animation: panelSweep 5s linear infinite;
  pointer-events: none;
}

@keyframes panelSweep {
  to {
    transform: translateX(140%);
  }
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.3rem;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--neon-cyan);
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
  text-shadow: var(--shadow-neon);
}

.subtitle {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
}

.hero-actions {
  text-align: right;
}

.spin-btn {
  border: 1px solid var(--panel-border);
  background: linear-gradient(90deg, rgba(66, 255, 201, 0.2), rgba(88, 169, 255, 0.3));
  color: white;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 0 0.75rem rgba(69, 255, 199, 0.4);
}

.spin-btn:hover {
  transform: translateY(-1px);
}

.spin-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.updated,
.disclaimer {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.disclaimer {
  color: #ffb1c9;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.9rem;
}

.price-panel {
  grid-column: span 4;
}

.bull-panel {
  grid-column: span 4;
}

.ai-panel {
  grid-column: span 4;
}

.trade-panel {
  grid-column: span 12;
}

.chart-panel,
.meme-panel {
  grid-column: span 12;
}

.smart-panel {
  grid-column: span 8;
}

.alerts-panel {
  grid-column: span 4;
}

.panel-label {
  margin: 0;
  color: var(--text-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.price-row {
  margin-top: 0.55rem;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}

.price-value {
  margin: 0;
  font-size: clamp(1.45rem, 3.4vw, 2.2rem);
  font-weight: 800;
}

.price-change {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(88, 169, 255, 0.45);
  color: var(--neon-blue);
}

.price-change.is-down {
  color: var(--neon-red);
  border-color: rgba(255, 95, 143, 0.45);
}

.bull-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.bull-score {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--neon-cyan);
}

.meter-track {
  margin-top: 0.7rem;
  width: 100%;
  height: 0.86rem;
  border-radius: 999px;
  background: rgba(30, 48, 78, 0.62);
  border: 1px solid rgba(88, 169, 255, 0.35);
  overflow: hidden;
}

.meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5f8f 0%, #ffd24c 50%, #45ffc7 100%);
  box-shadow: 0 0 0.7rem rgba(69, 255, 199, 0.55);
  transition: width 320ms ease;
}

.meter-hints {
  margin-top: 0.45rem;
  display: flex;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.chart-meta {
  margin: 0.24rem 0 0;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.tf-switch {
  display: flex;
  border: 1px solid rgba(88, 169, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
}

.tf-switch button {
  border: 0;
  border-right: 1px solid rgba(88, 169, 255, 0.25);
  background: rgba(15, 21, 38, 0.85);
  color: var(--text-soft);
  padding: 0.45rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.tf-switch button:last-child {
  border-right: 0;
}

.tf-switch button.is-active {
  color: white;
  background: linear-gradient(90deg, rgba(69, 255, 199, 0.3), rgba(88, 169, 255, 0.38));
}

.chart {
  width: 100%;
  height: 340px;
}

.ai-read {
  margin: 0.75rem 0 0;
  line-height: 1.55;
  color: #c8e7ff;
}

.meme-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
}

.trade-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.trade-wallet-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.wallet-status {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.trade-controls {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr auto auto auto;
  gap: 0.6rem;
  align-items: end;
}

.trade-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trade-controls input {
  width: 100%;
  border: 1px solid rgba(88, 169, 255, 0.36);
  border-radius: 8px;
  background: rgba(9, 14, 27, 0.85);
  color: var(--text-main);
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
}

.trade-btn-solid {
  border: 1px solid rgba(88, 169, 255, 0.46);
  background: linear-gradient(90deg, rgba(69, 255, 199, 0.18), rgba(88, 169, 255, 0.3));
  color: #f4fbff;
  border-radius: 9px;
  padding: 0.5rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.trade-btn-solid:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.trade-link {
  align-self: center;
  color: #8ce9ff;
  text-decoration: none;
  font-size: 0.82rem;
}

.trade-note {
  margin: 0.65rem 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.trade-tip {
  margin: 0.6rem 0 0;
  color: #a7c5ee;
  font-size: 0.75rem;
}

.trade-status {
  margin: 0.52rem 0 0;
  color: #cfe9ff;
  font-size: 0.82rem;
}

.trade-status.is-error {
  color: #ff98b7;
}

.trade-status.is-success {
  color: #79ffd2;
}

.meme-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  text-align: right;
}

.meme-table-wrap {
  overflow: auto;
  margin-top: 0.65rem;
}

.meme-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.meme-table th,
.meme-table td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(80, 132, 223, 0.2);
  font-size: 0.82rem;
}

.meme-table th {
  color: var(--text-soft);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.meme-row-link {
  color: #8ce9ff;
  text-decoration: none;
}

.meme-row-link:hover {
  text-decoration: underline;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.table-select-btn {
  border: 1px solid rgba(82, 213, 255, 0.45);
  background: rgba(82, 213, 255, 0.1);
  color: #9cefff;
  border-radius: 7px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.table-pair-link {
  color: #93e5ff;
  text-decoration: none;
  font-size: 0.72rem;
}

.risk-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(138, 180, 255, 0.38);
}

.risk-pill.risk-low {
  color: #07271f;
  border-color: rgba(69, 255, 199, 0.62);
  background: rgba(69, 255, 199, 0.8);
}

.risk-pill.risk-medium {
  color: #2b2402;
  border-color: rgba(255, 210, 76, 0.68);
  background: rgba(255, 210, 76, 0.86);
}

.risk-pill.risk-high {
  color: #3a1106;
  border-color: rgba(255, 145, 92, 0.72);
  background: rgba(255, 145, 92, 0.86);
}

.risk-pill.risk-extreme {
  color: #2f0915;
  border-color: rgba(255, 95, 143, 0.72);
  background: rgba(255, 95, 143, 0.88);
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.46rem;
  border: 1px solid rgba(138, 180, 255, 0.38);
  color: #98b6e5;
}

.signal-pill.signal-accumulating {
  color: #07271f;
  border-color: rgba(69, 255, 199, 0.62);
  background: rgba(69, 255, 199, 0.82);
}

.signal-pill.signal-distribution {
  color: #2f0915;
  border-color: rgba(255, 95, 143, 0.62);
  background: rgba(255, 95, 143, 0.85);
}

.flow-up {
  color: var(--neon-cyan);
}

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

.alert-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.alert-list li {
  border: 1px solid rgba(88, 169, 255, 0.24);
  border-left: 3px solid rgba(88, 169, 255, 0.45);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: rgba(14, 22, 39, 0.75);
}

.alert-list li.alert-accumulating {
  border-left-color: rgba(69, 255, 199, 0.75);
}

.alert-list li.alert-distribution {
  border-left-color: rgba(255, 95, 143, 0.75);
}

.alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.alert-symbol {
  font-weight: 800;
  font-size: 0.88rem;
}

.alert-score {
  color: var(--text-soft);
  font-size: 0.72rem;
}

.alert-text {
  margin: 0;
  color: #d1e5ff;
  line-height: 1.4;
  font-size: 0.81rem;
}

.alert-link {
  color: #93e5ff;
  text-decoration: none;
  font-size: 0.75rem;
}

.alert-actions {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.alert-trade-btn {
  border: 1px solid rgba(82, 213, 255, 0.45);
  background: rgba(82, 213, 255, 0.1);
  color: #9cefff;
  border-radius: 7px;
  padding: 0.25rem 0.52rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.pct-up {
  color: var(--neon-cyan);
}

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

.empty-cell {
  color: var(--text-soft);
  text-align: center;
  padding: 1rem 0.4rem;
}

.spin-target.spinning {
  animation: slotShake 0.18s linear infinite;
  filter: saturate(1.2);
}

.spin-target.spinning .price-value,
.spin-target.spinning .bull-score,
.spin-target.spinning .ai-read,
.spin-target.spinning .meme-table-wrap {
  opacity: 0.75;
}

@keyframes slotShake {
  0% { transform: translateY(0); }
  25% { transform: translateY(-2px); }
  50% { transform: translateY(2px); }
  75% { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}

@media (max-width: 980px) {
  .price-panel,
  .bull-panel,
  .ai-panel,
  .chart-panel,
  .meme-panel,
  .smart-panel,
  .alerts-panel {
    grid-column: span 12;
  }

  .hero {
    flex-direction: column;
  }

  .hero-actions {
    text-align: left;
  }

  .trade-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .war-room-wrap {
    width: min(1220px, calc(100% - 1rem));
  }

  .panel {
    border-radius: 14px;
    padding: 0.85rem;
  }

  .chart {
    height: 300px;
  }

  .spin-btn {
    width: 100%;
  }
}
