/* ==========================================================================
   RAZER — Design System
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Palette */
  --black: #0B0B0B;
  --dark: #141414;
  --dark-2: #1A1A1A;
  --white: #FFFFFF;
  --red: #E53935;
  --red-soft: rgba(229, 57, 53, 0.14);
  --red-line: rgba(229, 57, 53, 0.35);
  --muted: #9B9B9B;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* Elevation */
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);

  /* Radius */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Spacing */
  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap: 18px;
  --gap-lg: 26px;
  --gap-xl: 40px;

  --section-y: clamp(28px, 4vw, 52px);
  --card-pad: clamp(16px, 2vw, 22px);

  font-family: 'Tajawal', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

*::selection {
  background: var(--red);
  color: #fff;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--black);
  color: var(--white);
  direction: rtl;
}

body {
  font-family: 'Tajawal', Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  line-height: 1.3;
  font-weight: 800;
}

h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: clamp(18px, 2.2vw, 22px); }
h4 { font-size: clamp(16px, 1.8vw, 18px); }

p {
  margin: 0;
}

small {
  font-size: 13px;
}

/* Custom scrollbars only where a real pointer exists: on touch devices a
   fixed-width scrollbar reserves layout space and shifts the RTL document. */
@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--black); }
  ::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: var(--r-pill); }
  ::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: min(1180px, 100% - 32px);
  margin-inline: auto;
}

.page-container {
  flex: 1;
}

.page-panel {
  padding-block: var(--section-y);
  animation: fade-up 0.35s ease;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.section {
  margin-top: var(--section-y);
}

.page-header {
  margin-bottom: var(--gap-lg);
  border-inline-start: 3px solid var(--red);
  padding-inline-start: 14px;
}

.page-header h2 {
  margin-bottom: 6px;
}

.page-header p {
  color: var(--muted);
  font-size: 15px;
  max-width: 70ch;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  border-radius: var(--r-pill);
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  width: fit-content;
}

.text-link {
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
  transition: opacity 0.2s ease;
}

.text-link:hover {
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Buttons & controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

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

.btn.primary {
  background: var(--red);
  color: #fff;
}

.btn.primary:hover {
  background: #f04a44;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  color: var(--white);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.11);
}

.btn.tertiary {
  background: transparent;
  border-color: var(--red-line);
  color: var(--red);
}

.btn.tertiary:hover {
  background: var(--red-soft);
}

.btn.small {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: var(--r-xs);
}

.btn.full {
  width: 100%;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--white);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-control::placeholder {
  color: #6a6a6a;
}

.form-control:focus {
  outline: none;
  border-color: var(--red);
  background: rgba(255, 255, 255, 0.06);
}

textarea.form-control {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

select.form-control {
  cursor: pointer;
}

input[type="file"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-inline-end: 10px;
  padding: 6px 13px;
  border: 1px solid var(--red-line);
  border-radius: var(--r-xs);
  background: var(--red-soft);
  color: var(--red);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: var(--red);
  color: #fff;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 11px 18px;
  font-size: 15px;
  color: var(--white);
  transition: border-color 0.2s ease;
}

.search-input::placeholder {
  color: #6a6a6a;
}

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

.search-input.large {
  padding: 16px 22px;
  font-size: 18px;
  border-radius: var(--r-md);
}

.filter-bar,
.filter-grid {
  display: grid;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-lg);
}

.filter-bar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.filter-bar select {
  min-width: 170px;
}

.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field span {
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 11, 11, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

/* The main nav carries 15 links, so the header gets a wider track than the
   body content to keep it on a single row on large screens. */
.site-header > .container {
  width: min(1440px, 100% - 32px);
}

.header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gap);
  padding: 14px 0;
}

.brand,
.admin-brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: #050505;
}

.login-mark {
  width: 96px;
  height: 96px;
}

.header-social {
  margin-top: 0;
}

.header-social .social-icon {
  width: 34px;
  height: 34px;
}

.brand-copy,
.admin-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong,
.brand span,
.admin-brand span {
  font-size: 18px;
  color: var(--white);
  line-height: 1.1;
}

