:root {
  --bg: #0d0608;
  --surface: #1a0d11;
  --surface-alt: #251117;
  --ink: #f9edf0;
  --muted: #c9aeb7;

  --gold: #dbc591;
  --gold-soft: #f2e6c8;
  --red-velvet: #9f213c;
  --red-velvet-soft: #c53959;
  --charcoal: #14070b;

  --line: #55202f;
  --line-strong: #7a3248;

  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.32);
  --shadow-deep: 0 24px 54px rgba(0, 0, 0, 0.42);

  --mono: "IBM Plex Mono", monospace;
  --sans: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1300px 700px at 50% -30%, rgba(255, 218, 158, 0.18) 0%, transparent 64%),
    radial-gradient(1200px 700px at 12% 12%, rgba(207, 52, 84, 0.26) 0%, transparent 58%),
    radial-gradient(1200px 700px at 88% 20%, rgba(156, 26, 53, 0.28) 0%, transparent 60%),
    linear-gradient(160deg, #15070b 0%, #2d0d17 42%, #5a1328 52%, #2d0d17 62%, #15070b 100%);
  background-size: 100% 100%, 130% 130%, 130% 130%, 200% 200%;
  animation: carpetFlow 18s ease-in-out infinite alternate;
  background-attachment: fixed;
}

.ambient {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(56px);
  opacity: 0.58;
}

.ambient-a {
  width: 62vw;
  height: 24vh;
  right: -18vw;
  top: 14vh;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 194, 214, 0.18) 0%, rgba(201, 36, 72, 0.58) 65%, rgba(255, 194, 214, 0.16) 100%);
  transform: rotate(-12deg);
  animation: driftA 14s ease-in-out infinite alternate;
}

.ambient-b {
  width: 68vw;
  height: 26vh;
  left: -22vw;
  bottom: 8vh;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 204, 220, 0.14) 0%, rgba(227, 58, 96, 0.5) 48%, rgba(255, 204, 220, 0.14) 100%);
  transform: rotate(9deg);
  animation: driftB 15s ease-in-out infinite alternate;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.95rem clamp(0.85rem, 2vw, 1.6rem);
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(21, 8, 12, 0.94) 0%, rgba(21, 8, 12, 0.8) 100%);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: var(--gold-soft);
}

