/* ==========================================
   TrasX Premium Social CSS Design System
   ========================================== */

/* Design Tokens & Theme Variables */
:root {
  --bg-app: #f4f6fa;
  --bg-card: #ffffff;
  --bg-input: #f0f2f5;
  --bg-hover: rgba(0, 0, 0, 0.03);

  --primary: #1877f2;
  --primary-light: #e7f3ff;
  --primary-dark: #125ec2;

  --text-primary: #1c1e21;
  --text-secondary: #65676b;
  --text-muted: #8d949e;
  --text-main: var(--text-primary);

  --border-color: #ebedf0;
  --border-color-hover: #dadde1;

  --badge-red: #f02849;
  --badge-purple: #820ad1;
  --success: #10b981;
  --danger: #ef4444;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.06);
  --shadow-premium: 0 15px 35px -5px rgba(24, 119, 242, 0.08), 0 5px 15px -3px rgba(0, 0, 0, 0.03);

  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-card: 18px;
  --border-radius-pill: 30px;
  --border-radius-item: 12px;

  /* Comments Drawer Theme Variables */
  --bg-comments-drawer: #ffffff;
  --text-comments-drawer: var(--text-primary);
  --close-btn-bg: rgba(0, 0, 0, 0.05);
  --close-btn-hover: rgba(0, 0, 0, 0.1);
  --input-bg-comments: #f0f2f5;
  --input-border-comments: rgba(0, 0, 0, 0.08);
  --input-text-comments: #1c1e21;

  /* Font smoothing */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   Dark Mode & Theme Switching
   ========================================== */

/* Dark Mode Colors & Theme Overrides */
body[data-theme="dark"] {
  --bg-app: #0b0f19;
  /* Deep navy slate bg */
  --bg-card: #151f32;
  /* Premium dark slate card */
  --bg-input: #222f47;
  /* Input area */

  --primary: #38bdf8;
  /* Bright Sky blue */
  --primary-light: rgba(56, 189, 248, 0.15);
  --primary-dark: #0ea5e9;

  --text-primary: #f8fafc;
  /* Clean white-grey */
  --text-secondary: #94a3b8;
  /* Muted text */
  --text-muted: #64748b;
  /* Subtext */
  --text-main: var(--text-primary);

  --bg-hover: rgba(148, 163, 184, 0.10);

  --border-color: #1e293b;
  /* Subtle dark borders */
  --border-color-hover: #334155;

  --success: #34d399;
  --danger: #f87171;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.4);
  --shadow-premium: 0 15px 35px -5px rgba(56, 189, 248, 0.05), 0 5px 15px -3px rgba(0, 0, 0, 0.2);

  /* Comments Drawer Theme Variables Override */
  --bg-comments-drawer: rgba(21, 31, 50, 0.92);
  --close-btn-bg: rgba(255, 255, 255, 0.08);
  --close-btn-hover: rgba(255, 255, 255, 0.15);
  --input-bg-comments: #222f47;
  --input-border-comments: rgba(255, 255, 255, 0.1);
  --input-text-comments: #f8fafc;
}

/* Image adjustments for Dark Mode */
body[data-theme="dark"] img {
  filter: brightness(0.85) contrast(1.05);
}

/* Scrollbar adjustments for Dark Mode */
body[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.progressive-hidden {
  display: none !important;
}

.progressive-feed-sentinel {
  width: 100%;
  height: 12px;
  pointer-events: none;
}

/* Theme Toggle Button Icon Switching */
body[data-theme="dark"] .theme-icon-moon {
  display: none !important;
}

body[data-theme="dark"] .theme-icon-sun {
  display: block !important;
}

body:not([data-theme="dark"]) .theme-icon-sun {
  display: none !important;
}

body:not([data-theme="dark"]) .theme-icon-moon {
  display: block !important;
}


/* Reset & Core Setup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: clip;
  color-scheme: light;
}

body[data-theme="dark"] {
  color-scheme: dark;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

button {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  color: var(--text-primary);
  caret-color: var(--primary);
  font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
textarea,
select {
  -webkit-text-fill-color: var(--text-primary);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary);
  box-shadow: 0 0 0 1000px var(--bg-card) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ccd0d5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #90949c;
}

/* ==========================================
   Layout Containers
   ========================================== */

.app-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 24px;
  flex: 1;
  position: relative;
  align-items: start;
}

/* Hide mobile controls by default */
.mobile-header,
.mobile-nav,
.mobile-drawer {
  display: none;
}

/* ==========================================
   Header Component
   ========================================== */

.app-header {
  height: 70px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
}

/* Logo styling */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: url('/assets/trasx-logo-mark.png') center/cover no-repeat;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(24, 119, 242, 0.3);
  flex-shrink: 0;
}

.logo-icon::before {
  content: none;
}

.logo-icon::after {
  content: none;
}

/* Search Bar */
.search-bar {
  background-color: var(--bg-input);
  border-radius: var(--border-radius-pill);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  height: 42px;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.search-bar:focus-within {
  background-color: var(--bg-card);
  border-color: rgba(24, 119, 242, 0.4);
  box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.1);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.search-bar input {
  border: none;
  background: none;
  width: 100%;
  height: 100%;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* Header Right Buttons */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  background-color: var(--bg-input);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.icon-btn i {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid var(--bg-card);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 2;
  pointer-events: none;
}

.icon-btn .badge.red {
  background-color: var(--badge-red);
}

.mobile-notification-btn {
  width: 36px;
  height: 36px;
}

.mobile-notification-btn i,
.mobile-notification-btn svg {
  width: 18px;
  height: 18px;
}

.notifications-dropdown-panel {
  position: fixed !important;
  top: 76px !important;
  right: 24px !important;
  width: min(320px, calc(100vw - 24px)) !important;
  max-height: min(420px, calc(100dvh - 96px));
  overflow: hidden;
  z-index: 2200 !important;
}

/* Profile Dropdown Button */
.profile-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background-color: var(--bg-input);
  border-radius: var(--border-radius-pill);
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.profile-dropdown:hover {
  background-color: var(--border-color-hover);
}

.avatar {
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.header-avatar {
  width: 34px;
  height: 34px;
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropdown-arrow {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

/* Dropdown Menu Popup */
.dropdown-menu {
  position: absolute;
  top: 50px;
  right: 0;
  background-color: var(--bg-card);
  border-radius: var(--border-radius-item);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  width: 180px;
  padding: 8px 0;
  display: none;
  flex-direction: column;
  z-index: 120;
  animation: slideInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dropdown-menu.active {
  display: flex;
}

.dropdown-menu a {
  padding: 10px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

.dropdown-menu a:hover {
  background-color: var(--bg-input);
  color: var(--primary);
}

.dropdown-menu i {
  width: 16px;
  height: 16px;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   Sidebar Common & Left Sidebar
   ========================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 94px;
  /* 70px header height + 24px top padding */
  max-height: calc(100vh - 118px);
  /* 100vh - 70px header - 24px top padding - 24px bottom padding */
  overflow-y: auto;
  align-self: start;
  /* Prevent the sidebar from stretching to the full grid height so sticky works */
}


/* Profile Card */
.profile-card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-card);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.profile-card:hover {
  box-shadow: var(--shadow-md);
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.card-avatar {
  width: 48px;
  height: 48px;
}

.profile-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-card-name {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-badge,
.verified-badge-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
  vertical-align: middle;
  color: var(--primary);
}

.verified-badge {
  width: 17px;
  height: 17px;
}

.verified-badge-small {
  width: 13px;
  height: 13px;
}

.verified-badge svg,
.verified-badge-small svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.verified-badge svg > :nth-child(1),
.verified-badge-small svg > :nth-child(1) {
  stroke: currentColor !important;
  fill: currentColor !important;
  stroke-width: 1.4 !important;
}

.verified-badge svg > :nth-child(2),
.verified-badge-small svg > :nth-child(2) {
  stroke: #ffffff !important;
  fill: none !important;
  stroke-width: 2.1 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verified-badge svg *,
.verified-badge-small svg * {
  vector-effect: non-scaling-stroke;
}

/* Certification Types Colors */
.verified-badge[data-type="Basique"],
.verified-badge-small[data-type="Basique"] {
  color: #3b82f6;
}

.verified-badge[data-type="VIP"],
.verified-badge-small[data-type="VIP"] {
  color: #eab308;
}

.verified-badge[data-type="Gouvernement"],
.verified-badge-small[data-type="Gouvernement"] {
  color: #22c55e;
}

.verified-badge[data-type="Entreprise"],
.verified-badge-small[data-type="Entreprise"] {
  color: #a855f7;
}

.verified-badge[data-type="None"],
.verified-badge-small[data-type="None"] {
  display: none !important;
}

.profile-card-handle {
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  text-align: center;
  justify-content: space-around;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Navigation Menu */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--bg-card);
  border-radius: var(--border-radius-card);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-item);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.nav-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-item i {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.nav-item:hover i {
  transform: scale(1.1);
}

.nav-item.active {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.2);
}

.nav-item.active:hover {
  color: white;
  background-color: var(--primary);
}

.nav-badge {
  font-size: 11px;
  font-weight: 600;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}

.nav-badge.red {
  background-color: var(--badge-red);
}

.nav-badge.purple {
  background-color: var(--badge-purple);
}

.sidebar-divider {
  border: none;
  border-top: none;
  display: none;
}

/* Pages Section */
.pages-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-card);
  border-radius: var(--border-radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
}

.page-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-primary);
}

.page-item:hover .page-name {
  color: var(--primary);
}

.page-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.page-icon.uiux {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
}

.page-icon.webdes {
  background: linear-gradient(135deg, #8a2be2, #4a00e0);
}

.page-icon.dribbble {
  background: linear-gradient(135deg, #ea4c89, #ff758f);
}

.page-icon.behance {
  background: linear-gradient(135deg, #053eff, #001f80);
}

.page-name {
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-all-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-block;
  margin-top: 4px;
}

.view-all-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-links a:hover {
  text-decoration: underline;
}

.copyright {
  font-size: 11px;
}

/* ==========================================
   Middle Feed Column Components
   ========================================== */

.feed-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-x: hidden;
}

/* ==========================================
   Settings Page
   ========================================== */

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

.settings-column {
  min-width: 0;
}

.settings-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.settings-hero-card,
.settings-panel-card,
.settings-nav-card,
.settings-summary-card,
.settings-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-sm);
}

.settings-feature-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.settings-feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.settings-feature-card .premium-feature-title {
  font-size: 14px;
  line-height: 1.3;
}

.settings-feature-card .premium-feature-description {
  font-size: 12.5px;
  line-height: 1.5;
}

.settings-hero-card {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.settings-hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.settings-hero-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 60ch;
}

.settings-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
}

.settings-status-pill[data-tone="success"] {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.18);
  color: var(--success);
}

.settings-status-pill[data-tone="primary"] {
  background: var(--primary-light);
  border-color: rgba(24, 119, 242, 0.15);
  color: var(--primary);
}

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

.settings-nav-card {
  position: sticky;
  top: 94px;
  padding: 14px;
}

.settings-nav-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 4px 8px 10px;
}

.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  color: var(--text-primary);
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  font-size: 13px;
  line-height: 1.25;
}

.settings-nav-link:hover {
  background: var(--bg-input);
  border-color: var(--border-color);
  transform: translateX(2px);
}

.settings-nav-link.active {
  background: var(--primary-light);
  border-color: rgba(24, 119, 242, 0.16);
  color: var(--primary);
}

.settings-nav-link i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.settings-panel-card {
  padding: 20px;
}

.settings-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.settings-panel-subtitle {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.hidden-posts-list {
  display: grid;
  gap: 14px;
}

.hidden-post-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  background:
    linear-gradient(180deg, rgba(24, 119, 242, 0.045), rgba(24, 119, 242, 0) 60%),
    var(--bg-card);
  min-width: 0;
}

.hidden-post-media {
  border-radius: 16px;
  overflow: hidden;
  min-height: 118px;
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}

.hidden-post-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.hidden-post-media-fallback {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.16), transparent 60%),
    var(--bg-hover);
  color: var(--primary);
}

.hidden-post-media-fallback i,
.hidden-post-media-fallback svg {
  width: 28px;
  height: 28px;
}

.hidden-post-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hidden-post-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.hidden-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hidden-post-author img {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.hidden-post-author-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.hidden-post-author-handle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hidden-post-dates {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.hidden-post-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.hidden-post-link,
.hidden-post-restore-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}

.hidden-post-link {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.hidden-post-restore-btn {
  background: linear-gradient(135deg, #2563eb, #0f766e);
  border: none;
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
  cursor: pointer;
}

.hidden-post-link i,
.hidden-post-link svg,
.hidden-post-restore-btn i,
.hidden-post-restore-btn svg {
  width: 14px;
  height: 14px;
}

.hidden-posts-empty {
  border: 1px dashed var(--border-color);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
  background: var(--bg-hover);
}

.hidden-posts-empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
}

.hidden-posts-empty-icon i,
.hidden-posts-empty-icon svg {
  width: 22px;
  height: 22px;
}

.hidden-posts-empty-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.hidden-posts-empty-copy {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}

.settings-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
}

.settings-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-info-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spin {
  animation: spin 0.8s linear infinite;
}

.auth-page {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(24, 119, 242, 0.08), transparent 26%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.09), transparent 24%),
    #e9eef7;
  color: #111827;
  font-family: 'Inter', sans-serif;
}

.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-shell-centered {
  width: 100%;
}

.auth-card {
  width: min(100%, 1240px);
  min-height: min(780px, calc(100dvh - 64px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.98fr);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
}

.auth-card-terms {
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.82fr);
  height: calc(100dvh - 64px) !important;
  min-height: auto !important;
}

.auth-card-terms .auth-card-panel-form {
  overflow-y: auto !important;
  align-items: flex-start !important;
  height: 100% !important;
}

.auth-card-panel {
  min-width: 0;
}

.auth-card-panel-form {
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
}

.auth-card-inner {
  width: min(100%, 430px);
  display: flex;
  flex-direction: column;
}

.auth-card-inner-wide {
  width: min(100%, 760px);
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.auth-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: url('/assets/trasx-logo-mark.png') center/cover no-repeat;
  color: transparent;
  font-size: 0;
  text-indent: -9999px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(24, 119, 242, 0.28);
  flex-shrink: 0;
}

.auth-brand-name {
  font-size: 20px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: #2157c8;
  line-height: 1;
}

.auth-brand-tag {
  margin-top: 4px;
  font-size: 12px;
  color: #7c8799;
  font-weight: 500;
}

.auth-heading-block {
  margin-bottom: 18px;
}

.auth-heading {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
}

.auth-subheading {
  margin: 10px 0 0;
  color: #7b8494;
  font-size: 14px;
  line-height: 1.6;
}

.auth-alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.09);
  color: #c81e1e;
  border-color: rgba(239, 68, 68, 0.18);
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.08);
  color: #0c8f63;
  border-color: rgba(16, 185, 129, 0.18);
}

.auth-alert.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #a8620a;
  border-color: rgba(245, 158, 11, 0.18);
}

.auth-social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.auth-social-btn {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid #e7ebf3;
  background: #fff;
  color: #162032;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.08);
}

.auth-social-logo {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-right: 6px;
}

.auth-social-logo-google {
  background: linear-gradient(135deg, #34a853 0%, #1f8f44 100%);
  color: #ffffff;
  border: 1px solid rgba(52, 168, 83, 0.24);
}

.auth-social-logo-facebook {
  background: #111111;
  color: #ffffff;
  border: 1px solid rgba(17, 17, 17, 0.18);
}

.auth-divider-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 18px;
  color: #a0a8b6;
  font-size: 12px;
}

.auth-divider-row::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #edf1f6;
}

.auth-divider-row span {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.96);
  padding: 0 14px;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 700;
  color: #455063;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-input-wrap,
.auth-phone-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid #e3e8f2;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-input-wrap:focus-within,
.auth-phone-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.1);
}

.auth-input-icon {
  width: 46px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #98a3b6;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.auth-input,
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="date"],
.auth-field input[type="tel"] {
  width: 100%;
  min-height: 52px;
  border: none;
  background: transparent;
  color: #111827;
  font-size: 14px;
  padding: 0 16px 0 0;
  box-sizing: border-box;
}

.auth-input-inline {
  padding-left: 0;
}

.auth-input::placeholder,
.auth-field input::placeholder {
  color: #9ca3af;
}

.auth-field input:focus,
.auth-input:focus {
  outline: none;
}

.auth-field .iti,
.auth-phone-wrap .iti {
  width: 100%;
}

.auth-phone-wrap .iti input[type="tel"] {
  min-height: 52px;
  padding-left: 84px !important;
}

.auth-inline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
}

.auth-checkline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.auth-checkline input,
.auth-terms input {
  accent-color: var(--primary);
}

.auth-link-inline {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.auth-terms-document {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 0;
  max-height: min(54vh, 620px);
  overflow-y: auto;
  padding-right: 8px;
}

.auth-terms-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 16px;
  background: #f5f8fc;
  border: 1px solid #e6edf7;
}

.auth-terms-lang-btn {
  border: none;
  background: transparent;
  color: #607086;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-terms-lang-btn.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 10px 20px rgba(148, 163, 184, 0.14);
}

.auth-terms-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.auth-terms-panel.is-active {
  display: flex;
}

.auth-terms-panel[hidden] {
  display: none !important;
}

.auth-terms-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.auth-terms-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(24, 119, 242, 0.08);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-terms-hero-copy {
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #e6edf7;
}

.auth-terms-hero-copy .auth-heading {
  margin-top: 14px;
}

.auth-terms-hero-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.auth-terms-hero-card {
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e6edf7;
}

.auth-terms-hero-label {
  display: block;
  margin-bottom: 8px;
  color: #7c8799;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-terms-hero-value {
  display: block;
  color: #132238;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 700;
}

.auth-terms-layout {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 20px;
}

.auth-terms-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 20px;
  align-self: start;
}

.auth-terms-side-block {
  padding: 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e6edf7;
}

.auth-terms-side-block-note {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.auth-terms-side-title {
  margin: 0 0 12px;
  color: #132238;
  font-size: 14px;
  font-weight: 800;
}

.auth-terms-side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-terms-side-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: #4f5d73;
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
  background: #fbfdff;
  border: 1px solid #edf2f8;
}

.auth-terms-side-link:hover {
  color: var(--primary);
  border-color: rgba(24, 119, 242, 0.16);
  background: rgba(24, 119, 242, 0.04);
}

.auth-terms-side-index {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4fb;
  color: #335274;
  font-size: 12px;
  font-weight: 800;
}

.auth-terms-notice-list {
  margin: 0;
  padding-left: 18px;
  color: #5f6b7d;
  font-size: 13px;
  line-height: 1.65;
}

.auth-terms-document::-webkit-scrollbar {
  width: 8px;
}

.auth-terms-document::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.42);
  border-radius: 999px;
}

.auth-terms-notice-list li + li {
  margin-top: 8px;
}

.auth-terms-main {
  min-width: 0;
}

.auth-terms-section {
  padding: 20px 22px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid #e6edf7;
}

.auth-terms-section-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.auth-terms-section-index {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.12) 0%, rgba(24, 119, 242, 0.2) 100%);
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

.auth-terms-section h2 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
}

.auth-terms-section p {
  margin: 0;
  color: #5f6b7d;
  font-size: 13px;
  line-height: 1.7;
}

.auth-terms-actions {
  margin-top: 18px;
}

.auth-terms label a,
.auth-link-inline,
.auth-terms-section a {
  color: #1d4ed8;
}

.auth-submit {
  min-height: 52px;
  border: none;
  border-radius: 14px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.auth-step-actions-single {
  grid-template-columns: 1fr;
}

.auth-submit:hover,
.auth-secondary-btn:hover,
.auth-social-btn:hover {
  transform: translateY(-1px);
}

.auth-submit-solid {
  background: linear-gradient(135deg, var(--primary) 0%, #1767e6 100%);
  color: #fff;
  box-shadow: 0 18px 28px rgba(24, 119, 242, 0.22);
}

.auth-secondary-btn {
  min-height: 52px;
  border-radius: 14px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e2f0;
  background: #fff;
  color: #33507b;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.auth-secondary-btn-muted {
  background: #f8fbff;
  color: #415068;
}

.auth-switch-copy {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: #7b8494;
}

.auth-switch-copy a {
  color: #1d4ed8;
  font-weight: 700;
  margin-left: 4px;
}

.auth-feedback {
  font-size: 12px;
  display: none;
}

.auth-feedback.error {
  display: block;
  color: #c81e1e;
}

.auth-feedback.success {
  display: block;
  color: #0c8f63;
}

.auth-suggestions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
}

.auth-suggestion-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24, 119, 242, 0.08);
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.auth-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.auth-step-pill {
  min-height: 60px;
  border-radius: 16px;
  border: 1px solid #e5ebf5;
  background: #f8fbff;
  color: #7b8494;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.auth-step-pill span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e3ebfb;
  color: #5174ac;
  font-size: 12px;
  font-weight: 800;
}

.auth-step-pill small {
  font-size: 11px;
  font-weight: 700;
}

.auth-step-pill.is-active {
  border-color: rgba(24, 119, 242, 0.26);
  background: rgba(24, 119, 242, 0.08);
  color: #0f3f9f;
}

.auth-step-pill.is-active span,
.auth-step-pill.is-complete span {
  background: var(--primary);
  color: #fff;
}

.auth-step-pill.is-complete {
  color: #33507b;
}

.auth-form-step {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-form-step.is-active {
  display: flex;
}

.auth-form-step-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #132238;
}

.auth-form-step-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #7b8494;
}

.auth-step-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.auth-step-actions .auth-submit,
.auth-step-actions .auth-secondary-btn {
  width: 100%;
}

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-terms-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #e8edf5;
  background: #fbfdff;
}

.auth-terms label {
  font-size: 12px;
  line-height: 1.65;
  color: #586274;
}

.auth-card-panel-visual {
  position: relative;
  background: linear-gradient(180deg, #1667e8 0%, #1559d3 100%);
  overflow: hidden;
}

.auth-visual-surface {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 52px 44px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.auth-visual-orbit {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-visual-orbit-one {
  width: 360px;
  height: 360px;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
}

.auth-visual-orbit-two {
  width: 280px;
  height: 280px;
  top: 128px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 68%);
}

.auth-visual-plus {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 36px;
  left: 108px;
  top: 156px;
  border: 14px solid rgba(255, 255, 255, 0.09);
}

.auth-visual-plus::before,
.auth-visual-plus::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

.auth-visual-plus::before {
  width: 18px;
  top: 20px;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.auth-visual-plus::after {
  height: 18px;
  left: 20px;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.auth-visual-badge {
  position: absolute;
  z-index: 3;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.95);
  color: #1d4ed8;
  box-shadow: 0 20px 32px rgba(14, 34, 86, 0.22);
}

.auth-visual-badge-slack {
  left: 118px;
  top: 176px;
}

.auth-visual-badge-camera {
  left: 88px;
  top: 246px;
}

.auth-visual-badge-google {
  left: 154px;
  top: 324px;
}

.auth-visual-badge-star {
  left: 108px;
  top: 216px;
}

.auth-visual-badge-chat {
  left: 132px;
  top: 304px;
}

.auth-visual-badge-user {
  left: 198px;
  top: 186px;
}

.auth-visual-card {
  position: relative;
  z-index: 2;
  width: min(100%, 360px);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  color: #111827;
  box-shadow: 0 26px 50px rgba(13, 37, 92, 0.22);
}

.auth-visual-card-main {
  margin-top: 34px;
  padding: 18px 18px 20px;
}

.auth-visual-card-top {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-visual-card-top span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d6dce8;
}

.auth-visual-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-visual-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #edf2fa;
}

.auth-visual-avatar,
.auth-visual-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
  flex-shrink: 0;
}

.auth-visual-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.auth-visual-lines span,
.auth-visual-profile-copy span,
.auth-visual-progress span {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: #dbe4f1;
}

.auth-visual-lines span:first-child {
  width: 78%;
}

.auth-visual-lines span:last-child {
  width: 52%;
}

.auth-visual-copy {
  position: relative;
  z-index: 2;
  margin-top: 40px;
  text-align: center;
  max-width: 360px;
}

.auth-visual-copy h2 {
  margin: 0;
  color: #fff;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
}

.auth-visual-copy p {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
}

.auth-visual-dots {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.auth-visual-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.auth-visual-dots .is-active {
  width: 24px;
  background: #fff;
}

.auth-visual-surface-register .auth-visual-card-front {
  margin-top: 34px;
  padding: 18px;
}

.auth-visual-card-stacked {
  position: absolute;
  width: min(100%, 356px);
  height: 270px;
  border-radius: 24px;
}

.auth-visual-card-back {
  top: 178px;
  transform: translateX(10px) rotate(-4deg);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.auth-visual-card-front {
  position: relative;
  top: 0;
}

.auth-visual-profile-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-visual-profile-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-visual-profile-copy span:first-child {
  width: 70%;
}

.auth-visual-profile-copy span:last-child {
  width: 48%;
}

.auth-visual-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.auth-visual-stats-grid div {
  height: 78px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border: 1px solid #e8eef7;
}

.auth-visual-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-visual-progress span:first-child {
  width: 100%;
}

.auth-visual-progress span:last-child {
  width: 76%;
}

@media (max-width: 1080px) {
  .auth-shell {
    padding: 20px;
  }

  .auth-card {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
    min-height: auto;
  }

  .auth-card-panel-form {
    padding: 34px;
  }

  .auth-heading {
    font-size: 30px;
  }

  .auth-visual-copy h2 {
    font-size: 26px;
  }
}

@media (max-width: 900px) {
  .hidden-post-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-card-panel-visual {
    order: -1;
    min-height: 360px;
  }

  .auth-card-panel-form {
    padding: 28px 24px 26px;
  }

  .auth-card-inner {
    width: 100%;
    max-width: 560px;
  }

  .auth-card-inner-wide {
    max-width: 680px;
  }

  .auth-terms-hero,
  .auth-terms-layout {
    grid-template-columns: 1fr;
  }

  .auth-terms-sidebar {
    position: static;
  }

  .auth-terms-document {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .auth-visual-surface {
    min-height: 360px;
    padding: 28px 24px;
  }

  .auth-visual-card,
  .auth-visual-card-stacked {
    width: min(100%, 300px);
  }

  .auth-visual-orbit-one {
    width: 280px;
    height: 280px;
    top: 46px;
  }

  .auth-visual-orbit-two {
    width: 220px;
    height: 220px;
    top: 76px;
  }

  .auth-visual-plus {
    width: 120px;
    height: 120px;
    left: 50%;
    top: 110px;
    transform: translateX(-122px);
    border-width: 10px;
  }

  .auth-visual-badge-slack,
  .auth-visual-badge-star {
    left: calc(50% - 134px);
  }

  .auth-visual-badge-camera,
  .auth-visual-badge-chat {
    left: calc(50% - 150px);
  }

  .auth-visual-badge-google {
    left: calc(50% - 102px);
  }

  .auth-visual-badge-user {
    left: calc(50% - 40px);
  }

  .auth-visual-copy {
    margin-top: 24px;
  }
}

@media (max-width: 640px) {
  .hidden-post-card {
    grid-template-columns: 1fr;
  }

  .hidden-post-media {
    min-height: 170px;
  }

  .hidden-post-meta {
    flex-direction: column;
  }

  .hidden-post-dates {
    align-items: flex-start;
  }

  .auth-shell {
    padding: 0;
  }

  .auth-card {
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-card-panel-form {
    padding: 22px 18px 28px;
  }

  .auth-card-panel-visual {
    min-height: 300px;
  }

  .auth-heading {
    font-size: 26px;
  }

  .auth-subheading {
    font-size: 13px;
  }

  .auth-form-grid,
  .auth-step-actions {
    grid-template-columns: 1fr;
  }

  .auth-social-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .auth-social-btn {
    min-height: 48px;
    gap: 7px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .auth-social-logo {
    width: 19px;
    height: 19px;
    margin-right: 2px;
  }

  .auth-stepper {
    gap: 8px;
  }

  .auth-step-pill {
    min-height: 54px;
  }

  .auth-inline-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-visual-copy h2 {
    font-size: 22px;
  }

  .auth-visual-copy p {
    font-size: 13px;
  }

  .auth-visual-card,
  .auth-visual-card-stacked {
    width: min(100%, 256px);
  }
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-field input,
.settings-field select {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  padding: 0 14px;
  color: var(--text-primary);
  outline: none;
}

.settings-field input:focus,
.settings-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

.field-help-text {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

#eventDescription,
#statusCaption {
  width: 100%;
  min-height: 124px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

#eventDescription:focus,
#statusCaption:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
  background: var(--bg-card);
}

#eventDescription::placeholder,
#statusCaption::placeholder {
  color: var(--text-muted);
}

#kycDocument {
  width: 100%;
  min-height: 46px;
  padding: 8px 10px 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  font: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

#kycDocument:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
  background: var(--bg-card);
}

#kycDocument::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

#kycDocument::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

#kycDocument:hover::file-selector-button,
#kycDocument:hover::-webkit-file-upload-button {
  background: var(--bg-hover);
  border-color: var(--primary);
}

#kycDocument::file-selector-button:hover,
#kycDocument::-webkit-file-upload-button:hover {
  transform: translateY(-1px);
}

#ticketFile {
  width: 100%;
  min-height: 46px;
  padding: 8px 10px 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  font: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

#ticketFile:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
  background: var(--bg-card);
}

#ticketFile::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

#ticketFile::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

#ticketFile:hover::file-selector-button,
#ticketFile:hover::-webkit-file-upload-button {
  background: var(--bg-hover);
  border-color: var(--primary);
}

#ticketFile::file-selector-button:hover,
#ticketFile::-webkit-file-upload-button:hover {
  transform: translateY(-1px);
}