.brand small,
.admin-brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.nav-group {
  position: relative;
}

.nav-caret {
  cursor: pointer;
}

.nav-drop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 210px;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.nav-group:hover .nav-drop,
.nav-group:focus-within .nav-drop,
.nav-group.open .nav-drop {
  display: grid;
}

.nav-drop a {
  padding: 8px 12px;
  border-radius: var(--r-xs);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.nav-drop a:hover,
.nav-drop a.active {
  background: var(--red-soft);
  color: var(--white);
}

.site-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  color: var(--white);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.social-icon:hover {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
}

.trial-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 35;
  background: #1a1010;
  border-top: 1px solid var(--red-line);
  color: #f3d4d3;
  text-align: center;
  padding: 10px 36px 10px 16px;
  font-size: 13px;
}

body:has(#trialBanner:not([hidden])) {
  padding-bottom: 48px;
}

.trial-banner-close {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.legal-page {
  max-width: 760px;
}

.legal-page .panel {
  display: grid;
  gap: 14px;
}

.legal-page h3 {
  color: var(--red);
  font-size: 15px;
}

.artist-profile {
  display: grid;
  gap: var(--gap-lg);
  padding-block: var(--section-y);
}

.artist-profile-hero {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--gap-lg);
  align-items: start;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--card-pad);
}

.artist-profile-hero img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--r-md);
}

.search-hit {
  cursor: pointer;
}

button.search-hit {
  width: 100%;
  display: grid;
  text-align: inherit;
  font: inherit;
  color: inherit;
  background: var(--dark);
  border: 1px solid var(--line);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 7px;
  border-radius: var(--r-xs);
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--white);
  background: var(--red-soft);
}

.inline-link {
  color: var(--red);
  text-decoration: underline;
  word-break: break-word;
}

.btn-delete-own-post {
  margin-top: 8px;
  min-height: 40px;
  touch-action: manipulation;
}

.post-status {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.dm-toast {
  position: fixed;
  inset-block-start: 12px;
  inset-inline: 12px;
  z-index: 120;
  width: min(420px, calc(100% - 24px));
  margin-inline: auto;
  display: grid;
  gap: 2px;
  text-align: start;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--red-line);
  background: var(--dark);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}

.dm-toast[hidden] {
  display: none !important;
}

.dm-toast strong {
  font-size: 14px;
}

.dm-toast span {
  color: var(--muted);
  font-size: 13px;
}

.nav-badge {
  background: var(--red);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  margin-inline-start: 5px;
  line-height: 17px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 12px 4px 4px;
}

.header-identity:empty {
  display: none;
}

.identity-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
}

.identity-copy strong {
  font-size: 13px;
  color: var(--white);
}

.identity-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.guest-tag {
  background: var(--red-soft);
  color: var(--red);
  border-radius: var(--r-xs);
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
}

.mobile-menu-btn {
  display: none;
}

/* Two columns keep the 15-item menu on screen without scrolling. */
.mobile-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 10px 16px 18px;
  border-top: 1px solid var(--line);
  background: var(--black);
}

.mobile-menu a {
  padding: 11px 12px;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 600;
  font-size: 14.5px;
  text-align: center;
}

.mobile-menu a:hover,
.mobile-logout-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.mobile-logout-btn {
  padding: 11px 12px;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, 0.04);
  color: var(--red);
  font-weight: 700;
  font-size: 14.5px;
  text-align: center;
  border: none;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.home-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--gap-xl);
  align-items: center;
  padding-block: clamp(20px, 4vw, 46px);
}

.hero-copy {
  position: relative;
  display: grid;
  gap: 16px;
  align-content: start;
}

.razer-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}

.hero-copy > *:not(.razer-hero-canvas) {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  font-size: clamp(44px, 8vw, 84px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
}

.hero-copy p {
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 17px);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hero-status {
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  width: fit-content;
}

.hero-media {
  min-width: 0;
}

.hero-slider {
  position: relative;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 30px);
  min-height: 300px;
  display: grid;
  align-content: center;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-slider::before {
  content: '';
  position: absolute;
  inset-block-start: -60%;
  inset-inline-end: -30%;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(229, 57, 53, 0.18), transparent 70%);
  pointer-events: none;
}

