/* Reset & body */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-top: 72px;
  padding-bottom: 89px;
  background: #f4f4f4;
  font-family: Arial, sans-serif;
}

/* Fixed header */
.fixed-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
}

.topbar {
  background: #c1121f;
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  height: 50px;
  object-fit: contain;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.btn-register,
.btn-login {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
}

.btn-register { background: #ffd700; color: #222; }
.btn-login { background: #222; color: #fff; }

/* Menu bar */
.menu-bar {
  background: #777;
  padding: 3px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-links{
  display:flex;
  flex-wrap:nowrap;
  overflow-x:auto;
  scrollbar-width:none;
}

.menu-links::-webkit-scrollbar{
  display:none;
}

.provider-btn {
  border: none;
  background: transparent;
  color: white;
  font-weight: bold;
  cursor: pointer;
  padding: 8px 10px;

  display: flex;
  align-items: center;
  gap: 6px;
}

.provider-logo {
  display: none;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.provider-btn.active .provider-logo {
  display: block;
}

.provider-btn.active,
.provider-btn:hover {
  color: #ffd700;
}

.provider-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.provider-article {
  max-width: 1050px;
  margin: 50px auto;
  padding: 40px 50px;
}

.hero-provider-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-provider-link img {
  width: 144px;
  height: auto;
  border-radius: 12px;
  transition: transform .2s ease;
}

.hero-provider-link:hover img {
  transform: scale(1.05);
}

/* Hero */
.hero {
  min-height: 320px;
  background: #c1121f;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px 30px 20px; /* account for fixed header */
}

.hero h1 { font-size: 42px; margin: 0 0 10px; }

/* Games section */
.games {
  padding: 20px;
  margin-top: 20px;
  padding-bottom: 34px;
}

.game-search-area {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.search-box {
  width: 300px;
  padding: 10px 15px;
  border-radius: 25px;
  border: none;
  outline: none;
}
.pdf-feature-card {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 30px;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
}

.pdf-feature-card img {
  width: 100%;
  display: block;
  border-radius: 14px;
  cursor: pointer;
}

.faq-list {
  display: grid;
  gap: 14px;
  margin-bottom: 30px;
}

.faq-item {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.faq-item h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.faq-item p {
  margin: 0;
  line-height: 1.7;
}

/* Game cards */
.game-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  max-width: 1200px;
  margin: auto;
}

.game-card {
  background: white;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 5px 18px rgba(0,0,0,.08);
  overflow: hidden;
  box-sizing: border-box;
}

.game-card img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 20px;
  display: block;
  margin: 0 auto;
}

.game-card h3 {
  color: #c1121f;
  margin: 10px 0 6px;
}

.card-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-play {
  background: #ffd700;
  color: #c1121f;
  border: none;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}

.btn-play:hover { background: #ffcc00; }

/* Footer fixed */
.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 999;
}

.footer {
  background: #c40018;
  padding: 14px 12px;
}

.footer-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.footer-btn {
  background: #ffd000;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  padding: 11px 6px;
  border-radius: 12px;
  transition: .3s;
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.footer-btn:hover { 
  transform: translateY(-3px);
  background: #ffdf4d;
}

/* =========================
   Game Detail Page
========================= */

.detail-hero {
  min-height: 620px;
  background-size: cover;
  background-position: center;
  position: relative;
  margin-top: 0;
}

.detail-hero-overlay {
  min-height: 620px;
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.78),
    rgba(0,0,0,.35)
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 50px;
  overflow: hidden;
  position: relative;
}

.detail-hero-text {
  max-width: 620px;
  color: #fff;
  z-index: 2;
}

.detail-game-logo {
  max-width: 360px;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin-bottom: 18px;
}

.detail-hero-text h1 {
  font-size: 48px;
  margin: 0 0 15px;
}

.detail-hero-text p {
  font-size: 18px;
  line-height: 1.8;
}

.detail-character-img {
  max-width: 42%;
  max-height: 560px;
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,.45));
}

.game-main-play {
  background: linear-gradient(135deg, #ffd700, #ff9f00);
  color: #8b0000;
  border: none;
  padding: 16px 30px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}

.game-main-play:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ffe45c, #ffb300);
}

.game-main-play.disabled {
  background: #999;
  color: #fff;
  cursor: not-allowed;
}

.detail-info-row {
  max-width: 1050px;
  margin: -45px auto 30px;
  padding: 0 20px;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.detail-info-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.13);
}

.detail-info-card span {
  display: block;
  color: #777;
  margin-bottom: 8px;
}

.detail-info-card strong {
  color: #c1121f;
  font-size: 22px;
}

.detail-content {
  max-width: 1150px;
  margin: 0 auto 120px;
  background: #fff;
  padding: 36px;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.detail-content h2 {
  color: #c1121f;
  margin-top: 30px;
}

.detail-content p,
.detail-content li {
  line-height: 1.85;
  font-size: 16px;
}

.feature-list {
  padding-left: 22px;
}

.detail-screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.detail-screenshot-grid img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(0,0,0,.12);
  transition: .25s;
  cursor: pointer;
}

.detail-screenshot-grid img:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
}

.detail-screenshot-grid img:active {
  transform: scale(.98);
}

.detail-symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}

