/* Region page final overrides
   Keeps the approved Playful Premium direction, aligns every block to one safe
   content column, shows more of the hero carousel, and uses subscription cards
   focused on visual + price. */

.app.region-page {
  --region-side-padding: clamp(24px, 5.6vw, 38px);
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  /* Include Telegram fullscreen safe-area inset on top (0 when not fullscreen). */
  padding:
    calc(18px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px))
    var(--region-side-padding) 142px;
  overflow: hidden;
}

.region-page .page-head,
.region-page .region-hero,
.region-page .shelf,
.region-page .subscriptions,
.region-page .section {
  width: 100%;
  max-width: 100%;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  transform: none !important;
}

.region-page .page-head {
  margin: 0 0 18px !important;
}

.region-page .page-title {
  margin: 0;
  color: #fffdf8;
}

.region-page .page-subtitle {
  color: #edf3ff;
}

.region-page .region-hero {
  margin: 14px 0 34px !important;
}

.region-page .hero-track {
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 0 12px !important;
  margin: 0 !important;
  scroll-padding-left: 0 !important;
  scrollbar-width: none;
}

.region-page .hero-track::-webkit-scrollbar {
  display: none;
}

.region-page .hero-slide {
  flex: 0 0 78%;
  min-width: 78%;
  height: 300px;
  scroll-snap-align: start;
  border-color: rgba(93, 231, 255, 0.3);
  background:
    radial-gradient(circle at 28% 18%, rgba(93, 231, 255, 0.2), transparent 26%),
    radial-gradient(circle at 86% 16%, rgba(255, 122, 47, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(45, 76, 136, 0.52), rgba(17, 25, 46, 0.96)),
    #101827;
}

.region-page .hero-slide-content {
  left: 20px;
  right: 20px;
  bottom: 22px;
}

.region-page .region-hero-title {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  font-size: 26px;
}

.region-page .region-hero-subtitle {
  max-width: 430px;
  margin-left: auto;
  margin-right: auto;
}

.region-page .hero-dot.is-active {
  background: #ff7a2f;
}

.region-page .shelf,
.region-page .subscriptions,
.region-page .section {
  margin-top: 36px !important;
}

.region-page .shelf-header,
.region-page .subscriptions > .shelf-title,
.region-page .section-title {
  width: 100%;
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.region-page .shelf-header {
  margin-bottom: 14px !important;
  /* Arrow sits right next to the title instead of being pushed to the right edge.
     This is the Turkey parsed-shelf look (.is-parsed-shelf), applied uniformly to
     every region shelf — fixes СНГ and any static / non-hydrated Turkey shelves. */
  justify-content: flex-start;
  gap: 8px;
}

.region-page .shelf-more {
  margin-left: 2px;
  color: rgba(93, 231, 255, 0.95);
}

/* Static full-section page (СНГ, Индия): static .game-card fills the 2-column
   grid like the Turkey parsed cards instead of staying a fixed 150px width. */
.parsed-section-grid .game-card {
  width: 100%;
  min-width: 0;
}

.parsed-section-grid .game-cover {
  height: auto;
  aspect-ratio: 148 / 214;
}

.region-page .shelf-title,
.region-page .section-title {
  color: #fffdf8;
}

.region-page .shelf-row {
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 0 6px !important;
  margin: 0 !important;
  scroll-padding-left: 0 !important;
  scrollbar-width: none;
}

.region-page .shelf-row::-webkit-scrollbar {
  display: none;
}

.region-page .game-card {
  flex: 0 0 150px;
  min-width: 150px;
  width: 150px;
}

.region-page .game-cover {
  height: 214px;
}

.region-page .subscriptions {
  display: block;
}

.region-page .subscriptions > .shelf-title {
  margin-bottom: 14px !important;
}

.region-page .sub-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 0 16px !important;
  padding: 5px;
  border: 1px solid rgba(93, 231, 255, 0.22);
  border-radius: 20px;
  background: rgba(11, 22, 39, 0.92);
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.region-page .sub-tab {
  min-height: 44px;
  border-radius: 15px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 900;
  color: rgba(237, 243, 255, 0.72);
}

.region-page .sub-tab.is-active {
  color: #ffffff;
  background: linear-gradient(100deg, #5de7ff, #4e80ff 48%, #ff7a2f);
  box-shadow: 0 10px 24px rgba(93, 231, 255, 0.18);
}

.region-page .sub-list {
  display: grid;
  gap: 14px;
  width: 100%;
  margin: 0 !important;
}

.region-page .sub-card,
.region-page .single-subscription .sub-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-height: 130px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(93, 231, 255, 0.24);
  border-radius: 26px;
  background:
    radial-gradient(circle at 82% 50%, rgba(255, 122, 47, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(18, 34, 60, 0.98), rgba(14, 19, 34, 0.98));
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.region-page .sub-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(93, 231, 255, 0.36), rgba(255, 209, 102, 0.36), transparent);
  pointer-events: none;
}

.region-page .sub-visual {
  position: relative;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 130px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: none;
}

.region-page .sub-visual::before {
  content: "";
  position: absolute;
  inset: -68px -72px auto auto;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  opacity: 0.44;
}

.region-page .sub-visual::after {
  content: "";
  position: absolute;
  left: -36px;
  right: -36px;
  bottom: 26px;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.92), transparent);
  transform: rotate(-11deg);
  opacity: 0.92;
}

.region-page .sub-visual-glow {
  position: absolute;
  inset: auto auto -52px -38px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: rgba(93, 231, 255, 0.22);
}