.hero-slide {
  display: none;
  gap: 12px;
  grid-auto-rows: max-content;
  animation: fade-up 0.4s ease;
}

.hero-slide.active {
  display: grid;
}

.hero-slide h2 {
  font-size: clamp(20px, 2.4vw, 27px);
}

.hero-slide p {
  color: var(--muted);
  font-size: 15px;
}

.slider-dots {
  position: absolute;
  inset-block-end: 18px;
  inset-inline-start: clamp(20px, 3vw, 30px);
  display: flex;
  gap: 7px;
}

.slider-dot {
  width: 22px;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, width 0.25s ease;
}

.slider-dot.active {
  background: var(--red);
  width: 34px;
}

/* --------------------------------------------------------------------------
   Panels & generic cards
   -------------------------------------------------------------------------- */

.panel {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  min-width: 0;
}

.mini-panel,
.featured-panel {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  margin-bottom: var(--gap-sm);
}

.panel-head h3,
.panel-head h4 {
  margin: 0;
}

.section-grid,
.large-grid,
.split-grid {
  display: grid;
  gap: var(--gap);
  margin-top: var(--section-y);
}

.section-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.large-grid,
.split-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card-list {
  display: grid;
  gap: var(--gap-sm);
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 16px;
  display: grid;
  gap: 8px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card h4 {
  font-size: 16px;
}

.card p {
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta small {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.clickable {
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */

#newsList,
#articlesList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.news-card,
.article-card {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.news-card:hover,
.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--red-line);
  box-shadow: var(--shadow);
}

.news-card-image,
.article-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f0f0f;
}

.news-card-image img,
.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.news-card:hover .news-card-image img,
.article-card:hover .article-card-image img {
  transform: scale(1.05);
}

.news-category,
.article-category {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  background: var(--red);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
}

.news-card-content,
.article-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.news-card-content h3,
.article-card-content h3 {
  font-size: 17px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-excerpt,
.article-excerpt {
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-meta,
.article-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.news-author,
.article-author {
  font-weight: 700;
  color: #cfcfcf;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-tag {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 11px;
  color: var(--muted);
}

.news-comments-header,
.card-comments-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12.5px;
  color: var(--muted);
}

.comments-count {
  font-weight: 600;
}

.read-more {
  color: var(--red);
  font-weight: 700;
}

.news-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.news-like-btn:hover {
  border-color: var(--red-line);
  background: var(--red-soft);
}

.news-like-btn.liked {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
}

.heart {
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.heart.filled {
  color: var(--red);
  transform: scale(1.15);
}

.like-count {
  font-weight: 700;
}

.news-empty {
  grid-column: 1 / -1;
}

/* News modal */
.news-modal {
  width: min(760px, 100%);
  max-height: 88vh;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.news-modal > .modal-head {
  padding: var(--card-pad) var(--card-pad) var(--gap-sm);
  margin-bottom: 0;
  flex-shrink: 0;
}

.news-modal-content {
  overflow-y: auto;
  padding: 0 0 var(--card-pad);
}

.news-modal-header {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 0 var(--card-pad) var(--gap-sm);
}

.news-modal-header img {
  width: calc(100% + var(--card-pad) * 2);
  margin-inline-start: calc(var(--card-pad) * -1);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 14px;
}

.news-modal-header h3 {
  font-size: clamp(20px, 2.6vw, 27px);
}

.news-modal-body {
  padding: 0 var(--card-pad);
  display: grid;
  gap: 12px;
  color: #d6d6d6;
  font-size: 15.5px;
  line-height: 1.85;
}

.news-modal-comments {
  padding: var(--gap) var(--card-pad) 0;
  margin-top: var(--gap);
  border-top: 1px solid var(--line);
  display: grid;
  gap: var(--gap-sm);
}

.modal-news-like {
  width: fit-content;
}

.no-comments {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-sm);
}

.comments-list {
  display: grid;
  gap: 10px;
}

.comment {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 13px 15px;
  display: grid;
  gap: 7px;
}

.comment-reply {
  background: rgba(255, 255, 255, 0.05);
  border-inline-start: 2px solid var(--red-line);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-author {
  font-size: 14px;
  color: var(--white);
}

.comment-time {
  color: var(--muted);
  font-size: 11.5px;
}

.comment-body p {
  font-size: 14.5px;
  color: #d6d6d6;
}

.comment-actions {
  display: flex;
  gap: 8px;
}

.btn-like,
.btn-reply,
.btn-comment {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-like:hover,
.btn-reply:hover,
.btn-comment:hover {
  background: var(--red-soft);
  color: var(--white);
}

.replies-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-inline-start: 14px;
}

.comment-form-section {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.comment-input {
  flex: 1;
  min-width: 200px;
}

/* --------------------------------------------------------------------------
   Tiles (artists / producers)
   -------------------------------------------------------------------------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--gap);
}

.tile-list {
  display: grid;
  gap: var(--gap-sm);
}

.tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--red-line);
}

.tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tile-head h4 {
  font-size: 17px;
}

.tile-head small {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.tile-body p {
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.artist-name-btn {
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.artist-name-btn:hover {
  color: var(--red);
}

.exploding-name {
  display: inline-flex;
  gap: 1px;
}

.explosion-char {
  display: inline-block;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.5s ease, color 0.3s ease;
}

/* Artist modal */
.artist-modal {
  width: min(720px, 100%);
  max-height: 88vh;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--card-pad);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.artist-modal-content {
  display: grid;
  gap: var(--gap);
  margin-top: var(--gap-sm);
}

.artist-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--line);
}

.artist-detail-header h3 {
  font-size: clamp(22px, 3vw, 30px);
}

.artist-role {
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.artist-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
}

.artist-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.artist-detail-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.artist-detail-card strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.artist-detail-card p {
  font-size: 14.5px;
  font-weight: 600;
}

.artist-detail-body {
  display: grid;
  gap: var(--gap-sm);
}

.artist-detail-section {
  display: grid;
  gap: 8px;
}

.artist-detail-section > strong {
  color: var(--red);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.artist-detail-section p {
  color: #cfcfcf;
  font-size: 14.5px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.social-link:hover {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
}

/* Track list */
.track-list {
  display: grid;
  gap: 10px;
}

.track-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.track-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--red-line);
}

.track-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: #0f0f0f;
}

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

.track-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: 22px;
}

.track-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.track-info strong {
  font-size: 15px;
}

.track-card .track-url {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-listen {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Releases / reels / videos
   -------------------------------------------------------------------------- */

#releasesList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.reel-card {
  position: relative;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.reel-card:hover {
  transform: translateY(-4px);
  border-color: var(--red-line);
  box-shadow: var(--shadow);
}

.reel-card.no-url {
  cursor: default;
}

.reel-card.no-url:hover {
  transform: none;
}

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

.reel-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.reel-card:hover .reel-overlay {
  opacity: 1;
}

.play-button {
  background: var(--red);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
}

.reel-copy {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.reel-copy h4 {
  font-size: 16px;
}

.reel-copy p {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.video-card {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--red-line);
}

.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-meta {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.video-meta strong {
  font-size: 15.5px;
}

.video-meta p {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta small {
  color: var(--red);
  font-size: 11.5px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Dictionary
   -------------------------------------------------------------------------- */

.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}

.term-card {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  display: grid;
  gap: 8px;
  border-inline-start: 3px solid var(--red);
  transition: transform 0.2s ease;
}

.term-card:hover {
  transform: translateY(-3px);
}

.term-card strong {
  font-size: 18px;
}

.term-card strong span {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  margin-inline-start: 6px;
}

.term-card p {
  color: #cfcfcf;
  font-size: 14px;
}

.term-card small {
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

/* --------------------------------------------------------------------------
   Chat
   -------------------------------------------------------------------------- */

.chat-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

.chat-sidebar {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  display: grid;
  gap: 10px;
  align-content: start;
}

.chat-stats {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.chat-stats span {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--r-xs);
  padding: 7px 11px;
}

/* Live indicator: green dot while the realtime stream is connected. */
#chatOnlineLabel.is-live {
  color: var(--white);
}

#chatOnlineLabel.is-live::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-end: 7px;
  border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 0 3px rgba(53, 208, 127, 0.18);
  animation: chatPulse 2s ease-in-out infinite;
}

@keyframes chatPulse {
  50% { opacity: 0.45; }
}

.chat-panel {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  display: grid;
  gap: var(--gap-sm);
  min-width: 0;
}

.chat-reply-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  font-size: 13px;
}

.chat-window {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 180px;
  max-height: min(56vh, 520px);
  overflow-y: auto;
  padding-inline-end: 6px;
}

.chat-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.chat-row-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-row-header small {
  color: var(--muted);
  font-size: 11.5px;
  margin-inline-start: auto;
}

.chat-row p {
  font-size: 14.5px;
  word-break: break-word;
}

.chat-user-link {
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.chat-quote {
  background: rgba(255, 255, 255, 0.05);
  border-inline-start: 2px solid var(--red);
  border-radius: var(--r-xs);
  padding: 7px 11px;
  font-size: 12.5px;
  color: var(--muted);
}

.chat-quote strong {
  color: var(--red);
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-action-btn,
.chat-reaction {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px 11px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.chat-action-btn:hover,
.chat-reaction:hover {
  background: var(--red-soft);
  color: var(--white);
}

/* Reaction the current user already tapped. */
.chat-reaction.mine {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--white);
}

.chat-action-btn.small {
  padding: 2px 9px;
  font-size: 11px;
}

.chat-form {
  display: flex;
  gap: 10px;
}

.chat-form .form-control {
  flex: 1;
}

.chat-preview {
  display: grid;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Avatars
   -------------------------------------------------------------------------- */

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.user-avatar.sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.user-avatar.lg {
  width: 96px;
  height: 96px;
  font-size: 36px;
}

.avatar-fallback {
  border-radius: 50%;
}

.avatar-picker {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.avatar-preview {
  display: grid;
  place-items: center;
}

.avatar-preview img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--red-line);
}

/* --------------------------------------------------------------------------
   Posts (stories)
   -------------------------------------------------------------------------- */

.posts-layout,
.ads-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

.ads-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.post-form,
.ad-form {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 90px;
}

.post-form h3,
.ad-form h3 {
  margin-bottom: 2px;
}

.post-form label,
.ad-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.posts-feed {
  display: grid;
  gap: var(--gap);
}

.story-card {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  display: grid;
  gap: 12px;
}

.story-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-head div {
  display: grid;
}

.story-head small {
  color: var(--muted);
  font-size: 11.5px;
}

.story-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--r-sm);
}

.story-card p {
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   Ads
   -------------------------------------------------------------------------- */

.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.ad-card {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  display: grid;
  gap: 10px;
  align-content: start;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ad-card:hover {
  transform: translateY(-3px);
  border-color: var(--red-line);
}

.ad-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-sm);
}

.ad-card p {
  color: var(--muted);
  font-size: 14px;
}

.ad-card .btn {
  width: fit-content;
}

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */

.profile-header {
  display: flex;
  gap: var(--gap-lg);
  align-items: flex-start;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 30px);
  margin-bottom: var(--gap-lg);
}

.profile-info {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.profile-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-title h2 {
  font-size: clamp(22px, 3vw, 30px);
}

.profile-name {
  color: var(--muted);
  font-size: 15px;
}

.profile-bio {
  margin-top: 8px;
  font-size: 15px;
  color: #d6d6d6;
  max-width: 60ch;
  word-break: break-word;
}

.profile-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 14px 0;
  font-size: 14px;
}

.profile-stats span,
.profile-stats button {
  color: var(--muted);
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.profile-stats button:hover {
  color: var(--white);
}

.profile-stats strong {
  color: var(--white);
  font-weight: 800;
  margin-inline-end: 3px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-posts {
  display: grid;
  gap: var(--gap-sm);
}

.profile-posts h3 {
  margin-bottom: 4px;
}

.profile-link {
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  transition: color 0.2s ease;
}

.profile-link:hover {
  color: var(--red);
}

/* --------------------------------------------------------------------------
   Members
   -------------------------------------------------------------------------- */

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--gap);
}

.member-card {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 16px;
  display: grid;
  gap: 7px;
  justify-items: center;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.member-card:hover {
  transform: translateY(-3px);
  border-color: var(--red-line);
}

.member-card small {
  color: var(--muted);
}

.member-card p {
  color: var(--muted);
  font-size: 13px;
  min-height: 20px;
}

.member-stats {
  color: var(--red);
  font-size: 12.5px;
  font-weight: 700;
}

.member-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Direct messages
   -------------------------------------------------------------------------- */

.dm-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

.dm-sidebar {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
  display: grid;
  gap: 4px;
  align-content: start;
  max-height: 64vh;
  overflow-y: auto;
}

.dm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  transition: background 0.2s ease;
}

.dm-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dm-item.active {
  background: var(--red-soft);
}

.dm-item-body {
  display: grid;
  flex: 1;
  min-width: 0;
}

.dm-item-body strong {
  font-size: 14px;
}

.dm-item-body small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-unread {
  background: var(--red);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

.dm-empty {
  padding: 16px;
  font-size: 14px;
  text-align: center;
}

.dm-panel {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  display: grid;
  gap: var(--gap-sm);
  min-width: 0;
}

.dm-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dm-messages {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 160px;
  max-height: min(50vh, 460px);
  overflow-y: auto;
  padding-inline-end: 6px;
}

.dm-bubble {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--r-md);
  border-end-start-radius: 4px;
  padding: 10px 14px;
  max-width: min(78%, 460px);
  justify-self: start;
  display: grid;
  gap: 3px;
}

.dm-bubble.mine {
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  justify-self: end;
  border-end-start-radius: var(--r-md);
  border-end-end-radius: 4px;
}

.dm-bubble p {
  font-size: 14.5px;
  word-break: break-word;
}

.dm-bubble small {
  color: var(--muted);
  font-size: 10.5px;
  justify-self: end;
}

.dm-form {
  display: flex;
  gap: 10px;
}

.dm-form .btn {
  min-height: 44px;
  touch-action: manipulation;
}

.dm-form .form-control {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
  align-items: start;
}

.contact-form {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  display: grid;
  gap: 12px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.contact-info p {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 12px;
}

.contact-meta {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 8px;
}

.contact-meta strong {
  color: var(--red);
  margin-inline-end: 6px;
}

/* --------------------------------------------------------------------------
   Search overlay
   -------------------------------------------------------------------------- */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  padding-top: clamp(50px, 10vh, 110px);
  overflow-y: auto;
}

.search-panel {
  display: grid;
  gap: var(--gap);
}

.overlay-head {
  display: grid;
}

.search-results {
  display: grid;
  gap: var(--gap);
  padding-bottom: 60px;
}

.search-category {
  display: grid;
  gap: 10px;
}

.search-category h4 {
  color: var(--red);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */

.modal-overlay,
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  padding: 18px;
}

.modal-panel,
.auth-modal {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--card-pad);
  box-shadow: var(--shadow-lg);
}

.modal-head,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--line);
}

.modal-head h3,
.modal-header h3 {
  margin: 0;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-body label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.modal-error {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.modal-video-panel {
  width: min(900px, 100%);
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--card-pad);
  box-shadow: var(--shadow-lg);
}

.modal-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
}

.modal-video-body {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r-sm);
  overflow: hidden;
}

