:root {
  color-scheme: dark;
  --bg: #050905;
  --bg-2: #0a110b;
  --panel: rgba(17, 25, 17, 0.92);
  --panel-2: rgba(25, 36, 23, 0.92);
  --line: rgba(167, 197, 125, 0.26);
  --line-strong: rgba(167, 197, 125, 0.52);
  --text: #f5f8ee;
  --muted: #aeb99f;
  --soft: #d8e2c8;
  --accent: #a7c57d;
  --accent-2: #6f8d52;
  --accent-3: #d6ed9a;
  --danger: #e77d64;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 86% 14%, rgba(111, 141, 82, 0.26), transparent 34rem),
    linear-gradient(180deg, var(--bg) 0%, #080d08 50%, #030503 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "WOLGRAD MARKET";
  z-index: -1;
  display: grid;
  place-items: center;
  color: rgba(167, 197, 125, 0.035);
  font-family: Cinzel, serif;
  font-size: clamp(5rem, 18vw, 18rem);
  font-weight: 800;
  line-height: 0.8;
  text-align: center;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 9, 5, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
.account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.brand {
  font-weight: 900;
}

.account {
  justify-content: flex-end;
}

.brand-mark,
.empty-art,
.reward-icon,
.avatar.fallback {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(167, 197, 125, 0.1);
  color: var(--accent-3);
  font-size: 0.75rem;
  font-weight: 900;
}

.brand-mark {
  width: 42px;
  height: 42px;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.tab-button,
.discord-login,
.logout-btn,
.primary-link,
.secondary-link,
.submit-btn,
.item-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 31, 18, 0.86);
  color: var(--soft);
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, color 160ms ease;
}

.tab-button {
  min-width: 112px;
  padding: 0 18px;
}

.tab-button.active,
.discord-login,
.primary-link,
.submit-btn,
.item-button {
  border-color: rgba(167, 197, 125, 0.76);
  background: rgba(91, 118, 65, 0.55);
  color: #faffef;
}

.tab-button:hover,
.discord-login:hover,
.logout-btn:hover,
.primary-link:hover,
.secondary-link:hover,
.submit-btn:hover,
.item-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.discord-login,
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.discord-login.disabled {
  pointer-events: none;
  opacity: 0.66;
}

.points-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-3);
  background: rgba(167, 197, 125, 0.08);
  white-space: nowrap;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  object-fit: cover;
}

.account-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--soft);
}

.logout-btn {
  min-height: 36px;
  padding: 0 12px;
}

.hero {
  position: relative;
  min-height: min(760px, calc(100svh - 64px));
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 72px 22px 90px;
}

.hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.giant-word {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  color: transparent;
  -webkit-text-stroke: 1px rgba(167, 197, 125, 0.12);
  font-family: Cinzel, serif;
  font-size: clamp(5rem, 17vw, 17rem);
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero-pokemon {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 26px 38px rgba(0, 0, 0, 0.48));
  opacity: 0;
  animation: float-in 900ms ease forwards, hover-float 5.6s ease-in-out infinite;
}

.magearna {
  right: clamp(16px, 10vw, 170px);
  top: clamp(80px, 14vw, 130px);
  width: clamp(170px, 22vw, 330px);
}

.snorlax {
  left: clamp(8px, 10vw, 160px);
  bottom: clamp(16px, 8vw, 80px);
  width: clamp(150px, 18vw, 260px);
  animation-delay: 140ms, -1.8s;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  animation: reveal 680ms 160ms ease forwards;
}

.kicker,
.section-label {
  margin: 0;
  color: var(--accent-3);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Cinzel, Georgia, serif;
  letter-spacing: 0;
}

h1 {
  margin: 10px 0 18px;
  font-size: clamp(3.3rem, 9vw, 8.4rem);
  line-height: 0.88;
}

