:root {
  --bg: #ffffff;
  --bg-card: #f8f9fa;
  --bg-card2: #f1f3f4;
  --text: #202124;
  --text-muted: #5f6368;
  --text-dim: #80868b;
  --accent: #1a73e8;
  --accent-btn: #01875f;
  --accent-btn-hover: #056d4d;
  --star: #1a73e8;
  --border: #dadce0;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'Roboto', system-ui, -apple-system, sans-serif;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

.ps-page {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(8px + var(--safe-t)) 20px calc(72px + var(--safe-b));
}

.ps-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ps-play-brand {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ps-gp-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.ps-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.ps-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.ps-app-icon {
  width: 72px;
  height: 72px;
  border-radius: 20%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15);
}

.ps-app-name {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--text);
}

.ps-dev-name {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.ps-dev-sub {
  color: var(--text-muted);
  font-size: 12px;
}

.ps-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
}

.ps-stat {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

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

.ps-stat span:last-child {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.ps-stat-icon { font-size: 16px !important; }

.ps-stat-div {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.ps-install-wrap {
  margin-bottom: 24px;
}

.ps-btn-install {
  display: block;
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: var(--accent-btn);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background .2s, transform .1s;
  touch-action: manipulation;
}

.ps-btn-install:hover,
.ps-btn-install:active {
  background: var(--accent-btn-hover);
}

.ps-btn-install:active { transform: scale(.98); }

.ps-install-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

.ps-screenshots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 0 -20px 24px;
  padding-left: 20px;
  padding-right: 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.ps-shot {
  flex: 0 0 148px;
  height: 264px;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(60,64,67,.1);
}

.ps-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.ps-section {
  margin-bottom: 28px;
}

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

.ps-section-head h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.ps-arrow {
  color: var(--text-muted);
  font-size: 20px;
}

.ps-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ps-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ps-tag {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-card2);
  color: var(--text-muted);
}

.ps-safety-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.ps-safety-row {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.ps-safety-row:last-of-type { border-bottom: none; }

.ps-safety-ico { font-size: 18px; flex-shrink: 0; margin-top: 2px; }

.ps-safety-row strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.35;
  color: var(--text);
}

.ps-safety-row p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.ps-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.ps-rating-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

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

.ps-rating-big {
  text-align: center;
  min-width: 80px;
}

.ps-rating-num {
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  display: block;
  color: var(--text);
}

.ps-stars-lg {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 1px;
  margin: 4px 0;
}

.ps-rating-count {
  font-size: 12px;
  color: var(--text-muted);
}

.ps-bars { flex: 1; }

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

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

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

.ps-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.ps-review {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.ps-review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

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

.ps-review-head strong {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.ps-review-menu {
  color: var(--text-muted);
  font-size: 18px;
}

.ps-review-meta {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}

.ps-review-meta span { color: var(--text-muted); margin-left: 6px; }

.ps-review > p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ps-helpful {
  font-size: 12px;
  color: var(--text-dim);
  margin: 10px 0 8px;
}

.ps-helpful-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ps-helpful-btns button {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
}

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

.ps-dev-reply strong {
  font-size: 12px;
  color: var(--text);
}

.ps-dev-reply span {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.ps-dev-reply p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.45;
}

.ps-section-last { margin-bottom: 8px; }

.ps-spacer { height: 16px; }

.ps-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + var(--safe-b));
  max-width: 480px;
  margin: 0 auto;
}

.ps-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  min-width: 56px;
}

.ps-nav-item.active {
  color: var(--accent);
}

.ps-nav-item.active .ps-nav-ico {
  background: rgba(26,115,232,.12);
  border-radius: 50%;
  padding: 4px 12px;
}

.ps-nav-ico {
  font-size: 18px;
  line-height: 1;
}

.ps-toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + var(--safe-b));
  transform: translateX(-50%);
  background: #323232;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  z-index: 200;
  white-space: nowrap;
}

@media (min-width: 481px) {
  body {
    background: #f1f3f4;
  }
  .ps-page {
    background: var(--bg);
    min-height: 100vh;
    box-shadow: 0 0 24px rgba(60,64,67,.15);
  }
  .ps-bottom-nav {
    left: 50%;
    transform: translateX(-50%);
  }
}