.settings-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.settings-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
}

.settings-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.event-kyc-camera {
  display: grid;
  gap: 12px;
}

.event-kyc-camera-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  object-fit: cover;
}

.event-kyc-selfie-preview {
  display: grid;
  place-items: center;
  min-height: 96px;
  border-radius: 14px;
  border: 1px dashed var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  text-align: center;
  padding: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.event-kyc-selfie-preview.has-image {
  padding: 0;
  overflow: hidden;
}

.event-kyc-selfie-preview.has-image img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.event-kyc-camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.settings-primary-btn,
.settings-secondary-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-primary-btn {
  background: var(--primary);
  color: #ffffff;
}

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

.settings-secondary-btn {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.settings-language-preview {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================
   Events Page
   ========================================== */

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

.events-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.events-hero-card,
.events-panel-card,
.events-stat-card,
.events-mini-card,
.events-suggested-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: var(--border-radius-card);
}

.events-hero-card {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: stretch;
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.12), rgba(139, 92, 246, 0.08)), var(--bg-card);
  overflow: hidden;
  position: relative;
}

.events-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.events-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.events-hero-kicker i {
  width: 14px;
  height: 14px;
}

.events-hero-title {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.events-hero-subtitle {
  margin-top: 8px;
  max-width: 68ch;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.events-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.events-language-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: left;
  max-width: none;
  line-height: 1.5;
}

.events-primary-btn,
.events-secondary-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition-fast), filter var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.event-kyc-lock-note {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.event-kyc-locked-input {
  background: var(--bg-input);
}

.event-kyc-locked-input:disabled {
  opacity: 1;
  color: var(--text-primary);
  -webkit-text-fill-color: var(--text-primary);
}

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

.events-secondary-btn {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.events-primary-btn:hover,
.events-secondary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.events-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.events-stat-card {
  padding: 16px;
}

.events-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.events-stat-card strong {
  font-size: 24px;
  color: var(--text-primary);
}

.events-panel-card {
  padding: 20px;
}

.events-create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.events-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.events-field-wide {
  grid-column: 1 / -1;
}

.events-card-grid {
  display: grid;
  gap: 14px;
}

.event-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.event-card-cover {
  min-height: 190px;
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.9), rgba(139, 92, 246, 0.8));
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 18px;
}

.event-card-cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.event-status-pill,
.event-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.35);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.event-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.event-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.event-card-subtitle {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--text-secondary);
  font-size: 12px;
}

.event-card-subtitle span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.event-card-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.event-card-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.event-meta-item {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
}

.event-meta-item span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.event-meta-item strong {
  color: var(--text-primary);
  font-size: 13px;
}

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

.events-mini-grid {
  display: grid;
  gap: 12px;
}

.events-mini-card {
  padding: 14px 16px;
}

.events-mini-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.events-mini-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.events-suggested-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.events-suggested-item {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.events-suggested-copy {
  min-width: 0;
}

.events-suggested-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.events-suggested-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.events-empty-state,
.events-empty-mini {
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-input);
}

.events-empty-state i {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
}

.premium-balance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.premium-balance-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
}

.premium-balance-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.premium-balance-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.premium-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.premium-feature-card {
  padding: 14px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.premium-feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-feature-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.premium-feature-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

@media screen and (max-width: 1200px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .events-layout {
    grid-template-columns: 1fr;
  }

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

  .settings-nav-card {
    position: relative;
    top: auto;
  }
}

@media screen and (max-width: 768px) {
  .settings-hero-card,
  .settings-panel-card,
  .events-hero-card,
  .events-panel-card {
    padding: 16px;
  }

  .settings-grid,
  .settings-form-grid,
  .premium-balance-grid,
  .premium-feature-grid,
  .events-stats-grid,
  .events-form-grid,
  .event-card-meta-grid {
    grid-template-columns: 1fr;
  }

  .events-hero-card {
    grid-template-columns: 1fr;
  }

  .events-hero-actions {
    align-items: stretch;
  }

  .events-language-note {
    text-align: left;
    max-width: none;
  }
}

/* Stories Slider */
.stories-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
  /* Hide scrollbar Firefox */
  margin: 12px -24px 0 -24px;
  padding: 8px 24px;
  min-height: 106px;
}

.stories-wrapper::-webkit-scrollbar {
  display: none;
  /* Hide scrollbar Chrome/Safari */
}

.stories-container {
  display: flex;
  gap: 14px;
  padding-bottom: 4px;
  padding-top: 4px;
}

.stories-wrapper.stories-loading {
  overflow: hidden;
}

.stories-container.is-loading {
  display: none;
}

.story-card {
  flex: 0 0 85px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}

.story-avatar-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  transition: transform var(--transition-smooth);
}

.story-card:hover .story-avatar-container {
  transform: scale(1.08);
}

.story-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-card);
}

/* Purple stories gradient border from screenshot */
.story-avatar-container.active-story::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #8a2be2, #4a00e0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 1;
}

/* Your story specific styling */
.story-avatar-container.main-user .story-avatar {
  border: none;
  width: 60px;
  height: 60px;
}

.status-card {
  position: relative;
}

.status-avatar-container {
  overflow: visible;
}

.status-avatar-container::before {
  display: none !important;
}

.status-media-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-duration-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.add-story-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.add-story-btn i {
  width: 12px;
  height: 12px;
  stroke-width: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-username {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-modal-content,
.status-viewer-content {
  max-width: 480px;
  width: min(92vw, 480px);
  padding: 20px 22px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 18px;
  position: relative;
}

.status-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.status-modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text-primary);
}

.status-modal-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}

.status-create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status-caption-input {
  min-height: 72px;
  resize: vertical;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.status-caption-input::placeholder {
  color: var(--text-muted);
}

.status-caption-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg-card);
}

.status-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-input);
}

.status-upload-btn {
  appearance: none;
  text-decoration: none;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--border-radius-item);
  border: 1px solid transparent;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  flex: 0 0 auto;
  flex-shrink: 0;
  justify-content: center;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}

.status-upload-btn:hover {
  transform: translateY(-1px);
  background: var(--primary);
  color: #ffffff;
}

.status-upload-btn:active {
  transform: translateY(0);
}

.status-upload-btn i {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
  line-height: 1;
}

.status-upload-btn span {
  display: block;
  text-align: center;
  line-height: 1;
}

.status-upload-name {
  min-height: auto;
  display: inline-flex;
  align-items: center;
  flex: 1 1 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  word-break: break-word;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status-modal-content {
  max-height: 85vh;
  overflow-y: auto;
}

.status-media-preview-box {
  min-height: 130px;
  max-height: 240px;
  border: 1.5px dashed var(--border-color);
  border-radius: 12px;
  background: var(--bg-input);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12.5px;
}

.status-media-preview-box img,
.status-media-preview-box video {
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
}

.short-modal-overlay {
  background: rgba(6, 10, 20, 0.62) !important;
  padding: 18px;
  align-items: center;
}

.short-modal-content {
  max-width: 560px !important;
  width: min(94vw, 560px) !important;
  max-height: min(92vh, 760px) !important;
  padding: 0 !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 28px 80px rgba(2, 8, 23, 0.34) !important;
}

.short-modal-content .modal-close {
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  z-index: 4;
}

.short-modal-content .status-modal-header {
  margin: 0 !important;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-color);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(20, 184, 166, 0.08)),
    var(--bg-card);
}

.short-modal-content .status-modal-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.short-create-form {
  padding: 18px 24px 22px;
  overflow-y: auto;
  min-height: 0;
}

.short-tabs-nav {
  display: flex !important;
  align-items: center !important;
  height: 48px !important;
  min-height: 48px !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 5px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 14px;
  background: var(--bg-input);
  overflow-x: auto;
}

.short-tabs-nav .status-tab-btn {
  min-height: 38px;
  border-radius: 10px !important;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.short-tabs-nav .status-tab-btn.active {
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.16);
}

.short-format-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(59, 130, 246, 0.06));
}

.short-format-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.short-format-copy span {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.short-format-copy small,
.short-fit-option small {
  font-size: 11px;
  color: var(--text-secondary);
}

.short-fit-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.short-fit-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.short-fit-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.short-fit-option.active {
  border-color: rgba(59, 130, 246, 0.54);
  background: var(--primary-light);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.14);
}

.short-fit-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.72);
  flex: 0 0 auto;
}

.short-fit-icon i,
.short-fit-icon svg {
  width: 16px;
  height: 16px;
}

.short-fit-option strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.2;
}

.short-trade-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  background: rgba(139, 92, 246, 0.06);
}

.short-trade-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.short-trade-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.short-trade-switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.short-trade-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.short-trade-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border-color);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.short-trade-switch span::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  transition: transform var(--transition-fast);
}

.short-trade-switch input:checked + span {
  background: #8b5cf6;
}

.short-trade-switch input:checked + span::after {
  transform: translateX(20px);
}

.short-trade-info {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  background: rgba(139, 92, 246, 0.06);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.short-trade-info > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.short-trade-info > span {
  color: #f59e0b;
  font-weight: 800;
}

.short-trade-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.short-trade-balance span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

[data-theme="dark"] .short-trade-balance span {
  background: rgba(255, 255, 255, 0.05);
}

.short-trade-balance strong {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.1;
}

.short-trade-balance.is-insufficient span:first-child {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
}

.short-trade-warning {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-weight: 800;
}

@media (max-width: 520px) {
  .short-trade-balance {
    grid-template-columns: 1fr;
  }
}

.short-upload-status {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.short-upload-status.success {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.short-upload-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
}

.short-upload-card .status-upload-row {
  background: var(--bg-card);
}

.short-media-preview-box {
  height: 250px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.short-media-preview-box img,
.short-media-preview-box video {
  width: 100% !important;
  height: 100% !important;
  background: #05070d;
}

.status-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status-modal-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  flex: 1 1 220px;
}

.status-modal-footer .settings-primary-btn {
  min-height: 44px;
  flex: 0 1 220px;
  justify-content: center;
}

@media screen and (max-width: 560px) {
  .status-upload-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .status-upload-btn {
    min-width: 0;
    flex: 1 1 auto;
    border-radius: 10px;
  }

  .status-upload-name {
    min-height: auto;
    padding-top: 2px;
    white-space: normal;
  }

  .status-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .status-modal-note,
  .status-modal-footer .settings-primary-btn {
    width: 100%;
    flex: 1 1 auto;
  }

  .short-modal-overlay {
    padding: 0 14px 12px;
    align-items: flex-end;
  }

  .short-modal-content {
    width: 100% !important;
    max-width: 460px !important;
    max-height: calc(92dvh - 12px) !important;
    border-radius: 22px !important;
  }

  .short-modal-content .status-modal-header,
  .short-create-form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .short-tabs-nav {
    scrollbar-width: none;
  }

  .short-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .short-fit-options {
    grid-template-columns: 1fr;
  }

  .short-format-copy {
    flex-direction: column;
    gap: 2px;
  }
}

@media screen and (max-width: 380px) {
  .short-modal-overlay {
    padding-left: 10px;
    padding-right: 10px;
  }

  .short-modal-content .status-modal-header,
  .short-create-form {
    padding-left: 14px;
    padding-right: 14px;
  }
}

.status-viewer-content {
  max-width: 720px;
  width: min(94vw, 720px);
}

/* Story Progress Bar Indicator */
.status-viewer-progress-container {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 12px;
}

.status-viewer-progress-segment {
  height: 4px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  flex: 1;
  overflow: hidden;
  position: relative;
}

body[data-theme="dark"] .status-viewer-progress-segment {
  background: rgba(255, 255, 255, 0.15);
}

.status-viewer-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.status-viewer-progress-segment.completed .status-viewer-progress-fill {
  width: 100%;
  transition: none;
}

.status-viewer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-viewer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.status-viewer-media-shell {
  position: relative;
  width: 100%;
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.status-viewer-media-shell img,
.status-viewer-media-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none; /* Let click event pass to the parent shell for coordinate checking */
}

.status-viewer-caption {
  margin-top: 14px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 20px;
}

/* Create Post Card */
.create-post-card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  /* Set absolute coordinate reference context */
}

.create-post-upper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.create-post-upper-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.post-creator-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.create-post-input-wrapper {
  position: relative;
  flex: 1;
  background-color: var(--bg-input);
  border-radius: 20px;
  min-height: 42px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.create-post-input-wrapper input {
  border: none;
  background: none;
  width: 90%;
  height: 100%;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
}

.emoji-picker-btn {
  font-size: 16px;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.emoji-picker-btn:hover {
  transform: scale(1.15);
}

/* Share post button style matching the screenshot: light blue bg, blue text */
.share-post-btn {
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--border-radius-item);
  transition: var(--transition-smooth);
}

.share-post-btn:hover {
  background-color: rgba(24, 119, 242, 0.15);
  transform: translateY(-1px);
}

.share-sheet-section {
  margin-top: 16px;
}

.share-sheet-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.share-target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.share-target-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.share-target-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
}

.share-target-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

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

.share-target-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-target-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.share-target-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.share-empty-state {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  background: var(--bg-hover);
}

.social-share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 10px;
}

.social-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.social-share-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
}

.social-share-btn i,
.social-share-btn svg.brand-logo-svg,
.social-share-btn svg.brand-line-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
}

.social-share-btn svg.brand-logo-svg {
  stroke: none;
  fill: currentColor;
}

.social-share-btn svg.brand-line-svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.create-post-lower {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.post-options-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.post-opt-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.post-opt-btn i {
  width: 18px;
  height: 18px;
}

/* Color accents on icons from screenshot */
.post-opt-btn.image-video i {
  color: #1877f2;
}

.post-opt-btn.attachment i {
  color: #f9a825;
}

.post-opt-btn.live i {
  color: #f44336;
}

.post-opt-btn.hashtag i {
  color: #4caf50;
}

.post-opt-btn.mention i {
  color: #9c27b0;
}

.post-opt-btn:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.post-privacy-dropdown {
  position: relative;
}

.privacy-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--border-radius-item);
  background-color: var(--bg-input);
  transition: var(--transition-fast);
}

.privacy-select-btn:hover {
  background-color: var(--border-color-hover);
}

.privacy-select-btn i {
  width: 14px;
  height: 14px;
}

/* Sorting bar */
.feed-sort-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.feed-sort-row i {
  width: 16px;
  height: 16px;
}

/* Posts Lists & Card */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-smooth);
}

#postsContainer {
  flex-direction: column !important;
}

.sponsored-ad-card {
  position: relative;
  border: 1px solid rgba(24, 119, 242, 0.16);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  background:
    linear-gradient(180deg, rgba(24, 119, 242, 0.055), rgba(24, 119, 242, 0) 46%),
    var(--bg-card);
}

.sponsored-ad-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.sponsored-ad-header {
  padding: 12px 14px 8px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sponsored-ad-brand {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
}

.sponsored-ad-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sponsored-ad-brand-name,
.sponsored-ad-subtitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sponsored-ad-brand-name {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
}

.sponsored-ad-subtitle {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 700;
}

.sponsored-ad-media {
  position: relative;
  width: calc(100% - 28px);
  max-height: 150px;
  min-height: 88px;
  margin: 0 14px;
  aspect-ratio: 2.8 / 1;
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
}

.sponsored-ad-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--transition-smooth);
}

.sponsored-ad-card:hover .sponsored-ad-media img {
  transform: scale(1.035);
}

.sponsored-ad-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(24, 119, 242, 0.08);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  border: 1px solid rgba(24, 119, 242, 0.16);
}

.sponsored-ad-label i,
.sponsored-ad-label svg {
  width: 12px;
  height: 12px;
}

.sponsored-ad-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(24, 119, 242, 0.14);
  background: var(--bg-input);
}

.sponsored-ad-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sponsored-ad-copy {
  padding: 0 14px 9px 17px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sponsored-ad-copy h4 {
  margin: 0;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
}

.sponsored-ad-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sponsored-ad-footer {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px 12px 17px;
}

.sponsored-ad-domain {
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsored-ad-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
}

.sponsored-ad-cta i,
.sponsored-ad-cta svg {
  width: 12px;
  height: 12px;
}

.birthday-feed-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background:
    radial-gradient(circle at 18% 16%, rgba(24, 119, 242, 0.12), transparent 18%),
    radial-gradient(circle at 82% 22%, rgba(16, 185, 129, 0.12), transparent 18%),
    linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, var(--bg-card) 82%, var(--primary-light) 18%) 58%, var(--bg-card) 100%);
  box-shadow: var(--shadow-lg);
}

.birthday-feed-card-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 26px 22px 24px;
  text-align: center;
  overflow: hidden;
}

.birthday-feed-card-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.88) 0 12%, transparent 12.5%),
    radial-gradient(circle at 32% 18%, rgba(16, 185, 129, 0.18) 0 1.2%, transparent 1.6%),
    radial-gradient(circle at 66% 14%, rgba(24, 119, 242, 0.2) 0 1.1%, transparent 1.5%),
    radial-gradient(circle at 24% 58%, rgba(130, 10, 209, 0.16) 0 1%, transparent 1.4%),
    radial-gradient(circle at 78% 56%, rgba(240, 40, 73, 0.14) 0 1%, transparent 1.4%);
  pointer-events: none;
  opacity: 0.85;
}

.birthday-feed-confetti {
  --birthday-confetti-scale: 1;
  position: absolute;
  top: 74px;
  width: 124px;
  height: 228px;
  pointer-events: none;
  opacity: 0.96;
  transform: scaleX(var(--birthday-confetti-scale));
  animation: birthdayConfettiFloat 5.8s ease-in-out infinite;
}

.birthday-feed-confetti::before,
.birthday-feed-confetti::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
}

.birthday-feed-confetti-left {
  left: 8px;
}

.birthday-feed-confetti-right {
  right: 8px;
  --birthday-confetti-scale: -1;
  animation-delay: -2.4s;
}

.birthday-feed-confetti::before {
  background-image:
    radial-gradient(circle, var(--primary) 0 3px, transparent 3.5px),
    radial-gradient(circle, var(--success) 0 2.5px, transparent 3px),
    radial-gradient(circle, var(--badge-purple) 0 2.5px, transparent 3px),
    radial-gradient(circle, var(--badge-red) 0 2.6px, transparent 3.1px),
    radial-gradient(circle, #f59e0b 0 2.8px, transparent 3.3px),
    linear-gradient(135deg, transparent 0 44%, var(--primary) 44% 56%, transparent 56%),
    linear-gradient(135deg, transparent 0 44%, var(--badge-red) 44% 56%, transparent 56%),
    linear-gradient(135deg, transparent 0 44%, var(--success) 44% 56%, transparent 56%),
    linear-gradient(135deg, transparent 0 44%, var(--badge-purple) 44% 56%, transparent 56%);
  background-size: 12px 12px, 10px 10px, 10px 10px, 10px 10px, 11px 11px, 12px 12px, 10px 10px, 10px 10px, 10px 10px;
  background-position:
    8px 18px,
    56px 34px,
    32px 106px,
    78px 80px,
    44px 164px,
    22px 62px,
    58px 132px,
    14px 146px,
    90px 188px;
  animation: birthdayConfettiSpin 7.2s linear infinite;
}

.birthday-feed-confetti::after {
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0 45%, var(--primary) 45% 55%, transparent 55%),
    radial-gradient(circle at 50% 50%, transparent 0 45%, var(--success) 45% 55%, transparent 55%),
    radial-gradient(circle at 50% 50%, transparent 0 45%, var(--badge-purple) 45% 55%, transparent 55%),
    radial-gradient(circle at 50% 50%, transparent 0 45%, #f59e0b 45% 55%, transparent 55%);
  background-size: 42px 42px, 38px 38px, 30px 30px, 24px 24px;
  background-position: 0 58px, 42px 0, 72px 126px, 16px 188px;
  opacity: 0.72;
  animation: birthdayConfettiPulse 3.8s ease-in-out infinite;
}

.birthday-feed-card-hero {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}

.birthday-feed-card-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.birthday-feed-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-card) 78%, var(--primary-light) 22%);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--border-color) 62%, var(--primary) 38%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.birthday-feed-card-kicker i,
.birthday-feed-card-kicker svg {
  width: 12px;
  height: 12px;
}

.birthday-feed-title-block {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2px;
}

.birthday-feed-title {
  margin: 0;
  font-size: clamp(64px, 11vw, 106px);
  line-height: 0.86;
  font-weight: 900;
  letter-spacing: -0.06em;
  text-transform: none;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.birthday-feed-script {
  margin-top: -16px;
  color: color-mix(in srgb, var(--primary) 72%, var(--badge-purple) 28%);
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: clamp(50px, 9vw, 78px);
  line-height: 0.84;
  transform: rotate(-4deg);
}

.birthday-feed-card-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.18;
  max-width: 100%;
}

.birthday-feed-card-name:hover {
  color: var(--primary);
}

.birthday-feed-card-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  max-width: 360px;
}

.birthday-feed-card-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
}

.birthday-feed-blessing {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.birthday-feed-card-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 8px;
}

.birthday-gift-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  min-width: 188px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(24, 119, 242, 0.18);
}

.birthday-gift-btn i,
.birthday-gift-btn svg {
  width: 15px;
  height: 15px;
}

.birthday-gift-btn-demo {
  opacity: 1;
  cursor: pointer;
}

.birthday-feed-self-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 800;
}

.birthday-feed-card-photo {
  position: relative;
  display: block;
  width: min(100%, 210px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  overflow: hidden;
  border: 12px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.12);
  animation: birthdayHeroGlow 4.4s ease-in-out infinite;
}

.birthday-feed-card-photo::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.birthday-feed-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .birthday-feed-card-shell {
    padding: 22px 14px 20px;
  }

  .birthday-feed-card-photo {
    width: min(100%, 180px);
    border-width: 10px;
  }

  .birthday-feed-title {
    font-size: clamp(54px, 17vw, 84px);
  }

  .birthday-feed-script {
    font-size: clamp(42px, 13vw, 64px);
    margin-top: -10px;
  }

  .birthday-feed-confetti {
    width: 76px;
    height: 148px;
    top: 76px;
  }

  .birthday-feed-card-name {
    font-size: 17px;
  }

  .birthday-feed-card-text {
    max-width: 100%;
    font-size: 12.5px;
  }

  .birthday-gift-btn,
  .birthday-feed-self-pill {
    width: min(100%, 240px);
  }
}

body[data-theme="dark"] .birthday-feed-card {
  background:
    radial-gradient(circle at 18% 16%, rgba(56, 189, 248, 0.15), transparent 18%),
    radial-gradient(circle at 82% 22%, rgba(52, 211, 153, 0.14), transparent 18%),
    linear-gradient(180deg, var(--bg-card) 0%, rgba(34, 47, 71, 0.92) 58%, var(--bg-card) 100%);
}

body[data-theme="dark"] .birthday-feed-card-shell::before {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.06) 0 12%, transparent 12.5%),
    radial-gradient(circle at 32% 18%, rgba(52, 211, 153, 0.18) 0 1.2%, transparent 1.6%),
    radial-gradient(circle at 66% 14%, rgba(56, 189, 248, 0.2) 0 1.1%, transparent 1.5%),
    radial-gradient(circle at 24% 58%, rgba(130, 10, 209, 0.16) 0 1%, transparent 1.4%),
    radial-gradient(circle at 78% 56%, rgba(240, 40, 73, 0.14) 0 1%, transparent 1.4%);
}

@keyframes birthdayConfettiFloat {
  0%, 100% {
    transform: scaleX(var(--birthday-confetti-scale)) translateY(0) rotate(0deg);
  }
  50% {
    transform: scaleX(var(--birthday-confetti-scale)) translateY(-10px) rotate(2deg);
  }
}

@keyframes birthdayConfettiSpin {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(2deg) translateY(-4px);
  }
  100% {
    transform: rotate(0deg) translateY(0);
  }
}

@keyframes birthdayConfettiPulse {
  0%, 100% {
    opacity: 0.66;
  }
  50% {
    opacity: 0.98;
  }
}

@keyframes birthdayHeroGlow {
  0%, 100% {
    box-shadow: 0 20px 36px rgba(15, 23, 42, 0.12);
  }
  50% {
    box-shadow: 0 24px 44px rgba(24, 119, 242, 0.18);
  }
}

.post-header {
  position: relative;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 42px;
  height: 42px;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 14px;
  font-weight: 700;
}

.post-time {
  font-size: 11px;
  color: var(--text-muted);
}

.post-options-btn {
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.post-options-btn:hover {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.post-options-btn i {
  width: 20px;
  height: 20px;
}

.post-report-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
  z-index: 12000;
}

.post-report-modal-overlay.active {
  display: flex;
}

.post-report-modal {
  width: min(100%, 460px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
  padding: 24px;
  position: relative;
}

.post-report-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
}

.post-report-modal-close:hover {
  color: var(--text-primary);
}

.post-report-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-right: 40px;
}

.post-report-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(249, 115, 22, 0.2));
  color: #ef4444;
  flex-shrink: 0;
}

.post-report-modal-icon i,
.post-report-modal-icon svg {
  width: 22px;
  height: 22px;
}

.post-report-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.post-report-modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.post-report-reasons {
  display: grid;
  gap: 10px;
}

.post-report-reason {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.post-report-reason:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
}

.post-report-reason input {
  margin-top: 2px;
  accent-color: var(--primary);
}

.post-report-reason.is-selected {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.post-report-reason-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.post-report-reason-copy {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.post-report-details {
  width: 100%;
  min-height: 88px;
  margin-top: 14px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 12px 14px;
  font: inherit;
}

.post-report-details:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.post-report-details-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.post-report-error {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
}

.post-report-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.post-report-cancel-btn,
.post-report-submit-btn {
  flex: 1;
  min-height: 46px;
  border: none;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.post-report-cancel-btn {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.post-report-submit-btn {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 16px 32px rgba(239, 68, 68, 0.22);
}

.post-report-submit-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 768px) {
  .post-report-modal {
    padding: 20px 18px 18px;
    border-radius: 20px;
  }

  .post-report-modal-actions {
    flex-direction: column-reverse;
  }
}

/* Post Content & Layouts */
.post-content {
  padding: 0;
  /* Full bleed layout for images as pictured */
}

/* Grid layout for post 1: 50/50 split */
.post-images-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 20px;
}

.grid-image-wrapper {
  aspect-ratio: 1.15;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--bg-input);
  box-shadow: var(--shadow-sm);
}

.post-single-image {
  padding: 0 20px;
  border-radius: 12px;
  overflow: hidden;
}

.post-single-image img {
  border-radius: 12px;
  max-height: 400px;
}

.post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--transition-smooth);
}

