/* App / เกม — the app's own home (hero, download, screenshots, reviews). Header, footer, cards and
   articles come from _base.css; colours from theme options. */
:root { --star: #f4b400; --star-off: #dadce0; --good: #188038; --bad: #c5221f; }
html[data-mode='dark'] { --star-off: #3c4043; --good: #81c995; --bad: #f28b82; }
@media (prefers-color-scheme: dark) { html[data-mode='auto'] { --star-off: #3c4043; --good: #81c995; --bad: #f28b82; } }
.theme-app h1 { font-size: clamp(28px, 4.6vw, 44px); font-weight: 600; margin: 0; }
.theme-app .block > h2 { font-size: 22px; font-weight: 600; margin: 0 0 16px; }
.app-hero { padding-top: 8px; }
.app-id { display: flex; align-items: center; gap: 24px; }
.app-icon { width: 128px; height: 128px; border-radius: 28px; object-fit: cover; box-shadow: 0 1px 3px rgb(60 64 67 / .3), 0 4px 12px rgb(60 64 67 / .15); flex: none; background: var(--surface); }
.app-dev { margin: 6px 0 0; color: var(--brand); font-weight: 600; font-size: 17px; }
.app-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.app-tags span { font-size: 13px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--bg); }
.app-stats { display: flex; flex-wrap: wrap; margin: 26px 0 0; padding: 0; }
.app-stats > div { padding: 2px 26px; text-align: center; border-left: 1px solid var(--line); }
.app-stats > div:first-child { padding-left: 0; border-left: 0; text-align: left; }
.app-stats dt { display: flex; align-items: center; gap: 4px; justify-content: center; font-size: 15px; }
.app-stats > div:first-child dt { justify-content: flex-start; }
.app-stats dt strong { font-size: 17px; font-weight: 600; }
.app-stats dd { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.app-get { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.get-btn { display: inline-flex; align-items: center; gap: 10px; min-width: 260px; justify-content: center; padding: 13px 28px; border-radius: 12px; background: var(--brand); color: var(--on-brand); text-decoration: none; font-weight: 600; font-size: 17px; box-shadow: 0 1px 2px rgb(0 0 0 / .12); transition: filter .15s, transform .15s; }
.get-btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.get-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.get-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Screenshots */
.shots { list-style: none; margin: 0; padding: 2px 2px 12px; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.shots li { flex: none; scroll-snap-align: start; }
.shots img { height: 380px; width: auto; max-width: none; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: block; }

/* About */
.about { max-width: 780px; margin: 0 0 20px; white-space: pre-line; }

/* Stars */
.stars { display: inline-flex; gap: 1px; color: var(--star); vertical-align: middle; }
.star { width: 15px; height: 15px; fill: currentColor; }
.star.empty { fill: var(--star-off); }

/* Editorial review */

/* Store ratings + reviews */
.rating-big { display: grid; justify-items: start; gap: 4px; }
.rating-big strong { font-size: 56px; line-height: 1; font-weight: 500; }
.rating-big .star { width: 18px; height: 18px; }
.rating-big > span:not(.stars) { font-size: 13px; color: var(--muted); }
.reviews-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.review { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.review header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-meta { font-size: 12.5px; color: var(--muted); }
.review h3 { font-size: 15.5px; margin: 8px 0 4px; }
.review p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.source { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.notes { white-space: pre-line; max-width: 780px; margin: 0; }

/* Details */
.info { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; margin: 0; }
.info > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.info dt { font-size: 13px; color: var(--muted); }
.info dd { margin: 2px 0 0; font-weight: 500; }

@media (max-width: 720px) {
  .app-id { gap: 16px; align-items: flex-start; }
  .app-icon { width: 84px; height: 84px; border-radius: 20px; }
  .app-stats { flex-wrap: nowrap; overflow-x: auto; }
  .app-stats > div { padding: 2px 16px; flex: none; }
  .get-btn { width: 100%; min-width: 0; }
  .app-get > .get-main { width: 100%; }
    .shots img { height: 300px; }
    .reviews-cards { grid-template-columns: 1fr; }
}
.app-tags .tag-free { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 600; }
.stats-source { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.small { font-size: 14px; }
.shot { display: block; border-radius: 14px; cursor: zoom-in; }
.shot img { transition: transform .2s; }
.shot:hover img { transform: translateY(-2px); }
.viewer { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden; }
.viewer::backdrop { background: rgb(0 0 0 / .88); }
.viewer[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; justify-items: center; }
.viewer img { max-width: 100%; max-height: 88vh; width: auto; height: auto; border-radius: 12px; grid-column: 2; grid-row: 1; }
.viewer button { background: rgb(255 255 255 / .14); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer; }
.viewer button:hover { background: rgb(255 255 255 / .26); }
.viewer-prev { grid-column: 1; grid-row: 1; } .viewer-next { grid-column: 3; grid-row: 1; }
.viewer-close { position: fixed; top: 16px; right: 16px; font-size: 20px !important; }
.viewer-count { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; margin: 0; }
@media (max-width: 720px) { .viewer[open] { grid-template-columns: 0 1fr 0; } .viewer-prev, .viewer-next { position: fixed; bottom: 8px; } .viewer-prev { left: 16px; } .viewer-next { right: 16px; } }

/* Reviews */
.ratings-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 40px; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); margin-bottom: 18px; }
.rating-store { padding-left: 32px; border-left: 1px solid var(--line); }
.rating-bars { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 16px 1fr 36px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.bar { height: 9px; border-radius: 9px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--star); border-radius: 9px; }
.bar-n { text-align: right; }
.review-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { font: inherit; font-size: 14px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text-2); cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.review { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.review[hidden] { display: none; }
.review.is-pinned { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 50%, var(--bg)); }
.review header { display: flex; align-items: center; gap: 10px; }
.review .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; flex: none; }
.review-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.review-who strong { font-size: 14.5px; }
.pin { margin-left: auto; font-size: 12px; color: var(--brand); white-space: nowrap; }
.review-rate { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.src { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.src-visitor { background: var(--brand-soft); color: var(--brand); }
.src-team { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); color: var(--text-2); }
.review h3 { margin: 2px 0 0; font-size: 15.5px; }
.review-body { margin: 0; white-space: pre-line; }
.review-reply { margin-top: 6px; padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--surface); border-radius: 0 8px 8px 0; font-size: 14px; }
.review-reply p { margin: 4px 0 0; color: var(--text-2); white-space: pre-line; }
.more-btn { display: block; margin: 16px auto 0; font: inherit; font-weight: 600; padding: 9px 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--brand); cursor: pointer; }
.review-note { display: none; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-weight: 500; }
.review-note:target { display: block; }
.note-ok { background: color-mix(in srgb, var(--good) 14%, var(--bg)); color: var(--good); }
.note-bad { background: color-mix(in srgb, var(--bad) 12%, var(--bg)); color: var(--bad); }
.write-review { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.write-review > summary { padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; }
.write-review > summary::-webkit-details-marker { display: none; }
.review-form { display: grid; gap: 12px; padding: 0 18px 18px; }
.review-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.review-form input, .review-form select, .review-form textarea { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.review-form input:focus, .review-form select:focus, .review-form textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
.form-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; }
.form-note { margin: 0; font-size: 13px; color: var(--muted); }
.review-form .get-btn { justify-self: start; min-width: 0; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.star-input { border: 0; padding: 0; margin: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input legend { font-size: 14px; font-weight: 500; margin-bottom: 2px; float: left; width: 100%; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 30px; line-height: 1; color: var(--star-off); cursor: pointer; transition: color .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }
@media (max-width: 720px) {
  .ratings-summary { gap: 18px; padding: 16px; }
  .rating-store { padding-left: 0; border-left: 0; }
  .form-row { grid-template-columns: 1fr; }
}

/* Header: more room, download button on the right */
.theme-app .header-inner { min-height: 72px; gap: 28px; padding-top: 6px; padding-bottom: 6px; }
.theme-app .site-nav { margin-left: auto; }
.theme-app .site-nav ul { gap: 6px; }
.theme-app .site-nav a { padding: 8px 14px; }
.theme-app .brand-logo { width: 40px; height: 40px; border-radius: 11px; }
.nav-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 20px; border-radius: 999px; background: var(--brand); color: var(--on-brand); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; flex: none; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 80%, transparent); transition: filter .15s, transform .15s; }
.theme-app .site-nav + .nav-cta { margin-left: 0; }
.theme-app .header-inner > .brand + .nav-cta { margin-left: auto; }
.nav-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.nav-cta svg, .app-bar-btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
/* Bottom download bar (mobile) */
.app-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: none; align-items: center; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--line); box-shadow: 0 -8px 28px rgb(0 0 0 / .1); animation: cta-up .45s cubic-bezier(.2, .8, .2, 1) .2s both; }
@media (prefers-reduced-motion: reduce) { .app-bar { animation: none; } }
.app-bar img { width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.app-bar .cta-badge { width: 44px; height: 44px; border-radius: 12px; }
.app-bar .cta-badge svg { width: 20px; height: 20px; }
.app-bar-copy { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.35; }
.app-bar-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar-copy small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--brand); color: var(--on-brand); text-decoration: none; font-weight: 700; white-space: nowrap; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand) 75%, transparent); }
.app-bar-btn:active { transform: scale(.98); }
@media (max-width: 720px) {
  .theme-app .header-inner { min-height: 62px; gap: 12px; }
  .nav-cta { display: none; }
  .app-bar { display: flex; }
  body:has(.app-bar) .site-footer { padding-bottom: 84px; }
}

/* Reviews as rows, Play Store style */
.reviews-rows { display: flex; flex-direction: column; max-width: 760px; }
.reviews-rows .review { border: 0; border-radius: 0; background: none; padding: 20px 0; gap: 8px; border-bottom: 1px solid var(--line); }
.reviews-rows .review:last-child { border-bottom: 0; }
.reviews-rows .review.is-pinned { background: none; }
.reviews-rows .review header { gap: 12px; }
.reviews-rows .review .avatar { width: 32px; height: 32px; font-size: 14px; }
.reviews-rows .review-who strong { font-size: 15px; font-weight: 500; }
.reviews-rows .review-who .review-meta { display: none; }
.reviews-rows .review-rate { gap: 10px; }
.reviews-rows .review-rate .star { width: 13px; height: 13px; }
.rate-date { display: none; font-size: 13px; color: var(--muted); }
.reviews-rows .rate-date { display: inline; }
.reviews-rows .review h3 { font-size: 15px; font-weight: 600; margin: 0; }
.reviews-rows .review-body { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.reviews-rows .review-reply { margin: 8px 0 0; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--surface-2); }
.reviews-rows .review-reply strong { font-size: 14px; }
.ratings-summary.is-rows { background: none; padding: 0; gap: 24px 36px; align-items: center; }
.ratings-summary.is-rows .rating-big strong { font-size: 64px; }
.ratings-summary.is-rows .rating-bars { max-width: 420px; }
.ratings-summary.is-rows .bar { height: 10px; }
.ratings-summary.is-rows .bar i { background: var(--brand); }
