/* =====================================================================
   Diwa Games — Appyn-style APK directory
   Tokens measured from the supplied reference pages:
     page  #E6E9EF   text #4C4C4C   header/footer #1D222D
     accent (magenta) #CC1CA8       footer gold #FFD700
     boxes: #FFF, radius 20px, shadow 2px 2px 2px #E3E3E3, padding 20px 25px
     type: Open Sans, base 13px
   ===================================================================== */

:root {
  --page:        #E6E9EF;
  --text:        #4C4C4C;
  --text-soft:   #777777;
  --muted:       #ABABAB;
  --dark:        #1D222D;
  --dark-2:      #13161D;
  --accent:      #CC1CA8;
  --accent-dark: #A8168A;
  --gold:        #FFD700;
  --white:       #FFFFFF;
  --grey-1:      #F8F8F8;
  --grey-2:      #F2F2F2;
  --grey-3:      #EAEAEA;
  --grey-4:      #E3E3E3;
  --star:        #FFC107;

  --font: "Open Sans", Arial, Helvetica, sans-serif;

  --radius: 20px;
  --shadow: 2px 2px 2px 0 #E3E3E3;

  --sidebar: 300px;
  --gap: 20px;
  --header-h: 60px;

  --t: 200ms;
  --ease: ease;

  --z-header: 30;
  --z-nav: 40;
  --z-top: 50;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--t) var(--ease); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 12px; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

.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;
}
.skip-link {
  position: absolute; left: 10px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--white); padding: 10px 16px;
  border-radius: 0 0 8px 8px; font-weight: 600; transition: top var(--t) var(--ease);
}
.skip-link:focus { top: 0; color: var(--white); }

/* Full-bleed fluid container, exactly like the reference. */
.container { width: 100%; padding: 0 10px; margin: 0 auto; }
.page-body { padding-top: 20px; }

/* ---------- header --------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--dark);
  border-bottom: 2px solid var(--accent);
}
.header-inner { display: flex; align-items: center; min-height: var(--header-h); gap: 14px; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; }
.brand-text { color: var(--white); font-size: 15px; font-weight: 700; white-space: nowrap; }

.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; align-items: center; }
.nav-link {
  display: inline-flex; align-items: center; height: var(--header-h);
  padding: 0 15px; color: var(--white); font-size: 13px; font-weight: 600;
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.nav-link:hover { color: var(--accent); }
.nav-link.is-active { color: var(--accent); }
.nav-cta { color: var(--white); background: var(--accent); border-radius: 20px; height: 34px; margin-left: 10px; }
.nav-cta:hover, .nav-cta.is-active { background: var(--accent-dark); color: var(--white); }

.nav-toggle {
  display: none; margin-left: auto; width: 42px; height: 42px; cursor: pointer;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; color: var(--white);
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- search + social row (np) --------------------------------- */
.np { background: var(--page); padding: 15px 0; }
.np-inner { display: flex; align-items: center; gap: 14px; }