.grid-image-wrapper:hover .post-img,
.post-single-image:hover .post-img {
  transform: scale(1.03);
}

/* Post Footer actions */
.post-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
}

.post-actions {
  display: flex;
  gap: 20px;
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.post-action-btn i,
.post-action-btn svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.post-action-btn:hover {
  color: var(--primary);
}

.post-action-btn:hover i,
.post-action-btn:hover svg {
  transform: scale(1.15);
}

/* Active like state */
.post-action-btn.liked {
  color: var(--badge-red);
}

.post-action-btn.liked i,
.post-action-btn.liked svg {
  fill: var(--badge-red);
  color: var(--badge-red);
}

.post-bookmark-btn {
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.post-bookmark-btn:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.post-bookmark-btn.bookmarked i,
.post-bookmark-btn.bookmarked svg {
  fill: var(--primary);
  color: var(--primary);
}

.post-bookmark-btn i,
.post-bookmark-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================
   Right Sidebar Components
   ========================================== */

.sidebar-card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
}

.card-action-icon-btn {
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.card-action-icon-btn:hover {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.card-action-icon-btn i {
  width: 18px;
  height: 18px;
}

/* Messages Search Box */
.messages-search-wrapper {
  background-color: var(--bg-input);
  border-radius: var(--border-radius-pill);
  height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.messages-search-wrapper input {
  border: none;
  background: none;
  width: 100%;
  font-size: 13px;
  outline: none;
}

.messages-search-wrapper i {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.messages-search-wrapper .filter-icon {
  cursor: pointer;
}

/* Messages Tabs */
.messages-tabs {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  padding-bottom: 2px;
}

.tab-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 4px;
  position: relative;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  border-radius: 3px 3px 0 0;
}

.tab-count {
  font-weight: 500;
  font-size: 12px;
  margin-left: 2px;
}

/* Messages Contact list */
.messages-list {
  display: none;
  flex-direction: column;
  gap: 14px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.messages-list.active {
  display: flex;
}

.message-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--border-radius-item);
  transition: var(--transition-fast);
}

.message-item:hover {
  background-color: var(--bg-input);
}

.message-item[data-can-manage-request="1"] {
  flex-wrap: wrap;
  align-items: flex-start !important;
}

.message-request-actions {
  flex: 1 0 100%;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

.message-request-action {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.message-request-action:hover {
  transform: translateY(-1px);
}

.message-request-action.accept {
  background: var(--primary-light);
  border-color: rgba(59, 130, 246, 0.22);
  color: var(--primary);
}

.message-request-action.decline {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.msg-avatar-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.msg-avatar-wrapper .status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  background-color: #ccd0d5;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  z-index: 2;
}

.message-item.online .status-dot,
.msg-avatar-wrapper.online .status-dot {
  background-color: #41b35d;
}

.message-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.contact-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.message-preview {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.messages-card .view-all-link {
  margin-top: 16px;
}

/* Events Card details */
.events-card {
  margin-top: 24px;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: inherit;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.event-item-link:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.event-item.alignment-top {
  align-items: flex-start;
}

.event-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Event color schemes matching visual palette */
.event-icon-wrapper.invites {
  background-color: rgba(24, 119, 242, 0.1);
  color: var(--primary);
}

.event-icon-wrapper.collab {
  background-color: rgba(130, 10, 209, 0.1);
  color: var(--badge-purple);
}

.event-icon-wrapper.meetup {
  background-color: rgba(76, 175, 80, 0.1);
  color: #4caf50;
}

.event-icon-wrapper.gift {
  background-color: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

.event-icon-wrapper i {
  width: 16px;
  height: 16px;
}

.event-info {
  display: flex;
  flex-direction: column;
}

.event-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.event-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================
   Responsive Media Queries
   ========================================== */

/* Tablet Layout (Max 1200px) */
@media screen and (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .right-sidebar {
    display: none !important;
    /* Hide Right Sidebar */
  }
}

/* Small Tablet Layout (Max 992px) */
@media screen and (max-width: 992px) {
  .main-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }

  .right-sidebar {
    display: none !important;
  }
}

/* Mobile Screen Layout (Max 768px) */
@media screen and (max-width: 768px) {

  /* Hide desktop header and sidebar */
  .app-header,
  .left-sidebar {
    display: none !important;
  }

  /* Show Mobile sticky controls */
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
  }

  .mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .mobile-logo .logo-icon {
    width: 28px;
    height: 28px;
  }

  .mobile-logo .logo-icon::before,
  .mobile-logo .logo-icon::after {
    width: 8px;
    height: 8px;
  }

  .mobile-menu-toggle {
    width: 38px;
    height: 38px;
    background-color: var(--bg-input);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
  }

  .mobile-menu-toggle i {
    width: 18px;
    height: 18px;
  }

  .notifications-dropdown-panel {
    top: 68px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-height: calc(100dvh - 88px);
  }

  /* Adjust main container to single feed column */
  .main-layout {
    grid-template-columns: 1fr;
    padding: 12px;
    padding-bottom: 80px;
    /* Spacer for bottom nav bar */
  }

  /* Stories view tweak */
  .stories-wrapper {
    margin: 0 -12px;
    margin-top: 16px;
    padding: 0 12px;
  }

  .mobile-messages-section {
    margin-top: 16px;
  }

  #mobileMessagesSection {
    margin-top: 24px !important;
  }

  .story-card {
    flex: 0 0 75px;
  }

  .story-avatar-container {
    width: 50px;
    height: 50px;
  }

  .story-avatar {
    width: 44px;
    height: 44px;
  }

  .story-avatar-container.main-user .story-avatar {
    width: 50px;
    height: 50px;
  }

  /* Post adjustments */
  .create-post-card {
    position: relative;
    z-index: 50;
    /* Ensure popovers render on top of subsequent content */
    padding: 16px;
  }

  .create-post-upper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .create-post-upper-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .create-post-upper .post-creator-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .create-post-upper .share-post-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
    box-sizing: border-box;
  }

  .create-post-lower {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    overflow: visible;
    /* Prevent popover clipping */
  }

  .post-options-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    width: 100%;
  }

  .post-opt-btn {
    justify-content: center;
    padding: 10px 8px;
    background: var(--bg-hover);
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }

  .post-privacy-dropdown {
    width: 100%;
    margin-top: 4px;
  }

  .privacy-select-btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  .hashtag-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px;
  }

  .post-opt-btn span {
    font-size: 12px;
  }

  .post-card {
    border-radius: 12px;
  }

  .sponsored-ad-media {
    width: calc(100% - 24px);
    max-height: 124px;
    min-height: 78px;
    margin: 0 12px;
    aspect-ratio: 2.55 / 1;
    border-radius: 8px;
  }

  .sponsored-ad-header {
    padding: 11px 12px 7px 15px;
  }

  .sponsored-ad-copy {
    padding: 0 12px 8px 15px;
  }

  .sponsored-ad-copy h4 {
    font-size: 14px;
  }

  .sponsored-ad-footer {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 8px 12px 11px 15px;
  }

  .sponsored-ad-cta {
    justify-content: center;
    width: auto;
    box-sizing: border-box;
  }

  .post-header {
    padding: 16px;
  }

  .post-images-grid {
    padding: 0 12px;
    gap: 8px;
  }

  .post-single-image {
    padding: 0 12px;
  }

  .post-single-image img,
  .grid-image-wrapper {
    border-radius: 8px;
  }

  .post-footer {
    padding: 12px 16px;
  }

  .post-actions {
    gap: 14px;
  }

  .post-action-btn span {
    font-size: 12px;
  }

  /* Mobile Bottom Navigation */
  .mobile-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    width: 50px;
    height: 100%;
    position: relative;
    transition: var(--transition-fast);
  }

  .mobile-nav-item i {
    width: 22px;
    height: 22px;
  }

  .mobile-nav-item.active {
    color: var(--primary);
  }

  .mobile-nav-item .nav-badge {
    position: absolute;
    top: 10px;
    right: 8px;
    font-size: 8px;
    padding: 1px 4px;
  }

  /* Side Drawers for mobile */
  .mobile-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background-color: var(--bg-card);
    z-index: 150;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .mobile-drawer.active {
    right: 0;
  }

  .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
  }

  .drawer-header h3 {
    font-size: 16px;
  }

  .drawer-close-btn {
    color: var(--text-secondary);
  }

  .drawer-close-btn i {
    width: 20px;
    height: 20px;
  }

  .drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }

  .drawer-content .sidebar-card {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  /* Mobile Sidebar Overlays */
  .left-sidebar.mobile-active {
    display: flex !important;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 60px;
    width: 280px;
    background-color: var(--bg-card);
    z-index: 130;
    padding: 20px;
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .left-sidebar.mobile-active .profile-card-info,
  .left-sidebar.mobile-active .profile-stats,
  .left-sidebar.mobile-active .sidebar-divider,
  .left-sidebar.mobile-active .pages-section,
  .left-sidebar.mobile-active .sidebar-footer {
    display: flex !important;
  }

  .left-sidebar.mobile-active .sidebar-nav span {
    display: inline !important;
  }

  .left-sidebar.mobile-active .nav-item {
    width: 100%;
    height: auto;
    padding: 12px 16px;
    border-radius: var(--border-radius-item);
    justify-content: flex-start;
    gap: 12px;
  }

  .left-sidebar.mobile-active .nav-badge {
    position: static;
  }

  @keyframes slideInLeft {
    from {
      transform: translateX(-100%);
    }

    to {
      transform: translateX(0);
    }
  }
}

/* Shorts / Reels Premium Hover Styles */
.reel-card {
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.reel-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg), 0 20px 40px rgba(0, 0, 0, 0.4);
}

.reel-action-btn {
  transition: transform var(--transition-fast);
  touch-action: manipulation;
  pointer-events: auto;
}

.reel-action-btn:hover {
  transform: translateY(-2px);
}

.reel-action-btn:hover i {
  transform: scale(1.15);
}

.reel-action-btn i {
  transition: transform var(--transition-fast);
}

.shorts-mobile-search-btn,
.shorts-search-overlay {
  display: none;
}

.shorts-mobile-search-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 120;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.46);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

.shorts-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding: 18px 14px 88px;
}

.shorts-search-panel {
  width: min(420px, 100%);
  max-height: min(78vh, 620px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.shorts-search-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shorts-search-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.shorts-search-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.shorts-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

.shorts-search-input-wrap input,
.shorts-search-input-wrap input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff !important;
  font-size: 13px;
  outline: none;
  opacity: 1;
  appearance: none;
  -webkit-appearance: none;
}

.shorts-search-input-wrap input::placeholder,
.shorts-search-input-wrap input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.56);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.56);
  opacity: 1;
}

.shorts-search-input-wrap input::-webkit-search-decoration,
.shorts-search-input-wrap input::-webkit-search-cancel-button,
.shorts-search-input-wrap input::-webkit-search-results-button,
.shorts-search-input-wrap input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.shorts-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 80px;
  max-height: min(62vh, 520px);
}

.shorts-search-empty {
  padding: 18px 12px;
  border-radius: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.shorts-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  text-align: left;
}

.shorts-search-result-thumb {
  width: 52px;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

.shorts-search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shorts-search-result-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.shorts-search-result-copy strong,
.shorts-search-result-copy span,
.shorts-search-result-copy p,
.shorts-search-result-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shorts-search-result-copy strong,
.shorts-search-result-copy span,
.shorts-search-result-copy small {
  white-space: nowrap;
}

.shorts-search-result-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.shorts-search-result-copy span,
.shorts-search-result-copy small {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
}

.shorts-search-result-copy p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.reel-like-btn.liked i,
.reel-like-btn.liked svg,
.like-btn.liked i,
.like-btn.liked svg {
  fill: #ff2d55 !important;
  color: #ff2d55 !important;
}

/* Mobile TikTok-like full-screen snap-scroll Shorts */
@media screen and (max-width: 768px) {

  /* Hide mobile topbar when viewing shorts */
  body.viewing-shorts .mobile-header {
    display: none !important;
  }

  /* Expand main layout to full screen without padding */
  body.viewing-shorts .main-layout {
    padding: 0 !important;
    gap: 0 !important;
  }

  body.viewing-shorts .stories-wrapper,
  body.viewing-shorts .create-post-card,
  body.viewing-shorts #postsContainer,
  body.viewing-shorts .mobile-messages-section {
    display: none !important;
  }

  /* Make the shorts section fixed and cover full screen (minus bottom mobile nav) */
  body.viewing-shorts #shortsSection {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    /* 60px is mobile nav height */
    height: calc(100vh - 60px);
    width: 100vw;
    z-index: 90;
    background: #000 !important;
    /* TikTok dark vibe */
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
  }

  body.viewing-shorts .shorts-mobile-search-btn {
    display: inline-flex !important;
  }

  /* Hide the desktop-style shorts header on mobile and keep only the search button */
  body.viewing-shorts .shorts-header-container {
    display: none !important;
  }

  /* Enable vertical scroll snap type on the reels feed container */
  body.viewing-shorts .reels-feed {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100%;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    scrollbar-width: none;
    /* Hide scrollbars Firefox */
  }

  body.viewing-shorts .reels-feed::-webkit-scrollbar {
    display: none;
    /* Hide scrollbars Chrome/Safari */
  }

  /* Make each reel card take exactly the height of the viewport minus bottom nav */
  body.viewing-shorts .reel-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: calc(100vh - 60px) !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    aspect-ratio: auto !important;
    /* Override layout constraints */
    box-shadow: none !important;
    flex-shrink: 0 !important;
  }

  /* Ensure the video cover image is fully centered and covers the background */
  body.viewing-shorts .reel-card img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    filter: none !important;
  }

  /* Adjust actions overlay for full-height TikTok style */
  body.viewing-shorts .reel-card>div:last-child {
    right: 12px !important;
    bottom: 110px !important;
  }

  /* Adjust info text overlay at the bottom left */
  body.viewing-shorts .reel-card .reel-details-overlay {
    padding: 20px 16px 24px 16px !important;
  }

  /* Make mobile messages section take full available height */
  body.viewing-messages .main-layout {
    padding-top: 0;
  }

  body.viewing-messages #mobileMessagesSection {
    display: flex !important;
    gap: 0 !important;
    margin-top: -8px;
    min-height: calc(100vh - 132px);
  }

  body.viewing-messages #mobileMessagesSection > div:first-child {
    padding: 0 0 2px !important;
  }

  body.viewing-messages #mobileMessagesSection h2 {
    margin: 0 !important;
  }

  body.viewing-messages .stories-wrapper,
  body.viewing-messages .create-post-card,
  body.viewing-messages #postsContainer,
  body.viewing-messages #shortsSection {
    display: none !important;
  }

  body.viewing-messages #mobileMessagesSection .messages-card {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  body.viewing-messages #mobileMessagesSection .messages-list {
    flex: 1;
    max-height: none !important;
    /* Override the 380px limit */
    overflow-y: auto;
  }
}

/* ==========================================
   Facebook-Style Chat Popups
   ========================================== */

.chat-boxes-container {
  position: fixed;
  bottom: 0;
  right: 360px;
  /* Offset to clear the 320px right sidebar on desktop */
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 16px;
  z-index: 999;
  pointer-events: none;
}

@media screen and (max-width: 1200px) {
  .chat-boxes-container {
    right: 24px;
  }
}

.chat-box {
  width: 320px;
  height: 400px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 8px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow: hidden;
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-box.minimized {
  height: 48px !important;
}

/* Chat Header */
.chat-header {
  height: 48px;
  padding: 0 12px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-header-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.chat-header-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease;
}

.chat-header-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.chat-header-btn i,
.chat-header-btn svg {
  width: 14px;
  height: 14px;
}

.chat-icon-btn {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.chat-icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.chat-icon-btn i,
.chat-icon-btn svg {
  width: 14px;
  height: 14px;
  color: currentColor;
  stroke: currentColor;
}

body[data-theme="dark"] .chat-icon-btn {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border-color: rgba(148, 163, 184, 0.18);
}

body[data-theme="dark"] .chat-icon-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.25);
}

.chat-send-btn {
  flex: 0 0 36px;
  min-width: 36px;
  min-height: 36px;
  aspect-ratio: 1 / 1;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-card);
}

.chat-msg-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  width: fit-content;
  min-width: 0;
}

.chat-msg-wrapper.outgoing {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-wrapper.incoming {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-msg-bubble {
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg-wrapper.outgoing .chat-msg-bubble {
  background-color: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-msg-wrapper.incoming .chat-msg-bubble {
  background-color: var(--bg-input);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-msg-time {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.chat-msg-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  width: 100%;
}

.chat-msg-wrapper.outgoing .chat-msg-footer {
  justify-content: flex-end;
}

.chat-msg-wrapper.outgoing .chat-msg-time,
.chat-msg-wrapper.outgoing .chat-msg-status {
  color: rgba(255, 255, 255, 0.84);
}

.chat-msg-wrapper.outgoing .chat-msg-status.read {
  color: #ffffff;
}

.chat-msg-wrapper.incoming .chat-msg-footer {
  justify-content: flex-start;
}

.chat-msg-status {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--text-muted);
}

.chat-msg-status.read {
  color: var(--primary);
}

.chat-msg-status.sent {
  color: var(--text-muted);
}

.chat-msg-status i,
.chat-msg-status svg {
  width: 11px;
  height: 11px;
  color: currentColor;
  stroke: currentColor;
  fill: none;
}

.chat-msg-footer .chat-msg-time {
  margin-top: 0;
  display: inline-flex;
}

.chat-shared-post-bubble {
  width: min(240px, 72vw);
  max-width: 240px;
  padding: 6px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.chat-msg-wrapper.outgoing .chat-shared-post-bubble {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.chat-msg-wrapper.incoming .chat-shared-post-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.chat-shared-post-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.chat-msg-wrapper.chat-msg-wrapper-shared {
  max-width: min(88%, 340px);
}

.chat-shared-snapshot-bubble {
  width: min(290px, 78vw);
  max-width: 290px;
  padding: 0;
}

.chat-msg-wrapper.outgoing .chat-shared-snapshot-bubble,
.chat-msg-wrapper.incoming .chat-shared-snapshot-bubble {
  background: transparent;
  border-color: transparent;
}

.chat-shared-feed-card,
.chat-shared-reel-card {
  position: relative;
  overflow: hidden;
}

.chat-facebook-share-shell {
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.chat-shared-capture-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.chat-msg-wrapper.outgoing .chat-shared-capture-badge {
  background: rgba(15, 23, 42, 0.34);
  color: #fff;
}

.chat-msg-wrapper.incoming .chat-shared-capture-badge {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-primary);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-facebook-share-badge {
  position: static;
  margin: 10px 10px 0;
  background: transparent !important;
  border: none !important;
  backdrop-filter: none;
  padding: 0;
  color: var(--text-muted) !important;
}

.chat-tiktok-share-badge {
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.44) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-shared-feed-card.post-card {
  border-radius: 0;
  box-shadow: none;
  border: none;
  background: var(--bg-card);
}

.chat-shared-feed-card .post-header {
  padding: 10px 12px 8px;
}

.chat-shared-feed-card .post-author-info,
.chat-shared-static-author {
  min-width: 0;
}

.chat-shared-feed-card .author-details,
.chat-shared-feed-card .post-header > *,
.chat-shared-feed-card .post-content > * {
  min-width: 0;
}

.chat-shared-static-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-shared-feed-card .author-avatar {
  width: 32px;
  height: 32px;
}

.chat-shared-feed-card .author-name {
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-shared-feed-card .post-time {
  font-size: 10px;
}

.chat-shared-feed-card .post-content {
  pointer-events: none;
}

.chat-shared-feed-card .post-content .post-text {
  padding: 0 12px 10px !important;
  font-size: 12px;
  line-height: 1.4;
}

.chat-shared-feed-card .post-content .post-bg-container {
  min-height: 124px;
  padding: 14px 12px;
}

.chat-shared-feed-card .post-content .post-bg-container p {
  font-size: 12px !important;
  line-height: 1.35;
}

.chat-shared-feed-card .post-single-image img,
.chat-shared-feed-card .post-images-grid img,
.chat-shared-feed-card .post-video-shell video {
  max-height: 150px;
  object-fit: cover;
}

.chat-shared-feed-card .post-single-video,
.chat-shared-feed-card .post-single-live,
.chat-shared-feed-card .challenge-post-card {
  pointer-events: none;
}

.chat-shared-feed-card .post-footer {
  padding: 0 8px 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.chat-shared-feed-card .post-actions {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.chat-shared-feed-card .post-action-btn,
.chat-shared-feed-card .post-bookmark-btn,
.chat-shared-feed-card button,
.chat-shared-feed-card a {
  pointer-events: none !important;
}

.chat-shared-feed-card .post-action-btn {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 10px;
  min-width: 0;
  flex: 1 1 calc(50% - 3px);
  justify-content: center;
}

.chat-shared-feed-card .post-action-btn i,
.chat-shared-feed-card .post-bookmark-btn i {
  width: 13px;
  height: 13px;
}

.chat-shared-feed-card .btn-text-label,
.chat-shared-feed-card .action-label {
  font-size: 10px;
}

.chat-shared-feed-card .action-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.chat-shared-feed-card .challenge-post-card {
  margin: 0 10px 10px;
  transform: none;
  width: auto;
  overflow: hidden;
}

.chat-facebook-share-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 12px;
  background: rgba(148, 163, 184, 0.08);
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.chat-facebook-share-domain {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.chat-facebook-share-open {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.chat-shared-reel-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  min-height: 250px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}

.chat-shared-reel-media,
.chat-shared-reel-media img,
.chat-shared-reel-media video,
.chat-shared-reel-fallback {
  width: 100%;
  height: 250px;
}

.chat-shared-reel-media img,
.chat-shared-reel-media video {
  display: block;
  object-fit: cover;
}

.chat-shared-reel-fallback {
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
}

.chat-shared-reel-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 8px;
  padding: 76px 14px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 12%, rgba(0, 0, 0, 0.48) 64%, transparent 100%);
  color: #fff;
}

.chat-shared-reel-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.chat-shared-reel-author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-shared-reel-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.chat-shared-reel-author>div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-shared-reel-author-name,
.chat-shared-reel-author span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-shared-reel-author-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.chat-shared-reel-author span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.76);
}

.chat-shared-reel-caption {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-shared-reel-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 10px;
  font-weight: 700;
}

.chat-shared-reel-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-shared-reel-stats-vertical {
  position: absolute;
  right: 12px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.chat-shared-reel-stats-vertical span {
  min-width: 52px;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.chat-shared-reel-stats-vertical strong {
  font-size: 10px;
  font-weight: 800;
}

.chat-shared-reel-card *,
.chat-shared-snapshot-bubble .post-card * {
  pointer-events: none;
}

@media screen and (max-width: 560px) {
  .chat-msg-wrapper.chat-msg-wrapper-shared {
    max-width: calc(100% - 18px);
  }

  .chat-shared-snapshot-bubble {
    width: min(320px, calc(100vw - 92px));
    max-width: calc(100vw - 92px);
  }

  .chat-shared-feed-card .post-header {
    padding: 10px 10px 8px;
  }

  .chat-facebook-share-badge {
    margin: 8px 8px 0;
  }

  .chat-shared-feed-card .post-content .post-text {
    padding: 0 10px 8px !important;
    font-size: 11px;
  }

  .chat-shared-feed-card .post-content .post-bg-container {
    min-height: 110px;
    padding: 12px 10px;
  }

  .chat-shared-feed-card .post-content .post-bg-container p {
    font-size: 11px !important;
  }

  .chat-shared-feed-card .post-single-image img,
  .chat-shared-feed-card .post-images-grid img,
  .chat-shared-feed-card .post-video-shell video {
    max-height: 132px;
  }

  .chat-shared-feed-card .post-footer {
    padding: 0 6px 6px;
  }

  .chat-shared-feed-card .post-actions {
    gap: 4px;
  }

  .chat-shared-feed-card .post-action-btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 28px;
    padding: 5px 6px;
    font-size: 9.5px;
  }

  .chat-shared-feed-card .btn-text-label,
  .chat-shared-feed-card .action-label {
    font-size: 9.5px;
  }

  .chat-shared-feed-card .challenge-post-card {
    margin: 0 8px 8px;
  }

  .chat-facebook-share-cta {
    padding: 9px 10px 10px;
  }

  .chat-shared-reel-card {
    min-height: 220px;
  }

  .chat-shared-reel-media,
  .chat-shared-reel-media img,
  .chat-shared-reel-media video,
  .chat-shared-reel-fallback {
    height: 220px;
  }

  .chat-shared-reel-overlay {
    padding: 70px 12px 12px;
  }

  .chat-shared-reel-stats-vertical {
    right: 10px;
    bottom: 12px;
  }

  .chat-shared-reel-stats-vertical span {
    min-width: 48px;
    padding: 5px 7px;
  }
}

@media screen and (max-width: 400px) {
  .chat-msg-wrapper.chat-msg-wrapper-shared {
    max-width: calc(100% - 10px);
  }

  .chat-shared-snapshot-bubble {
    width: calc(100vw - 76px);
    max-width: calc(100vw - 76px);
  }

  .chat-shared-feed-card .author-avatar {
    width: 30px;
    height: 30px;
  }

  .chat-shared-feed-card .author-name {
    font-size: 11px;
  }

  .chat-shared-feed-card .post-time {
    font-size: 9px;
  }

  .chat-shared-feed-card .post-action-btn {
    flex: 1 1 100%;
  }

  .chat-facebook-share-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-shared-reel-card {
    min-height: 205px;
  }

  .chat-shared-reel-media,
  .chat-shared-reel-media img,
  .chat-shared-reel-media video,
  .chat-shared-reel-fallback {
    height: 205px;
  }

  .chat-shared-reel-overlay {
    padding: 52px 10px 10px;
  }

  .chat-shared-reel-stats-vertical {
    right: 8px;
    gap: 6px;
  }

  .chat-shared-reel-stats-vertical span {
    min-width: 44px;
  }
}

.chat-shared-post-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.chat-msg-wrapper.outgoing .chat-shared-post-kicker {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.96);
}

.chat-msg-wrapper.incoming .chat-shared-post-kicker {
  background: var(--primary-light);
  color: var(--primary);
}

.chat-shared-post-author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-shared-post-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-shared-post-author>div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-shared-post-author strong,
.chat-shared-post-author span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-shared-post-author strong {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.chat-shared-post-author span {
  font-size: 10px;
  line-height: 1.2;
  opacity: 0.82;
}

.chat-shared-post-media {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
}

.chat-shared-post-media img,
.chat-shared-post-media video {
  display: block;
  width: 100%;
  height: 108px;
  object-fit: cover;
}

.chat-shared-post-media-video video {
  background: #000;
}

.chat-shared-post-excerpt {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-shared-post-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  pointer-events: none;
}

.chat-msg-wrapper.outgoing .chat-shared-post-link {
  background: #fff;
  color: var(--primary);
}

.chat-msg-wrapper.incoming .chat-shared-post-link {
  background: var(--primary-light);
  color: var(--primary);
}

/* Chat Input */
.chat-input-wrapper {
  height: 52px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: visible;
}

.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 0 16px;
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn i,
.chat-send-btn svg {
  width: 14px;
  height: 14px;
  color: white;
  stroke: white;
}

.chat-attachment-preview {
  padding: 0 12px 10px 12px;
}

.chat-attachment-preview-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-attachment-preview-media {
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  display: block;
  background: #000;
}

.chat-attachment-preview-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
}

.chat-attachment-preview-meta {
  min-width: 0;
  flex: 1;
}

.chat-attachment-preview-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-attachment-preview-subtitle {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-attachment-preview-remove {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  flex: 0 0 28px;
  border: none;
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Mobile responsive styles for Chat Box */
@media screen and (max-width: 768px) {
  .chat-boxes-container {
    right: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    gap: 0 !important;
    flex-direction: column !important;
  }

  .chat-box {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    z-index: 2000 !important;
    border: none !important;
  }

  .chat-header {
    height: 56px;
    padding-top: env(safe-area-inset-top);
  }

  .chat-input-wrapper {
    flex: 0 0 auto;
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(56px + env(safe-area-inset-bottom));
    min-height: calc(56px + env(safe-area-inset-bottom));
  }

  .chat-messages {
    min-height: 0;
  }
}




/* --- HASHTAG FEATURE CSS --- */
.post-input-editable {
  width: 100%;
  min-height: 24px;
  max-height: 120px;
  overflow-y: auto;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  padding: 8px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-input-editable:empty:before {
  content: '';
}

.post-input-placeholder {
  position: absolute;
  top: 10px;
  left: 12px;
  color: var(--text-secondary);
  pointer-events: none;
  display: block;
}

.post-input-editable:focus+.post-input-placeholder,
.post-input-editable:not(:empty)+.post-input-placeholder {
  display: none;
}

.hashtag-free {
  color: #3b82f6;
  /* Blue */
  font-weight: 600;
  font-style: italic;
}

.hashtag-paid {
  color: #f59e0b;
  /* Gold/Amber */
  font-weight: 600;
  text-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
  font-style: italic;
}

.hashtag-link,
.mention-link {
  font-size: 0.80em;
  font-style: italic;
  letter-spacing: 0.01em;
}

/* Popover Glassmorphism Design */
.hashtag-popover {
  display: none;
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  width: 320px;
  text-align: left;
  flex-direction: column;
  /* Force header and body to stack vertically when displayed as flex */
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hashtag-popover-arrow {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #5b72f6;
  /* Blends perfectly with the top gradient header */
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 1001;
  /* Higher than header so it is visible on top */
}

#hashtagListModal .hashtag-popover-arrow {
  background: #5b72f6;
}

#photoVideoModal .hashtag-popover-arrow {
  background: #0c9ef8;
}

#attachmentModal .hashtag-popover-arrow {
  background: #f7941e;
}

#challengeModal .hashtag-popover-arrow {
  background: #fa6e1b;
}

#mentionModal .hashtag-popover-arrow {
  background: #be34d6;
}

#textStyleModal .hashtag-popover-arrow {
  background: #ec4899;
}

.hashtag-popover-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
  background: var(--bg-card);
}

.hashtag-popover-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hashtag-popover-body {
  padding: 12px;
  position: relative;
  z-index: 2;
}

.hashtag-list-container {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 4px;
}

.hashtag-list-container::-webkit-scrollbar {
  width: 6px;
}

.hashtag-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.hashtag-list-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.hashtag-list-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.hashtag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hashtag-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  transform: translateY(-1px);
}

.hashtag-item:active {
  transform: translateY(0) scale(0.98);
}

.hashtag-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hashtag-item-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary);
  transition: color 0.2s;
}

.hashtag-item:hover .hashtag-item-name {
  color: #3b82f6;
}

.hashtag-item.is-premium:hover .hashtag-item-name {
  color: #f59e0b;
}

.hashtag-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.hashtag-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 10px;
  text-align: center;
  color: var(--text-secondary);
  gap: 8px;
}

