:root {
  --bg: #07111f;
  --panel: rgba(13, 25, 43, 0.78);
  --text: #eef6ff;
  --muted: #94a8c6;
  --line: rgba(255, 255, 255, 0.10);
  --green: #15e68a;
  --red: #ff526b;
  --gold: #ffc857;
  --cyan: #34d3ff;
  --purple: #9d7dff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: #07111f;
  color: var(--text);
  min-height: 100vh;
}

.background-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 8%, rgba(52, 211, 255, 0.12), transparent 24%),
    radial-gradient(circle at 85% 5%, rgba(157, 125, 255, 0.10), transparent 22%);
  z-index: -1;
}

.site-header {
  max-width: 1640px;
  margin: 0 auto;
  padding: 30px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

select,
button,
input {
  font: inherit;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

select option {
  color: #07111f;
  background: #ffffff;
}

button {
  cursor: pointer;
  font-weight: 800;
}

#refreshBtn {
  background: linear-gradient(135deg, var(--gold), #ff8a3d);
  color: #1b1200;
  border: none;
  box-shadow: 0 12px 30px rgba(255, 200, 87, 0.25);
}

.dashboard {
  max-width: 1640px;
  margin: 0 auto;
  padding: 10px 24px 40px;
}

.glass-card {
  background: linear-gradient(180deg, var(--panel), rgba(6, 14, 26, 0.76));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.left-content {
  min-width: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.asset-panel {
  padding: 24px;
}

.asset-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.asset-title-row img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.asset-title-row h2 {
  margin-bottom: 4px;
}

.asset-title-row p {
  color: var(--muted);
  margin-bottom: 0;
}

.price-block {
  margin: 26px 0 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.price-block h3 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.06em;
  margin-bottom: 0;
}

.pill {
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 900;
  background: rgba(21, 230, 138, 0.14);
  color: var(--green);
  white-space: nowrap;
}

.pill.negative {
  background: rgba(255, 82, 107, 0.14);
  color: var(--red);
}

.range-wrap {
  margin-bottom: 18px;
}

.range-line {
  height: 8px;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  overflow: hidden;
}

.range-line span {
  display: block;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--green));
  border-radius: inherit;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-top: 8px;
}

.metrics {
  display: grid;
  gap: 10px;
}

.metrics div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 13px 0 3px;
}

.metrics span {
  color: var(--muted);
}

.metrics strong {
  text-align: right;
}

.chart-panel {
  padding: 22px;
  min-height: 470px;
}

.chart-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.chart-topbar h2 {
  margin-bottom: 0;
}

.time-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.time-btn {
  padding: 9px 11px;
  border-radius: 12px;
  color: var(--muted);
}

.time-btn.active {
  background: rgba(52, 211, 255, 0.16);
  color: var(--text);
  border-color: rgba(52, 211, 255, 0.38);
}

#priceChart {
  width: 100%;
  max-height: 360px;
}

.partner-card {
  margin-top: 22px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.partner-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.referral-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 900;
  color: #1b1200;
  background: linear-gradient(135deg, var(--gold), #ff8a3d);
  box-shadow: 0 12px 30px rgba(255, 200, 87, 0.25);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 14px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.hint {
  color: var(--muted);
  margin-bottom: 0;
}

.metal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.metal-card {
  padding: 22px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  position: relative;
  overflow: hidden;
}

.metal-card::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  right: -36px;
  top: -36px;
  background: rgba(255,255,255,0.10);
}

.metal-card h3 {
  margin-bottom: 8px;
}

.metal-note {
  color: var(--muted);
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}

.metal-chart-card {
  min-height: 570px;
}

.tradingview-widget-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 420px;
  margin: 14px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}

.tradingview-widget-container iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.interval-buttons {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 12px;
}

.interval-btn {
  padding: 7px 9px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.interval-btn.active {
  background: rgba(255, 200, 87, 0.18);
  color: var(--text);
  border-color: rgba(255, 200, 87, 0.42);
}

.ipo-section {
  margin-top: 24px;
  padding: 22px;
}

.ipo-chart {
  min-height: 230px;
}

.ipo-watch-box,
.ipo-card {
  padding: 26px;
  border: 1px dashed rgba(255, 200, 87, 0.45);
  border-radius: 22px;
  background: rgba(255,255,255,0.05);
}

.ipo-watch-box h3,
.ipo-card h3 {
  margin-bottom: 18px;
}

.ipo-watch-box p,
.ipo-card p {
  color: var(--muted);
}

.ipo-watch-box strong,
.ipo-card strong {
  color: var(--text);
}

.ipo-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.ipo-metric {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
}

.ipo-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.ipo-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.crypto-section {
  margin-top: 24px;
  padding: 22px;
}

.table-heading {
  margin-top: 0;
}

#searchInput {
  min-width: 240px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr.crypto-row {
  cursor: pointer;
  transition: 0.18s ease;
}

tr.crypto-row:hover {
  background: rgba(255,255,255,0.06);
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.asset-cell img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.asset-cell small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.positive {
  color: var(--green);
  font-weight: 900;
}

.negative-text {
  color: var(--red);
  font-weight: 900;
}

.star-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  transition: 0.18s ease;
}

.star-btn:hover,
.star-btn.active {
  color: #1b1200;
  background: linear-gradient(135deg, var(--gold), #ff8a3d);
  box-shadow: 0 10px 28px rgba(255, 200, 87, 0.25);
}

.insights-panel {
  padding: 20px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.insights-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.insights-header h2 {
  margin-bottom: 0;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(21, 230, 138, 0.12);
  color: var(--green);
  font-weight: 900;
  font-size: 0.78rem;
}

.insights-list {
  display: grid;
  gap: 12px;
}

.insight-card {
  padding: 15px;
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 0.18s ease;
}

.insight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(52, 211, 255, 0.35);
}

.insight-tag {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  color: #07111f;
  background: var(--cyan);
}

.insight-card h3 {
  font-size: 0.96rem;
  line-height: 1.35;
  margin-bottom: 8px;
}

.insight-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 10px;
}

.insight-meta {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

/* MODAL FIX */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.modal:not(.hidden) {
  display: flex;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(640px, 100%);
  background: #0b1728;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px;
  position: relative;
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
}

.modal-content p {
  color: var(--muted);
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 10px 24px 40px;
}

footer p {
  margin-bottom: 6px;
}

@media (max-width: 1250px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .insights-panel {
    position: static;
    max-height: none;
  }

  .insights-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .hero-grid,
  .metal-grid,
  .ipo-card-grid {
    grid-template-columns: 1fr;
  }

  .site-header,
  .section-heading,
  .chart-topbar,
  .partner-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  select,
  #refreshBtn,
  #searchInput,
  .referral-btn {
    width: 100%;
  }

  .insights-list {
    grid-template-columns: 1fr;
  }
}