:root {
  --bg: #07070d;
  --bg2: #0d0d1a;
  --panel: #111122;
  --panel2: #181830;
  --border: #232347;
  --text: #eef0f8;
  --dim: #8b8fb0;
  --cyan: #22d3ee;
  --purple: #a855f7;
  --pos: #2dd4bf;
  --hot: #fbbf24;
  --neg: #fb7185;
  --glow-cyan: rgba(34, 211, 238, 0.5);
  --glow-purple: rgba(168, 85, 247, 0.45);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 배경 글로우 */
.glow-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(34,211,238,0.10), transparent 70%),
    radial-gradient(55% 45% at 90% 10%, rgba(168,85,247,0.12), transparent 70%),
    var(--bg);
}

.wrap { max-width: 960px; margin: 0 auto; padding: 28px 16px 90px; }

/* 언어 토글 (상단 우측) */
.topbar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.lang-seg button { padding: 5px 13px; font-size: 12px; font-weight: 700; }

.grad {
  background: linear-gradient(92deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.muted { color: var(--dim); font-weight: 500; font-size: .8em; }

/* ── 히어로 ── */
.hero { padding: 18px 0 22px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 30px; filter: drop-shadow(0 0 10px var(--glow-cyan)); }
.brand-name { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.live {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--cyan);
  border: 1px solid rgba(34,211,238,0.4); border-radius: 999px; padding: 3px 9px;
  background: rgba(34,211,238,0.06);
}
.live .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 8px var(--glow-cyan); animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.tagline { color: var(--dim); margin-top: 14px; font-size: 14.5px; }
.tagline b { color: var(--text); }
.meta { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--dim); }
.meta span { background: var(--panel); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px; }

/* ── 요약 카드 ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.stat-card {
  background: linear-gradient(160deg, var(--panel2), var(--panel));
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 16px 14px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  opacity: .8;
}
.stat-label { font-size: 12px; color: var(--dim); }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px;
  font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--dim); margin-top: 3px; }

/* ── 설명 3스텝 ── */
.explain { margin-top: 22px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; }
.explain h2 { font-size: 16px; margin-bottom: 16px; }
.steps { display: flex; align-items: stretch; gap: 10px; }
.step { flex: 1; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; position: relative; }
.step.arrow { flex: 0 0 auto; display: flex; align-items: center;
  background: none; border: none; color: var(--dim); font-size: 18px; padding: 0; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700;
  background: rgba(34,211,238,0.12); color: var(--cyan);
  border: 1px solid rgba(34,211,238,0.35); margin-bottom: 8px;
}
.step b { display: block; font-size: 14px; }
.step p { color: var(--dim); font-size: 12.5px; margin-top: 4px; }
.step.highlight { border-color: rgba(168,85,247,0.5);
  box-shadow: 0 0 24px rgba(168,85,247,0.12) inset; }
.step.highlight .step-no { background: rgba(168,85,247,0.15); color: var(--purple);
  border-color: rgba(168,85,247,0.4); }

/* ── 수익 기준 토글 ── */
.controls { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.ctrl-label { font-size: 13px; color: var(--dim); font-weight: 600; }
.ctrl-note { font-size: 11.5px; color: var(--dim); margin-left: auto; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; }
.seg button {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--dim); background: none; border: none; padding: 6px 16px;
  border-radius: 999px; transition: color .15s, background .15s;
}
.seg button.on {
  color: #04121a;
  background: linear-gradient(92deg, var(--cyan), var(--purple));
  box-shadow: 0 2px 12px rgba(34,211,238,0.3);
}

/* ── 패널/표 ── */
.panel { background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; margin-top: 18px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px; }
.panel-head h2 { font-size: 16px; font-weight: 700; }
.up { color: var(--pos); } .down { color: var(--neg); }
.hint { font-size: 12px; color: var(--dim); }
.hint b { color: var(--cyan); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 580px; }
thead th { text-align: left; color: var(--dim); font-weight: 500; font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 10px; border-bottom: 1px solid var(--panel2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { will-change: transform; }
tbody tr:hover { background: var(--panel2); }
tr.entering { opacity: 0; }

/* 순위 이동 방향 플래시 */
@keyframes flashUp   { from { background: rgba(45,212,191,0.22); } to { background: transparent; } }
@keyframes flashDown { from { background: rgba(251,113,133,0.20); } to { background: transparent; } }
tr.flash-up   { animation: flashUp .8s ease-out; }
tr.flash-down { animation: flashDown .8s ease-out; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { color: var(--dim); width: 28px; }
.sym { font-weight: 700; }
.cd { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 13px; }
.cd.soon { color: var(--hot); font-weight: 700; }
.dim { color: var(--dim); }

.apr-pos { color: var(--pos); }
.apr-hot { color: var(--hot); font-weight: 800; text-shadow: 0 0 12px rgba(251,191,36,.4); }
.apr-neg { color: var(--neg); }

/* ── CTA ── */
.cta { margin-top: 26px; text-align: center; border-radius: 18px; padding: 34px 20px;
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(34,211,238,0.10), transparent 60%),
    linear-gradient(160deg, #15203a, var(--panel));
  border: 1px solid var(--border); }
.cta h2 { font-size: 20px; }
.cta p { color: var(--dim); margin: 10px 0 22px; font-size: 14.5px; }
.cta p b { color: var(--text); }
.btn {
  display: inline-block; font-weight: 800; font-size: 15.5px; text-decoration: none;
  color: #04121a; padding: 14px 30px; border-radius: 999px;
  background: linear-gradient(92deg, var(--cyan), var(--purple));
  box-shadow: 0 6px 24px rgba(34,211,238,0.3);
  transition: transform .09s ease, box-shadow .2s, filter .2s;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(168,85,247,0.4); }

/* ── 푸터 ── */
footer { margin-top: 30px; text-align: center; color: var(--dim); font-size: 12px; }
#disclaimer { color: #c9b075; }
.copy { margin-top: 8px; }

/* ── 모바일 하단 고정 CTA ── */
.sticky-cta { display: none; }
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .stat-value { font-size: 23px; }
  .steps { flex-direction: column; }
  .step.arrow { transform: rotate(90deg); align-self: center; height: 16px; }
  .brand-name { font-size: 25px; }
  .wrap { padding: 20px 12px 90px; }
  .sticky-cta {
    display: block; position: fixed; left: 12px; right: 12px; z-index: 50;
    bottom: calc(12px + env(safe-area-inset-bottom)); /* 아이폰 홈바 회피 */
    text-align: center; text-decoration: none; font-weight: 800; font-size: 15px;
    color: #04121a; padding: 14px; border-radius: 14px;
    background: linear-gradient(92deg, var(--cyan), var(--purple));
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  }
}

/* ── 아주 좁은 폰(≤480px): 핵심 컬럼만 남겨 가로 스크롤 제거 ── */
@media (max-width: 480px) {
  table { min-width: 0; font-size: 13px; }
  th, td { padding: 9px 6px; }
  /* 펀딩비(3), 24h 거래대금(7) 숨김 → #/종목/주기/APR(또는 일일)/다음정산 유지 */
  #top-table th:nth-child(3), #top-table td:nth-child(3),
  #top-table th:nth-child(7), #top-table td:nth-child(7),
  #bottom-table th:nth-child(3), #bottom-table td:nth-child(3),
  #bottom-table th:nth-child(7), #bottom-table td:nth-child(7) { display: none; }
  .ctrl-note { width: 100%; margin-left: 0; }
}
