:root {
  --bg: #10140f;
  --panel: #1a2118;
  --line: #2c3828;
  --ink: #e7f0e4;
  --muted: #8ea08a;
  --ceiling: #e879f9;
  --up: #3dd68c;
  --ref: #f6c445;
  --down: #ff5d6c;
  --floor: #38bdf8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(7, 11, 9, 0.42), rgba(8, 12, 10, 0.9) 520px),
    url("../img/floor.jpg") center 120px / cover no-repeat fixed,
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
}

.hero {
  margin: 18px 28px 0;
  min-height: 250px;
  border: 1px solid rgba(231, 240, 228, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(100deg, rgba(6, 10, 8, 0.88) 0%, rgba(6, 10, 8, 0.42) 58%, rgba(6, 10, 8, 0.2) 100%),
    url("../img/skyline.jpg") center 42% / cover no-repeat;
}

.hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  min-height: 250px;
  padding: 32px 28px;
}

.hero-lead {
  max-width: 460px;
  margin: 8px 0 0;
  color: #d7e2d4;
  font-size: 15px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

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

.who {
  font-weight: 750;
}

.auth {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #1a2118;
  color: var(--ink);
  padding: 18px;
}

#register-fields[hidden],
#auth-fullname-wrap[hidden],
.auth .field[hidden] {
  display: none !important;
}

.captcha-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 10px;
}

.captcha-line img {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10140f;
}

.auth::backdrop { background: rgba(0, 0, 0, 0.55); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  background: #10140f;
  border-radius: 12px;
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.auth-tab.active { background: #e7f0e4; color: #142016; }

.auth .field input {
  background: #3a4250;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  caret-color: #fcd535;
  border: 1px solid #6b7585;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.auth .field input::placeholder {
  color: #c6cbd3;
  -webkit-text-fill-color: #c6cbd3;
  opacity: 1;
}

.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.auth-hint[hidden] {
  display: none !important;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status.live .dot {
  background: var(--up);
  box-shadow: 0 0 0 4px rgba(61, 214, 140, 0.15);
}

.status.down .dot { background: var(--down); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 18px 28px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.legend li { display: flex; align-items: center; gap: 7px; }

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.swatch.ceiling { background: var(--ceiling); }
.swatch.up { background: var(--up); }
.swatch.ref { background: var(--ref); }
.swatch.down { background: var(--down); }
.swatch.floor { background: var(--floor); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
  margin: 0 28px;
}

.board-wrap {
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 26, 20, 0.92);
}

.board {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.crypto-board { margin-top: 16px; }

.crypto-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 10px;
}

.crypto-head h2 { font-size: 22px; }

.crypto-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.board.coins { min-width: 640px; }

.coin-name { color: var(--muted); font-weight: 500; }

th, td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(231, 240, 228, 0.04); }
tbody tr.selected { background: rgba(61, 214, 140, 0.1); }
tbody tr:last-child td { border-bottom: 0; }

.chart-panel {
  margin: 16px 0 0;
  padding: 16px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 26, 20, 0.92);
}

.chart-panel[hidden] { display: none; }

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

.chart-quote {
  margin: 0;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.chart-quote span { margin-left: 8px; font-size: 15px; }

.frames { display: flex; flex-wrap: wrap; gap: 6px; }

.frames button {
  border: 1px solid var(--line);
  background: #10140f;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.frames button.active {
  background: #e7f0e4;
  border-color: #e7f0e4;
  color: #142016;
}

.frames button:disabled { opacity: 0.35; cursor: default; }

.chart-ohlc {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chart-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.chart-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.chart-box { height: 420px; }

.candle-tip {
  min-width: 180px;
  padding: 8px 10px;
  background: #10140f;
  border: 1px solid #2c3828;
  border-radius: 8px;
  color: #e7f0e4;
  font-size: 12px;
}

.candle-tip p { margin: 0 0 6px; color: var(--muted); }

.candle-tip div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  line-height: 1.45;
}

.candle-tip b { font-weight: 650; }

.news {
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 26, 20, 0.92);
}

.news-head h2,
.trade h2 {
  margin: 0;
  font-size: 20px;
}

.news-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.news-tab {
  border: 1px solid var(--line);
  background: #10140f;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.news-tab.active {
  background: #e7f0e4;
  border-color: #e7f0e4;
  color: #142016;
}

.feature,
.story {
  color: inherit;
  text-decoration: none;
}

.feature img,
.story img {
  display: block;
  width: 100%;
  object-fit: cover;
}

.feature img {
  height: 156px;
  border-radius: 12px;
}

.feature h3,
.story h3 {
  margin: 8px 0 4px;
  font-size: 16px;
  line-height: 1.35;
}

.feature:hover h3,
.story:hover h3 { color: var(--ref); }

.feature time,
.story time,
.feature p,
.story p,
.news-source {
  color: var(--muted);
  font-size: 12px;
}

.feature p,
.story p {
  margin: 0;
  line-height: 1.45;
}

.story {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.story img {
  width: 84px;
  height: 64px;
  border-radius: 8px;
}

.story h3 { margin-top: 0; font-size: 14px; }

.news-source { margin: 8px 0 4px; }

.money-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 28px 0;
}

.money-card {
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 26, 20, 0.92);
}