.searchBox { position: relative; flex: 1; min-width: 0; }
.searchBox input {
  width: 100%; height: 44px; border: 0; border-radius: 50px;
  background: var(--grey-2); color: var(--text);
  font-family: var(--font); font-size: 16px; padding: 0 90px 0 20px;
}
.searchBox input::placeholder { color: #8A909B; }
.searchBox button {
  position: absolute; right: 0; top: 0; width: 70px; height: 44px; cursor: pointer;
  border: 0; border-radius: 50px; background: var(--accent); color: var(--white);
  display: grid; place-items: center; transition: background-color var(--t) var(--ease);
}
.searchBox button:hover { background: var(--accent-dark); }

.social { display: flex; align-items: center; gap: 8px; }
.social a {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  color: var(--white); transition: filter var(--t) var(--ease);
}
.social a:hover { filter: brightness(1.15); color: var(--white); }
.s-fb { background: #1877F2; } .s-tw { background: #1DA1F2; } .s-ig { background: #C13584; }
.s-pi { background: #E60023; } .s-yt { background: #FF0000; } .s-tg { background: #0088CC; }

/* ---------- hero ----------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--dark) url("../images/hero.jpg") center / cover no-repeat;
  border-bottom: 2px solid var(--accent);
  padding: 46px 0 40px; text-align: center;
}
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(19, 22, 29, .55); }
.hero .container { position: relative; }
.hero h1 {
  color: var(--white); font-size: 40px; font-weight: 600; margin: 0 0 8px;
  text-shadow: 0 2px 14px rgba(0,0,0,.65);
}
.hero p { color: #F2F3F6; font-size: 14px; margin: 0 0 20px; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.hero .searchBox { max-width: 600px; margin: 0 auto 18px; }
.hero .social { justify-content: center; }

/* ---------- boxes ---------------------------------------------------- */
.box {
  position: relative; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 25px; margin: 0 0 20px;
}
.box-title {
  position: relative; margin: -20px 0 15px; padding: 15px 0;
  color: var(--muted); font-size: 17px; font-weight: 700; text-transform: uppercase;
}
.box-title::before {
  content: ""; position: absolute; left: -25px; bottom: -0.5px;
  width: calc(100% + 50px); height: 1px; border-bottom: 1px solid var(--grey-3);
}
/* short magenta dash under a section title */
.br-title { width: 30px; height: 3px; background: var(--accent); margin: 0 0 15px; border-radius: 2px; }

.title-section {
  color: var(--text); font-size: 22px; font-weight: 400;
  margin: 3px 10px 10px; padding: 0 0 10px;
}

/* ---------- app card grid -------------------------------------------- */
.bloques { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; margin: 0 0 25px; }
.bloques.cols5 { grid-template-columns: repeat(5, 1fr); }

.bav { min-width: 0; }
.bav > a {
  display: block; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px; text-align: center; height: 100%;
  border-bottom: 2px solid transparent;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease), border-color var(--t) var(--ease);
}
.bav > a:hover { box-shadow: 0 6px 16px rgba(0,0,0,.13); border-bottom-color: var(--accent); transform: translateY(-2px); }

.bloque-imagen {
  width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
  background: var(--grey-2); margin: 0 auto 10px;
}
.bloque-imagen img { width: 100%; height: 100%; object-fit: cover; }

.bav .title { color: #444; font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.px-postmeta { color: var(--accent); font-size: 13px; line-height: 1.5; }
.px-postmeta span { display: block; color: var(--text-soft); }
.px-postmeta .ver { color: var(--accent); }

/* horizontal variant (Top rated) */
.bloques.wide { grid-template-columns: repeat(4, 1fr); }
.bav.wb > a { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px; }
.bav.wb .bloque-imagen { width: 75px; height: 75px; flex: none; margin: 0; aspect-ratio: auto; }
.bav.wb .title { margin: 0 0 2px; }
.bav.wb .px-postmeta { text-align: left; }

/* ---------- page layout ---------------------------------------------- */
.wrapper { display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar); gap: var(--gap); align-items: start; }
.wrapper > * { min-width: 0; }

/* ---------- app detail header ---------------------------------------- */
.crumbs { color: var(--text-soft); font-size: 12px; margin: 0 0 6px; }
.crumbs a { color: var(--text-soft); }
.crumbs a:hover { color: var(--accent); }

.app-head { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 25px; }
.app-icb { text-align: center; }
.image-single {
  width: 150px; height: 150px; border-radius: var(--radius); overflow: hidden;
  margin: 0 auto 12px; background: var(--grey-2);
}
.image-single img { width: 100%; height: 100%; object-fit: cover; }

.btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  background: var(--accent); color: var(--white); border: 0; border-radius: var(--radius);
  padding: 8px 25px; font-size: 14px; font-weight: 600; font-family: var(--font);
  min-height: 38px; text-align: center;
  transition: background-color var(--t) var(--ease);
}
.btn-download:hover { background: var(--accent-dark); color: var(--white); }
.btn-block { width: 100%; }

.box-rating { margin: 12px 0 0; font-size: 13px; }
.box-rating .rate-num { font-size: 20px; font-weight: 700; color: var(--accent); }
.box-rating .rate-of, .box-rating .votes { color: var(--text-soft); }
.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.stars .star { fill: #C9CFD8; }
.stars .star.is-full, .stars .star.is-half { fill: var(--star); }
.stars .star.is-half { opacity: .55; }

.main-box-title { color: var(--text); font-size: 38px; font-weight: 700; margin: 0 7px 0 0; display: inline; }
.version { color: var(--muted); font-size: 18px; font-weight: 600; }

.meta-cats { margin: 12px 0; }
.post-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.post-categories a {
  display: inline-block; background: var(--accent); color: var(--white);
  border-radius: var(--radius); padding: 2px 10px 3px; font-size: 12px; font-weight: 600;
}
.post-categories a:hover { background: var(--accent-dark); color: var(--white); }

.descripcion { margin: 12px 0 16px; }

.box-data-app { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; margin: 0 0 16px; }
.da-s { font-size: 13px; }
.da-s strong { display: block; font-weight: 700; color: var(--text); }
.da-s span { color: var(--text-soft); }

.botones_sociales { display: flex; flex-wrap: wrap; gap: 8px; }
.botones_sociales a {
  display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 14px;
  background: var(--grey-2); color: #6B6B6B; border-radius: var(--radius); font-size: 11px; font-weight: 600;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.botones_sociales a:hover { background: var(--accent); color: var(--white); }

/* ---------- article prose -------------------------------------------- */
.entry { font-size: 14px; line-height: 1.75; }
.entry p { margin: 0 0 14px; }
.entry .a-h2 { font-size: 22px; font-weight: 700; color: var(--text); margin: 24px 0 10px; }
.entry .a-h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 20px 0 8px; }
.entry .a-list { margin: 0 0 14px; padding-left: 20px; list-style: disc; }
.entry .a-list li { margin: 0 0 6px; }
.entry strong { color: var(--text); font-weight: 700; }
.entry .a-quote {
  margin: 0 0 12px; padding: 12px 16px; background: var(--grey-1);
  border: 1px solid var(--grey-2); border-left: 3px solid var(--accent); border-radius: 12px;
}
.entry .a-quote blockquote { margin: 6px 0 8px; font-size: 13px; }
.entry .a-quote figcaption { color: var(--text-soft); font-size: 12px; }
.entry .a-stars { color: var(--star); letter-spacing: 2px; margin: 0; }

/* ---------- download links box --------------------------------------- */
.bxdwnl .btn-download { width: 100%; margin: 0 0 15px; }
.bx-info-install {
  background: var(--grey-1); border: 1px solid var(--grey-2); border-radius: var(--radius);
  padding: 15px; font-size: 13px; color: var(--text);
}
.bx-info-install strong { display: block; margin: 0 0 8px; }
.bx-info-install ol { margin: 0; padding-left: 18px; }
.bx-info-install li { margin: 0 0 4px; }

/* ---------- sidebar widgets ------------------------------------------ */
.widget { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 20px 15px; margin: 0 0 20px; }
.widget-title {
  margin: 0 -10px 10px; padding: 10px; font-size: 16px; font-weight: 600;
  text-transform: uppercase; color: var(--text); border-bottom: 1px solid var(--grey-2);
}
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--grey-2); }
.widget ul li:last-child { border-bottom: 0; }
.widget ul a { color: var(--text); }
.widget ul a:hover { color: var(--accent); }