.modal-video-body > div,
.modal-video-body iframe,
.modal-video-body video {
  width: 100%;
  height: 100%;
  border: none;
}

.image-preview-wrap {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin-top: 8px;
}

.image-preview-wrap img {
  max-width: 190px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}

.image-preview-wrap span {
  color: var(--muted);
  font-size: 12px;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.auth-note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */

body.auth-locked .app-shell {
  visibility: hidden;
}

body.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(circle at 15% 0%, rgba(229, 57, 53, 0.16), transparent 55%),
    radial-gradient(circle at 85% 100%, rgba(229, 57, 53, 0.1), transparent 55%),
    var(--black);
}

.login-shell {
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 22px;
  justify-items: center;
}

.login-brand {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.login-mark {
  width: 96px;
  height: 96px;
  margin-inline: auto;
  object-fit: contain;
  border-radius: 12px;
}

.login-logo {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--red);
  line-height: 1;
}

.login-brand small {
  color: var(--muted);
  font-size: 13px;
}

.login-card {
  width: 100%;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-title {
  font-size: 24px;
}

.login-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.login-card .auth-form {
  text-align: start;
}

.login-card .btn {
  margin-top: 4px;
  min-height: 46px;
  touch-action: manipulation;
}

.auth-tabs {
  display: flex;
  gap: 5px;
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--r-sm);
  padding: 5px;
  position: relative;
  z-index: 3;
}

