/*
Theme Name: XueXue
Description: Minimal clean blog theme with Thai language support
Version: 1.0.0
Text Domain: xuexue
*/

/* === Variables === */
:root {
  --font-sans: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

  /* Dark + gold theme (ทั้งเว็บใช้โทนเดียวกับหน้า homepage) */
  --bg: #0a0a0d;
  --bg-subtle: #16161c;
  --text: #ececf0;
  --text-muted: #9a9aa4;
  --accent: #f5c451;
  --accent-light: rgba(245, 196, 81, 0.14);
  --border: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.08);

  --content-width: 700px;
  --site-width: 1100px;
  --radius: 6px;
  --radius-lg: 12px;

  /* PG-style premium gold (used on homepage) */
  --gold: #f5c451;
  --gold-soft: #f9de9c;
  --gold-deep: #c8912f;
  --gold-grad: linear-gradient(135deg, #f9de9c 0%, #f0c14b 45%, #d99e2b 100%);
  --home-bg: #0a0a0d;
  --home-card: #16161c;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

/* === Base === */
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.25em; }
a { text-decoration: none; color: inherit; }
a:hover { text-decoration: underline; }

/* === Layout === */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 13, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245, 196, 81, 0.14);
}

.header-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-branding a {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.site-branding a:hover { text-decoration: none; }

.site-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 1px 0 0;
}

/* Navigation */
.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
  align-items: center;
}

.main-navigation a {
  display: block;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.main-navigation a:hover {
  color: var(--accent);
  background: rgba(245, 196, 81, 0.10);
  text-decoration: none;
}

/* === Header Search === */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 16px;
  flex: 0 1 300px;
}

.header-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.header-search-input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.header-search-input::placeholder { color: var(--text-muted); }

.header-search-input:focus {
  background: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Dark variant on homepage */
.home .header-search-icon { color: rgba(255,255,255,0.5); }
.home .header-search-input {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}
.home .header-search-input::placeholder { color: rgba(255,255,255,0.5); }
.home .header-search-input:focus {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

/* === Container === */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* === Post List (index/archive) === */
.posts-list { padding: 40px 0; }

.post-card {
  padding: 36px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.post-card:last-child { border-bottom: none; }

.post-card-thumbnail {
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card-thumbnail img { transform: scale(1.03); }

/* Featured first post */
.post-card.is-featured .post-card-title { font-size: 1.65rem; }
.post-card.is-featured .post-card-thumbnail { aspect-ratio: 16 / 7; }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.category-tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.category-tag:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-card-title {
  font-size: 1.3rem;
  line-height: 1.4;
  margin: 0 0 10px;
}

.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }

.post-card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.15s;
}

.read-more:hover { gap: 8px; text-decoration: none; }

/* === Pagination === */
.navigation.pagination { padding: 40px 0 60px; }

.navigation.pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.page-numbers:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.page-numbers.current { background: var(--accent); color: #fff; }
.page-numbers.dots { background: none; cursor: default; }

/* === Archive Header === */
.archive-header {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border-subtle);
}

.archive-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.archive-title { font-size: 2rem; margin: 0; }
.archive-desc { color: var(--text-muted); margin: 8px 0 0; }

/* === Single Post === */
.entry-header { padding: 56px 0 28px; }

.entry-header .post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.entry-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.entry-meta-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.entry-meta-bar .sep { color: var(--border); }

.entry-meta-bar a { color: var(--text-muted); }
.entry-meta-bar a:hover { color: var(--text); text-decoration: none; }

.entry-featured-image {
  margin: 28px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.entry-featured-image img { width: 100%; height: 100%; object-fit: cover; }

/* === Post Content === */
.entry-content { padding: 28px 0; }

.entry-content p { margin-bottom: 1.5em; }

.entry-content h2 { font-size: 1.45rem; margin: 2em 0 0.6em; }
.entry-content h3 { font-size: 1.2rem; margin: 1.8em 0 0.5em; }
.entry-content h4 { font-size: 1rem; margin: 1.5em 0 0.4em; }

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content a:hover { text-decoration: none; }

.entry-content blockquote {
  margin: 1.8em 0;
  padding: 16px 24px;
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}

.entry-content blockquote p:last-child { margin: 0; }

.entry-content ul, .entry-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.entry-content li { margin-bottom: 0.4em; }

.entry-content img {
  border-radius: var(--radius-lg);
  margin: 1.5em auto;
}

.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gold-soft);
}

.entry-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  margin: 1.5em 0;
}