.detail-symbol-grid img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  background: #f7f7f7;
  border-radius: 14px;
  padding: 10px;
}

.detail-play-bottom {
  text-align: center;
  margin-top: 40px;
}

.game-not-found {
  min-height: 70vh;
  padding-top: 180px;
  text-align: center;
}

.game-iframe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  z-index: 99998;
}

.iframe-close {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 99999;
  background: #c1121f;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

@media (max-width: 768px) {
  body {
    padding-top: 72px;
  }

  .detail-hero {
    margin-top: 0 !important;
  }


  .detail-hero-overlay {
    flex-direction: column;
    text-align: center;
    padding: 35px 20px;
  }

  .detail-hero-text h1 {
    font-size: 36px;
  }

  .detail-character-img {
    max-width: 90%;
    margin-top: 25px;
  }

  .detail-info-row {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .detail-content {
    margin: 0 15px 120px;
    padding: 24px;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 99997;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}

.lightbox img {
  max-width: 95%;
  max-height: 90%;
  border-radius: 16px;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  background: #c1121f;
  color: white;
  padding: 10px 15px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  z-index: 99998;
}


.related-games {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap: 20px;
  margin-top: 20px;
}

.related-card {
  cursor: pointer;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px 16px rgba(0,0,0,.1);
  transition: transform .25s ease,
              box-shadow .25s ease;
}

.related-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.related-card a {
  text-decoration: none;
  color: inherit;
}

.related-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: transform .35s ease;
}

.related-card:hover img {
  transform: scale(1.06);
}

.related-card h3 {
  padding: 12px;
  font-size: 15px;
  text-align: center;
  color: #c1121f;
  transition: color .25s ease;
}

.related-card:hover h3 {
  color: #ff9800;
}


/* =========================
   Hero Symbols ใต้ปุ่ม
========================= */

.hero-symbols{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:20px;
  align-items:center;
}

.hero-symbol{
  width:60px;
  height:60px;
  object-fit:contain;
  animation:float 3s ease-in-out infinite;
  filter:drop-shadow(0 8px 15px rgba(0,0,0,.3));
}

.hero-symbol:nth-child(2){ animation-delay:.4s; }
.hero-symbol:nth-child(3){ animation-delay:.8s; }
.hero-symbol:nth-child(4){ animation-delay:1.2s; }
.hero-symbol:nth-child(5){ animation-delay:1.6s; }

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

/* =========================
   Hero ใหม่: ใช้ Game Icon + Symbols + PDF Page 2
   แทน Logo / Character ที่บางเกมมีพื้นหลังดำหรือเขียว
========================= */

.detail-game-logo,
.detail-character-img {
  display: none !important;
}

.hero-icon-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.detail-app-icon {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 30px;
  box-shadow: 0 14px 35px rgba(0,0,0,.38);
  background: rgba(255,255,255,.12);
}

.hero-icon-stack .hero-symbols {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  align-items: center;
  justify-content: center;
  max-width: 360px;
}

.hero-icon-stack .hero-symbol {
  width: 54px;
  height: 54px;
  object-fit: contain;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 15px rgba(0,0,0,.35));
}

.hero-pdf-preview {
  width: 330px;
  max-width: 38%;
  background: rgba(255,255,255,.96);
  border-radius: 24px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.38);
  text-align: center;
  z-index: 2;
}

.hero-pdf-preview img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
  border-radius: 16px;
  cursor: zoom-in;
}

.hero-pdf-preview span {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: #555;
  font-weight: 700;
}

@media (max-width: 768px) {
  .detail-hero,
  .detail-hero-overlay {
    min-height: auto;
  }

  .detail-hero-overlay {
    flex-direction: column;
    gap: 24px;
    text-align: center;
    padding: 34px 18px 42px;
  }

  .detail-app-icon {
    width: 118px;
    height: 118px;
    border-radius: 24px;
  }

  .hero-icon-stack .hero-symbols {
    max-width: 300px;
    gap: 8px;
  }

  .hero-icon-stack .hero-symbol {
    width: 44px;
    height: 44px;
  }

  .hero-pdf-preview {
    width: 100%;
    max-width: 420px;
    padding: 12px;
  }

  .hero-pdf-preview img {
    max-height: 420px;
  }
}


