﻿:root {
  --bg: #0b1118;
  --panel: #121b26;
  --panel-2: #172231;
  --text: #e7edf6;
  --muted: #93a4b8;
  --border: #24364b;
  --up: #20c57a;
  --down: #f25f5c;
  --line: #69b7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 10%, #152131 0%, var(--bg) 45%);
  color: var(--text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
}

.topbar {
  width: min(1280px, 94vw);
  margin: 20px auto 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
}

h2 {
  margin: 0;
  font-size: 1.05rem;
}

.price-box {
  text-align: right;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px;
}

.price {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.9rem);
  font-weight: 700;
}

.change {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.change.up,
.premium-up {
  color: var(--up);
}

.change.down,
.premium-down {
  color: var(--down);
}

.layout {
  width: min(1280px, 94vw);
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.chart-card,
.info-card,
.premium-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.chart-card {
  min-height: 62vh;
  overflow: hidden;
}

#tv_chart {
  width: 100%;
  height: 62vh;
}

.info-card {
  padding: 16px;
}

.info-card ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.info-card li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.92rem;
}

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

#refreshBtn {
  width: 100%;
  margin-top: 14px;
  border: 1px solid var(--border);
  background: #213448;
  color: var(--text);
  padding: 11px;
  border-radius: 10px;
  cursor: pointer;
}

#refreshBtn:hover {
  background: #2a425a;
}

.premium-card {
  grid-column: 1 / -1;
  padding: 16px;
}

.premium-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.premium-now {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.window-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.window-btn {
  border: 1px solid var(--border);
  background: #1a2838;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
}

.window-btn:hover {
  background: #22364a;
}

.window-btn.is-active {
  border-color: #4f89c2;
  background: #2a4661;
}

.chart-wrap {
  width: 100%;
  height: 260px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  overflow: hidden;
}

#premiumChart {
  width: 100%;
  height: 100%;
  display: block;
}

#zeroLine {
  stroke: #3b4f68;
  stroke-width: 1;
  stroke-dasharray: 6 6;
}

#premiumLine {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.premium-meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .price-box {
    text-align: left;
  }

  .chart-card,
  #tv_chart {
    min-height: 56vh;
    height: 56vh;
  }

  .premium-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .premium-meta {
    flex-direction: column;
  }
}
