        :root {
            color-scheme: dark;
        }
        * {
            box-sizing: border-box;
        }
        body {
            margin: 0;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background: radial-gradient(circle at top, #1f2937 0, #020617 42%, #000 100%);
            color: #e5e7eb;
        }
        a {
            color: inherit;
            text-decoration: none;
        }
        header {
            border-bottom: 1px solid rgba(15,23,42,0.9);
            background: linear-gradient(to right, #020617dd, #020617cc);
            backdrop-filter: blur(12px);
            position: sticky;
            top: 0;
            z-index: 20;
        }
        .nav-inner {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0.8rem 1.25rem;
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .brand {
            font-weight: 800;
            letter-spacing: 0.06em;
            font-size: 1rem;
            text-transform: uppercase;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .brand-pill {
            width: 26px;
            height: 26px;
            border-radius: 999px;
            background: radial-gradient(circle at 30% 20%, #a855f7, #ec4899);
            box-shadow: 0 0 24px rgba(236, 72, 153, 0.5);
        }
        .nav-spacer {
            flex: 1;
        }
        .nav-chip {
            font-size: 0.8rem;
            padding: 0.25rem 0.7rem;
            border-radius: 999px;
            border: 1px solid #374151;
            background: #020617;
            color: #9ca3af;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 80px;
        }
        .nav-chip strong {
            margin-left: 0.25rem;
            color: #bbf7d0;
        }

        main {
            max-width: 1200px;
            margin: 0 auto;
            padding: 1.5rem 1.25rem 3rem;
        }

        .admin-bar {
            display: flex;
            justify-content: flex-end;
            margin-bottom: 0.75rem;
        }

        .layout {
            display: grid;
            grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
            gap: 1.5rem;
        }
        @media (max-width: 900px) {
            .layout {
                grid-template-columns: minmax(0, 1fr);
            }
        }

        .sidebar {
            background: rgba(15,23,42,0.95);
            border-radius: 1rem;
            padding: 1rem;
            border: 1px solid #111827;
            box-shadow: 0 22px 60px rgba(0,0,0,0.65);
        }
        .sidebar h2 {
            font-size: 0.95rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #9ca3af;
            margin: 0 0 0.75rem;
        }
        .type-toggle {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        .pill {
            flex: 1;
            text-align: center;
            font-size: 0.8rem;
            padding: 0.35rem 0.4rem;
            border-radius: 999px;
            border: 1px solid #374151;
            background: #020617;
            color: #9ca3af;
            cursor: pointer;
        }
        .pill.active {
            background: radial-gradient(circle at 10% 0%, #22c55e, #14b8a6);
            border-color: transparent;
            color: #020617;
            font-weight: 600;
        }

        .category-list {
            list-style: none;
            margin: 0;
            padding: 0;
            max-height: none;
            overflow: visible;
        }
        .category-item {
            margin-bottom: 0.2rem;
        }
        .category-link {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.35rem 0.55rem;
            border-radius: 0.6rem;
            font-size: 0.85rem;
            cursor: pointer;
        }
        .category-link:hover {
            background: #0b1120;
        }
        .category-link.active {
            background: #111827;
            color: #f9fafb;
        }
        .badge-count {
            font-size: 0.75rem;
            color: #6b7280;
        }

        .content-header {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            align-items: center;
            margin-bottom: 1rem;
        }
        .content-header-text {
            flex: 1 1 auto;
        }
        .content-header-text h1 {
            font-size: 1.3rem;
            margin: 0;
        }
        .content-header-text p {
            margin: 0.1rem 0 0;
            font-size: 0.85rem;
            color: #9ca3af;
        }
        .legend {
            margin: 0.35rem 0 0;
            font-size: 0.78rem;
            color: #9ca3af;
        }

        .search-wrap {
            flex: 0 0 260px;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            background: #020617;
            border-radius: 999px;
            padding: 0.25rem 0.7rem;
            border: 1px solid #1f2937;
        }
        .search-wrap input {
            flex: 1;
            border: none;
            background: transparent;
            color: #f9fafb;
            font-size: 0.85rem;
            outline: none;
        }
        .search-wrap span {
            font-size: 0.8rem;
            color: #6b7280;
        }
        @media (max-width: 700px) {
            .search-wrap {
                flex: 1 1 100%;
            }
        }

        .emote-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
            gap: 0.9rem;
        }
        .emote-card {
            background: radial-gradient(circle at top left, #111827, #020617 60%);
            border-radius: 1rem;
            padding: 0.7rem 0.7rem 0.75rem;
            border: 1px solid rgba(31,41,55,0.9);
            box-shadow: 0 16px 40px rgba(0,0,0,0.7);
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
        }
        .emote-thumb {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.2rem 0 0.1rem;
        }
        .emote-thumb img.emote-preview {
            display: block;
            image-rendering: pixelated;
            max-width: 100%;
            height: auto;
        }

        .chat-preview-bars {
            margin-top: 0.25rem;
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
        }
        .chat-preview-bars img {
            display: block;
            width: 100%;
            max-width: 100%;
            border-radius: 0.5rem;
            border: 1px solid #1f2937;
        }

        .emote-meta {
            display: flex;
            flex-direction: column;
            gap: 0.1rem;
        }
        .emote-name-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.35rem;
        }
        .emote-name {
            font-size: 0.9rem;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .new-badge {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            padding: 0.06rem 0.45rem;
            border-radius: 999px;
            background: radial-gradient(circle at 10% 0%, #f97316, #facc15);
            color: #111827;
            font-weight: 700;
            box-shadow: 0 0 12px rgba(248, 250, 252, 0.25);
            white-space: nowrap;
        }

        .emote-tags {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.75rem;
            color: #9ca3af;
        }
        .tag-chip {
            padding: 0.05rem 0.45rem;
            border-radius: 999px;
            border: 1px solid #1f2937;
            font-size: 0.7rem;
        }
        .tag-chip.badge-chip {
            border-color: #f59e0b;
            color: #fbbf24;
        }
        .tag-chip.emote-chip {
            border-color: #22c55e;
            color: #6ee7b7;
        }

        .emote-actions {
            margin-top: 0.25rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.78rem;
        }
        .owned-pill {
            padding: 0.15rem 0.5rem;
            border-radius: 999px;
            border: 1px solid #22c55e;
            color: #bbf7d0;
            background: rgba(22,163,74,0.16);
            font-weight: 600;
            white-space: nowrap;
        }
        .download-link {
            font-size: 0.78rem;
            padding: 0.2rem 0.55rem;
            border-radius: 999px;
            border: 1px solid #1d4ed8;
            background: rgba(59,130,246,0.15);
            color: #bfdbfe;
            white-space: nowrap;
        }
        .buy-form {
            flex: 1;
        }
        .buy-btn {
            width: 100%;
            border-radius: 999px;
            border: 1px solid #22c55e;
            background: #22c55e;
            color: #020617;
            font-size: 0.8rem;
            font-weight: 600;
            padding: 0.3rem 0.4rem;
            cursor: pointer;
        }
        .buy-btn[disabled] {
            opacity: 0.6;
            cursor: not-allowed;
        }
        .need-credits {
            font-size: 0.76rem;
            color: #f97316;
        }
        .need-credits a {
            color: #fdba74;
            text-decoration: underline;
        }
        .signin-note {
            font-size: 0.76rem;
            color: #9ca3af;
        }
        .signin-note a {
            text-decoration: underline;
        }

        .empty-state {
            margin-top: 2rem;
            text-align: center;
            color: #6b7280;
            font-size: 0.9rem;
        }
		/* ==========================================================
   ADDITIONS (from challenge page styles) — safe to append
   ========================================================== */

/* Minor nav-chip improvement (gap) */
.nav-chip { gap: 0.25rem; }

/* Generic card */
.card {
  background: #020617;
  border-radius: 1.2rem;
  border: 1px solid #111827;
  padding: 1.5rem 1.7rem;
  box-shadow: 0 22px 60px rgba(0,0,0,0.8);
}
.card + .card { margin-top: 1.4rem; }

/* Intro / welcome card bits */
.intro-title {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}
.intro-text {
  font-size: 0.95rem;
  color: #d1d5db;
  line-height: 1.7;
}
.intro-steps {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: #e5e7eb;
  padding-left: 1.25rem;
}
.intro-steps li { margin-bottom: 0.35rem; }

/* Challenge header block */
.challenge-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}
.challenge-title h1 {
  margin: 0;
  font-size: 1.4rem;
}
.challenge-title p {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  gap: 0.35rem;
}
.status-active {
  background: rgba(34,197,94,0.15);
  border: 1px solid #22c55e;
  color: #bbf7d0;
}
.status-upcoming {
  background: rgba(56,189,248,0.15);
  border: 1px solid #38bdf8;
  color: #bae6fd;
}
.status-ended {
  background: rgba(239,68,68,0.15);
  border: 1px solid #ef4444;
  color: #fecaca;
}

/* Meta chips row */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #9ca3af;
}
.meta-item {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #111827;
  background: radial-gradient(circle at top left, #111827, #020617);
}

/* Main description */
.description {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e5e7eb;
}

/* Example block */
.example-block {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #9ca3af;
}
.example-block img {
  margin-top: 0.5rem;
  max-width: 100%;
  height: auto;
  border-radius: 0.8rem;
  border: 1px solid #111827;
}

/* Notices */
.notice {
  margin-top: 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.8rem;
  font-size: 0.85rem;
}
.notice-warning {
  background: rgba(251,191,36,0.09);
  border: 1px solid #fbbf24;
  color: #fef9c3;
}
.notice-error {
  background: rgba(239,68,68,0.09);
  border: 1px solid #ef4444;
  color: #fecaca;
}
.notice-success {
  background: rgba(34,197,94,0.09);
  border: 1px solid #22c55e;
  color: #bbf7d0;
}
.notice-info {
  background: rgba(59,130,246,0.08);
  border: 1px solid #3b82f6;
  color: #dbeafe;
}

/* Requirements block */
.requirements {
  margin-top: 1.1rem;
  font-size: 0.9rem;
}
.requirements h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.requirements ol {
  margin: 0;
  padding-left: 1.25rem;
}
.requirements li {
  margin-bottom: 0.3rem;
  line-height: 1.5;
}
.requirements strong { font-weight: 600; }

/* CTA row + button */
.cta-row {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid #22c55e;
  background: #22c55e;
  color: #020617;
  cursor: pointer;
}
.cta-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.cta-info {
  font-size: 0.8rem;
  color: #9ca3af;
}
.cta-info a { text-decoration: underline; }

/* Current submission panel */
.current-submission {
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px dashed #111827;
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 1rem;
}
@media (max-width: 800px) {
  .current-submission { grid-template-columns: minmax(0, 1fr); }
}
.current-submission h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.submission-image { text-align: center; }
.submission-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.8rem;
  border: 1px solid #111827;
}
.submission-meta {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* History card */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.history-header h2 {
  margin: 0;
  font-size: 1.1rem;
}
.points-pill {
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #22c55e;
  background: rgba(34,197,94,0.12);
  font-size: 0.82rem;
  color: #bbf7d0;
}
.history-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
}
.history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.82rem;
  border-radius: 0.7rem;
  padding: 0.45rem 0.55rem;
  background: radial-gradient(circle at top left, #020617, #020617 60%);
  border: 1px solid #111827;
}
.history-thumb img {
  width: 60px;
  height: auto;
  border-radius: 0.4rem;
  border: 1px solid #111827;
  display: block;
}
.history-main { min-width: 0; }
.history-title {
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.history-meta {
  color: #9ca3af;
  font-size: 0.78rem;
}
.history-status-pill {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  text-align: center;
  min-width: 80px;
}
.hs-pending {
  background: rgba(251,191,36,0.15);
  border: 1px solid #fbbf24;
  color: #fef9c3;
}
.hs-approved {
  background: rgba(34,197,94,0.15);
  border: 1px solid #22c55e;
  color: #bbf7d0;
}
.hs-rejected {
  background: rgba(239,68,68,0.15);
  border: 1px solid #ef4444;
  color: #fecaca;
}

/* Extra objective highlight */
.challenge-objective {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1.15rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.5;
  text-shadow: 0 0 4px rgba(0,0,0,0.4);
}
/* ==========================================================
   ADDITIONS (form + alerts + file upload)
   ========================================================== */

/* Card typography defaults */
.card h1 {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
}
.card p {
  margin: 0.2rem 0 0.6rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Alerts (simple banners) */
.alert {
  margin-bottom: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
}
.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid #ef4444;
  color: #fecaca;
}
.alert-success {
  background: rgba(34,197,94,0.1);
  border: 1px solid #22c55e;
  color: #bbf7d0;
}

/* Meta helper text */
.meta {
  margin: 0.6rem 0 1rem;
  font-size: 0.86rem;
  color: #9ca3af;
}

/* Basic form styling */
form { margin-top: 1rem; }

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

input[type="file"] {
  font-size: 0.86rem;
  margin-bottom: 0.7rem;
}

.hint {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 0.8rem;
}

button[type="submit"] {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #22c55e;
  background: #22c55e;
  color: #020617;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Custom file upload button */
.file-upload-wrapper {
  display: inline-block;
  position: relative;
}

.file-upload-btn {
  background: #22c55e;
  border: 1px solid #22c55e;
  color: #020617;
  padding: 0.45rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  display: inline-block;
}

/* Invisible input overlays the button (click-through) */
.file-upload-wrapper input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
/* ==========================================================
   ADDITIONS (Achievements page UI)
   ========================================================== */

/* Generic headings */
h1 {
  margin: 0 0 0.8rem;
  font-size: 1.6rem;
}
p.lead {
  margin: 0 0 1.4rem;
  font-size: 0.95rem;
  color: #9ca3af;
}

/* Achievements summary row */
.ach-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}
.ach-summary {
  flex: 1 1 160px;
  background: radial-gradient(circle at top, #020617, #020617 55%);
  border-radius: 0.9rem;
  border: 1px solid #111827;
  padding: 0.7rem 0.9rem;
  font-size: 0.8rem;
}
.ach-summary-label {
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}
.ach-summary-value {
  margin-top: 0.15rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.ach-summary-value span.sub {
  font-size: 0.8rem;
  color: #6b7280;
  margin-left: 0.2rem;
}

/* Section titles */
.ach-section-title {
  margin: 1.4rem 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ach-section-title span.icon { font-size: 1.1rem; }

.ach-section-subtitle {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  color: #9ca3af;
}

/* Achievements grid */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.8rem;
}

/* Achievements cards */
.ach-card {
  border-radius: 0.95rem;
  border: 1px solid #111827;
  padding: 0.75rem 0.85rem 0.8rem;
  background: radial-gradient(circle at top left, #020617, #020617 60%);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9rem;
}
.ach-card.locked {
  opacity: 0.7;
  border-style: dashed;
}

.ach-card-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.1rem;
}

/* Badge icon circles */
.ach-badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.ach-badge.unlocked {
  background: radial-gradient(circle at 20% 0%, #facc15, #f97316);
  box-shadow: 0 0 18px rgba(250,204,21,0.35);
}
.ach-badge.locked {
  background: radial-gradient(circle at 20% 0%, #111827, #020617);
  box-shadow: 0 0 14px rgba(15,23,42,0.8);
  color: #9ca3af;
}

/* Text blocks */
.ach-name { font-weight: 600; }
.ach-desc {
  font-size: 0.83rem;
  color: #9ca3af;
}
.ach-meta {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #6b7280;
}
.ach-empty {
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Mobile spacing */
@media (max-width: 700px) {
  .card {
    padding: 1.4rem 1.3rem 1.6rem;
  }
}

/* ==========================================================
   ADDITIONS (Profile card / buttons / achievements list)
   ========================================================== */

/* Profile-style rows */
.row { margin-bottom: 1rem; }

.label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 0.15rem;
}

.value { font-size: 1rem; }

.credits {
  font-weight: 700;
  color: #86efac;
}

/* Button system (note: you already have .btn in some pages; this is compatible) */
.actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  text-align: center;
  padding: 0.65rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid #22c55e;
  background: #22c55e;
  color: #020617;
}

.btn.secondary {
  background: transparent;
  border-color: #4b5563;
  color: #e5e7eb;
}

.btn.warning {
  background: #16a34a;
  border-color: #16a34a;
  color: #020617;
}

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

.btn-small {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  flex: none;
}

/* Achievements (list variant, different to grid variant) */
.achievements {
  margin-top: 1.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid #111827;
}

.achievements-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.achievements-title span.icon { font-size: 1.1rem; }

.achievements-subtitle {
  font-size: 0.86rem;
  color: #9ca3af;
  margin-bottom: 0.9rem;
}

.ach-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ach-item {
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #111827;
  background: radial-gradient(circle at top left, #020617, #020617 60%);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.88rem;
}

.ach-item + .ach-item { margin-top: 0.5rem; }

/* Note: .ach-name / .ach-desc / .ach-meta / .ach-empty already exist from earlier */

/* ==========================================================
   ADDITIONS (Custom CTA + emote variants + download sizes)
   ========================================================== */

/* Page subtitle */
.subtitle {
  margin: 0 0 1.3rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Custom CTA block */
.custom-cta {
  margin-bottom: 1.4rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid #111827;
  background: radial-gradient(circle at top left, #0b1120, #020617 65%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.custom-cta-text {
  flex: 1 1 220px;
  font-size: 0.88rem;
  color: #e5e7eb;
}
.custom-cta-text strong {
  color: #a5b4fc;
}
.custom-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* CTA buttons (variant-safe) */
.cta-btn.primary {
  background: #22c55e;
  border-color: #22c55e;
  color: #020617;
}
.cta-btn.secondary {
  background: transparent;
  border-color: #4b5563;
  color: #e5e7eb;
}
.cta-btn:hover {
  filter: brightness(1.05);
}

/* Emote card state variants */
.emote-card.recent {
  box-shadow:
    0 0 0 1px #22c55e,
    0 0 24px rgba(34,197,94,0.4);
}

.emote-card.custom-private {
  border-color: #ef4444;
  box-shadow:
    0 0 0 1px rgba(248,113,113,0.75),
    0 22px 60px rgba(248,113,113,0.35);
}

.emote-card.custom-public {
  border-color: #f97316;
  box-shadow:
    0 0 0 1px rgba(251,146,60,0.8),
    0 22px 60px rgba(249,115,22,0.35);
}

/* Enhanced emote thumb layout */
.emote-thumb {
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

/* Chat preview wrap (new variant) */
.chat-preview-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.chat-preview-img {
  width: 100%;
  max-width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #1f2937;
  background: #020617;
  box-shadow: 0 6px 18px rgba(0,0,0,0.7);
}

/* Custom emote flags */
.custom-flag {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.custom-flag.private { color: #fecaca; }
.custom-flag.public  { color: #fed7aa; }

/* Footer row on emote cards */
.emote-footer {
  margin-top: 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #9ca3af;
  gap: 0.5rem;
}

/* Download size pills */
.size-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}
.size-pill {
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #1d4ed8;
  background: rgba(59,130,246,0.15);
  color: #bfdbfe;
  white-space: nowrap;
}

/* Empty state helpers */
.empty-state a {
  color: #9ca3af;
  text-decoration: underline;
}

/* Back links block */
.back-links {
  margin-top: 1.5rem;
  font-size: 0.85rem;
}
.back-links a {
  text-decoration: underline;
  color: #9ca3af;
}
.back-links a + a {
  margin-left: 1rem;
}

/* ==========================================================
   ADDITIONS (Credits / PayPal / purchase flow)
   ========================================================== */

/* Narrow purchase pages (opt-in by structure, not global main) */
.balance {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Inline success / error messages */
.msg-ok,
.msg-err {
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}
.msg-ok {
  background: rgba(22,163,74,0.12);
  border: 1px solid rgba(34,197,94,0.7);
  color: #bbf7d0;
}
.msg-err {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(248,113,113,0.7);
  color: #fecaca;
}

/* Credit pack selection */
.packs {
  margin: 1rem 0 1.2rem;
}
.packs-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 0.4rem;
}
.packs-options label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.packs-options input {
  margin-right: 0.45rem;
}

/* PayPal container (white card inside dark UI) */
.paypal-wrap {
  margin-top: 0.5rem;
  margin-bottom: 1.2rem;
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  padding: 1.2rem 1.4rem 1.4rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
  text-align: center;
}

.paypal-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #374151;
  margin: 0 0 0.8rem;
}

#paypal-button-container,
#paypal-button-container iframe {
  background: transparent !important;
}

.paypal-note {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: #4b5563;
}

/* Dev / manual credit buttons */
button.dev-btn {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #22c55e;
  background: #22c55e;
  color: #020617;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  margin-top: 0.4rem;
  cursor: pointer;
}
button.dev-btn:hover {
  filter: brightness(1.05);
}

/* Helper text + back links */
.hint {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.back {
  margin-top: 1rem;
  text-align: left;
  font-size: 0.85rem;
}
.back a {
  text-decoration: underline;
  color: #9ca3af;
}

/* Developer-only section */
.dev-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed #1f2937;
}
.dev-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.7);
  color: #e9d5ff;
  margin-bottom: 0.4rem;
}

/* Local chips for page actions (so we don't affect header chips) */
.page-chip{
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #020617;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

/* Breadcrumbs */
.breadcrumbs{
  margin-top: .35rem;
  font-size: .82rem;
  color: #9ca3af;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.breadcrumbs a{ color:#bfdbfe; }
.breadcrumbs a:hover{ text-decoration: underline; }

/* ==========================================================
   ADDITIONS (PNG Viewer page UI)
   Safe to append — uses unique class names to avoid conflicts
   ========================================================== */

.viewer-card{
  background:#020617;
  border:1px solid #111827;
  border-radius:1rem;
  padding:1.2rem;
  box-shadow:0 20px 50px rgba(0,0,0,0.8);
}

.viewer-grid{
  display:grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap:1rem;
  align-items:start;
}
@media (max-width: 900px){
  .viewer-grid{ grid-template-columns: minmax(0,1fr); }
}

.preview-wrap{
  display:flex;
  justify-content:center;
}

.preview-stack{
  position:relative;
  display:inline-block;
  line-height:0;
  border-radius:1rem;
  overflow:hidden;
  border:1px solid #1f2937;
  background:#0b1120;
  box-shadow:0 16px 40px rgba(0,0,0,0.7);
}

.preview-stack img{
  display:block;
  width:100%;
  height:auto;
  max-width:520px;
}

/* Hover overlay image (optional second image layered on top) */
.preview-hover{
  position:absolute;
  inset:0;
  opacity:0;
  transition:opacity .25s ease;
}
.preview-stack:hover .preview-hover{
  opacity:1;
}

.preview-caption{
  margin-top:.6rem;
  font-size:.85rem;
  color:#9ca3af;
  text-align:center;
}

/* Right-side stats chips */
.stats{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:.6rem;
}
@media (max-width: 520px){
  .stats{ grid-template-columns:minmax(0,1fr); }
}

.stat-chip{
  padding:.55rem .7rem;
  border-radius:.9rem;
  border:1px solid #111827;
  background: radial-gradient(circle at top left, #111827, #020617);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  font-size:.82rem;
  color:#9ca3af;
}
.stat-chip strong{
  color:#e5e7eb;
  font-weight:700;
}

/* Button row helper (works with your existing .btn system) */
.btn-row{
  margin-top:.9rem;
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
}

/* Titles used on viewer pages */
.section-title-h2{
  margin:0 0 .6rem;
  font-size:1rem;
}
.similar-title{
  margin:1.25rem 0 .65rem;
  font-size:1.05rem;
  font-weight:600;
  color:#e5e7eb;
}

/* ==========================================================
   PNG Viewer polish (sidebar + file details text)
   ========================================================== */

.file-row{
  margin-top: .1rem;
  display: flex;
  gap: .35rem;
  align-items: baseline;
  font-size: .85rem;
  color: #9ca3af;
  line-height: 1.35;
}

.file-k{
  color:#e5e7eb;
  font-weight:700;
  flex: 0 0 auto;
}

.file-v{
  min-width: 0;
  word-break: break-word;   /* prevents ugly overflow */
  overflow-wrap: anywhere;  /* nicer wrapping for long slugs */
}

.sidebar-actions{
  margin-top: .6rem;
  display: flex;
}

.sidebar-actions .page-chip{
  width: 100%;
  justify-content: center;
}

.nowrap{ white-space: nowrap; }

/* Make stat chips read nicer */
.stat-chip span{ white-space: nowrap; }
.stat-chip strong{ white-space: nowrap; }

.btn.disabled{
  opacity: .55;
  cursor: not-allowed;
  text-align: center;
}

.btn.disabled:hover{
  filter: none;
}

/* ==========================================================
   FIX: PNG Viewer stat text overflowing
   (put at the VERY END of style.css)
   ========================================================== */

.stats{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-chip{
  padding:.65rem .75rem;
  border-radius:.9rem;
  border:1px solid #111827;
  background: radial-gradient(circle at top left, #111827, #020617);
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap:.2rem;
  font-size:.78rem;
  color:#9ca3af;
  text-align:center;
}


.stat-chip span{
  font-size:.75rem;
  text-transform: uppercase;
  letter-spacing:.08em;
  color:#9ca3af;
  white-space: nowrap;
}


.stat-chip strong{
  font-size:1.05rem;
  font-weight:700;
  color:#e5e7eb;
  line-height:1.1;
  white-space: nowrap;
}



/* Optional: on very small screens, make it single column */
@media (max-width: 520px){
  .stats{ grid-template-columns: minmax(0,1fr); }
  .stat-chip strong{ max-width: 70%; }
}

/* ─────────────────────────────────────────
   PNG FOLDERS (Sidebar tree) — refined
   - smaller text
   - NO arrow/chevron
───────────────────────────────────────── */

.games-nav{
  margin-top:.5rem;
  display:flex;
  flex-direction:column;
  gap:.3rem;
  max-height: calc(100vh - 220px);
  overflow:auto;
  padding-right:.25rem;
}

/* nice scrollbar (webkit only) */
.games-nav::-webkit-scrollbar{ width:8px; }
.games-nav::-webkit-scrollbar-track{ background:transparent; }
.games-nav::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}
.games-nav::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,.18); }

.games-item{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.15);
  border-radius: 14px;
  overflow:hidden;
}

/* summary row */
.games-item > summary{
  list-style:none;
  cursor:pointer;
  padding:.45rem .65rem;
  display:flex;
  align-items:center;
  gap:.4rem;              /* smaller gap now that we removed arrow */
  user-select:none;
}

.games-item > summary::-webkit-details-marker{ display:none; }

/* REMOVE the chevron */
.games-item > summary::before{
  content:none !important;
  display:none !important;
}

.games-item > summary:hover{
  background: rgba(255,255,255,.06);
}

/* main folder link */
.games-game{
  color:#dbeafe;
  text-decoration:none;
  font-weight:700;
  letter-spacing:.015em;
  font-size:.82rem;        /* smaller */
  line-height:1.15;
  display:block;
  flex:1;
}

.games-game:hover{ text-decoration:underline; }

/* subfolders container */
.games-subs{
  padding:.25rem .65rem .65rem 1.15rem; /* less indent */
  display:flex;
  flex-direction:column;
  gap:.3rem;
}

/* leaf links (subfolders + folders without kids) */
.games-sub{
  display:block;
  text-decoration:none;
  color:#cbd5e1;
  font-size:.78rem;        /* smaller */
  padding:.32rem .45rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.12);
}

.games-sub:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color:#ffffff;
}

/* section title used in sidebar */
.sidebar .sidebar-section-title{
  font-weight:900;
  letter-spacing:.12em;
  font-size:.78rem;
  opacity:.9;
  margin-top:1rem;
  margin-bottom:.6rem;
  color: rgba(255,255,255,.75);
}

/* ─────────────────────────────────────────
   Header: two-row navigation layout
───────────────────────────────────────── */

.nav-stack{
  display:flex;
  flex-direction:column;
  gap:.55rem;
}

.nav-row{
  display:flex;
  align-items:center;
  gap:.45rem;
  flex-wrap:wrap;
}

/* Primary nav row */
.nav-row-main{
  padding-bottom:.35rem;
  border-bottom:1px solid rgba(255,255,255,.06);
}

/* User row slightly muted */
.nav-row-user .nav-chip{
  font-size:.78rem;
}

/* On small screens, collapse nicely */
@media (max-width: 720px){
  .nav-row{
    justify-content:center;
  }
  .nav-spacer{
    display:none;
  }
}

/* ==========================================================
   AUTH PAGES (Login / Register) — scoped so it won't affect site-wide .card
   Add to the VERY END of style.css
   ========================================================== */

.auth-wrap{
  min-height: calc(100vh - 70px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:1.5rem;
}

.auth-card{
  width:100%;
  max-width:420px;
  background:#020617;
  border-radius:1rem;
  border:1px solid #111827;
  padding:1.8rem 2rem 2rem;
  box-shadow:0 20px 50px rgba(0,0,0,0.8);
}

.auth-card h1{
  margin:0 0 0.75rem;
  font-size:1.4rem;
}

.auth-subtitle{
  margin:0 0 1.4rem;
  font-size:0.9rem;
  color:#9ca3af;
}

.auth-field{ margin-bottom:0.9rem; }

.auth-card label{
  display:block;
  font-size:0.82rem;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:#9ca3af;
  margin-bottom:0.25rem;
}

.auth-card input[type="text"],
.auth-card input[type="password"]{
  width:100%;
  border-radius:0.75rem;
  border:1px solid #1f2937;
  background:#020617;
  color:#f9fafb;
  padding:0.55rem 0.7rem;
  font-size:0.9rem;
  outline:none;
}

.auth-card input:focus{ border-color:#22c55e; }

.auth-errors{
  background:rgba(239,68,68,0.12);
  border:1px solid rgba(248,113,113,0.7);
  color:#fecaca;
  border-radius:0.75rem;
  padding:0.6rem 0.8rem;
  font-size:0.82rem;
  margin-bottom:0.9rem;
}

.auth-btn{
  width:100%;
  border-radius:999px;
  border:1px solid #22c55e;
  background:#22c55e;
  color:#020617;
  font-weight:600;
  padding:0.6rem 0.75rem;
  margin-top:0.4rem;
  cursor:pointer;
}

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

.auth-alt{
  margin-top:0.9rem;
  text-align:center;
  font-size:0.85rem;
  color:#9ca3af;
}

.auth-alt a{ text-decoration:underline; }

.auth-errors-list{
  margin: 0;
  padding-left: 1.1rem;
}
.auth-errors-list li{
  margin: .2rem 0;
}

/* ==========================================================
   ADDITIONS (Winners page UI)
   Safe to append — uses unique class names
   ========================================================== */

/* Winners card layout */
.winners-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.winners-card {
  background: radial-gradient(circle at top left, #111827, #020617 60%);
  border-radius: 1rem;
  padding: 1.2rem 1.3rem 1.3rem;
  border: 1px solid rgba(31,41,55,0.9);
  box-shadow: 0 16px 40px rgba(0,0,0,0.7);
}

.winners-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: flex-start;
}

.winners-header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.winners-header p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #9ca3af;
}

.winners-meta {
  font-size: 0.8rem;
  color: #6b7280;
  text-align: right;
  margin-top: 0.2rem;
}

.winners-table-wrap {
  margin-top: 0.5rem;
  border-radius: 0.9rem;
  border: 1px solid #1f2937;
  background: #020617;
  overflow: hidden;
  overflow-x: auto;
}

table.winners-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-size: 0.9rem;
}

table.winners-table th,
table.winners-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #111827;
  white-space: nowrap;
}

table.winners-table th {
  background: #030712;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

table.winners-table tbody tr:nth-child(even) {
  background: #020617;
}

table.winners-table tbody tr:nth-child(odd) {
  background: #020617cc;
}

.winner-date {
  color: #9ca3af;
}

.winner-username {
  font-weight: 500;
}

.winner-amount {
  font-weight: 700;
  color: #facc15;
}

.no-results {
  margin-top: 0.5rem;
  font-style: italic;
  color: #9ca3af;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .winners-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .winners-meta {
    text-align: left;
  }
}

/* ==========================================================
   Wheel Giveaway Winners — polish
   Scoped to .winners-* so it won't affect other pages
   ========================================================== */

.winners-layout{
  max-width: 980px;              /* keeps it from stretching too wide */
  margin: 0 auto;
}

.winners-card{
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: radial-gradient(circle at 15% 10%, rgba(168,85,247,.18), transparent 38%),
              radial-gradient(circle at 85% 20%, rgba(34,197,94,.10), transparent 40%),
              radial-gradient(circle at top left, #0b1224, #020617 60%);
  box-shadow: 0 26px 80px rgba(0,0,0,.75);
}

/* subtle shine line */
.winners-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transform: translateX(-60%);
  pointer-events:none;
}

/* header spacing + typography */
.winners-header{
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.winners-header h1{
  font-size: 1.55rem;
  letter-spacing: .02em;
}

.winners-header p{
  max-width: 62ch;
  line-height: 1.55;
}

/* meta line (top right) */
.winners-meta{
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(2,6,23,.65);
}

/* optional little stat chips row */
.winners-stats{
  margin-top: .85rem;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.winners-stat{
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(2,6,23,.55);
  color: #9ca3af;
  font-size: .82rem;
}
.winners-stat strong{
  color: #e5e7eb;
  font-size: .95rem;
  font-weight: 800;
}
.winners-stat .accent{
  color: #facc15;
}

/* table container */
.winners-table-wrap{
  margin-top: .9rem;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(2,6,23,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

/* table */
table.winners-table{
  min-width: 520px; /* a touch wider so it doesn't wrap awkwardly */
}

table.winners-table th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(3,7,18,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

table.winners-table td{
  border-bottom: 1px solid rgba(255,255,255,.06);
}

table.winners-table tbody tr{
  transition: transform .08s ease, background .15s ease;
}

table.winners-table tbody tr:hover{
  background: rgba(255,255,255,.04);
}

/* make amounts line up nicer */
.winner-amount{
  text-align: right;
  font-weight: 900;
  color: #facc15;
}

/* small “pill” look for usernames */
.winner-username{
  font-weight: 700;
  color: #e5e7eb;
}

.winner-date{
  color:#a8b1c2;
  font-variant-numeric: tabular-nums;
}

/* responsive improvements */
@media (max-width: 640px){
  .winners-header h1{ font-size: 1.35rem; }
  table.winners-table{ min-width: 480px; }
}

/* ==========================================================
   FIX: Wheel Giveaway header → match table container
   ========================================================== */

/* Wrap header content like the table */
.winners-header{
  margin-bottom: 1rem;
  padding: 1.2rem 1.4rem;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(2,6,23,.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

/* Remove the old divider line */
.winners-header{
  border-bottom: none;
}

/* Tighten title spacing */
.winners-header h1{
  margin: 0;
}

.winners-header p{
  margin: .4rem 0 0;
}

/* Meta pill stays top-right but aligned nicely */
.winners-meta{
  align-self: flex-start;
}

/* Stats row padding consistency */
.winners-stats{
  margin-top: .9rem;
}

/* Make header + table feel connected */
.winners-table-wrap{
  margin-top: .75rem;
}

/* On mobile, keep spacing clean */
@media (max-width: 700px){
  .winners-header{
    padding: 1rem 1.1rem;
  }
}