h2 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 0.98;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.hero-copy p:not(.kicker),
.view-head p,
.catalog-title p,
.selected-preview p,
.reward-card p,
.info-panel p,
.info-panel li {
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy p:not(.kicker) {
  max-width: 560px;
  margin-inline: auto;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.primary-link {
  min-width: 160px;
}

.secondary-link {
  background: rgba(6, 11, 6, 0.68);
}

.app-shell {
  width: min(1260px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: reveal 240ms ease both;
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.view-head.split {
  align-items: center;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 10, 0.78);
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 13px 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 197, 125, 0.12);
}

.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 24px;
  align-items: start;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 14px;
}

.catalog-item,
.offer-panel,
.info-panel,
.reward-card,
.points-card,
.reward-flow {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.catalog-item {
  min-height: 264px;
  display: grid;
  grid-template-rows: 132px 1fr auto;
  gap: 12px;
  padding: 14px;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.catalog-item:hover,
.catalog-item:focus-within {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.catalog-art {
  display: grid;
  place-items: center;
  min-height: 132px;
}

.catalog-art img,
.selected-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.36));
}

.catalog-title h3 {
  margin: 0 0 6px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.item-button,
.submit-btn {
  width: 100%;
}

.item-button:disabled,
.submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.offer-panel {
  position: sticky;
  top: 84px;
  padding: 18px;
}

.selected-preview {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 112px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.selected-preview img,
.empty-art {
  width: 86px;
  height: 86px;
}

form {
  display: grid;
  gap: 14px;
}

.fine-print {
  margin: 0;
  color: var(--accent-3);
  font-size: 0.82rem;
  line-height: 1.4;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.success {
  color: var(--accent-3);
}

.error,
.error-text {
  color: var(--danger);
}

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

.points-card {
  min-width: 168px;
  padding: 18px 20px;
  text-align: center;
}

.points-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.points-card strong {
  color: var(--accent-3);
  font-size: 2rem;
}

.loyalty-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.4fr);
  gap: 18px;
}

.info-panel {
  padding: 22px;
}

.info-panel ol {
  margin: 0;
  padding-left: 20px;
}

.info-panel li + li {
  margin-top: 12px;
}

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

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 5, 0.5);
}

.history-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row span {
  color: var(--accent-3);
}

.history-row small {
  color: var(--muted);
}

.reward-flow {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  color: var(--soft);
}

.reward-flow span::after {
  content: ">";
  margin-left: 12px;
  color: var(--accent-2);
}

.reward-flow span:last-child::after {
  content: "";
}

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

.reward-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  min-height: 250px;
}

.reward-icon {
  width: 64px;
  height: 64px;
  border-radius: 8px;
}

.reward-card strong {
  color: var(--accent-3);
}

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

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

@keyframes float-in {
  to {
    opacity: 0.92;
  }
}

@keyframes hover-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0;
  }

  .brand,
  .account {
    justify-content: center;
  }

  .topbar,
  .hero {
    position: relative;
  }

  .market-layout,
  .loyalty-grid {
    grid-template-columns: 1fr;
  }

  .offer-panel {
    position: static;
  }

  .view-head,
  .view-head.split {
    align-items: stretch;
    flex-direction: column;
  }

  .filters {
    width: 100%;
  }
}

@media (max-width: 720px) {
  body::before {
    place-items: start center;
    padding-top: 160px;
  }

  .topbar {
    min-height: 0;
  }

  .brand {
    padding-top: 6px;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 12px 2px;
  }

  .tab-button {
    min-width: 104px;
    padding: 0 12px;
  }

  .account {
    padding-bottom: 6px;
    flex-wrap: wrap;
  }

  .account-name {
    max-width: 100px;
  }

  .hero {
    min-height: 600px;
    padding: 220px 18px 56px;
    place-items: end center;
  }

  .magearna {
    right: 14px;
    top: 40px;
    width: 190px;
  }

  .snorlax {
    left: 10px;
    top: 98px;
    bottom: auto;
    width: 138px;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 4.8rem);
  }

  .hero-actions,
  .filters,
  .reward-flow {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 24px, 1260px);
    padding-top: 28px;
  }

  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  }

  .catalog-item {
    min-height: 242px;
    grid-template-rows: 112px 1fr auto;
  }

  .selected-preview {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .selected-preview img,
  .empty-art {
    width: 72px;
    height: 72px;
  }

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

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