/* Ludo Rush — Play Store inspired UI (original design) */
:root {
  /* Play-style palette */
  --play-bg: #ffffff;
  --play-surface: #f8f9fa;
  --play-text: #202124;
  --play-text-2: #5f6368;
  --play-text-3: #80868b;
  --play-green: #01875f;
  --play-green-dark: #056449;
  --play-green-light: #e6f4ef;
  --play-blue: #1a73e8;
  --play-star: #fabb05;
  --play-divider: #e8eaed;
  --play-tag-bg: #f1f3f4;
  --play-bar-bg: #e8eaed;
  --play-bar-fill: #fabb05;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --page-max: 480px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #e8eaed;
}

body {
  font-family: Roboto, 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--play-bg);
  color: var(--play-text);
  font-size: 14px;
  line-height: 1.43;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-bottom: calc(72px + var(--safe-bottom));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--play-green);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Store top bar ── */
.store-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--play-divider);
  background: var(--play-bg);
}

.store-bar__label {
  font-size: 18px;
  font-weight: 500;
  color: var(--play-text);
  letter-spacing: 0.01em;
}

.store-bar__badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--play-green);
  background: var(--play-green-light);
  padding: 4px 10px;
  border-radius: 4px;
}

/* ── App header ── */
.app-header {
  display: flex;
  gap: 16px;
  padding: 16px 16px 12px;
  align-items: flex-start;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 20%;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
}

.app-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--play-text);
  line-height: 1.27;
  margin-bottom: 2px;
}

.app-developer {
  font-size: 14px;
  font-weight: 500;
  color: var(--play-green);
  margin-bottom: 4px;
}

.app-contains {
  font-size: 12px;
  color: var(--play-text-2);
}

/* ── Metrics row ── */
.metrics {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 8px 16px;
  text-align: center;
}

.metric { flex: 1; }

.metric__value {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--play-text);
  line-height: 1.2;
}

.metric__value .star {
  color: var(--play-star);
  font-size: 12px;
}

.metric__age {
  font-size: 13px;
  border: 1px solid var(--play-text-2);
  border-radius: 2px;
  padding: 1px 4px;
  display: inline-block;
}

.metric__label {
  display: block;
  font-size: 12px;
  color: var(--play-text-2);
  margin-top: 4px;
}

.metric-divider {
  width: 1px;
  height: 24px;
  background: var(--play-divider);
  flex-shrink: 0;
}

.platform-hint {
  text-align: center;
  font-size: 12px;
  color: var(--play-text-2);
  padding: 0 16px 8px;
  min-height: 1em;
}

.platform-hint:empty { display: none; }

body.is-android .platform-hint { color: var(--play-green); }

/* ── Install button ── */
.install-wrap {
  display: flex;
  gap: 10px;
  padding: 0 16px 8px;
  align-items: stretch;
}

.btn-install-play {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--play-green);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  text-transform: none;
  box-shadow: none;
  transition: background 0.15s ease;
}

.btn-install-play:hover { background: var(--play-green-dark); }
.btn-install-play:active { background: #034d38; transform: scale(0.99); }

.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0 14px;
  border: 1px solid var(--play-divider);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--play-text-2);
  background: var(--play-bg);
}

.btn-share:hover {
  background: var(--play-surface);
  color: var(--play-text);
}

.wishlist-note {
  text-align: center;
  font-size: 12px;
  color: var(--play-text-3);
  padding: 4px 16px 16px;
}

/* ── Screenshots section ── */
.screenshots-section { padding-bottom: 12px; }

.screenshots-sub {
  font-size: 13px;
  color: var(--play-text-2);
  margin: -8px 0 14px;
}

.screenshot-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.screenshot-tabs::-webkit-scrollbar { display: none; }

.screenshot-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--play-text-2);
  background: var(--play-tag-bg);
  border: 1px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.screenshot-tab.is-active {
  color: var(--play-green);
  background: var(--play-green-light);
  border-color: var(--play-green);
}

.screenshot-tab:hover:not(.is-active) {
  background: var(--play-divider);
  color: var(--play-text);
}

.shots-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
  scrollbar-width: none;
  min-height: 300px;
}

.shots-gallery::-webkit-scrollbar { display: none; }

.shot-item {
  flex: 0 0 150px;
  scroll-snap-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.shot-item.is-hidden {
  display: none;
}

.shot-item__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
  touch-action: manipulation;
}

.shot-item__btn:active { transform: scale(0.98); }

.shot-item__btn img {
  width: 150px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--play-divider);
  display: block;
}

.shot-item figcaption {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--play-text-2);
  text-align: center;
}

.screenshots-hint {
  font-size: 12px;
  color: var(--play-text-3);
  text-align: center;
  margin-top: 8px;
}