.hashtag-empty-state i {
  color: var(--border-color);
  width: 32px;
  height: 32px;
}

.hashtag-empty-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.hashtag-create-btn {
  width: 100%;
  padding: 10px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
  transition: all 0.2s;
}

.hashtag-create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
  filter: brightness(1.05);
}

.hashtag-create-btn:active {
  transform: translateY(0);
}

.challenge-title-input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(249, 115, 22, 0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,247,237,0.98) 100%);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 8px 24px rgba(249, 115, 22, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.challenge-title-input::placeholder {
  color: #9a6b5a;
  font-weight: 600;
}

.challenge-title-input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14), 0 12px 28px rgba(249, 115, 22, 0.14);
  transform: translateY(-1px);
}

#challengeModal input.settings-input,
#challengeModal input.challenge-title-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none !important;
  transition: all 0.2s ease;
  transform: none !important;
}

#challengeModal input.settings-input::placeholder,
#challengeModal input.challenge-title-input::placeholder {
  color: var(--text-secondary) !important;
  opacity: 0.7;
}

#challengeModal input.settings-input:focus,
#challengeModal input.challenge-title-input:focus {
  outline: none !important;
  border-color: #f97316 !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15) !important;
  background: var(--bg-card) !important;
}

.challenge-post-card {
  margin: 0 20px 18px;
  margin-top: -4px;
  padding: 0;
  border-radius: 26px;
  border: 0;
  background: var(--bg-card);
  box-shadow: none;
  overflow: visible;
}

.challenge-post-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.challenge-post-kicker {
  font-size: 11px;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenge-post-title {
  font-size: 18px;
  font-weight: 800;
  color: #14532d;
  margin-top: 3px;
}

.challenge-post-meta {
  font-size: 11px;
  color: #4b5563;
  margin-top: 4px;
}

.challenge-post-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   CHALLENGE INFOGRAPHIC BOARD  –  Org-Chart Design
   Layout: [Top Winner] → [3 colored columns with sub-cards]
   Matches: arrow/chevron cards + diamond photo overlay
═══════════════════════════════════════════════════════ */
.challenge-infographic-board {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  border-radius: 22px;
  padding: 22px 16px 20px;
  margin-top: 14px;
  background: linear-gradient(160deg, #fdf6ff 0%, #f0f4ff 60%, #fafbff 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: visible;
  box-shadow: 0 8px 32px rgba(80, 40, 160, 0.08);
}

/* ─── TOP WINNER ROW ─── */
.cib-top-section {
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;
  padding-bottom: 0;
}

/* ─── TREE CONNECTOR (vertical drop → horizontal bar → 3 drops) ─── */
.cib-connector-tree {
  position: relative;
  width: 100%;
  height: 36px;
  flex-shrink: 0;
}

/* Vertical line from top winner card down to horizontal bar */
.cib-connector-tree::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 55%;
  background: #c8cdd8;
  transform: translateX(-50%);
  border-radius: 2px;
}

/* Horizontal bar connecting the 3 column drop points */
.cib-connector-tree::after {
  content: '';
  position: absolute;
  left: calc(100% / 6);
  right: calc(100% / 6);
  top: 55%;
  height: 2px;
  background: #c8cdd8;
  transform: translateY(-50%);
  border-radius: 2px;
}

/* ─── THREE COLUMNS ─── */
.cib-columns {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: flex-start;
}

.cib-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Vertical drop from horizontal bar to each column main card */
.cib-column::before {
  content: '';
  display: block;
  width: 2px;
  height: 18px;
  background: #c8cdd8;
  margin: 0 auto;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Vertical line between main card and first sub-card */
.cib-v-line {
  width: 2px;
  height: 12px;
  background: #d1d5db;
  margin: 0 auto;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─── BASE CARD (arrow/chevron shape) ─── */
.cib-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: transform 0.22s ease, filter 0.22s ease, box-shadow 0.22s ease;
  /* Arrow shape pointing RIGHT */
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
  background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
  padding: 10px 26px 10px 40px;
  min-height: 64px;
  box-sizing: border-box;
  overflow: visible;
}

.cib-card:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.06);
}

/* ─── Diamond photo container (rotated 45°, overhangs left) ─── */
.cib-diamond {
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(255,255,255,0.25);
  border: 3px solid rgba(255,255,255,0.95);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  overflow: hidden;
  flex-shrink: 0;
  z-index: 2;
}

.cib-diamond img {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 130%;
  height: 130%;
  object-fit: cover;
  transform: rotate(-45deg);
  transform-origin: center;
}

/* Placeholder diamond (no photo) */
.cib-diamond--placeholder {
  background: rgba(255,255,255,0.2);
}

.cib-diamond--placeholder::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  width: 55%;
  height: 55%;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: 2px solid rgba(255,255,255,0.6);
}

/* ─── Card content ─── */
.cib-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.cib-name {
  font-size: 10.5px;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.cib-pos {
  font-size: 8.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.cib-info {
  font-size: 7.5px;
  color: rgba(255,255,255,0.72);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── WINNER CARD (top, larger) ─── */
.cib-card--winner {
  width: 58%;
  min-width: 170px;
  max-width: 280px;
  min-height: 76px;
  padding: 13px 32px 13px 50px;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 0 100%);
}

.cib-card--winner .cib-diamond {
  width: 56px;
  height: 56px;
  left: -20px;
  border-radius: 12px;
}

.cib-card--winner .cib-name { font-size: 12px; }
.cib-card--winner .cib-pos  { font-size: 9.5px; }
.cib-card--winner .cib-info { font-size: 8px; }

/* ─── MAIN COLUMN CARD (medium) ─── */
.cib-card--main {
  min-height: 68px;
  padding: 10px 24px 10px 42px;
}

.cib-card--main .cib-diamond {
  width: 48px;
  height: 48px;
  left: -17px;
}

/* ─── SUB CARD (smaller, lighter) ─── */
.cib-card--sub {
  min-height: 56px;
  padding: 8px 20px 8px 36px;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
}

.cib-card--sub .cib-diamond {
  width: 38px;
  height: 38px;
  left: -13px;
  border-radius: 8px;
}

.cib-card--sub .cib-name { font-size: 9px; }
.cib-card--sub .cib-pos  { font-size: 8px; }
.cib-card--sub .cib-info { font-size: 7px; }

/* ─── INNER EDGE HIGHLIGHT ─── */
.cib-card::after {
  content: '';
  position: absolute;
  inset: 1px 18px 1px 1px;
  clip-path: inherit;
  border: 1px solid rgba(255,255,255,0.2);
  pointer-events: none;
}

/* ─── COLOR VARIANTS ─── */
/* Orange – winner */
.cib-card.is-orange {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.32);
}

/* Purple – column 1 */
.cib-card.is-purple {
  background: linear-gradient(135deg, #5b21b6 0%, #8b5cf6 100%);
  box-shadow: 0 8px 20px rgba(91, 33, 182, 0.28);
}

/* Pink – column 2 */
.cib-card.is-pink {
  background: linear-gradient(135deg, #be185d 0%, #ec4899 100%);
  box-shadow: 0 8px 20px rgba(190, 24, 93, 0.28);
}

/* Blue – column 3 */
.cib-card.is-blue {
  background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.28);
}

/* ─── RESPONSIVE ─── */
@media screen and (max-width: 768px) {
  .challenge-infographic-board {
    padding: 16px 10px 16px;
  }

  .cib-card--winner {
    width: 80%;
    min-width: 0;
    max-width: 100%;
  }

  .cib-columns {
    gap: 6px;
  }

  .cib-card--winner { padding: 11px 28px 11px 44px; min-height: 64px; }
  .cib-card--winner .cib-diamond { width: 46px; height: 46px; left: -16px; }
  .cib-card--winner .cib-name { font-size: 10px; }

  .cib-card--main { padding: 9px 20px 9px 36px; min-height: 58px; }
  .cib-card--main .cib-diamond { width: 38px; height: 38px; left: -13px; }
  .cib-card--main .cib-name { font-size: 8.5px; }

  .cib-card--sub { padding: 7px 16px 7px 30px; min-height: 48px; }
  .cib-card--sub .cib-diamond { width: 30px; height: 30px; left: -10px; }
  .cib-card--sub .cib-name { font-size: 7.5px; }
  .cib-card--sub .cib-pos  { font-size: 7px; }
  .cib-card--sub .cib-info { display: none; }

  .cib-connector-tree { height: 28px; }
}

/* Legacy classes (hidden / not rendered anymore) */
.challenge-infographic-core,
.challenge-core-hex,
.challenge-core-bridge,
.challenge-core-decor,
.challenge-branches,
.challenge-branch-spine,
.challenge-branches-list,
.challenge-branch-row,
.challenge-branch-joint,
.challenge-vote-card {
  display: none;
}

@keyframes challengeOrgReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cib-card {
  animation: challengeOrgReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cib-card--winner { animation-delay: 0s; }
.cib-card--main   { animation-delay: 0.1s; }
.cib-card--sub:nth-child(1) { animation-delay: 0.18s; }
.cib-card--sub:nth-child(2) { animation-delay: 0.25s; }


.challenge-infographic-board::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 10% 30%, rgba(59, 130, 246, 0.07), transparent 38%),
    radial-gradient(ellipse at 15% 80%, rgba(249, 115, 22, 0.07), transparent 30%);
  pointer-events: none;
}

/* ── Left: Big central hexagon ── */
.challenge-infographic-core {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.challenge-core-hex {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 14px;
  color: #0f172a;
  background: #ffffff;
  clip-path: polygon(25% 5%, 75% 5%, 98% 50%, 75% 95%, 25% 95%, 2% 50%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  isolation: isolate;
  z-index: 2;
}

.challenge-core-hex::before {
  content: '';
  position: absolute;
  inset: -8px;
  z-index: -1;
  background: linear-gradient(135deg, #e11d48 0%, #2563eb 30%, #10b981 60%, #f59e0b 100%);
  clip-path: polygon(25% 5%, 75% 5%, 98% 50%, 75% 95%, 25% 95%, 2% 50%);
  filter: drop-shadow(0 8px 20px rgba(59, 130, 246, 0.22));
  animation: challengeHueShift 8s linear infinite;
}

.challenge-core-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}

.challenge-core-hex strong {
  font-size: 13px;
  line-height: 1.1;
  font-weight: 900;
  text-transform: uppercase;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.challenge-core-hex small {
  margin-top: 6px;
  font-size: 9px;
  color: #475569;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── Horizontal bridge: hex → vertical spine ── */
.challenge-core-bridge {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 2px;
  position: relative;
  z-index: 0;
}

.challenge-core-bridge-line {
  height: 2px;
  width: 28px;
  background: linear-gradient(90deg, rgba(148,163,184,0.7), rgba(148,163,184,0.3));
  flex-shrink: 0;
}

.challenge-core-bridge-dot {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #94a3b8;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.9);
  margin: 0 2px;
}

/* ── Right: vertical spine + arrow banners ── */
.challenge-branches {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  padding-left: 0;
}

/* Vertical colorful spine */
.challenge-branch-spine {
  position: absolute;
  left: 12px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg,
    #e11d48 0%,
    #4f46e5 17%,
    #2563eb 33%,
    #38bdf8 48%,
    #22c55e 63%,
    #facc15 79%,
    #fb923c 90%,
    #ef4444 100%);
  box-shadow: 0 0 0 5px rgba(255,255,255,0.85);
  animation: challengeSpineGlow 2.8s ease-in-out infinite;
}

.challenge-branches-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 4px 8px 28px;
  width: 100%;
}

.challenge-branch-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  opacity: 0;
  transform: translateX(18px);
  animation: challengeBranchReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--item-index, 0) * 0.09s);
}

/* Horizontal connector from spine to joint dot */
.challenge-branch-row::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  width: 16px;
  height: 1.5px;
  background: rgba(100, 116, 139, 0.5);
  transform: translateY(-50%);
  pointer-events: none;
}

/* Vertical connector between rows */
.challenge-branch-row::after {
  content: '';
  position: absolute;
  left: -14px;
  bottom: 50%;
  width: 1.5px;
  height: calc(10px + 50%);
  background: rgba(100, 116, 139, 0.25);
  pointer-events: none;
}

.challenge-branch-row:first-child::after {
  display: none;
}

/* Circle joint dot on the spine */
.challenge-branch-joint {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #94a3b8;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  z-index: 2;
}

/* ── Arrow-banner vote card (chevron/arrow shape) ── */
.challenge-vote-card {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 70px;
  box-sizing: border-box;
  border: 0;
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  /* Arrow shape pointing right */
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 0 100%);
  padding: 10px 32px 10px 12px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-items: center;
  text-align: left;
  column-gap: 10px;
  row-gap: 1px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(30, 58, 138, 0.15);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
  overflow: hidden;
}

.challenge-vote-card:hover {
  transform: translateX(4px) scale(1.01);
  box-shadow: 0 14px 30px rgba(30, 58, 138, 0.25);
  filter: brightness(1.05);
}

