:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --text: #000000;
  --muted: #6b7280;
  --accent: #0ea5a0;
  --accent-dark: #047857;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --transition: 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* HEADER */
header.top {
  background: var(--card);
  padding: 14px 20px;
  box-shadow: var(--shadow);
}

header.top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

header.top .logo {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 18px;
}

/* NAVBAR */
header.top .nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-bar {
  display: flex;
  gap: 6px;
}

.search-bar input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  min-width: 200px;
}

.search-bar button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.search-bar button:hover {
  background: var(--accent-dark);
}

/* HERO LINKS */
.hero {
  display: flex;
  gap: 14px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.hero a {
  background: var(--card);
  padding: 8px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 500;
  color: var(--accent);
  transition: var(--transition);
}

.hero a:hover {
  background: var(--accent);
  color: #fff;
}

/* FOOTER */
footer {
  background: var(--card);
  padding: 20px;
  text-align: center;
  color: var(--muted);
  margin-top: 40px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

footer a {
  color: var(--accent);
  margin: 0 6px;
  font-weight: 500;
}

/* WRAPPER */
.wrap {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 16px;
}

/* GRID (apps on homepage) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

/* CARD */
.card {
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.card:hover {
  transform: translateY(-3px);
}

.thumb {
  width: 60px;
  height: 60px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 20px;
  color: #fff;
}

.meta { flex: 1; }
.meta h3 { margin: 0; font-size: 16px; }
.meta p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ACTION BUTTONS */
.actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

a.down {
  background: linear-gradient(180deg, var(--accent), #00b894);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
}

a.ghost {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
}

.small {
  font-size: 12px;
  padding: 5px 10px;
}

/* APP DETAIL PAGE */
.app-detail {
  margin-top: 24px;
}

.detail-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius);
  align-items: center;
  box-shadow: var(--shadow);
}

.detail-thumb {
  width: 100px;
  height: 100px;
  border-radius: 18px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
}

.detail-info { flex: 1; }
.detail-info h1 { margin: 0; font-size: 22px; }
.detail-meta { color: var(--muted); font-size: 14px; margin: 4px 0; }

.download-btn {
  background: linear-gradient(180deg, var(--accent), #00b894);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  display: inline-block;
  margin-top: 10px;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.download-btn:hover {
  background: linear-gradient(180deg, #06b6d4, #10d3b8);
}

/* SECTIONS */
.section {
  margin-top: 20px;
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.info-table div {
  margin-bottom: 6px;
  font-size: 14px;
}

/* SCREENSHOT CAROUSEL */
.screenshots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.screenshots img {
  height: 300px;
  border-radius: var(--radius);
  flex-shrink: 0;
  scroll-snap-align: start;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.screenshots img:hover {
  transform: scale(1.03);
}

/* SECTION TITLES */
.section-title {
  font-size: 18px;
  margin: 20px 0 12px;
}

/* ✅ RESPONSIVE FIXES */
@media (max-width: 768px) {
  /* NAV STACK */
  header.top .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .search-bar {
    width: 100%;
  }

  .search-bar input {
    flex: 1;
    min-width: auto;
    width: 100%;
  }

  .search-bar button {
    flex-shrink: 0;
  }

  /* HERO */
  .hero {
    gap: 10px;
    justify-content: flex-start;
  }

  .hero a {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
  }

  /* GRID CARDS */
  .grid {
    grid-template-columns: 1fr;
  }

  .card {
    flex-direction: row;
    align-items: center;
  }

  .thumb {
    width: 50px;
    height: 50px;
  }

  .meta h3 { font-size: 14px; }
  .meta p { font-size: 12px; }

  .actions {
    flex-direction: column;
    gap: 4px;
  }

  a.down.small, a.ghost.small {
    font-size: 12px;
    padding: 5px 8px;
  }
}

@media (max-width: 480px) {
  .hero a {
    flex: 1 1 100%;
  }

  .screenshots img {
    height: 160px;
  }

  .detail-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-thumb {
    width: 70px;
    height: 70px;
    font-size: 16px;
  }
}
