:root {
  --bg: #0a0c11;
  --bg-card: #14171f;
  --bg-card-2: #191d27;
  --border: #262b36;
  --text: #e8ebf0;
  --text-dim: #7a8496;
  --gold: #f7931a;
  --up: #16c784;
  --down: #ea3943;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(247,147,26,0.10), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(22,199,132,0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 18px 60px;
  position: relative;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  animation: fadeUp .5s ease both;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), #ffb84d);
  color: #1a1200;
  font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(247,147,26,0.35);
}
.header h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.5px;
}
.subtitle { color: var(--text-dim); font-size: 12px; margin-top: 3px; }

.live-box { text-align: right; font-size: 11px; }
.dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--up); margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(22,199,132,0.7);
  animation: pulse 1.8s infinite;
}
.dot-off { background: var(--down); animation: none; }
.live-label { color: var(--text); font-weight: 600; letter-spacing: 1px; }
.updated { color: var(--text-dim); margin-top: 6px; }
.countdown { color: var(--gold); margin-top: 2px; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22,199,132,0.6); }
  70% { box-shadow: 0 0 0 9px rgba(22,199,132,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,199,132,0); }
}

.error-banner {
  background: rgba(234,57,67,0.12);
  border: 1px solid rgba(234,57,67,0.4);
  color: #ff8a91;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--bg-card-2), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  animation: fadeUp .5s ease .08s both;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--up);
}
.hero.down::before { background: var(--down); }
.hero-label { color: var(--text-dim); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.price {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(38px, 9vw, 64px);
  letter-spacing: -2px;
  margin: 10px 0 14px;
  line-height: 1;
  transition: color .3s;
}
.mood { font-size: 0.6em; margin-left: 12px; }
.flash-up { animation: flashUp .7s ease; }
.flash-down { animation: flashDown .7s ease; }
@keyframes flashUp { 0% { color: var(--up); text-shadow: 0 0 24px rgba(22,199,132,0.6);} 100% { color: var(--text); } }
@keyframes flashDown { 0% { color: var(--down); text-shadow: 0 0 24px rgba(234,57,67,0.6);} 100% { color: var(--text); } }

.change-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px;
  font-weight: 600; font-size: 16px;
}
.badge-up { background: rgba(22,199,132,0.15); color: var(--up); }
.badge-down { background: rgba(234,57,67,0.15); color: var(--down); }
.arrow { font-size: 13px; }
.abs { font-size: 13px; }
.abs-up { color: var(--up); }
.abs-down { color: var(--down); }
.mood-text {
  margin-top: 12px; font-family: "Space Grotesk", sans-serif;
  color: var(--gold); font-weight: 500; font-size: 15px;
}
.src-note { position: absolute; top: 20px; right: 22px; color: var(--text-dim); font-size: 10px; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 18px;
  animation: fadeUp .5s ease .16s both;
}
.card-title {
  color: var(--text-dim); font-size: 12px; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 16px;
}

/* Chart */
.chart-wrap { position: relative; width: 100%; }
.chart-svg { width: 100%; height: 240px; display: block; cursor: crosshair; }
.grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 6; vector-effect: non-scaling-stroke; }
.cross { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart-empty { color: var(--text-dim); height: 240px; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.tooltip {
  position: absolute; top: 0; transform: translateX(-50%);
  background: #000; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; pointer-events: none;
  white-space: nowrap;
}
.tt-price { font-weight: 600; font-size: 13px; }
.tt-time { color: var(--text-dim); font-size: 10px; }

/* Stats */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 18px;
  animation: fadeUp .5s ease .24s both;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.stat-label { color: var(--text-dim); font-size: 11px; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 17px; }

/* Refresh button */
.refresh-btn {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px;
  border-radius: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  animation: fadeUp .5s ease .3s both;
}
.refresh-btn:hover { border-color: var(--gold); color: var(--gold); }
.refresh-btn:active { transform: scale(0.98); }

/* Footer */
.footer {
  margin-top: 30px; text-align: center;
  color: var(--text-dim); font-size: 12px;
}
.footer a { color: var(--gold); text-decoration: none; margin-top: 8px; display: inline-block; }
.footer a:hover { text-decoration: underline; }

/* Skeleton / shimmer */
.skeleton { border-radius: 12px; }
.price + .skeleton, .skeleton { height: 60px; }
.shimmer {
  background: linear-gradient(90deg, var(--bg-card-2) 25%, #232833 50%, var(--bg-card-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row > :nth-child(3) { grid-column: 1 / -1; }
  .src-note { display: none; }
  .live-box { text-align: left; }
  .header { flex-direction: column; }
}
</parameter>