/* ── Color variants ── */
.challenge-vote-card.is-red,
.challenge-branch-joint.is-red {
  border-color: #e11d48;
}
.challenge-vote-card.is-red {
  background: linear-gradient(135deg, #9f1239 0%, #e11d48 100%);
  box-shadow: 0 10px 24px rgba(225, 29, 72, 0.2);
}

.challenge-vote-card.is-indigo,
.challenge-branch-joint.is-indigo {
  border-color: #4f46e5;
}
.challenge-vote-card.is-indigo {
  background: linear-gradient(135deg, #312e81 0%, #6366f1 100%);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.2);
}

.challenge-vote-card.is-blue,
.challenge-branch-joint.is-blue {
  border-color: #2563eb;
}
.challenge-vote-card.is-blue {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

.challenge-vote-card.is-sky,
.challenge-branch-joint.is-sky {
  border-color: #38bdf8;
}
.challenge-vote-card.is-sky {
  background: linear-gradient(135deg, #0369a1 0%, #38bdf8 100%);
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.2);
}

.challenge-vote-card.is-green,
.challenge-branch-joint.is-green {
  border-color: #22c55e;
}
.challenge-vote-card.is-green {
  background: linear-gradient(135deg, #14532d 0%, #22c55e 100%);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.2);
}

.challenge-vote-card.is-gold,
.challenge-branch-joint.is-gold {
  border-color: #facc15;
}
.challenge-vote-card.is-gold {
  background: linear-gradient(135deg, #92400e 0%, #facc15 100%);
  box-shadow: 0 10px 24px rgba(250, 204, 21, 0.2);
}

.challenge-vote-card.is-orange,
.challenge-branch-joint.is-orange {
  border-color: #fb923c;
}
.challenge-vote-card.is-orange {
  background: linear-gradient(135deg, #9a3412 0%, #fb923c 100%);
  box-shadow: 0 10px 24px rgba(251, 146, 60, 0.2);
}

/* Inner glow highlight */
.challenge-vote-card::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  right: 20px;
  bottom: 1px;
  clip-path: inherit;
  border: 1px solid rgba(255,255,255,0.18);
  pointer-events: none;
}

/* Small hexagon icon per card (replaces avatar) */
.challenge-vote-card img {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  background: rgba(255,255,255,0.2);
  clip-path: polygon(25% 5%, 75% 5%, 98% 50%, 75% 95%, 25% 95%, 2% 50%);
  border-radius: 0;
}

/* Rank badge */
.challenge-tree-rank {
  position: absolute;
  right: 24px;
  top: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* Name */
.challenge-vote-card strong {
  grid-column: 2;
  grid-row: 1;
  font-size: 10.5px;
  line-height: 1.2;
  color: #ffffff;
  font-weight: 800;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Country + score */
.challenge-tree-country,
.challenge-tree-score {
  grid-column: 2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,0.88);
  font-size: 8px;
  line-height: 1.2;
}

/* CTA pill */
.challenge-vote-cta {
  grid-column: 2;
  grid-row: 3;
  margin-top: 3px;
  font-size: 7px;
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Responsive ── */
@media screen and (max-width: 768px) {
  .challenge-infographic-board {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 10px 14px 10px;
    gap: 10px;
  }

  .challenge-infographic-core {
    align-items: center;
  }

  .challenge-core-hex {
    width: 110px;
    height: 110px;
  }

  .challenge-core-bridge {
    display: none;
  }

  .challenge-core-decor {
    display: none;
  }

  .challenge-branches {
    padding-left: 0;
  }

  .challenge-branch-spine {
    left: 14px;
    top: 6px;
    bottom: 6px;
  }

  .challenge-branches-list {
    padding-left: 24px;
    gap: 8px;
  }

  .challenge-vote-card {
    min-height: 60px;
    padding: 8px 26px 8px 10px;
    grid-template-columns: 34px minmax(0, 1fr);
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  }

  .challenge-vote-card img {
    width: 28px;
    height: 28px;
  }

  .challenge-vote-card strong { font-size: 9px; }
  .challenge-tree-country,
  .challenge-tree-score,
  .challenge-vote-cta { font-size: 6.5px; }
}

/* Legacy decor elements (hidden in new design) */
.challenge-core-decor {
  display: none;
}

@keyframes challengeBranchReveal {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes challengeSpineGlow {
  0%, 100% { box-shadow: 0 0 0 5px rgba(255,255,255,0.85), 0 0 0 rgba(59,130,246,0); }
  50%       { box-shadow: 0 0 0 5px rgba(255,255,255,0.85), 0 0 16px rgba(59,130,246,0.22); }
}

@keyframes challengeHueShift {
  0%   { filter: hue-rotate(0deg)   drop-shadow(0 10px 20px rgba(59,130,246,0.2)); }
  50%  { filter: hue-rotate(20deg)  drop-shadow(0 10px 20px rgba(16,185,129,0.2)); }
  100% { filter: hue-rotate(0deg)   drop-shadow(0 10px 20px rgba(59,130,246,0.2)); }
}

.challenge-post-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Restored previous challenge org-board design */
.challenge-org-board {
  position: relative;
  border-radius: 26px;
  padding: 22px 14px 16px;
  margin-top: 14px;
  background: linear-gradient(180deg, #fff8f2 0%, #fffdf9 100%);
  /* border: 1px solid rgba(217, 119, 6, 0.12); */
  overflow: hidden;
}

.challenge-org-top {
  position: relative;
  display: flex;
  justify-content: center;
  padding-bottom: 36px;
}

.challenge-org-top::before {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  top: 52px;
  height: 1.5px;
  background: #d8b486;
}

.challenge-org-top::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 52px;
  width: 1.5px;
  height: 56px;
  transform: translateX(-50%);
  background: #d8b486;
}

.challenge-org-columns {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 6px;
}

.challenge-org-column {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.challenge-org-column::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -18px;
  width: 1.5px;
  height: 18px;
  transform: translateX(-50%);
  background: #d8b486;
}

.challenge-org-column .challenge-vote-card + .challenge-vote-card::before {
  content: '';
  position: absolute;
  left: 40px;
  top: -16px;
  width: 1.5px;
  height: 16px;
  background: #d8b486;
}

.challenge-org-board .challenge-vote-card {
  display: grid;
  position: relative;
  width: min(100%, 176px);
  min-width: 0;
  min-height: 82px;
  box-sizing: border-box;
  border: 0;
  background: linear-gradient(135deg, #8a2be2 0%, #6b21a8 100%);
  clip-path: polygon(18px 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 18px 100%, 0 50%);
  padding: 10px 18px 10px 12px;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  align-items: center;
  text-align: left;
  column-gap: 9px;
  row-gap: 2px;
  color: inherit;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(91, 33, 182, 0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  overflow: hidden;
}

.challenge-org-board .challenge-vote-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(91, 33, 182, 0.22);
  filter: brightness(1.04);
}

.challenge-org-board .challenge-vote-card.is-top {
  width: min(100%, 204px);
  background: linear-gradient(135deg, #f97316 0%, #fb923c 52%, #f59e0b 100%);
  box-shadow: 0 18px 38px rgba(249, 115, 22, 0.22);
}

.challenge-org-board .challenge-vote-card.is-purple {
  background: linear-gradient(135deg, #7e22ce 0%, #6d28d9 100%);
}

.challenge-org-board .challenge-vote-card.is-pink {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  box-shadow: 0 16px 30px rgba(219, 39, 119, 0.18);
}

.challenge-org-board .challenge-vote-card.is-blue {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.18);
}

.challenge-org-board .challenge-vote-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 18px;
  clip-path: inherit;
  /* border: 1px solid rgba(255,255,255,0.22); */
  pointer-events: none;
}

.challenge-org-board .challenge-vote-card img {
  display: block;
  grid-column: 1;
  grid-row: 1 / span 4;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.96);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.14);
  background: #fff;
  clip-path: none;
}

.challenge-org-board .challenge-tree-rank {
  position: absolute;
  right: 10px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.challenge-org-board .challenge-vote-card strong {
  display: -webkit-box;
  grid-column: 2;
  grid-row: 1;
  font-size: 11px;
  line-height: 1.15;
  color: #ffffff;
  font-weight: 800;
  max-width: 100%;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.challenge-org-board .challenge-tree-country,
.challenge-org-board .challenge-tree-score {
  display: block;
  grid-column: 2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,0.9);
  font-size: 8px;
  line-height: 1.15;
}

.challenge-org-board .challenge-vote-cta {
  display: inline-flex;
  grid-column: 2;
  grid-row: 4;
  margin-top: 2px;
  font-size: 7px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 3px 6px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 92px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media screen and (max-width: 768px) {
  .challenge-org-board {
    padding: 18px 8px 12px;
  }

  .challenge-org-top::before {
    left: 12%;
    right: 12%;
  }

  .challenge-org-columns {
    gap: 8px;
  }

  .challenge-org-column {
    gap: 10px;
  }

  .challenge-org-board .challenge-vote-card {
    width: min(100%, 108px);
    min-height: 74px;
    padding: 8px 12px 8px 9px;
    grid-template-columns: 32px minmax(0, 1fr);
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  }

  .challenge-org-board .challenge-vote-card img {
    width: 30px;
    height: 30px;
    border-width: 3px;
  }

  .challenge-org-board .challenge-vote-card.is-top {
    width: min(100%, 148px);
  }

  .challenge-org-board .challenge-vote-card strong {
    font-size: 8px;
  }

  .challenge-org-board .challenge-tree-country,
  .challenge-org-board .challenge-tree-score,
  .challenge-org-board .challenge-vote-cta {
    font-size: 6px;
  }
}

.challenge-action-btn {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

/* Professional challenge redesign */
.challenge-post-card {
  margin: 0 20px 18px;
  margin-top: -4px;
  padding: 0;
  border-radius: 26px;
  border: 0;
  background: var(--bg-card);
  box-shadow: none;
  overflow: visible;
}

.challenge-post-header {
  padding: 18px 18px 10px;
  margin-bottom: 0;
  align-items: flex-start;
}

.challenge-post-kicker {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.challenge-post-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 800;
  margin-top: 5px;
}

.challenge-post-meta {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.challenge-post-badge {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.challenge-org-board,
.challenge-infographic-board {
  margin: 0 14px 14px;
  padding: 0;
  border-radius: 22px;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: hidden;
}

.challenge-org-top::before,
.challenge-org-top::after,
.challenge-org-column::before,
.challenge-org-column .challenge-vote-card + .challenge-vote-card::before,
.cib-connector-tree,
.cib-column::before,
.cib-v-line,
.challenge-infographic-board::before,
.challenge-branch-spine,
.challenge-branch-row::before,
.challenge-branch-row::after,
.challenge-branch-joint {
  display: none !important;
}

.challenge-org-top {
  padding-bottom: 12px;
}

.challenge-org-columns,
.cib-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  padding-top: 0;
}

.challenge-org-column,
.cib-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.challenge-org-board .challenge-vote-card,
.cib-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 102px;
  padding: 14px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 20px;
  clip-path: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  transform: none;
}

.challenge-org-board .challenge-vote-card:hover,
.cib-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  filter: none;
}

.challenge-org-board .challenge-vote-card::before,
.cib-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: #e2e8f0;
}

.challenge-org-board .challenge-vote-card::after,
.cib-card::after {
  display: none;
}

.challenge-org-board .challenge-vote-card.is-top {
  min-height: 118px;
}

.challenge-org-board .challenge-vote-card.is-top::before {
  background: #e2e8f0;
}

.challenge-org-board .challenge-vote-card,
.cib-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 4px;
}

.challenge-org-board .challenge-vote-card img,
.cib-diamond {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: 52px;
  height: 52px;
  grid-column: 1;
  grid-row: 1 / span 4;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  clip-path: none;
}

.cib-diamond img {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
}

.cib-diamond--placeholder::after {
  transform: translate(-50%, -50%);
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(148, 163, 184, 0.38);
}

.challenge-org-board .challenge-tree-rank {
  position: absolute;
  right: 12px;
  top: 12px;
  min-width: 28px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 9px;
  font-weight: 800;
}

.challenge-org-board .challenge-vote-card.is-top .challenge-tree-rank {
  background: linear-gradient(135deg, var(--primary) 0%, var(--badge-purple) 100%);
  color: #ffffff;
}

.challenge-org-board .challenge-vote-card strong,
.cib-name {
  grid-column: 2;
  grid-row: 1;
  font-size: 13px;
  line-height: 1.25;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.challenge-org-board .challenge-tree-country,
.challenge-org-board .challenge-tree-score,
.cib-pos,
.cib-info {
  grid-column: 2;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}

.challenge-org-board .challenge-vote-cta {
  grid-column: 2;
  grid-row: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #f8fafc;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  max-width: none;
}

.challenge-beauty-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.challenge-beauty-card {
  position: relative;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 14px 14px 18px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.challenge-beauty-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.challenge-beauty-card.is-leading {
  border-color: rgba(15, 23, 42, 0.12);
}

.challenge-beauty-rank {
  position: absolute;
  right: 12px;
  top: 12px;
  min-width: 28px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.challenge-beauty-card.is-leading .challenge-beauty-rank {
  background: linear-gradient(135deg, var(--primary) 0%, var(--badge-purple) 100%);
  color: #fff;
}

.challenge-beauty-card img {
  width: 58px;
  height: 58px;
  margin-left: 4px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.challenge-beauty-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.challenge-beauty-body strong {
  font-size: 13px;
  line-height: 1.25;
  color: #0f172a;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.challenge-beauty-meta {
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challenge-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  grid-column: 2;
  grid-row: 4;
  width: 100%;
}

.challenge-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  min-width: 0;
}

.challenge-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e 0%, #14b8a6 52%, #38bdf8 100%);
}

.challenge-progress-value {
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
}

.challenge-beauty-user-badge {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: calc(100% - 16px);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.challenge-beauty-user-badge img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.challenge-beauty-user-link {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challenge-beauty-user-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.challenge-miss-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  overflow: hidden;
}

.challenge-miss-track {
  display: flex;
  width: 100%;
  transition: transform 0.32s ease;
  will-change: transform;
}

.challenge-miss-slide {
  min-width: 100%;
  padding: 0 18px 2px;
  box-sizing: border-box;
}

.challenge-miss-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  cursor: default;
}

.challenge-miss-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.16;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
}

.challenge-miss-photo-wrap > img {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: cover;
}

.challenge-miss-award {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.challenge-miss-award.is-crown {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.challenge-miss-award.is-silver {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.challenge-miss-award.is-bronze {
  background: linear-gradient(135deg, #fb923c 0%, #c2410c 100%);
}

.challenge-miss-award i,
.challenge-miss-award svg {
  width: 18px;
  height: 18px;
}

.challenge-miss-card .challenge-beauty-body,
.challenge-miss-card .challenge-progress-row {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
}

.challenge-miss-card .challenge-beauty-body strong {
  -webkit-line-clamp: 2;
}

.challenge-miss-card .challenge-beauty-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.challenge-miss-vote-btn {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
}

.challenge-miss-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px 16px;
}

.challenge-carousel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.challenge-carousel-btn i,
.challenge-carousel-btn svg {
  width: 14px;
  height: 14px;
}

.challenge-miss-counter {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
}

.challenge-poll-board {
  border-radius: 24px;
  overflow: visible;
  background: transparent;
  border: 0;
  width: 100%;
  box-shadow: none;
}

.challenge-poll-title {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 16px;
  letter-spacing: 0.02em;
}

.challenge-poll-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.challenge-poll-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 2px 0;
}

.challenge-poll-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.challenge-poll-option:hover .challenge-poll-avatar {
  transform: scale(1.08);
}

.challenge-poll-track {
  position: relative;
  flex-grow: 1;
  height: 42px;
  border-radius: 21px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  overflow: visible;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  transition: border-color 0.2s ease;
}

.challenge-poll-option:hover .challenge-poll-track {
  border-color: var(--primary);
}

.challenge-poll-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.18) 0%, rgba(20, 184, 166, 0.28) 55%, rgba(56, 189, 248, 0.24) 100%);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.challenge-poll-flag {
  position: absolute;
  top: -10px;
  transform: translateX(-50%);
  left: clamp(11px, var(--percent, 0%), calc(100% - 11px));
  z-index: 5;
  width: 22px;
  height: 22px;
  background: var(--bg-card);
  border: 1.5px solid #f97316;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.2);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.challenge-poll-name {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 70px);
}


.challenge-poll-percent {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  z-index: 2;
  text-align: right;
}

.challenge-org-board .challenge-vote-card.is-top .challenge-vote-cta {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
}

.challenge-org-board .challenge-vote-card.is-purple,
.challenge-org-board .challenge-vote-card.is-pink,
.challenge-org-board .challenge-vote-card.is-blue,
.cib-card.is-orange,
.cib-card.is-purple,
.cib-card.is-pink,
.cib-card.is-blue {
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.challenge-post-actions {
  padding: 0 14px 14px;
  margin-top: 0;
}

.challenge-action-btn {
  flex: 1 1 140px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.challenge-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

@media screen and (max-width: 768px) {
  .challenge-post-card {
    margin-left: 0;
    margin-right: 0;
  }

  .challenge-org-board,
  .challenge-infographic-board {
    padding: 12px;
  }

  .challenge-org-columns,
  .cib-columns {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .challenge-org-board .challenge-vote-card,
  .cib-card {
    min-height: 92px;
    grid-template-columns: 50px minmax(0, 1fr);
    padding: 12px;
  }

  .challenge-org-board .challenge-vote-card img,
  .cib-diamond {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-left: 2px;
  }

  .challenge-org-board .challenge-vote-card strong,
  .cib-name {
    font-size: 12px;
  }

  .challenge-org-board .challenge-tree-country,
  .challenge-org-board .challenge-tree-score,
  .challenge-org-board .challenge-vote-cta,
  .cib-pos,
  .cib-info {
    font-size: 9px;
  }

  .challenge-beauty-grid {
    grid-template-columns: 1fr;
  }

  .challenge-beauty-card {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 12px 12px 12px 14px;
    gap: 12px;
  }

  .challenge-beauty-card img {
    width: 48px;
    height: 48px;
    margin-left: 2px;
  }

  .challenge-poll-option {
    display: flex;
    gap: 6px;
    padding: 0;
  }

  .challenge-poll-avatar {
    width: 36px;
    height: 36px;
  }

  .challenge-poll-track {
    height: 38px;
    border-radius: 19px;
  }

  .challenge-poll-name,
  .challenge-poll-percent {
    font-size: 11px;
  }

  .challenge-poll-list {
    padding: 12px 8px;
    gap: 10px;
  }

  .beauty-challenge-board {
    gap: 10px !important;
    margin: 0 8px 14px !important;
    width: calc(100% - 16px) !important;
  }

  .challenge-beauty-user-badge {
    left: 6px;
    right: 6px;
    bottom: 6px;
    max-width: calc(100% - 12px);
    padding: 4px 7px;
  }

  .challenge-beauty-user-link {
    font-size: 9.5px;
  }

  .challenge-miss-slide {
    padding: 0 8px 2px;
  }

  .challenge-miss-nav {
    padding: 0 8px 12px;
  }

  .challenge-carousel-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
  }

  .challenge-poll-flag {
    width: 18px;
    height: 18px;
    font-size: 9px;
    top: -8px;
    transform: translateX(-50%);
    left: clamp(9px, var(--percent, 0%), calc(100% - 9px));
  }
}

@media screen and (max-width: 480px) {
  .challenge-org-board,
  .challenge-infographic-board {
    padding: 10px 8px;
  }

  .challenge-poll-list {
    padding: 10px 4px;
  }

  .beauty-challenge-board {
    margin: 0 4px 12px !important;
    width: calc(100% - 8px) !important;
  }

  .challenge-beauty-user-badge {
    left: 5px;
    right: 5px;
    bottom: 5px;
    max-width: calc(100% - 10px);
  }

  .challenge-poll-avatar {
    width: 38px;
    height: 38px;
  }

  .challenge-miss-photo-wrap {
    aspect-ratio: 1 / 1.08;
  }

  .challenge-miss-card .challenge-beauty-meta {
    flex-direction: column;
    gap: 4px;
  }
}

.challenge-action-btn.challenge-join-btn {
  border: none !important;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  color: #ffffff !important;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.challenge-action-btn.challenge-join-btn:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4) !important;
  transform: translateY(-1px);
  border-color: transparent !important;
}

.challenge-action-btn.challenge-accept-btn {
  border: 1px solid rgba(34, 197, 94, 0.25) !important;
  background: var(--bg-card) !important;
  color: #15803d !important;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.challenge-action-btn.challenge-accept-btn:hover {
  background: rgba(34, 197, 94, 0.08) !important;
  border-color: #22c55e !important;
  color: #15803d !important;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.15) !important;
}

.hashtag-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.hashtag-badge.free {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.hashtag-badge.paid {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

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

.animate-spin {
  animation: spin 0.9s linear infinite;
}

@media screen and (max-width: 768px) {
  .hashtag-popover {
    position: absolute;
    width: 95%;
    max-width: 320px;
    z-index: 3100;
    /* Force it to overlay everything on mobile */
    border-radius: 16px;
    animation: popoverFadeInMobile 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes popoverFadeInMobile {
    from {
      opacity: 0;
      transform: translateY(-10px) scale(0.95);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .hashtag-popover-arrow {
    display: block !important;
  }
}

/* Custom upload zones & mention item styles */
.media-upload-zone:hover,
.file-upload-zone:hover {
  background: var(--bg-card) !important;
  border-color: #3b82f6 !important;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.mention-item:hover {
  background: var(--bg-hover);
}

.mention-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.mention-item-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.mention-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.mention-item-username {
  font-size: 11px;
  color: var(--text-secondary);
}


/* Generic Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  position: relative;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.modal-close:hover {
  color: var(--text-primary);
}

.compose-message-modal {
  display: none;
  z-index: 3200;
}

.compose-message-modal.active {
  display: flex;
}

.compose-message-modal-content {
  width: min(92vw, 560px);
  max-width: 560px;
  padding: 22px;
}

.compose-message-header {
  padding-right: 34px;
  margin-bottom: 14px;
}

.compose-message-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.compose-message-search {
  margin-bottom: 14px;
}

.compose-message-search input {
  border: none;
  background: none;
  width: 100%;
  font-size: 13px;
  outline: none;
  color: var(--text-primary);
  caret-color: var(--primary);
}

.compose-message-search input::placeholder {
  color: var(--text-muted);
}

.compose-message-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: min(66vh, 540px);
  overflow: auto;
  padding-right: 2px;
}

.compose-message-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compose-message-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 2px;
}

.compose-message-section-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gift-modal-content {
  width: min(92vw, 420px);
  max-width: 420px;
  padding: 18px;
  border-radius: 20px;
}

.gift-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding-right: 28px;
}

.gift-modal-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(59, 130, 246, 0.18));
  color: var(--primary);
  flex-shrink: 0;
}

.gift-modal-badge i {
  width: 17px;
  height: 17px;
}

.gift-modal-header-copy h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.gift-modal-header-copy p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.gift-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gift-modal-close i {
  width: 16px;
  height: 16px;
}

.gift-modal-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.gift-preset-card {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-hover);
  color: var(--text-primary);
  padding: 7px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.gift-preset-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.4);
}

.gift-preset-card.active {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.55);
}

.gift-preset-emoji {
  font-size: 16px;
  line-height: 1;
}

.gift-preset-name {
  font-size: 10px;
  font-weight: 700;
}

.gift-preset-price {
  font-size: 9px;
  color: var(--text-secondary);
}

.gift-custom-amount {
  margin-bottom: 10px;
}

.gift-custom-amount label {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.gift-custom-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-hover);
  padding: 0 12px;
}

.gift-custom-currency {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.gift-custom-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 0;
  outline: none;
}

.gift-modal-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
}

.gift-summary-label {
  display: block;
  margin-bottom: 2px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.gift-modal-summary strong {
  font-size: 12px;
  color: var(--text-primary);
}

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

.gift-modal-cancel,
.gift-modal-confirm {
  flex: 1;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.gift-modal-cancel {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
}

.gift-modal-confirm {
  border: none;
  background: linear-gradient(135deg, #111827 0%, #374151 100%);
  color: #fff;
}

@media (max-width: 640px) {
  .gift-modal-content {
    padding: 16px;
    border-radius: 18px;
  }

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

  .gift-modal-summary,
  .gift-modal-actions {
    flex-direction: column;
  }
}

.compose-contact-item {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: none;
}

.compose-contact-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-color-hover);
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}

.compose-contact-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.compose-contact-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.compose-contact-copy {
  min-width: 0;
  flex: 1;
}

.compose-contact-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 2px;
}

.compose-contact-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compose-contact-chip {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(24, 119, 242, 0.08);
  border-radius: 999px;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compose-contact-username,
.compose-contact-preview,
.compose-contact-presence,
.compose-contact-time {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compose-contact-preview {
  margin-top: 2px;
  color: var(--text-muted);
}

.compose-contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
  min-width: 0;
}

.compose-contact-presence {
  max-width: 120px;
  text-align: right;
}

.compose-contact-time {
  font-size: 10px;
  color: var(--text-muted);
}

.compose-message-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  background: var(--bg-input);
}

body[data-theme="dark"] .compose-contact-chip {
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.15);
}

/* Text Style Modal Styles */
.bg-select-option {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.bg-select-option:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.bg-select-option.active {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.bg-select-option-price-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(245, 158, 11, 0.9);
  color: white;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.bg-select-option-free-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(16, 185, 129, 0.9);
  color: white;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.text-format-btn {
  transition: all 0.2s ease;
}

.text-format-btn:hover {
  color: var(--primary) !important;
  background: var(--bg-hover) !important;
}

.text-format-btn.active {
  background: var(--bg-hover) !important;
  color: var(--primary) !important;
}

.post-input-editable {
  transition: all 0.25s ease;
}

.post-bg-container {
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  border-radius: 8px;
  margin: 0 20px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

@media screen and (max-width: 768px) {
  .post-bg-container {
    margin: 0 12px !important;
    padding: 24px 16px !important;
    min-height: 160px !important;
    font-size: clamp(14px, calc(var(--bg-text-size, 20px) * 0.75), 24px) !important;
  }

  .btn-text-label {
    display: none !important;
  }
}

/* ==========================================================================
   Bookmarks Styles
   ========================================================================== */

.bookmarks-empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--border-radius-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-top: 12px;
  transition: all 0.3s ease-in-out;
}

.bookmarks-empty-state .empty-icon-container {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--primary);
  animation: pulse-bookmarks 2s infinite;
}

@keyframes pulse-bookmarks {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(24, 119, 242, 0.2);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(24, 119, 242, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(24, 119, 242, 0);
  }
}

.bookmarks-empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.bookmarks-empty-state p {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0;
  line-height: 1.5;
}

/* Post Card unbookmark fade-out collapse transition */
.post-card.fade-out {
  opacity: 0 !important;
  transform: scale(0.95) translateY(-10px) !important;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-top-width: 0 !important;
  border-bottom-width: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  pointer-events: none !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Animation de pulsation pour l'enregistrement vocal */
@keyframes pulse-recording {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Popover du sélecteur d'émojis */
.emoji-picker-popover {
  position: absolute;
  bottom: 44px;
  right: 8px;
  width: 300px;
  height: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  animation: emoji-pop-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.emoji-picker-popover.picker-down {
  bottom: auto;
  top: 46px;
}

.header-search-emoji-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform var(--transition-fast, 0.2s);
}

.header-search-emoji-btn:hover {
  transform: scale(1.15);
}

@keyframes emoji-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.emoji-picker-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.emoji-search-input {
  flex: 1;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.emoji-search-input:focus {
  border-color: var(--primary);
}

.emoji-search-input::placeholder {
  color: var(--text-muted);
}

.emoji-picker-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.emoji-picker-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1;
}

.emoji-picker-close:hover {
  color: var(--text-primary);
}

/* Category tab bar */
.emoji-tab-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.emoji-tab-bar::-webkit-scrollbar {
  display: none;
}

.emoji-tab-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
  line-height: 1;
}

.emoji-tab-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.1);
}

.emoji-tab-btn.active {
  background: var(--primary);
  transform: scale(1.05);
}

.emoji-picker-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 6px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.emoji-picker-grid::-webkit-scrollbar {
  width: 4px;
}

.emoji-picker-grid::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.emoji-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
}

.emoji-picker-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 3px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  aspect-ratio: 1;
}

.emoji-picker-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.2);
}

.emoji-picker-btn:active {
  transform: scale(0.95);
}

/* Lecteur audio sur mesure */
.voice-note-player {
  transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
  padding: 4px 8px !important;
  gap: 6px !important;
  max-width: 200px !important;
}

.voice-note-player:hover {
  border-color: var(--primary-light) !important;
  background: rgba(139, 92, 246, 0.06) !important;
}

/* Playing state: glowing border + animated shadow */
.voice-note-player.playing {
  border-color: var(--primary) !important;
  background: rgba(139, 92, 246, 0.1) !important;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.18), 0 2px 8px rgba(139, 92, 246, 0.15);
  animation: voice-player-glow 2s ease-in-out infinite;
}

@keyframes voice-player-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.18), 0 2px 8px rgba(139, 92, 246, 0.12); }
  50%       { box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.30), 0 2px 12px rgba(139, 92, 246, 0.25); }
}

.voice-play-btn {
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s !important;
}

.voice-play-btn:hover {
  transform: scale(1.1);
}

.voice-play-btn:active {
  transform: scale(0.92);
}

.reel-voice-note-player {
  display: flex;
  align-items: center;
  width: min(100%, 240px);
  max-width: 240px !important;
  margin-top: 6px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.05);
  user-select: none;
}

.reel-voice-note-player .voice-play-btn {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.reel-voice-note-player .voice-play-btn i,
.reel-voice-note-player .voice-play-btn svg {
  width: 10px;
  height: 10px;
  fill: #ffffff;
}

.reel-voice-note-player .voice-timeline-wrap {
  flex: 1;
  min-width: 54px;
  display: flex;
  align-items: center;
}

.reel-voice-note-player .voice-timeline {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--border-color);
  overflow: hidden;
}

.reel-voice-note-player .voice-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: var(--primary);
}

.reel-voice-note-player .voice-duration {
  min-width: 48px;
  color: var(--text-muted);
  font-family: monospace;
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.reel-voice-note-player .voice-audio-element {
  display: none;
}

/* Pulsing play button while playing */
.voice-note-player.playing .voice-play-btn {
  animation: voice-btn-pulse 1.4s ease-in-out infinite;
}

@keyframes voice-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.35); }
  50%       { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0); }
}

/* Animated waveform bars shown when playing */
.voice-note-player .voice-waveform {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  flex-shrink: 0;
}

.voice-note-player.playing .voice-waveform {
  display: flex;
}

.voice-note-player.playing .voice-timeline-wrap {
  display: none !important;
}

.voice-waveform span {
  display: block;
  width: 2px;
  border-radius: 1px;
  background: var(--primary);
  animation: waveform-bar 1.1s ease-in-out infinite;
}

.voice-waveform span:nth-child(1) { height: 5px;  animation-delay: 0s; }
.voice-waveform span:nth-child(2) { height: 10px; animation-delay: 0.15s; }
.voice-waveform span:nth-child(3) { height: 14px; animation-delay: 0.3s; }
.voice-waveform span:nth-child(4) { height: 8px;  animation-delay: 0.45s; }
.voice-waveform span:nth-child(5) { height: 12px; animation-delay: 0.1s; }
.voice-waveform span:nth-child(6) { height: 6px;  animation-delay: 0.35s; }
.voice-waveform span:nth-child(7) { height: 11px; animation-delay: 0.2s; }

@keyframes waveform-bar {
  0%, 100% { transform: scaleY(0.4); opacity: 0.7; }
  50%       { transform: scaleY(1);   opacity: 1; }
}

.voice-duration {
  font-size: 9px !important;
  min-width: 52px !important;
  white-space: nowrap;
}

.voice-timeline {
  height: 3px !important;
  cursor: pointer;
  position: relative;
  border-radius: 1.5px;
  flex: 1;
  min-width: 60px !important;
}

.voice-timeline:hover .voice-progress {
  background: var(--primary-hover) !important;
}

/* Keep private-chat voice notes visually stable while playing */
.chat-voice-note-player.playing {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: var(--border-color) !important;
  box-shadow: none !important;
  animation: none !important;
}

.chat-voice-note-player.playing .voice-timeline-wrap {
  display: flex !important;
}

.chat-voice-note-player.playing .voice-waveform {
  display: none !important;
}

.chat-voice-note-player .voice-play-btn {
  position: relative;
}

.chat-voice-note-player.playing .voice-play-btn {
  animation: chat-voice-btn-pulse 1.15s ease-in-out infinite;
  transform: none !important;
}

@keyframes chat-voice-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(24, 119, 242, 0.26); }
  50% { box-shadow: 0 0 0 5px rgba(24, 119, 242, 0); }
}

.chat-voice-note-player.playing .voice-progress {
  transition: width 0.08s linear;
}

.chat-voice-note-player .voice-duration {
  transition: color 0.2s ease;
}

.chat-voice-note-player.playing .voice-duration {
  color: var(--primary) !important;
}

/* Post Media Visual Preview */
.post-media-preview-container {
  position: relative;
  margin-top: 12px;
  border-radius: var(--border-radius-item);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  max-height: 320px;
  display: none;
  justify-content: center;
  align-items: center;
}

.post-media-preview-container img,
.post-media-preview-container video {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.cancel-media-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-smooth);
}

.cancel-media-btn:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

.video-download-setting {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}

.video-download-setting.is-visible {
  display: flex;
}

.video-download-setting input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.video-download-toggle-ui {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-color);
  padding: 3px;
  flex: 0 0 auto;
  transition: background var(--transition-fast);
}

.video-download-toggle-ui span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  transition: transform var(--transition-fast);
}

.video-download-setting input:checked + .video-download-toggle-ui {
  background: var(--primary);
}

.video-download-setting input:checked + .video-download-toggle-ui span {
  transform: translateX(16px);
}

/* Post Video elements */
.post-single-video {
  padding: 0 20px 16px 20px;
}

.post-video-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-item);
  background-color: #0b0f19;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.post-video {
  width: 100%;
  max-height: 480px;
  background-color: #0b0f19;
  display: block;
  outline: none;
}

.post-video-end-overlay,
.reel-end-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.38) 62%, rgba(0, 0, 0, 0.68) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  overflow: hidden;
}

.post-video-end-overlay.is-visible,
.reel-end-overlay.is-visible {
  opacity: 1;
}

.post-video-end-card,
.reel-end-card {
  min-width: 104px;
  max-width: min(70vw, 160px);
  padding: 14px 14px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateY(10px) scale(0.9);
  opacity: 0;
  position: relative;
  z-index: 2;
}

.post-video-end-card {
  min-width: 92px;
  max-width: min(44vw, 128px);
  padding: 11px 11px 10px;
  gap: 6px;
}

