/*
Theme Name:   PlayKid Child (VI)
Theme URI:    https://playkid.com
Description:  Child theme for H5 Game Site — built on Astra
Author:       PlayKid
Author URI:   https://playkid.com
Template:     astra
Version:      1.5.0
Text Domain:  playkid-child
*/

/* =============================================
   IMPORT PARENT THEME
   ============================================= */
@import url('../astra/style.css');

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
  --pk-primary:    #6d28d9;
  --pk-secondary:  #2563eb;
  --pk-dark:       #1a0a3e;
  --pk-darker:     #0d1b4e;
  --pk-accent:     #f59e0b;
  --pk-hot:        #ef4444;
  --pk-new:        #10b981;
  --pk-grad:       linear-gradient(135deg, #7c3aed, #3b82f6);
  --pk-grad-btn:   linear-gradient(90deg, #6d28d9, #2563eb);
  --pk-radius:     12px;
  --pk-radius-sm:  8px;
  --pk-shadow:     0 4px 20px rgba(0,0,0,0.12);
  --pk-shadow-hover: 0 8px 30px rgba(109,40,217,0.25);
}

/* =============================================
   GLOBAL RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }

body.playkid-body {
  background: #f0f0f5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

img { max-width: 100%; height: auto; }

a { text-decoration: none; }

/* =============================================
   HEADER
   ============================================= */
.pk-header {
  background: linear-gradient(90deg, var(--pk-dark), var(--pk-darker));
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.pk-logo {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pk-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  list-style: none;
  padding: 0;
  margin-bottom: 0;
}

.pk-nav a {
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.pk-nav a:hover { color: #fff; }

.pk-hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  margin-left: auto;
}

/* =============================================
   GAME DETAIL PAGE
   ============================================= */
.pk-detail-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: 120px 1fr 150px;
  gap: 0;
  background: #fff;
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
  overflow: hidden;
}

/* LEFT sidebar */
.pk-sidebar-left {
  border-right: 1px solid #eee;
  padding: 16px 8px;
  background: #f8f8fc;
}

.pk-sb-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #999;
  text-align: center;
  margin-bottom: 12px;
}

.pk-hot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-bottom: 12px;
  cursor: pointer;
  text-decoration: none;
}

.pk-hot-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  background: var(--pk-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.pk-hot-name {
  font-size: 10px;
  font-weight: 600;
  color: #333;
  text-align: center;
  line-height: 1.3;
}

/* MAIN column */
.pk-detail-main {
  padding: 20px;
}

/* Hero: avatar+meta (3/4) | ads square (1/4) */
.pk-hero-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.pk-hero-left {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.pk-game-avatar {
  width: 100px;
  height: 100px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--pk-grad);
}

.pk-game-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #111;
  line-height: 1.2;
}

.pk-game-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pk-cat-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 600;
}

.pk-stars {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 4px;
}