.auth-tab {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 10px 8px;
  border: none;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 3;
  pointer-events: auto;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab.active,
body:has(#register:target) #authTabRegister,
body:not(:has(#register:target)) #authTabLogin {
  background: var(--red);
  color: #fff;
}

body:has(#register:target) #authTabLogin {
  background: transparent;
  color: var(--muted);
}

#register:target {
  display: block !important;
}

body:has(#register:target) #login.auth-panel {
  display: none !important;
}

.auth-divider {
  position: relative;
  margin: 18px 0;
  color: var(--muted);
}

.auth-divider::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 1px;
  background: var(--line-strong);
}

.auth-divider span {
  position: relative;
  background: var(--dark);
  padding: 0 12px;
  font-size: 13px;
}

/* Admin login */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(229, 57, 53, 0.14), transparent 55%),
    var(--black);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: 27px;
}

.auth-card p {
  color: var(--muted);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Admin dashboard
   -------------------------------------------------------------------------- */

.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--dark);
  border-inline-end: 1px solid var(--line);
  padding: 22px 16px;
  display: grid;
  gap: var(--gap);
  align-content: start;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-nav {
  display: grid;
  gap: 3px;
}

.admin-link {
  text-align: start;
  padding: 10px 13px;
  border-radius: var(--r-xs);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
}

