:root {
  color-scheme: light;
  --bg-top: #2c78a7;
  --bg-bottom: #2a83b6;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.12);
  --text: #102235;
  --muted: #627589;
  --line: rgba(16, 34, 53, 0.12);
  --gold: #f7b935;
  --shadow: 0 14px 34px rgba(18, 48, 72, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body {
  min-width: 320px;
}

body[data-page="home"],
body[data-page="detail"] {
  display: flex;
  flex-direction: column;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(33, 96, 136, 0.95), rgba(38, 114, 160, 0.9));
  box-shadow: 0 4px 18px rgba(11, 40, 62, 0.16);
}

.header-shell,
.page {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.header-shell {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: #eff8ff;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(12, 33, 57, 0.2));
}

.brand-text {
  font-size: 22px;
  letter-spacing: 0;
  color: #e9fbff;
}

.searchbar {
  flex: 1;
  display: flex;
  justify-content: center;
}

.searchbar input {
  width: min(540px, 100%);
  height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 16px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.page {
  padding: 20px 0 40px;
  flex: 1;
}

body[data-page="home"] {
  background: #ffffff;
}

body[data-page="home"] .site-header {
  position: static;
}

body[data-page="home"] .page {
  width: min(2010px, calc(100% - 24px));
  padding-top: 14px;
}

.section-head h2,
.section-head h2,
.panel-head h2 {
  margin: 0;
}

.icon-wall-section,
.panel {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.icon-wall-section {
  padding: 22px;
}

body[data-page="home"] .icon-wall-section {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="home"] .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  padding: 0 2px;
}

body[data-page="home"] .section-head h2 {
  color: #0f2235;
  font-size: 18px;
}

body[data-page="home"] .section-head p {
  display: none;
}

.section-head,
.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2,
.panel-head h2 {
  font-size: 20px;
  color: #fff;
}

.section-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
}

.icon-wall {
  --cols: 12;
  --gap-size: 8px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: clamp(88px, calc((100vw - 40px - (var(--cols) - 1) * var(--gap-size)) / var(--cols)), 190px);
  gap: var(--gap-size);
  grid-auto-flow: dense;
}

.icon-card,
.icon-only-card,
.top-icon,
.app-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.icon-card {
  display: block;
  background: rgba(255, 255, 255, 0.88);
  padding: 8px;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.icon-card:hover,
.icon-only-card:hover,
.side-card:hover,
.top-icon:hover {
  transform: translateY(-3px);
}

.icon-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
}

.icon-only-card {
  display: block;
  border-radius: 4px;
  background: #e9eef5;
  padding: 0;
  box-shadow: none;
  transition: transform 180ms ease;
  aspect-ratio: 1 / 1;
}

.icon-only-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.icon-only-card.featured {
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 1600px) {
  .icon-wall {
    --cols: 11;
  }
}

@media (max-width: 1320px) {
  .icon-wall {
    --cols: 10;
  }
}

@media (max-width: 1080px) {
  .icon-wall {
    --cols: 8;
  }
}

@media (max-width: 820px) {
  .icon-wall {
    --cols: 6;
  }
}

.icon-card-body {
  padding: 10px 2px 4px;
}

.icon-card h3 {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.35;
}

.icon-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.stars {
  color: var(--gold);
  letter-spacing: 0;
}

.detail-page {
  width: min(1540px, calc(100% - 64px));
  padding-top: 24px;
}

.mobile-detail-head,
.mobile-ad-unit,
.mobile-info-panel {
  display: none;
}

.mobile-ad-unit {
  display: none;
}

.top-icon-rail {
  margin-bottom: 18px;
}

.top-icon-track {
  --top-cols: 12;
  display: grid;
  grid-template-columns: repeat(var(--top-cols), minmax(0, 1fr));
  gap: 8px;
  overflow: hidden;
  padding-bottom: 0;
}

.top-icon {
  display: block;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.22);
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.top-icon img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

@media (max-width: 1280px) {
  .top-icon-track {
    --top-cols: 10;
  }
}

.detail-layout {
  display: grid;
  grid-template-columns: 376px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.side-list {
  display: grid;
  gap: 14px;
}

.side-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
}

.side-card.active {
  outline: 3px solid rgba(248, 190, 38, 0.55);
}

.app-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.app-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.side-card .rating-line {
  margin-top: 6px;
}

.detail-main {
  display: grid;
  gap: 30px;
}

.detail-card,
.panel {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.detail-card {
  padding: 0;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 460px;
  gap: 34px;
  min-height: 300px;
  align-items: start;
}

.detail-media {
  min-height: 300px;
  display: grid;
  place-items: center;
}

body[data-page="detail"] .mobile-ad-unit {
  display: none;
}

.ad-slot-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
}

.ad-slot-label {
  width: min(300px, 100%);
  color: #7a8ea3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
}

.ad-slot-wrap[data-ad-unit="detailHero"] {
  gap: 0;
}

.ad-slot-wrap[data-ad-unit="detailHero"] .ad-slot {
  width: 100%;
  height: 380px;
  max-height: 380px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.ad-slot-wrap[data-ad-unit="detailDesktopSide"] {
  height: 100%;
  align-content: center;
  justify-items: center;
}

.ad-slot-wrap[data-ad-unit="detailDesktopSide"] .ad-slot,
.ad-slot-wrap[data-ad-unit="detailDesktopSide"] .adsbygoogle {
  display: block;
  width: min(520px, 100%);
  min-height: 320px;
  height: 320px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.ad-panel {
  padding: 16px;
}

.ad-slot {
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 2px dashed rgba(47, 134, 255, 0.45);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(47, 134, 255, 0.08), rgba(47, 134, 255, 0.04)),
    #f8fbff;
  color: #2f86ff;
  text-align: center;
  font-weight: 700;
}

.ad-slot span {
  font-size: 14px;
  padding: 0 16px;
}

.ad-slot-300x250 {
  width: 300px;
  height: 250px;
  max-width: 100%;
}

.ad-slot-970x250 {
  width: min(100%, 970px);
  height: 250px;
}

.detail-summary {
  padding-top: 18px;
}

.title-block {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 0;
}

.desktop-detail-card .title-block {
  justify-content: flex-start;
  margin-bottom: 26px;
}

.title-block .app-thumb {
  width: 96px;
  height: 96px;
  border-radius: 16px;
}

.desktop-detail-card .title-block .app-thumb {
  width: 122px;
  height: 122px;
}

.title-copy h1 {
  margin: 0;
  color: #0a0f18;
  font-size: 28px;
  line-height: 1.12;
}

.title-copy p {
  margin: 10px 0 0;
  color: var(--muted);
}

.title-copy .rating-line {
  margin-top: 6px;
  font-size: 16px;
}

.desktop-detail-card .meta-grid {
  max-width: 590px;
  margin: 0;
}

.desktop-detail-card .meta-item {
  min-height: 70px;
}

.desktop-detail-card {
  display: grid;
  grid-template-columns: 620px minmax(360px, 480px) minmax(0, 1fr);
  min-height: 374px;
  overflow: hidden;
}

.desktop-card-ad {
  grid-column: 1;
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 34px 44px;
  background: #fff;
}

.desktop-card-content {
  grid-column: 2;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 56px 0 46px;
}

.detail-info-panel {
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
}

.detail-info-panel .panel-head {
  min-height: 80px;
  margin: 0;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.detail-info-panel .panel-head h2 {
  color: #0f2235;
  font-size: 24px;
}

.detail-info-panel .meta-grid {
  display: block;
}

.detail-info-panel .meta-item {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  min-height: 66px;
  padding: 0 30px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.detail-info-panel .meta-icon {
  display: none;
}

.detail-info-panel .meta-item p {
  color: #0f2235;
  font-size: 18px;
  font-weight: 800;
}

.detail-info-panel .meta-item strong {
  color: #0f2235;
  font-size: 18px;
  font-weight: 500;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.meta-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  min-height: 72px;
}

.meta-icon {
  width: 28px;
  height: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.meta-icon span {
  border: 2px solid #1f2430;
  border-radius: 2px;
}

.meta-item strong,
.meta-item p {
  margin: 0;
}

.meta-item p {
  color: var(--muted);
  font-size: 14px;
}

.meta-item strong {
  font-size: 18px;
}

.panel {
  padding: 24px 28px;
}

.panel.detail-info-panel {
  padding: 0;
}

.detail-page .panel-head {
  min-height: 72px;
  margin: -24px -28px 36px;
  padding: 34px 28px 26px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.detail-page .panel-head h2 {
  color: #102235;
  font-size: 26px;
}

.detail-page .screenshots-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-info-panel .meta-item > div:last-child {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  align-items: center;
  width: 100%;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.screenshots-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(16, 34, 53, 0.08);
}

.screenshots-empty {
  grid-column: 1 / -1;
  min-height: 140px;
  display: grid;
  place-items: center;
  color: #64788c;
  font-size: 15px;
  border: 1px dashed rgba(16, 34, 53, 0.16);
  border-radius: 10px;
  background: #f8fafc;
}

.intro-copy p {
  margin: 0;
  color: #31475b;
  line-height: 1.75;
}

.intro-copy p + p {
  margin-top: 12px;
}

.reviews-list {
  display: grid;
  gap: 14px;
}

.review-card {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.review-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.review-card h3 {
  margin: 0 0 6px;
  color: #102235;
  font-size: 15px;
}

.review-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.review-card p {
  margin: 0;
  color: #31475b;
  line-height: 1.7;
  font-size: 14px;
}

.play-panel {
  padding-top: 14px;
  padding-bottom: 14px;
}

.play-panel-content {
  display: grid;
  gap: 12px;
}

.play-panel-copy {
  margin: 0;
  color: #5f7387;
  font-size: 13px;
  line-height: 1.6;
}

.play-now-button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 34px;
  border-radius: 2px;
  background: #2f86ff;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-button {
  display: inline-grid;
  place-items: center;
  min-width: 170px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.store-button.google-play {
  background: #2f86ff;
}

.store-button.app-store {
  background: #111827;
}

.store-empty {
  display: grid;
  gap: 8px;
}

.store-empty-note {
  margin: 0;
  color: #5f7387;
  font-size: 13px;
  line-height: 1.6;
}

.rating-breakdown {
  display: grid;
  gap: 8px;
}

.rating-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
}

.rating-row-label {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0;
}

.rating-bar {
  height: 5px;
  border-radius: 999px;
  background: #e7edf4;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #2f86ff;
}

.hotapps-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.hotapp-card {
  display: block;
}

.hotapp-card img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.site-footer {
  width: 100%;
  background: #ffffff;
  border-top: 1px solid rgba(16, 34, 53, 0.08);
  padding: 18px 0;
}

.footer-nav {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  align-items: center;
}

.footer-nav a {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 10px;
  color: #1d9ec6;
  font-size: 18px;
  font-weight: 500;
  background: transparent;
}

.footer-nav a:hover {
  background: #eefafd;
}

.legal-shell {
  background: #ffffff;
  padding: 32px;
}

.legal-head h2 {
  color: #102235;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.legal-section {
  padding: 22px 24px;
  border: 1px solid rgba(16, 34, 53, 0.08);
  border-radius: 12px;
  background: #fbfdff;
}

.legal-section h3 {
  margin: 0 0 10px;
  color: #102235;
  font-size: 18px;
}

.legal-section p {
  margin: 0;
  color: #40576b;
  line-height: 1.75;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .icon-wall {
    --cols: 8;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .side-rail {
    order: 2;
  }

  .detail-main {
    order: 1;
  }

  .side-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-page="detail"] {
    background: #eef5fa;
  }

  body[data-page="detail"] .site-header {
    position: static;
  }

  body[data-page="detail"] .header-shell,
  body[data-page="detail"] .page {
    width: 100%;
  }

  .header-shell {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 2px;
  }

  body[data-page="detail"] .brand {
    gap: 3px;
  }

  body[data-page="detail"] .brand-logo {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  body[data-page="detail"] .brand-text {
    font-size: 12px;
  }

  .searchbar {
    width: 100%;
  }

  body[data-page="detail"] .searchbar {
    flex: 0 0 108px;
  }

  body[data-page="detail"] .searchbar input {
    height: 22px;
    padding: 0 12px;
    font-size: 10px;
  }

  body[data-page="detail"] .detail-page {
    padding: 6px 0 0;
  }

  body[data-page="detail"] .top-icon-rail,
  body[data-page="detail"] .side-rail,
  body[data-page="detail"] .desktop-detail-card {
    display: none;
  }

  body[data-page="detail"] .mobile-detail-head {
    display: block;
    padding: 0 8px 10px;
  }

  body[data-page="detail"] .mobile-ad-unit {
    display: grid;
    min-height: 176px;
    margin: 0 2px 6px;
  }

  body[data-page="detail"] .ad-slot-wrap[data-ad-unit="detailHero"] .ad-slot {
    height: 176px;
    max-height: 176px;
    border-radius: 4px;
  }

  body[data-page="detail"] .detail-layout {
    display: block;
  }

  body[data-page="detail"] .detail-main {
    gap: 6px;
  }

  body[data-page="detail"] .mobile-info-panel {
    display: block;
  }

  body[data-page="detail"] .title-block {
    gap: 8px;
  }

  body[data-page="detail"] .title-block .app-thumb {
    width: 42px;
    height: 42px;
    border-radius: 6px;
  }

  body[data-page="detail"] .title-copy h1 {
    color: #435466;
    font-size: 13px;
  }

  body[data-page="detail"] .title-copy .rating-line {
    margin-top: 2px;
    font-size: 8px;
  }

  body[data-page="detail"] .panel {
    border-radius: 0;
    box-shadow: none;
  }

  body[data-page="detail"] .panel-head {
    min-height: auto;
    margin: 0 0 10px;
    padding: 0;
    border-bottom: 0;
  }

  body[data-page="detail"] .panel-head h2 {
    color: #0f2235;
    font-size: 10px;
  }

  body[data-page="detail"] .detail-info-panel .panel-head {
    min-height: 28px;
    padding: 7px 8px;
  }

  body[data-page="detail"] .detail-info-panel .meta-item {
    min-height: 28px;
    padding: 0 8px;
  }

  body[data-page="detail"] .detail-info-panel .meta-item > div:last-child {
    grid-template-columns: 1fr 1fr;
  }

  body[data-page="detail"] .detail-info-panel .meta-item p,
  body[data-page="detail"] .detail-info-panel .meta-item strong {
    font-size: 9px;
  }

  body[data-page="detail"] .detail-info-panel .meta-item a {
    color: #17a7d7;
  }

  .icon-wall {
    --cols: 4;
  }

  .top-icon-track {
    --top-cols: 5;
  }

  .meta-grid,
  .screenshots-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="detail"] .screenshots-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .hotapps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ad-slot-970x250 {
    height: 160px;
  }

  .ad-slot-300x250 {
    width: min(100%, 300px);
  }

  .footer-nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }

  .detail-card,
  .panel {
    padding: 18px;
  }

  body[data-page="detail"] .panel {
    padding: 8px;
  }

  body[data-page="detail"] .detail-info-panel {
    padding: 0;
  }

  .title-block {
    align-items: start;
  }

  .title-copy h1 {
    font-size: 28px;
  }

  body[data-page="detail"] .title-copy h1 {
    font-size: 13px;
  }
}
