/* ===========================
   Miracle · LIVE Scoreboard
   전광판은 항상 다크 톤 유지 (라이트 모드여도)
   =========================== */

.scoreboard-section {
  position: relative;
  padding: 56px 0 40px;

  /* Force dark palette inside the scoreboard, regardless of page theme */
  --bg: #0a0a0c;
  --bg-card: #18181c;
  --bg-elev: #131316;
  --bg-card-hover: #1c1c22;
  --bg-tinted: #1a1a20;
  --text: #f5f5f7;
  --text-dim: #9a9aa3;
  --text-faint: #5a5a63;
  --border: #26262c;
  --border-soft: #1e1e23;
  --border-strong: #353540;

  color: var(--text);
}

/* Subtle ambient glow behind the board */
.scoreboard-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 400px at 20% 0%, rgba(167, 139, 250, 0.10), transparent 60%),
    radial-gradient(700px 380px at 90% 100%, rgba(96, 165, 250, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.scoreboard-section .container { position: relative; z-index: 1; }

/* === Live header === */
.sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.sb-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sb-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.live-pill .pulse {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: live-pulse 1.4s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.sb-tz {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.6px;
}
.sb-tz span { color: var(--text-dim); }

/* === Main scoreboard panel === */
.scoreboard {
  background: linear-gradient(180deg, var(--bg-card), #14141a);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 30px 60px -30px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.versus-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
}

.side {
  padding: 32px 32px 28px;
  position: relative;
}
.side-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.side-emoji {
  font-size: 16px;
  display: inline-block;
}
.side-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin-bottom: 16px;
}

.side.human .side-pnl { color: #fbbf24; }
.side.bot .side-pnl { color: #a78bfa; }

.side-pnl {
  font-family: var(--font-mono, "SF Mono", monospace);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}
.side-pnl.flash-up { animation: flash-up .6s ease; }
.side-pnl.flash-down { animation: flash-down .6s ease; }
@keyframes flash-up {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); filter: drop-shadow(0 0 16px rgba(52, 211, 153, 0.55)); }
  100% { transform: scale(1); }
}
@keyframes flash-down {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); filter: drop-shadow(0 0 16px rgba(248, 113, 113, 0.55)); }
  100% { transform: scale(1); }
}

.side-sub {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 600;
}

.side-stats {
  display: flex;
  gap: 24px;
  margin-top: 22px;
}
.side-stat .k {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.side-stat .v {
  font-family: var(--font-mono, "SF Mono", monospace);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.vs-divider {
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border-strong), transparent);
  position: relative;
}
.vs-divider::before {
  content: "VS";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  width: 44px; height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.leader-bar {
  border-top: 1px solid var(--border-soft);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.18);
}
.leader-bar .lead-name {
  font-weight: 700;
  letter-spacing: 0.3px;
}
.leader-bar .lead-name.human { color: #fbbf24; }
.leader-bar .lead-name.bot { color: #a78bfa; }
.leader-bar .lead-gap {
  font-family: var(--font-mono, monospace);
  color: var(--text-dim);
  font-size: 12.5px;
}

/* === Exchange cards — mini trading terminals === */
.exchange-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.ex-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.ex-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* Brand colors */
.ex-card.bybit  { --brand: #f7a600; --brand-soft: rgba(247, 166, 0, 0.10); }
.ex-card.bitget { --brand: #00f0c8; --brand-soft: rgba(0, 240, 200, 0.10); }
.ex-card.mexc   { --brand: #2562ff; --brand-soft: rgba(37, 98, 255, 0.12); }

/* === Brand header bar === */
.ex-head {
  position: relative;
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--brand-soft), transparent 80%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ex-head::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
}
.ex-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ex-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #0a0a0c;
  font-weight: 900;
  font-size: 13px;
  font-family: var(--font-mono, monospace);
  letter-spacing: -0.5px;
}
.ex-card.bitget .ex-logo,
.ex-card.bybit  .ex-logo { color: #0a0a0c; }
.ex-card.mexc   .ex-logo { color: #ffffff; }

.ex-name {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text);
}
.ex-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
}
.ex-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  animation: ex-pulse 1.8s ease-in-out infinite;
}
@keyframes ex-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Market panel (price + 24h + vol) === */
.ex-market {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.ex-pair {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 6px;
}
.ex-pair .pair-perp {
  background: var(--brand-soft);
  color: var(--brand);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  letter-spacing: 0.6px;
}
.ex-price {
  font-family: var(--font-mono, monospace);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  transition: color .2s;
}
.ex-price .currency {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
}
.ex-price.flash-up   { color: #34d399; }
.ex-price.flash-down { color: #f87171; }

.ex-market-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.ex-meta-item .k {
  color: var(--text-faint);
  font-size: 9.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 2px;
  font-family: var(--font-sans);
  font-weight: 600;
}
.ex-meta-item .v { color: var(--text-dim); font-weight: 600; }
.ex-meta-item .v.pos { color: #34d399; }
.ex-meta-item .v.neg { color: #f87171; }

/* === Battle panel (human vs bot) === */
.ex-battle {
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.18);
}
.ex-battle-title {
  font-size: 9.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 8px;
}
.ex-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}
.ex-side {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}
.ex-side .em { font-size: 14px; }
.ex-pnl {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.ex-pnl.pos { color: #34d399; }
.ex-pnl.neg { color: #f87171; }
.ex-pnl.zero { color: var(--text-dim); }

.ex-mini-chart {
  margin-top: 10px;
  height: 56px;
  position: relative;
}
.ex-mini-chart canvas { display: block; width: 100% !important; height: 100% !important; }

/* === Footer link (외부) === */
.ex-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-faint);
}
.ex-foot a {
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 10.5px;
}
.ex-foot a:hover { opacity: 0.85; }

/* === Big PNL chart === */
.pnl-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 16px;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.chart-head h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.chart-head .sub {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.4px;
}
.chart-legend {
  display: flex;
  gap: 18px;
  align-items: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
}
.legend-dot.human { background: #fbbf24; }
.legend-dot.bot { background: #a78bfa; }
.legend-pct {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart-canvas-wrap {
  height: 280px;
  position: relative;
}
.chart-canvas-wrap canvas { display: block; }

/* === Ticker === */
.ticker {
  margin-top: 16px;
  background: linear-gradient(180deg, var(--bg-card), #14141a);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.ticker::before, .ticker::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.ticker::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-card), transparent);
}
.ticker::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg-card), transparent);
}

.ticker-label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.32);
  color: #c4b5fd;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  padding: 5px 10px;
  border-radius: 6px;
  text-transform: uppercase;
}

.ticker-track {
  display: flex;
  gap: 28px;
  padding: 14px 0 14px 110px;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  font-size: 13px;
  font-family: var(--font-mono, "SF Mono", monospace);
}
.ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.tick {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
}
.tick .who {
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  letter-spacing: 0.4px;
  font-family: var(--font-sans);
}
.tick .who.bot {
  background: rgba(167, 139, 250, 0.14);
  color: #c4b5fd;
}
.tick .who.human {
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
}
.tick .ex {
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.4px;
}
.tick .sym { color: var(--text); font-weight: 600; }
.tick .side-l { color: #34d399; font-weight: 700; }
.tick .side-s { color: #f87171; font-weight: 700; }
.tick .pnl { font-weight: 700; }
.tick .pnl.pos { color: #34d399; }
.tick .pnl.neg { color: #f87171; }
.tick .ago { color: var(--text-faint); font-size: 11.5px; }
.tick .sep { color: var(--border-strong); }

/* === Footnote === */
.sb-footnote {
  margin-top: 16px;
  padding: 14px 18px;
  font-size: 12px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-soft);
  border-radius: 10px;
  line-height: 1.6;
}
.sb-footnote strong { color: var(--text-dim); }

/* === Responsive === */
@media (max-width: 880px) {
  .exchange-grid { grid-template-columns: 1fr; }
  .versus-row { grid-template-columns: 1fr; }
  .vs-divider {
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  }
  .vs-divider::before {
    width: 38px; height: 38px;
    font-size: 11px;
  }
  .side-pnl { font-size: 42px; }
  .side { padding: 28px 22px; }
  .chart-canvas-wrap { height: 220px; }
  .chart-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .side-pnl { font-size: 36px; }
  .side-name { font-size: 22px; }
  .side-stats { gap: 14px; }
  .ticker-label { display: none; }
  .ticker-track { padding-left: 16px; }
}
