:root {
  --bg: #041329;
  --surface: #0d1c32;
  --surface-2: #112036;
  --surface-3: #1c2a41;
  --text: #d6e3ff;
  --muted: #e5bcc4;
  --pink: #ff4b89;
  --pink-soft: #ffb1c3;
  --cyan: #00eefc;
  --cyan-soft: #7df4ff;
  --gold: #e9c400;
  --green: #39ff14;
  --danger: #ffb4ab;
  --border: rgba(229, 188, 196, 0.22);
  --shadow-pink: 0 0 22px rgba(255, 75, 137, 0.28);
  --shadow-cyan: 0 0 18px rgba(0, 238, 252, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 5%, rgba(255, 75, 137, 0.18), transparent 28rem),
    radial-gradient(circle at 90% 12%, rgba(0, 238, 252, 0.12), transparent 30rem),
    linear-gradient(180deg, #041329 0%, #08111f 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

code {
  color: var(--cyan-soft);
  white-space: pre-wrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 28, 50, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 0 15px rgba(255, 177, 195, 0.14);
}

.brand {
  color: var(--pink-soft);
  font-family: "Sora", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 800;
  font-style: italic;
}

.nav,
.account,
.hero-actions,
.dialog-actions,
.row-actions,
.queue-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav a {
  color: var(--muted);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
}

.nav a.active,
.nav a:hover {
  color: var(--cyan-soft);
  border-bottom-color: var(--cyan);
}

.avatar {
  width: 40px;
  height: 40px;
  border: 2px solid var(--pink);
  border-radius: 50%;
  object-fit: cover;
}

.balance-pill,
.price-badge,
.dialog-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 238, 252, 0.4);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--cyan-soft);
  background: rgba(28, 42, 65, 0.82);
  box-shadow: var(--shadow-cyan);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--pink);
  border-radius: 8px;
  color: white;
  background: var(--pink);
  box-shadow: var(--shadow-pink);
  cursor: pointer;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  min-height: 44px;
  padding: 14px 18px;
  text-transform: uppercase;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.button.ghost {
  color: var(--pink-soft);
  background: transparent;
  box-shadow: none;
}

.button.outline {
  color: var(--cyan-soft);
  border-color: var(--cyan);
  background: transparent;
  box-shadow: none;
}

.button.compact {
  min-height: 36px;
  padding: 10px 12px;
  font-size: 12px;
}

.button.twitch {
  border-color: #9146ff;
  background: #9146ff;
  color: white;
  box-shadow: 0 0 16px rgba(145, 70, 255, 0.3);
}

.hero {
  position: relative;
  min-height: 82vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 96px 24px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 19, 41, 0.15), rgba(4, 19, 41, 0.95)),
    url("https://images.unsplash.com/photo-1550745165-9bc0b252726f?auto=format&fit=crop&w=1800&q=80") center/cover;
  opacity: 0.56;
}

.hero-content {
  position: relative;
  max-width: 880px;
  text-align: center;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 8px 14px;
  border: 1px solid rgba(233, 196, 0, 0.7);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(201, 168, 0, 0.14);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.live-pill strong {
  font: inherit;
}

.live-pill small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.live-pill.offline {
  color: var(--muted);
  border-color: var(--border);
  background: rgba(28, 42, 65, 0.55);
}

.live-pill.offline span {
  background: var(--muted);
  box-shadow: none;
}

.live-pill.unknown,
.live-pill.checking {
  color: var(--gold);
}

.live-pill.unknown span,
.live-pill.checking span {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Sora", system-ui, sans-serif;
}

.hero h1 {
  color: white;
  font-size: clamp(42px, 8vw, 76px);
  font-style: italic;
  font-weight: 800;
  line-height: 1.04;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(255, 75, 137, 0.32);
}

.hero p,
.market-hero p,
.muted,
.info-card p,
.product-card p {
  color: var(--muted);
  line-height: 1.6;
}

.hero p {
  max-width: 680px;
  margin: 24px auto 34px;
  font-size: 18px;
}

.hero-actions {
  justify-content: center;
  flex-wrap: wrap;
}

.feature-band,
.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--cyan-soft);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.section-heading h2,
.market-title h2,
.admin-head h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.feature-grid,
.product-grid,
.stats-row {
  display: grid;
  gap: 20px;
}

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

