*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
body {
  font-family: 'Cinzel', 'MedievalSharp', serif;
  background: #1A1C29;
  color: #E8DCC8;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(212,175,55,0.05) 0%, transparent 70%);
  animation: parchmentBreath 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
  will-change: opacity;
}
@keyframes parchmentBreath {
  0% { opacity: 0.3; }
  100% { opacity: 0.8; }
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.site-header {
  background: #1A1C29;
  padding: 12px 16px;
  border-bottom: 2px solid #D4AF37;
  box-shadow: 0 2px 8px rgba(212,175,55,0.3);
  height: 60px;
  display: flex;
  align-items: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #E8DCC8;
  letter-spacing: 1px;
  transition: all 0.5s ease-in-out;
  text-shadow: 0 0 10px rgba(212,175,55,0.3);
}
.logo:hover {
  color: #D4AF37;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(42,36,21,0.9);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(212,175,55,0.4);
  border: 2px solid #D4AF37;
}
.logo span {
  color: #D4AF37;
  font-weight: 600;
}
@media (max-width: 480px) {
  .logo { font-size: 1rem; }
  .logo-icon { width: 32px; height: 32px; }
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
@media (max-width: 576px) {
  .container {
    padding: 0 8px;
  }
}

.hero-section {
  max-width: 100%;
  max-height: 140px;
  margin: 0 auto;
  padding: 10px 0;
  overflow: hidden;
  box-sizing: border-box;
}
@media (min-width: 577px) {
  .hero-section {
    max-width: 375px;
    padding: 10px;
  }
}
.hero-section .container {
  padding: 0;
  overflow: visible;
}
.hero-grid {
  display: flex;
  gap: 10px;
  height: 120px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 5px;
  scrollbar-width: none;
  max-width: 100%;
  box-sizing: border-box;
}
.hero-grid::-webkit-scrollbar {
  display: none;
}
.hero-card {
  flex: 0 0 auto;
  width: 90px;
  height: 90px;
  background: #2A2415;
  border-radius: 50%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(212,175,55,0.3);
  transition: all 0.5s ease-in-out;
  border: 2px solid #D4AF37;
  text-decoration: none;
  overflow: hidden;
  position: relative;
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,0) 0%, rgba(212,175,55,0) 100%);
  z-index: 3;
  pointer-events: none;
  transition: all 0.5s ease-in-out;
}
.hero-card:hover::before {
  background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, rgba(212,175,55,0) 70%);
  animation: goldenRipple 0.8s ease-out;
}
@keyframes goldenRipple {
  0% { background: radial-gradient(circle, rgba(255,215,0,0.8) 0%, rgba(212,175,55,0) 0%); }
  100% { background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, rgba(212,175,55,0) 70%); }
}
.hero-card:hover {
  border-color: #FFD700;
  box-shadow: 0 0 20px rgba(212,175,55,0.6);
}
.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: none;
}
.hero-card span {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85px;
  z-index: 2;
  transition: color 0.5s ease-in-out;
}
.hero-card:hover span {
  color: #FFD700;
}

