:root {
  color-scheme: dark;
  --board-bg: #080806;
  --board-surface: #11110e;
  --board-surface-strong: #181711;
  --board-gold: #e3bd45;
  --board-gold-soft: #f5da7b;
  --board-text: #fffdf5;
  --board-muted: #a9a598;
  --board-line: rgba(227, 189, 69, 0.22);
  --board-buy: #f6f1df;
  --board-sell: #f4c84b;
  --board-live: #4ad39a;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--board-bg);
}

body {
  color: var(--board-text);
}

button,
a {
  font: inherit;
}

.price-board {
  position: relative;
  display: grid;
  grid-template-rows: minmax(112px, 17vh) minmax(0, 1fr) minmax(76px, 11vh);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: clamp(18px, 2vw, 38px) clamp(22px, 3vw, 58px);
  overflow: hidden;
  background:
    radial-gradient(circle at 6% 8%, rgba(227, 189, 69, 0.13), transparent 21%),
    radial-gradient(circle at 93% 88%, rgba(227, 189, 69, 0.08), transparent 24%),
    linear-gradient(135deg, #080806 0%, #0d0c09 56%, #070706 100%);
}

.price-board::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(var(--board-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--board-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 34%);
}

.board-header,
.board-table,
.board-footer {
  position: relative;
  z-index: 1;
}

.board-header {
  display: grid;
  grid-template-columns: minmax(210px, 0.85fr) minmax(380px, 1.6fr) minmax(250px, 0.85fr);
  align-items: center;
  gap: clamp(18px, 2vw, 42px);
  border-bottom: 1px solid var(--board-line);
}

.board-brand {
  display: inline-flex;
  align-items: center;
  width: min(100%, 360px);
  height: 100%;
}

.board-brand img {
  display: block;
  width: 100%;
  max-height: 92px;
  object-fit: contain;
  object-position: left center;
}

.board-heading {
  text-align: center;
}

.board-heading span {
  color: var(--board-gold);
  font-size: clamp(0.68rem, 0.8vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.18em;
}

.board-heading h1 {
  margin: 0.25em 0 0.08em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.2vw, 4.5rem);
  line-height: 0.95;
}

.board-heading p {
  margin: 0;
  color: var(--board-muted);
  font-size: clamp(0.8rem, 0.95vw, 1.15rem);
}

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

.board-clock {
  color: var(--board-gold-soft);
  font-size: clamp(1.8rem, 2.7vw, 3.6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.board-tool-actions {
  display: flex;
  gap: 8px;
}

.board-tool-actions a,
.board-tool-actions button {
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--board-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--board-text);
  cursor: pointer;
  text-decoration: none;
}

.board-tool-actions a:hover,
.board-tool-actions button:hover,
.board-tool-actions a:focus-visible,
.board-tool-actions button:focus-visible {
  border-color: var(--board-gold);
  outline: none;
}

.board-table {
  display: grid;
  grid-template-rows: minmax(42px, 7vh) minmax(0, 1fr);
  min-height: 0;
  padding: clamp(10px, 1.4vh, 20px) 0;
}

.board-table-header,
.board-price-row {
  display: grid;
  grid-template-columns: minmax(300px, 1.3fr) minmax(210px, 1fr) minmax(210px, 1fr);
  align-items: center;
  column-gap: clamp(14px, 2vw, 36px);
}

.board-table-header {
  padding: 0 clamp(18px, 1.7vw, 32px);
  color: var(--board-muted);
  font-size: clamp(0.78rem, 0.95vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.board-table-header span:nth-child(n + 2) {
  text-align: center;
}

.board-price-list {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  min-height: 0;
  gap: clamp(6px, 0.8vh, 12px);
}

.board-price-row {
  position: relative;
  min-height: 0;
  padding: clamp(8px, 1vh, 15px) clamp(18px, 1.7vw, 32px);
  overflow: hidden;
  border: 1px solid var(--board-line);
  border-radius: clamp(10px, 1vw, 18px);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.025), rgba(227, 189, 69, 0.055));
}

.board-price-row::after {
  position: absolute;
  top: 14%;
  right: 0;
  width: 4px;
  height: 72%;
  border-radius: 4px 0 0 4px;
  background: var(--board-gold);
  content: "";
}

.board-product {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: clamp(13px, 1.5vw, 26px);
}

.board-product-icon {
  display: grid;
  flex: 0 0 auto;
  width: clamp(46px, 4.3vw, 78px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(227, 189, 69, 0.4);
  border-radius: 50%;
  background: rgba(227, 189, 69, 0.09);
  color: var(--board-gold-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 2.5rem);
  font-weight: 700;
}

.board-product strong,
.board-product small {
  display: block;
}

.board-product strong {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.4vw, 3.2rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-product small {
  margin-top: 0.4em;
  color: var(--board-muted);
  font-size: clamp(0.68rem, 0.8vw, 1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-value {
  padding: 0.18em 0.25em;
  border-radius: 10px;
  font-size: clamp(1.65rem, 3.25vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.board-value-buy {
  color: var(--board-buy);
}

.board-value-sell {
  color: var(--board-sell);
}

.board-value.price-up {
  background: rgba(48, 190, 124, 0.2);
  color: #77efb8;
  transform: scale(1.025);
}

.board-value.price-down {
  background: rgba(217, 77, 77, 0.2);
  color: #ff9696;
  transform: scale(1.025);
}

.board-footer {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(330px, 1.2fr);
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--board-line);
  color: var(--board-muted);
  font-size: clamp(0.68rem, 0.78vw, 0.95rem);
}

.board-feed {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.board-feed strong,
.board-feed span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-feed-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--board-live);
  box-shadow: 0 0 0 5px rgba(74, 211, 154, 0.1);
}

.board-feed.status-cached .board-feed-dot {
  background: #e3a745;
  box-shadow: 0 0 0 5px rgba(227, 167, 69, 0.1);
}

.board-feed.status-unavailable .board-feed-dot {
  background: #dd6565;
  box-shadow: 0 0 0 5px rgba(221, 101, 101, 0.1);
}

.board-updated {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.board-updated time {
  color: var(--board-text);
  font-variant-numeric: tabular-nums;
}

.board-footer p {
  margin: 0;
  text-align: right;
}

@media (max-width: 950px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .price-board {
    display: block;
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }

  .board-header {
    grid-template-columns: 1fr;
    padding-bottom: 20px;
    text-align: center;
  }

  .board-brand {
    justify-self: center;
  }

  .board-brand img {
    object-position: center;
  }

  .board-tools {
    align-items: center;
  }

  .board-table-header {
    display: none;
  }

  .board-table {
    display: block;
  }

  .board-price-list {
    display: grid;
    gap: 10px;
  }

  .board-price-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 16px;
  }

  .board-product {
    grid-column: 1 / -1;
  }

  .board-footer {
    grid-template-columns: 1fr;
    padding: 18px 0;
    text-align: center;
  }

  .board-feed,
  .board-updated {
    justify-content: center;
  }

  .board-footer p {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
