/* ─── Happy XP Day animation ────────────────────── */
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  80%  { opacity: 1; transform: translateY(-80px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-110px) scale(1.05); }
}

.happy-xp-day {
  position: absolute;
  z-index: 9999;
  font-size: 22px;
  font-weight: 700;
  color: #a8e063;
  text-shadow: 0 2px 12px rgba(124, 92, 252, 0.6);
  pointer-events: none;
  white-space: nowrap;
  animation: floatUp 1.8s ease-out forwards;
}

/* ─── Reset & Base ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0f;
  --surface: #17171a;
  --surface2: #1e1e23;
  --border: #2a2a32;
  --accent: #7c5cfc;
  --accent-hover: #9b7dff;
  --twitter: #1da1f2;
  --twitter-hover: #0d8de0;
  --text: #e8e8f0;
  --text-muted: #888899;
  --radius: 12px;
  --radius-sm: 8px;
  --panel-bg: rgba(255, 255, 255, 0.07);
  --panel-border: rgba(255, 255, 255, 0.1);
}

html, body {
  min-height: 100%;
  background: var(--bg) url('assets/site-bg.png') center center / cover no-repeat fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Layout ────────────────────────────────────── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ─── Header ────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px 20px;
}

.site-header-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.site-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}


.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#logo-card {
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  display: block;
  flex-shrink: 0;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.built-by {
  font-size: 15px;
  color: var(--text-muted);
}

.built-by a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.built-by a:hover {
  color: var(--accent-hover);
}

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

.support-text {
  font-size: 15px;
  color: var(--text-muted);
}

.heart {
  color: #a8e063;
}

.wallet-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: monospace;
  font-size: 11px;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.wallet-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wallet-copy.copied {
  border-color: #22c55e;
  color: #22c55e;
}

.wallet-icon {
  font-size: 13px;
  opacity: 0.6;
}

/* ─── Main two-column layout ────────────────────── */
.content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 760px) {
  .content { grid-template-columns: 1fr; }
}

/* ─── Controls panel ────────────────────────────── */
.controls {
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ─── Form fields ───────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.field input[type="text"],
.field input[type="number"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field input[type="text"]:focus,
.field input[type="number"]:focus {
  border-color: var(--accent);
}

/* ─── Frame Toggle ──────────────────────────────── */
.frame-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.frame-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.frame-btn:hover { transform: scale(1.1); border-color: var(--accent); }
.frame-btn.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* Dot swatches */
.frame-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: block;
}

.frame-dot--none {
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.frame-dot--bronze   { background: linear-gradient(135deg, #804A00, #CD7F32, #804A00); }
.frame-dot--silver   { background: linear-gradient(135deg, #8e9eab, #ffffff, #8e9eab); }
.frame-dot--gold     { background: linear-gradient(135deg, #BF953F, #FCF6BA, #AA771C); }
.frame-dot--platinum { background: linear-gradient(135deg, #a9a9a9, #ffffff, #d4d4d4); }
.frame-dot--diamond  { background: linear-gradient(135deg, #a8edff, #5bc8f5, #a8edff); }
.frame-dot--obsidian { background: linear-gradient(135deg, #1a1a2e, #4a0080, #1a1a2e); }

/* ─── Font Color Toggle ─────────────────────────── */
.color-toggle {
  display: flex;
  gap: 8px;
}

.color-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.color-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--text);
}

.color-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── File input ────────────────────────────────── */
.file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: border-color 0.15s;
}

.file-label:hover { border-color: var(--accent); color: var(--text); }

.file-label input[type="file"] { display: none; }

/* ─── Background grid + categories ─────────────── */
.bg-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Category tab bar */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-tab {
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.cat-tab:hover:not(.active) {
  border-color: var(--accent);
  color: var(--text);
}

.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Thumbnails inside a category */
.cat-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 60px;
}

.bg-thumb {
  width: 100%;
  aspect-ratio: 3/2;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  object-fit: cover;
  transition: border-color 0.15s, transform 0.1s;
}

.bg-thumb:hover { transform: scale(1.04); border-color: var(--accent); }
.bg-thumb.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* Placeholder swatch when no image loaded yet */
.bg-thumb-placeholder {
  width: 100%;
  aspect-ratio: 3/2;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: border-color 0.15s, transform 0.1s;
}

.bg-thumb-placeholder:hover { transform: scale(1.04); border-color: var(--accent); }
.bg-thumb-placeholder.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.bg-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
  line-height: 1.6;
}

/* ─── Preview section ───────────────────────────── */
.preview-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.canvas-wrapper {
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#card-canvas {
  border-radius: 30px;
  max-width: 100%;
  display: block;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55);
  overflow: hidden;
}

/* ─── Action buttons ────────────────────────────── */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-width: 160px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: rgba(124, 92, 252, 0.25);
  border: 1px solid rgba(124, 92, 252, 0.55);
  color: #c4b0ff;
}
.btn-primary:hover {
  background: rgba(124, 92, 252, 0.4);
  border-color: rgba(155, 125, 255, 0.8);
}

.btn-twitter {
  background: rgba(29, 161, 242, 0.2);
  border: 1px solid rgba(29, 161, 242, 0.5);
  color: #7dd3f8;
}
.btn-twitter:hover {
  background: rgba(29, 161, 242, 0.35);
  border-color: rgba(29, 161, 242, 0.8);
}

/* ─── Project Info Panel ────────────────────────────── */
#project-info:empty { display: none; }

#project-info {
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.project-info-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.project-logo {
  height: 90px;
  width: auto;
  object-fit: contain;
}

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

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  transition: border-color 0.15s, color 0.15s;
}

.project-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Download Feed ─────────────────────────────── */
.feed-section {
  margin-top: 0;
  margin-bottom: 28px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.feed-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
}

.feed-counter {
  font-size: 15px;
  color: var(--text-muted);
}

.feed-counter strong {
  color: var(--accent);
  font-weight: 700;
}

.feed-list {
  display: flex;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.feed-list::-webkit-scrollbar {
  height: 4px;
}
.feed-list::-webkit-scrollbar-track {
  background: transparent;
}
.feed-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.feed-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-size: 13px;
  flex-shrink: 0;
  width: 160px;
}

.feed-thumb {
  width: 100%;
  aspect-ratio: 600 / 380;
  border-radius: 4px;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--surface2);
}

.feed-thumb--empty {
  width: 100%;
  aspect-ratio: 600 / 380;
  background: var(--surface2);
  border-radius: 4px;
}

.feed-nick {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-cat {
  color: var(--accent);
  background: rgba(124, 92, 252, 0.15);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

.feed-time {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: auto;
}

.feed-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}
