:root {
  --gp-green: #01875f;
  --gp-green-hover: #017a55;
  --gp-text: #202124;
  --gp-text-secondary: #5f6368;
  --gp-text-tertiary: #80868b;
  --gp-border: #dadce0;
  --gp-bg: #fff;
  --gp-bg-soft: #f1f3f4;
  --gp-blue: #1a73e8;
  --gp-shadow: 0 1px 2px rgba(60,64,67,.1), 0 1px 3px 1px rgba(60,64,67,.05);
  --gp-shadow-md: 0 1px 3px rgba(60,64,67,.12), 0 4px 8px 3px rgba(60,64,67,.04);
  --gp-radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--gp-text);
  background: var(--gp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 14px; line-height: 1.5;
}
a { color: var(--gp-blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

.gp-icon {
  width: 22px; height: 22px;
  fill: currentColor; vertical-align: middle; flex-shrink: 0;
}

/* ============ Header ============ */
.gp-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--gp-border);
}
.gp-header-inner {
  display: flex; align-items: center; gap: 14px;
  max-width: 1280px; margin: 0 auto; padding: 10px 24px;
  min-height: 64px;
}
.gp-mobile-search { display: none; }

.gp-logo {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  padding: 4px 6px; margin-left: -6px; border-radius: 8px;
  text-decoration: none; transition: background .15s;
}
.gp-logo:hover { background: var(--gp-bg-soft); }
.gp-logo-img {
  height: 36px; width: auto; display: block;
  max-width: none;
}

.gp-nav { display: flex; gap: 22px; margin-left: 14px; }
.gp-nav-link {
  color: var(--gp-text-secondary); font-weight: 500; font-size: 14px;
  padding: 18px 0; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.gp-nav-link.active { color: var(--gp-green); border-bottom-color: var(--gp-green); }
.gp-nav-link:hover { color: var(--gp-text); }

.gp-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.gp-search {
  display: flex; align-items: center; gap: 12px;
  background: var(--gp-bg-soft);
  padding: 10px 18px; border-radius: 999px;
  width: 320px; color: var(--gp-text-secondary); font-size: 14px;
  transition: background .15s;
}
.gp-search:hover { background: #e8eaed; text-decoration: none; }
.gp-search-placeholder { flex: 1; }

.gp-icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: transparent; color: var(--gp-text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s; text-decoration: none;
}
.gp-icon-btn:hover { background: var(--gp-bg-soft); }

.gp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-left: 4px; transition: transform .15s;
}
.gp-avatar:hover { transform: scale(1.06); }
.gp-avatar .gp-icon { width: 32px; height: 32px; }

/* ============ Main ============ */
.gp-main { max-width: 1280px; margin: 0 auto; padding: 16px 24px 24px; }

.gp-breadcrumb { font-size: 13px; color: var(--gp-text-secondary); margin: 12px 0 24px; }
.gp-breadcrumb a { color: var(--gp-text-secondary); }
.gp-breadcrumb a:hover { color: var(--gp-text); }
.gp-breadcrumb span { padding: 0 6px; }

/* ============ App header ============ */
.gp-app-header { padding: 12px 0 24px; }
.gp-app-header-grid {
  display: grid; grid-template-columns: 168px 1fr; gap: 32px; align-items: start;
}
.gp-app-icon {
  width: 168px; height: 168px; border-radius: 32px; overflow: hidden;
  box-shadow: var(--gp-shadow); background: #f1f3f4;
}
.gp-app-icon img { width: 100%; height: 100%; object-fit: cover; }
.gp-app-icon-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.gp-app-icon-fallback span { font-size: 96px; letter-spacing: -4px; }
.gp-app-title {
  font-size: 56px; font-weight: 400; line-height: 1.1;
  margin: 0 0 8px; letter-spacing: -.5px; color: var(--gp-text);
  font-family: 'Google Sans','Product Sans','Roboto',sans-serif;
}
.gp-app-developer { font-size: 14px; }
.gp-app-developer a { color: var(--gp-green); font-weight: 500; }
.gp-verified { display: inline-flex; vertical-align: middle; }
.gp-verified .gp-icon { width: 14px; height: 14px; color: var(--gp-green); margin-left: 2px; }
.gp-app-flags { color: var(--gp-text-secondary); font-size: 12px; margin-top: 4px; }
.gp-dot { padding: 0 4px; }

.gp-app-stats {
  display: flex; align-items: stretch; gap: 0;
  margin: 20px 0; padding: 4px 0; max-width: 580px;
}
.gp-stat { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 0 16px; text-decoration: none; color: var(--gp-text); }
.gp-stat:first-child { padding-left: 0; }
.gp-stat:last-child  { padding-right: 0; }
.gp-stat-divider { width: 1px; background: var(--gp-border); margin: 8px 0; }
.gp-stat-top { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--gp-text); font-weight: 500; }
.gp-stat-bottom { font-size: 12px; color: var(--gp-text-secondary); }
.gp-star-mini { width: 14px !important; height: 14px !important; color: var(--gp-text); }
.gp-info { width: 14px !important; height: 14px !important; color: var(--gp-text-secondary); }
.gp-pegi {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gp-text-secondary); border-radius: 4px;
  padding: 1px 6px; font-size: 11px; color: var(--gp-text-secondary); font-weight: 700;
  min-width: 22px;
}

