:root {
  color-scheme: dark light;
  --bg: #0c0c0e;
  --surface: #161618;
  --surface-2: #1e1e22;
  --border: #2a2a2f;
  --text: #ececee;
  --muted: #8a8a92;
  --accent: #ececee;
  --accent-2: #c4c4cc;
  --bonus: #f5c518;
  --bonus-bright: #ffe066;
  --bonus-text: #ffd60a;
  --bonus-glow: rgba(245, 197, 24, 0.45);
  --success: #6ed09b;
  --error: #e87285;
  --proof-req-bg: rgba(245, 197, 24, 0.06);
  --proof-req-border: rgba(245, 197, 24, 0.3);
  --proof-req-text: #e8c97a;
  --radius: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --surface-2: #f0f0f2;
    --border: #dedee2;
    --text: #15151a;
    --muted: #5e5e68;
    --accent: #15151a;
    --accent-2: #3a3a44;
    --bonus: #b07c00;
    --bonus-bright: #e0a200;
    --bonus-text: #9a6500;
    --bonus-glow: rgba(176, 124, 0, 0.35);
    --proof-req-bg: rgba(176, 124, 0, 0.06);
    --proof-req-border: rgba(176, 124, 0, 0.35);
    --proof-req-text: #6b4a00;
  }
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 24px 24px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 12px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle { color: var(--muted); margin: 0; }
.bonus-callout {
  color: var(--bonus-text);
  font-weight: 600;
  margin: 0;
}

.categories {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.category { margin-bottom: 40px; }
.category h2 {
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.category-desc {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .links-grid {
    grid-template-columns: 1fr;
  }
}

.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-card:hover {
  border-color: var(--accent-2);
  transform: translateY(-2px);
}

.link-card:has(.bonus-btn) {
  border-color: transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(
      from var(--angle),
      var(--border) 0%,
      var(--border) 65%,
      var(--bonus) 72%,
      var(--bonus-bright) 75%,
      var(--bonus) 78%,
      var(--border) 85%,
      var(--border) 100%
    ) border-box;
  animation: bonus-arc 4s linear infinite;
  box-shadow: 0 0 16px -6px var(--bonus-glow);
}
.link-card:has(.bonus-btn):hover {
  border-color: transparent;
  animation-duration: 2s;
  box-shadow: 0 0 26px -4px var(--bonus-glow);
}

@keyframes bonus-arc {
  to { --angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .link-card:has(.bonus-btn) {
    animation: none;
  }
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.link-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.description {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.cat-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.info {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
  display: grid;
  gap: 6px;
}
.info > div strong { color: var(--muted); margin-right: 4px; }
.info .bonus { color: var(--bonus-text); font-weight: 600; }

.reward-tiers ul {
  margin: 4px 0;
  padding-left: 20px;
}
.reward-tiers li { margin: 2px 0; }
.reward-tiers .tier-amount { font-weight: 600; }
.reward-tiers div strong { color: var(--muted); margin-right: 4px; }

.terms-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1px;
}
.terms-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.signup-btn,
.primary {
  background: var(--text);
  color: var(--bg);
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.signup-btn:hover,
.primary:hover { opacity: 0.85; text-decoration: none; color: var(--bg); }
.signup-btn:hover { transform: translateY(-1px); }
.primary:disabled { opacity: 0.5; cursor: not-allowed; }

.bonus-btn {
  background: linear-gradient(120deg, #ffc83d, #ffe066);
  color: #1a172a;
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 0 0 1px rgba(255, 200, 61, 0.3), 0 4px 14px rgba(255, 200, 61, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.bonus-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 200, 61, 0.5), 0 6px 18px rgba(255, 200, 61, 0.3);
}
.bonus-btn .bolt { font-size: 1.1em; line-height: 1; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: 1rem;
}

.filters {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 24px 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.filters select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  min-width: 200px;
  cursor: pointer;
}
.filters select:focus { outline: none; border-color: var(--accent); }

.foot {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal.hidden { display: none; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h2 { margin: 0 0 8px; font-size: 1.25rem; }
.modal-content .muted { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; }
.modal-content label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 12px 0 4px;
}
.modal-content input,
.modal-content textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}
.modal-content input:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.modal-content .primary { width: 100%; margin-top: 16px; padding: 12px; }

.close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
}
.close-btn:hover { color: var(--text); }

.status { margin: 12px 0 0; font-size: 0.9rem; min-height: 1.2em; }
.status.success { color: var(--success); }
.status.error { color: var(--error); }

.hidden { display: none !important; }

.proof-req {
  background: var(--proof-req-bg);
  border: 1px solid var(--proof-req-border);
  border-left: 3px solid var(--bonus);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--proof-req-text);
  font-size: 0.9rem;
  white-space: pre-wrap;
}
.proof-req::before {
  content: 'Proof required: ';
  color: var(--bonus-text);
  font-weight: 700;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-btn {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  margin: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.file-btn:hover { border-color: var(--accent); color: var(--accent); }

.small { font-size: 0.8rem; }
.muted { color: var(--muted); }

.image-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.image-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}
.image-item .thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.image-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.image-meta .name {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remove-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
}
.remove-btn:hover { color: var(--error); background: rgba(255, 107, 138, 0.1); }