.entry-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.entry-content hr {
  border: none;
  border-top: 2px solid var(--border-subtle);
  margin: 2.5em 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92rem;
}

.entry-content th, .entry-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.entry-content th { background: var(--bg-subtle); font-weight: 600; }
.entry-content tr:hover td { background: var(--bg-subtle); }

/* === Post Tags === */
.entry-tags {
  padding: 24px 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.tag-item {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all 0.15s;
}

.tag-item:hover {
  background: var(--accent);
  color: #201400;
  border-color: var(--accent);
  text-decoration: none;
}

/* === Post Navigation === */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 28px 0 64px;
  border-top: 1px solid var(--border-subtle);
}

.nav-previous, .nav-next {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-previous:hover, .nav-next:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}

.nav-next { text-align: right; }

.nav-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.nav-post-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Empty states === */
.no-posts {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}

.no-posts h2 { margin-bottom: 8px; color: var(--text); }

/* === 404 === */
.error-404 {
  text-align: center;
  padding: 100px 24px;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
}

.error-404 h1 { margin-bottom: 12px; }
.error-404 p { color: var(--text-muted); margin-bottom: 28px; }

/* === Page === */
.page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  padding: 56px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

/* === Button === */
.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; text-decoration: none; }

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 28px 0;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-copy a { color: var(--text-muted); }
.footer-copy a:hover { color: var(--text); text-decoration: none; }

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links a:hover { color: var(--text); text-decoration: none; }

