:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #0f172a;
  --accent-brand: #059669;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-link {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  overflow-x: auto;
}
.main-nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text); }
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.search-bar input {
  height: 38px;
  width: 210px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}
.search-bar button {
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Main */
.page-main { padding: 28px 0 56px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h1, .section-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.section-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Category strip */
.cat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.cat-tab {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.cat-tab:hover, .cat-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Game Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease;
}
.game-card:hover { border-color: #94a3b8; }
.game-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.game-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.game-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.game-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.game-summary {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Game Detail Page */
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.game-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.game-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.game-hero-icon {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  flex-shrink: 0;
}
.game-hero h1 {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.2;
}
.btn-playstore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  background: var(--accent-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
}
.btn-playstore:hover { filter: brightness(0.95); }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.article-box, .sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.article-box h2, .article-box h3 { margin-top: 20px; margin-bottom: 8px; }
.article-box h2:first-child { margin-top: 0; }
.article-box p { color: #334155; font-size: 15px; line-height: 1.75; }

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.specs-table th, .specs-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.specs-table th { color: var(--muted); font-weight: 500; }
.specs-table td { font-weight: 600; text-align: right; }

.screenshots-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.screenshots-row img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Guides */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.guide-card h3 { margin: 6px 0 8px; font-size: 17px; line-height: 1.35; }
.guide-card p { margin: 0; font-size: 14px; color: var(--muted); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}
.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* AdSense Container */
.ad-slot-wrap {
  margin: 20px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}
.ad-label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 6px;
}

/* Forms */
.form-stack label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-stack input, .form-stack textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 14px;
}
.form-stack button {
  height: 42px;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.alert-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 36px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
}
.footer-links { list-style: none; padding: 0; margin: 8px 0 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 860px) {
  .detail-grid, .footer-grid { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .search-bar { width: 100%; }
  .search-bar input { flex: 1; }
}
