:root {
  --bg: #030712;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --gold: #f472b6;
  --gold-soft: rgba(236, 72, 153, 0.16);
  --text: #ffffff;
  --muted: #a3a3a3;
  --danger: #f87171;
}

* { box-sizing: border-box; }

body.dl-theme {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Plus Jakarta Sans", system-ui, sans-serif;
  hyphens: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(236, 72, 153, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(251, 146, 60, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
}

.dl-page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 36px 20px 48px;
}

.dl-hero {
  text-align: center;
  margin-bottom: 28px;
}

.dl-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f472b6;
}

.dl-logo {
  width: 120px;
  height: auto;
  display: block;
  margin: 0 auto 14px;
}

.dl-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  color: #fff;
  font-weight: 800;
}

.dl-hero p {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.55;
}

.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.dl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px 20px;
  text-align: center;
  backdrop-filter: blur(12px);
}

.dl-card--missing {
  border-style: dashed;
  opacity: 0.92;
}

.dl-card--hub {
  background: linear-gradient(165deg, var(--gold-soft), rgba(12, 16, 28, 0.7) 55%);
  border-color: rgba(244, 114, 182, 0.28);
}

.dl-platform {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f472b6;
  font-weight: 700;
}

.dl-card h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  color: #fff;
}

.dl-btn {
  display: inline-block;
  background: linear-gradient(135deg, #ec4899, #ef4444, #fb923c);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  margin: 4px 0;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.35);
}

.dl-btn--secondary {
  background: transparent;
  color: #f9a8d4;
  border: 1px solid rgba(244, 114, 182, 0.45);
  box-shadow: none;
}

.dl-btn:hover { filter: brightness(1.05); }

.dl-meta {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.45;
  word-break: break-word;
}

.dl-meta code,
.dl-missing code,
.dl-foot code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
  color: #f9a8d4;
}

.dl-qr {
  margin: 18px auto 0;
  width: 200px;
  height: 200px;
  padding: 10px;
  background: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.dl-qr img,
.dl-qr canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* davidshimjs QRCode leaves a hidden canvas + visible img; don't force canvas display */
.dl-qr > img {
  display: block;
}

.dl-qr > canvas {
  display: none !important;
}

/* Table fallback (some mobile browsers) */
.dl-qr > table {
  width: 100% !important;
  height: 100% !important;
  border-collapse: collapse;
}

.dl-hint {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.dl-link {
  display: inline-block;
  margin-top: 12px;
  color: #f9a8d4;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.dl-link:hover { color: #fff; }

.dl-missing {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.dl-missing strong { color: var(--text); }

.dl-foot {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.dl-foot a {
  color: #f9a8d4;
}

.dl-foot a:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .dl-page { padding: 24px 14px 36px; }
  .dl-qr { width: 180px; height: 180px; }
}