.region-page .sub-visual-logo,
.region-page .sub-visual-label,
.region-page .sub-visual-term {
  position: relative;
  z-index: 1;
}

.region-page .sub-visual-logo {
  color: #ffffff;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.8px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.42);
}

.region-page .sub-visual-label {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.98);
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.32);
}

.region-page .sub-visual-term {
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
  border-radius: 999px;
  padding: 6px 10px 5px;
  background: rgba(7, 14, 28, 0.58);
  color: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.region-page .sub-visual-essential {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.76), transparent 25%),
    linear-gradient(135deg, #f8fbff 0%, #d9dfeb 58%, #eef3ff 100%);
}

.region-page .sub-visual-essential .sub-visual-logo,
.region-page .sub-visual-essential .sub-visual-label {
  color: #182235;
  text-shadow: none;
}

.region-page .sub-visual-essential .sub-visual-term {
  background: rgba(20, 32, 52, 0.11);
  color: #26344c;
}

.region-page .sub-visual-extra {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.54), transparent 25%),
    linear-gradient(135deg, #fff078 0%, #ffc844 50%, #ff8a34 100%);
}

.region-page .sub-visual-extra .sub-visual-logo,
.region-page .sub-visual-extra .sub-visual-label {
  color: #201a08;
  text-shadow: none;
}

.region-page .sub-visual-extra .sub-visual-term {
  background: rgba(41, 36, 14, 0.12);
  color: #29240e;
}

.region-page .sub-visual-deluxe {
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 209, 102, 0.34), transparent 28%),
    linear-gradient(135deg, #0a0a0d 0%, #251b07 56%, #b98912 100%);
}

.region-page .sub-visual-ea {
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 93, 104, 0.36), transparent 28%),
    linear-gradient(135deg, #161944 0%, #4b2bbf 54%, #ff5d45 100%);
}

.region-page .sub-copy,
.region-page .sub-title,
.region-page .sub-meta {
  display: none !important;
}

.region-page .sub-price {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: end;
  min-width: 0;
  margin: 0 22px 0 14px;
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  color: #fff8e7;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -1px;
  text-align: right;
  white-space: nowrap;
  text-shadow:
    0 2px 18px rgba(255, 209, 102, 0.28),
    0 4px 18px rgba(0, 0, 0, 0.44);
  box-shadow: none !important;
}

.region-page .single-subscription {
  margin-top: 36px !important;
}

.region-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 1000;
  width: min(calc(100% - 24px), 600px);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.region-bottom-nav button,
.region-nav-tabs {
  pointer-events: auto;
}

.region-nav-back {
  flex: 0 0 auto;
  height: 52px;
  border: 1px solid rgba(93, 231, 255, 0.22);
  border-radius: 18px;
  padding: 0 14px;
  background: rgba(13, 23, 40, 0.92);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.region-nav-tabs {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  height: 58px;
  border: 1px solid rgba(93, 231, 255, 0.18);
  border-radius: 22px;
  padding: 5px;
  background: rgba(13, 17, 30, 0.9);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.region-nav-tab {
  min-width: 0;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: rgba(220, 230, 247, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}

.region-nav-tab.is-active {
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 20%, rgba(93, 231, 255, 0.2), transparent 42%),
    rgba(255, 122, 47, 0.14);
}

.region-nav-icon {
  font-size: 18px;
  line-height: 1;
}

.region-nav-label {
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .app.region-page {
    --region-side-padding: 24px;
    max-width: none;
  }

  .region-page .hero-slide {
    flex-basis: 80%;
    min-width: 80%;
    height: 290px;
  }

  .region-page .game-card {
    flex-basis: 154px;
    min-width: 154px;
    width: 154px;
  }

  .region-page .sub-card,
  .region-page .single-subscription .sub-card {
    grid-template-columns: minmax(0, 1fr) 118px;
    min-height: 124px;
  }

  .region-page .sub-visual {
    min-height: 124px;
    padding: 16px 17px;
  }

  .region-page .sub-visual-logo {
    font-size: 29px;
  }

  .region-page .sub-visual-label {
    font-size: 16px;
  }

  .region-page .sub-price {
    margin-right: 16px;
    font-size: 27px;
    letter-spacing: -0.8px;
  }

  .region-bottom-nav {
    width: min(calc(100% - 20px), 600px);
    gap: 8px;
  }

  .region-nav-back {
    height: 50px;
    padding: 0 12px;
    font-size: 13px;
  }

  .region-nav-tabs {
    height: 56px;
    border-radius: 20px;
  }

  .region-nav-label {
    font-size: 9px;
  }
}

@media (max-width: 380px) {
  .app.region-page {
    --region-side-padding: 20px;
  }

  .region-page .hero-slide {
    flex-basis: 82%;
    min-width: 82%;
  }

  .region-page .game-card {
    flex-basis: 148px;
    min-width: 148px;
    width: 148px;
  }

  .region-page .sub-card,
  .region-page .single-subscription .sub-card {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .region-page .sub-visual {
    padding: 15px 15px;
  }

  .region-page .sub-visual-logo {
    font-size: 25px;
  }

  .region-page .sub-visual-label {
    font-size: 13px;
  }

  .region-page .sub-visual-term {
    font-size: 9px;
    padding: 5px 7px 4px;
  }

  .region-page .sub-price {
    margin-right: 13px;
    font-size: 22px;
  }

  .region-nav-label {
    display: none;
  }

  .region-nav-tabs {
    height: 52px;
  }

  .region-nav-back {
    height: 48px;
  }
}