:root {
  --bg: #071018;
  --surface: rgba(10, 18, 27, 0.8);
  --surface-strong: rgba(14, 22, 32, 0.94);
  --border: rgba(123, 164, 208, 0.16);
  --text: #eef6ff;
  --text-soft: #96adc3;
  --accent: #f5b86a;
  --accent-strong: #ffd18f;
  --accent-cool: #63d8d0;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  --radius: 24px;
  --shell: min(1400px, calc(100vw - 32px));
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(99, 216, 208, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(245, 184, 106, 0.16), transparent 28%),
    linear-gradient(180deg, #091019 0%, #05090d 100%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  overflow-x: hidden;
}

a {
  color: var(--accent-strong);
}

button,
input,
select {
  font: inherit;
}

.backdrop {
  pointer-events: none;
  position: fixed;
  z-index: 0;
  filter: blur(24px);
  opacity: 0.8;
}

.backdrop-a {
  top: 8%;
  right: -5rem;
  width: 23rem;
  height: 23rem;
  background: rgba(245, 184, 106, 0.16);
}

.backdrop-b {
  bottom: 8%;
  left: -6rem;
  width: 28rem;
  height: 28rem;
  background: rgba(99, 216, 208, 0.14);
}

.grid-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 92%);
}

.shell {
  position: relative;
  z-index: 1;
  width: var(--shell);
  margin: 0 auto;
}

.surface {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 24px;
  padding: 46px 0 26px;
  align-items: stretch;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  max-width: 12ch;
}

.lede {
  max-width: 64ch;
  color: var(--text-soft);
  font-size: 1.04rem;
  line-height: 1.72;
  margin: 18px 0 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-cool);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
}

.hero-panel,
.controls,
.results,
.insight-panel,
.stat-card,
.dialog-shell {
  padding: 22px;
}

.hero-actions,
.status-row,
.chip-row,
.toggle-group,
.pagination,
.card-actions,
.card-stats,
.table-actions,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 24px;
}

.status-pill,
.chip,
.toggle-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 14px;
}

.status-pill {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-meta {
  margin-top: 20px;
}

.status-meta p {
  margin: 0 0 10px;
  color: var(--text-soft);
  line-height: 1.6;
}

.notice-banner {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(245, 184, 106, 0.08);
  border: 1px solid rgba(245, 184, 106, 0.18);
  color: #ffe2af;
  line-height: 1.55;
}

.main-layout {
  display: grid;
  gap: 24px;
  padding-bottom: 48px;
}

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

.stat-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.stat-card strong {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
}

.control-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 0.85fr) auto;
  gap: 14px;
  align-items: end;
}

.control-row + .control-row {
  margin-top: 20px;
}

.control-row.stacked {
  grid-template-columns: 1fr;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.search-field input,
.select-field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

.search-field input:focus,
.select-field select:focus {
  border-color: rgba(99, 216, 208, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 216, 208, 0.1);
}

.button,
.icon-button,
.chip,
.toggle-button {
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button:hover,
.icon-button:hover,
.chip:hover,
.toggle-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #f9d391);
  color: #231808;
}

.button-ghost,
.icon-button {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.chip.is-active,
.toggle-button.is-active {
  background: rgba(99, 216, 208, 0.16);
  border-color: rgba(99, 216, 208, 0.34);
  color: #defbf8;
}

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

.section-header h2,
.results-header h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.section-header p,
.results-header p,
.results-note,
.site-footer p,
.detail-block p {
  color: var(--text-soft);
}

.leaderboard-list,
.insight-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.leaderboard-item,
.insight-list li {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.results-header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 20px;
}

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

.order-card {
  border-radius: 22px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    linear-gradient(135deg, rgba(99, 216, 208, 0.06), transparent 38%);
  display: grid;
  gap: 16px;
}

.card-topline {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

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

.item-orb {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-family: "IBM Plex Mono", monospace;
  color: #221504;
  font-size: 0.92rem;
  background: linear-gradient(135deg, #ffd99e, #63d8d0);
}

.item-title h3 {
  margin: 0;
  font-size: 1.08rem;
}

.item-title p,
.card-meta,
.site-footer p {
  margin: 4px 0 0;
}

.badge {
  border-radius: 999px;
  padding: 7px 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.price-value {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.mini-stat {
  display: grid;
  gap: 4px;
}

.mini-stat strong {
  font-size: 1rem;
}

.mini-stat span {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-cool), var(--accent));
}

.table-wrapper {
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th,
.orders-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.orders-table th {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 500;
}

.pagination {
  justify-content: center;
  align-items: center;
  margin-top: 22px;
}

.empty-state {
  padding: 42px 18px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 0 0 42px;
}

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

.detail-dialog {
  width: min(760px, calc(100vw - 24px));
  border: 0;
  background: transparent;
  padding: 0;
}

.detail-dialog::backdrop {
  background: rgba(4, 9, 14, 0.76);
  backdrop-filter: blur(8px);
}

.dialog-shell {
  margin: auto;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.dialog-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.dialog-content {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-block {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-block h4 {
  margin: 0 0 10px;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 860px) {
  .stats-grid,
  .orders-grid,
  .detail-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

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

  .hero {
    padding-top: 32px;
  }

  .hero h1 {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .hero-panel,
  .controls,
  .results,
  .insight-panel,
  .stat-card,
  .dialog-shell {
    padding: 18px;
  }

  .item-title,
  .card-topline,
  .card-actions,
  .card-stats {
    align-items: start;
    flex-direction: column;
  }
}
