*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --play-green: #01875f;
  --play-green-light: #e6f4ef;
  --play-green-hover: #056449;
  --page-bg: #ffffff;
  --surface: #ffffff;
  --text: #202124;
  --text-muted: #5f6368;
  --text-light: #80868b;
  --border: #dadce0;
  --header-height: 64px;
  --tile-size: 120px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  background: var(--page-bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header — Play Store style */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  color: var(--text);
}

.header__brand-logo {
  height: 40px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
}

.header__brand-text {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header__menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.4rem;
  margin-left: auto;
}

.header__menu-btn svg {
  width: 24px;
  height: 24px;
}

.header__lang {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

.lang-btn {
  min-width: 2.25rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-btn--active {
  background: var(--play-green-light);
  color: var(--play-green);
  border-color: #b7dfd3;
}

.header__nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  height: 100%;
  margin-left: 0.5rem;
}

.header__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.header__ext-icon {
  width: 12px;
  height: 12px;
  opacity: 0.5;
}

.header__link:hover {
  color: var(--play-green-hover);
}

.header__link--active {
  color: var(--play-green);
  border-bottom-color: var(--play-green);
}

.header__search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f1f3f4;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  width: 280px;
  flex-shrink: 0;
}

.header__search svg {
  width: 18px;
  height: 18px;
  color: var(--text-light);
  flex-shrink: 0;
}

.header__search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: transparent;
}

.header__search input::placeholder {
  color: var(--text-light);
}

.header-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
}

