:root {
  --bg-main: #0e1013;
  --bg-card: #1b1f24;
  --bg-card-hover: #222830;
  --text-main: #ffffff;
  --text-muted: #9aa5b5;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.22);
  --radius-card: 20px;
  --transition: 0.22s ease;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background: radial-gradient(
    circle at 50% 0%,
    #20242b 0%,
    #15181c 60%,
    #0e1013 100%
  );
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.bg-circle {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
}

.circle-1 {
  top: -15%;
  left: 20%;
  width: 600px;
  height: 500px;
  background: rgba(255, 255, 255, 0.04);
}

.circle-2 {
  bottom: 5%;
  right: 15%;
  width: 500px;
  height: 400px;
  background: rgba(255, 255, 255, 0.02);
}

/* Header */

header {
  width: 100%;
  margin: 0 auto;
  padding: 48px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

header h1 {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  overflow-wrap: anywhere;
}

.store-subtitle {
  margin: -4px 0 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  font-weight: 500;
}

.store-features {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin: 0 0 28px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  font-weight: 500;
  user-select: none;
}

.store-features span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.page-navigation {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 20px 20px;
  text-align: left;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color var(--transition);
}

.back-link:hover {
  color: #ffffff;
}

/* Page layout */

.page-container {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 70px;
}

.page-heading {
  margin: 12px 0 30px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: #9ba8ba;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.page-heading h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.8px;
  overflow-wrap: anywhere;
}

.page-heading p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

/* Sorting */

.catalog-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}

.catalog-toolbar label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.catalog-toolbar select {
  min-width: 185px;
  max-width: 100%;
  padding: 11px 13px;
  color: #ffffff;
  background: #1b1f24;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

.catalog-toolbar select:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
}

.catalog-toolbar option {
  color: #ffffff;
  background: #1b1f24;
}

.sort-submit {
  padding: 11px 16px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.sort-submit:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Grids */

.games-grid,
.services-grid,
.products-grid {
  display: grid;
  gap: 24px;
  width: 100%;
  align-items: stretch;
}

.games-grid {
  grid-template-columns: repeat(auto-fill, minmax(215px, 245px));
  justify-content: center;
}

.services-grid,
.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr));
}

/* Game cards: narrow portrait cards for tall game artwork */

.game-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
}

.game-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 8;
  overflow: hidden;
  background: #242a32;
}

.game-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  transition: transform 0.45s ease;
}

.game-card:hover .game-card__media img {
  transform: scale(1.035);
}

.game-card__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.01) 45%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
}

.game-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 17px;
  min-width: 0;
  padding: 20px;
}

.game-card__body h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.game-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.game-card__price {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.game-card__price span {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.game-card__price strong {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.game-card__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.94rem;
  font-weight: 600;
  transition:
    color var(--transition),
    gap var(--transition);
}

.game-card:hover .game-card__link {
  gap: 11px;
  color: #ffffff;
}

/* Service cards: wider cards with more readable descriptions */

.service-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 440px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.service-card__media {
  height: 225px;
  flex: 0 0 auto;
  overflow: hidden;
  background: #242a32;
}

.service-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.service-card:hover .service-card__media img {
  transform: scale(1.04);
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255, 255, 255, 0.09),
      transparent 65%
    ),
    linear-gradient(135deg, #242a32, #15191e);
}

.service-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 14px;
  padding: 21px 22px 22px;
}

.service-card__title {
  margin: 0;
  color: #ffffff;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.service-card__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: #a7b1c0;
  font-size: 0.96rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.service-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.service-card__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.service-card__price span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.service-card__price strong {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
}

.product-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition);
}

.product-open:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(10px);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.glass-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.modal-content {
  position: relative;
  width: min(680px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px;
  background: rgba(24, 28, 34, 0.98);
  border-color: rgba(255, 255, 255, 0.12);
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.17);
  border-radius: 10px;
}

.close-btn {
  position: absolute;
  top: 17px;
  right: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition:
    opacity var(--transition),
    background var(--transition);
}