.admin-link.active {
  background: var(--red);
  color: #fff;
}

.admin-link.locked {
  opacity: 0.45;
  cursor: not-allowed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-link.locked:hover {
  background: transparent;
  color: var(--muted);
}

.lock-mark {
  font-size: 13px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.4;
}

.rank-super {
  color: #fff4c2;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.rank-admin {
  color: #f3d27a;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.55);
}

.rank-manager {
  color: #e8e8e8;
  background: rgba(192, 192, 192, 0.14);
  border: 1px solid rgba(192, 192, 192, 0.55);
}

.chat-row-header .rank-badge,
.profile-title .rank-badge,
.member-card .rank-badge {
  margin-inline-start: 6px;
}

.btn-comment-delete {
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  padding: 6px 10px;
  touch-action: manipulation;
}

.admin-logout {
  width: 100%;
}

.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  padding: 22px clamp(18px, 3vw, 32px);
  background: rgba(11, 11, 11, 0.96);
  border-bottom: 1px solid var(--line);
}

.admin-header h1 {
  font-size: clamp(20px, 2.4vw, 26px);
}

.admin-header p {
  color: var(--muted);
  font-size: 13.5px;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-size: 13px;
  color: var(--muted);
}

.admin-content {
  padding: clamp(18px, 3vw, 32px);
  flex: 1;
}