h1 {
  margin: 0.22rem 0 0;
  font-size: clamp(1.52rem, 2.8vw, 2.26rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.meta p {
  margin: 0.15rem 0;
}

.page {
  max-width: min(1920px, 100vw);
  margin: 0 auto;
  padding: 0.78rem clamp(0.85rem, 1.8vw, 1.6rem) 2.4rem;
}

.controls {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  background: linear-gradient(180deg, rgba(35, 13, 20, 0.9) 0%, rgba(24, 9, 15, 0.86) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 0.88rem;
  box-shadow: var(--shadow-soft);
}

.control-group {
  display: grid;
  gap: 0.42rem;
}

.controls label,
.control-title {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--gold-soft);
  font-weight: 600;
}

.controls input {
  width: min(560px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  min-height: 38px;
  padding: 0.62rem 0.84rem;
  font-size: 0.95rem;
  color: var(--ink);
  font-family: var(--sans);
  background: #17090e;
}

.controls input::placeholder {
  color: #918269;
}

.controls input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.source-switch {
  display: inline-flex;
  width: fit-content;
  min-height: 38px;
  gap: 0.32rem;
  padding: 0.2rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #2c1118 0%, #1d0a11 100%);
}

.source-btn {
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #d7cab1;
  font-family: var(--mono);
  font-size: 0.74rem;
  min-height: 34px;
  padding: 0.34rem 0.66rem;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease;
}

.source-btn:hover {
  background: rgba(207, 173, 102, 0.12);
  border-color: rgba(207, 173, 102, 0.25);
}

.source-btn.is-active {
  background: linear-gradient(180deg, #f0ddaf 0%, #dbc591 100%);
  color: #2a0f16;
  border-color: #f4e5bf;
  font-weight: 700;
}

.source-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.legend {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.46rem;
}

.legend-chip {
  border: 1px solid var(--line-strong);
  background: rgba(207, 173, 102, 0.08);
  color: #dac79f;
  border-radius: 999px;
  padding: 0.3rem 0.64rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
}

.category-nav {
  display: flex;
  gap: 0.46rem;
  overflow-x: auto;
  padding: 0.18rem 0.05rem 0.22rem;
  scrollbar-width: thin;
}

.category-nav-btn {
  border: 1px solid var(--line-strong);
  background: rgba(26, 20, 14, 0.95);
  color: #dcccae;
  border-radius: 999px;
  min-height: 36px;
  padding: 0.34rem 0.66rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease;
}

.category-nav-btn:hover {
  border-color: var(--gold);
  background: rgba(207, 173, 102, 0.12);
}

.category-nav-btn.is-active {
  background: linear-gradient(180deg, #f0ddaf 0%, #dbc591 100%);
  color: #2a0f16;
  border-color: #f4e5bf;
  font-weight: 700;
}

.market-grid {
  display: grid;
  gap: 0.9rem;
}

.category-card {
  background: linear-gradient(180deg, rgba(33, 10, 18, 0.97) 0%, rgba(22, 8, 13, 0.98) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-deep);
  opacity: 0;
  transform: translateY(10px);
  animation: cardIn 300ms ease forwards;
  animation-delay: var(--stagger, 0ms);
  scroll-margin-top: 108px;
}

.category-head {
  padding: 0.9rem 1rem 0.8rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.category-name {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  letter-spacing: 0.01em;
}

.category-sub {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.category-stats {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #b8a98b;
  text-align: right;
}

.award-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.44rem;
  padding: 0.64rem 1rem 0.38rem;
}

.award-pill {
  border: 1px solid var(--line-strong);
  background: rgba(219, 197, 145, 0.12);
  color: #e3d3b1;
  border-radius: 999px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0.26rem 0.58rem;
  font-size: 0.72rem;
}

.award-pill--nom {
  border-color: #ee7d9a;
  background: rgba(159, 33, 60, 0.52);
  color: #ffe3e7;
  font-weight: 700;
}

.chart-wrap {
  width: 100%;
  height: 312px;
  margin: 0.18rem 0.38rem 0.3rem;
  padding: 0.3rem 0.35rem 0.26rem 0.15rem;
  border: 1px solid #2f261d;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(31, 10, 17, 0.92) 0%, rgba(18, 7, 12, 0.95) 100%);
  position: relative;
}

.chart-photo-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 16;
}

.chart-photo-badge {
  position: absolute;
  width: var(--photo-size, 22px);
  height: var(--photo-size, 22px);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #f2e6c8;
  box-shadow:
    0 0 0 1px rgba(30, 11, 16, 0.78),
    0 4px 10px rgba(0, 0, 0, 0.36);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: #2b1219;
  transition:
    width 220ms ease,
    height 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.chart-photo-badge:hover,
.chart-photo-badge:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow:
    0 0 0 1px rgba(30, 11, 16, 0.78),
    0 6px 14px rgba(0, 0, 0, 0.42);
}

.chart-photo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #eedcb7;
  background: #2a1018;
}

th,
td {
  padding: 0.56rem 0.6rem;
  border-bottom: 1px solid #302519;
  white-space: nowrap;
}

tbody tr {
  transition: background 220ms ease;
}

tbody tr:hover,
tbody tr:focus-within {
  background: rgba(219, 197, 145, 0.12);
}

.mono {
  font-family: var(--mono);
}

.market-name {
  display: block;
  font-weight: 500;
}

.nominee-link {
  color: inherit;
  text-decoration: none;
}

.nominee-link:hover,
.nominee-link:focus-visible {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.spark {
  width: 108px;
  height: 30px;
}

.empty {
  margin: 2rem auto;
  max-width: 560px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(18, 15, 12, 0.95);
  color: #d8c8a6;
  text-align: center;
  padding: 1rem;
}

@media (min-width: 1080px) {
  .controls {
    grid-template-columns: minmax(320px, 420px) minmax(360px, 1fr);
    column-gap: 1rem;
    row-gap: 0.72rem;
    align-items: end;
  }

  .control-group--source {
    grid-column: 1;
  }

  .control-group--filter {
    grid-column: 2;
  }

  .control-group--filter input {
    width: 100%;
  }

  .control-group--legend,
  .control-group--jump {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1600px) {
  .page {
    padding-left: 0.72rem;
    padding-right: 0.72rem;
  }

  .topbar {
    padding-left: 0.72rem;
    padding-right: 0.72rem;
  }

  .chart-wrap {
    height: 332px;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: static;
  }

  .controls {
    padding: 0.78rem;
  }

  .chart-wrap {
    height: 262px;
    margin: 0.16rem 0.3rem 0.24rem;
  }
}

@media (max-width: 640px) {
  .meta {
    text-align: left;
  }

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

  .controls input,
  .source-switch {
    width: 100%;
  }

  .source-switch {
    justify-content: space-between;
  }

  .source-btn {
    flex: 1 1 0;
  }

  .chart-wrap {
    height: 230px;
    margin: 0.14rem 0.2rem 0.2rem;
  }
}

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

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes driftA {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(9px) translateX(-22px) rotate(-10deg);
  }
}

@keyframes driftB {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(-11px) translateX(20px) rotate(11deg);
  }
}

@keyframes carpetFlow {
  from {
    background-position:
      center top,
      0% 0%,
      100% 0%,
      0% 50%;
  }
  to {
    background-position:
      center top,
      10% 10%,
      90% 12%,
      100% 50%;
  }
}