.w-post { display: flex; gap: 10px; align-items: center; }
.w-post .thumb { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; flex: none; background: var(--grey-2); }
.w-post .thumb img { width: 100%; height: 100%; object-fit: cover; }
.w-post > span:last-child { min-width: 0; }
.w-post .t { display: block; font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.35; }
.w-post .m { display: block; font-size: 12px; color: var(--text-soft); line-height: 1.45; }
.w-post .m .ver { color: var(--accent); }

.widget-empty { color: var(--text-soft); font-size: 13px; margin: 0; }

.sidebar-search { display: flex; gap: 8px; }
.sidebar-search input {
  flex: 1; min-width: 0; height: 34px; border: 1px solid var(--grey-2);
  border-radius: var(--radius); padding: 0 12px; font-family: var(--font); font-size: 13px; background: var(--grey-1);
}
.sidebar-search button {
  height: 34px; padding: 0 16px; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--accent); color: var(--white); font-size: 12px; font-weight: 600;
}
.sidebar-search button:hover { background: var(--accent-dark); }

/* ---------- comments (visual replica, not wired to storage) ------------ */
.comment-form label { display: block; font-size: 13px; margin: 0 0 6px; }
.comment-form textarea, .comment-form input[type="text"], .comment-form input[type="email"] {
  width: 100%; border: 1px solid var(--grey-2); background: var(--grey-1);
  border-radius: 12px; padding: 10px 12px; font-family: var(--font); font-size: 13px; color: var(--text);
}
.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form .fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0; }
.form-note { margin: 10px 0 0; font-size: 12px; color: var(--accent); font-weight: 600; }
.form-note[hidden] { display: none; }