.shots-loading,
.shots-empty {
  font-size: 13px;
  color: var(--play-text-2);
  padding: 24px 0;
  text-align: center;
  width: 100%;
}

.shots-empty code {
  font-size: 11px;
  background: var(--play-tag-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Screenshot lightbox */
.shot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.shot-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.shot-lightbox__close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.shot-lightbox img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.shot-lightbox__caption {
  margin-top: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  max-width: 320px;
}

/* ── Dividers & blocks ── */
.divider {
  border: none;
  border-top: 8px solid var(--play-surface);
  margin: 0;
}

.block {
  padding: 20px 16px;
}

.block-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--play-text);
  margin-bottom: 12px;
}

.about-text {
  font-size: 14px;
  color: var(--play-text-2);
  line-height: 1.5;
  margin-bottom: 12px;
}

.about-text strong { color: var(--play-text); font-weight: 500; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--play-text-2);
  background: var(--play-tag-bg);
  padding: 6px 12px;
  border-radius: 16px;
}

/* ── Ratings overview ── */
.rating-overview {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.rating-score {
  text-align: center;
  min-width: 80px;
}

.rating-score__num {
  display: block;
  font-size: 56px;
  font-weight: 400;
  color: var(--play-text);
  line-height: 1;
}

.rating-score__stars {
  display: block;
  color: var(--play-star);
  font-size: 14px;
  letter-spacing: 1px;
  margin: 4px 0;
}

.rating-score__count {
  font-size: 12px;
  color: var(--play-text-2);
}

.rating-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}

.rating-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--play-text-2);
}

.rating-bar > span { width: 8px; text-align: right; }

.rating-bar .bar {
  flex: 1;
  height: 10px;
  background: var(--play-bar-bg);
  border-radius: 2px;
  overflow: hidden;
}

.rating-bar .bar i,
.rating-bar .bar .bar-fill {
  display: block;
  height: 100%;
  background: var(--play-bar-fill);
  border-radius: 2px;
}

.bar-fill--78 { width: 78%; }
.bar-fill--15 { width: 15%; }
.bar-fill--5  { width: 5%; }
.bar-fill--1  { width: 1%; }

/* ── Featured reviews (top of page) ── */
.reviews-featured {
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--play-divider);
}

.reviews-featured__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--play-text);
  padding: 0 16px 10px;
}

.reviews-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.reviews-scroll::-webkit-scrollbar { display: none; }

.review-card {
  flex: 0 0 220px;
  padding: 12px;
  background: var(--play-surface);
  border: 1px solid var(--play-divider);
  border-radius: 8px;
  scroll-snap-align: start;
}

.review-card__head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.review-card__name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--play-text);
}

.review-card__stars {
  font-size: 12px;
  color: var(--play-star);
}

.review-card__text {
  font-size: 13px;
  color: var(--play-text-2);
  line-height: 1.45;
}

/* ── Reviews list ── */
.block--reviews { padding-top: 8px; }

.block-title--sm {
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--play-text-2);
}

.review {
  padding: 16px 0;
  border-bottom: 1px solid var(--play-divider);
}

.review:last-child { border-bottom: none; }

.review-top {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.review-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.review-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--play-text);
}

.review-flag { font-size: 12px; }

.review-meta {
  font-size: 12px;
  color: var(--play-text-2);
  margin-top: 2px;
}

.review-stars { color: var(--play-star); }

.review-body {
  font-size: 14px;
  color: var(--play-text-2);
  line-height: 1.5;
  margin-bottom: 8px;
}

.review-helpful {
  font-size: 12px;
  color: var(--play-text-3);
}

/* ── Footer ── */
.footer {
  padding: 20px 16px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--play-text-2);
  background: var(--play-surface);
}

.footer a { color: var(--play-blue); }

.footer-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--play-text-3);
}

/* ── Sticky install ── */
.sticky-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 100%;
  max-width: var(--page-max);
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: var(--play-bg);
  border-top: 1px solid var(--play-divider);
  box-shadow: 0 -2px 8px rgba(60, 64, 67, 0.1);
}

.btn-install-play--sticky {
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
}

body.is-android .btn-install-play--sticky {
  animation: play-pulse 2.5s ease-in-out infinite;
}

@keyframes play-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(1, 135, 95, 0); }
  50% { box-shadow: 0 0 0 4px rgba(1, 135, 95, 0.2); }
}

/* ── Desktop: phone column ── */
@media (min-width: 521px) {
  body {
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 16px rgba(60, 64, 67, 0.1);
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
  }
}

@media (max-width: 360px) {
  .app-title { font-size: 20px; }
  .rating-score__num { font-size: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  body.is-android .btn-install-play--sticky { animation: none; }
}
