:root {
  --bg: #050509;
  --bg-soft: #0b0b12;
  --card-bg: rgba(10, 10, 15, 0.96);
  --border-subtle: rgba(255,255,255,0.12);
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --accent-default: #ffffff;
  --danger: #ff4b4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.06), transparent 55%),
    var(--bg) url('/assets/anime-bg.jpg') center/cover fixed no-repeat;
}

/* =========================
   Header / Layout
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(90deg, rgba(0,0,0,0.95), rgba(0,0,0,0.65));
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.logo span {
  opacity: 0.6;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.site-header nav a:hover {
  color: #fff;
}
.site-header nav a.accent {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.6);
}
.site-header nav a.accent:hover {
  background: #fff;
  color: #000;
}

.main-content {
  min-height: calc(100vh - 80px);
  padding: 32px 16px 64px;
  max-width: 960px;
  margin: 0 auto;
}

.site-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--muted);
  background: #000;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* =========================
   Hero
   ========================= */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-inner {
  max-width: 640px;
  width: 100%;
  text-align: center;
  background: rgba(2,2,8,0.96);
  padding: 40px 24px 32px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 22px 50px rgba(0,0,0,0.85);
}

.glitch-title {
  font-size: 34px;
  text-transform: lowercase;
  letter-spacing: 0.22em;
  margin: 0 0 10px;
}
.glitch-title span {
  opacity: 0.5;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* =========================
   Buttons
   ========================= */

.btn {
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  background: transparent;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}
.btn.primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.75);
}
.btn.ghost:hover {
  background: rgba(255,255,255,0.08);
}
.btn.tiny {
  padding: 3px 10px;
  font-size: 11px;
}
.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}
.btn.danger:hover {
  background: var(--danger);
  color: #000;
}

/* =========================
   Auth
   ========================= */

.auth-box {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 26px 20px 22px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 45px rgba(0,0,0,0.8);
}

.auth-box h2 {
  margin-top: 0;
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 16px;
}

.auth-box form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.auth-box label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.auth-box input,
.auth-box textarea {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  padding: 9px 10px;
  background: rgba(0,0,0,0.9);
  color: #fff;
  font-size: 14px;
}
.auth-box textarea {
  resize: vertical;
}

.error-box,
.info-box {
  font-size: 13px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}
.error-box {
  background: rgba(255,75,75,0.08);
  border: 1px solid rgba(255,75,75,0.4);
}
.info-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
}

.auth-switch {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-switch a {
  color: #fff;
  text-decoration: none;
}

/* =========================
   Dashboard
   ========================= */

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
}
@media (max-width: 800px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
}

.dash-panel {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  padding: 18px 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.75);
}

.dash-panel h2 {
  margin-top: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.profile-form,
.link-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-form label,
.link-form label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.profile-form input,
.profile-form textarea,
.link-form input,
.profile-form select,
.link-form select {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 8px 9px;
  background: rgba(3,3,8,0.95);
  color: #fff;
  font-size: 13px;
}
.profile-form textarea {
  resize: vertical;
}

.profile-url {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.profile-url code {
  display: inline-block;
  background: rgba(255,255,255,0.05);
  padding: 4px 6px;
  border-radius: 6px;
  margin-top: 3px;
}

/* Links list in dashboard */

.links-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.links-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}
.links-list li .link-label {
  font-weight: 500;
}
.links-list li .link-url {
  color: var(--muted);
  font-size: 11px;
  word-break: break-all;
}
.links-list li.empty {
  color: var(--muted);
  text-align: center;
}

.inline-form {
  display: inline-block;
}

/* =========================
   Free layout builder (dashboard)
   ========================= */

.layout-free-builder {
  margin-top: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.7);
  font-size: 12px;
}