.admin-section {
  display: grid;
  gap: var(--gap);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--gap-sm);
}

.stat-card {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.stat-card span {
  font-family: 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 800;
}

.stat-card small {
  color: var(--muted);
  font-size: 12.5px;
}

.stat-card.red span {
  color: var(--red);
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  display: grid;
  gap: 3px;
}

.activity-meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.data-grid {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  align-items: center;
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  font-size: 14px;
}

.table-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-actions .btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-delete {
  border-color: var(--red-line);
  color: var(--red);
}

.admin-confirm-panel {
  width: min(420px, 100%);
}

.admin-confirm-panel p {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.admin-confirm-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-confirm-actions .btn {
  flex: 1;
  min-height: 48px;
  touch-action: manipulation;
}

.chat-managers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}

/* Admin track editor */
.track-group {
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px;
}

.track-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.track-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Spotlight / footer / visitor counter
   -------------------------------------------------------------------------- */

.spotlight-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 30px);
  margin-top: var(--section-y);
}

.spotlight-copy {
  display: grid;
  gap: 10px;
  align-content: start;
}

.spotlight-copy p {
  color: var(--muted);
  font-size: 15px;
}

.spotlight-chat {
  display: grid;
  gap: 10px;
  align-content: start;
}

.site-footer {
  margin-top: var(--section-y);
  border-top: 1px solid var(--line);
  padding-block: var(--gap-xl);
  background: var(--dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap-lg);
}

