@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --bg: #0b0e11;
  --panel: #181a20;
  --line: #2b3139;
  --text: #eaecef;
  --muted: #848e9c;
  --yellow: #f0b90b;
  --green: #0ecb81;
  --red: #f6465d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, "Noto Sans KR", sans-serif;
}

.trade-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #181a20;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  color: var(--yellow);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  font-size: 1.2rem;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.top-nav a.active,
.top-nav a:hover {
  color: var(--yellow);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info form { margin: 0; }

.balance {
  color: var(--yellow);
  font-weight: 800;
}

.logout-btn {
  border: 1px solid var(--line);
  background: #12151c;
  color: var(--text);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

.trade-page.simple {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: grid;
  gap: 16px;
}

.chart-card,
.table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.chart-toolbar {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.symbol-box label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.symbol-box select {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f1218;
  color: var(--text);
  padding: 0 12px;
}

.price-box .name {
  font-size: 1.15rem;
  font-weight: 800;
}

.price-box .price {
  margin-top: 4px;
  font-size: 1.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.price-box .price.up { color: var(--green); }
.price-box .price.down { color: var(--red); }

.price-box .meta,
.status-box {
  color: var(--muted);
  font-size: 0.86rem;
}

.status-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-box .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(14, 203, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 203, 129, 0); }
}

#tv_chart_container {
  width: 100%;
  height: 480px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f1218;
}

#fallbackChart {
  display: none;
  width: 100%;
  height: 480px;
  border-radius: 10px;
  background: #0f1218;
}

.dev-banner {
  margin-top: 14px;
  border: 1px dashed rgba(240, 185, 11, 0.45);
  background: rgba(240, 185, 11, 0.08);
  color: var(--yellow);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.table-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

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

.table-card th,
.table-card td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  font-size: 0.9rem;
}

.table-card th {
  color: var(--muted);
}

.table-card tbody tr:hover {
  background: rgba(240, 185, 11, 0.05);
  cursor: pointer;
}

.table-card tbody tr.active {
  background: rgba(240, 185, 11, 0.12);
}

@media (max-width: 900px) {
  .chart-toolbar {
    grid-template-columns: 1fr;
  }

  #tv_chart_container,
  #fallbackChart {
    height: 300px;
  }
}
