/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #f97316;
  --primary-light: #fdba74;
  --primary-dark: #ea580c;
  --bg: #ffffff;
  --bg-gray: #f8f9fa;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --header-height: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-gray);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.logo:hover { color: var(--primary); }
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}
.logo-text { color: var(--text); }
.logo-text span { color: var(--primary); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.main-nav a:hover, .main-nav a.active {
  background: var(--primary);
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.hero h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin: 16px auto 0;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Sections ===== */
.section { margin-bottom: 48px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.view-all {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.view-all:hover { color: var(--primary-dark); }

.section-desc {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 1rem;
}

/* ===== Game Grid ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ===== Game Card ===== */
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  color: var(--text);
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.game-card-img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #f0f0f0;
}
.game-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.game-card:hover .game-card-img img { transform: scale(1.05); }

.game-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-card-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.game-card-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card-info p {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.game-rating {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
}
.game-category {
  background: var(--bg-gray);
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== Game Detail ===== */
.game-detail { margin-bottom: 48px; }

.game-detail-header {
  margin-bottom: 24px;
}
.game-detail-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.game-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Detail page top section */
.game-detail-top {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}
.game-detail-cover {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f0f0f0;
}
.game-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/10;
}
.game-detail-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.game-detail-info h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.game-detail-desc {
  color: var(--text-light);
  line-height: 1.7;
  margin: 16px 0 20px;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-date {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.play-now-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 14px 40px;
  border-radius: 50px;
  transition: all 0.3s;
  text-align: center;
  width: fit-content;
  box-shadow: 0 4px 16px rgba(249,115,22,0.3);
}
.play-now-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(249,115,22,0.4);
}
.game-detail-tags {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.game-detail-tags span {
  background: var(--bg-gray);
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* Play page */
.play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.play-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
}
.back-to-detail {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  transition: all 0.2s;
}
.back-to-detail:hover {
  background: var(--primary);
  color: #fff;
}

.game-frame-wrapper {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}
.game-frame-wrapper iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}
.fullscreen-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
  z-index: 10;
}
.fullscreen-btn:hover { background: var(--primary); }

.game-detail-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.game-detail-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.game-detail-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text);
}
.game-detail-content p {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 12px;
}
.game-detail-content ul {
  padding-left: 24px;
  margin-bottom: 12px;
}
.game-detail-content li {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 6px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* ===== Page Content (Privacy, About, Contact) ===== */
.page-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  margin-bottom: 48px;
}
.page-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.page-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
}
.page-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}
.page-content p {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 12px;
}
.page-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}
.page-content li {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 6px;
}
.last-updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* ===== Contact Cards ===== */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.contact-card {
  background: var(--bg-gray);
  border-radius: var(--radius-sm);
  padding: 24px;
  border: 1px solid var(--border);
}
.contact-card h3 { margin-top: 0; }
.contact-email {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  font-size: 1rem;
}

/* ===== FAQ ===== */
.faq { margin-top: 16px; }
.faq-item {
  background: var(--bg-gray);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.faq-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.faq-item p {
  margin: 0;
  font-size: 0.9rem;
}

/* ===== SEO Content ===== */
.seo-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.seo-content h2 {
  margin-top: 0;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--text);
  color: #d1d5db;
  padding: 48px 0 0;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h3 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.footer-col p {
  font-size: 0.85rem;
  line-height: 1.7;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #d1d5db; font-size: 0.85rem; }
.footer-col a:hover { color: var(--primary-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  text-align: center;
  font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }

  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.95rem; }

  .game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  .game-frame-wrapper iframe { height: 400px; }

  .page-content { padding: 24px; }
  .game-detail-content { padding: 20px; }

  .game-detail-top {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
  .game-detail-cover img {
    aspect-ratio: 16/9;
  }
}

@media (max-width: 480px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .game-card-info { padding: 10px; }
  .game-card-info h3 { font-size: 0.85rem; }
  .game-card-info p { display: none; }
  .game-frame-wrapper iframe { height: 300px; }
}
