/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:    #e8192c;
  --dark:   #111;
  --card:   #1a1a1a;
  --border: #2a2a2a;
  --text:   #fff;
  --muted:  #aaa;
}

html, body {
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 32px;
}

/* ── TOP BAR ── */
.topbar {
  text-align: center;
  padding: 18px 16px 14px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
}
.topbar-logo {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 400;
  letter-spacing: 1.5px;
  color: #fff;
}

/* ── MAIN CARD ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 12px;
  overflow: hidden;
}

/* ── BANNER ── */
.banner {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #0a0a0a;
}
.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── CARD BODY ── */
.card-body {
  padding: clamp(14px, 4vw, 20px);
}

.game-title {
  font-size: clamp(20px, 5.5vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
  color: #fff;
}

.game-desc {
  font-size: clamp(13px, 3.5vw, 15px);
  color: #bbb;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ── FEATURES ── */
.features { margin-bottom: 20px; }
.feature {
  display: flex;
  gap: 8px;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 600;
  margin-bottom: 8px;
  align-items: flex-start;
  line-height: 1.5;
  color: #ddd;
}
.feature-arrow {
  color: var(--red);
  font-size: 9px;
  margin-top: 3px;
  flex-shrink: 0;
}

/* ── PLATFORM TOGGLE ── */
.platform-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.plat-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid #444;
  background: transparent;
  color: #888;
  font-size: clamp(13px, 3.5vw, 15px);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  min-height: 44px;
}
.plat-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── DOWNLOAD BUTTON ── */
.btn-download {
  width: 100%;
  background: linear-gradient(135deg, #e8192c, #c0001a);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 17px;
  font-size: clamp(15px, 4.5vw, 18px);
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
  min-height: 54px;
  display: block;
}
.btn-download:active { opacity: .85; }

/* ── PROGRESS WRAP (inline inside card) ── */
.progress-wrap {
  display: none;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 14px 16px;
}
.progress-wrap.visible { display: block; }

.progress-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.progress-spinner {
  color: var(--red);
  font-size: 16px;
  animation: spin 1.2s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-label {
  flex: 1;
  font-size: clamp(12px, 3vw, 13px);
  font-weight: 600;
  color: var(--red);
}
.progress-pct {
  font-size: clamp(13px, 3.5vw, 15px);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.progress-track {
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e8192c, #ff5566);
  border-radius: 3px;
  transition: width .5s linear;
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  font-size: clamp(10px, 2.5vw, 11px);
  color: #666;
}

/* ── STATS BAR ── */
.stats-bar {
  display: flex;
  margin: 12px 12px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.stat-item {
  flex: 1;
  text-align: center;
  padding: 14px 4px;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-val {
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.stat-star { color: var(--red); font-size: 13px; }
.stat-lbl  { font-size: clamp(9px, 2.3vw, 11px); color: #666; }
.age-badge {
  display: inline-block;
  border: 1.5px solid #555;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: clamp(10px, 2.5vw, 12px);
  font-weight: 700;
  color: #aaa;
}

/* ── FULLSCREEN CPA OVERLAY ── */
.cpa-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
}
.cpa-overlay.open { display: block; }

/* ══════════════════════════════
   TABLET (≥ 600px)
══════════════════════════════ */
@media (min-width: 600px) {
  body { max-width: 700px; }
  .card { margin: 0 20px; }
  .stats-bar { margin: 14px 20px 0; }
  .game-title { font-size: 30px; }
  .btn-download { font-size: 19px; }
}

/* ══════════════════════════════
   DESKTOP (≥ 900px)
══════════════════════════════ */
@media (min-width: 900px) {
  body { max-width: 780px; }
  .card-body { padding: 24px 28px; }
}
