/* ============================================================
   Gold Rummy - APK Directory
   Layout + design replicated from the Diwa Games reference.

   Tokens measured from the reference DOM:
     page bg      #E6E9EF      body text  #4C4C4C @ 13px
     accent       #CC1CA8      header bg  #1D222D (60px + 2px accent rule)
     card         #fff r20 shadow 2px 2px 2px #E3E3E3
     app card     220x321, icon 150, title 14/600 #444, meta 12 #A7A7A7
     grid         6 cols, 220px card / 240px pitch
     shell        main 1120 + sidebar 300, 20px gap
     font         'Open Sans', Arial, sans-serif
   ============================================================ */

:root {
  --bg:            #E6E9EF;
  --accent:        #CC1CA8;
  --accent-dark:   #A81589;
  --header-bg:     #1D222D;
  --card:          #FFFFFF;
  --card-shadow:   2px 2px 2px 0 #E3E3E3;
  --radius:        20px;

  --text:          #4C4C4C;
  --title:         #444444;
  --meta:          #A7A7A7;
  --box-head:      #ABABAB;

  --gold:          #FFD700;
  --gold-cta:      #FFB100;
  --footer-bg:     #0B0B0B;

  --shell:         1440px;
  --main:          1120px;
  --side:          300px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .18s ease, background-color .18s ease, opacity .18s ease; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; color: var(--text); line-height: 1.25; }
p { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 18px; font-weight: 700;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 10px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  border-bottom: 2px solid var(--accent);
}
.site-header__inner { display: flex; align-items: center; gap: 20px; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__logo { width: 44px; height: 44px; border-radius: 8px; }
.brand__name { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: block; padding: 0 12px; line-height: 58px;
  color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.nav__link:hover { color: var(--gold); }
.nav__link.is-active { color: var(--gold); }

.nav-toggle {
  display: none; margin-left: auto;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 6px;
}
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }

/* ---------- Hero (homepage) ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 2px solid var(--accent); }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(3px); transform: scale(1.08); }
.hero__veil { position: absolute; inset: 0; z-index: 1; background: rgba(24, 40, 66, .82); }
.hero__inner { position: relative; z-index: 2; padding: 46px 10px 40px; text-align: center; }
.hero__title { font-size: 40px; font-weight: 600; line-height: 46px; color: #fff; margin: 0 0 6px; }
.hero__sub { font-size: 16px; font-weight: 300; line-height: 30px; color: #fff; margin: 0 auto 22px; max-width: 760px; }

/* search pill */
.search { display: flex; align-items: center; justify-content: center; max-width: 600px; margin: 0 auto; }
.search__field {
  flex: 1; height: 44px; min-width: 0;
  padding: 0 110px 0 20px; margin-right: -70px;
  border: 0; border-radius: 50px; background: #F2F2F2;
  color: #43454B; font-family: inherit; font-size: 16px;
}
.search__field::placeholder { color: #8A8D96; }
.search__btn {
  position: relative; z-index: 1;
  width: 70px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50px; background: var(--accent); color: #fff;
}
.search__btn:hover { background: var(--accent-dark); }

.socials { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.socials a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; opacity: .92; }
.socials a:hover { opacity: 1; color: #fff; }
.s-fb { background: #3B5998; } .s-x  { background: #55ACEE; } .s-ig { background: #C13584; }
.s-yt { background: #DA1725; } .s-pi { background: #DA1725; } .s-tg { background: #229ED9; }

/* ---------- Section titles (homepage) ---------- */
.title-section {
  font-size: 22px; font-weight: 400; color: var(--text);
  margin: 3px 10px 10px; padding-top: 18px;
}

/* ---------- App card ---------- */
.apps-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; padding: 0 10px 10px; }

.app-card {
  display: flex; flex-direction: column; background: var(--card); color: inherit;
  border-radius: var(--radius); border-bottom: 2px solid var(--accent);
  box-shadow: var(--card-shadow); padding: 15px; text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.app-card:hover { transform: translateY(-3px); box-shadow: 3px 4px 10px 0 #D6D9E2; color: inherit; }
.app-card__img {
  display: block; width: 100%; max-width: 150px; aspect-ratio: 1; margin: 0 auto 12px;
  border-radius: 14px; overflow: hidden; background: #F2F2F2;
}
.app-card__img img { width: 100%; height: 100%; object-fit: cover; }
.app-card__title { display: block; font-size: 14px; font-weight: 600; color: var(--title); margin-bottom: 4px; }
.app-card:hover .app-card__title { color: var(--accent); }
.app-card__meta { display: block; font-size: 12px; color: var(--meta); }

/* horizontal "top rated" strip */
.rail { position: relative; padding: 0 10px 10px; }
.rail__track {
  display: flex; gap: 20px; overflow-x: auto; scroll-behavior: smooth;
  scroll-snap-type: x mandatory; padding-bottom: 6px;
  scrollbar-width: thin; scrollbar-color: #C9CCD6 transparent;
}
.rail__track::-webkit-scrollbar { height: 6px; }
.rail__track::-webkit-scrollbar-thumb { background: #C9CCD6; border-radius: 3px; }
.rail__item { flex: 0 0 250px; scroll-snap-align: start; }

.rail-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border-radius: var(--radius); border-bottom: 2px solid var(--accent);
  box-shadow: var(--card-shadow); padding: 15px; color: inherit; height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}
.rail-card:hover { transform: translateY(-3px); box-shadow: 3px 4px 10px 0 #D6D9E2; color: inherit; }
.rail-card__img { display: block; flex: 0 0 62px; width: 62px; height: 62px; border-radius: 12px; overflow: hidden; background: #F2F2F2; }
.rail-card__img img { width: 100%; height: 100%; object-fit: cover; }
.rail-card > span { display: block; min-width: 0; }
.rail-card__title { display: block; font-size: 14px; font-weight: 600; color: var(--title); margin-bottom: 2px; }
.rail-card:hover .rail-card__title { color: var(--accent); }
.rail-card__meta { display: block; font-size: 12px; color: var(--meta); line-height: 1.45; }

.rail__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: transparent; border: 0; color: #9AA0AE;
}
.rail__nav:hover { color: var(--accent); }
.rail__nav--prev { left: -8px; }
.rail__nav--next { right: -8px; }

/* ---------- Promo banner ---------- */
.promo { display: grid; place-items: center; padding: 40px 10px 60px; }
.promo__card {
  width: 100%; max-width: 520px; text-align: center;
  background: #000; border: 3px solid var(--gold); border-radius: 18px;
  padding: 34px 30px; box-shadow: 0 0 26px rgba(255,215,0,.55);
}
.promo__art { width: 250px; height: 250px; margin: 0 auto 18px; border-radius: 16px; overflow: hidden; }
.promo__art img { width: 100%; height: 100%; object-fit: cover; }
.promo__title {
  font-size: 26px; font-weight: 800; color: var(--gold); margin: 0 0 8px;
  text-transform: uppercase; text-shadow: 0 0 12px rgba(255,215,0,.6);
}
.promo__sub { color: #fff; font-size: 14px; margin: 0 0 22px; }
.promo__cta {
  display: inline-block; padding: 13px 34px; border-radius: 50px;
  background: linear-gradient(180deg, var(--gold), var(--gold-cta));
  color: #1A1A1A; font-size: 15px; font-weight: 700; text-transform: uppercase;
  box-shadow: 0 0 18px rgba(255,177,0,.6);
}
.promo__cta:hover { filter: brightness(1.07); color: #1A1A1A; }

/* ---------- Detail shell ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 20px; padding: 20px 10px 40px; align-items: start; }

.box {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--card-shadow); padding: 20px 25px; margin-bottom: 20px;
}
.box__head {
  font-size: 17px; font-weight: 700; color: var(--box-head);
  text-transform: uppercase; letter-spacing: .01em;
  padding: 0 0 15px; margin: 0 0 18px; position: relative;
  border-bottom: 1px solid #EEE;
}
.box__head::after {
  content: ''; position: absolute; left: 0; bottom: -1px; width: 46px; height: 3px; background: var(--accent);
}

/* app header block */
.apphead { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 25px; }
.apphead__left { text-align: center; }
.apphead__icon { width: 150px; height: 150px; border-radius: 16px; overflow: hidden; background: #F2F2F2; margin-bottom: 14px; }
.apphead__icon img { width: 100%; height: 100%; object-fit: cover; }

.btn-dl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border-radius: var(--radius);
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  padding: 9px 18px; width: 100%; min-height: 33px;
}
.btn-dl:hover { background: var(--accent-dark); color: #fff; }
.btn-dl--wide { font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 10px 25px; min-height: 35px; }

.rating { margin-top: 12px; font-size: 12px; color: var(--meta); }
.rating__score { font-size: 22px; font-weight: 700; color: var(--text); }
.rating__of { font-size: 12px; color: var(--meta); }
.stars { display: flex; justify-content: center; gap: 1px; margin: 4px 0; }
.star { color: var(--gold-cta); }
.star--empty { color: #DCDCDC; }

/* icon size utilities */
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.rating__report { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--meta); }

.crumbs { font-size: 12px; color: var(--meta); margin-bottom: 6px; }
.crumbs a { color: var(--meta); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--text); }

.apphead__title { font-size: 38px; font-weight: 700; color: var(--text); margin: 0 0 10px; line-height: 1.15; }
.apphead__ver { font-size: 20px; font-weight: 400; color: var(--meta); }

.pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.pill {
  display: inline-block; padding: 2px 10px 3px; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
}
.pill:hover { background: var(--accent-dark); color: #fff; }

.apphead__desc { font-size: 13px; color: var(--text); margin-bottom: 16px; }

.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; margin-bottom: 18px; }
.meta-grid__k { font-size: 13px; font-weight: 700; color: var(--text); }
.meta-grid__v { font-size: 13px; color: #6E6E6E; }
.meta-grid__v--accent { color: var(--accent); font-weight: 600; }

.share { display: flex; flex-wrap: wrap; gap: 8px; }
.share__btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border: 1px solid #E4E4E4; border-radius: var(--radius);
  color: #6E6E6E; font-size: 12px; background: #fff;
}
.share__btn:hover { border-color: var(--accent); color: var(--accent); }

/* article body */
.article h2 { font-size: 22px; font-weight: 700; color: var(--text); margin: 26px 0 12px; }
.article h2:first-child { margin-top: 0; }
.article p { font-size: 13px; line-height: 1.75; color: var(--text); margin: 0 0 14px; }

/* install steps */
.howto { background: #F7F7F7; border-radius: 12px; padding: 16px 20px; margin-top: 18px; }
.howto b { display: block; font-size: 13px; color: var(--text); margin-bottom: 8px; }
.howto ol { margin: 0; padding-left: 20px; font-size: 13px; color: var(--text); }
.howto li { margin-bottom: 4px; }

/* related grid inside a box */
.rel-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.rel-card { display: block; text-align: center; color: inherit; }
.rel-card__img { display: block; width: 100%; max-width: 122px; aspect-ratio: 1; margin: 0 auto 8px; border-radius: 14px; overflow: hidden; background: #F2F2F2; }
.rel-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .18s ease; }
.rel-card:hover .rel-card__img img { transform: scale(1.05); }
.rel-card__title { display: block; font-size: 13px; font-weight: 600; color: var(--title); margin-bottom: 3px; }
.rel-card:hover .rel-card__title { color: var(--accent); }
.rel-card__meta { display: block; font-size: 12px; color: var(--meta); line-height: 1.45; }

/* ---------- Sidebar ---------- */
.sidebar { display: block; }
.side-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 18px 20px; margin-bottom: 20px; }
.side-box__head { font-size: 15px; font-weight: 700; color: var(--text); text-transform: uppercase; margin: 0 0 14px; }

.side-search { display: flex; gap: 8px; }
.side-search input {
  flex: 1; min-width: 0; height: 34px; padding: 0 14px;
  border: 0; border-radius: 50px; background: #F2F2F2; font-family: inherit; font-size: 13px; color: #43454B;
}
.side-search button { padding: 0 18px; height: 34px; border: 0; border-radius: 50px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; }
.side-search button:hover { background: var(--accent-dark); }

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li + li { border-top: 1px solid #F0F0F0; }
.side-post { display: flex; align-items: center; gap: 12px; padding: 11px 0; color: inherit; }
.side-post__img { display: block; flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: #F2F2F2; }
.side-post__img img { width: 100%; height: 100%; object-fit: cover; }
.side-post > span { display: block; min-width: 0; }
.side-post__title { display: block; font-size: 13px; font-weight: 600; color: var(--title); margin-bottom: 2px; }
.side-post:hover .side-post__title { color: var(--accent); }
.side-post__meta { display: block; font-size: 12px; color: var(--meta); line-height: 1.4; }

.side-links { list-style: none; margin: 0; padding: 0; }
.side-links li + li { border-top: 1px solid #F0F0F0; }
.side-links a { display: block; padding: 10px 0 10px 14px; color: var(--text); font-size: 13px; }
.side-links a:hover { color: var(--accent); }

/* ---------- Static page prose ---------- */
.prose h1 { font-size: 30px; font-weight: 700; color: var(--text); margin: 0 0 16px; }
.prose h2 { font-size: 22px; font-weight: 700; color: var(--text); margin: 26px 0 12px; }
.prose h3 { font-size: 17px; font-weight: 700; color: var(--accent); margin: 20px 0 10px; }
.prose p { font-size: 13px; line-height: 1.75; margin: 0 0 14px; }
.prose ul { list-style: none; margin: 0 0 16px; padding: 0; }
.prose ul li { position: relative; padding-left: 20px; margin-bottom: 7px; font-size: 13px; line-height: 1.7; }
.prose ul li::before { content: ''; position: absolute; left: 4px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.prose a { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); border-top: 3px solid var(--gold); text-align: center; padding: 34px 10px 26px; }
.footer__title { font-size: 24px; font-weight: 800; color: var(--gold); text-transform: uppercase; margin: 0 0 12px; text-shadow: 0 0 10px rgba(255,215,0,.45); }
.footer__blurb { max-width: 700px; margin: 0 auto 22px; color: #fff; font-size: 14px; line-height: 1.9; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 24px; }
.footer__link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border: 1px solid var(--gold); border-radius: 50px;
  color: var(--gold); font-size: 13px; background: transparent;
}
.footer__link:hover { background: var(--gold); color: #1A1A1A; }
.footer__note { max-width: 1000px; margin: 0 auto 18px; color: #9A9A9A; font-size: 12px; line-height: 1.8; }
.footer__rule { max-width: 1250px; margin: 0 auto 16px; border: 0; border-top: 1px solid #333; }
.footer__copy { color: var(--gold); font-size: 13px; margin: 0; }

/* ---------- Scroll to top ---------- */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease, background .18s ease;
}
.to-top[hidden] { display: none; }
.to-top.is-visible { opacity: 1; transform: translateY(0); }
.to-top:hover { background: var(--accent-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .apps-grid { grid-template-columns: repeat(4, 1fr); }
  .rel-grid  { grid-template-columns: repeat(4, 1fr); }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
}
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 62px;
    background: var(--header-bg); border-bottom: 2px solid var(--accent);
    max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .nav.is-open { max-height: 460px; }
  .nav__list { flex-direction: column; align-items: stretch; padding: 6px 10px 12px; }
  .nav__link { line-height: 1.4; padding: 12px 6px; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .hero__title { font-size: 30px; line-height: 36px; }
  .hero__sub { font-size: 15px; line-height: 26px; }
  .apphead { grid-template-columns: 1fr; }
  .apphead__left { display: flex; flex-direction: column; align-items: center; }
  .apphead__icon { width: 130px; height: 130px; }
  .btn-dl { width: auto; padding-inline: 34px; }
  .apphead__title { font-size: 28px; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .box { padding: 18px 18px; }
}
@media (max-width: 680px) {
  .apps-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .rel-grid  { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .sidebar { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .share { gap: 6px; }
  .promo__art { width: 190px; height: 190px; }
  .promo__title { font-size: 21px; }
  .footer__title { font-size: 20px; }
  body { font-size: 14px; }
  .app-card__title, .rel-card__title { font-size: 14px; }
  .app-card__meta, .rel-card__meta { font-size: 12.5px; }
  .article p, .prose p, .prose ul li { font-size: 14px; }
}
@media (max-width: 400px) {
  .hero__title { font-size: 25px; line-height: 31px; }
  .rel-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .app-card:hover, .rail-card:hover { transform: none; }
  .rel-card:hover .rel-card__img img { transform: none; }
}

/* article bullet lists (Diwa Lucky / Diwa Ace briefs) */
.article ul.article__ul { list-style: none; margin: 0 0 16px; padding: 0; }
.article ul.article__ul li { position: relative; padding-left: 20px; margin-bottom: 7px; font-size: 13px; line-height: 1.7; color: var(--text); }
.article ul.article__ul li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent, #CC1CA8); }

/* sticky Diwa Lucky offer pill */
.offer-sticky {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 95;
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 14px 28px; border-radius: 999px; border: 2px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-cta), #E08E00); color: #1A1A1A;
  font-weight: 800; font-size: 16px; letter-spacing: .2px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35), 0 0 0 4px rgba(255,215,0,.18);
}
.offer-sticky:hover { color: #1A1A1A; background: linear-gradient(180deg, var(--gold), var(--gold-cta)); }
.site-footer { padding-bottom: 96px; }
@media (max-width: 680px) {
  .offer-sticky { bottom: 12px; padding: 12px 20px; font-size: 14px; }
  .to-top { bottom: 78px; right: 14px; }
}