.content {
  flex: 1;
  padding: 1.5rem 1.5rem 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Intro */
.play-intro {
  margin-bottom: 1.25rem;
}

.play-intro__title {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
}

.play-intro__sub {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Filter chips */
.play-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.play-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.play-chip:hover {
  background: #f8f9fa;
}

.play-chip--active {
  background: var(--play-green-light);
  border-color: var(--play-green-light);
  color: var(--play-green);
}

/* Section */
.play-section {
  margin-bottom: 2.25rem;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.play-section__title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
}

.play-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem 1rem;
}

/* App tile */
.play-tile {
  width: 100%;
  display: block;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  border-radius: 12px;
  transition: background 0.15s;
}

.play-tile:hover {
  background: #f8f9fa;
}

.play-tile:focus-visible {
  outline: 2px solid var(--play-green);
  outline-offset: 2px;
}

.play-tile__icon {
  width: var(--tile-size);
  height: var(--tile-size);
  border-radius: 20%;
  overflow: hidden;
  background: var(--tile-color, #e8eaed);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
  margin-bottom: 0.65rem;
  position: relative;
}

.play-tile__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-tile__fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 500;
  color: #fff;
  background: var(--tile-color, #868e96);
}

.play-tile__name {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.play-tile__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.play-tile__platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.play-tile__platform {
  display: block;
  opacity: 0.9;
  transition: opacity 0.15s, transform 0.15s;
}

.play-tile__platform img {
  height: 22px;
  width: auto;
  border-radius: 4px;
}

.play-tile__platform:hover {
  opacity: 1;
  transform: scale(1.05);
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  background: var(--surface);
}

.footer a {
  color: var(--play-green);
}

.footer a:hover {
  text-decoration: underline;
}

.footer a:hover {
  text-decoration: underline;
}

/* Product detail page */
.product-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
}

.product-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.25rem 0 1.25rem;
  color: var(--play-green);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.product-page__back:hover {
  text-decoration: underline;
}

.product-page__not-found {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 1rem 0;
}

.product-page__content {
  width: 100%;
}

.detail__cover {
  width: 100%;
  margin: 0 0 1.25rem;
  max-height: 280px;
  overflow: hidden;
  border-radius: 12px;
  background: #e8eaed;
}

.detail__cover img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.detail__zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}

.detail__zoom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.detail__cover .detail__zoom {
  height: 220px;
}

.detail__shot--mobile .detail__zoom,
.detail__shot--desktop .detail__zoom {
  height: 100%;
}

.detail__shot--mobile .detail__zoom img,
.detail__shot--desktop .detail__zoom img {
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.lightbox__img {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.lightbox__close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.detail__hero {
  max-width: 720px;
  padding-top: 0.5rem;
}

.detail__hero-top {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.detail__icon {
  width: 72px;
  height: 72px;
  border-radius: 20%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--tile-color, #e8eaed);
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
}

.detail__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail__title {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
}

.detail__dev {
  font-size: 0.9rem;
  color: var(--play-green);
  font-weight: 500;
  margin-top: 0.35rem;
}

.detail__tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.detail__stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.detail__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  padding: 0 0.5rem;
  border-right: 1px solid var(--border);
}

.detail__stat:last-child {
  border-right: none;
}

.detail__stat strong {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.detail__stat span {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  text-align: center;
}

.detail__stat span a {
  color: var(--play-green);
  text-decoration: none;
}

.detail__stat span a:hover {
  text-decoration: underline;
}

.detail__no-links {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.detail__section {
  padding: 0 0 1.5rem;
}

.detail__section-title {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.detail__customer-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #f8f9fa;
  border: 1px solid #e8eaed;
}

.detail__customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--play-green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.detail__customer-name {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.detail__customer-link {
  font-size: 0.85rem;
  color: var(--play-green);
  text-decoration: none;
}

.detail__customer-link:hover {
  text-decoration: underline;
}

.detail__download .detail__stores {
  margin-bottom: 0;
}

.detail__stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail__shot-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.detail__shot-tab {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.detail__shot-tab--active {
  background: #e8f5e9;
  border-color: var(--play-green);
  color: #137333;
  font-weight: 500;
}

.detail__shots-grid {
  display: grid;
  gap: 0.75rem;
}

.detail__shots-grid--mobile {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.detail__shots-grid--desktop {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.detail__shot--mobile {
  border-radius: 12px;
  overflow: hidden;
  background: #e8eaed;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
  aspect-ratio: 9 / 16;
}

.detail__shot--desktop {
  border-radius: 10px;
  overflow: hidden;
  background: #e8eaed;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
  border: 1px solid #dadce0;
  aspect-ratio: 16 / 9;
}

.detail__shot--mobile img,
.detail__shot--desktop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail__store-btn img {
  height: 40px;
  width: auto;
}

.detail__about-title {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.detail__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.detail__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail__features li {
  font-size: 0.875rem;
  color: var(--text);
  padding-left: 1.25rem;
  position: relative;
}

.detail__features li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--play-green);
}

@media (max-width: 900px) {
  .header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .header__brand {
    order: 1;
    flex: 1;
    min-width: 0;
  }

  .header__lang {
    order: 2;
    margin-left: 0;
  }

  .header__menu-btn {
    display: block;
    order: 3;
  }

  .header__nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    height: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    z-index: 180;
    margin-left: 0;
  }

  .header__nav--open {
    display: flex;
  }

  .header__link {
    padding: 0.85rem 1.25rem;
    border-bottom: none;
    border-left: 3px solid transparent;
    margin-bottom: 0;
  }

  .header__link--active {
    border-left-color: var(--play-green);
    background: var(--play-green-light);
  }

  .header__search {
    order: 4;
    width: 100%;
    flex: 1 1 100%;
  }

  .header-overlay--visible {
    display: block;
  }

  .content {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .play-grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 1rem 0.75rem;
  }

  .play-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

  .play-chips::-webkit-scrollbar {
    display: none;
  }

  :root {
    --tile-size: 96px;
  }

  .product-page {
    padding: 0 1rem max(1.5rem, env(safe-area-inset-bottom));
  }

  .detail__cover {
    max-height: 200px;
    border-radius: 10px;
  }

  .detail__cover img {
    height: 180px;
  }

  .detail__title {
    font-size: 1.35rem;
  }

  .detail__hero-top {
    flex-direction: row;
    align-items: center;
  }

  .detail__stats {
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  .detail__stat {
    border-right: none;
    min-width: auto;
    align-items: flex-start;
  }

  .detail__shots-grid--mobile {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .detail__shots-grid--desktop {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .footer {
    padding: 1rem;
    font-size: 0.75rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header__brand-text {
    font-size: 1.15rem;
  }

  .play-intro__title {
    font-size: 1.4rem;
  }
}