.pk-star { color: #f59e0b; font-size: 16px; }
.pk-star.empty { color: #ddd; }

.pk-rating-num {
  font-size: 12px;
  color: #888;
  margin-left: 4px;
}

.pk-dev-name {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* Ads square — looks like play button */
.pk-ads-hero {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: var(--pk-darker);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.pk-ads-hero .pk-ad-label {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
  letter-spacing: .5px;
}

.pk-play-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 2.5px solid rgba(255,255,255,0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.pk-ads-cta {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Go to Game button */
.pk-btn-goto {
  display: block;
  width: 100%;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--pk-grad-btn);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  text-align: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.3px;
}

.pk-btn-goto:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  color: #fff;
}

/* Screenshots */
.pk-screenshots {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.pk-screenshot {
  height: 80px;
  min-width: 120px;
  border-radius: 10px;
  object-fit: cover;
  flex: 1;
}

/* Section title */
.pk-section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tags */
.pk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pk-tag {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #f4f4f8;
  border: 1px solid #e0e0e8;
  color: #666;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
}

.pk-tag:hover {
  background: var(--pk-primary);
  color: #fff;
  border-color: var(--pk-primary);
}

/* RIGHT sidebar */
.pk-sidebar-right {
  border-left: 1px solid #eee;
  padding: 16px 8px;
  background: #f8f8fc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pk-sr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-decoration: none;
}

.pk-sr-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  background: var(--pk-grad);
}

.pk-sr-name {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  color: #333;
  line-height: 1.3;
}

.pk-ads-fill {
  margin-top: auto;
  background: #f0f0f8;
  border: 1px dashed #ccc;
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #aaa;
  font-size: 10px;
  text-align: center;
  min-height: 80px;
}

/* =============================================
   PLAY SCREEN
   ============================================= */
.pk-play-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 16px;
}

.pk-player-wrap {
  background: #000;
  border-radius: var(--pk-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pk-iframe-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: var(--pk-darker);
}

.pk-iframe-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.pk-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--pk-darker);
  cursor: pointer;
}

.pk-play-btn-big {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: transform 0.2s;
}

.pk-play-overlay:hover .pk-play-btn-big {
  transform: scale(1.08);
}

.pk-play-game-name {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.pk-play-hint {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
}

.pk-ctrl-bar {
  background: #111;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pk-ctrl-btn {
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  padding: 5px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 7px;
  cursor: pointer;
  background: transparent;
  transition: all 0.18s;
}

.pk-ctrl-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.pk-ctrl-mid {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
}

/* Play page sidebar */
.pk-play-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =============================================
   APP DOWNLOAD PAGE
   ============================================= */
.pk-appdownload-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 0;
  background: #fff;
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
  overflow: hidden;
}

.pk-appdownload-main {
  padding: 24px;
}

.pk-app-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.pk-app-icon {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--pk-grad);
}

.pk-app-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.pk-app-dev {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}

.pk-store-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pk-store-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.pk-store-btn:hover { opacity: 0.88; }

.pk-store-btn-play { background: #01875f; color: #fff; }
.pk-store-btn-apple { background: #1c1c1e; color: #fff; }

/* Highlights */
.pk-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.pk-highlight {
  background: #f8f8fc;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid #eee;
}

.pk-hi-icon  { font-size: 24px; margin-bottom: 6px; }
.pk-hi-val   { font-size: 16px; font-weight: 800; color: #111; margin-bottom: 2px; }
.pk-hi-label { font-size: 10px; color: #888; }

/* App screenshots */
.pk-app-screenshots {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.pk-app-screenshot {
  height: 100px;
  min-width: 70px;
  border-radius: 10px;
  object-fit: cover;
  flex: 1;
  background: #dde;
}

/* Ads banner in app page */
.pk-ads-banner-mid {
  width: 100%;
  min-height: 60px;
  background: #f0f0f8;
  border: 1px dashed #ccc;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}

/* =============================================
   BLOG / POST PAGE
   ============================================= */
.pk-blog-page {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
}

.pk-post-header {
  margin-bottom: 24px;
}

.pk-post-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.3;
}

.pk-post-meta {
  font-size: 12px;
  color: #888;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pk-post-content {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

.pk-post-content h2 { font-size: 20px; font-weight: 700; margin: 24px 0 10px; }
.pk-post-content h3 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; }
.pk-post-content p  { margin-bottom: 16px; }
.pk-post-content img { border-radius: 10px; margin: 12px 0; }

/* =============================================
   RESPONSIVE — TABLET (768px – 1024px)
   ============================================= */
@media (max-width: 1024px) {
  /* Game List: 4 cols */
  .pk-game-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 100px;
  }

  /* Detail: 2 col, no left sidebar */
  .pk-detail-page {
    grid-template-columns: 1fr 130px;
  }

  .pk-sidebar-left { display: none; }

  /* Play: full width, no sidebar */
  .pk-play-page {
    grid-template-columns: 1fr;
  }

  .pk-play-sidebar { display: none; }

  /* App download: 2 col */
  .pk-appdownload-page {
    grid-template-columns: 1fr 130px;
  }

  /* Tablet ads: banner ngang thay square */
  .pk-ads-hero {
    aspect-ratio: unset;
    height: 56px;
    flex-direction: row;
    border-radius: 10px;
    grid-column: 1 / -1; /* full width dưới hero-left */
  }

  .pk-hero-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pk-play-ring { width: 32px; height: 32px; font-size: 14px; }
  .pk-ads-cta { font-size: 10px; }
}

/* =============================================
   RESPONSIVE — MOBILE (< 768px)
   ============================================= */
@media (max-width: 767px) {
  /* Header */
  .pk-nav { display: none; }
  .pk-hamburger { display: block; }

  /* Game List: 3 cols */
  .pk-game-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 90px;
    gap: 5px;
  }

  /* Ads tile mobile: full 3 cols, 1 row */
  .pk-ads-tile {
    grid-column: span 3;
    grid-row: span 1;
    height: 50px;
  }

  /* Detail: 1 col, no sidebars */
  .pk-detail-page {
    grid-template-columns: 1fr;
    border-radius: 0;
  }

  .pk-sidebar-left,
  .pk-sidebar-right { display: none; }

  /* Mobile hero: avatar+meta stacked, NO ads here */
  .pk-hero-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Hide ads square in hero on mobile */
  .pk-ads-hero { display: none; }

  /* Mobile ads square: after button, full width */
  .pk-ads-mobile {
    display: flex !important;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: var(--pk-darker);
    border: 1px solid rgba(255,255,255,0.08);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    margin-bottom: 16px;
    overflow: hidden;
  }

  /* Related games strip on mobile */
  .pk-mobile-related {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
  }

  .pk-mobile-related-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    text-decoration: none;
  }

  .pk-mobile-related-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--pk-grad);
  }

  .pk-mobile-related-name {
    font-size: 9px;
    font-weight: 600;
    color: #333;
    text-align: center;
    width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Play page: full screen feel */
  .pk-play-page {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .pk-player-wrap { border-radius: 0; }

  /* App download: 1 col */
  .pk-appdownload-page {
    grid-template-columns: 1fr;
  }

  .pk-appdownload-page .pk-sidebar-right { display: none; }

  /* Store btns stacked */
  .pk-store-btns { flex-direction: column; }
  .pk-store-btn { justify-content: center; }

  /* Mobile ads square in app page */
  .pk-ads-banner-mid {
    aspect-ratio: 1 / 1;
    height: auto;
  }

  /* Blog */
  .pk-post-title { font-size: 22px; }
}