.close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.modal-content .product-title {
  max-width: calc(100% - 40px);
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 1.55rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.modal-content .product-desc {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.modal-content .product-desc p {
  margin: 0 0 10px;
}

/* Offers: up to 3 buttons stretch to full width; 4+ become a horizontal strip */

.plan-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 9px;
  width: 100%;
  min-width: 0;
  margin-bottom: 20px;
  padding: 5px;
  overflow-x: hidden;
  overflow-y: hidden;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 13px;
}

.plan-btn {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}

.plan-btn:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.plan-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.plan-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  text-decoration: line-through;
}

.plan-tabs.is-scrollable {
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.04);
  cursor: grab;
  touch-action: pan-x;
}

.plan-tabs.is-scrollable:active {
  cursor: grabbing;
}

.plan-tabs.is-scrollable .plan-btn {
  flex: 0 0 138px;
  width: 138px;
  scroll-snap-align: start;
}

.plan-tabs.is-scrollable::-webkit-scrollbar {
  height: 6px;
}

.plan-tabs.is-scrollable::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.plan-tabs.is-scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 10px;
}

/* Features */

.features-section {
  width: 100%;
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-bottom: 22px;
  padding: 21px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 17px;
}

.features-section::-webkit-scrollbar {
  width: 5px;
}

.features-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.features-section h3 {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 700;
}

#modal-features {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-group:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.feature-group-title {
  color: #ffffff;
  font-size: 0.93rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  overflow-wrap: anywhere;
}

.feature-items-line {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

/* Modal price and actions */

.price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.price {
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.action-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
}

.action-btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 0.94rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition:
    transform var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.action-btn:hover {
  transform: translateY(-2px);
}

.tg-btn {
  color: #ffffff;
  background: #229ed9;
  box-shadow: 0 4px 15px rgba(34, 158, 217, 0.25);
}

.tg-btn:hover {
  background: #1b8fc7;
  box-shadow: 0 6px 20px rgba(34, 158, 217, 0.4);
}

.fp-btn {
  color: #111418;
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.12);
}

.fp-btn:hover {
  background: #eeeeee;
}

/* Empty states */

.catalog-empty {
  grid-column: 1 / -1;
  width: 100%;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* Modal state */

body.modal-open {
  overflow: hidden;
}

/* Focus */

.game-card:focus-visible,
.back-link:focus-visible,
.product-open:focus-visible,
.plan-btn:focus-visible,
.close-btn:focus-visible,
.action-btn:focus-visible,
.sort-submit:focus-visible,
.catalog-toolbar select:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

/* Tablet */

@media (max-width: 800px) {
  header {
    padding-top: 35px;
  }

  .page-container {
    width: min(100% - 32px, 700px);
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 230px));
    gap: 18px;
  }

  .services-grid,
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr));
    gap: 18px;
  }

  .service-card__media {
    height: 215px;
  }
}

/* Mobile */

@media (max-width: 560px) {
  header {
    padding-top: 28px;
  }

  header h1 {
    margin-bottom: 12px;
  }

  .store-features {
    flex-direction: column;
    gap: 9px;
    margin-bottom: 22px;
  }

  .page-container {
    width: calc(100% - 28px);
    padding-bottom: 45px;
  }

  .page-heading {
    margin-top: 8px;
    margin-bottom: 22px;
  }

  .catalog-toolbar {
    justify-content: stretch;
  }

  .catalog-toolbar label {
    width: 100%;
  }

  .catalog-toolbar select {
    flex: 1;
  }

  .games-grid {
    grid-template-columns: minmax(0, 245px);
    justify-content: center;
    gap: 18px;
  }

  .services-grid,
  .products-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
  }

  .service-card__media {
    height: 220px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-content {
    max-height: 94vh;
    padding: 22px 18px;
  }

  .features-section {
    padding: 17px;
  }

  .action-buttons {
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .game-card__bottom,
  .service-card__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-card__link,
  .product-open {
    width: 100%;
  }

  .plan-tabs.is-scrollable .plan-btn {
    flex-basis: 124px;
    width: 124px;
  }

  .modal-content .product-title {
    font-size: 1.3rem;
  }
}