/* === Responsive === */
@media (max-width: 640px) {
  body { font-size: 16px; }

  .header-inner { padding: 0 16px; gap: 12px; }
  .container { padding: 0 16px; }
  .main-navigation { display: none; }
  .header-search { flex: 1 1 auto; margin-right: 0; min-width: 0; }

  .entry-title { font-size: 1.55rem; }
  .archive-title { font-size: 1.5rem; }

  .post-navigation { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

/* =====================================================
   HOMEPAGE — Featured Showcase (Epic-style)
   ===================================================== */

/* Dark header on front page */
.home .site-header {
  background: rgba(13, 13, 13, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.home .site-branding a { color: #fff; }
.home .site-tagline { color: rgba(255,255,255,0.45); }
.home .main-navigation a { color: rgba(255,255,255,0.65); }
.home .main-navigation a:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Showcase wrapper */
.featured-showcase {
  display: flex;
  height: calc(100vh - 60px);
  min-height: 480px;
  max-height: 780px;
  background: #0d0d0d;
  overflow: hidden;
}

/* === Hero Panel (left) === */
.hero-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-color: #1a1a2a;
  transform: scale(1.03);
  transition: transform 0.6s ease;
}

.hero-slide.is-active .hero-bg { transform: scale(1); }

/* Two-axis gradient overlay */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,  rgba(0,0,0,0.80) 0%, rgba(0,0,0,0.30) 55%, rgba(0,0,0,0.05) 100%),
    linear-gradient(to top,    rgba(0,0,0,0.65) 0%, transparent 55%);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 48px 52px;
  max-width: 540px;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  color: rgba(255,255,255,0.9);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
  transition: background 0.15s;
}

.hero-badge:hover { background: rgba(255,255,255,0.22); text-decoration: none; }

.hero-title {
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.hero-excerpt {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.75;
  margin: 0 0 26px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: #fff;
  color: #0d0d0d;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background 0.15s, transform 0.15s;
}

.hero-btn-primary:hover {
  background: rgba(255,255,255,0.88);
  transform: translateY(-1px);
  text-decoration: none;
}

.hero-btn-bookmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.hero-btn-bookmark:hover { background: rgba(255,255,255,0.18); }
.hero-btn-bookmark.is-saved svg { fill: #fff; }

/* Progress bar at bottom of hero */
.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.1);
  z-index: 2;
}

.hero-progress-bar {
  height: 100%;
  background: rgba(255,255,255,0.6);
  width: 0%;
  transition: width linear;
}

/* === Sidebar Panel (right) === */
.sidebar-panel {
  width: 290px;
  flex-shrink: 0;
  background: #141414;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.05);
}

.sidebar-items {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sidebar-items::-webkit-scrollbar { width: 3px; }
.sidebar-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.sidebar-item.is-active {
  background: rgba(255,255,255,0.07);
  border-left-color: rgba(255,255,255,0.9);
  color: #fff;
}

.sidebar-thumb {
  width: 68px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #222;
}

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

.sidebar-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #222, #2e2e2e);
}

.sidebar-title {
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar navigation arrows */
.sidebar-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.sidebar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sidebar-nav-btn:disabled { opacity: 0.3; cursor: default; }

/* === Recent Posts section === */
.homepage-recent { padding: 52px 0 64px; }

.section-heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.recent-card {
  display: block;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s, transform 0.2s;
}

.recent-card:hover {
  border-color: var(--border);
  transform: translateY(-3px);
  text-decoration: none;
  color: var(--text);
}

.recent-card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-subtle);
}

.recent-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.recent-card:hover .recent-card-thumb img { transform: scale(1.04); }

.recent-card-body { padding: 14px 16px 18px; }

.recent-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.recent-card-cat {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recent-card-date { font-size: 0.78rem; color: var(--text-muted); }

.recent-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Responsive === */
@media (max-width: 900px) {
  .recent-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .featured-showcase {
    flex-direction: column;
    height: auto;
    max-height: none;
  }

  .hero-panel { height: 62vw; min-height: 260px; position: relative; }
  .hero-content { padding: 24px 20px; }
  .hero-title { font-size: 1.3rem; }
  .hero-excerpt { display: none; }

  .sidebar-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.05);
  }

  .sidebar-items { display: flex; overflow-x: auto; overflow-y: hidden; }

  .sidebar-item {
    flex-direction: column;
    flex-shrink: 0;
    width: 110px;
    padding: 10px 8px;
    text-align: center;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .sidebar-item.is-active {
    border-left-color: transparent;
    border-bottom-color: #fff;
  }

  .sidebar-thumb { width: 100%; height: 56px; }

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

/* =====================================================
   Embedded Game (iframe) — playable in-article
   ===================================================== */
.game-embed {
  /* break out of the narrow content column for a wider play area */
  position: relative;
  width: min(100vw - 32px, 1040px);
  margin: 28px 50% 16px;
  transform: translateX(-50%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  aspect-ratio: 16 / 9;
}

.game-embed iframe,
.game-embed #game-area {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.game-embed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100vw - 32px, 1040px);
  margin: 0 50% 28px;
  transform: translateX(-50%);
  flex-wrap: wrap;
}

.game-embed-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.game-embed-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
}

.game-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.game-fullscreen-btn:hover { opacity: 0.88; }

@media (max-width: 640px) {
  .game-embed { aspect-ratio: 3 / 4; min-height: 480px; }
}

/* =====================================================
   Floating CTA buttons (fixed bottom-right, all pages)
   ===================================================== */
.floating-cta {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.fcta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px 0 6px;
  border-radius: 30px;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  /* start collapsed to just the icon, expand on hover (desktop) */
  max-width: 300px;
}

.fcta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  filter: brightness(1.05);
  text-decoration: none;
  color: #fff;
}

.fcta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 50%;
}

.fcta-label { white-space: nowrap; letter-spacing: 0.01em; }

