html {
  color-scheme: dark;
}

h1,
h2,
.platform-card h3 {
  text-wrap: balance;
}

a,
button,
input,
select,
textarea {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 45, 85, 0.18);
}

.shop .platform-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.shop .platform-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 245, 225, 0.02), rgba(255, 245, 225, 0)),
    rgba(13, 13, 18, 0.72);
}

.shop .platform-card--featured {
  background:
    radial-gradient(circle at top right, rgba(255, 184, 0, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 45, 85, 0.12), rgba(255, 107, 53, 0.05) 52%, rgba(13, 13, 18, 0.9));
  border-color: rgba(255, 184, 0, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 0, 0.45);
}

.shop .platform-card--featured:hover {
  box-shadow:
    4px 4px 0 var(--hot-red),
    8px 8px 0 var(--gold-blaze),
    inset 0 0 0 1px rgba(255, 184, 0, 0.5);
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 245, 225, 0.35);
  background: rgba(13, 13, 18, 0.58);
  color: rgba(255, 245, 225, 0.78);
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.platform-features {
  margin-bottom: 0;
  flex: 1;
}

.platform-actions {
  display: grid;
  gap: 0.75rem;
}

.platform-actions .btn-masq-primary,
.platform-actions .btn-masq-outline {
  width: 100%;
  text-align: center;
}

.store-buy-button {
  width: 100%;
  text-align: center;
}

.store-buy-button[disabled] {
  opacity: 0.65;
}

.platform-note {
  font-size: var(--small);
  color: rgba(255, 245, 225, 0.56);
  border-top: 1px solid rgba(255, 245, 225, 0.35);
  padding-top: 1rem;
}

.shop-status {
  margin: 0 auto 1.5rem;
  max-width: 42rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 245, 225, 0.35);
  background: rgba(255, 245, 225, 0.03);
  color: rgba(255, 245, 225, 0.88);
  font-size: var(--small);
}

.shop-status--success {
  border-color: rgba(0, 200, 83, 0.6);
  background: rgba(0, 200, 83, 0.08);
}

.shop-status--error {
  border-color: rgba(255, 45, 85, 0.72);
  background: rgba(255, 45, 85, 0.08);
}

.shop-status--info {
  border-color: rgba(0, 102, 255, 0.9);
  background: rgba(0, 102, 255, 0.08);
}

.shop-volume-library {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 2px solid rgba(255, 245, 225, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 245, 225, 0.03), rgba(255, 245, 225, 0.01)),
    rgba(13, 13, 18, 0.82);
  box-shadow: 10px 10px 0 rgba(255, 45, 85, 0.08);
}

.shop-volume-library-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.shop-volume-library-head h3 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop-volume-library-head p {
  max-width: 56rem;
  color: rgba(255, 245, 225, 0.72);
}

.shop-volume-groups {
  display: grid;
  gap: 1.5rem;
}

.shop-catalog-state {
  margin: 0;
  padding: 1rem;
  border: 1px solid rgba(255, 245, 225, 0.35);
  background: rgba(255, 245, 225, 0.03);
  color: rgba(255, 245, 225, 0.72);
  font-family: var(--ui);
  font-size: var(--small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shop-catalog-state--empty {
  border-color: rgba(255, 184, 0, 0.55);
  color: rgba(255, 245, 225, 0.88);
}

.shop-volume-group {
  display: grid;
  gap: 1rem;
}

.shop-volume-offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.shop-volume-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 245, 225, 0.35);
}

.shop-volume-heading h4 {
  font-family: var(--display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.shop-volume-note {
  font-size: var(--small);
  color: rgba(255, 245, 225, 0.56);
}

.shop-chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.shop-chapter-card {
  display: grid;
  gap: 0.85rem;
  min-height: 100%;
  padding: 1rem;
  border: 1px solid rgba(255, 245, 225, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 245, 225, 0.025), rgba(255, 245, 225, 0)),
    rgba(13, 13, 18, 0.72);
}

.shop-chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.shop-chapter-label,
.shop-chapter-release,
.shop-chapter-preview {
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shop-chapter-label {
  color: rgba(255, 245, 225, 0.92);
}

.shop-chapter-release {
  color: rgba(255, 245, 225, 0.5);
}

.shop-chapter-preview {
  color: var(--gold-blaze);
}

.shop-chapter-card h5 {
  font-family: var(--display);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop-chapter-card p {
  color: rgba(255, 245, 225, 0.72);
}

.shop-chapter-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
}

.shop-offer-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid rgba(255, 245, 225, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 245, 225, 0.028), rgba(255, 245, 225, 0)),
    rgba(13, 13, 18, 0.86);
}

.shop-offer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.shop-offer-badge,
.shop-offer-note {
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shop-offer-badge {
  color: var(--gold-blaze);
}

.shop-offer-note {
  color: rgba(255, 245, 225, 0.52);
}

.shop-chapter-actions .btn-masq-primary,
.shop-chapter-actions .btn-masq-outline,
.shop-chapter-actions .store-buy-button {
  width: 100%;
  text-align: center;
}

.shop-chapter-card--external {
  border-color: rgba(0, 102, 255, 0.9);
}

.shop-chapter-card--coming-soon {
  border-color: rgba(255, 184, 0, 0.48);
}

@media (prefers-contrast: more) {
  .shop .platform-card,
  .shop .platform-card--featured,
  .platform-badge,
  .platform-note,
  .shop-status,
  .shop-volume-library,
  .shop-volume-heading,
  .shop-chapter-card,
  .shop-offer-card {
    border-color: rgba(255, 245, 225, 0.68) !important;
  }

  .platform-note,
  .shop-volume-note,
  .shop-offer-note {
    color: rgba(255, 245, 225, 0.92);
  }

  .shop-chapter-card--external {
    border-color: rgba(0, 102, 255, 0.95) !important;
  }

  .shop-chapter-card--coming-soon,
  .shop .platform-card--featured {
    border-color: rgba(255, 184, 0, 0.72) !important;
  }
}

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

  .shop .platform-card--featured {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .shop .platform-grid {
    grid-template-columns: 1fr;
  }

  .shop-volume-offers {
    grid-template-columns: 1fr;
  }

  .shop-chapter-grid {
    grid-template-columns: 1fr;
  }

  .shop-status {
    margin-bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop .platform-card,
  .shop .platform-card--featured {
    transition: none;
  }
}