.money-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.money-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.money-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

.money-form .field input,
.money-form select {
  background: #12161c;
  color: #eaecef;
  -webkit-text-fill-color: #eaecef;
  caret-color: #fcd535;
  border: 1px solid #2b3139;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}
.money-form .field input::placeholder {
  color: #848e9c;
  -webkit-text-fill-color: #848e9c;
  opacity: 1;
}

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

.presets button {
  border: 1px solid var(--line);
  background: #10140f;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  cursor: pointer;
}

.presets button.active,
.presets button:hover { color: var(--ink); border-color: #6d8068; }

.alloc {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: center;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.alloc i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--up);
}

.trade {
  margin: 16px 28px 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 26, 20, 0.92);
}

.trade h2 { margin-bottom: 8px; }

.balances {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.balances strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.order {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.side-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #10140f;
  border-radius: 12px;
}

.side-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 8px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.side-btn.buy.active { background: var(--up); color: #062216; }
.side-btn.sell.active { background: var(--down); color: #2a060a; }

.order select {
  background: #10140f;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.stepper {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  background: #10140f;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.stepper input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 11px 4px;
  font: inherit;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.stepper input:focus { outline: none; }
.stepper:focus-within { border-color: #6d8068; }

.step {
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.step:hover { background: #243024; }
.step:disabled { color: #4d5c4a; cursor: default; }

.stepper input.up { color: var(--up); }
.stepper input.down { color: var(--down); }
.stepper input.ref { color: var(--ref); }
.stepper input.ceiling { color: var(--ceiling); }
.stepper input.floor { color: var(--floor); }

.band-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.percents {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.percents button {
  background: #10140f;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 0;
  font: inherit;
  cursor: pointer;
}

.percents button:hover,
.percents button.active { color: var(--ink); border-color: #6d8068; }

.total-line {
  display: flex;
  justify-content: space-between;
  margin: 0;
  color: var(--muted);
}

.total-line strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.submit {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.submit.buy { background: var(--up); color: #062216; }
.submit.sell { background: var(--down); color: #2a060a; }
.submit:disabled { opacity: 0.6; cursor: default; }

.msg { min-height: 1.3em; margin: 10px 0 0; }
.msg.ok { color: var(--up); }
.msg.bad { color: var(--down); }

.holdings {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
}

td.num, th.num { text-align: right; }

.code {
  font-weight: 750;
  letter-spacing: 0.08em;
}

.venue-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--floor);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  vertical-align: 2px;
}

.venues {
  margin: 16px 28px 0;
}

.venues-copy h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.venues-copy p {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.venue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.venue {
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 26, 20, 0.92);
  border-top: 3px solid var(--floor);
}

.venue.hnx { border-top-color: var(--ref); }
.venue.upcom { border-top-color: var(--up); }

.venue header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.venue header span {
  font-weight: 750;
  letter-spacing: 0.08em;
}

.venue header a {
  color: var(--muted);
  font-size: 13px;
}

.venue h3 {
  margin: 10px 0 6px;
  font-size: 16px;
}

.venue p,
.venue li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.venue ul {
  margin: 8px 0;
  padding-left: 18px;
}

.venue-on {
  margin: 0 0 8px;
  color: var(--ink) !important;
}

.venue-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.venue-code {
  border: 1px solid var(--line);
  background: #10140f;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.venue-code:hover { border-color: var(--floor); color: var(--floor); }

.price, .band, .vol {
  font-variant-numeric: tabular-nums;
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
}

.price.ceiling, .band.ceiling { color: var(--ceiling); }
.price.up { color: var(--up); }
.price.ref { color: var(--ref); }
.price.down { color: var(--down); }
.price.floor, .band.floor { color: var(--floor); }

.vol { color: #d5e2d2; }

td.price.flash-up { animation: flash-up 0.8s linear; }
td.price.flash-down { animation: flash-down 0.8s linear; }

@keyframes flash-up {
  0%, 22%, 44% { background: #1f8f55; color: #f3fff8; }
  11%, 33%, 100% { background: transparent; }
}

@keyframes flash-down {
  0%, 22%, 44% { background: #c53644; color: #fff5f6; }
  11%, 33%, 100% { background: transparent; }
}

.sound {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}

.sound[aria-pressed="false"] { color: var(--muted); }

.empty { color: var(--muted); text-align: center; }

.note {
  margin: 14px 28px 28px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .split, .venue-grid, .money-row { grid-template-columns: 1fr; }
  body { background-attachment: scroll; }
}

@media (max-width: 720px) {
  .hero, .legend, .split, .venues, .money-row, .trade, .note { margin-left: 14px; margin-right: 14px; }
  .crypto-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero-bar {
    flex-direction: column;
    align-items: flex-start;
    min-height: 220px;
    padding: 22px 16px;
  }
  h1 { font-size: 26px; }
}
