/* 3Patti Games - Mobile First, 100% mobile friendly */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --color-bg: #0f0f14;
  --color-card: #1a1a24;
  --color-primary: #e8b923;
  --color-text: #e8e8e8;
  --color-muted: #888;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --header-h: 56px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-card);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.search-form {
  flex: 1;
  min-width: 120px;
  display: flex;
  gap: 8px;
}
.search-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.95rem;
}
.search-form button {
  padding: 8px 14px;
  background: var(--color-primary);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.main-nav {
  display: flex;
  gap: 12px;
}
.main-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--color-primary); }
.ad-header, .ad-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  min-height: 50px;
  text-align: center;
}

/* Main */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
  width: 100%;
}

/* Game grid - mobile first */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (min-width: 480px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 600px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .games-grid { grid-template-columns: repeat(4, 1fr); }
}

.game-card {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}
.game-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}
.game-card .thumb {
  aspect-ratio: 1;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.game-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-card .info {
  padding: 12px;
}
.game-card .info h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card .stats {
  font-size: 0.8rem;
  color: var(--color-muted);
}
.game-card.vip .thumb { border: 2px solid var(--color-primary); }
.game-card.vip .thumb::after {
  content: 'VIP';
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--color-primary);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.game-card .thumb { position: relative; }

/* Single game page */
.game-single .game-hero {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}
@media (min-width: 600px) {
  .game-single .game-hero { grid-template-columns: 200px 1fr; }
}
.game-single .game-icon {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--color-card);
}
.game-single .game-meta h1 { margin: 0 0 8px; font-size: 1.5rem; }
.game-single .game-meta .version { color: var(--color-muted); font-size: 0.9rem; }
.game-single .game-content {
  background: var(--color-card);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.game-single .game-content h2 { font-size: 1.2rem; margin-top: 1em; }

/* Download section - 8 sec timer */
.download-section {
  background: var(--color-card);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  text-align: center;
}
.download-timer {
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.download-btn {
  display: inline-block;
  padding: 14px 28px;
  background: var(--color-primary);
  color: #000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: opacity 0.2s;
}
.download-btn:disabled, .download-btn.hidden {
  opacity: 0.5;
  pointer-events: none;
}

/* Comments */
.comments-section {
  background: var(--color-card);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.comments-section h2 { margin: 0 0 16px; font-size: 1.2rem; }
.comment-form label { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.comment-form input, .comment-form textarea {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: var(--color-bg);
  color: var(--color-text);
}
.comment-form textarea { min-height: 80px; resize: vertical; }
.comment-list { margin-top: 20px; }
.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.comment-item:last-child { border-bottom: none; }
.comment-author { font-weight: 600; font-size: 0.9rem; }
.comment-date { font-size: 0.8rem; color: var(--color-muted); }
.comment-text { margin-top: 4px; }

/* Related games */
.related-games h2 { margin: 0 0 16px; font-size: 1.2rem; }
.related-games .games-grid { margin-top: 0; }

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 10px 16px;
  background: var(--color-card);
  color: var(--color-text);
  text-decoration: none;
  border-radius: 8px;
  min-width: 44px;
  text-align: center;
}
.pagination a:hover { background: var(--color-primary); color: #000; }
.pagination .current { background: var(--color-primary); color: #000; font-weight: 600; }
.pagination .disabled { opacity: 0.5; pointer-events: none; }

/* Footer */
.site-footer {
  background: var(--color-card);
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: auto;
  padding: 20px 16px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.footer-inner p { margin: 0 0 8px; color: var(--color-muted); font-size: 0.9rem; }
.footer-nav { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.footer-nav a { color: var(--color-muted); text-decoration: none; }
.footer-nav a:hover { color: var(--color-primary); }

/* Page title */
.page-title { margin: 0 0 20px; font-size: 1.5rem; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--color-muted); }

/* Admin - keep same theme, forms */
input, textarea, select, button {
  font-family: inherit;
  font-size: 1rem;
}
.btn {
  display: inline-block;
  padding: 10px 18px;
  background: var(--color-primary);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary { background: var(--color-muted); color: #fff; }
.btn-danger { background: #c0392b; color: #fff; }
