/* Detail page */
.detail-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px 96px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding: 8px 4px;
}

.detail-back:hover {
  color: var(--text);
}

.detail-hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.detail-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.detail-icon .badge-appdoni-plus {
  width: 26px;
  height: 26px;
  inset-inline-start: 4px;
  bottom: 4px;
}

.detail-icon .badge-appdoni-plus svg {
  width: 14px;
  height: 14px;
}

.detail-title {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 4px;
}

.detail-dev {
  color: var(--play-green);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.detail-genre {
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 20px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.detail-stat {
  flex: 1;
  min-width: 100px;
  padding: 14px 12px;
  text-align: center;
  border-left: 1px solid var(--border-light);
}

.detail-stat:last-child {
  border-left: none;
}

.detail-stat-value {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.detail-stat-value svg {
  width: 14px;
  height: 14px;
}

.detail-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.detail-actions .btn-install {
  min-width: 160px;
  text-align: center;
}

.btn-share,
.btn-wishlist {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--play-green);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.btn-share:hover,
.btn-wishlist:hover {
  background: var(--play-green-soft);
}

.detail-notes {
  font-size: 12px;
  color: var(--text-muted);
  width: 100%;
}

.detail-shots {
  margin-bottom: 32px;
}

.shot {
  width: 200px;
  height: 356px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  display: block;
  appearance: none;
  -webkit-appearance: none;
}

.shot:focus-visible {
  outline: 2px solid var(--play-green);
  outline-offset: 2px;
}

.shot .art-placeholder {
  font-size: 42px;
}

.detail-section {
  margin-bottom: 32px;
}

.detail-section h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
}

.detail-section p,
.detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-line;
}

.detail-desc.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.btn-text {
  color: var(--play-green);
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}

.review-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 20px 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-light);
}

.review-card:last-child {
  border-bottom: 0;
}

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

.review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.review-meta {
  flex: 1;
  min-width: 0;
}

.review-meta .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.review-meta .date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.review-card .stars-row {
  margin-inline-start: auto;
}

.review-body,
.review-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

.review-body p {
  margin: 0 0 0.5em;
}

.review-body p:last-child {
  margin-bottom: 0;
}

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

.review-helpful-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-family: inherit;
  cursor: default;
}

/* Google Play ratings summary */
.play-reviews .reviews-header {
  margin-bottom: 20px;
}

.play-reviews .reviews-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 6px;
}

.play-reviews .reviews-verified {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.ratings-summary {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 8px;
}

.ratings-summary-score {
  text-align: center;
}

.ratings-big {
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
}

.ratings-summary-score .stars-row {
  justify-content: center;
  margin: 8px 0 6px;
}

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

.ratings-histogram {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hist-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: center;
}

.hist-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.hist-track {
  height: 8px;
  background: var(--hover);
  border-radius: 999px;
  overflow: hidden;
}

.hist-fill {
  height: 100%;
  background: var(--play-green);
  border-radius: 999px;
  min-width: 0;
}

.stars-row {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.stars-row .star {
  width: 14px;
  height: 14px;
  fill: #dadce0;
}

.stars-row .star.filled {
  fill: var(--play-green);
}

.reviews-list {
  margin-bottom: 16px;
}

.reviews-list.comments-list-collapsible:not(.is-expanded) > .review-card:nth-child(n + 7) {
  display: none;
}

.comments-show-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--play-green);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.comments-show-more:hover {
  background: var(--play-green-soft);
  border-color: var(--play-green);
}

.comments-show-more[hidden] {
  display: none !important;
}

.reviews-empty {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 20px;
}

.review-form-wrap {
  margin-top: 8px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
}

.review-form .comment-reply-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 12px;
}

.review-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.review-form input[type="text"],
.review-form input[type="email"],
.review-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 12px;
}

.review-form textarea {
  min-height: 100px;
  resize: vertical;
}

.rating-picker {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 12px;
}

.rating-pick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
}