.post-video-end-overlay.is-visible .post-video-end-card,
.reel-end-overlay.is-visible .reel-end-card {
  animation: mediaEndCardRise 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.post-video-end-logo,
.reel-end-logo {
  width: clamp(78px, 18vw, 116px);
  height: clamp(78px, 18vw, 116px);
  border-radius: 28%;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  transform: scale(0.72) rotate(-10deg);
  opacity: 0;
  filter: drop-shadow(0 0 20px rgba(37, 99, 235, 0.32));
  position: relative;
  z-index: 2;
}

.post-video-end-logo {
  width: clamp(44px, 8vw, 64px);
  height: clamp(44px, 8vw, 64px);
}

.reel-end-logo {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
}

.post-video-end-username,
.reel-end-username {
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-video-end-overlay::before,
.reel-end-overlay::before {
  content: '';
  position: absolute;
  width: clamp(118px, 28vw, 180px);
  height: clamp(118px, 28vw, 180px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.08);
  opacity: 0;
  transform: scale(0.6);
}

.post-video-end-overlay::before {
  width: clamp(92px, 18vw, 126px);
  height: clamp(92px, 18vw, 126px);
  box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.08);
}

.reel-end-overlay::before {
  width: 58px;
  height: 58px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.post-video-end-overlay.is-visible::before,
.reel-end-overlay.is-visible::before {
  animation: postVideoEndRingPulse 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.post-video-end-overlay.is-visible .post-video-end-logo,
.reel-end-overlay.is-visible .reel-end-logo {
  animation: postVideoEndLogoPulse 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes mediaEndCardRise {
  0% {
    transform: translateY(10px) scale(0.9);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes postVideoEndLogoPulse {
  0% {
    transform: scale(0.72) rotate(-10deg);
    opacity: 0;
  }
  32% {
    transform: scale(1.08) rotate(2deg);
    opacity: 1;
  }
  58% {
    transform: scale(0.96) rotate(-1deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes postVideoEndRingPulse {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  28% {
    opacity: 0.95;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

.custom-video-controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f172a;
}

.video-controls-left,
.video-controls-center,
.video-controls-right {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.video-controls-left {
  flex: 0 0 auto;
}

.video-controls-center {
  flex: 1 1 auto;
}

.video-controls-right {
  margin-left: auto;
  flex: 0 0 auto;
}

.video-control-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.video-control-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: rgba(255, 255, 255, 0.32);
  transform: none;
}

.video-control-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.video-control-btn i {
  width: 11px;
  height: 11px;
}

.video-time {
  min-width: 34px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.video-progress-slider,
.video-volume-slider {
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  outline: none;
  cursor: pointer;
}

.video-progress-slider {
  flex: 1 1 auto;
  min-width: 90px;
}

.video-volume-slider {
  width: 62px;
  flex: 0 0 auto;
}

.video-progress-slider::-webkit-slider-thumb,
.video-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.video-progress-slider::-moz-range-thumb,
.video-volume-slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.video-download-status {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: none;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.video-download-status.is-visible {
  display: block;
}

.follow-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.follow-toggle-btn--text {
  width: auto;
  min-width: 84px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.profile-view-all-btn {
  height: 30px !important;
  min-height: 30px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: none !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.profile-view-all-btn:hover {
  box-shadow: none !important;
}

.social-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}

.social-user-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  flex: 1;
}

.social-user-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
}

.social-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-user-handle {
  font-size: 11px;
  color: var(--text-muted);
}

.social-user-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.social-user-pill[data-tone="success"] {
  color: var(--success);
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.18);
}

.social-user-pill[data-tone="primary"] {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.18);
}

.social-user-pill[data-tone="muted"] {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
}

.social-user-action {
  min-width: 88px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  box-shadow: none !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.follow-toggle-btn:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.35);
}

.follow-toggle-btn[data-following="1"] {
  color: #16a34a;
}

.follow-toggle-btn[data-following="1"]:hover {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.35);
}

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

@media screen and (max-width: 768px) {
  .custom-video-controls {
    gap: 5px;
    padding: 6px 7px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: hidden;
  }

  .video-control-btn {
    width: 23px;
    height: 23px;
  }

  .video-control-btn[data-video-control="play"] {
    order: 1;
    margin-right: 2px;
  }

  .video-current-time {
    order: 2;
    margin-left: 4px;
  }

  .video-progress-slider {
    order: 3;
    flex: 1 1 auto;
    min-width: 56px;
  }

  .video-duration {
    order: 4;
  }

  .video-controls-right {
    margin-left: auto;
    gap: 5px;
  }

  .video-controls-right .video-control-btn,
  .video-controls-right .video-volume-slider {
    order: 5;
  }

  .video-volume-slider {
    display: none;
  }

  .video-time {
    min-width: 30px;
    font-size: 10.5px;
  }

  .profile-social-grid {
    grid-template-columns: 1fr !important;
  }
}

@media screen and (max-width: 480px) {
  .custom-video-controls {
    gap: 4px;
    padding: 5px 6px;
  }

  .video-controls-center {
    gap: 4px;
  }

  .video-progress-slider {
    min-width: 44px;
  }
}

/* Multi-range input slider thumb overrides for professional video clip trimmer */
#trimStartSlider::-webkit-slider-thumb,
#trimEndSlider::-webkit-slider-thumb,
#shortVideoOffsetSlider::-webkit-slider-thumb,
#shortAudioOffsetSlider::-webkit-slider-thumb {
  pointer-events: auto !important;
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
}
#trimStartSlider::-webkit-slider-thumb:hover,
#trimEndSlider::-webkit-slider-thumb:hover,
#shortVideoOffsetSlider::-webkit-slider-thumb:hover,
#shortAudioOffsetSlider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

#trimStartSlider::-moz-range-thumb,
#trimEndSlider::-moz-range-thumb,
#shortVideoOffsetSlider::-moz-range-thumb,
#shortAudioOffsetSlider::-moz-range-thumb {
  pointer-events: auto !important;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
}
#trimStartSlider::-moz-range-thumb:hover,
#trimEndSlider::-moz-range-thumb:hover,
#shortVideoOffsetSlider::-moz-range-thumb:hover,
#shortAudioOffsetSlider::-moz-range-thumb:hover {
  transform: scale(1.15);
}

/* Sponsored Ad Premium Animations & Interactions */
.ad-item-link {
  transition: transform 0.25s ease, opacity 0.8s ease-in-out !important;
}
.ad-item-link:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}
.ad-banner-wrapper img {
  transition: transform 0.35s ease !important;
}
.ad-item-link:hover .ad-banner-wrapper img {
  transform: scale(1.05);
}

.desktop-short-create-btn {
  display: none;
}

@media screen and (min-width: 769px) {
  .shorts-header-container {
    display: none !important;
  }

  body.viewing-shorts {
    overflow: hidden !important;
  }

  body.viewing-shorts .main-layout {
    height: calc(100vh - 70px);
    overflow: hidden;
    padding: 0 24px 0 24px;
  }

  body.viewing-shorts .desktop-short-create-btn {
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(24, 119, 242, 0.18);
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.20);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  }

  body.viewing-shorts .desktop-short-create-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(59, 130, 246, 0.34);
  }

  body.viewing-shorts .desktop-short-create-btn i,
  body.viewing-shorts .desktop-short-create-btn svg {
    width: 16px;
    height: 16px;
    color: #ffffff;
    stroke-width: 2.6;
  }

  body.viewing-shorts .sidebar {
    top: 20px !important;
    margin-top: -50px !important;
    max-height: calc(100vh - 90px) !important;
  }

  body.viewing-shorts .right-sidebar {
    padding-bottom: 40px !important;
  }

  body.viewing-shorts #feedMainContent {
    flex: 1 !important;
    height: 100%;
    overflow: hidden;
    align-self: stretch !important;
  }

  body.viewing-shorts .feed-column {
    height: calc(100vh - 70px) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
  }

  body.viewing-shorts #shortsSection {
    display: flex !important;
    flex: 1 !important;
    height: 100%;
    width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
  }

  body.viewing-shorts .reels-feed {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    overflow-y: scroll !important;
    scroll-behavior: smooth;
    scroll-snap-type: none;
    display: flex;
    flex-direction: column;
    gap: 20px !important;
    padding: 20px 0 !important; /* Symmetric padding */
    scrollbar-width: none; /* Hide scrollbars Firefox */
    cursor: grab;
    user-select: none;
    touch-action: pan-x;
  }

  body.viewing-shorts .reels-feed.grabbing {
    cursor: grabbing !important;
  }

  body.viewing-shorts .reel-video {
    cursor: pointer !important;
  }

  body.viewing-shorts .reels-feed.grabbing .reel-video {
    cursor: grabbing !important;
  }

  body.viewing-shorts .reels-feed::-webkit-scrollbar {
    display: none; /* Hide scrollbars Chrome/Safari */
  }

  body.viewing-shorts .reel-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: calc(100vh - 110px) !important;
    aspect-ratio: auto !important;
    max-width: 440px !important;
    width: 100%;
    margin: 0 auto !important;
    border-radius: var(--border-radius-card) !important;
    border: 1px solid var(--border-color) !important;
    flex-shrink: 0 !important;
    background: #000;
  }

  body.viewing-shorts .reel-card img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    filter: brightness(0.85);
  }
}

@media screen and (min-width: 769px) and (max-width: 1080px) {
  body.viewing-shorts .desktop-short-create-btn {
    width: 42px;
    padding: 0;
    border-radius: 50%;
  }

  body.viewing-shorts .desktop-short-create-btn span {
    display: none;
  }
}

.reel-video[data-media-fit="contain"] {
  object-fit: contain !important;
  background: #000;
}

/* --- Reels/Shorts Premium Styling & Animations --- */
.reel-video {
  outline: none;
  background-color: #000;
  filter: none !important;
}

.reel-trade-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #ffffff;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.reel-trade-btn > div {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
}

.reel-trade-btn i,
.reel-trade-btn svg {
  width: 19px;
  height: 19px;
  color: #ffffff;
}

.reel-trade-btn span {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}

.reel-trade-btn strong {
  min-width: 46px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: #ffffff;
  font-size: 10.5px;
  line-height: 1;
}

.reel-trade-btn.disabled,
.reel-trade-btn:disabled {
  opacity: 0.82;
  cursor: not-allowed;
}

/* Comments Drawer Container (Desktop Default) */
.reel-comments-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65%;
  z-index: 20;
  transform: translateY(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border-color);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  
  /* Adaptive theme background & blur */
  background: var(--bg-comments-drawer);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  color: var(--text-primary);
}

.reel-comments-drawer.open {
  transform: translateY(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Comments Drawer Header */
.reel-comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

.reel-comments-title {
  font-size: 13.5px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

/* Close Drawer Button */
.close-comments-drawer-btn {
  background: var(--close-btn-bg);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary) !important;
  transition: background 0.2s, transform 0.1s;
}

.close-comments-drawer-btn:hover {
  background: var(--close-btn-hover);
}

.close-comments-drawer-btn:active {
  transform: scale(0.95);
}

.close-comments-drawer-btn i {
  width: 14px;
  height: 14px;
  color: var(--text-primary) !important;
  transition: transform 0.2s ease;
}

.close-comments-drawer-btn:hover i {
  transform: rotate(90deg);
}

/* Comments Scroll List */
.reel-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reel-comments-list::-webkit-scrollbar {
  width: 5px;
}

.reel-comments-list::-webkit-scrollbar-track {
  background: transparent;
}

.reel-comments-list::-webkit-scrollbar-thumb {
  background: var(--border-color-hover, rgba(0, 0, 0, 0.1));
  border-radius: 10px;
}

.reel-comments-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, rgba(0, 0, 0, 0.25));
}

/* Comment Form */
.reel-comment-form {
  padding: 12px 16px 20px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
}

.reel-reply-context {
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.08);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.reel-reply-context-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-cancel-reply-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.reel-cancel-reply-btn:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.reel-cancel-reply-btn i,
.reel-cancel-reply-btn svg {
  width: 14px;
  height: 14px;
}

.reel-comment-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.reel-comment-input {
  width: 100%;
  background: var(--input-bg-comments);
  border: 1px solid var(--input-border-comments);
  border-radius: 20px;
  padding: 8px 78px 8px 16px;
  color: var(--input-text-comments);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.reel-comment-input:focus {
  border-color: var(--primary) !important;
}

.reel-comment-tools {
  position: absolute;
  right: 9px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.reel-comment-tool-btn,
.reel-cancel-recording-btn,
.reel-stop-recording-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

.reel-comment-tool-btn:hover,
.reel-cancel-recording-btn:hover,
.reel-stop-recording-btn:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.reel-comment-tool-btn:active,
.reel-cancel-recording-btn:active,
.reel-stop-recording-btn:active {
  transform: scale(0.94);
}

.reel-comment-tool-btn i,
.reel-comment-tool-btn svg,
.reel-cancel-recording-btn i,
.reel-cancel-recording-btn svg,
.reel-stop-recording-btn i,
.reel-stop-recording-btn svg {
  width: 15px;
  height: 15px;
}

.reel-voice-recording-overlay {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid var(--primary);
  background: var(--bg-card);
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 0 12px;
  z-index: 3;
}

.reel-recording-status,
.reel-recording-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reel-voice-recording-overlay .recording-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse-recording 1s infinite;
}

.reel-voice-recording-overlay .recording-timer {
  font-size: 12px;
  color: var(--text-primary);
  font-family: monospace;
}

.reel-stop-recording-btn {
  color: var(--primary);
}

.reel-comment-submit-btn {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  opacity: 0.5;
  pointer-events: none;
  margin: 0 6px; /* Added space around the button */
  transition: opacity 0.2s, background 0.2s, transform 0.1s;
}

.reel-comment-submit-btn i,
.reel-comment-submit-btn svg {
  width: 14px;
  height: 14px;
  color: white !important;
  stroke: white !important;
}

/* Comment Items styling */
.reel-comment-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: slideInComment 0.3s ease-out forwards;
}

@keyframes slideInComment {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reel-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

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

.reel-comment-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.reel-comment-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.reel-comment-username {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.reel-comment-time {
  font-size: 10px;
  color: var(--text-secondary);
  opacity: 0.85;
}

.reel-comment-text {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.reel-comment-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reel-comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.reel-reply-btn,
.reel-read-more-replies-btn,
.reel-read-more-comments-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.reel-reply-btn:hover,
.reel-read-more-replies-btn:hover,
.reel-read-more-comments-btn:hover {
  color: var(--primary);
}

.reel-replies-list {
  margin-top: 8px;
  margin-left: 20px;
  padding-left: 12px;
  border-left: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reel-comment-item.is-reply {
  gap: 9px;
}

.reel-comment-item.is-reply .reel-comment-avatar {
  width: 26px;
  height: 26px;
}

.reel-read-more-comments-btn {
  align-self: center;
  margin: 2px auto 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-hover);
}

/* Floating heart for double-click action */
@keyframes floatUpHeart {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    transform: translate(-50%, -50%) scale(1.3) rotate(-15deg);
    opacity: 0.95;
  }
  30% {
    transform: translate(-50%, -50%) scale(1) rotate(10deg);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, calc(-50% - 100px)) scale(0.6) rotate(-25deg);
    opacity: 0;
  }
}

.floating-heart-icon {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  color: #ff3b30;
  fill: #ff3b30;
  filter: drop-shadow(0 4px 12px rgba(255, 59, 48, 0.6));
  animation: floatUpHeart 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Play/Pause indicator flash */
@keyframes playPauseIndicatorFlash {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  40% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

.play-pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  color: #fff;
}

.play-pause-indicator.animate-flash {
  animation: playPauseIndicatorFlash 0.5s ease-out forwards;
}

/* Mobile media query overrides for comments bottom sheet */
@media screen and (max-width: 768px) {
  .reel-comments-drawer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 55vh !important;
    z-index: 1000 !important; /* Above mobile bottom nav */
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -15px 35px rgba(0, 0, 0, 0.3) !important;
  }

  /* Lower/hide the mobile nav when comments drawer is open so the drawer covers it completely */
  body.comments-drawer-open .mobile-nav {
    z-index: 10 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  /* Mobile overrides for Share Sheet Modal to make it a bottom sheet */
  #shareSheetModal {
    align-items: flex-end !important;
  }

  #shareSheetModal .modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 24px 24px 0 0 !important;
    margin: 0 !important;
    max-height: 80vh !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25) !important;
    animation: slideUpShareSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  #shareSheetModal .share-sheet-body {
    max-height: 60vh !important;
  }
}

@keyframes slideUpShareSheet {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* CD Spinning & Voice Wave Animations for multi-format Shorts */
@keyframes spin-cd {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse-wave {
  0% { transform: scaleY(0.4); opacity: 0.7; }
  100% { transform: scaleY(1.3); opacity: 1; }
}

.voice-bar.animated {
  transform-origin: center;
}
.voice-bar.animated.animating {
  animation: pulse-wave 0.8s infinite alternate ease-in-out;
}
.voice-bar.animated:nth-child(2).animating { animation-delay: 0.15s; }
.voice-bar.animated:nth-child(3).animating { animation-delay: 0.3s; }
.voice-bar.animated:nth-child(4).animating { animation-delay: 0.1s; }
.voice-bar.animated:nth-child(5).animating { animation-delay: 0.25s; }

/* Shorts Progress Bar Slider Custom Thumb styling */
.reel-progress-slider {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  height: 4px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: height 0.1s ease;
}

.reel-progress-slider:hover {
  height: 6px;
}

/* Webkit browser slider thumbs */
.reel-progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.reel-progress-slider:hover::-webkit-slider-thumb {
  transform: scale(1.2);
}

/* Firefox browser slider thumbs */
.reel-progress-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.reel-progress-slider:hover::-moz-range-thumb {
  transform: scale(1.2);
}

/* Mobile seekbar custom placement at the bottom navigation bar top */
@media screen and (max-width: 768px) {
  body.viewing-shorts .reel-progress-container {
    position: absolute !important;
    bottom: 8px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    gap: 8px !important;
    z-index: 10 !important;
    padding: 0 16px !important;
    background: transparent !important;
    box-sizing: border-box !important;
  }

  body.viewing-shorts .reel-progress-container .reel-current-time,
  body.viewing-shorts .reel-progress-container .reel-duration {
    display: block !important;
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    min-width: unset !important;
  }

  body.viewing-shorts .reel-progress-slider {
    flex: 1 !important;
    width: auto !important;
    margin: 0 !important;
    border-radius: 999px !important;
    height: 4px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border: none !important;
  }

  body.viewing-shorts .reel-progress-slider::-webkit-slider-thumb {
    width: 14px !important;
    height: 14px !important;
    background: var(--primary) !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
    transform: none !important;
  }

  body.viewing-shorts .reel-progress-slider::-moz-range-thumb {
    width: 14px !important;
    height: 14px !important;
    background: var(--primary) !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
    transform: none !important;
  }
}

/* ==========================================================================
   TikTok-like Loader, Music Marquee, and Active Card Entrance Animations
   ========================================================================== */

/* 1. TikTok-like loader styling */
.reel-loader-container {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.2);
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tiktok-loader {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tiktok-loader .loader-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  mix-blend-mode: screen;
}

.tiktok-loader .dot-1 {
  background: var(--primary); /* Platform Primary Color */
  animation: tiktok-orbit-1 1s ease-in-out infinite;
}

.tiktok-loader .dot-2 {
  background: #ec4899; /* Vibrant Pink/Magenta Contrast Accent */
  animation: tiktok-orbit-2 1s ease-in-out infinite;
}

@keyframes tiktok-orbit-1 {
  0% {
    transform: translate(-12px, 0) scale(1);
    z-index: 2;
  }
  50% {
    transform: translate(12px, 0) scale(1.2);
    z-index: 2;
  }
  100% {
    transform: translate(-12px, 0) scale(1);
    z-index: 1;
  }
}

@keyframes tiktok-orbit-2 {
  0% {
    transform: translate(12px, 0) scale(1.2);
    z-index: 1;
  }
  50% {
    transform: translate(-12px, 0) scale(1);
    z-index: 1;
  }
  100% {
    transform: translate(12px, 0) scale(1.2);
    z-index: 2;
  }
}

/* 2. Music title text scroller marquee */
.reel-music-scroller-wrap {
  overflow: hidden !important;
  white-space: nowrap !important;
  width: 100% !important;
  max-width: 180px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 2px !important;
}

.reel-music-scroller-track {
  display: flex !important;
  flex-direction: row !important;
  width: max-content !important;
  flex-shrink: 0 !important;
}

.reel-music-scroller-text {
  display: inline-block !important;
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.85) !important;
  flex-shrink: 0 !important;
  padding-right: 24px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  white-space: nowrap !important;
  animation: marquee-scroll 10s linear infinite !important;
}

@keyframes marquee-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

/* 3. Active Shorts overlay & actions slide-in entrance transition */
.reel-details-overlay {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.74) 0%, rgba(0, 0, 0, 0.22) 45%, transparent 78%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.reel-card.active .reel-details-overlay {
  opacity: 1;
  transform: translateY(0);
}

.reel-actions-container {
  opacity: 0;
  transform: translateX(15px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
  pointer-events: auto !important;
  z-index: 20 !important;
}

.reel-card.active .reel-actions-container {
  opacity: 1;
  transform: translateX(0);
}

body.viewing-shorts .reel-card.active .reel-actions-container,
body.viewing-shorts .reel-card .reel-actions-container {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  z-index: 20 !important;
}

.reel-actions-container .reel-trade-btn {
  position: relative;
  z-index: 21 !important;
  pointer-events: auto !important;
}

.reel-play-overlay {
  background: transparent !important;
}

.reel-play-overlay > div {
  background: rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

.reel-actions-container .reel-action-btn > div,
.reel-actions-container .reel-trade-btn > div {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.reel-actions-container .reel-action-btn > div {
  background: rgba(0, 0, 0, 0.24) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
}

.reel-actions-container .reel-trade-btn > div {
  background: rgba(124, 58, 237, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.34) !important;
}

/* Ensure vinyl still spins smoothly */
.reel-turntable {
  position: relative;
  width: 238px;
  height: 238px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.42));
}

.reel-turntable-plinth {
  position: absolute;
  inset: 10px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(61, 38, 111, 0.98), rgba(18, 12, 39, 0.96)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 40%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -12px 24px rgba(0, 0, 0, 0.28);
}

.reel-turntable-platter-ring {
  position: absolute;
  width: 174px;
  height: 174px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.08) 0 36%, rgba(0, 0, 0, 0.12) 36% 42%, transparent 42%),
    linear-gradient(145deg, rgba(92, 92, 108, 0.7), rgba(24, 24, 34, 0.92));
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.12),
    inset 0 -6px 14px rgba(0, 0, 0, 0.42);
}

.spinning-vinyl {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.2), transparent 18%),
    radial-gradient(circle at center, #151515 0 18%, #090909 18% 100%);
  border: 8px solid #292524;
  display: grid;
  place-items: center;
  box-shadow:
    0 12px 40px rgba(0,0,0,0.6),
    inset 0 0 0 2px rgba(255,255,255,0.03);
  animation: spin-cd 4s linear infinite;
  animation-play-state: paused;
}

.vinyl-groove,
.vinyl-highlight,
.vinyl-label,
.vinyl-label-core {
  position: absolute;
  border-radius: 50%;
}

.vinyl-groove {
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.vinyl-groove--outer {
  inset: 18px;
}

.vinyl-groove--mid {
  inset: 32px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.05);
}

.vinyl-groove--inner {
  inset: 48px;
  border-color: rgba(255, 255, 255, 0.04);
}

.vinyl-highlight {
  inset: 10px 72px 92px 28px;
  background: linear-gradient(140deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
  transform: rotate(-18deg);
  filter: blur(2px);
}

.vinyl-label {
  width: 42px;
  height: 42px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.24), transparent 35%),
    linear-gradient(145deg, var(--primary), #ec4899);
  border: 2px solid rgba(255,255,255,0.9);
  display: grid;
  place-items: center;
}

.vinyl-label-core {
  width: 9px;
  height: 9px;
  background: #f8fafc;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.28);
}

.reel-tonearm {
  position: absolute;
  top: 28px;
  right: 34px;
  width: 96px;
  height: 96px;
  transform-origin: 16px 16px;
  transform: rotate(18deg);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.reel-video.is-playing .reel-tonearm {
  transform: rotate(33deg);
}

.reel-tonearm-base {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, #d4d4d8, #52525b);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.35);
}

.reel-tonearm-bar {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 66px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(145deg, #f4f4f5, #71717a);
  transform: rotate(16deg);
  transform-origin: left center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.28);
}

.reel-tonearm-head {
  position: absolute;
  top: 24px;
  right: 6px;
  width: 20px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(145deg, #fafafa, #71717a);
  transform: rotate(18deg);
}

.reel-tonearm-needle {
  position: absolute;
  top: 34px;
  right: 10px;
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, #e5e7eb, #111827);
  transform: rotate(18deg);
  transform-origin: top center;
}

/* ==========================================================================
   TikTok-like Share Bottom Sheet & Download Watermark Progress CSS
   ========================================================================== */

/* Reels Share Overlay background */
.reels-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.reels-share-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Bottom Sheet Container */
.reels-share-sheet {
  width: 100%;
  max-width: 500px;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(20px) saturate(160%);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 20px 32px 20px;
  box-sizing: border-box;
  box-shadow: 0 -15px 30px rgba(0, 0, 0, 0.4);
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.reels-share-overlay.open .reels-share-sheet {
  transform: translateY(0);
}

/* Drag handle on top of bottom sheet */
.reels-share-drag-handle {
  width: 40px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  margin: 0 auto 16px auto;
}

/* Header style */
.reels-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.reels-share-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.reels-share-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Short preview header */
.reels-share-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  margin-bottom: 20px;
}

/* Bottom Sheet Sections */
.reels-share-section {
  margin-bottom: 20px;
}

.reels-share-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

/* Horizontal scrolling friends list */
.reels-share-friends-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none; /* Firefox */
}

.reels-share-friends-row::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.reels-share-friend-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  width: 64px;
}

.reels-share-friend-btn .friend-avatar-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  transition: transform 0.2s;
}

.reels-share-friend-btn:hover .friend-avatar-wrap {
  transform: scale(1.08);
}

.reels-share-friend-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reels-share-friend-btn .friend-name {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Social sharing icons row */
.reels-share-social-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.reels-share-social-row::-webkit-scrollbar {
  display: none;
}

.reels-social-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  width: 64px;
}

.reels-social-btn .icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.reels-social-btn:hover .icon-circle {
  transform: scale(1.08);
}

.reels-social-btn.whatsapp .icon-circle { background: #25D366; }
.reels-social-btn.facebook .icon-circle { background: #1877F2; }
.reels-social-btn.x-platform .icon-circle { background: #1c1917; border: 1px solid rgba(255, 255, 255, 0.1); }
.reels-social-btn.telegram .icon-circle { background: #0088cc; }
.reels-social-btn.linkedin .icon-circle { background: #0077B5; }
.reels-social-btn.copy-link .icon-circle { background: rgba(255, 255, 255, 0.1); }

.reels-social-btn span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
}

/* Action Items (Download) Row */
.reels-share-actions-row {
  display: flex;
  gap: 20px;
}

.reels-action-item-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: white;
  cursor: pointer;
}

.reels-action-item-btn .action-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.reels-action-item-btn:hover .action-icon-circle {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.reels-action-item-btn span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
}

/* Download Progress Overlay screen */
.download-progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.download-progress-card {
  width: min(90vw, 340px);
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px 24px;
  box-sizing: border-box;
  text-align: center;
  color: white;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.progress-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px auto;
}

.progress-title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 6px;
}

.progress-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #ec4899 100%);
  border-radius: 99px;
  transition: width 0.1s linear;
}

.progress-percentage {
  font-size: 18px;
  font-weight: 800;
  font-family: monospace;
  color: var(--primary);
  margin-bottom: 24px;
}

.progress-cancel-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  color: white;
  padding: 8px 20px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

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

/* Ensure share sheet icons size is set explicitly */
.reels-share-sheet svg,
.reels-share-sheet i {
  width: 20px !important;
  height: 20px !important;
  display: block !important;
  stroke: #ffffff !important;
  fill: none !important;
  stroke-width: 2 !important;
}

/* Specific overrides for brand SVG logos inside the share sheet to display correctly */
.reels-share-sheet svg.brand-logo-svg,
body:not([data-theme="dark"]) .reels-share-sheet .reels-social-btn .icon-circle svg.brand-logo-svg {
  stroke: none !important;
  fill: currentColor !important;
  stroke-width: 0 !important;
  display: inline-block !important;
}

.reels-share-sheet svg.brand-line-svg,
body:not([data-theme="dark"]) .reels-share-sheet .reels-social-btn .icon-circle svg.brand-line-svg {
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
  display: inline-block !important;
}

/* Close button and copy link inside action circle styles in dark mode */
.reels-share-sheet .reels-share-close-btn svg,
.reels-share-sheet .reels-social-btn.copy-link .icon-circle svg {
  stroke: #ffffff !important;
}

/* Light mode overrides for the Share Bottom Sheet */
body:not([data-theme="dark"]) .reels-share-sheet {
  background: rgba(255, 255, 255, 0.95) !important;
  border-top: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 -15px 30px rgba(0, 0, 0, 0.08) !important;
}

body:not([data-theme="dark"]) .reels-share-drag-handle {
  background: rgba(0, 0, 0, 0.15) !important;
}

body:not([data-theme="dark"]) .reels-share-close-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text-primary) !important;
}
body:not([data-theme="dark"]) .reels-share-close-btn:hover {
  background: rgba(0, 0, 0, 0.1) !important;
}

body:not([data-theme="dark"]) .reels-share-preview {
  background: rgba(0, 0, 0, 0.03) !important;
}
body:not([data-theme="dark"]) #reelsShareAuthor {
  color: var(--text-primary) !important;
}
body:not([data-theme="dark"]) #reelsShareCaption {
  color: var(--text-secondary) !important;
}

body:not([data-theme="dark"]) .reels-share-title {
  color: var(--text-muted) !important;
}

body:not([data-theme="dark"]) .reels-share-friend-btn .friend-name {
  color: var(--text-secondary) !important;
}

body:not([data-theme="dark"]) .reels-social-btn span {
  color: var(--text-secondary) !important;
}

body:not([data-theme="dark"]) .reels-social-btn.x-platform .icon-circle {
  background: #000000 !important;
}

body:not([data-theme="dark"]) .reels-social-btn.copy-link .icon-circle {
  background: rgba(0, 0, 0, 0.05) !important;
}

body:not([data-theme="dark"]) .reels-action-item-btn .action-icon-circle {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: var(--text-primary) !important;
}
body:not([data-theme="dark"]) .reels-action-item-btn:hover .action-icon-circle {
  background: rgba(0, 0, 0, 0.08) !important;
}
body:not([data-theme="dark"]) .reels-action-item-btn span {
  color: var(--text-secondary) !important;
}

/* Ensure icons are correctly colored in light mode */
body:not([data-theme="dark"]) .reels-share-sheet .reels-social-btn .icon-circle svg {
  stroke: #ffffff !important; /* Keep icons inside solid colored circles white */
}

/* Correct stroke color for copy-link, close and download icons in light mode */
body:not([data-theme="dark"]) .reels-share-sheet .reels-social-btn.copy-link .icon-circle svg,
body:not([data-theme="dark"]) .reels-share-sheet .reels-action-item-btn .action-icon-circle svg,
body:not([data-theme="dark"]) .reels-share-sheet .reels-share-close-btn svg {
  stroke: var(--text-primary) !important;
}

/* Desktop Centering styling for Share Sheet Modal */
@media screen and (min-width: 769px) {
  .reels-share-overlay {
    align-items: center !important;
    justify-content: center !important;
  }
  .reels-share-sheet {
    border-radius: 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transform: translateY(30px) scale(0.95) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
    max-width: 460px !important;
    padding-bottom: 24px !important;
  }
  .reels-share-overlay.open .reels-share-sheet {
    transform: translateY(0) scale(1) !important;
  }
  .reels-share-drag-handle {
    display: none !important;
  }
  body:not([data-theme="dark"]) .reels-share-sheet {
    border: 1px solid var(--border-color) !important;
  }
}