.gp-cta { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.gp-install-btn {
  background: var(--gp-green); color: #fff;
  border: none; border-radius: 999px;
  padding: 10px 28px; font-size: 14px; font-weight: 500;
  letter-spacing: .25px; min-width: 192px;
  transition: background .15s, transform .05s, box-shadow .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.gp-install-btn:hover { background: var(--gp-green-hover); box-shadow: var(--gp-shadow); }
.gp-install-btn:active { transform: scale(.98); }
.gp-install-btn[disabled], .gp-install-btn.is-loading { background: #80c2a8; cursor: progress; }
.gp-install-btn .gp-spinner { display: none; }
.gp-install-btn.is-loading .gp-spinner { display: inline-block; }
.gp-install-btn-sm { min-width: 130px; padding: 8px 22px; }
.gp-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: gpspin 0.8s linear infinite; }
@keyframes gpspin { to { transform: rotate(360deg); } }

.gp-secondary-btn {
  background: transparent; color: var(--gp-text);
  border: 1px solid var(--gp-border); border-radius: 999px;
  padding: 9px 18px; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.gp-secondary-btn:hover { background: var(--gp-bg-soft); }
.gp-secondary-btn .gp-icon { width: 18px; height: 18px; color: var(--gp-text-secondary); }
.gp-device-line {
  margin-top: 16px; color: var(--gp-text-secondary); font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}

/* ============ Sections ============ */
.gp-section { border-top: 1px solid var(--gp-border); padding: 24px 0; }
.gp-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; color: var(--gp-text); text-decoration: none;
}
.gp-section-head h2 { font-size: 22px; font-weight: 500; margin: 0; font-family: 'Google Sans','Roboto',sans-serif; display: flex; align-items: center; gap: 8px; }
.gp-section-sub { color: var(--gp-text-secondary); font-size: 13px; margin: -8px 0 16px; display: inline-flex; align-items: center; gap: 6px; }
.gp-app-description {
  font-size: 14px; line-height: 1.7; color: var(--gp-text);
  white-space: pre-wrap; max-width: 920px;
}
.gp-app-tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.gp-tag {
  border: 1px solid var(--gp-border); border-radius: 999px;
  padding: 6px 14px; color: var(--gp-text-secondary); font-size: 13px;
}
.gp-tag:hover { background: var(--gp-bg-soft); color: var(--gp-text); }

/* ============ Screenshots ============ */
.gp-screenshots-section { padding: 8px 0 24px; border-top: none; }
.gp-screens-wrap { position: relative; }
.gp-screens {
  display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth;
  scroll-snap-type: x mandatory; padding: 8px 0;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.gp-screens::-webkit-scrollbar { height: 6px; }
.gp-screens::-webkit-scrollbar-thumb { background: var(--gp-border); border-radius: 3px; }
.gp-screen { flex: 0 0 auto; scroll-snap-align: start; border-radius: 12px; overflow: hidden; box-shadow: var(--gp-shadow); background: #f1f3f4; }
.gp-screen img { display: block; height: 360px; width: auto; max-width: none; object-fit: cover; }
.gp-screens-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 1px solid var(--gp-border);
  box-shadow: var(--gp-shadow);
  display: flex; align-items: center; justify-content: center;
  z-index: 2; color: var(--gp-text); cursor: pointer;
}
.gp-screens-arrow:hover { background: var(--gp-bg-soft); }
.gp-screens-prev { left: -16px; }
.gp-screens-next { right: -16px; }

/* ============ Reviews ============ */
.gp-reviews-summary {
  display: grid; grid-template-columns: 1fr 2fr; gap: 32px;
  align-items: center; max-width: 720px; margin-bottom: 24px;
}
.gp-rating-big { display: flex; flex-direction: column; align-items: center; }
.gp-rating-num { font-size: 64px; font-weight: 500; line-height: 1; font-family: 'Google Sans','Roboto',sans-serif; }
.gp-rating-stars { display: flex; gap: 2px; }
.gp-rating-stars .gp-icon { width: 18px; height: 18px; color: var(--gp-green); }
.gp-rating-count { color: var(--gp-text-secondary); font-size: 13px; margin-top: 6px; }
.gp-rating-bars { display: flex; flex-direction: column; gap: 8px; }
.gp-rating-bar { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--gp-text-secondary); }
.gp-bar-num { width: 12px; text-align: right; }
.gp-bar-track { flex: 1; height: 10px; background: var(--gp-bg-soft); border-radius: 6px; overflow: hidden; }
.gp-bar-fill { height: 100%; background: var(--gp-green); border-radius: 6px; }

.gp-review-list { display: flex; flex-direction: column; gap: 28px; max-width: 920px; }
.gp-review-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.gp-review-avatar {
  width: 32px; height: 32px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 14px;
}
.gp-review-meta { flex: 1; }
.gp-review-author { font-size: 13px; font-weight: 500; }
.gp-review-rating { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gp-text-secondary); }
.gp-review-rating .gp-icon { width: 14px; height: 14px; color: var(--gp-green); }
.gp-review-date { margin-left: 8px; }
.gp-review-text { font-size: 14px; line-height: 1.6; margin: 8px 0; color: var(--gp-text); }
.gp-review-helpful { font-size: 12px; color: var(--gp-text-secondary); }
.gp-review-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--gp-text-secondary); }
.gp-pill { border: 1px solid var(--gp-border); background: #fff; border-radius: 999px; padding: 4px 14px; font-size: 13px; color: var(--gp-text); }
.gp-pill:hover { background: var(--gp-bg-soft); }

/* ============ Info grid ============ */
.gp-info-cells { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 32px; max-width: 720px; }
.gp-info-cells > div { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.gp-info-cells strong { color: var(--gp-text); font-weight: 500; }
.gp-info-cells span { color: var(--gp-text-secondary); }

/* ============ Developer list ============ */
.gp-developer-list { list-style: none; padding: 0; margin: 0; }
.gp-developer-list li { border-bottom: 1px solid var(--gp-border); }
.gp-developer-list li:last-child { border-bottom: none; }
.gp-developer-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; font-size: 14px; color: var(--gp-text);
}
.gp-developer-list .gp-icon { color: var(--gp-text-secondary); }

/* ============ Similar apps (2-col grid, Play Store style) ============ */
.gp-similar-section { padding-bottom: 8px; }
.gp-similar-wrap { position: relative; }
.gp-similar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  padding: 4px 0 8px;
}
.gp-similar-card {
  display: flex; flex-direction: row;
  align-items: center; gap: 12px;
  color: var(--gp-text); text-decoration: none;
  min-width: 0;
}
.gp-similar-icon {
  flex: 0 0 56px;
  width: 56px; height: 56px;
  border-radius: 12px; overflow: hidden;
  background: #f5f5f5;
}
.gp-similar-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gp-similar-info { flex: 1; min-width: 0; }
.gp-similar-name {
  font-size: 13px; font-weight: 500; color: var(--gp-text); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-similar-dev {
  display: block;
  font-size: 11px; color: var(--gp-text-secondary); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-similar-rating { font-size: 11px; color: var(--gp-text-secondary); display: flex; align-items: center; gap: 2px; line-height: 1.4; margin-top: 1px; }
.gp-similar-rating .gp-icon { width: 11px !important; height: 11px !important; }
.gp-similar-prev, .gp-similar-next { display: none; }

.gp-flag { padding: 12px 0 !important; }
.gp-flag .gp-section-head { margin-bottom: 0; }
.gp-flag h2 { font-size: 14px; font-weight: 500; color: var(--gp-text-secondary); }
.gp-flag .gp-icon { color: var(--gp-text-secondary); width: 18px; height: 18px; }

/* ============ Footer ============ */
.gp-footer { background: #fafafa; border-top: 1px solid var(--gp-border); margin-top: 8px; }
.gp-footer-inner { max-width: 1280px; margin: 0 auto; padding: 16px 24px; }
.gp-footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gp-footer-cols h4 { font-size: 14px; margin: 0 0 12px; font-weight: 500; }
.gp-footer-cols ul { list-style: none; padding: 0; margin: 0; }
.gp-footer-cols li { padding: 4px 0; }
.gp-footer-cols a { font-size: 13px; color: var(--gp-text-secondary); }
.gp-footer-cols a:hover { color: var(--gp-text); }
.gp-footer-bottom {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gp-border);
  font-size: 12px; color: var(--gp-text-secondary);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.gp-footer-bottom a { color: var(--gp-text-secondary); }
.gp-footer-bottom a:hover { color: var(--gp-text); }

/* ============ Toast ============ */
.gp-toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #202124; color: #fff;
  padding: 12px 20px; border-radius: 8px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none; z-index: 100; max-width: 90vw;
}
.gp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ Sticky install bar (mobile) ============ */
.gp-sticky-install {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fff; border-top: 1px solid var(--gp-border);
  display: none; align-items: center; gap: 12px;
  padding: 10px 16px; box-shadow: 0 -4px 12px rgba(0,0,0,.06);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.gp-sticky-install[hidden] { display: none; }
.gp-sticky-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.gp-sticky-icon { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex-shrink: 0; box-shadow: var(--gp-shadow); }
.gp-sticky-icon img { width: 100%; height: 100%; object-fit: cover; }
.gp-icon-fb { width: 100%; height: 100%; display:flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; }
.gp-sticky-text { min-width: 0; }
.gp-sticky-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-sticky-rating { font-size: 12px; color: var(--gp-text-secondary); display: flex; align-items: center; gap: 4px; }

/* ============ Responsive: tablets ============ */
@media (max-width: 980px) {
  .gp-nav { display: none; }
  .gp-search { width: 200px; }
  .gp-app-header-grid { grid-template-columns: 96px 1fr; gap: 20px; }
  .gp-app-icon { width: 96px; height: 96px; border-radius: 22px; }
  .gp-app-icon-fallback span { font-size: 56px; letter-spacing: -2px; }
  .gp-app-title { font-size: 22px; line-height: 1.25; margin-bottom: 4px; }
  .gp-app-developer { font-size: 13px; }
  .gp-app-stats { flex-wrap: nowrap; max-width: none; gap: 0; padding: 12px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gp-app-stats::-webkit-scrollbar { display: none; }
  .gp-app-stats { scrollbar-width: none; }
  .gp-stat-divider { display: block; }
  .gp-stat { padding: 0 12px; flex: 0 0 auto; min-width: max-content; }
  .gp-cta { gap: 10px; }
  .gp-install-btn { flex: 1; min-width: 0; padding: 10px 20px; }
  .gp-secondary-btn { flex: 1; justify-content: center; padding: 9px 14px; }
  .gp-reviews-summary { grid-template-columns: 1fr; gap: 16px; text-align: left; }
  .gp-rating-big { align-items: flex-start; }
  .gp-info-cells { grid-template-columns: 1fr; gap: 14px; }
  .gp-footer-cols { grid-template-columns: 1fr 1fr; }
  .gp-screen img { height: 240px; }
  .gp-screens-arrow { display: none; }
  .gp-similar-prev, .gp-similar-next { display: none !important; }
}

/* ============ Responsive: phones (Android Play Store layout) ============ */
@media (max-width: 600px) {
  .gp-header-inner {
    padding: 6px 8px; min-height: 64px; gap: 0;
    display: flex; align-items: center; justify-content: space-between;
  }
  .gp-mobile-search { display: inline-flex; }
  .gp-search { display: none; }
  .gp-header-actions { gap: 0; }
  .gp-header-actions .gp-icon-btn:not(.gp-mobile-search) { display: none; }
  .gp-logo-img { height: 32px; }
  .gp-logo { padding: 6px 8px; margin-left: 0; }
  .gp-avatar { width: 32px; height: 32px; margin-left: 4px; }
  .gp-avatar .gp-icon { width: 32px; height: 32px; }

  .gp-main { padding: 0 16px 24px; }
  .gp-breadcrumb { display: none; }

  .gp-app-header { padding-top: 16px; }
  .gp-app-header-grid { grid-template-columns: 80px 1fr; gap: 16px; align-items: center; }
  .gp-app-icon { width: 80px; height: 80px; border-radius: 18px; }
  .gp-app-icon-fallback span { font-size: 44px; letter-spacing: -2px; }
  .gp-app-title { font-size: 22px; line-height: 1.2; margin: 0 0 2px; }
  .gp-app-developer { font-size: 13px; }
  .gp-app-flags { font-size: 11px; }

  .gp-app-stats { padding: 16px 0 0; margin: 12px -16px 16px; padding-left: 16px; padding-right: 16px; }
  .gp-stat { padding: 0 14px; }
  .gp-stat-top { font-size: 13px; }
  .gp-stat-bottom { font-size: 11px; }

  .gp-cta { flex-direction: column; gap: 8px; }
  .gp-install-btn, .gp-secondary-btn { width: 100%; justify-content: center; min-width: 0; }
  .gp-secondary-btn { display: none; } /* mobile keeps only Install — like real Play Store */
  .gp-device-line { font-size: 13px; }

  .gp-section h2 { font-size: 18px; }
  .gp-screen img { height: 220px; }

  .gp-rating-num { font-size: 56px; }
  .gp-rating-stars .gp-icon { width: 16px; height: 16px; }

  .gp-similar { gap: 10px 12px; }
  .gp-similar-icon { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 10px; }
  .gp-similar-name { font-size: 12px; }
  .gp-similar-dev { font-size: 10px; }
  .gp-similar-rating { font-size: 10px; }

  .gp-footer-cols { grid-template-columns: 1fr; gap: 24px; }

  .gp-sticky-install.is-visible { display: flex; }
}

/* ============ Touch tweaks ============ */
@media (hover: none) {
  .gp-icon-btn:hover, .gp-secondary-btn:hover, .gp-install-btn:hover { background: var(--gp-green); }
  .gp-install-btn:hover { background: var(--gp-green); }
}