.footer-grid h3 {
  color: var(--red);
  margin-bottom: 8px;
}

.footer-grid h4 {
  margin-bottom: 10px;
  font-size: 15px;
}

.footer-grid p {
  color: var(--muted);
  font-size: 14px;
}

.footer-grid a,
.footer-grid span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  padding: 3px 0;
  transition: color 0.2s ease;
}

.footer-grid a:hover {
  color: var(--red);
}

.visitor-counter {
  position: fixed;
  inset-block-end: 18px;
  inset-inline-start: 18px;
  z-index: 30;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-size: 12.5px;
  box-shadow: var(--shadow-sm);
}

.visitor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

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

@media (max-width: 1100px) {
  .main-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-grid;
  }

  .header-grid {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand search menu"
      "identity identity identity";
    align-items: center;
    gap: 10px 8px;
  }

  .brand {
    grid-area: brand;
    min-width: 0;
  }

  .site-header .brand-copy small {
    display: none;
  }

  .header-identity .identity-copy strong {
    font-size: 15px;
  }

  .header-identity .identity-copy small {
    font-size: 12px;
  }

  .header-actions {
    display: contents;
  }

  .header-social,
  .header-admin,
  .header-actions > #logoutBtn {
    display: none !important;
  }

  #searchToggle {
    grid-area: search;
  }

  .mobile-menu-btn {
    grid-area: menu;
  }

  .header-identity {
    grid-area: identity;
    width: 100%;
    justify-content: flex-start;
    padding: 8px 12px;
    border-radius: 12px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
  }

  .chat-shell,
  .dm-layout,
  .posts-layout,
  .ads-layout {
    grid-template-columns: 1fr;
  }

  .ads-layout {
    grid-template-areas: none;
  }

  .post-form,
  .ad-form {
    position: static;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    border-inline-end: none;
    border-bottom: 1px solid var(--line);
  }

  .admin-nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .admin-link {
    text-align: center;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .row-actions {
    justify-content: stretch;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .row-actions .btn {
    flex: 1;
    min-height: 44px;
    font-size: 15px;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(1180px, 100% - 24px);
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-bar select {
    min-width: 0;
  }

  #newsList,
  #articlesList,
  #releasesList,
  .tile-grid,
  .video-grid,
  .term-grid,
  .members-grid,
  .ads-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-info {
    justify-items: center;
  }

  .profile-title,
  .profile-stats,
  .profile-actions {
    justify-content: center;
  }

  .profile-bio {
    max-width: none;
  }

  .artist-profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .dm-sidebar {
    max-height: 240px;
  }

  .dm-bubble {
    max-width: 88%;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .row-actions {
    justify-content: stretch;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .row-actions .btn {
    flex: 1;
    min-height: 44px;
    font-size: 15px;
  }

  .track-row {
    grid-template-columns: 1fr;
  }

  .chat-window {
    max-height: 60vh;
  }

  .visitor-counter {
    inset-block-end: 12px;
    inset-inline-start: 12px;
    padding: 6px 13px;
    font-size: 11.5px;
  }

  .news-modal-header img {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 480px) {
  .hero-actions .btn,
  .profile-actions .btn {
    flex: 1;
  }

  .btn {
    padding: 10px 16px;
  }

  .chat-form,
  .dm-form {
    flex-wrap: wrap;
  }

  .chat-form .btn,
  .dm-form .btn {
    width: 100%;
  }

  .member-actions {
    width: 100%;
    flex-direction: column;
  }

  .member-actions .btn {
    width: 100%;
  }

  .login-card {
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
