:root {
  --bg: #ffffff;
  --fg: #1a1c20;
  --play-green: #16a34a;
  --play-green-dark: #138a3e;
  --play-muted: #5f6368;
  --divider: #e8eaed;
  --surface: #f8f9fa;
  --gradient-install: linear-gradient(135deg, #16a34a, #138a3e);
  --shadow-install: 0 10px 30px -10px rgba(22, 163, 74, 0.45);
  --shadow-card: 0 4px 16px -8px rgba(0, 0, 0, 0.18);
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

body { padding-bottom: 110px; min-height: 100vh; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

/* Top Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 12px;
  border-bottom: 1px solid var(--divider);
}
.top-actions { display: flex; gap: 4px; }
.icon-btn {
  padding: 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--surface); }

/* Container */
.container { max-width: 480px; margin: 0 auto; padding: 20px 16px 0; }

/* App Header */
.app-header { display: flex; gap: 16px; align-items: flex-start; }
.app-icon {
  width: 80px; height: 80px;
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  object-fit: cover;
  flex-shrink: 0;
}
.app-meta { flex: 1; min-width: 0; padding-top: 2px; }
.app-meta h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.15; }
.dev-link {
  color: var(--play-green);
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
  padding: 0;
}
.dev-link:hover { text-decoration: underline; }
.iap { font-size: 12px; color: var(--play-muted); margin-top: 4px; }

/* Stats */
.stats {
  display: flex;
  align-items: center;
  margin-top: 22px;
  text-align: center;
}
.stat { flex: 1; }
.stat-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
}
.stat p { font-size: 11px; color: var(--play-muted); margin-top: 2px; }
.divider { width: 1px; height: 32px; background: var(--divider); }
.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--divider);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Install Section */
.install-section { margin-top: 24px; }
.install-btn {
  position: relative;
  width: 100%;
  background: var(--gradient-install);
  color: white;
  font-weight: 600;
  font-size: 15px;
  padding: 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-install);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s;
}
.install-btn:active { transform: scale(0.97); }
.install-btn:disabled { opacity: 0.9; cursor: wait; }
.shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.ghost-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  font-size: 14px;
  color: var(--fg);
  background: white;
  transition: background 0.15s, transform 0.15s;
}
.ghost-btn:hover { background: var(--surface); }
.ghost-btn:active { transform: scale(0.97); }

.device-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--play-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Screenshots */
.screenshots { margin: 28px -16px 0; }
.shots-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.shots-scroll::-webkit-scrollbar { display: none; }
.shot {
  flex-shrink: 0;
  width: 175px;
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  background: var(--surface);
}
.shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.shot:hover img { transform: scale(1.04); }

/* Block sections */
.block { margin-top: 28px; }
.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.block-header h2 { font-size: 17px; font-weight: 600; }
.muted-icon { color: var(--play-muted); }
.body-text {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(26, 28, 32, 0.85);
}
.muted-text { color: var(--play-muted); font-size: 13px; line-height: 1.5; margin-top: 8px; }
.muted-text.small { font-size: 11px; margin-top: 0; }
.muted-text.center { text-align: center; }
.mt { margin-top: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--play-muted);
}

/* Safety */
.safety-list {
  margin-top: 16px;
  border: 1px solid var(--divider);
  border-radius: 16px;
  overflow: hidden;
}
.safety-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
}
.safety-item:last-child { border-bottom: none; }
.safety-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--play-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.safety-item p { font-size: 13.5px; color: rgba(26,28,32,0.9); }

/* Ratings */
.rating-summary {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.rating-num { text-align: center; }
.big-num { font-size: 56px; line-height: 1; font-weight: 300; }
.small-stars { display: flex; gap: 2px; justify-content: center; margin-top: 6px; }
.rating-num p { font-size: 11px; color: var(--play-muted); margin-top: 4px; }
.bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-row span { font-size: 11px; color: var(--play-muted); width: 8px; }
.bar {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.bar > div { height: 100%; background: var(--play-green); border-radius: 999px; }

.review { margin-top: 28px; display: flex; gap: 12px; align-items: flex-start; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fb7185, #db2777);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}
.review-body { flex: 1; }
.reviewer { font-size: 14px; font-weight: 500; }
.review-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.review-text { margin-top: 8px; font-size: 14px; line-height: 1.55; color: rgba(26,28,32,0.9); }
.helpful-row {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  flex-wrap: wrap;
}
.pill-btn {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  font-size: 12px;
  background: white;
  transition: background 0.15s;
}
.pill-btn:hover { background: var(--surface); }

.copyright {
  margin-top: 40px;
  text-align: center;
  font-size: 11px;
  color: var(--play-muted);
}

/* Floating Pill */
.floating-pill {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s;
}
.floating-pill:active { transform: translateX(-50%) scale(0.97); }
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--play-green);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 22, 28, 0.55);
  animation: fade-in 0.2s ease-out;
}
.modal-overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  animation: modal-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal.closing { animation: modal-out 0.2s ease-in forwards; }
@keyframes modal-out {
  to { opacity: 0; transform: scale(0.95); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-head-left { display: flex; align-items: center; gap: 12px; }
.modal-icon {
  width: 48px; height: 48px;
  border-radius: 16px;
  background: var(--gradient-install);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-install);
}
.modal-head h3 { font-size: 18px; font-weight: 600; }

.modal-body-text { margin-top: 18px; font-size: 14px; color: rgba(26,28,32,0.85); line-height: 1.5; }

.link-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--divider);
}
.link-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: rgba(26,28,32,0.8);
  font-family: inherit;
  text-overflow: ellipsis;
}

.modal-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modal-actions .ghost-btn { padding: 12px; font-weight: 500; }
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 999px;
  background: var(--gradient-install);
  color: white;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-install);
  transition: transform 0.15s;
}
.primary-btn:active { transform: scale(0.97); }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 12px 20px;
  background: #16a34a;
  color: white;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
  animation: toast-in 0.3s ease-out;
}
.toast[hidden] { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (min-width: 768px) {
  .container { max-width: 520px; }
}
