:root {
  --bg: #1B2838;
  --bg-card: #16202D;
  --bg-secondary: #2A475E;
  --bg-header: #171A21;
  --accent: #66C0F4;
  --accent-hover: #4DA6E0;
  --green: #4CAF50;
  --text: #C6D4DF;
  --text-muted: #8BA0B4;
  --border: #2A475E;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

a { color: inherit; }

/* ── Header ── */
header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo img { border-radius: 6px; }
nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 16px;
  transition: color 0.15s;
}
nav a:hover { color: var(--text); }

/* ── Our Sites Bar ── */
.our-sites-bar {
  justify-content: center;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 7px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.our-sites-bar::-webkit-scrollbar { display: none; }
.our-sites-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.our-sites-links {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.our-sites-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.our-sites-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1B2838 0%, #2A475E 60%, #1B2838 100%);
  padding: 52px 20px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}
.hero p {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 24px;
}
.hero-install-btn {
  background: var(--accent);
  color: #1B2838;
  border: none;
  padding: 10px 26px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.hero-install-btn:hover { background: var(--accent-hover); }

/* ── Main ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ── Tabs ── */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 22px;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Games Grid ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ── Game Card ── */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.card-image {
  position: relative;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  aspect-ratio: 460 / 215;
  object-fit: cover;
  display: block;
  background: var(--bg-secondary);
}
.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--green);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}
.free-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #1B2838;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}
.card-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.price-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.original-price {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.final-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green);
}
.final-price.is-free { color: var(--accent); }
.platform-icons {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Loading ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-muted);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ── */
.error-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-muted);
  text-align: center;
}
.error-state button {
  background: var(--accent);
  color: #1B2838;
  border: none;
  padding: 9px 22px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ── Data Source Note ── */
.data-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 36px;
}

/* ── No Data ── */
.no-data {
  color: var(--text-muted);
  text-align: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

/* ── Footer ── */
footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 36px 20px 24px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.footer-links h4 {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.footer-links a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 7px;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.7;
}

/* ── PWA Banner ── */
.pwa-banner {
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 2px solid var(--accent);
  padding: 14px 20px;
  z-index: 1000;
  transition: bottom 0.35s cubic-bezier(.22,.68,0,1.2);
}
.pwa-banner.show { bottom: 0; }
.pwa-banner-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pwa-banner-content > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pwa-banner-content strong { color: #fff; font-size: 0.9rem; }
.pwa-banner-content span { font-size: 0.78rem; color: var(--text-muted); }
.pwa-install-btn {
  background: var(--accent);
  color: #1B2838;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.pwa-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
}

/* ── About / Privacy pages ── */
.page-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.page-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 24px;
}
.page-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 32px 0 12px;
}
.page-content p, .page-content li {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.75;
}
.page-content ul { padding-left: 20px; }
.page-content li { margin-bottom: 6px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.45rem; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .tab-btn { font-size: 0.85rem; padding: 9px 14px; }
  .footer-inner { gap: 28px; }
}
@media (max-width: 480px) {
  .games-grid { grid-template-columns: 1fr 1fr; }
  .tab-btn { padding: 8px 10px; font-size: 0.8rem; }
  .hero h1 { font-size: 1.25rem; }
}
