:root {
  --bg: #0b0f14;
  --bg-card: #141b24;
  --bg-card-hover: #1a2430;
  --text: #f0f4f8;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --border: rgba(148, 163, 184, 0.12);
  --free: #22c55e;
  --ads: #f59e0b;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.18), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
}

.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

.site-header {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

.logo {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.contact-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.contact-link:hover {
  text-decoration: underline;
}

.section {
  margin: 2.5rem 0 3rem;
}

.section-title {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.app-grid.featured {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}

.app-card-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.app-icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.app-icon-img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.app-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.app-icon-fallback {
  position: absolute;
  inset: 0;
}

.app-icon-fallback[hidden] {
  display: none !important;
}

.app-icon.lyriq { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.app-icon.fridge-friend { background: linear-gradient(135deg, #06b6d4, #22c55e); }
.app-icon.duck-hunting { background: linear-gradient(135deg, #f97316, #ef4444); }
.app-icon.alphasnake { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.app-icon.bacattack { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.app-icon.doughnuts { background: linear-gradient(135deg, #f59e0b, #f97316); }

.app-info {
  min-width: 0;
}

.app-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.app-tagline {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-free {
  background: rgba(34, 197, 94, 0.15);
  color: var(--free);
}

.badge-ads {
  background: rgba(245, 158, 11, 0.15);
  color: var(--ads);
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: auto;
}

.store-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}

.store-link:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(99, 102, 241, 0.5);
}

.store-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.site-footer {
  padding: 2rem 0 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.loading,
.error {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.error {
  color: #f87171;
}

@media (max-width: 600px) {
  .app-grid,
  .app-grid.featured {
    grid-template-columns: 1fr;
  }
}