.games-section {
  padding: 8px 0 32px;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #D4AF37;
  position: relative;
  display: inline-block;
  padding-left: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(212,175,55,0.3);
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: linear-gradient(180deg, #D4AF37, #7B68EE);
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
}
@media (max-width: 768px) {
  .section-title { font-size: 1.25rem; }
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 16px;
  padding: 5px 0;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 1024px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px)  { .game-grid { grid-template-columns: repeat(3, 1fr); gap: 10px 12px; } }
@media (max-width: 576px)  { .game-grid { grid-template-columns: repeat(2, 1fr); gap: 6px 8px; } }

@media (max-width: 576px) {
  .hero-section {
    max-width: 100%;
    max-height: 140px;
    position: relative;
    overflow: hidden;
  }
  .hero-grid {
    display: flex;
    gap: 8px;
    height: 130px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 5px 0;
  }
  .hero-grid::-webkit-scrollbar { display: none; }
  .hero-card {
    flex: 0 0 auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    scroll-snap-align: center;
  }
  .hero-card img {
    border-radius: 50%;
  }
}

.game-card {
  background: #2A2415;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid #D4AF37;
  box-shadow: 0 2px 8px rgba(212,175,55,0.2);
  transition: all 0.5s ease-in-out;
  cursor: pointer;
  position: relative;
}
@media (max-width: 576px) {
  .game-card {
    border-radius: 3px;
    border-width: 1px;
    overflow: hidden;
  }
}
.game-card::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: conic-gradient(from 0deg, transparent, rgba(212,175,55,0.3), transparent, rgba(123,104,238,0.2), transparent);
  border-radius: inherit;
  z-index: -1;
  animation: magicRotate 6s linear infinite;
  will-change: transform;
}
.game-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-top: 3px solid #D4AF37;
  border-right: 3px solid #D4AF37;
  border-radius: 0 6px 0 0;
  opacity: 0.6;
  pointer-events: none;
  z-index: 3;
}
.game-card:hover {
  transform: translateY(-2px);
  border-color: #FFD700;
  box-shadow: 0 0 20px rgba(212,175,55,0.6);
}
.game-card:active {
  transform: scale(0.98);
}
@keyframes magicRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.game-card-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: rgba(212,175,55,0.05);
  position: relative;
}
.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease-in-out;
  border-radius: 4px 4px 0 0;
  border: 1px solid #D4AF37;
  border-bottom: none;
  position: relative;
  z-index: 2;
}
.game-card:hover .game-card-thumb img {
  transform: scale(1.08);
  filter: brightness(0.85) sepia(0.3);
}
.game-card:hover .game-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(123,104,238,0.15));
  z-index: 3;
  pointer-events: none;
}
.game-card-title {
  padding: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #E8DCC8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  text-shadow: 0 0 5px rgba(212,175,55,0.2);
  position: relative;
  z-index: 2;
}
@media (max-width: 576px) {
  .game-card-title {
    padding: 4px;
    font-size: 0.6rem;
  }
}

.ad-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.detail-wrap {
  display: flex;
  gap: 28px;
  padding: 32px 0;
  flex: 1;
}
.detail-main {
  flex: 7;
  min-width: 0;
}
.detail-sidebar {
  flex: 3;
  min-width: 280px;
  max-width: 360px;
}
@media (max-width: 900px) {
  .detail-wrap { flex-direction: column; }
  .detail-sidebar { max-width: 100%; min-width: 0; }
}

.game-frame-wrap {
  background: #2A2415;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 6px;
  border: 2px solid #D4AF37;
  box-shadow: 0 4px 12px rgba(212,175,55,0.3);
}
.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  aspect-ratio: unset;
  border-radius: 0;
}
.game-frame-wrap.mobile-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  z-index: 9999;
  aspect-ratio: unset;
  border-radius: 0;
}
.game-frame-wrap.mobile-fullscreen .fullscreen-btn {
  display: block;
  z-index: 10;
}
.game-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: relative;
  z-index: 1;
}
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,28,41,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.5s ease-in-out;
  z-index: 3;
}
.game-overlay.hidden { opacity: 0; pointer-events: none; }
.game-overlay-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: brightness(90%) saturate(80%);
}
.play-btn {
  position: relative;
  z-index: 1;
  background: rgba(42,36,21,0.9);
  color: #D4AF37;
  border: 2px solid #D4AF37;
  padding: 18px 36px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.5s ease-in-out;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(212,175,55,0.3);
  text-shadow: 0 0 10px rgba(212,175,55,0.3);
  font-family: 'Cinzel', 'MedievalSharp', serif;
}
.play-btn:hover {
  transform: translateY(-2px);
  background: #2A2415;
  box-shadow: 0 0 20px rgba(212,175,55,0.6);
  border-color: #FFD700;
  color: #FFD700;
}
.play-btn:active {
  transform: scale(0.98);
}

.fullscreen-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: rgba(42,36,21,0.9);
  color: #D4AF37;
  border: 2px solid #D4AF37;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
  transition: all 0.5s ease-in-out;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(212,175,55,0.3);
  font-family: 'Cinzel', 'MedievalSharp', serif;
}
.fullscreen-btn:hover {
  transform: translateY(-1px);
  background: #2A2415;
  border-color: #FFD700;
  color: #FFD700;
}
.game-frame-wrap.playing .fullscreen-btn { display: block; }
.game-frame-wrap.playing .game-overlay { display: none; }
.game-frame-wrap.playing .game-overlay-thumb { display: none; }