/* Short Upload Compilation Status & Progress styling */
.short-upload-status.info {
  border-color: rgba(139, 92, 246, 0.28);
  background: rgba(139, 92, 246, 0.08);
  color: var(--primary);
}

.short-compilation-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 99px;
  margin-top: 8px;
  overflow: hidden;
}

.short-compilation-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #06b6d4 100%);
  border-radius: 99px;
  transition: width 0.1s linear;
}

/* TikTok-Style Bottom Navigation Create Button */
.tiktok-btn-container {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.tiktok-btn {
  position: relative;
  width: 44px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tiktok-wing {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38px;
  border-radius: 8px;
  z-index: 1;
}

.tiktok-wing-left {
  left: 0;
  background: linear-gradient(135deg, #8a2be2, #4a00e0); /* Status ring gradient */
}

.tiktok-wing-right {
  right: 0;
  background: var(--primary); /* TrasX primary blue */
}

.tiktok-body {
  position: absolute;
  top: 0;
  left: 3px;
  right: 3px;
  bottom: 0;
  background-color: var(--text-main); /* contrast color, text color of theme */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.15s ease-in-out, background-color 0.2s ease;
}

.tiktok-btn:hover .tiktok-body {
  transform: scale(1.06);
}

.tiktok-body svg,
.tiktok-body i {
  color: var(--bg-card) !important;
  stroke: var(--bg-card) !important;
}

/* --- TrasX Gomoku Games Styles --- */
.gomoku-game-layout {
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .gomoku-game-layout {
    grid-template-columns: 280px 1fr;
  }
}

.gomoku-board {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  aspect-ratio: 1;
  background: var(--border-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  /* border: 1.5px solid var(--border-color); */
  border-radius: 16px;
  padding: 2px;
  gap: 1px;
  /* box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05); */
  position: relative;
  max-width: 100%;
  width: min(520px, 92vw);
  height: min(520px, 92vw);
  margin: 0 auto;
  overflow: hidden;
}

.gomoku-cell {
  position: relative;
  cursor: pointer;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  transition: background-color 0.2s ease;
}

.gomoku-cell:not(.has-stone):hover {
  background: rgba(15, 23, 42, 0.85);
}

/* Hover preview of placement */
.gomoku-cell .stone-preview {
  display: none;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.25);
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border: 1px dashed var(--primary);
}

.gomoku-cell:not(.has-stone):hover .stone-preview {
  display: block;
}

/* Game stones styling */
.gomoku-stone {
  width: 85%;
  height: 85%;
  border-radius: 50%;
  position: absolute;
  z-index: 3;
  pointer-events: none;
  animation: gomokuStonePlace 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.gomoku-stone.black {
  background: radial-gradient(circle at 30% 30%, #4b5563, #0f172a 75%);
  border: 1px solid #020617;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.55), inset 0 1.5px 3px rgba(255, 255, 255, 0.15);
}

.gomoku-stone.white {
  background: radial-gradient(circle at 30% 30%, #ffffff, #e2e8f0 80%);
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22), inset 0 -1.5px 3px rgba(0, 0, 0, 0.12);
}

/* Glow for winning alignment */
.gomoku-stone.winning {
  animation: gomokuStoneWinGlow 1.2s infinite alternate ease-in-out;
  border: 2px solid #10b981 !important;
}

@keyframes gomokuStonePlace {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes gomokuStoneWinGlow {
  from {
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: scale(1);
  }
  to {
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.95), 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: scale(1.05);
  }
}

/* ==========================================================================
   Real-Time Games & Lobbies styles
   ========================================================================== */

.games-container-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  margin-bottom: 40px;
}

.games-lobby {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

.games-lobby-header {
  text-align: center;
  margin-top: 10px;
}

.games-lobby-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.games-lobby-header h2 i {
  color: var(--primary);
  width: 30px;
  height: 30px;
}

.games-lobby-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.games-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  width: 100%;
}

.game-catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  box-shadow: var(--shadow-md);
}

.game-catalog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.game-catalog-card.card-tictactoe:hover {
  border-color: #3b82f6;
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.12), var(--shadow-lg);
}

.game-catalog-card.card-connect4:hover {
  border-color: #ec4899;
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.12), var(--shadow-lg);
}

.game-catalog-card.card-gomoku:hover {
  border-color: #a855f7;
  box-shadow: 0 12px 28px rgba(168, 85, 247, 0.12), var(--shadow-lg);
}

.game-card-bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

body[data-theme="dark"] .game-card-bg-glow {
  background: radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.06), transparent 60%);
}

.game-catalog-card:hover .game-card-bg-glow {
  opacity: 1;
}

.game-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-catalog-card:hover .game-icon-wrap {
  transform: scale(1.1) rotate(5deg);
}

.card-tictactoe .game-icon-wrap {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.card-connect4 .game-icon-wrap {
  background: rgba(236, 72, 153, 0.08);
  color: #ec4899;
}

.card-gomoku .game-icon-wrap {
  background: rgba(168, 85, 247, 0.08);
  color: #a855f7;
}

.game-icon-wrap i, .game-icon-wrap svg {
  width: 28px;
  height: 28px;
}

.game-catalog-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.game-catalog-card p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  min-height: 38px;
}

.play-catalog-btn {
  width: 100%;
  border-radius: 12px;
  height: 40px;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

.card-tictactoe .play-catalog-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.card-connect4 .play-catalog-btn {
  background: linear-gradient(135deg, #ec4899, #db2777);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
}

.card-gomoku .play-catalog-btn {
  background: linear-gradient(135deg, #a855f7, #9333ea);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.game-catalog-card:hover .play-catalog-btn {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.live-games-lobby-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 10px;
  width: 100%;
}

.lobby-list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.lobby-list-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.pulse-indicator-green {
  background: #10b981;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.pulse-indicator-green::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.games-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

/* Dynamic list item styles */
.game-list-item {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.game-list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.game-timer-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(124, 77, 255, 0.15);
  border: 1px solid rgba(124, 77, 255, 0.3);
  color: #b388ff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.game-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.game-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.game-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-item-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.game-item-sub i, .game-item-sub svg {
  width: 12px;
  height: 12px;
}

.game-item-btn-waiting {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--primary-light);
  border: 1px solid rgba(24, 119, 242, 0.12);
}

.game-item-vs-cluster {
  display: flex;
  align-items: center;
  gap: 4px;
}

.game-item-vs-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-color);
}

.game-item-vs-avatar.p1 {
  border-color: var(--primary);
}

.game-item-vs-avatar.p2 {
  border-color: #ec4899;
}

.game-item-vs-text {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 2px;
}

/* Active Game Arena style */
.active-game-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
}

.active-game-header {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 14px 22px;
  box-shadow: var(--shadow-md);
}

.game-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-header-info h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  font-family: 'Outfit', sans-serif;
}

.game-header-info span {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

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

.spectators-badge-btn {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  height: 32px;
}

.spectators-badge-btn:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
}

.spectators-badge-btn span {
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
}

.live-blink-dot {
  background: #10b981;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.2s infinite alternate;
}

@keyframes blink {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

.forfeit-game-btn {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  height: 32px;
  transition: var(--transition-fast);
}

.forfeit-game-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
}

.game-arena-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.game-scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 16px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.scoreboard-player {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.scoreboard-player .player-score-badge {
  margin-left: auto;
}

.player-avatar-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.player-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.scoreboard-player.p1 .player-avatar-wrap img {
  border-color: var(--primary);
}

.scoreboard-player.p2 .player-avatar-wrap img {
  border-color: #ec4899;
}

.active-turn-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  transition: border-color 0.3s;
  pointer-events: none;
}

/* Pulsing ring for the active player's turn */
.player-turn-active .active-turn-ring {
  border-color: #10b981;
  animation: activeRingPulse 1.5s infinite;
}

@keyframes activeRingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.player-meta {
  min-width: 0;
}

.player-name-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  max-width: 100%;
}

.player-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.player-symbol-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  display: inline-block;
  margin-top: 2px;
}

.badge-p1 {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-p2 {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.player-score-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  background: var(--bg-hover);
  padding: 4px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  min-width: 24px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.scoreboard-player.p2 .player-score-badge {
  color: #ec4899;
}

.game-send-gift-btn {
  background: rgba(251, 191, 36, 0.1) !important;
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
  border-radius: 50% !important;
  width: 28px !important;
  height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  outline: none !important;
  transition: all 0.2s !important;
  flex-shrink: 0 !important;
}

.game-send-gift-btn:hover {
  background: #fbbf24 !important;
  transform: scale(1.05);
}

.game-send-gift-btn:hover i, .game-send-gift-btn:hover svg {
  color: #000000 !important;
}

.scoreboard-vs {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 20px;
  color: var(--text-muted);
  background: var(--bg-hover);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.game-turn-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  color: var(--primary);
  padding: 10px 20px;
  border-radius: 14px;
  background: var(--primary-light);
  border: 1px solid rgba(59, 130, 246, 0.15);
  transition: all 0.3s ease;
}

.game-turn-status-bar.finished-win {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

.game-turn-status-bar.finished-draw {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.2);
}

.game-replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
  transition: all 0.2s ease;
}

.game-replay-btn:hover {
  background: var(--primary-dark, #2563eb);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
}

.game-replay-btn:active {
  transform: scale(0.98);
}

.game-board-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 24px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

body[data-theme="dark"] .game-board-wrapper {
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Domino Board & Pieces Styling */
.domino-board-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

/* Action Bar */
.domino-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  gap: 12px;
}

.boneyard-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-hover);
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
}

.boneyard-badge i {
  color: var(--primary);
  width: 16px;
  height: 16px;
}

.domino-btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.domino-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(24, 119, 242, 0.35);
}

.domino-btn-primary:active {
  transform: translateY(0);
}

.domino-btn-primary:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.domino-btn-secondary {
  background: #f43f5e;
  color: white;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
  transition: all 0.2s ease;
}

.domino-btn-secondary:hover {
  background: #e11d48;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.35);
}

.domino-btn-secondary:active {
  transform: translateY(0);
}

/* Scrollable Domino Table wrapper */
.domino-table-wrapper {
  position: relative;
  width: 100%;
  background: #0f5132; /* Classic Green Salon Felt Tapis */
  background-image: radial-gradient(#157347 25%, #0f5132 85%);
  border-radius: 20px;
  padding: 50px 24px;
  border: 6px solid #5c3d2e; /* Luxury Wooden Table Frame border */
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.5), var(--shadow-md);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Horizontal line-up of played dominoes */
/* Plateau de dominos avec support du tracé absolu (serpentin) */
.domino-table {
  position: relative;
  width: 100%;
  min-height: 160px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.domino-empty-table-msg {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Indicateurs de placement positionnés de manière absolue */
.domino-table-indicator {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  border: 2px dashed #10b981;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  animation: pulseGreen 1.5s infinite ease-in-out;
}

.domino-table-indicator:hover {
  background: rgba(16, 185, 129, 0.3);
  transform: translate(-50%, -50%) scale(1.05);
}

.domino-table-indicator i {
  width: 18px;
  height: 18px;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Design des dominos standards (Main du joueur) */
.domino-tile {
  position: relative;
  display: flex;
  background: transparent;
  border-radius: 6px;
  border: none;
  box-shadow: 0 6px 0 #cfcaa9, 0 8px 12px rgba(0, 0, 0, 0.25); /* Tranche 3D de l'ivoire */
  width: 90px;
  height: 45px;
  cursor: default;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
  user-select: none;
}

/* Double vertical standard (Main du joueur) */
.domino-tile.double {
  flex-direction: column;
  width: 45px;
  height: 90px;
  box-shadow: 0 6px 0 #cfcaa9, 0 8px 12px rgba(0, 0, 0, 0.25);
}

/* Dominos sur la table (Taille réduite, positionnement absolu) */
.domino-table .domino-tile {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: none; /* Pas d'animation de transition de position pendant le jeu */
  background: transparent !important;
  border: none !important;
  box-shadow: 0 3px 0 #cfcaa9, 0 4px 8px rgba(0, 0, 0, 0.3); /* Tranche 3D plus fine sur la table */
}

/* Ajustements pour les pips et séparateurs des dominos de la table */
.domino-table .domino-tile .domino-half-pips {
  width: 20px;
  height: 20px;
  gap: 1.5px;
}

.domino-table .domino-tile .pip {
  width: 5px;
  height: 5px;
  box-shadow: inset 0.5px 0.5px 1px rgba(0, 0, 0, 0.85);
}

.domino-table .domino-tile.vertical .domino-divider {
  width: 100%;
  height: 2px;
}

.domino-table .domino-tile:not(.vertical) .domino-divider {
  width: 2px;
  height: 100%;
}

/* Playable hand styling */
.domino-tile.playable {
  cursor: pointer;
}

.domino-tile.playable:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.25), 
              0 0 12px rgba(24, 119, 242, 0.4);
  border-color: var(--primary);
}

.domino-tile.selected {
  transform: translateY(-12px);
  border-color: var(--primary);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.3), 
              0 0 18px rgba(24, 119, 242, 0.7);
  animation: floatTile 2s infinite ease-in-out;
}

@keyframes floatTile {
  0% { transform: translateY(-12px); }
  50% { transform: translateY(-16px); }
  100% { transform: translateY(-12px); }
}

/* Dividers with metallic center spindle pin (Pivot) */
.domino-divider {
  position: relative;
  background: #64748b; /* Slate divider groove */
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.4), 0.5px 0.5px 0.5px rgba(255, 255, 255, 0.7);
}

/* Les séparateurs, points (pips) et moitiés de dominos sont maintenant rendus de manière réaliste et vectorielle directement par l'image SVG générée en ligne dans JS. */

/* Hand Section */
.domino-player-hand-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
  padding: 18px 22px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  margin-top: 8px;
}

.domino-player-hand-section h4 {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.domino-player-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 16px 0;
  min-height: 80px;
}

.hand-spectating-msg {
  color: var(--text-muted);
  font-size: 12.5px;
  font-style: italic;
  font-weight: 600;
  padding: 14px;
}

/* Last Played Highlights for ALL Games */
/* Domino last tile played - soft pulsing gold border and drop shadow */
.domino-tile.last-played {
  outline: 3px solid #eab308;
  outline-offset: 2px;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.85), 0 5px 8px rgba(0, 0, 0, 0.3) !important;
  animation: lastPlayedPulse 2s infinite ease-in-out;
}

/* Connect 4 last cell dropped - clean inner white highlight on disc */
.c4-cell.last-played .c4-disc {
  box-shadow: inset 0 0 0 3px #ffffff, 0 0 8px rgba(255, 255, 255, 0.8) !important;
}

/* Gomoku last stone placed - golden center dot indicator */
.gomoku-cell.last-played .gomoku-stone {
  position: relative;
  box-shadow: 0 0 0 2px #eab308, 0 4px 6px rgba(0,0,0,0.3) !important;
}

.gomoku-cell.last-played .gomoku-stone::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: #eab308;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px #eab308;
}

@keyframes lastPlayedPulse {
  0% { transform: scale(1); box-shadow: 0 0 14px rgba(234, 179, 8, 0.85); }
  50% { transform: scale(1.03); box-shadow: 0 0 20px rgba(234, 179, 8, 1); }
  100% { transform: scale(1); box-shadow: 0 0 14px rgba(234, 179, 8, 0.85); }
}

/* Responsiveness overrides for Mobile & Tablet views */
@media (max-width: 768px) {
  .domino-tile {
    width: 72px;
    height: 36px;
    border-radius: 8px;
  }
  .domino-tile.double {
    width: 36px;
    height: 72px;
  }
  .domino-half-pips {
    width: 24px;
    height: 24px;
  }
  .pip {
    width: 6px;
    height: 6px;
  }
  .domino-table-wrapper {
    padding: 30px 16px;
    border-width: 5px;
  }
}

@media (max-width: 480px) {
  .domino-tile {
    width: 56px;
    height: 28px;
    border-radius: 6px;
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.15), 
                inset 0 1px 2px rgba(255, 255, 255, 0.8),
                inset 0 -2px 0 #e6e2d3;
  }
  .domino-tile.double {
    width: 28px;
    height: 56px;
    box-shadow: 3px 0 4px rgba(0, 0, 0, 0.15), 
                inset 1px 0 2px rgba(255, 255, 255, 0.8),
                inset -2px 0 0 #e6e2d3;
  }
  .domino-half-pips {
    width: 18px;
    height: 18px;
    gap: 2px;
  }
  .pip {
    width: 4px;
    height: 4px;
  }
  .domino-table-wrapper {
    padding: 20px 10px;
    border-width: 4px;
  }
  .domino-table {
    min-height: 100px;
    gap: 8px;
  }
  .domino-player-hand {
    gap: 8px;
  }
  .domino-action-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }
  .boneyard-badge {
    justify-content: center;
  }
}

/* Connect Four Board Grid - Highly responsive and premium */
.connectfour-grid-container {
  display: none;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.c4-drop-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.c4-drop-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  aspect-ratio: 1;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  outline: none;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.c4-drop-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  transform: translateY(-2px);
}

.c4-drop-btn i, .c4-drop-btn svg {
  width: 14px;
  height: 14px;
}

.connectfour-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  padding: 14px;
  border-radius: 16px;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .connectfour-grid {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
  border-color: rgba(255, 255, 255, 0.05);
}

.c4-cell {
  background: var(--bg-card);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: hidden; /* Restrict disc rendering within cell space */
}

