:root {
  /* Precise PGXW Color Matching */
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #555555;
  --header-height: 0px;
  --bottom-nav-height: 60px;
  
  /* Brand Gradients (Eyeballed from screenshots) */
  --header-gradient: linear-gradient(90deg, #d8309a 0%, #9524a8 100%);
  --footer-bg: #9524a8;
  --btn-amber: linear-gradient(180deg, #ffcd3c 0%, #f6a116 100%);
  --btn-pink: #d8309a;
  
  --border: #f0f0f0;
  
  --radius: 10px;
  --radius-sm: 4px;
  
  --container-width: 1200px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Prompt', 'Inter', system-ui, sans-serif; /* Adding Prompt for better Thai rendering */
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  padding-bottom: var(--bottom-nav-height);
  padding-top: var(--header-height);
}

.container {
  width: min(var(--container-width), 96vw);
  margin: 0 auto;
}

/* HEADER - Fixed top style */
.site-header {
  background: var(--header-gradient);
  padding: 10px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  color: #fff;
  letter-spacing: -1px;
  text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
  font-style: italic;
  line-height: 1;
}

.logo img {
  display: block;
}

.site-nav {
  display: none;
}

@media (min-width: 1024px) {
  .site-nav {
    display: flex;
    gap: 15px;
    align-items: center;
  }
  .site-nav a {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
  }
  .site-nav a:hover {
    color: #1a1a1a;
  }
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-btn {
  padding: 6px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-white {
  background: #fff;
  color: #d8309a;
}

.btn-amber {
  background: var(--btn-amber);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.nav-btn:hover {
  filter: brightness(0.8);
}

/* HERO */
.hero {
  padding: 0 0 30px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  margin-top: 0;
  margin-bottom: 15px;
}

.hero p {
  font-size: 1rem;
  color: #444;
  max-width: 1000px;
  margin: 0 auto 25px;
}

.promo-banner {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* GAME GRID - Very tight 2-column mobile, 4-6 desktop */
.grid-container {
  padding: 20px 0;
}

.section-label {
  display: inline-block;
  background: #d8309a;
  color: #fff;
  padding: 4px 20px;
  border-radius: 5px;
  font-weight: 700;
  margin-bottom: 20px;
}

.games-grid {
  display: grid;
  gap: 6px;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-items: stretch;
  align-items: stretch;
}

/* Keep 4 columns on most desktop widths, drop only on small screens */
@media (max-width: 640px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .games-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* Ensure cards fully fill grid cells */
.game-card {
  width: 100%;
  min-width: 0;
}

.game-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  background: #eee;
  display: block;
  width: 100%;
}

.game-thumb {
  display: block;
  width: 100%;
  height: 100%;
}

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay play button "คลิก" */
.btn-play-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 15%;
  min-height: 26px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  letter-spacing: 0.4px;
  text-decoration: none;
}

.btn-play-overlay:active {
  background: rgba(0, 0, 0, 0.9);
}

@media (hover: hover) {
  .btn-play-overlay:hover {
    background: rgba(0, 0, 0, 0.88);
  }
}

/* BOTTOM NAV - Exact replica */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #d8309a;
  display: flex;
  height: var(--bottom-nav-height);
  z-index: 2000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  gap: 8px;
  transition: background 0.2s ease;
}

.bottom-nav-item .icon-circle {
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d8309a;
  font-size: 14px;
}

.bottom-nav-item.center {
  background: rgba(0,0,0,0.05);
  border-left: 1px solid rgba(255,255,255,0.1);
  border-right: 1px solid rgba(255,255,255,0.1);
}

.bottom-nav-item:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* FOOTER */
.site-footer {
  background: var(--footer-bg);
  color: #fff;
  padding: 40px 0 0;
  text-align: center;
}

.footer-logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 3rem;
  font-style: italic;
  margin-bottom: 20px;
  display: inline-block;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 1rem;
  font-weight: 700;
}

.footer-nav a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: #1a1a1a;
}

.copyright-bar {
  background: #1a1a1a;
  color: #fff;
  padding: 10px 0;
  font-size: 0.8rem;
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--btn-pink);
  color: #fff;
  padding: 8px;
  z-index: 10000;
  transition: top 0.2s ease;
  text-decoration: none;
  font-weight: bold;
}
.skip-link:focus {
  top: 0;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 15px 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
}
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: #ccc;
}
.breadcrumbs a {
  color: var(--btn-pink);
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
