:root {
  --bg-0: #0b0711;
  --bg-1: #140b1d;
  --surface: rgba(31, 20, 43, 0.96);
  --text: #f4ebff;
  --muted: #c5b7d8;
  --pink: #f77df6;
  --cyan: #33dcff;
  --lime: #c7ff54;
  --danger: #ef426f;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 20% 12%, rgba(247, 125, 246, 0.18), transparent 28%),
    radial-gradient(circle at 86% 22%, rgba(51, 220, 255, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
}

.shop-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(10px, env(safe-area-inset-top)) 14px max(10px, env(safe-area-inset-bottom));
}

.shop-card {
  width: min(94vw, 520px);
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 14px auto minmax(30px, auto);
  gap: clamp(8px, 1.6dvh, 14px);
  overflow: hidden;
  border-radius: 20px;
  padding: clamp(12px, 3.6vw, 22px);
  background: linear-gradient(180deg, rgba(47, 31, 61, 0.98), rgba(22, 14, 31, 0.98));
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.shop-header {
  display: grid;
  gap: clamp(5px, 1dvh, 8px);
}

.shop-kicker {
  margin: 0;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.shop-header h1 {
  margin: 0;
  color: var(--pink);
  font-size: clamp(1.9rem, 8.4vw, 3.1rem);
  line-height: 0.95;
}

.shop-balance {
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(8, 6, 14, 0.56);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.shop-balance strong {
  color: var(--lime);
  font-size: 1rem;
}

.shop-carousel {
  min-height: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: stretch;
  gap: 8px;
}

.shop-arrow {
  width: 44px;
  height: 58px;
  align-self: center;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  font-size: 2rem;
  font-weight: 900;
}

.shop-cosmetic {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(96px, 15dvh, 122px);
  justify-items: center;
  align-items: center;
  gap: clamp(8px, 1.5dvh, 14px);
}

.shop-card-preview-wrap {
  width: min(58vw, 230px, calc((100dvh - 330px) * 0.72));
  min-width: 150px;
  max-height: 100%;
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
}

.shop-card-preview {
  --card-border-width: 5px;
  --card-inner-border-width: 3px;
  --card-radius: 18px;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  position: relative;
  overflow: hidden;
  color: #3b82f6;
}

.shop-card-preview::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.34);
}

.shop-card-preview::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 32%),
    rgba(0, 0, 0, 0.02);
}

.shop-card-preview.card-back {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 22%),
    var(--card-back-cosmetic-image, linear-gradient(135deg, rgba(255,255,255,0.16), transparent 34%)),
    linear-gradient(180deg, #10162a 0%, #050711 100%);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow:
    inset 0 0 0 var(--card-border-width) currentColor,
    inset 0 0 0 calc(var(--card-border-width) + 2px) rgba(255,255,255,0.2);
}

.shop-card-preview.card-back.locked {
  filter: blur(7px) saturate(0.72) brightness(0.7);
}

.shop-card-preview.card-back.locked::after {
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(5, 5, 12, 0.64), rgba(5, 5, 12, 0.84));
}

.shop-card-preview.card-back-cosmetic-classic {
  background-image:
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M8,1 L15,8 L8,15 L1,8 Z" fill="none" stroke="white" stroke-width="1" opacity="0.22"/></svg>');
  background-repeat: repeat;
  background-color: #1d4ed8;
  background-size: 16px 16px;
}

.shop-card-preview.card-back-cosmetic-midnight-stars {
  --card-back-cosmetic-image:
    radial-gradient(circle at 18% 16%, rgba(255,255,255,0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 28%, rgba(51,220,255,0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 38% 70%, rgba(247,125,246,0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 82%, rgba(255,255,255,0.8) 0 2px, transparent 3px),
    linear-gradient(180deg, #060913 0%, #10162a 100%);
}

.shop-card-preview.card-back-cosmetic-neon-table {
  --card-back-cosmetic-image:
    repeating-linear-gradient(45deg, rgba(199,255,84,0.18) 0 7px, transparent 7px 17px),
    radial-gradient(circle at 50% 24%, rgba(51,220,255,0.55), transparent 34%),
    linear-gradient(160deg, #1a1040 0%, #052e3e 100%);
}

.shop-card-preview.card-back-cosmetic-royal-felt {
  --card-back-cosmetic-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 8px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.07) 0 2px, transparent 2px 10px),
    linear-gradient(180deg, #0f6f43 0%, #05341f 100%);
}

.shop-cosmetic-copy {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 2.15em 2.7em 1.45em;
  align-content: start;
  text-align: center;
}

.shop-cosmetic-copy h2 {
  margin: 0;
  font-size: clamp(1.35rem, 5.6vw, 1.95rem);
  line-height: 1.08;
  overflow: hidden;
}

.shop-cosmetic-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
}

.shop-cost {
  margin-top: 0 !important;
  color: var(--lime) !important;
  font-weight: 900;
  line-height: 1.25 !important;
  text-transform: uppercase;
}

.shop-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.shop-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
}

.shop-dot.active {
  background: var(--cyan);
}

.shop-actions {
  display: grid;
  gap: clamp(8px, 1.3dvh, 10px);
}

.shop-primary-btn,
.shop-secondary-btn {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  padding: 12px 16px;
  font: inherit;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.shop-primary-btn {
  color: #213100;
  background: linear-gradient(180deg, #d8ff75 0%, #b7f13d 100%);
}

.shop-primary-btn:disabled {
  color: rgba(244, 235, 255, 0.64);
  background: rgba(255,255,255,0.12);
}

.shop-secondary-btn {
  color: #08202c;
  background: linear-gradient(180deg, #74e8ff, #35c4f1);
}

.shop-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  height: 2.7em;
  overflow: hidden;
}

@media (max-height: 700px) {
  .shop-card {
    grid-template-rows: auto minmax(0, 1fr) 10px auto minmax(24px, auto);
    gap: 7px;
    padding: 12px;
  }

  .shop-kicker {
    font-size: 0.64rem;
  }

  .shop-header h1 {
    font-size: clamp(1.7rem, 7.8vw, 2.5rem);
  }

  .shop-balance {
    padding: 7px 11px;
  }

  .shop-carousel {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 6px;
  }

  .shop-arrow {
    width: 40px;
    height: 52px;
  }

  .shop-cosmetic {
    grid-template-rows: minmax(0, 1fr) 88px;
    gap: 7px;
  }

  .shop-card-preview-wrap {
    width: min(48vw, 190px, calc((100dvh - 292px) * 0.72));
    min-width: 132px;
  }

  .shop-cosmetic-copy {
    grid-template-rows: 2em 2.55em 1.35em;
  }

  .shop-cosmetic-copy h2 {
    font-size: clamp(1.2rem, 5vw, 1.55rem);
  }

  .shop-primary-btn,
  .shop-secondary-btn {
    min-height: 42px;
  }

  .shop-note {
    font-size: 0.72rem;
    height: 2.45em;
  }
}

@media (max-height: 620px) {
  .shop-card {
    grid-template-rows: auto minmax(0, 1fr) 8px auto;
  }

  .shop-note {
    display: none;
  }
}
