:root {
  color-scheme: dark;
  --bg: #090c0f;
  --panel: #141a20;
  --panel-soft: #1c242c;
  --line: #303a43;
  --text: #f0f4f5;
  --muted: #9da8ad;
  --good: #5bd18f;
  --bad: #ff7373;
  --accent: #d9b56d;
  --accent-strong: #f1cd82;
  --blue: #7eb6d9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(9, 12, 15, 0.25), var(--bg) 520px),
    radial-gradient(circle at 18% 0%, rgba(217, 181, 109, 0.18), transparent 380px),
    radial-gradient(circle at 100% 12%, rgba(126, 182, 217, 0.12), transparent 420px),
    var(--bg);
  color: var(--text);
  font-family: Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.app {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 180px;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid rgba(217, 181, 109, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(217, 181, 109, 0.14), rgba(20, 26, 32, 0.7)),
    linear-gradient(90deg, rgba(20, 26, 32, 0.92), rgba(20, 26, 32, 0.58));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
}

.brandMark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(241, 205, 130, 0.64);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(241, 205, 130, 0.22), rgba(167, 119, 48, 0.18));
  color: var(--accent-strong);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 1;
}

.subtitle {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.searchBox {
  position: relative;
}

input,
button {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(9, 12, 15, 0.62);
  color: var(--text);
  font: inherit;
}

input {
  width: min(320px, 44vw);
  padding: 0 12px;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  width: min(440px, 80vw);
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(217, 181, 109, 0.38);
  border-radius: 8px;
  background: #10161b;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
}

.suggestion {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(48, 58, 67, 0.8);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.suggestion:hover,
.suggestion.active {
  background: rgba(217, 181, 109, 0.12);
  filter: none;
}

.suggestion img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.suggestion strong,
.suggestion small {
  display: block;
}

.suggestion small {
  color: var(--muted);
}

.suggestionPrice {
  color: var(--accent-strong);
  font-weight: 800;
  white-space: nowrap;
}

button {
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(180deg, var(--accent-strong), #a77730);
  color: #14100a;
  border-color: rgba(241, 205, 130, 0.7);
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
}

.summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.summaryCard {
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 26, 32, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.summaryCard.featured {
  border-color: rgba(217, 181, 109, 0.48);
}

.summaryCard span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.summaryCard strong {
  font-size: 1.16rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
}

.toolbar strong {
  color: var(--text);
  margin-right: 8px;
}

.toolbar a {
  color: var(--accent-strong);
  text-decoration: none;
}

.marketRadar {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(217, 181, 109, 0.24);
  border-radius: 8px;
  background: rgba(20, 26, 32, 0.78);
}

.radarHeader {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.radarHeader h2 {
  margin: 0;
  font-size: 1.5rem;
}

.radarHeader span {
  color: var(--muted);
  text-align: right;
}

.liveDot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(91, 209, 143, 0.12);
}

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

.radarTab {
  height: 38px;
  min-width: 112px;
  background: rgba(9, 12, 15, 0.42);
  color: var(--muted);
  border-color: var(--line);
}

.radarTab.active {
  color: #14100a;
  border-color: rgba(241, 205, 130, 0.72);
  background: linear-gradient(180deg, var(--accent-strong), #a77730);
}

.radarList {
  display: grid;
  gap: 8px;
}

.radarItem {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 76px;
  padding: 12px;
  border-color: rgba(48, 58, 67, 0.92);
  background: rgba(9, 12, 15, 0.36);
  color: var(--text);
  text-align: left;
}

.radarItem span {
  min-width: 0;
}

.radarItem img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.radarItem strong,
.radarItem small,
.radarItem em,
.radarNumbers b {
  display: block;
}

.radarItem strong {
  overflow-wrap: anywhere;
  font-size: 1.02rem;
  line-height: 1.15;
}

.radarItem small {
  color: var(--muted);
  line-height: 1.25;
}

.radarItem em {
  margin-top: 3px;
  color: #bdd0d8;
  font-size: 0.86rem;
  font-style: normal;
  line-height: 1.28;
}

.radarNumbers {
  color: var(--accent-strong);
  text-align: right;
  white-space: nowrap;
}

.radarNumbers small.positive {
  color: var(--good);
}

.radarNumbers small.negative {
  color: var(--bad);
}

.radarEmpty {
  margin: 0;
  min-height: 72px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer span:first-child {
  color: var(--accent-strong);
  font-weight: 800;
}

.tableWrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 26, 32, 0.9);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.28);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1b232a;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(126, 182, 217, 0.08);
}

.item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}

.item small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.item .englishName {
  color: var(--blue);
}

.positive {
  color: var(--good);
}

.negative {
  color: var(--bad);
}

.signal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.signal.buy {
  border-color: rgba(91, 209, 143, 0.45);
  color: var(--good);
  background: rgba(91, 209, 143, 0.08);
}

.signal.watch {
  border-color: rgba(241, 205, 130, 0.44);
  color: var(--accent-strong);
  background: rgba(241, 205, 130, 0.08);
}

.signal.avoid {
  border-color: rgba(255, 115, 115, 0.45);
  color: var(--bad);
  background: rgba(255, 115, 115, 0.08);
}

.loading,
.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 20px, 1220px);
    padding: 12px 0 28px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    padding: 16px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .brandMark {
    width: 38px;
    height: 38px;
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  h1 {
    font-size: 2.35rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .searchBox {
    grid-column: 1 / -1;
  }

  input,
  button {
    width: 100%;
  }

  .suggestions {
    left: 0;
    right: auto;
    width: 100%;
  }

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

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

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

  .radarHeader span {
    text-align: left;
  }

  .radarTab {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .radarItem {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .radarNumbers {
    grid-column: 2;
    display: flex;
    gap: 10px;
    text-align: left;
  }

  .footer {
    flex-direction: column;
  }
}
