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

:root {
  --play-green: #01875f;
  --play-green-hover: #016d4d;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-link: #01875f;
  --border: #dadce0;
  --bg: #ffffff;
  --bg-secondary: #f1f3f4;
  --star-color: #01875f;
  --font: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Vértice brand (screenshots) */
  --v-bg: #0A0C0B;
  --v-elev-1: #121613;
  --v-elev-2: #1A201C;
  --v-line: #243029;
  --v-text-hi: #F2F5F0;
  --v-text-mid: #9BA89E;
  --v-text-low: #5C6862;
  --v-accent: #C6F24E;
  --v-accent-press: #A8D63C;
  --v-gold: #D8B26A;
  --v-win: #3FB984;
  --v-loss: #E5604D;
  --v-display: 'Bricolage Grotesque', sans-serif;
  --v-body: 'Hanken Grotesk', sans-serif;
  --v-mono: 'DM Mono', monospace;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: calc(56px + env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.i18n-pending .page {
  visibility: hidden;
}

body.i18n-pending .play-topbar {
  visibility: visible;
}

html[dir="rtl"] .review-footer .helpful-label {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .detail-row dd {
  text-align: left;
}

html[dir="rtl"] .play-topbar-brand {
  padding-left: 0;
  padding-right: 4px;
}

/* Google Play top bar */
.play-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: env(safe-area-inset-top, 0px) 4px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.play-topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.play-topbar-btn:active {
  background: var(--bg-secondary);
}

.play-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding-left: 4px;
}

.play-topbar-brand span {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-logo {
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.play-topbar-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px));
  width: 100%;
}

/* App Header */
.app-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.app-icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
}

.app-icon img {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.verified-badge {
  flex-shrink: 0;
}

.developer-name {
  display: inline-block;
  color: var(--text-link);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 2px;
}

.developer-name:hover {
  text-decoration: underline;
}

.app-tags {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Stats Row */
.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--border);
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 0 8px;
}

.stat-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.stat-value .star {
  color: var(--text-primary);
  font-size: 12px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.stat-badge .stat-label {
  max-width: 90px;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.editors-badge {
  margin-bottom: 2px;
}

/* Install Section */
.install-section {
  padding: 20px 0;
}

.install-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  min-height: 48px;
  background: var(--play-green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.install-btn:hover,
.install-btn:active {
  background: var(--play-green-hover);
}

.install-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.device-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
}

.device-info svg {
  flex-shrink: 0;
}

/* Screenshots */
.screenshots-section {
  margin: 0 -16px 24px;
  overflow: hidden;
}

.screenshots-track {
  display: flex;
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.screenshots-track::-webkit-scrollbar {
  display: none;
}

.screenshot {
  flex: 0 0 auto;
  width: min(42vw, 180px);
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  scroll-snap-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  display: block;
  object-fit: cover;
  background: #0A0C0B;
  user-select: none;
  -webkit-user-drag: none;
}

/* Sections */
.section {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.app-description strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: 16px;
}

.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.features-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.features-list strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.features-list span {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.whats-new {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.whats-new strong {
  color: var(--text-primary);
}

/* Reviews */
.reviews-section .section-header h2 {
  font-size: 15px;
}

.rating-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  align-items: center;
}

.rating-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.rating-number {
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  color: var(--text-primary);
}

.stars-large {
  color: var(--star-color);
  font-size: 14px;
  letter-spacing: 1px;
  margin: 4px 0;
}

.stars-large .star-half {
  opacity: 0.4;
}

.reviews-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.rating-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-row span {
  font-size: 11px;
  color: var(--text-secondary);
  width: 8px;
  text-align: right;
}

.bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--star-color);
  border-radius: 2px;
}

/* Review Cards */
.review {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.review:last-child {
  border-bottom: none;
}

.review-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
}

.avatar-1 { background: linear-gradient(135deg, #C6F24E, #3FB984); color: #0A0C0B; }
.avatar-2 { background: linear-gradient(135deg, #D8B26A, #E5604D); }
.avatar-3 { background: linear-gradient(135deg, #243029, #5C6862); }

.reviewer-name {
  font-size: 14px;
  font-weight: 500;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.stars-small {
  color: var(--star-color);
  font-size: 11px;
  letter-spacing: -1px;
}

.review-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.review-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.review-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.helpful-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.helpful-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

.helpful-btn {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.helpful-btn:hover {
  background: var(--bg-secondary);
}

.dev-response {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.dev-response strong {
  font-size: 13px;
  font-weight: 500;
}

.dev-response .review-date {
  margin-left: 8px;
}

.dev-response p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

/* App Details */
.details-list {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row dt {
  color: var(--text-secondary);
  font-weight: 400;
}

.detail-row dd {
  color: var(--text-primary);
  text-align: right;
}

/* Compliance Footer */
.compliance-footer {
  padding: 20px 0 8px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.compliance-footer p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.compliance-sub {
  margin-top: 4px;
  font-size: 11px !important;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Sticky Bar */
.sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 100;
}

@media (max-width: 599px) {
  .page {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .screenshots-section {
    margin-left: calc(-1 * max(16px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(16px, env(safe-area-inset-right)));
  }

  .screenshots-track {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    scroll-padding-inline: max(16px, env(safe-area-inset-left));
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-badge .stat-label {
    max-width: 72px;
  }

  .rating-summary {
    gap: 16px;
  }

  .rating-number {
    font-size: 48px;
  }

  .review-footer {
    gap: 6px;
  }

  .helpful-label {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
  }

  .detail-row {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .detail-row dd {
    text-align: left;
  }

  .install-section .install-btn {
    display: none;
  }

  .sticky-bar {
    transform: translateY(0);
  }
}

.sticky-bar.visible {
  transform: translateY(0);
}

.sticky-bar .install-btn {
  max-width: 720px;
  margin: 0 auto;
}

/* Desktop */
@media (min-width: 600px) {
  .page {
    padding: 32px 24px 40px;
  }

  .app-icon {
    width: 96px;
    height: 96px;
  }

  .app-title {
    font-size: 28px;
  }

  .screenshot {
    width: 180px;
  }

  .sticky-bar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-bar {
    transition: none;
  }
}
