:root {
  --play-green: #01875f;
  --play-green-press: #016b4c;
  --tester-blue: #a8c7fa;
  --tester-blue-text: #001d35;
  --app-name: "Imandar Book";
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { font-family: "Roboto", Arial, sans-serif; }
body { background: #fff; color: #1f1f1f; }
img { display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }

/* View switching. Mobile shows the dark Play app style, desktop shows the white web style. */
.desktop-view { display: none; }
.mobile-view { display: block; }
@media (min-width: 1000px) {
  .desktop-view { display: block; }
  .mobile-view { display: none; }
  body { background: #fff; }
}

/* ===================== MOBILE (dark Play Store app) ===================== */
.mobile-view { background: #0e0e0e; color: #e3e3e3; min-height: 100vh; padding-bottom: 32px; }
.m-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.m-topbar .ti { font-size: 24px; color: #e3e3e3; }
.m-icon-btn { background: transparent; padding: 8px; border-radius: 50%; display: flex; }

.m-appheader { display: flex; gap: 18px; padding: 28px 20px 4px; align-items: flex-start; }
.m-appicon { width: 68px; height: 68px; border-radius: 16px; object-fit: cover; flex-shrink: 0; background: #fff; }
.m-apptitle { font-size: 22px; font-weight: 500; line-height: 1.25; color: #fff; }
.m-appdev { color: #7cacf8; font-size: 14px; margin-top: 6px; }
.m-appsub { color: #9aa0a6; font-size: 12px; margin-top: 2px; }

.m-stats { display: flex; align-items: center; padding: 22px 8px 20px; }
.m-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.m-stat .val { font-size: 14px; font-weight: 500; color: #e8eaed; display: flex; align-items: center; gap: 4px; }
.m-stat .val .ti { font-size: 15px; }
.m-stat .lab { font-size: 12px; color: #9aa0a6; }
.m-stat .rate-badge { border: 1px solid #5f6368; border-radius: 3px; padding: 0 4px; font-size: 11px; }
.m-divider { width: 1px; height: 34px; background: #3c4043; }

.m-install-wrap { padding: 4px 20px 10px; }
.m-install { width: 100%; height: 40px; border-radius: 20px; background: var(--tester-blue); color: var(--tester-blue-text); font-size: 15px; font-weight: 500; }
.m-install:active { opacity: .85; }
/* Green Open state shown after the app is installed, same shape as the Install buttons. */
.m-install.btn-open, .d-install.btn-open { background: var(--play-green); color: #fff; }
.m-install.btn-open:active, .d-install.btn-open:hover { background: var(--play-green-press); }
.m-share { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; color: #7cacf8; font-size: 13px; font-weight: 500; }

.m-section { padding: 20px 20px 8px; }
.m-section h2 { font-size: 18px; font-weight: 500; color: #e8eaed; display: flex; align-items: center; justify-content: space-between; }
.m-about { color: #bdc1c6; font-size: 14px; line-height: 1.6; margin-top: 12px; }

.m-shots { display: flex; gap: 12px; overflow-x: auto; padding: 14px 20px 6px; scrollbar-width: none; }
.m-shots::-webkit-scrollbar { display: none; }
.shot { height: 320px; width: 158px; border-radius: 12px; flex-shrink: 0; border: 1px solid #2a2a2a; overflow: hidden; position: relative; background: #0f1626; }
.shot-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.m-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 20px 0; }
.chip { border: 1px solid #3c4043; color: #bdc1c6; border-radius: 8px; font-size: 12px; padding: 6px 12px; display: flex; align-items: center; gap: 6px; }

.m-bottomnav { position: fixed; left: 0; right: 0; bottom: 0; height: 62px; background: #1b1b1b; display: flex; border-top: 1px solid #2a2a2a; }
.m-navitem { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #9aa0a6; font-size: 11px; }
.m-navitem.active { color: #7cacf8; }
.m-navitem .ti { font-size: 22px; }

/* ===================== DESKTOP (white Play Store web) ===================== */
.d-header { height: 64px; display: flex; align-items: center; gap: 28px; padding: 0 24px; max-width: 1280px; margin: 0 auto; }
.d-logo { display: flex; align-items: center; gap: 8px; font-size: 22px; color: #5f6368; font-weight: 400; }
.d-logo .play { width: 26px; height: 26px; }
.d-nav { display: flex; gap: 26px; font-size: 14px; color: #5f6368; }
.d-nav a { padding: 8px 2px; }
.d-nav a.active { color: var(--play-green); font-weight: 500; border-bottom: 3px solid var(--play-green); }
.d-header .spacer { flex: 1; }
.d-header .ti { font-size: 22px; color: #5f6368; }

.d-main { max-width: 1000px; margin: 0 auto; padding: 24px; }
.d-top { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.d-title { font-size: 56px; font-weight: 400; color: #202124; letter-spacing: -1px; line-height: 1.05; }
.d-dev { color: var(--play-green); font-size: 16px; font-weight: 500; margin-top: 18px; }
.d-dev span { color: #5f6368; font-weight: 400; }
.d-metrics { display: flex; align-items: center; gap: 20px; margin-top: 26px; }
.d-metric { display: flex; flex-direction: column; gap: 4px; }
.d-metric .v { font-size: 15px; font-weight: 500; color: #202124; display: flex; align-items: center; gap: 5px; }
.d-metric .l { font-size: 12px; color: #5f6368; }
.d-mdiv { width: 1px; height: 40px; background: #dadce0; }
.d-actions { display: flex; align-items: center; gap: 20px; margin-top: 28px; }
.d-install { background: var(--play-green); color: #fff; height: 40px; padding: 0 24px; border-radius: 8px; font-size: 15px; font-weight: 500; min-width: 220px; }
.d-install:hover { background: var(--play-green-press); }
.d-share { display: flex; align-items: center; gap: 8px; color: var(--play-green); font-size: 14px; font-weight: 500; cursor: pointer; }
.d-avail { display: flex; align-items: center; gap: 10px; color: #5f6368; font-size: 13px; margin-top: 22px; }

.d-appicon { width: 220px; height: 220px; border-radius: 36px; justify-self: end; box-shadow: 0 1px 3px rgba(0,0,0,.2); }

.d-rating-card { border: 1px solid #dadce0; border-radius: 12px; padding: 20px 24px; display: flex; align-items: center; gap: 40px; margin-top: 10px; width: fit-content; }
.d-rc-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.d-rc-item .v { font-size: 22px; font-weight: 500; color: #202124; display: flex; align-items: center; gap: 4px; }
.d-rc-item .l { font-size: 12px; color: #5f6368; }

.d-shots { display: flex; gap: 16px; overflow-x: auto; padding: 36px 0 8px; scrollbar-width: thin; }
.d-shots .shot { height: 380px; width: 188px; }

.d-section { margin-top: 40px; }
.d-section h2 { font-size: 22px; font-weight: 400; color: #202124; }
.d-about { color: #5f6368; font-size: 14px; line-height: 1.7; margin-top: 18px; max-width: 720px; }

/* Screenshot placeholder art, uses the app theme. Swap for real screenshots later. */
.shot-art { width: 100%; height: 100%; background: linear-gradient(180deg,#0f1626 0%,#070b14 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px; text-align: center; }
.shot-art img { width: 54px; height: 54px; border-radius: 12px; }
.shot-art .cap { color: #cdd4e0; font-size: 13px; font-weight: 500; }
.shot-art .sub { color: #7f8aa0; font-size: 11px; }
.shot-art .pill { background: #1b2436; border-radius: 8px; width: 86%; height: 34px; }

/* ===================== INSTALL PROGRESS OVERLAY ===================== */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: flex-end; justify-content: center; z-index: 999; }
.overlay.open { display: flex; }
@media (min-width: 1000px) { .overlay { align-items: center; } }
.sheet { background: #1f1f1f; color: #e8eaed; width: 100%; max-width: 440px; border-radius: 20px 20px 0 0; padding: 24px; }
@media (min-width: 1000px) { .sheet { border-radius: 20px; } }
.sheet-head { display: flex; align-items: center; gap: 14px; }
.sheet-head img { width: 52px; height: 52px; border-radius: 12px; background: #fff; }
.sheet-head .nm { font-size: 16px; font-weight: 500; color: #fff; }
.sheet-head .st { font-size: 13px; color: #9aa0a6; margin-top: 2px; }
.progress-track { height: 6px; background: #3c4043; border-radius: 3px; margin: 22px 0 10px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--play-green); border-radius: 3px; transition: width .18s ease; }
.progress-row { display: flex; justify-content: space-between; font-size: 13px; color: #bdc1c6; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.sheet-btn { background: transparent; color: #7cacf8; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.sheet-btn.primary { background: var(--play-green); color: #fff; padding: 8px 22px; }
.ios-steps { font-size: 14px; color: #bdc1c6; line-height: 1.7; margin-top: 16px; display: none; }
.ios-steps b { color: #fff; }
.step-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.step-num { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background: var(--play-green); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ===================== IOS (App Store style) ===================== */
/* A tiny script in index.html tags the html element with apple-device,
   so iPhone and iPad users get the App Store layout at every width. */
.ios-view { display: none; }
html.apple-device .mobile-view { display: none; }
html.apple-device .desktop-view { display: none; }
html.apple-device .ios-view { display: block; }
html.apple-device body { background: #fff; }

.ios-view {
  background: #fff; color: #1c1c1e; min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  max-width: 680px; margin: 0 auto; padding: 8px 0 48px;
}

.as-header { display: flex; gap: 16px; padding: 24px 20px 18px; }
.as-appicon { width: 114px; height: 114px; border-radius: 26px; object-fit: cover; background: #fff; border: 0.5px solid rgba(0,0,0,.12); flex-shrink: 0; }
.as-headinfo { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.as-title { font-size: 22px; font-weight: 600; line-height: 1.2; color: #1c1c1e; }
.as-subtitle { font-size: 15px; color: #8e8e93; margin-top: 3px; }
.as-actionrow { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.as-getwrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.as-get { background: rgba(120,120,128,.12); color: #007aff; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 8px 26px; border-radius: 17px; line-height: 1; }
.as-get:active { opacity: .55; }
.as-get.btn-open { background: rgba(120,120,128,.12); color: #007aff; }
.as-iap { font-size: 9px; color: #8e8e93; letter-spacing: .2px; }
.as-share { background: transparent; color: #007aff; padding: 4px 2px 0; display: flex; }
.as-share svg { width: 22px; height: 27px; }
.as-share:active { opacity: .45; }

/* The app preview video sits right below the Share button, App Store style. */
.as-video { padding: 8px 20px 0; }
.as-video video { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 16px; background: #000; display: block; }
.as-video-title { font-size: 18px; margin-bottom: 10px; }

.as-stats { display: flex; align-items: stretch; overflow-x: auto; padding: 18px 20px 4px; scrollbar-width: none; }
.as-stats::-webkit-scrollbar { display: none; }
.as-stat { min-width: 92px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 2px 10px; }
.as-stat .lab { font-size: 11px; font-weight: 500; color: #8e8e93; text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; }
.as-stat .val { font-size: 20px; font-weight: 600; color: #8e8e93; display: flex; align-items: center; white-space: nowrap; }
.as-stat .val svg { width: 24px; height: 24px; }
.as-stat .sub { font-size: 12px; color: #8e8e93; white-space: nowrap; letter-spacing: 1px; }
.as-statdiv { width: 1px; background: #e5e5ea; margin: 6px 0; flex-shrink: 0; }

.as-shots { display: flex; gap: 12px; overflow-x: auto; padding: 16px 20px 4px; scrollbar-width: none; }
.as-shots::-webkit-scrollbar { display: none; }
.as-shot { height: 400px; width: 185px; border-radius: 20px; border: 0.5px solid rgba(0,0,0,.12); background: #f2f2f7; }

.as-compat { display: flex; align-items: center; gap: 8px; padding: 12px 20px 0; color: #8e8e93; font-size: 13px; }
.as-compat .ti { font-size: 17px; }

.as-section { padding: 24px 20px 0; }
.as-h2 { font-size: 20px; font-weight: 700; color: #1c1c1e; margin-bottom: 8px; }
.as-desc { font-size: 15px; line-height: 1.5; color: #1c1c1e; }
.as-devrow { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; color: #8e8e93; }
.as-devname { color: #007aff; font-size: 15px; }
.as-devlabel { font-size: 13px; color: #8e8e93; margin-top: 2px; }
.as-devrow .ti { font-size: 18px; }
.as-ratingrow { display: flex; align-items: flex-end; justify-content: space-between; }
.as-bigscore { font-size: 54px; font-weight: 800; color: #1c1c1e; line-height: 1; display: flex; align-items: baseline; gap: 8px; }
.as-bigscore span { font-size: 15px; font-weight: 600; color: #8e8e93; }
.as-ratecount { font-size: 15px; color: #8e8e93; }
.as-inforow { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 0.5px solid #e5e5ea; font-size: 15px; }
.as-inforow span { color: #8e8e93; flex-shrink: 0; }
.as-inforow b { color: #1c1c1e; font-weight: 400; text-align: right; }