:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: rgba(17, 22, 30, 0.82);
  --panel-strong: #121821;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f7fb;
  --muted: #8793a5;
  --cyan: #32e1c4;
  --blue: #3e8cff;
  --red: #ff5d6c;
  --green: #4de39d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family:
    Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(50, 225, 196, 0.14), transparent 33%),
    radial-gradient(circle at 100% 15%, rgba(62, 140, 255, 0.12), transparent 28%),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.025;
  background-image: linear-gradient(#fff 1px, transparent 1px),
    linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 48px 48px;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 40px;
}

.topbar,
.section-heading,
.live-row,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(50, 225, 196, 0.5);
  border-radius: 13px;
  color: #07100e;
  font-size: 21px;
  font-weight: 900;
  background: var(--cyan);
  box-shadow: 0 0 30px rgba(50, 225, 196, 0.22);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 2px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.eyebrow {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.status-pill,
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b9c2ce;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
}

.status-pill {
  padding: 9px 13px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(77, 227, 157, 0.09);
  animation: pulse 1.8s infinite;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 24px;
  margin: 72px 0 34px;
  align-items: end;
}

.hero-copy {
  min-width: 0;
}

.live-row {
  justify-content: flex-start;
  gap: 12px;
}

.live-badge {
  padding: 7px 11px;
  color: var(--red);
  border-color: rgba(255, 93, 108, 0.24);
  background: rgba(255, 93, 108, 0.08);
}

