@property --tint {
  syntax: '<color>';
  inherits: true;
  initial-value: #2A3550;
}
:root {
  --bg:        #101215;
  --surface:   #181B20;
  --surface-2: #21252B;
  --border:    #2A2F36;
  --fg:        #ECEEF2;
  --fg-dim:    #9BA1AC;
  --fg-muted:  #6C727C;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
             'Helvetica Neue', Arial, sans-serif;
  --border-radius:    4px;
  --border-radius-md: 6px;
  --border-radius-lg: 8px;
}
html {
  background: var(--bg);
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  overscroll-behavior-y: none;
  padding-bottom: env(safe-area-inset-bottom);
  min-height: 100vh;
  font-family: var(--font-ui), sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

.hero {
  padding: calc(env(safe-area-inset-top) + 20px) 16px 24px;
  background: linear-gradient(
    180deg,
    var(--tint) 0%,
    color-mix(in oklab, var(--tint) 45%, var(--bg)) 55%,
    var(--bg) 100%
  );
}

.hero__art {
  position: relative;
  aspect-ratio: 1;
  max-width: 300px;
  margin: 0 auto;
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform 120ms ease;
  cursor: pointer;
}
.hero__art:active { transform: scale(0.98); }
.hero__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__art::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.rail { margin: 40px 0; }

.rail__title {
  margin: 0 0 12px;
  padding: 0 16px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 4px;
}

.rail__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 132px;
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
  scrollbar-width: none;
}

.rail__track::-webkit-scrollbar { display: none; }

.card {
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;

}

.card__art {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--surface);
  transition: transform 120ms ease;
}

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

.card__art::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.card:active .card__art { transform: scale(0.97); }

.card__name {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[hidden] { display: none !important; }

.rail__track, .hero__art { pointer-events: none; }
.loaded .rail__track, .loaded .hero__art { pointer-events: auto; }

/* ---------- оболочка ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 240ms cubic-bezier(.32, .72, 0, 1),
              visibility 240ms;
}

.sheet.is-open { transform: translateX(0); visibility: visible; }

/* ---------- страница карточки ---------- */

.card-page {
  position: relative;
  padding: calc(env(safe-area-inset-top) + 16px) 16px
           calc(env(safe-area-inset-bottom) + 40px);
  background: linear-gradient(
    180deg,
    var(--tint) 0,
    color-mix(in oklab, var(--tint) 45%, var(--bg)) 170px,
    var(--bg) 360px
  );
}

.card-close {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 8px);
  float: right;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(10px);
  color: var(--fg);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.card-title {
  margin: 4px 44px 16px 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.card-img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0 auto 28px;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

/* ---------- подписи и значения ---------- */

.card-available-platforms-text,
.card-localisation-text,
.card-also-title,
.card-description-title {
  user-select: none;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.card-available-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.available-xbox-one,
.available-xbox-series,
.card-localisation-yes,
.card-localisation-no {
  user-select: none;
  padding: 6px 12px;
  border-radius: var(--border-radius);
  background: var(--surface-2);
  font-size: 13px;
}

.card-localisation { margin-bottom: 28px; }
.card-localisation-yes,
.card-localisation-no { display: inline-block; }
.card-localisation-yes { color: #6FCF97; }
.card-localisation-no  { color: var(--fg-muted); }

/* ---------- покупка ---------- */

.card-purchase-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.card-purchase-buy-button,
.card-purchase-paypal-button {
  display: block;
  padding: 15px;
  border: 0;
  border-radius: var(--border-radius);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease;
}

.card-purchase-buy-button {
  background: var(--fg);
  color: var(--bg);
}

.card-purchase-paypal-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-dim);
}

.card-purchase-buy-button:active,
.card-purchase-paypal-button:active { transform: scale(.985); }

/* ---------- ещё на аккаунте ---------- */

.card-also { margin-bottom: 32px; }

.card-also-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 104px;
  gap: 10px;
  margin: 0 -16px;
  padding: 0 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.card-also-track::-webkit-scrollbar { display: none; }

.also-card {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.also-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: var(--border-radius-md);
  object-fit: cover;
  background: var(--surface);
}

.also-card-name {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- описание ---------- */

.card-description-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-dim);
  white-space: pre-line;
}

.alphabet {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 2px;
  padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.alphabet::-webkit-scrollbar { display: none; }

.alphabet__letter {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 8px 0;
  border-radius: var(--border-radius);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
  cursor: pointer;
}

.alphabet__letter:active { background: var(--surface-2); color: var(--fg); }

.letter { scroll-margin-top: 52px; }

.letter__title {
  margin: 24px 0 12px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--fg-muted);
}

.letter__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 12px;
  padding: 0 16px;
}

.tile__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile { cursor: pointer; }

.tile__art {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: var(--surface);
  transition: transform 120ms ease;
}

.tile__art::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.tile:active .tile__art { transform: scale(.97); }

.tile__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alphabet__letter.is-current {
  background: var(--fg);
  color: var(--bg);
}
.card-purchase-note {
  user-select: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0;
  padding-inline: 2px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-muted);
}

.card-purchase-note__icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  opacity: .7;
}
