:root {
  --bg: #070b16;
  --surface: #0f1628;
  --surface-2: #151f36;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --gold: #facc15;
  --danger: #f87171;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 360px at 50% -60px, rgba(16, 185, 129, 0.2), transparent 70%),
    radial-gradient(500px 320px at 90% 90%, rgba(56, 189, 248, 0.08), transparent 70%);
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Profile */
.profile-card {
  background: linear-gradient(180deg, rgba(15, 22, 40, 0.92), rgba(15, 22, 40, 0.72));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  backdrop-filter: blur(12px);
}

.avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
}

.avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.handle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.profile-card h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge-free {
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.handle {
  color: var(--emerald-bright);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 2px;
}

.tagline {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 10px auto 16px;
  max-width: 48ch;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.socials a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.15s;
}

.socials a:hover {
  border-color: var(--emerald);
  transform: translateY(-1px);
}

/* Claim Banner & Form */
.claim-banner,
.unlocked-banner,
.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.claim-banner {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 18px 40px -24px rgba(16, 185, 129, 0.45);
}

.pill-emerald {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #052e22;
  background: var(--emerald-bright);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.claim-head h2,
.unlocked-banner h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.claim-head p,
.unlocked-banner p {
  font-size: 0.9rem;
  color: var(--muted);
}

.claim-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #090e1c;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
}

.btn-primary {
  margin-top: 4px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #042419;
  background: linear-gradient(135deg, var(--emerald-bright), var(--emerald));
  box-shadow: 0 10px 24px -10px rgba(16, 185, 129, 0.65);
  transition: transform 0.15s, filter 0.15s;
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.privacy-note {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

/* Unlocked Library */
.library {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.unlocked-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-color: rgba(16, 185, 129, 0.45);
}

.btn-ghost {
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.group-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.group-title h3 {
  font-size: 0.96rem;
  font-weight: 700;
}

.group-title span {
  font-size: 0.76rem;
  color: var(--emerald-bright);
  font-weight: 600;
  white-space: nowrap;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.file-item:hover {
  border-color: var(--emerald);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.file-item-zip {
  border-color: rgba(250, 204, 21, 0.45);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.55), rgba(15, 22, 40, 0.95));
}

.file-item-zip .dl-pill {
  background: var(--gold);
  color: #1e1b04;
}

.file-meta strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
}

.file-meta span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.dl-pill {
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: #052e22;
  background: var(--emerald-bright);
  padding: 6px 12px;
  border-radius: 999px;
}

/* Preview Catalog */
.preview-catalog h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.14);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.tag-gold {
  color: var(--gold);
  background: rgba(250, 204, 21, 0.14);
}

.catalog-card h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.catalog-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--muted);
}

.catalog-card li::before {
  content: "✓ ";
  color: var(--emerald-bright);
  font-weight: 700;
}

/* External Quick Links */
.link-tile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}

.link-tile:hover {
  border-color: var(--emerald);
}

.link-tile strong {
  display: block;
  font-size: 0.92rem;
}

.link-tile span {
  font-size: 0.8rem;
  color: var(--muted);
}

.arrow {
  font-size: 1.2rem;
  color: var(--emerald-bright);
}

.footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
}

[hidden] {
  display: none !important;
}
