* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0b0f17;
  color: #f2f2f2;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
}

/* INDEX PAGE */

.topbar {
  background: #111827;
  border-bottom: 1px solid #232b38;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar nav {
  display: flex;
  gap: 16px;
}

.topbar nav a {
  color: #c7cfdd;
}

.hero {
  padding: 32px 0 20px;
}

.hero h2 {
  margin: 0 0 8px;
  font-size: 38px;
}

.hero p {
  margin: 0;
  color: #9eabc0;
}

.featured-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.featured-tab {
  background: #d9d9d9;
  color: #1b1b1b;
  padding: 16px 18px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
}

.featured-tab.active {
  background: #f2f2f2;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

.store-grid-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  background: #171d2a;
  border: 1px solid #283245;
  border-radius: 18px;
  padding: 18px;
  min-height: 150px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.store-grid-card:hover {
  transform: translateY(-2px);
  border-color: #3a4a68;
  background: #1b2231;
}

.store-grid-icon-wrap {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  background: linear-gradient(180deg, #25314a, #1a2232);
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-grid-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
}

.store-grid-body {
  min-width: 0;
}

.store-grid-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.store-grid-title-row h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.store-grid-version {
  background: #253147;
  color: #dce6fa;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.store-grid-description {
  margin: 0;
  color: #c8d1e0;
  font-size: 16px;
  line-height: 1.45;
}

/* APP DETAIL PAGE */

.app-detail-page {
  padding-top: 28px;
  padding-bottom: 28px;
}

.merged-header {
  padding: 0 0 22px;
}

.detail-header-card {
  background: #171d2a;
  border: 1px solid #283245;
  border-radius: 20px;
  padding: 22px 24px 24px;
}

.detail-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.detail-card-brand {
  font-size: 18px;
  font-weight: 700;
  color: #f2f2f2;
}

.detail-card-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.detail-card-nav a {
  color: #c7cfdd;
  font-size: 15px;
}

.detail-card-divider {
  height: 1px;
  background: #283245;
  margin: 18px 0 22px;
}

.detail-card-content {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 26px;
  align-items: start;
}

.detail-header-left {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.detail-app-icon {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 28px;
  background: linear-gradient(180deg, #25314a, #1a2232);
  padding: 18px;
}

.detail-header-right {
  min-width: 0;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-title-row h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
}

.detail-version {
  background: #253147;
  color: #dce6fa;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}

.detail-meta {
  margin-top: 12px;
  color: #9eabc0;
  font-size: 16px;
}

.detail-text {
  margin-top: 20px;
  color: #d7dfec;
  line-height: 1.7;
  font-size: 17px;
  max-width: 900px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn {
  display: inline-block;
  background: #ff9500;
  color: #111;
  padding: 11px 16px;
  border-radius: 11px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

.btn.secondary {
  background: #2b364b;
  color: #f2f2f2;
}

.template-section {
  padding: 0 0 22px;
}

.template-box {
  background: #171d2a;
  border: 1px solid #283245;
  border-radius: 18px;
  padding: 20px;
}

.template-box h3 {
  margin: 0 0 16px;
  font-size: 19px;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.screenshot-card {
  background: #101521;
  border: 1px solid #253148;
  border-radius: 14px;
  overflow: hidden;
  min-height: 180px;
}

.screenshot-card img {
  width: 100%;
  height: 320px;
  object-fit: contain;
  background: #0c1020;
}

.version-list {
  display: grid;
  gap: 12px;
}

.version-item {
  background: #101521;
  border: 1px solid #253148;
  border-radius: 14px;
  padding: 16px;
}

.version-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.version-item p {
  margin: 0;
  color: #d7dfec;
}

.placeholder-box {
  background: #101521;
  border: 1px dashed #32405d;
  border-radius: 14px;
  padding: 32px 20px;
  color: #94a3ba;
  text-align: center;
}

.empty-box {
  background: #171d2a;
  border: 1px solid #283245;
  border-radius: 18px;
  padding: 24px;
}

.form {
  display: grid;
  gap: 16px;
  max-width: 700px;
  padding: 24px 0 40px;
}

.form label {
  display: grid;
  gap: 8px;
}

.form span {
  color: #cfd7e6;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #333b4d;
  background: #12161d;
  color: #f2f2f2;
}

.alert {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
}

.alert.error {
  background: #481d1d;
  border: 1px solid #7b2f2f;
}

.alert.success {
  background: #17351f;
  border: 1px solid #2f6e40;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
  .store-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-card-content {
    grid-template-columns: 130px 1fr;
  }

  .detail-app-icon {
    width: 120px;
    height: 120px;
  }

  .detail-title-row h2 {
    font-size: 32px;
  }
}

@media (max-width: 760px) {
  .detail-card-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-card-nav {
    flex-wrap: wrap;
  }

  .detail-card-content {
    grid-template-columns: 1fr;
  }

  .detail-header-left {
    justify-content: flex-start;
  }

  .store-grid {
    grid-template-columns: 1fr;
  }

  .featured-tabs {
    grid-template-columns: 1fr;
  }

  .store-grid-title-row,
  .version-item-top,
  .detail-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-title-row h2 {
    font-size: 28px;
  }

  .screenshot-card img {
    height: 240px;
  }
}