.rating-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-pick svg {
  width: 14px;
  height: 14px;
  fill: #dadce0;
}

.rating-pick:has(input:checked),
.rating-pick:hover {
  border-color: var(--play-green);
  background: var(--play-green-soft);
  color: var(--play-green);
}

.rating-pick:has(input:checked) svg,
.rating-pick:hover svg {
  fill: var(--play-green);
}

.review-submit {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .ratings-summary {
    grid-template-columns: 100px 1fr;
    gap: 16px;
  }

  .ratings-big {
    font-size: 44px;
  }

  .review-top {
    flex-wrap: wrap;
  }

  .review-card .stars-row {
    margin-inline-start: 48px;
    width: 100%;
  }
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
  font-size: 13px;
}

.detail-info-grid dt {
  color: var(--text-muted);
}

.detail-info-grid dd {
  margin-bottom: 8px;
  color: var(--text);
}

.detail-sticky-install {
  display: none;
  position: fixed;
  bottom: 64px;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  z-index: 90;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.detail-sticky-install .btn-install {
  width: 100%;
  text-align: center;
  display: block;
}

@media (max-width: 640px) {
  .detail-page {
    padding: 12px 12px 120px;
  }

  .detail-hero {
    grid-template-columns: 72px 1fr;
    gap: 14px;
  }

  .detail-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }

  .detail-title {
    font-size: 22px;
  }

  .detail-stat {
    min-width: 80px;
    padding: 12px 8px;
  }

  .shot {
    width: 140px;
    height: 248px;
  }

  .detail-sticky-install {
    display: block;
  }

  body.has-bottom-nav .detail-sticky-install {
    bottom: 64px;
  }
}

/* WordPress media adaptations */
.shot img,
.detail-icon img,
.art-thumb img,
.chart-icon img,
.app-tile-icon img,
.featured-icon img,
.indie-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.art-thumb {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.detail-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #000;
}

.detail-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.download-list,
.version-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-list .btn-install {
  display: inline-flex;
  width: auto;
  padding: 10px 20px;
}

.detail-desc.entry-content {
  white-space: normal;
}

.detail-page .content-section {
  padding-left: 0;
  padding-right: 0;
}

/* ========== Screenshot lightbox ========== */
body.lightbox-open {
  overflow: hidden;
}

.shot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
  background: rgba(32, 33, 36, 0.45);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: shot-lightbox-in 0.22s ease;
}

.shot-lightbox[hidden] {
  display: none;
}

@keyframes shot-lightbox-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.shot-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(920px, 100%);
  max-height: 100%;
  width: 100%;
  height: 100%;
}

.shot-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 112px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  animation: shot-lightbox-zoom 0.22s ease;
}

@keyframes shot-lightbox-zoom {
  from {
    transform: scale(0.92);
    opacity: 0.6;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.shot-lightbox-close,
.shot-lightbox-nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background var(--transition), transform var(--transition);
}

.shot-lightbox-close:hover,
.shot-lightbox-nav:hover {
  background: #fff;
  transform: scale(1.05);
}

.shot-lightbox-close:focus-visible,
.shot-lightbox-nav:focus-visible {
  outline: 2px solid var(--play-green);
  outline-offset: 2px;
}

.shot-lightbox-close {
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
}

.shot-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}

.shot-lightbox-nav:hover {
  transform: translateY(-50%) scale(1.05);
}

.shot-lightbox-nav.prev {
  right: 16px;
}

.shot-lightbox-nav.next {
  left: 16px;
}

.shot-lightbox-nav[hidden] {
  display: none;
}

.shot-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: none;
}

@media (max-width: 640px) {
  .shot-lightbox {
    padding: 64px 16px 72px;
  }

  .shot-lightbox-img {
    max-height: calc(100vh - 140px);
    border-radius: var(--radius-md);
  }

  .shot-lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .shot-lightbox-nav.prev {
    right: 8px;
  }

  .shot-lightbox-nav.next {
    left: 8px;
  }

  .shot-lightbox-close {
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
  }
}