@media (max-width: 768px) {
  .game-frame-wrap .fullscreen-btn {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .game-frame-wrap.playing .fullscreen-btn {
    display: block;
  }
}

.game-frame-wrap:fullscreen .fullscreen-btn,
.game-frame-wrap:-webkit-full-screen .fullscreen-btn {
  display: none !important;
}

.detail-title {
  font-size: 1.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #D4AF37;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(212,175,55,0.3);
}
.detail-desc {
  font-size: 1rem;
  color: #E8DCC8;
  line-height: 1.8;
  margin-bottom: 20px;
}
.tips-box {
  background: #3F1B1B;
  border-left: 4px solid #D4AF37;
  padding: 20px;
  margin-top: 16px;
  border-radius: 0 6px 6px 0;
  box-shadow: 0 4px 12px rgba(212,175,55,0.3);
  border: 2px solid #D4AF37;
  border-left: 4px solid #D4AF37;
}
.tips-box h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #D4AF37;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(212,175,55,0.3);
}
.tips-box ul {
  list-style: none;
  padding: 0;
}
.tips-box li {
  font-size: 0.9rem;
  color: #E8DCC8;
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}
.tips-box li::before {
  content: '\2726';
  position: absolute;
  left: 0;
  color: #D4AF37;
  font-size: 0.8rem;
}

.related-section {
  padding: 32px 0;
}
.related-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #D4AF37;
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(212,175,55,0.3);
}
.related-section h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, #D4AF37, #7B68EE);
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 768px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }

.site-footer {
  background: #1A1C29;
  padding: 40px 0;
  margin-top: auto;
  border-top: 2px solid #D4AF37;
  box-shadow: 0 -2px 8px rgba(212,175,55,0.2);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: 0.8rem;
  color: #E8DCC8;
  transition: all 0.5s ease-in-out;
  font-weight: 500;
  padding: 8px 16px;
  position: relative;
  letter-spacing: 1px;
  text-shadow: 0 0 5px rgba(212,175,55,0.2);
}
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #D4AF37;
  transition: all 0.5s ease-in-out;
  transform: translateX(-50%);
  box-shadow: 0 0 5px rgba(212,175,55,0.5);
}
.footer-links a:hover::after {
  width: 80%;
}
.footer-links a:hover {
  color: #D4AF37;
}
.footer-copy {
  font-size: 0.85rem;
  color: #E8DCC8;
  margin-top: 8px;
  letter-spacing: 1px;
}

.info-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 20px;
  flex: 1;
  background: #2A2415;
  margin-top: 32px;
  margin-bottom: 32px;
  border-radius: 6px;
  border: 2px solid #D4AF37;
  box-shadow: 0 4px 12px rgba(212,175,55,0.3);
}
.info-page h1 {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 28px;
  color: #D4AF37;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 15px rgba(212,175,55,0.4);
}
.info-page h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: #D4AF37;
  position: relative;
  padding-left: 16px;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(212,175,55,0.3);
}
.info-page h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: linear-gradient(180deg, #D4AF37, #7B68EE);
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
}
.info-page p {
  font-size: 1rem;
  color: #E8DCC8;
  line-height: 1.9;
  margin-bottom: 16px;
}
.info-page a {
  color: #7B68EE;
  font-weight: 500;
  transition: all 0.5s ease-in-out;
  border-bottom: 2px solid transparent;
  text-shadow: 0 0 5px rgba(123,104,238,0.2);
}
.info-page a:hover {
  border-bottom-color: #7B68EE;
  color: #9B8AFF;
}
.info-page ul {
  list-style: none;
  padding: 0;
}
.info-page li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: #E8DCC8;
  font-size: 1rem;
  line-height: 1.8;
}
.info-page li::before {
  content: '\2726';
  position: absolute;
  left: 4px;
  color: #D4AF37;
  font-size: 0.8rem;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track {
  background: transparent;
  border: none;
}
::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.5);
  border-radius: 4px;
  border: none;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212,175,55,0.7);
}
@media (max-width: 576px) {
  ::-webkit-scrollbar { width: 0; display: none; }
  * { scrollbar-width: none; }
}

@media (max-width: 768px) {
  .info-page { margin: 20px 16px; padding: 32px 20px; }
  .info-page h1 { font-size: 1.8rem; }
  .play-btn { padding: 14px 28px; font-size: 1rem; }
  .detail-title { font-size: 1.5rem; }
}