/* 3 Patti All APK - Mobile-first, fast */
:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --radius: 12px;
  --font: 'Outfit', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid rgba(15,23,42,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--accent); }
.header-search {
  flex: 1;
  min-width: 180px;
  display: flex;
  gap: 8px;
}
.header-search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(148,163,184,.5);
  border-radius: var(--radius);
  background: #f9fafb;
  color: var(--text);
  font: inherit;
}
.header-search input::placeholder { color: var(--muted); }
.header-search button {
  padding: 10px 18px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
.header-search button:hover { background: var(--accent-hover); color: #fff; }
.nav-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nav-cats a {
  padding: 6px 12px;
  border-radius: 8px;
  background: #e5e7eb;
  font-size: 0.9rem;
  color: var(--muted);
}
.nav-cats a:hover { background: rgba(245,158,11,.2); color: var(--accent); text-decoration: none; }
.ad-block { padding: 8px 16px; text-align: center; min-height: 50px; }
.ad-header, .ad-footer { max-width: 1200px; margin: 0 auto; }

/* Page container */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }

/* Game grid - 20 on home */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}
@media (min-width: 600px) {
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
.game-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.25);
  transition: transform .2s, box-shadow .2s;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(15,23,42,.15);
  border-color: rgba(245,158,11,.4);
}
.game-card a { text-decoration: none; color: inherit; display: block; }
.game-card a:hover { text-decoration: none; }
.game-card .thumb {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  background: #e5e7eb;
}
.game-card .info { padding: 12px; }
.game-card .name { font-weight: 600; font-size: 1rem; margin: 0 0 4px; color: var(--text); }
.game-card .cat { font-size: 0.8rem; color: var(--muted); }

/* Single game page */
.game-single .game-hero {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
}
@media (min-width: 640px) {
  .game-single .game-hero { grid-template-columns: 200px 1fr; }
}
.game-single .icon-wrap {
  width: 160px;
  height: 160px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.game-single .icon-wrap img { width: 100%; height: 100%; object-fit: cover; }
.game-single h1 { margin: 0 0 8px; font-size: 1.75rem; }
.game-single .rating-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.stars { color: var(--accent); font-size: 1.25rem; letter-spacing: 2px; }
.stars .filled { color: var(--accent); }
.stars .empty { color: var(--muted); opacity: .5; }
.rating-text { color: var(--muted); font-size: 0.9rem; }
.btn-download {
  display: inline-block;
  padding: 14px 28px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}
.btn-download:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.screenshots img { border-radius: 8px; width: 100%; height: auto; }
.article-content {
  margin: 24px 0;
  line-height: 1.7;
  color: var(--text);
}
.article-content h2, .article-content h3 { margin: 1em 0 0.5em; }
.article-content p { margin: 0 0 1em; }
.article-content ul, .article-content ol { margin: 0 0 1em; padding-left: 1.5em; }

/* Comments */
.comments-section { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(148,163,184,.3); }
.comments-section h3 { margin: 0 0 16px; }
.comment-form label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 0.9rem; }
.comment-form input, .comment-form textarea {
  width: 100%;
  max-width: 400px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(148,163,184,.5);
  border-radius: 8px;
  background: #f9fafb;
  color: var(--text);
  font: inherit;
}
.comment-form textarea { min-height: 100px; resize: vertical; }
.comment-list { margin-top: 24px; }
.comment-item {
  background: var(--card);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(148,163,184,.25);
}
.comment-item .author { font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.comment-item .date { font-size: 0.8rem; color: var(--muted); }
.comment-item .body { margin-top: 8px; }

/* Related games */
.related-section { margin-top: 40px; }
.related-section h3 { margin: 0 0 16px; }
.related-section .game-grid { margin-top: 0; }

/* Category / Search page title */
.page-title { margin: 0 0 24px; font-size: 1.5rem; }
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
  justify-content: center;
}
.pagination a, .pagination span {
  padding: 10px 16px;
  background: var(--card);
  border-radius: 8px;
  color: var(--text);
}
.pagination a:hover { background: var(--accent); color: #000; text-decoration: none; }
.pagination .current { background: var(--accent); color: #000; }

/* Footer */
.site-footer {
  background: var(--card);
  border-top: 1px solid rgba(148,163,184,.25);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  text-align: center;
}
.footer-inner > a { font-weight: 700; font-size: 1.1rem; }
.footer-inner p { color: var(--muted); font-size: 0.9rem; margin: 8px 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 16px 0; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.copy { font-size: 0.85rem; opacity: .8; }

/* Breadcrumb */
.breadcrumb { margin-bottom: 16px; font-size: 0.9rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }

/* Admin */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
.admin-header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 24px; border-bottom: 1px solid rgba(148,163,184,.35); padding-bottom: 16px; }
.admin-header a { color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(148,163,184,.25); }
th { background: #f9fafb; font-weight: 600; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; font: inherit; cursor: pointer; border: none; text-decoration: none; }
.btn-primary { background: var(--accent); color: #000; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; max-width: 400px; padding: 10px; border: 1px solid rgba(148,163,184,.5); border-radius: 8px; background: #f9fafb; color: var(--text); }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-success { background: rgba(34,197,94,.2); color: #86efac; }
.alert-error { background: rgba(239,68,68,.2); color: #fca5a5; }