/* ---------- promo box ------------------------------------------------- */
.promo {
  max-width: 520px; margin: 30px auto; padding: 26px 22px; text-align: center;
  background: #0B0B0B; border: 2px solid var(--gold); border-radius: 22px;
  box-shadow: 0 0 26px rgba(255, 215, 0, .45);
}
.promo img { width: 190px; height: 190px; margin: 0 auto 16px; border-radius: 18px; }
.promo h2 { color: var(--gold); font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.promo p { color: #E7E7E7; font-size: 13px; margin: 0 0 18px; }
.btn-gold {
  display: inline-block; background: linear-gradient(180deg, #FFE95C, #F5B301);
  color: #1B1B1B; font-weight: 700; font-size: 14px; padding: 12px 34px;
  border-radius: 40px; text-transform: uppercase;
}
.btn-gold:hover { color: #1B1B1B; filter: brightness(1.06); }

/* ---------- footer ---------------------------------------------------- */
.site-footer {
  background: var(--dark); color: var(--white);
  border-top: 2px solid var(--accent); padding: 34px 0 30px; text-align: center; margin-top: 10px;
}
.site-footer h2 { color: var(--gold); font-size: 28px; font-weight: 700; margin: 0 0 12px; }
.site-footer p { color: #D6D9DF; font-size: 13px; max-width: 620px; margin: 0 auto 18px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 22px; }
.footer-links a {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--gold); background: #111111; border: 1px solid var(--gold);
  border-radius: 40px; padding: 10px 20px; font-size: 13px;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.footer-links a:hover { background: var(--gold); color: #111111; }
.footer-dis { color: #A9AEB8; font-size: 12px; max-width: 900px; margin: 0 auto 18px; }
.footer-base { border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; color: var(--gold); font-size: 12px; }

.notice-legal {
  background: #14161C; border: 1px solid rgba(255, 215, 0, .35); border-radius: 12px;
  padding: 16px 18px; margin: 0 0 20px; color: #C9CDD6; font-size: 12px; line-height: 1.7;
}
.notice-legal strong { color: var(--gold); }
.notice-legal p { margin: 0 0 8px; }
.notice-legal p:last-child { margin: 0; }

/* ---------- scroll to top --------------------------------------------- */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: var(--z-top);
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: 50%; background: var(--accent); color: var(--white);
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), background-color var(--t) var(--ease);
}
.to-top[hidden] { display: none; }
.to-top.is-visible { opacity: 1; transform: none; }
.to-top:hover { background: var(--accent-dark); }

/* ---------- responsive ------------------------------------------------- */
@media (max-width: 1280px) {
  .bloques { grid-template-columns: repeat(5, 1fr); }
  .bloques.wide { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1080px) {
  .wrapper { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
  .bloques { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: fixed; left: 0; right: 0; top: calc(var(--header-h) + 2px); z-index: var(--z-nav);
    background: var(--dark-2); padding: 8px 10px 14px; margin: 0;
    border-bottom: 2px solid var(--accent);
    opacity: 0; visibility: hidden; transform: translateY(-10px); pointer-events: none;
    transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility var(--t);
  }
  .primary-nav.is-open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
  .primary-nav ul { flex-direction: column; align-items: stretch; }
  .nav-link { height: 46px; padding: 0 12px; }
  .nav-cta { margin: 8px 0 0; justify-content: center; }

  .app-head { grid-template-columns: 1fr; }
  .main-box-title { font-size: 28px; }
  .box-data-app { grid-template-columns: repeat(2, 1fr); }
  .np-inner { flex-wrap: wrap; }
  .np .social { width: 100%; justify-content: center; }
}

@media (max-width: 768px) {
  .bloques { grid-template-columns: repeat(3, 1fr); }
  .bloques.wide { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 30px; }
  .box { padding: 18px 16px; }
  .box-title { margin: -18px 0 14px; }
  .box-title::before { left: -16px; width: calc(100% + 32px); }
  .comment-form .fields { grid-template-columns: 1fr; }
  /* keep mobile body text at a readable 16px */
  body { font-size: 16px; }
  .bav .title, .da-s, .entry, .px-postmeta { font-size: 16px; }
  .px-postmeta span { font-size: 15px; }
  .crumbs, .da-s span, .w-post .m { font-size: 15px; }
}

@media (max-width: 560px) {
  .sidebar { grid-template-columns: 1fr; }
  .bloques, .bloques.wide, .bloques.cols5 { grid-template-columns: repeat(2, 1fr); }
  .box-data-app { grid-template-columns: 1fr; }
  .hero { padding: 34px 0 30px; }
  .hero h1 { font-size: 26px; }
  .promo img { width: 150px; height: 150px; }
}

@media (max-width: 400px) {
  .bloques, .bloques.wide, .bloques.cols5 { grid-template-columns: 1fr; }
}

/* ---------- motion / print --------------------------------------------- */
@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;
  }
}

@media print {
  .site-header, .np, .hero, .sidebar, .to-top, .site-footer, .promo { display: none !important; }
  .box { box-shadow: none; border: 1px solid #DDD; }
}