/* Per-button colors (icon color matches the pill) */
.fcta-register { background: #22a95b; }
.fcta-register .fcta-icon { color: #22a95b; }

.fcta-login    { background: #2f7fd1; }
.fcta-login    .fcta-icon { color: #2f7fd1; }

.fcta-promo    { background: #f0722f; }
.fcta-promo    .fcta-icon { color: #f0722f; }

/* Mobile: collapse to icon-only pills, expand the tapped one is not needed;
   keep compact so they don't cover content */
@media (max-width: 640px) {
  .floating-cta { right: 12px; bottom: 12px; gap: 8px; }

  .fcta-btn {
    height: 44px;
    padding: 0 6px;
    max-width: 44px;
    overflow: hidden;
  }

  .fcta-icon { width: 32px; height: 32px; }

  /* hide label on mobile to save space; icons remain tappable */
  .fcta-label {
    opacity: 0;
    width: 0;
    margin-left: -10px;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fcta-btn { transition: none; }
}

/* =====================================================================
   PG-STYLE PREMIUM HOMEPAGE  (dark + gold, scoped to .home)
   Keeps the existing structure — only restyles the front page.
   ===================================================================== */

/* Ambient background: near-black with soft gold glows */
body.home {
  background: var(--home-bg);
}
.home .site-main {
  background:
    radial-gradient(1200px 500px at 78% -6%, rgba(245,196,81,0.12), transparent 60%),
    radial-gradient(900px 500px at 8% 108%, rgba(245,196,81,0.06), transparent 60%),
    var(--home-bg);
}

/* ---- Header (home) : gold branding + focus ---- */
.home .site-header {
  background: rgba(10, 10, 13, 0.82);
  border-bottom-color: rgba(245, 196, 81, 0.14);
}
.home .site-branding a {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.home .main-navigation a:hover { color: var(--gold); background: rgba(245,196,81,0.10); }
.home .header-search-input:focus {
  border-color: rgba(245,196,81,0.55);
  box-shadow: 0 0 0 3px rgba(245,196,81,0.14);
}

/* ---- Showcase shell ---- */
.home .featured-showcase {
  background: transparent;
  gap: 14px;
  padding: 18px 18px 4px;
  max-width: calc(var(--site-width) + 260px);
  margin: 0 auto;
  height: auto;
  max-height: none;
}
.home .hero-panel {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(245,196,81,0.18);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.02);
  min-height: 460px;
}

/* Gold sheen along the top of the hero */
.hero-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--gold-grad);
  opacity: 0.8;
  z-index: 3;
}

/* Hero badge → gold chip */
.home .hero-badge {
  background: rgba(245,196,81,0.16);
  border-color: rgba(245,196,81,0.35);
  color: var(--gold-soft);
}
.home .hero-badge:hover { background: rgba(245,196,81,0.28); }

.home .hero-title {
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

/* Primary CTA (incl. Play Demo) → glossy gold */
.home .hero-btn-primary {
  background: var(--gold-grad);
  color: #201400;
  box-shadow: 0 8px 22px rgba(217,158,43,0.35);
  font-weight: 800;
}
.home .hero-btn-primary:hover {
  background: var(--gold-grad);
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(217,158,43,0.45);
}
.home .hero-btn-bookmark:hover {
  background: rgba(245,196,81,0.18);
  border-color: rgba(245,196,81,0.45);
}

/* Progress bar → gold */
.home .hero-progress-bar { background: var(--gold); }

/* ---- Sidebar → gold active state, glassy panel ---- */
.home .sidebar-panel {
  background: rgba(22,22,28,0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245,196,81,0.14);
  border-radius: 18px;
}
.home .sidebar-item.is-active {
  background: linear-gradient(90deg, rgba(245,196,81,0.16), rgba(245,196,81,0.02));
  border-left-color: var(--gold);
  color: #fff;
}
.home .sidebar-item:hover { color: var(--gold-soft); }
.home .sidebar-thumb { border: 1px solid rgba(255,255,255,0.06); }
.home .sidebar-nav-btn:hover { background: rgba(245,196,81,0.16); color: var(--gold); border-color: rgba(245,196,81,0.3); }

/* ---- Recent posts → premium GAME CARDS ---- */
.home .homepage-recent { background: transparent; }

.home .section-heading {
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: none;
}
.home .section-heading::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--gold-grad);
}

.home .recent-card {
  background: var(--home-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  color: #fff;
  overflow: hidden;
}
.home .recent-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245,196,81,0.55);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(245,196,81,0.25), 0 0 30px rgba(245,196,81,0.12);
  color: #fff;
}

.home .recent-card-thumb {
  position: relative;
  background: linear-gradient(135deg, #1c1c24, #101015);
}

/* Play button overlay (fades in on hover) */
.recent-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #201400;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  pointer-events: none;
}
.recent-play svg { margin-left: 3px; }
.home .recent-card:hover .recent-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.home .recent-card-cat { color: var(--gold); }
.home .recent-card-date { color: rgba(255,255,255,0.5); }
.home .recent-card-title { color: #fff; }

/* Pagination → gold current */
.home .page-numbers {
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.08);
}
.home .page-numbers:hover { background: rgba(245,196,81,0.14); color: var(--gold); }
.home .page-numbers.current {
  background: var(--gold-grad);
  color: #201400;
  border-color: transparent;
}

/* ---- Game rows by category (BC-style horizontal scrollers) ---- */
.game-rows {
  max-width: 1240px;
  margin: 8px auto 0;
  padding: 28px 24px 8px;
}

.card-row { margin-bottom: 34px; }

.card-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-row-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
}
.card-row-title::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--gold-grad);
}