.detail-app-icon {
  animation: heroFloat 3.5s ease-in-out infinite;
  will-change: transform;
}

.hero-pdf-preview {
  will-change: auto;
}

.hero-symbol:nth-child(1){
  animation: float 2.8s ease-in-out infinite;
}

.hero-symbol:nth-child(2){
  animation: float 3.3s ease-in-out infinite;
}

.hero-symbol:nth-child(3){
  animation: float 2.5s ease-in-out infinite;
}

.hero-symbol:nth-child(4){
  animation: float 3.8s ease-in-out infinite;
}

.hero-symbol:nth-child(5){
  animation: float 3.1s ease-in-out infinite;
}

@keyframes heroFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}
.detail-app-icon {
  cursor: pointer;
  transition: filter .25s ease;
}

.detail-app-icon:hover {
  filter: brightness(.9);
}

/* =========================
   Game Insights
========================= */

.game-insights-panel {
  background: linear-gradient(180deg, #fff, #fff8f0);
  border-radius: 22px;
  padding: 26px;
  margin-bottom: 32px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border: 1px solid rgba(193,18,31,.08);
}

.game-insights-header h2 {
  margin: 0 0 8px;
  color: #c1121f;
}

.game-insights-header p {
  margin: 0 0 20px;
  color: #555;
  line-height: 1.75;
}

.game-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.game-insight-box {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 5px 16px rgba(0,0,0,.07);
}

.game-insight-box h3 {
  margin: 0 0 12px;
  color: #c1121f;
  font-size: 20px;
}

.game-insight-box ul {
  margin: 0;
  padding-left: 20px;
}

.game-insight-box li {
  margin-bottom: 8px;
  line-height: 1.75;
}

.game-insight-meta {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.game-insight-tags,
.game-special-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.game-insight-tag,
.game-special-feature {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.game-insight-tag {
  background: #ffe8e8;
  color: #b00016;
}

.game-special-feature {
  background: #fff1c1;
  color: #7a4a00;
}

@media (max-width: 768px) {
  .game-insights-panel {
    padding: 20px;
  }

  .game-insights-grid {
    grid-template-columns: 1fr;
  }
}

.insights-section{
    margin:20px 0;
    padding:20px;
    background:#1a1a1a;
    border-radius:12px;
}

.insights-section h2{
    margin-bottom:12px;
    font-size:20px;
}

.insights-list{
    list-style:none;
    padding:0;
    margin:0;
}

.insights-list li{
    padding:8px 0;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.insights-list li:last-child{
    border-bottom:none;
}
/* =========================
   v9.1 Game Insights Premium
========================= */

.game-insights-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 30px;
}

.insight-card {
  background: linear-gradient(135deg, #fffaf0, #ffffff);
  border: 1px solid rgba(193, 18, 31, .12);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}

.insight-card-head h2 {
  margin: 0 0 16px;
  color: #c1121f;
  font-size: 22px;
}

.insight-chip-list {
  display: grid;
  gap: 10px;
}

.insight-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(193,18,31,.05);
  border: 1px solid rgba(193,18,31,.08);
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.65;
  color: #222;
  font-size: 15px;
}

.insight-chip-icon {
  width: 26px;
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.insight-highlights {
  border-top: 5px solid #ffd700;
}

.insight-players {
  border-top: 5px solid #c1121f;
}

@media (max-width: 768px) {
  .game-insights-wrap {
    grid-template-columns: 1fr;
  }

  .insight-card {
    padding: 18px;
    border-radius: 18px;
  }

  .insight-card-head h2 {
    font-size: 20px;
  }
}

.related-reason {
  margin: -4px 10px 12px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 215, 0, .18);
  color: #8b0000;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.community-card{
    background:#fff;
    border-radius:20px;
    padding:24px;
    margin-bottom:24px;

    box-shadow:0 8px 24px rgba(0,0,0,.08);
}

.community-card h2{
    margin-bottom:16px;
    color:#c1121f;
}

.community-score{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:20px;
}

.community-rating{
    font-size:42px;
    font-weight:700;
    color:#c1121f;
}

.community-rating span{
    font-size:18px;
    color:#777;
}

.community-meta{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.community-tags h3{
    margin-bottom:12px;
}

.community-tag-list{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.community-tag{
    background:#fff3cd;
    border:1px solid #ffe08a;
    border-radius:999px;
    padding:8px 12px;
    font-size:14px;
    font-weight:600;
}

@media(max-width:768px){

    .community-score{
        flex-direction:column;
        align-items:flex-start;
    }

    .community-rating{
        font-size:34px;
    }

}