.symbol {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.side {
  margin-top: 16px;
  font-size: clamp(58px, 9vw, 112px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.side.long {
  color: var(--cyan);
  text-shadow: 0 0 60px rgba(50, 225, 196, 0.18);
}

.side.short {
  color: var(--red);
  text-shadow: 0 0 60px rgba(255, 93, 108, 0.18);
}

.subtitle {
  max-width: 620px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.return-card,
.price-card,
.details {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(21, 28, 38, 0.94), rgba(11, 15, 21, 0.9));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.return-card {
  padding: 24px;
  border-radius: 20px;
}

.return-card span,
.price-card span,
.detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.return-card strong {
  display: block;
  margin: 13px 0 7px;
  color: var(--cyan);
  font-size: 42px;
  letter-spacing: -0.06em;
}

.return-card strong.negative {
  color: var(--red);
}

.return-card small {
  color: #aab4c2;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.price-card {
  position: relative;
  overflow: hidden;
  padding: 23px;
  border-radius: 17px;
}

.price-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(23px, 3vw, 34px);
  letter-spacing: -0.045em;
}

.bar {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
}

.cyan {
  background: var(--cyan);
}

.blue {
  background: var(--blue);
}

.red {
  background: var(--red);
}

.details {
  margin-top: 14px;
  padding: 30px;
  border-radius: 20px;
}

.section-heading h2 {
  margin-top: 6px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.youtube-link {
  padding: 10px 13px;
  color: #cbd3dd;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.youtube-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.detail-grid div {
  padding: 19px;
  background: var(--panel-strong);
}

.detail-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.reading-note {
  display: flex;
  gap: 13px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 13px;
  background: rgba(50, 225, 196, 0.055);
}

.scan-icon {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
}

.reading-note p {
  color: #dbe3ec;
  font-size: 13px;
  line-height: 1.5;
}

.reading-note small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

footer {
  gap: 24px;
  padding: 20px 4px 0;
  color: #626e7d;
  font-size: 10px;
  line-height: 1.5;
}

footer p {
  max-width: 620px;
}

#countdown {
  white-space: nowrap;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.trader-directory {
  min-width: 0;
}

.directory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin: 76px 0 28px;
}

.directory-head h2 {
  margin: 8px 0 12px;
  font-size: clamp(34px, 5vw, 62px);
  letter-spacing: -0.065em;
}

.directory-copy {
  color: var(--muted);
  font-size: 14px;
}

.directory-meta {
  min-width: 130px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
}

.directory-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.directory-meta strong {
  display: block;
  margin-top: 5px;
  font-size: 26px;
}

.trader-list {
  display: grid;
  gap: 12px;
}

.list-loading {
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: var(--panel);
}

.trader-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr repeat(4, minmax(120px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16);
}

.trader-row > div {
  min-width: 0;
  padding: 21px;
  background: linear-gradient(145deg, #141a23, #10151d);
}

.trader-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(50, 225, 196, 0.34);
  border-radius: 14px;
  color: var(--cyan);
  font-weight: 900;
  background: rgba(50, 225, 196, 0.08);
}

.trader-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trader-name-line h3 {
  margin: 0;
  font-size: 17px;
}

.platform {
  color: var(--muted);
  font-size: 10px;
}

.trader-identity .live-badge {
  margin-top: 7px;
  padding: 4px 7px;
  font-size: 9px;
}

.position-main span,
.row-metric span,
.row-return span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.position-main strong,
.row-metric strong,
.row-return strong {
  display: block;
  margin: 8px 0 5px;
  overflow: hidden;
  font-size: 19px;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-side.long,
.row-return strong {
  color: var(--cyan);
}

.row-side.short,
.row-return strong.negative {
  color: var(--red);
}

.position-main small,
.row-metric small,
.row-return small {
  color: #727f90;
  font-size: 10px;
}

.row-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 21px !important;
}

.row-footer p {
  overflow: hidden;
  color: #a6b0be;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-footer span {
  flex: 0 0 auto;
  color: #626f80;
  font-size: 10px;
}

.row-link {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #b7c0cd;
  font-size: 12px;
  text-decoration: none;
  background: #161c25;
}

.chat-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(20, 26, 35, 0.96), rgba(11, 15, 21, 0.94));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

.chat-sidebar {
  position: sticky;
  top: 18px;
  margin-top: 76px;
}

.chat-head,
.chat-name-row,
.chat-form,
.chat-presence {
  display: flex;
  align-items: center;
}

.chat-head {
  justify-content: space-between;
  gap: 20px;
}

.chat-head h2 {
  margin: 6px 0 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.chat-presence {
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.chat-presence strong {
  color: var(--text);
  font-size: 14px;
}

.chat-name-row {
  gap: 9px;
  margin-top: 20px;
}

.chat-name-row label,
#chatStatus {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

#chatStatus {
  margin-left: auto;
}

.chat-name-row input,
.chat-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.chat-name-row input {
  width: 180px;
  padding: 9px 11px;
}

.chat-name-row button,
.chat-form button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.chat-name-row button {
  padding: 9px 12px;
  color: #cbd3dd;
  background: rgba(255, 255, 255, 0.08);
}

.chat-messages {
  height: clamp(340px, 52vh, 620px);
  margin-top: 14px;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 8, 12, 0.5);
}

.chat-empty {
  padding: 110px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.chat-message + .chat-message {
  margin-top: 13px;
}

.chat-message-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-message-head strong {
  color: var(--cyan);
  font-size: 12px;
}

.chat-message-head time {
  color: #596575;
  font-size: 9px;
}

.chat-message p {
  margin-top: 4px;
  color: #d9e0e9;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-system {
  margin: 9px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.chat-form {
  gap: 10px;
  margin-top: 12px;
}

.chat-form input {
  flex: 1;
  padding: 13px 14px;
}

.chat-form button {
  padding: 13px 20px;
  color: #07100e;
  background: var(--cyan);
}

.chat-form button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chat-guide {
  margin-top: 10px;
  color: #5f6b7a;
  font-size: 10px;
}

@media (min-width: 1241px) {
  body {
    overflow: hidden;
  }

  .shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
  }

  .content-layout,
  .trader-directory,
  .chat-sidebar,
  .chat-panel {
    min-height: 0;
  }

  .trader-directory,
  .chat-panel {
    display: flex;
    flex-direction: column;
  }

  .trader-list {
    min-height: 0;
    padding-right: 8px;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .chat-sidebar {
    height: calc(100% - 76px);
  }

  .chat-panel {
    height: 100%;
  }

  .chat-messages {
    flex: 1;
    height: auto;
    min-height: 180px;
  }
}

@media (max-width: 1240px) {
  .shell {
    width: min(1180px, calc(100% - 32px));
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .chat-sidebar {
    position: static;
    margin-top: 28px;
  }

  .chat-messages {
    height: 340px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

  .status-pill {
    padding: 8px 10px;
    font-size: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    margin-top: 54px;
  }

  .side {
    font-size: clamp(56px, 20vw, 84px);
  }

  .return-card {
    padding: 20px;
  }

  .price-grid {
    grid-template-columns: 1fr;
  }

  .details {
    padding: 21px;
  }

  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-heading {
    align-items: flex-end;
  }

  .youtube-link {
    font-size: 0;
  }

  .youtube-link::after {
    content: "YouTube ↗";
    font-size: 11px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .directory-head {
    align-items: flex-start;
    margin-top: 52px;
  }

  .directory-meta {
    min-width: 92px;
    padding: 13px;
  }

  .trader-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .trader-identity {
    grid-column: 1 / -1;
  }

  .trader-row > div {
    padding: 17px;
  }

  .row-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .row-footer p {
    max-width: 100%;
  }

  .chat-panel {
    padding: 17px;
  }

  .chat-name-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .chat-name-row input {
    flex: 1;
    width: auto;
  }

  #chatStatus {
    width: 100%;
    margin: 0;
  }

  .chat-messages {
    height: 300px;
  }
}