.card-row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-row-all {
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.06);
  border-radius: 16px;
  transition: background 0.15s, color 0.15s;
}
.card-row-all:hover { background: rgba(245,196,81,0.16); color: var(--gold); text-decoration: none; }

.row-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.row-arrow:hover { background: rgba(245,196,81,0.16); color: var(--gold); border-color: rgba(245,196,81,0.3); }

/* Horizontal track */
.card-row-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.card-row-track::-webkit-scrollbar { display: none; }

/* Portrait game tile */
.game-tile {
  flex: 0 0 auto;
  width: 158px;
  scroll-snap-align: start;
  text-decoration: none;
}
.game-tile:hover { text-decoration: none; }

.game-tile-art {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(150deg, #20202a 0%, #121218 100%);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.game-tile-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Bottom gradient for legibility of the overlaid name */
.game-tile-art::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}

.game-tile:hover .game-tile-art {
  transform: translateY(-5px);
  border-color: rgba(245,196,81,0.6);
  box-shadow: 0 14px 30px rgba(0,0,0,0.5), 0 0 22px rgba(245,196,81,0.15);
}

.game-tile-name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-tile-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #201400;
  background: var(--gold-grad);
  border-radius: 10px;
  letter-spacing: 0.02em;
}

/* Center play button appears on hover */
.game-tile-play {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 2;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #201400;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.game-tile-play svg { margin-left: 2px; }
.game-tile:hover .game-tile-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 640px) {
  .game-rows { padding: 20px 16px 4px; }
  .game-tile { width: 132px; }
  .card-row-title { font-size: 1.02rem; }
}

