:root {
  color-scheme: dark;
  --bg: #0b1116;
  --surface: #111a21;
  --surface-2: #17242b;
  --line: #28414b;
  --text: #eef7f8;
  --muted: #9bb1b8;
  --teal: #66d6de;
  --green: #7ee2a8;
  --gold: #f4c967;
  --coral: #ff8975;
  --blue: #88a8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(102, 214, 222, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(244, 201, 103, 0.1), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.is-hidden {
  display: none !important;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  padding: 8px;
  border: 1px solid rgba(49, 89, 100, 0.8);
  border-radius: 999px;
  background: rgba(9, 16, 22, 0.84);
  backdrop-filter: blur(14px);
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a.active {
  background: rgba(102, 214, 222, 0.14);
  color: var(--text);
}

.top-nav a.active {
  border: 1px solid rgba(102, 214, 222, 0.54);
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: end;
  padding: 18px 0 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 52px;
  line-height: 1.02;
  white-space: nowrap;
}

h2 {
  font-size: 22px;
}

.lede {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.status-card,
.metric,
.panel,
.controls {
  background: color-mix(in srgb, var(--surface) 92%, black);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.status-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.masthead-side {
  display: grid;
  gap: 12px;
  justify-items: end;
  align-self: end;
}

.language-toggle {
  min-height: 34px;
  padding: 0 14px;
  border-color: var(--line);
  border-radius: 999px;
  background: rgba(17, 26, 33, 0.92);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.language-toggle:hover {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(102, 214, 222, 0.1);
}

.status-card strong,
.status-card span {
  display: block;
}

.status-card strong {
  margin-bottom: 4px;
}

.status-card span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(244, 201, 103, 0.12);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(126, 226, 168, 0.12);
}

.status-dot.bad {
  background: var(--coral);
  box-shadow: 0 0 0 6px rgba(255, 137, 117, 0.12);
}

.controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-note {
  display: block;
  margin-top: 6px;
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #091016;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(102, 214, 222, 0.12);
}

.ad-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.ad-banner {
  position: relative;
  height: 86px;
  overflow: hidden;
  padding: 11px 18px;
  border: 1px solid #315964;
  border-radius: 8px;
  background: #142027;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  animation: adPulse 2.7s ease-in-out infinite;
}

.ad-banner::before {
  position: absolute;
  inset: -70% auto -70% -30%;
  width: 48px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  filter: blur(1px);
  transform: rotate(18deg);
  animation: adShine 3.2s ease-in-out infinite;
}

.ad-banner strong,
.ad-banner em {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.ad-banner strong {
  color: #ffffff;
  font-size: clamp(25px, 2.05vw, 31px);
  line-height: 1;
}

.ad-banner em {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.12;
  font-style: normal;
  font-weight: 800;
}

.ad-banner-wide {
  grid-column: 1 / -1;
}

.ad-banner-blue {
  background:
    linear-gradient(100deg, rgba(0, 103, 210, 0.98), rgba(9, 31, 88, 0.98)),
    var(--surface);
}

.ad-banner-gold {
  background:
    linear-gradient(100deg, rgba(244, 201, 103, 0.98), rgba(150, 28, 51, 0.98)),
    var(--surface);
}

.ad-banner-gold::before {
  animation-delay: 0.7s;
}

.ad-banner-web3 {
  background:
    linear-gradient(100deg, rgba(42, 92, 255, 0.98), rgba(123, 45, 211, 0.98) 47%, rgba(17, 185, 156, 0.98)),
    var(--surface);
}

.ad-banner-web3 strong {
  font-size: clamp(24px, 2vw, 30px);
}

.ad-banner-web3::before {
  animation-delay: 0.35s;
}

.ad-banner-cyan {
  background:
    linear-gradient(100deg, rgba(16, 138, 139, 0.98), rgba(11, 55, 94, 0.98)),
    var(--surface);
}

.ad-banner-cyan::before {
  animation-delay: 1.1s;
}

.ad-banner-red {
  background:
    linear-gradient(100deg, rgba(255, 137, 117, 0.98), rgba(117, 25, 65, 0.98)),
    var(--surface);
}

.ad-banner-red::before {
  animation-delay: 1.6s;
}

.home-market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.home-kpi,
.pool-card {
  border: 1px solid #315964;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 26, 33, 0.98), rgba(11, 17, 22, 0.98)),
    var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.home-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.home-kpi {
  min-height: 112px;
  padding: 18px;
}

.home-kpi span,
.home-kpi em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.home-kpi span {
  font-size: 13px;
  font-weight: 850;
}

.home-kpi strong {
  display: block;
  margin: 8px 0 3px;
  color: var(--teal);
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.home-kpi em {
  font-size: 13px;
  font-weight: 750;
}

.market-kpi {
  min-height: 104px;
  background:
    linear-gradient(180deg, rgba(16, 31, 38, 0.98), rgba(11, 17, 22, 0.98)),
    var(--surface);
}

.market-kpi strong {
  color: var(--green);
  font-size: 25px;
}

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

.pool-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.pool-card.best {
  border-color: rgba(126, 226, 168, 0.78);
  box-shadow: 0 18px 54px rgba(126, 226, 168, 0.12);
}

.pool-card.best::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, rgba(126, 226, 168, 0.14), transparent 45%);
  pointer-events: none;
}

.pool-card-head,
.pool-card-main,
.pool-card-metrics,
.pool-card-link {
  position: relative;
}

.pool-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.pool-card-head span,
.pool-card-main span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pool-card-head strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 24px;
}

.pool-card-head em {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(244, 201, 103, 0.13);
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.pool-card-main {
  margin: 18px 0 14px;
}

.pool-card-main strong {
  display: block;
  margin: 7px 0 2px;
  color: var(--teal);
  font-size: 34px;
  line-height: 1;
}

.pool-card-main em {
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
}

.pool-card-metrics {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}

.pool-card-metrics span {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.pool-card-metrics strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.pool-card-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  background: var(--teal);
  color: #041216;
  font-weight: 850;
  text-decoration: none;
}

.compare-table-wrap {
  margin-top: 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 20px 0 22px;
}

.metric {
  min-height: 128px;
  padding: 22px 26px;
  border-color: #315964;
  background:
    linear-gradient(180deg, rgba(17, 26, 33, 0.98), rgba(11, 17, 22, 0.98)),
    var(--surface);
}

.metric span,
.metric em {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0;
}

.metric strong {
  display: block;
  margin: 10px 0 2px;
  color: var(--teal);
  font-size: clamp(30px, 2.6vw, 40px);
  line-height: 1.08;
  font-weight: 850;
}

.metric em {
  color: var(--muted);
  font-size: clamp(16px, 1.35vw, 21px);
  font-weight: 700;
  font-style: normal;
}

.panel {
  padding: 18px;
  margin-top: 18px;
}

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

button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--teal);
  color: #041216;
  font-weight: 800;
  cursor: pointer;
}

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

.table-tools {
  display: grid;
  grid-template-columns: 220px 150px;
  gap: 10px;
}

@keyframes adPulse {
  0%,
  100% {
    border-color: #315964;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 16px 48px rgba(255, 137, 117, 0.28);
  }
}

@keyframes adShine {
  0%,
  42% {
    left: -45%;
    opacity: 0;
  }
  52% {
    opacity: 1;
  }
  72%,
  100% {
    left: 118%;
    opacity: 0;
  }
}

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

.daily-stat-card {
  min-height: 118px;
  padding: 20px 24px;
  border: 1px solid #315964;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 26, 33, 0.98), rgba(11, 17, 22, 0.98)),
    var(--surface);
}

.daily-stat-card span,
.daily-stat-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.daily-stat-card span {
  font-size: 15px;
  font-weight: 850;
}

.daily-stat-card strong {
  display: block;
  margin: 10px 0 4px;
  color: var(--teal);
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.08;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.daily-stat-card em {
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.error-card strong {
  color: var(--coral);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

td {
  color: #dbe8ea;
}

tr:last-child td {
  border-bottom: 0;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

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

.rent-cell,
.rent-cell span {
  color: var(--coral);
  font-weight: 800;
}

.rent-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  background: var(--coral);
  color: #210905;
  font-weight: 850;
  text-decoration: none;
}

.rent-card-link:hover {
  filter: brightness(1.08);
}

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

.empty {
  padding: 36px 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .masthead,
  .controls,
  .metric-grid,
  .home-market-grid,
  .pool-compare-grid {
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: flex-start;
    overflow-x: auto;
    border-radius: 8px;
  }

  .masthead-side {
    justify-items: stretch;
  }

  h1 {
    font-size: 42px;
  }

  .language-toggle {
    justify-self: end;
  }

  .ad-strip {
    grid-template-columns: 1fr;
  }

  .daily-stat-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .table-tools {
    grid-template-columns: 1fr;
  }
}