.c4-disc {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.c4-disc.new-disc {
  animation: c4Fall 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.c4-disc.player1 {
  background: radial-gradient(circle at 35% 35%, #ff4d4d 0%, #c81010 80%);
  border: 1px solid #990000;
}

.c4-disc.player2 {
  background: radial-gradient(circle at 35% 35%, #ffd000 0%, #d48b00 80%);
  border: 1px solid #996000;
}

@keyframes c4Fall {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes popStone {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.gomoku-board-container {
  display: none;
  width: 100%;
}

.gomoku-board-container .gomoku-board {
  width: min(480px, 86vw);
  height: min(480px, 86vw);
  margin: 0 auto;
}

.chess-board-container {
  display: none;
  width: 100%;
}

.chess-board-shell {
  width: min(520px, 92vw);
  margin: 0 auto;
  background: #24201e;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.35);
  box-shadow: none;
}

.chess-board-top-name,
.chess-board-bottom-name {
  padding: 11px 14px;
  background: #26211f;
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.15;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1 / 1;
}

.chess-square {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
}

.chess-square.light {
  background: #f0d8b0;
}

.chess-square.dark {
  background: #b78b61;
}

.chess-square.selected {
  box-shadow: inset 0 0 0 4px rgba(59, 130, 246, 0.55);
}

.chess-square.last-move {
  box-shadow: inset 0 0 0 999px rgba(250, 204, 21, 0.13);
}

.chess-square.legal::after {
  content: '';
  width: 16%;
  height: 16%;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.28);
  position: absolute;
}

.chess-square.capture::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 4px solid rgba(17, 24, 39, 0.28);
}

.chess-piece {
  font-size: clamp(32px, 6vw, 49px);
  line-height: 1;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.mathduel-board-container,
.table-football-board-container {
  display: none;
  width: 100%;
}

.mathduel-card,
.table-football-card {
  width: min(460px, 92vw);
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
}

.mathduel-round,
.table-football-phase {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.mathduel-question {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  color: var(--text-primary);
  text-align: center;
  margin: 8px 0 16px;
}

.mathduel-answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mathduel-answer-btn,
.table-football-lane-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--text-primary);
  border-radius: 16px;
  min-height: 54px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mathduel-answer-btn:hover,
.table-football-lane-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}

.mathduel-result,
.table-football-result,
.table-football-sub {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.table-football-header {
  text-align: center;
  margin-bottom: 14px;
}

.table-football-field {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: stretch;
  min-height: 220px;
  padding: 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.2)),
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.06) 0 28px,
      rgba(255,255,255,0.02) 28px 56px
    );
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.table-football-goal,
.table-football-center {
  border-radius: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.table-football-goal {
  background: rgba(15, 23, 42, 0.18);
  border: 1px dashed rgba(255,255,255,0.18);
  padding: 16px 10px;
}

.table-football-center {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 12px;
  align-items: center;
}

.table-football-goal-slot,
.table-football-ball-slot {
  height: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}

.table-football-goal-slot.active::after,
.table-football-ball-slot.active::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
}

.table-football-goal-slot.blocked::after {
  content: '🧤';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.table-football-ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #d1d5db 70%);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.table-football-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.market-container-section {
  width: 100%;
  padding: 0;
  --market-shell-bg: color-mix(in srgb, var(--primary) 16%, #ffffff);
  --market-shell-bg-soft: color-mix(in srgb, var(--primary) 8%, #ffffff);
  --market-board-bg: var(--bg-card);
  --market-board-border: color-mix(in srgb, var(--border-color) 92%, #e7eef5);
  --market-divider: color-mix(in srgb, var(--border-color) 92%, #e7eef5);
  --market-soft-surface: color-mix(in srgb, var(--primary) 6%, var(--bg-input));
  --market-ghost-surface: transparent;
  --market-ghost-color: var(--text-primary);
  --market-action-surface: color-mix(in srgb, var(--primary) 10%, #e9f2f9);
  --market-action-color: var(--text-primary);
  --market-method-color: color-mix(in srgb, var(--primary) 75%, #1b75d0);
  --market-shadow: none;
}

body[data-theme="dark"] .market-container-section {
  --market-shell-bg: color-mix(in srgb, var(--primary) 18%, #151f32);
  --market-shell-bg-soft: color-mix(in srgb, var(--primary) 10%, #151f32);
  --market-board-bg: #182235;
  --market-board-border: color-mix(in srgb, var(--border-color) 88%, #334155);
  --market-divider: color-mix(in srgb, var(--border-color) 88%, #334155);
  --market-soft-surface: color-mix(in srgb, var(--primary) 8%, #1e293b);
  --market-action-surface: color-mix(in srgb, var(--primary) 15%, #223149);
  --market-action-color: #f8fafc;
  --market-method-color: color-mix(in srgb, var(--primary) 70%, #8ec5ff);
  --market-shadow: none;
}

.market-mobile-shell {
  width: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--market-shell-bg) 0%, var(--market-shell-bg) 18%, var(--market-shell-bg-soft) 18%, var(--market-shell-bg-soft) 100%);
  box-shadow: var(--market-shadow);
}

.market-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 22px 62px;
}

.market-topbar-left,
.market-topbar-right,
.market-mobile-offer-head,
.market-mobile-user,
.market-mobile-offer-body,
.market-offer-top,
.market-order-top,
.market-offer-price-row,
.market-order-grid,
.market-form-actions,
.market-order-actions {
  display: flex;
}

.market-topbar-left,
.market-topbar-right,
.market-mobile-user {
  align-items: center;
}

.market-topbar-left,
.market-topbar-right {
  gap: 12px;
}

.market-topbar-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.market-topbar-title {
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}

.market-topbar-chevron {
  color: var(--text-secondary);
}

.market-icon-btn,
.market-currency-btn,
.market-currency-select,
.market-header-action-btn,
.market-primary-btn,
.market-secondary-btn,
.market-soft-action-btn {
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.market-icon-btn:hover,
.market-currency-btn:hover,
.market-currency-select:hover,
.market-header-action-btn:hover,
.market-primary-btn:hover,
.market-secondary-btn:hover,
.market-soft-action-btn:hover {
  transform: translateY(-1px);
}

.market-back-btn,
.market-filter-btn,
.market-header-action-btn,
.market-icon-btn {
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--market-ghost-color);
  box-shadow: none;
}

.market-currency-btn {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}

.market-currency-select {
  min-height: auto;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  padding: 0 18px 0 0;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position:
    calc(100% - 11px) 52%,
    calc(100% - 6px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  outline: none;
  max-width: 84px;
}

.market-topbar-right {
  gap: 10px;
  position: relative;
}

.market-topbar-menu[hidden] {
  display: none !important;
}

.market-topbar-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 196px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 16px;
  background: var(--market-board-bg);
  border: 1px solid var(--market-board-border);
  z-index: 8;
}

.market-topbar-menu-item,
.market-panel-close-btn {
  border: none;
  background: transparent;
  cursor: pointer;
}

.market-topbar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background 0.18s ease, transform 0.18s ease;
}

.market-topbar-menu-item:hover {
  background: var(--market-soft-surface);
}

.market-mobile-board {
  margin-top: -28px;
  border-radius: 28px 28px 0 0;
  background: var(--market-board-bg);
  padding: 18px 22px 14px;
  border-top: none;
}

.market-mobile-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.market-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  position: relative;
}

.market-mode-switch::after {
  content: '';
  position: absolute;
  left: calc(50% - 0.5px);
  top: 5px;
  bottom: 8px;
  width: 1px;
  background: var(--market-divider);
}

.market-mode-tab {
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
}

.market-mode-tab.is-active {
  color: var(--text-primary);
  font-weight: 700;
}

.market-asset-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 2px;
  overflow-x: auto;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--market-divider);
}

.market-asset-tabs::-webkit-scrollbar {
  display: none;
}

.market-asset-tab {
  position: relative;
  border: none;
  background: transparent;
  padding: 0 0 12px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 1;
}

.market-asset-tab.is-active {
  color: var(--primary);
}

.market-asset-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.market-asset-tab:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.market-mini-label,
.market-mobile-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}

.market-panel {
  padding: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 0;
  background: transparent;
  border: none;
}

.market-create-panel {
  margin: 4px 0 12px;
  padding: 0 0 12px;
  background: transparent;
  border-bottom: 1px solid var(--market-divider);
}

.market-create-panel-collapsed {
  display: none;
}

.market-create-panel.market-create-panel-open {
  display: flex;
}

.market-managed-panel-collapsed {
  display: none;
}

.market-managed-panel.market-managed-panel-open {
  display: flex;
}

.market-panel-head--with-close {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.market-panel-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.market-panel-close-btn:hover {
  background: var(--market-soft-surface);
  color: var(--text-primary);
}

.market-panel-head h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: inherit;
}

.market-panel-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.market-create-balance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 5%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border-color));
}

.market-create-balance-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.market-create-balance-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 700;
}

/* Frozen balance — strip variant inside "Créer une annonce" */
.market-create-balance-strip--frozen {
  background: color-mix(in srgb, #f59e0b 8%, var(--bg-card));
  border-color: color-mix(in srgb, #f59e0b 22%, var(--border-color));
}

.market-create-balance-strip--frozen .market-create-balance-label {
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 3px;
}

.market-create-balance-strip--frozen i[data-lucide] {
  color: #b45309;
}

/* Frozen escrow summary row inside "Mes annonces" list */
.market-offers-frozen-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, #f59e0b 8%, var(--bg-card));
  border: 1px solid color-mix(in srgb, #f59e0b 22%, var(--border-color));
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
}

.market-offers-frozen-summary i[data-lucide] {
  color: #b45309;
}

/* Shared pill styles */
.market-frozen-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.market-frozen-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.market-frozen-pill--usdt {
  background: color-mix(in srgb, #06b6d4 14%, var(--bg-card));
  color: #0891b2;
  border: 1px solid color-mix(in srgb, #06b6d4 30%, transparent);
}

.market-frozen-pill--token {
  background: color-mix(in srgb, var(--accent-color, #7c4dff) 14%, var(--bg-card));
  color: var(--accent-color, #7c4dff);
  border: 1px solid color-mix(in srgb, var(--accent-color, #7c4dff) 30%, transparent);
}


.market-offer-form,
.market-orders-list,
.market-offers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.market-form-row--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.market-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.market-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.market-field-helper {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.market-field input,
.market-field select,
.market-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 12px;
  outline: none;
}

.market-field input[readonly] {
  background: color-mix(in srgb, var(--primary) 4%, var(--bg-card));
  color: var(--text-secondary);
  cursor: default;
}

.market-field input.is-readonly {
  background: color-mix(in srgb, var(--primary) 4%, var(--bg-card));
  color: var(--text-secondary);
  cursor: default;
}

.market-field input:focus,
.market-field select:focus,
.market-field textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 48%, #dbe6ef);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.market-field input.is-invalid,
.market-order-chat-input.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.market-field textarea {
  resize: vertical;
  min-height: 110px;
}

.market-note-box {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, #e0ebf3);
  background: color-mix(in srgb, var(--primary) 7%, var(--bg-card));
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.market-note-box--warn {
  border-color: color-mix(in srgb, #f59e0b 30%, transparent);
  background: color-mix(in srgb, #f59e0b 8%, var(--bg-card));
  color: #92400e;
}

.market-form-actions,
.market-order-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.market-primary-btn,
.market-secondary-btn,
.market-soft-action-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.market-primary-btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 68%, #0f766e) 100%);
}

.market-secondary-btn {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, #eef4f8);
}

.market-danger-btn {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.market-danger-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.market-danger-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.market-soft-action-btn {
  width: 104px;
  min-width: 104px;
  min-height: 38px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 8%, var(--bg-card));
  color: var(--market-action-color);
  font-size: 11px;
  font-weight: 700;
}

.market-offers-panel {
  display: flex;
  flex-direction: column;
}

.market-trade-modal[hidden] {
  display: none !important;
}

.market-trade-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.market-trade-modal-dialog {
  width: min(100%, 430px);
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--market-board-border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.market-trade-modal-head,
.market-order-chat-head,
.market-order-chat-compose-actions,
.market-order-chat-bubble-meta {
  display: flex;
}

.market-trade-modal-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.market-trade-modal-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--text-primary);
}

.market-trade-modal-head p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.market-trade-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.market-trade-modal-stat {
  border-radius: 12px;
  background: var(--market-soft-surface);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.market-trade-modal-stat span,
.market-trade-modal-total span {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.market-trade-modal-stat strong,
.market-trade-modal-total strong {
  font-size: 12px;
  color: var(--text-primary);
}

.market-trade-modal-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--market-divider);
}

.market-page-head,
.market-page-head-copy,
.market-order-summary-actions {
  display: flex;
}

.market-page-head {
  align-items: flex-start;
  gap: 12px;
}

.market-page-head-copy {
  flex-direction: column;
  gap: 4px;
}

.market-page-head-copy h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text-primary);
}

.market-page-head-copy p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.market-page-back-btn {
  margin-top: 1px;
}

.market-offers-list--mobile {
  gap: 0;
}

.market-mobile-offer-card {
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--market-divider);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-mobile-offer-card.is-hidden-by-mode {
  display: none;
}

.market-mobile-offer-card:last-child {
  border-bottom: none;
}

.market-mobile-offer-head,
.market-offer-top,
.market-order-top,
.market-offer-price-row {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.market-mobile-user {
  gap: 8px;
  min-width: 0;
}

.market-mobile-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--market-soft-surface);
}

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

.market-mobile-user-copy {
  min-width: 0;
}

.market-user-name,
.market-order-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.market-user-meta,
.market-terms-preview {
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.4;
}

.market-mobile-reputation {
  text-align: right;
  flex: 0 0 auto;
}

.market-mobile-reputation-top,
.market-mobile-reputation-sub {
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.35;
}

.market-mobile-reputation strong {
  color: var(--text-primary);
  font-size: 11px;
}

.market-mobile-offer-body {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.market-mobile-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.market-mobile-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.market-mobile-price {
  font-size: clamp(17px, 2.4vw, 20px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--text-primary);
}

.market-mobile-meta-line {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.market-mobile-meta-line strong {
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
}

.market-mobile-method-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.market-mobile-method-dot {
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--market-method-color);
  display: inline-block;
}

.market-terms-preview--mobile {
  margin: 0;
  font-size: 11px;
}

.market-offer-card,
.market-order-card {
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-order-chat-box {
  border-top: 1px solid var(--market-divider);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-order-chat-box--standalone {
  border-top: none;
  padding-top: 0;
}

.market-order-chat-head {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-secondary);
}

.market-order-chat-head strong {
  font-size: 12px;
  color: var(--text-primary);
}

.market-order-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.market-order-chat-empty {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 14px 10px;
  border-radius: 12px;
  background: var(--market-soft-surface);
}

.market-order-chat-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.market-order-chat-message.is-me {
  align-items: flex-end;
}

.market-order-chat-bubble {
  max-width: min(100%, 320px);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--market-soft-surface);
  color: var(--text-primary);
  font-size: 11.5px;
  line-height: 1.45;
}

.market-order-chat-message.is-me .market-order-chat-bubble {
  background: color-mix(in srgb, var(--primary) 12%, var(--bg-card));
}

.market-order-chat-proof-image {
  width: min(220px, 100%);
  border-radius: 12px;
  display: block;
  border: 1px solid var(--market-divider);
}

.market-order-chat-bubble-meta {
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
}

.market-order-chat-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-order-chat-input {
  width: 100%;
  min-height: 64px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 11.5px;
  resize: vertical;
  outline: none;
}

.market-order-chat-compose-actions {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.market-order-chat-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--market-soft-surface);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.market-order-chat-proof-name {
  font-size: 10.5px;
  color: var(--text-secondary);
  flex: 1 1 120px;
}

.market-order-summary-actions {
  justify-content: flex-end;
}

.market-order-detail-card {
  gap: 14px;
}

.market-offer-badge,
.market-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.market-offer-badge.is-sell,
.market-status-pill.is-paid,
.market-status-pill.is-released {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
}

.market-offer-badge.is-buy,
.market-status-pill.is-pending_payment {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
}

.market-status-pill.is-cancelled {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

.market-status-pill.is-disputed {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
}

.market-order-grid {
  flex-wrap: wrap;
  gap: 14px;
}

.market-order-grid > div {
  min-width: 130px;
  flex: 1 1 130px;
}

.market-empty-state {
  min-height: 180px;
  border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--primary) 16%, #dbe6ef);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.market-empty-state i {
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  .market-trade-modal-grid {
    grid-template-columns: 1fr;
  }

  .mathduel-answers {
    grid-template-columns: 1fr;
  }

  .market-topbar {
    padding: 18px 16px 52px;
  }

  .market-topbar-left,
  .market-topbar-right {
    justify-content: flex-start;
  }

  .market-topbar-title {
    font-size: 17px;
  }

  .market-mobile-board {
    padding: 16px 16px 14px;
    border-radius: 22px 22px 0 0;
  }

  .market-form-row,
  .market-form-row--triple {
    grid-template-columns: 1fr;
  }

  .market-mobile-tabs {
    gap: 10px;
  }

  .market-asset-tabs {
    gap: 18px;
  }

  .market-mobile-offer-head,
  .market-mobile-offer-body {
    gap: 14px;
  }

  .market-mobile-price {
    font-size: clamp(16px, 5.5vw, 19px);
  }

  .market-soft-action-btn {
    width: 98px;
    min-width: 98px;
    min-height: 36px;
    font-size: 10.5px;
  }

  .table-football-field {
    grid-template-columns: 1fr;
  }

  .table-football-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Chat component */
.game-side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.game-chat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  display: flex;
  flex-direction: column;
  height: 380px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.game-chat-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-chat-header i, .game-chat-header svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.game-chat-header span {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.game-chat-feed {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-chat-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
  margin: auto 0;
  padding: 0 10px;
}

.game-chat-form {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-card);
}

.game-chat-form input {
  flex: 1;
  height: 36px;
  border-radius: var(--border-radius-pill);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  padding: 0 16px;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.game-chat-form input:focus {
  border-color: var(--primary);
}

.game-chat-form button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s, background-color 0.2s;
}

.game-chat-form button:hover {
  transform: scale(1.05);
  background-color: var(--primary-dark);
}

.game-chat-msg-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.game-chat-msg-bubble {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 16px;
  max-width: 82%;
  width: fit-content;
  box-shadow: var(--shadow-sm);
}

.spectator-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  transition: transform 0.2s;
}

.spectator-list-item:hover {
  transform: translateX(2px);
}

/* Modals & Setup styles */
.game-setup-modal {
  border-radius: 24px;
  max-width: 420px !important;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header-gradient {
  padding: 24px;
  text-align: center;
  color: white;
  position: relative;
}

.modal-header-gradient.bg-setup {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
}

.modal-header-gradient.bg-spectators {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modal-header-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px auto;
  opacity: 0.95;
}

.modal-header-gradient h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}

.modal-header-gradient p {
  margin: 6px 0 0 0;
  opacity: 0.8;
  font-size: 12px;
}

.modal-close-btn {
  position: absolute;
  right: 16px;
  top: 16px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.3);
  color: white;
}

.modal-body-options {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-group-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.setup-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setup-option-label {
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--bg-card);
  position: relative;
}

.setup-option-label input[type="radio"] {
  position: absolute;
  top: 8px;
  right: 8px;
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
}

.option-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.option-card-content span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.option-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.setup-option-label:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.setup-option-label:hover .option-icon {
  color: var(--primary);
}

.setup-option-label.active {
  border-color: var(--primary) !important;
  background: var(--primary-light);
}

.setup-option-label.active .option-icon {
  color: var(--primary);
}

.modal-action-btn-primary {
  margin-top: 10px;
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.35);
}

.modal-action-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.45);
}

.spectators-list-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 10000 !important;
  border-radius: 24px;
  max-width: 360px !important;
  width: 90% !important;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.spectators-list-container {
  padding: 20px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  z-index: 9999;
}

.modal-overlay-blur {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 9999;
}

.game-confirm-modal-content {
  width: min(92vw, 420px);
  max-width: 420px;
  padding: 28px 24px 22px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.game-confirm-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(245, 158, 11, 0.18));
  color: #ef4444;
}

.game-confirm-modal-icon i,
.game-confirm-modal-icon svg {
  width: 24px;
  height: 24px;
}

.game-confirm-modal-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.game-confirm-modal-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.game-confirm-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.game-confirm-cancel-btn,
.game-confirm-accept-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.game-confirm-cancel-btn {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.game-confirm-accept-btn {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 14px 30px rgba(239, 68, 68, 0.24);
}

.game-confirm-cancel-btn:hover,
.game-confirm-accept-btn:hover {
  transform: translateY(-1px);
}

/* Inline Lobby Game Setup Card */
.lobby-setup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lobby-setup-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.lobby-setup-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px 0;
}

.lobby-setup-header h3 i, .lobby-setup-header h3 svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

.lobby-setup-header p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
}

.lobby-setup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-group-label {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.game-choices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.game-choice-option {
  position: relative;
  cursor: pointer;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  padding: 12px;
  text-align: center;
  transition: all 0.25s ease;
}

.game-choice-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.choice-card-content i, .choice-card-content svg {
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
}

.game-choice-option.active {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.04);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.15);
}

.game-choice-option.active .choice-card-content {
  color: var(--primary);
}

.game-choice-option.active .choice-card-content i, .game-choice-option.active .choice-card-content svg {
  transform: scale(1.1) rotate(4deg);
}

.setup-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 576px) {
  .setup-row-grid {
    grid-template-columns: 1fr;
  }
}

.sub-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sub-choice-option {
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  padding: 10px;
  text-align: center;
  transition: all 0.2s ease;
}

.sub-choice-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sub-choice-option.active {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.04);
}

.sub-choice-option.active .choice-card-content {
  color: var(--primary);
}

.lobby-start-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  color: white;
  border: none;
  border-radius: 14px;
  height: 44px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
  margin-top: 8px;
}

.lobby-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.lobby-start-btn:active {
  transform: translateY(0);
}

/* Games Lobby Tabs (style aligned with messages tabs) */
.games-lobby-tabs {
  display: flex;
  justify-content: flex-start;
  gap: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  padding-bottom: 4px;
}

.games-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 4px;
  position: relative;
  cursor: pointer;
  transition: color 0.2s ease;
}

.games-tab-btn i, .games-tab-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.games-tab-btn:hover {
  color: var(--primary);
}

.games-tab-btn:hover i, .games-tab-btn:hover svg {
  transform: scale(1.1);
}

.games-tab-btn.active {
  color: var(--primary);
}

.games-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* Games Lobby Tab Contents */
.games-tab-content {
  display: none;
  animation: tabFadeIn 0.25s ease-out;
}

.games-tab-content.active {
  display: block;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive grid layouts */
@media (min-width: 768px) {
  .live-games-lobby-grid {
    grid-template-columns: 1fr 1fr;
  }
  .active-game-area {
    grid-template-columns: 1fr 300px;
  }
  body.viewing-games .main-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  body.viewing-games .right-sidebar {
    display: none !important;
  }
}

/* Mobile Overrides for Games Section - Compact headers & scoreboard */
@media screen and (max-width: 768px) {
  .active-game-header {
    padding: 8px 12px !important;
    gap: 8px !important;
    border-radius: 16px !important;
  }
  .game-header-info {
    gap: 8px !important;
  }
  .game-header-info h3 {
    font-size: 13.5px !important;
  }
  .game-header-info span {
    font-size: 10px !important;
  }
  .spectators-badge-btn, .forfeit-game-btn {
    padding: 4px 8px !important;
    height: 26px !important;
    font-size: 10px !important;
  }
  .spectators-badge-btn span {
    font-size: 10px !important;
  }
  .game-scoreboard {
    padding: 8px 12px !important;
    gap: 8px !important;
    border-radius: 16px !important;
  }
  .scoreboard-player {
    gap: 8px !important;
  }
  .player-avatar-wrap {
    width: 32px !important;
    height: 32px !important;
  }
  .player-name {
    font-size: 12.5px !important;
  }
  .player-symbol-badge {
    font-size: 9px !important;
    padding: 1px 4px !important;
  }
  .scoreboard-vs {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }
  .player-score-badge {
    font-size: 15px !important;
    padding: 2px 8px !important;
    border-radius: 8px !important;
  }
  /* Connect 4 Mobile Responsiveness */
  .game-board-wrapper {
    padding: 10px !important;
    border-radius: 16px !important;
  }
  .connectfour-grid-container {
    padding: 10px !important;
    border-radius: 16px !important;
    gap: 8px !important;
  }
  .connectfour-grid {
    padding: 8px !important;
    gap: 6px !important;
    border-radius: 12px !important;
  }
  .c4-drop-header {
    gap: 6px !important;
  }
  .c4-drop-btn {
    box-shadow: none !important;
  }

  /* Game Chat Box and Panel mobile refinements */
  .game-side-panel,
  .game-chat-box,
  .game-chat-feed,
  .game-chat-form {
    box-sizing: border-box !important;
  }
  .game-chat-form input {
    min-width: 0 !important;
  }
  .game-chat-msg-bubble {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* Ultra mobile and small screen refinements */
  @media screen and (max-width: 480px) {
    .active-game-header {
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 12px !important;
      padding: 10px !important;
    }
    .game-header-info {
      justify-content: flex-start !important;
      width: 100% !important;
    }
    .game-header-actions {
      display: flex !important;
      justify-content: space-between !important;
      width: 100% !important;
      gap: 8px !important;
    }
    .spectators-badge-btn, .forfeit-game-btn {
      flex: 1 !important;
      justify-content: center !important;
      padding: 4px 6px !important;
      font-size: 11px !important;
    }

    .game-scoreboard {
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 10px !important;
      padding: 12px 10px !important;
    }
    .scoreboard-player {
      width: 100% !important;
      display: flex !important;
      align-items: center !important;
      gap: 10px !important;
    }
    .scoreboard-player .player-score-badge {
      margin-left: auto !important;
    }
    .player-meta {
      flex: 1 !important;
      min-width: 0 !important;
    }
    .player-name-wrapper {
      max-width: 140px !important;
    }
    .scoreboard-vs {
      align-self: center !important;
      margin: -4px 0 !important;
      width: 28px !important;
      height: 28px !important;
      font-size: 11px !important;
      line-height: 26px !important;
    }

    .game-turn-status-bar {
      padding: 8px 12px !important;
      font-size: 12px !important;
      border-radius: 10px !important;
    }

    /* Connect 4 Mobile Board adjustments */
    .game-board-wrapper {
      padding: 6px !important;
      border-radius: 12px !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }
    .connectfour-grid-container {
      padding: 8px !important;
      border-radius: 16px !important;
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }
    .connectfour-grid {
      padding: 6px !important;
      gap: 4px !important;
      border-radius: 10px !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }
    .c4-drop-header {
      gap: 4px !important;
      padding: 0 4px !important;
    }
    .c4-drop-btn {
      width: 100% !important;
    }
    .c4-cell {
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    }
  }
}

/* Premium Bot Selection Card styling */
.bots-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 12px;
  width: 100%;
}

.bot-select-card {
  position: relative;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 94%, var(--primary) 6%) 0%, color-mix(in srgb, var(--bg-card) 98%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--border-color) 88%, var(--primary) 12%);
  border-radius: 16px;
  padding: 18px 12px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bot-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% -20%, rgba(124, 77, 255, 0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.bot-select-card:hover .bot-card-glow {
  opacity: 1;
}

.bot-select-card:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 88%, var(--primary) 12%) 0%, color-mix(in srgb, var(--bg-card) 96%, var(--primary) 4%) 100%);
  border-color: color-mix(in srgb, var(--primary) 26%, var(--border-color) 74%);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--text-primary) 16%, transparent);
}

.bot-select-card.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--bg-card) 88%) 0%, color-mix(in srgb, var(--primary) 4%, var(--bg-card) 96%) 100%);
  border-color: color-mix(in srgb, var(--primary) 58%, var(--border-color) 42%);
  box-shadow: 0 0 20px color-mix(in srgb, var(--primary) 22%, transparent), inset 0 0 12px color-mix(in srgb, var(--primary) 8%, transparent);
  transform: translateY(-2px);
}

.bot-select-card.active .bot-card-glow {
  opacity: 1;
  background: radial-gradient(circle at 50% -20%, rgba(124, 77, 255, 0.3) 0%, transparent 60%);
}

/* Online Indicator badge */
.bot-status-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.bot-avatar-wrapper {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--border-color) 80%, #ffffff 20%) 0%, color-mix(in srgb, var(--bg-card) 86%, var(--primary) 14%) 100%);
  box-shadow: 0 4px 8px color-mix(in srgb, var(--text-primary) 12%, transparent);
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.bot-select-card.active .bot-avatar-wrapper {
  background: linear-gradient(135deg, #7c4dff 0%, #ff4081 100%);
  box-shadow: 0 0 10px rgba(124, 77, 255, 0.45);
  transform: scale(1.04);
}

.bot-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--bg-card);
}

.bot-info-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.bot-select-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.1px;
}

.bot-select-card-rank {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bot-select-card-wins {
  font-size: 10.5px;
  font-weight: 600;
  color: #fbbf24;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4.5px;
  background: rgba(251, 191, 36, 0.08);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.15);
}

body[data-theme="dark"] .bot-select-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-color: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .bot-select-card:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .bot-select-card.active {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.1) 0%, rgba(124, 77, 255, 0.02) 100%);
  border-color: #7c4dff;
  box-shadow: 0 0 20px rgba(124, 77, 255, 0.35), inset 0 0 12px rgba(124, 77, 255, 0.05);
}

body[data-theme="dark"] .bot-avatar-wrapper {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body[data-theme="dark"] .bot-select-card-name {
  color: #ffffff;
}

body[data-theme="dark"] .bot-select-card-rank {
  color: var(--text-muted);
}

.bot-select-card-wins i {
  width: 10.5px !important;
  height: 10.5px !important;
  stroke-width: 2.5;
}

/* ═══════════════════════════════════════════════
   GAME INVITE RECEIVED MODAL — Premium Design
   ═══════════════════════════════════════════════ */

@keyframes gir-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes gir-card-in {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes gir-pulse-ring {
  0%   { transform: scale(1);    opacity: 0.6; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

#gameInviteReceivedModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: gir-overlay-in 0.25s ease forwards;
}

.gir-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.35);
  animation: gir-card-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Header gradient ─────────────────────────── */
.gir-header {
  background: linear-gradient(135deg, var(--primary, #7c4dff) 0%, #a855f7 100%);
  padding: 28px 24px 24px;
  text-align: center;
  position: relative;
}

.gir-challenge-label {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.95);
  white-space: nowrap;
}

.gir-avatar-wrap {
  position: relative;
  display: inline-block;
  margin: 20px auto 12px;
}

.gir-avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.5);
  animation: gir-pulse-ring 1.8s ease-out infinite;
}

.gir-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  display: block;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.gir-challenger-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', 'Inter', sans-serif;
  letter-spacing: -0.3px;
}

.gir-challenger-username {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}

/* ── Body ─────────────────────────────────────── */
.gir-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gir-invite-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.55;
  margin: 0;
}

/* ── Info pills grid ──────────────────────────── */
.gir-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gir-info-pill {
  background: var(--bg-hover, rgba(255,255,255,0.04));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gir-info-pill-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted, #888);
}

.gir-info-pill-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.gir-info-pill-value.paid {
  color: #10b981;
}

.gir-info-pill-value.free {
  color: var(--primary, #7c4dff);
}

/* ── Progress bar ─────────────────────────────── */
.gir-timer-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gir-timer-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.gir-progress-track {
  height: 5px;
  background: var(--bg-hover, rgba(255,255,255,0.08));
  border-radius: 100px;
  overflow: hidden;
}

.gir-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 100px;
  transition: width 0.1s linear, background 0.4s ease;
}

/* ── Actions ──────────────────────────────────── */
.gir-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 22px 22px;
}

.gir-btn {
  height: 46px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}

.gir-btn:active {
  transform: scale(0.96);
}

.gir-btn-decline {
  background: var(--bg-input, rgba(255,255,255,0.06));
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.gir-btn-decline:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.gir-btn-accept {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.gir-btn-accept:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.gir-btn-accept:disabled,
.gir-btn-decline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */

@keyframes skeletonShimmer {
  0% { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton-base {
  background: linear-gradient(
    90deg,
    var(--bg-hover, #f0f0f0) 25%,
    var(--bg-input, #e0e0e0) 50%,
    var(--bg-hover, #f0f0f0) 75%
  );
  background-size: 1200px 100%;
  animation: skeletonShimmer 1.5s infinite linear;
  border-radius: 8px;
}

/* Skeleton post card */
.skeleton-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card, 16px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: skeletonFadeIn 0.3s ease both;
}

@keyframes skeletonFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header row: avatar + name + date */
.skeleton-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.skeleton-name {
  height: 13px;
  width: 38%;
  border-radius: 6px;
}

.skeleton-date {
  height: 11px;
  width: 22%;
  border-radius: 6px;
}

/* Text lines */
.skeleton-text-line {
  height: 12px;
  border-radius: 6px;
}

.skeleton-text-line.w-full  { width: 100%; }
.skeleton-text-line.w-90    { width: 90%; }
.skeleton-text-line.w-75    { width: 75%; }
.skeleton-text-line.w-55    { width: 55%; }

/* Media area */
.skeleton-media {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  margin: 4px 0;
}

/* Reactions row */
.skeleton-actions {
  display: flex;
  gap: 20px;
  padding-top: 4px;
}

.skeleton-action-btn {
  height: 13px;
  border-radius: 6px;
  width: 52px;
}

/* Dark mode overrides */
[data-theme="dark"] .skeleton-base,
body.dark-mode .skeleton-base {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 1200px 100%;
  animation: skeletonShimmer 1.5s infinite linear;
}

/* Skeleton container hidden once posts load */
#skeletonFeed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#skeletonFeed.hidden {
  display: none;
}

/* ---- Generic skeleton hide ---- */
.sk-section.hidden {
  display: none !important;
}

/* ============================================================
   SKELETON — STORIES ROW
   ============================================================ */
.skeleton-stories-row {
  display: flex;
  gap: 12px;
  overflow: hidden;
  padding: 4px 0;
}

#skeletonStories.hidden {
  display: none !important;
}

.skeleton-story-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.skeleton-story-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.skeleton-story-label {
  height: 10px;
  width: 54px;
  border-radius: 5px;
}

/* ============================================================
   SKELETON — RIGHT SIDEBAR
   ============================================================ */
.skeleton-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton-card-title {
  height: 14px;
  width: 55%;
  border-radius: 7px;
}

/* Ad card */
.skeleton-ad-banner {
  width: 100%;
  height: 130px;
  border-radius: 10px;
}

.skeleton-ad-text-line {
  height: 11px;
  border-radius: 5px;
}

.skeleton-ad-text-line.w-70 { width: 70%; }
.skeleton-ad-text-line.w-45 { width: 45%; }

/* Message item */
.skeleton-msg-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.skeleton-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-msg-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.skeleton-msg-name {
  height: 11px;
  width: 55%;
  border-radius: 5px;
}

.skeleton-msg-preview {
  height: 9px;
  width: 80%;
  border-radius: 5px;
}

/* Event item */
.skeleton-event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.skeleton-event-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.skeleton-event-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.skeleton-event-title {
  height: 11px;
  width: 65%;
  border-radius: 5px;
}

.skeleton-event-meta {
  height: 9px;
  width: 40%;
  border-radius: 5px;
}

/* ============================================================
   SKELETON — PROFILE PAGE
   ============================================================ */
.skeleton-profile-wrapper {
  width: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

/* Banner */
.skeleton-profile-banner {
  width: 100%;
  height: 160px;
  border-radius: 0;
}

/* Avatar circle below banner */
.skeleton-profile-avatar-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -52px;
  gap: 10px;
  padding: 0 16px;
}

.skeleton-profile-avatar-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 5px solid var(--bg-card);
  box-sizing: content-box;
}

.skeleton-profile-name {
  height: 18px;
  width: 45%;
  border-radius: 8px;
  margin-top: 8px;
}

.skeleton-profile-username {
  height: 12px;
  width: 28%;
  border-radius: 6px;
}

.skeleton-profile-bio {
  height: 11px;
  border-radius: 5px;
}

.skeleton-profile-bio.w-80 { width: 80%; }
.skeleton-profile-bio.w-65 { width: 65%; }

/* Stats row */
.skeleton-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 32px;
}

.skeleton-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.skeleton-stat-number {
  height: 20px;
  width: 50%;
  border-radius: 8px;
}

.skeleton-stat-label {
  height: 11px;
  width: 70%;
  border-radius: 5px;
}

/* Social grid (followers/following) */
.skeleton-social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 20px;
}

.skeleton-social-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-social-title {
  height: 13px;
  width: 50%;
  border-radius: 6px;
}

/* Posts/Reels grid */
.skeleton-profile-tabs {
  display: flex;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-top: 24px;
}

.skeleton-profile-tab {
  flex: 1;
  height: 48px;
  border-radius: 0;
}

.skeleton-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 2px;
}

.skeleton-grid-item {
  aspect-ratio: 1;
  border-radius: 0;
}

/* Wallet / private info */
.skeleton-wallet-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 20px;
  margin: 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton-wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.skeleton-wallet-label {
  height: 11px;
  width: 38%;
  border-radius: 5px;
}

.skeleton-wallet-value {
  height: 13px;
  width: 28%;
  border-radius: 5px;
}

.skeleton-wallet-btn {
  height: 38px;
  border-radius: 8px;
  flex: 1;
}

/* ============================================================
   SKELETON — SETTINGS PAGE
   ============================================================ */
.skeleton-settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton-settings-title {
  height: 15px;
  width: 35%;
  border-radius: 7px;
  margin-bottom: 4px;
}

.skeleton-settings-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.skeleton-settings-label {
  height: 10px;
  width: 25%;
  border-radius: 5px;
}

.skeleton-settings-input {
  height: 42px;
  border-radius: 10px;
  width: 100%;
}

.skeleton-settings-btn {
  height: 42px;
  border-radius: 10px;
  width: 40%;
  align-self: flex-end;
}