/* ---- Feature category tiles (CASINO/SPORTS + POKER/RACING/...) ---- */
.feature-tiles {
  max-width: 1240px;
  margin: 4px auto 0;
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ftiles-big {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ftiles-small {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.ftile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: linear-gradient(160deg, #1a1a20, #131318);
  border: 1px solid rgba(255,255,255,0.07);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.ftile:hover {
  transform: translateY(-4px);
  border-color: rgba(245,196,81,0.5);
  box-shadow: 0 14px 34px rgba(0,0,0,0.5), 0 0 22px rgba(245,196,81,0.12);
  text-decoration: none;
}

.ftile-lg { min-height: 168px; padding: 22px 24px; justify-content: flex-start; }
.ftile-sm { min-height: 92px; padding: 16px 18px; justify-content: center; }

.ftile-head {
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  z-index: 2;
}
.ftile-ic { color: var(--gold); display: inline-flex; }
.ftile-title {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}
.ftile-sm .ftile-title { font-size: 0.92rem; }

.ftile-desc {
  position: relative;
  z-index: 2;
  margin: 16px 0 0;
  max-width: 58%;
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Image placeholder area (drop a background-image or <img> later) */
.ftile-art {
  position: absolute;
  z-index: 1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center right;
  pointer-events: none;
}
.ftile-lg .ftile-art {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 46%;
  height: 78%;
  /* subtle placeholder sheen until a real image is added */
  background-image: radial-gradient(ellipse at 70% 50%, rgba(245,196,81,0.10), transparent 70%);
}
.ftile-sm .ftile-art {
  right: 10px;
  bottom: 8px;
  width: 52%;
  height: 70%;
  background-image: radial-gradient(ellipse at 75% 60%, rgba(245,196,81,0.08), transparent 70%);
}

@media (max-width: 900px) {
  .ftiles-small { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .feature-tiles { padding: 8px 16px 20px; }
  .ftiles-big { grid-template-columns: 1fr; }
  .ftiles-small { grid-template-columns: repeat(2, 1fr); }
  .ftile-desc { max-width: 70%; }
}

/* ---- Homepage H1 intro (เกมเดโม่) ---- */
.home-intro {
  max-width: 900px;
  margin: 24px auto 4px;
  padding: 0 24px;
  text-align: center;
}
.home-h1 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.home-h1-sub {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ---- Promo image carousel (top layer) ---- */
.promo-carousel {
  position: relative;
  max-width: 1240px;
  margin: 18px auto 4px;
  padding: 0 24px;
}

.promo-viewport {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(245,196,81,0.14);
  box-shadow: 0 12px 34px rgba(0,0,0,0.4);
}

.promo-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.promo-slide { flex: 0 0 100%; min-width: 0; }

.promo-link {
  display: block;
  position: relative;
  aspect-ratio: 1280 / 266; /* ตรงกับสัดส่วนแบนเนอร์ → โชว์เต็มไม่ครอป */
  background: #16161c;
  overflow: hidden;
}
.promo-link img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder look (until real banners are dropped in) */
.promo-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
  color: #fff;
}
.promo-ph-1 { background: linear-gradient(120deg, #1b1b24 0%, #2a2118 55%, #3a2c12 100%); }
.promo-ph-2 { background: linear-gradient(120deg, #101820 0%, #16303a 60%, #0f3b33 100%); }
.promo-ph-3 { background: linear-gradient(120deg, #1e1420 0%, #3a1f3a 60%, #2a1440 100%); }
.promo-ph-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.promo-ph-title {
  font-size: clamp(1.1rem, 2.6vw, 1.7rem);
  font-weight: 800;
  color: #fff;
}
.promo-ph-hint { font-size: 0.82rem; color: rgba(255,255,255,0.5); }

/* Arrows */
.promo-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
  z-index: 2;
}
.promo-carousel:hover .promo-arrow { opacity: 1; }
.promo-arrow:hover { background: var(--gold); color: #201400; }
.promo-prev { left: 34px; }
.promo-next { right: 34px; }

/* Dots */
.promo-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 2;
}
.promo-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.15s, width 0.15s;
}
.promo-dot:hover { background: rgba(255,255,255,0.7); }
.promo-dot.is-active { background: var(--gold); width: 22px; border-radius: 4px; }

@media (max-width: 640px) {
  .promo-carousel { padding: 0 16px; margin-top: 12px; }
  .promo-prev { left: 22px; }
  .promo-next { right: 22px; }
  .promo-arrow { opacity: 1; width: 34px; height: 34px; }
}

/* ---- Featured "เกม" block + animated game wall ---- */
.featured-game {
  max-width: 1240px;
  margin: 12px auto 0;
  padding: 34px 24px 8px;
}

.featured-game-intro {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 22px;
}
.fg-title {
  margin: 0 0 12px;
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}
.fg-desc {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  line-height: 1.85;
}
.fg-desc p { margin: 0 0 0.6em; }
.fg-all {
  display: inline-block;
  margin-top: 16px;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.92rem;
}
.fg-all:hover { color: var(--gold-soft); text-decoration: none; }

/* Gold button (ใช้ในบล็อกทดลองเล่น) */
.fg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 30px;
  background: var(--gold-grad);
  color: #201400;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(217,158,43,0.32);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}
.fg-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 12px 28px rgba(217,158,43,0.42);
  text-decoration: none;
  color: #201400;
}

/* Try-play CTA — a bit more breathing room (ไม่มี wall ด้านล่าง) */
.try-play { padding-bottom: 34px; }
.tryplay-cta { text-align: center; margin-top: 24px; }

/* Try-play game images — plain responsive grid */
.tryplay-games {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 860px;
  margin: 24px auto 0;
}
.tryplay-game {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--home-card);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tryplay-game img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}
.tryplay-game:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 196, 81, 0.55);
  box-shadow: 0 14px 30px rgba(0,0,0,0.5), 0 0 22px rgba(245,196,81,0.12);
}

@media (max-width: 720px) {
  .tryplay-games { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 380px) {
  .tryplay-games { grid-template-columns: 1fr; }
}

/* The scrolling wall */
.game-wall {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 16px;
  height: 640px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 85%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 85%, transparent 100%);
}

.gw-col { overflow: hidden; }

.gw-track {
  display: block;
  animation-name: gw-up;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

/* Every tile (incl. last) has equal bottom margin → -50% loops seamlessly */
.gw-tile {
  display: block;
  aspect-ratio: 3 / 4;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #16161c;
  border: 1px solid rgba(255,255,255,0.05);
}
.gw-tile img { width: 100%; height: 100%; object-fit: cover; }

@keyframes gw-up {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

/* pause when hovering the wall */
.game-wall:hover .gw-track { animation-play-state: paused; }

/* Offset alternating columns downward a touch for an organic look */
.gw-col:nth-child(even) .gw-track { transform: translateY(-40px); }

@media (max-width: 1100px) {
  .game-wall { grid-template-columns: repeat(5, 1fr); }
  .gw-col:nth-child(n+6) { display: none; }
}
@media (max-width: 768px) {
  .game-wall { grid-template-columns: repeat(3, 1fr); height: 540px; }
  .gw-col:nth-child(n+4) { display: none; }
}
@media (max-width: 480px) {
  .game-wall { grid-template-columns: repeat(2, 1fr); }
  .gw-col:nth-child(n+3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gw-track { animation: none; }
}

/* Promotion wall — 5 columns, centered (สมดุลกึ่งกลางหน้า) */
.game-wall.promo-wall {
  grid-template-columns: repeat(5, 1fr);
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
/* รูปโปรฯ เป็นสี่เหลี่ยมจตุรัส 1:1 — โชว์เต็มไม่ครอป */
.game-wall.promo-wall .gw-tile { aspect-ratio: 1 / 1; }
.game-wall.promo-wall .gw-tile img { object-fit: cover; }
@media (max-width: 768px) {
  .game-wall.promo-wall { grid-template-columns: repeat(3, 1fr); }
  .game-wall.promo-wall .gw-col:nth-child(n+4) { display: none; }
}
@media (max-width: 480px) {
  .game-wall.promo-wall { grid-template-columns: repeat(2, 1fr); }
  .game-wall.promo-wall .gw-col:nth-child(n+3) { display: none; }
}

/* ---- Homepage SEO article (long-form, dark theme) ---- */
.home .homepage-seo {
  max-width: 820px;
  margin: 46px auto 8px;
  color: rgba(255,255,255,0.72);
}
.home .homepage-seo h1,
.home .homepage-seo h2,
.home .homepage-seo h3,
.home .homepage-seo h4 { color: #fff; }
.home .homepage-seo h2 { border-left: 4px solid var(--gold); padding-left: 12px; }
.home .homepage-seo a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.home .homepage-seo a:hover { color: var(--gold-soft); }
.home .homepage-seo strong { color: #fff; }
.home .homepage-seo blockquote {
  border-left: 4px solid var(--gold);
  background: rgba(245,196,81,0.07);
  color: rgba(255,255,255,0.8);
}
.home .homepage-seo table th { background: rgba(255,255,255,0.06); color: #fff; }
.home .homepage-seo table th,
.home .homepage-seo table td { border-color: rgba(255,255,255,0.12); }
.home .homepage-seo tr:hover td { background: rgba(255,255,255,0.04); }
.home .homepage-seo code { background: rgba(255,255,255,0.1); color: var(--gold-soft); }

/* ---- Promotion page (การ์ดโปรโมชั่น) ---- */
.promo-page {
  max-width: 1240px;
  padding-bottom: 60px;
}

.promo-page-head {
  padding: 52px 0 26px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 26px;
}
.promo-page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.promo-page-sub { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

.promo-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.promo-card {
  background: var(--home-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.promo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 196, 81, 0.5);
  box-shadow: 0 14px 34px rgba(0,0,0,0.45), 0 0 22px rgba(245,196,81,0.12);
}

/* tighten the inner columns block */
.promo-card .promo-card-cols { margin: 0; gap: 12px; }
.promo-card .wp-block-column { margin: 0; }

.promo-card-title {
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.promo-card-sub {
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0 6px;
}
.promo-card-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

.promo-card-img { margin: 0; }
.promo-card-img img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.promo-card .wp-block-buttons { margin-top: 16px; }
.promo-card-btn .wp-block-button__link,
.promo-card-btn a {
  background: var(--gold-grad);
  color: #201400;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 20px;
  border-radius: 8px;
}
.promo-card-btn .wp-block-button__link:hover { filter: brightness(1.06); }

@media (max-width: 640px) {
  .promo-page-grid { grid-template-columns: 1fr; }
}

/* Non-home pages keep the clean light theme untouched. */
