:root {
  --bg: #0d0d14;
  --bg-alt: #14141f;
  --bg-card: #1a1a2a;
  --bg-hover: #222238;
  --border: #2b2b44;
  --text: #e8e8f0;
  --text-dim: #9a9ab0;
  --accent: #7c5cff;
  --accent-2: #ff5c8a;
  --accent-3: #00d4a8;
  --accent-grad: linear-gradient(135deg, #7c5cff, #ff5c8a);
  --danger: #ff5c5c;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Navigation ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.logo span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: safe center;
  flex-wrap: nowrap;
  gap: 4px;
  list-style: none;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: #ff4d6d;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 18px rgba(124, 92, 255, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: rgba(255, 92, 92, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 92, 92, 0.4);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Search bar ---------- */
.search-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 20px 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.hero h1 span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 640px;
  margin: 0 auto 28px;
}

/* ---------- Layout / sections ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  width: 100%;
}

section {
  margin-bottom: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.section-head .link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Grids ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.anime-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.anime-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.anime-card .poster {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-hover);
}

.anime-card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.anime-card .info {
  padding: 10px 12px;
}

.anime-card .title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.anime-card .jtitle {
  color: var(--text-dim);
  font-size: 0.72rem;
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anime-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.anime-card .score {
  color: var(--accent-3);
  font-weight: 700;
}

.anime-card .pill {
  background: rgba(124, 92, 255, 0.2);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  align-items: center;
}

.filters select,
.filters input {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: var(--bg-hover);
  color: var(--text);
}

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

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.page-info {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- Detail page ---------- */
.detail-header {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  margin-bottom: 36px;
}

.detail-poster {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  align-self: start;
}

.detail-title {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  margin-bottom: 6px;
}

.detail-jtitle {
  color: var(--text-dim);
  margin-bottom: 14px;
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.stat strong {
  color: var(--accent-3);
}

.detail-synopsis {
  color: var(--text-dim);
  margin-bottom: 20px;
  max-width: 800px;
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.genre-tag {
  background: rgba(124, 92, 255, 0.15);
  border: 1px solid rgba(124, 92, 255, 0.35);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.trailer-wrap {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 36px;
}

.trailer-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ---------- Characters / episodes ---------- */
.sub-head {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.char-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.char-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.char-card .char-name {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 8px 2px;
}

.char-card .char-role {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0 8px 10px;
}

.ep-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}

.ep-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.ep-item .ep-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.ep-item .ep-num {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.ep-item .ep-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.ep-item .ep-score {
  color: var(--accent-3);
  font-weight: 700;
  font-size: 0.85rem;
}

.ep-item .ep-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  color: #f5b52a;
  background: rgba(245, 181, 42, 0.12);
  border: 1px solid rgba(245, 181, 42, 0.35);
}

.ep-item .ep-link {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: auto;
}

.ep-item .ep-link:hover {
  text-decoration: underline;
}

/* ---------- Reviews ---------- */
.reviews-section {
  margin-top: 36px;
}

.review-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.review-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
}

.rating-picker {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.star {
  font-size: 1.6rem;
  color: var(--border);
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
  background: none;
  border: none;
}

.star.active {
  color: #ffd54a;
  transform: scale(1.1);
}

.review {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.review .review-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.review .review-author {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.review .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  overflow: hidden;
}

.review .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review .stars {
  color: #ffd54a;
  letter-spacing: 2px;
}

.review .review-date {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.review p {
  color: var(--text-dim);
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- Rankings ---------- */
.rank-list {
  counter-reset: rank;
}

.rank-item {
  display: grid;
  grid-template-columns: 40px 60px 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.rank-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.rank-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-2);
}

.rank-item:nth-child(1) .rank-num,
.rank-item:nth-child(2) .rank-num,
.rank-item:nth-child(3) .rank-num {
  color: #ffd54a;
}

.rank-thumb {
  width: 60px;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
}

.rank-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-item .rank-title {
  font-weight: 600;
}

.rank-score {
  text-align: right;
}

.rank-score .score-big {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-3);
}

.rank-score .votes {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ---------- Chat ---------- */
.chat-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  height: 70vh;
  min-height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.msg.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg .bubble {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 14px;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.msg .bubble .msg-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.msg .bubble .msg-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.chat-input-wrap {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}

.chat-input-wrap input,
.chat-input-wrap textarea {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-wrap input:focus,
.chat-input-wrap textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.chat-input-wrap textarea {
  resize: none;
  line-height: 1.4;
}

.chat-join {
  text-align: center;
  padding: 40px 20px;
}

/* ---------- Auth ---------- */
.auth-wrap {
  max-width: 420px;
  margin: 40px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.auth-wrap h1 {
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-dim);
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 1.1rem;
  padding: 6px 8px;
  line-height: 1;
  border-radius: 6px;
}

.password-toggle:hover {
  color: var(--accent);
}

.form-error {
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.4);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.form-switch {
  text-align: center;
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.form-switch a {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- User menu ---------- */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
  font-size: 0.95rem;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Loading / skeleton ---------- */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton cards: translucent shimmer placeholders that match .anime-card */
.sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.sk-card {
  background: rgba(30, 30, 45, 0.55);
  background: color-mix(in srgb, var(--bg-card) 55%, transparent);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  animation: skFade 1.4s ease-in-out infinite;
}

.sk-poster {
  aspect-ratio: 3 / 4;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.09) 50%,
    transparent 70%
  );
  background-color: var(--bg-hover);
  background-size: 200% 100%;
  animation: skShimmer 1.4s linear infinite;
}

.sk-line {
  height: 12px;
  border-radius: 6px;
  margin: 10px 12px 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.09) 50%,
    transparent 70%
  );
  background-color: var(--bg-hover);
  background-size: 200% 100%;
  animation: skShimmer 1.4s linear infinite;
}

.sk-line.short {
  width: 55%;
  margin-top: 8px;
}

@keyframes skShimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes skFade {
  0%, 100% {
    opacity: 0.85;
  }
  50% {
    opacity: 0.55;
  }
}

/* ---------- Footer ---------- */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 28px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

footer a {
  color: var(--accent);
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .detail-header {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    max-width: 260px;
    margin: 0 auto;
  }

  .nav-links a {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }

  .rank-item {
    grid-template-columns: 30px 50px 1fr;
  }

  .rank-thumb {
    width: 50px;
  }
}

/* ---------- Gamification (ranks, badges, XP) ---------- */
.rank-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* Admin: verified badge + red name shown across the site */
.admin-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #e11d48, #9f1239);
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.5);
  white-space: nowrap;
}

.admin-name {
  color: #ff4d6d;
  font-weight: 800;
}

.msg.highlight {
  background: linear-gradient(135deg, rgba(0,212,168,.12), rgba(255,196,0,.10));
  border: 1px solid rgba(0,212,168,.45);
  box-shadow: 0 0 12px rgba(0,212,168,.12);
  border-radius: 12px;
  padding: 8px 10px;
}

.xp-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}

.xp-bar > div {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 999px;
  transition: width .4s ease;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.profile-card .avatar-lg {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  border: 3px solid rgba(255,255,255,.15);
}

.profile-card .avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stat-strip {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.stat-strip .stat {
  text-align: center;
}

.stat-strip .stat b {
  display: block;
  font-size: 1.3rem;
  color: var(--accent-3);
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
}

.user-row .avatar {
  width: 34px;
  height: 34px;
}

.friend-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dm-thread {
  display: flex;
  flex-direction: column;
  height: 55vh;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dm-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.dm-bubble.mine {
  align-self: flex-end;
  background: var(--accent-grad);
  color: #fff;
}

.dm-bubble.theirs {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.dm-bubble .dm-who {
  font-size: 0.7rem;
  opacity: .75;
  margin-bottom: 3px;
}

.dm-input {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.like-btn:hover {
  border-color: var(--accent);
  color: var(--accent-3);
}

.like-btn.liked {
  color: var(--accent-3);
  border-color: var(--accent);
}