.layout-builder-title {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.layout-free-card {
  position: relative;
  height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: radial-gradient(circle at top, rgba(255,255,255,0.12), transparent 55%);
  overflow: hidden;
}

/* draggable blocks inside preview */
.lf-block {
  position: absolute;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(10,10,20,0.95);
  font-size: 11px;
  cursor: move;
  user-select: none;
  white-space: nowrap;
}
.lf-block.dragging {
  opacity: 0.7;
}

.layout-builder-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.layout-builder-controls span {
  color: var(--muted);
  font-size: 12px;
}

.layout-builder-controls label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.layout-builder-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

/* =========================
   Profile Page (classic / split / custom)
   ========================= */

.profile-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* Base card */
.profile-card {
  margin-top: 24px;
  max-width: 520px;
  width: 100%;
  background: var(--card-bg, rgba(0,0,0,0.86));
  border-radius: 22px;
  border: 1px solid var(--border-subtle);
  padding: 20px 20px 18px;
  box-shadow: 0 22px 50px rgba(0,0,0,0.85);
  position: relative;
  overflow: hidden;
  --accent: var(--accent, var(--accent-default));
}

/* Avatar wrapper */
.avatar-wrap {
  display: inline-block;
  padding: 3px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
  flex-shrink: 0;
}

/* Avatar */
.profile-card .avatar {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--accent);
}

/* Wrapper for text / badges / links */
.profile-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

/* Name */
.profile-name {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Username */
.profile-username {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Badges */
.profile-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 40px;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.badge-emoji {
  font-size: 13px;
}

/* Bio */
.profile-bio {
  font-size: 13px;
  color: #ddd;
  margin-top: 4px;
  margin-bottom: 14px;
}

/* Profile links on public profile */
.profile-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-link-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.7);
  text-decoration: none;
  color: #fff;
  font-size: 13px;
  background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
  position: relative;
  overflow: hidden;
}

.profile-link-btn:hover {
  border-color: #fff;
}

.profile-link-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  transform: translateX(-140%);
  opacity: 0;
}

.profile-link-btn:hover::after {
  opacity: 1;
  transform: translateX(140%);
  transition: transform 0.55s ease-out;
}

.link-icon {
  font-size: 16px;
}

.profile-links .empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Layout: classic (stacked) */
.profile-card.layout-classic {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 420px;
}

.profile-card.layout-classic .profile-main {
  text-align: center;
  align-items: center;
}

.profile-card.layout-classic .avatar-wrap {
  margin-bottom: 4px;
}

/* Layout: split (avatar left, text right) */
.profile-card.layout-split {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  text-align: left;
  justify-content: center;
  padding-left: 30px;
  padding-right: 30px;
}

.profile-card.layout-split .profile-main {
  text-align: left;
  margin-left: 10px;
}

.profile-card.layout-split .avatar-wrap {
  flex-shrink: 0;
  margin-right: 10px;
}

/* Split layout – narrower buttons */
.profile-card.layout-split .profile-links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-card.layout-split .profile-link-btn {
  width: 50%;
  max-width: 360px;
  justify-content: flex-start;
  margin-left: 0;
  padding: 10px 14px;
}

/* Themes (border / glow tweaks) */
.profile-card.theme-ghost {
  border-color: rgba(255,255,255,0.45);
}
.profile-card.theme-oni {
  border-color: #ff3b3b;
  box-shadow: 0 0 26px rgba(255,59,59,0.5);
}
.profile-card.theme-vapor {
  border-color: #b478ff;
  box-shadow: 0 0 26px rgba(180,120,255,0.5);
}
.profile-card.theme-dox {
  border-color: #ffffff;
  box-shadow: 0 0 32px rgba(255,255,255,0.65);
}

/* Custom / free layout */
.profile-card.layout-free {
  max-width: 620px;
  width: 100%;
  position: relative;
  min-height: 260px;
}
.profile-card.layout-free.align-center {
  text-align: center;
}
.profile-card.layout-free.align-left {
  text-align: left;
}
.profile-card.layout-free .pf-block {
  position: absolute;
}

/* Collapse split to stacked on mobile */
@media (max-width: 620px) {
  .profile-card.layout-split {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-card.layout-split .profile-main {
    text-align: center;
  }
}

/* =========================
   Not Found
   ========================= */

.not-found {
  text-align: center;
  margin-top: 80px;
}
.not-found h2 {
  font-size: 22px;
}

/* =========================
   Responsive tweaks
   ========================= */

@media (max-width: 600px) {
  .hero-inner {
    padding: 32px 18px;
  }
  .glitch-title {
    font-size: 28px;
  }
}