.info-card,
.product-card,
.queue-panel,
.stat-card,
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 32, 54, 0.78);
  box-shadow: 0 12px 38px rgba(1, 14, 36, 0.38);
}

.info-card {
  padding: 28px;
}

.info-card .material-symbols-outlined {
  color: var(--pink-soft);
  font-size: 44px;
}

.info-card.cyan .material-symbols-outlined {
  color: var(--cyan-soft);
}

.info-card.gold .material-symbols-outlined {
  color: var(--gold);
}

.market-hero {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 44px;
  background:
    linear-gradient(90deg, rgba(8, 17, 31, 0.96), rgba(8, 17, 31, 0.58), rgba(8, 17, 31, 0.22)),
    url("https://images.unsplash.com/photo-1542751371-adc38448a05e?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.market-hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  font-style: italic;
  text-transform: uppercase;
}

.market-title,
.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 36px 0 20px;
}

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

.product-card {
  display: flex;
  min-height: 360px;
  overflow: hidden;
  flex-direction: column;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 75, 137, 0.6);
  box-shadow: 0 16px 34px rgba(255, 75, 137, 0.12);
}

.product-icon {
  position: relative;
  min-height: 150px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(255, 75, 137, 0.2), transparent 58%),
    var(--surface-3);
}

.product-icon .material-symbols-outlined {
  color: var(--pink-soft);
  font-size: 64px;
  text-shadow: 0 0 16px rgba(255, 177, 195, 0.5);
}

.tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  color: #221b00;
  background: var(--gold);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.product-body h3 {
  font-size: 19px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--cyan-soft);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.redeem-dialog {
  width: min(520px, calc(100% - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
}

.redeem-dialog::backdrop {
  background: rgba(1, 14, 36, 0.78);
  backdrop-filter: blur(4px);
}

.dialog-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface-2);
}

.icon-button.close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: var(--border);
  background: transparent;
  box-shadow: none;
}

.dialog-price {
  margin: 16px 0;
}

.dynamic-fields {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--bg);
  padding: 12px;
  resize: vertical;
}

.field textarea {
  min-height: 116px;
}

.message {
  min-height: 22px;
  color: var(--muted);
}

.message.success {
  color: var(--green);
}

.message.error,
.empty-state.error {
  color: var(--danger);
}

.admin-shell {
  padding-top: 48px;
}

.stats-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.stat-card {
  padding: 20px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 38px;
}

.queue-panel {
  padding: 18px;
}

.api-docs {
  margin-top: 28px;
}

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

.doc-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 32, 54, 0.78);
  box-shadow: 0 12px 38px rgba(1, 14, 36, 0.38);
  padding: 20px;
}

.doc-card h3 {
  font-size: 18px;
}

.doc-card p {
  color: var(--muted);
  line-height: 1.55;
}

.doc-card pre {
  overflow-x: auto;
  margin: 14px 0 0;
  border: 1px solid rgba(0, 238, 252, 0.22);
  border-radius: 8px;
  background: rgba(1, 14, 36, 0.72);
  padding: 14px;
}

.doc-card pre code {
  color: var(--cyan-soft);
  white-space: pre;
}

.queue-toolbar {
  margin-bottom: 18px;
}

.segmented {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  padding: 10px 14px;
}

.segmented.active {
  color: var(--bg);
  border-color: var(--cyan);
  background: var(--cyan);
}

.redeem-list {
  display: grid;
  gap: 12px;
}

.redeem-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: rgba(4, 19, 41, 0.58);
}

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

.row-title span {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--bg);
  background: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.redeem-row p {
  color: var(--muted);
  margin: 6px 0;
}

.empty-state,
.panel {
  padding: 28px;
  text-align: center;
}

.page.narrow {
  width: min(760px, calc(100% - 32px));
  margin: 80px auto;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 34px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1050px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .topbar,
  .market-title,
  .admin-head,
  .redeem-row,
  .market-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .account {
    flex-wrap: wrap;
  }

  .product-grid,
  .stats-row,
  .docs-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 72vh;
  }

  .market-hero {
    padding: 28px;
  }
}
