/* Global Resets & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}



.accordion-collapsed-placeholder {
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
  user-select: none;
}

.accordion-collapsed-placeholder:hover {
  opacity: 1;
  color: var(--text-primary);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* ===== PREMIUM LOADING SCREEN ===== */
#loadingScreen {
  background: #0d1117;
  z-index: 10000;
  overflow: hidden;
}

/* Ambient radial glow behind loader */
.loader-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 255, 135, 0.06) 0%, transparent 65%);
  pointer-events: none;
  animation: loader-glow-breathe 4s ease-in-out infinite;
}

@keyframes loader-glow-breathe {

  0%,
  100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

/* Loading content wrapper */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
  text-align: center;
}

/* 3D Liquid Loader */
.chatvsu-liquid-loader {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  transform-style: preserve-3d;
  animation: liquid-float 4s ease-in-out infinite;
  filter: drop-shadow(0 15px 25px rgba(0, 255, 135, 0.2));
}

.liquid-base {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.15;
  filter: grayscale(100%);
  pointer-events: none;
}

.liquid-color-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* SVG Sine wave mask */
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="M0,100 C40,70 60,130 100,100 C140,70 160,130 200,100 V250 H0 Z" fill="black"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="M0,100 C40,70 60,130 100,100 C140,70 160,130 200,100 V250 H0 Z" fill="black"/></svg>');
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 200% 200%;
  mask-size: 200% 200%;
  -webkit-mask-position: 0% 100%;
  mask-position: 0% 100%;
  animation: liquid-fill 2.5s linear infinite;
}

.liquid-color {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes liquid-float {

  0%,
  100% {
    transform: translateY(0) rotateX(0) rotateY(0);
  }

  50% {
    transform: translateY(-15px) rotateX(5deg) rotateY(-5deg);
  }
}

@keyframes liquid-fill {

  0%,
  100% {
    -webkit-mask-position: 100% 120%;
    /* Start empty, shifted right */
    mask-position: 100% 120%;
  }

  50% {
    -webkit-mask-position: -100% -20%;
    /* Completely full, shifted left */
    mask-position: -100% -20%;
  }
}

/* Brand name */
.loader-brand {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
  animation: loader-brand-in 0.8s ease-out both;
  animation-delay: 0.3s;
  opacity: 0;
}

@keyframes loader-brand-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dynamic message */
.loader-message {
  font-size: 0.9rem;
  color: #8b949e;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
  min-height: 1.4em;
  transition: opacity 0.4s ease;
}

/* Progress bar track */
.loader-progress-track {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #34d399, #10b981);
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Shimmer on progress bar */
.loader-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: loader-shimmer 1.5s ease-in-out infinite;
}

@keyframes loader-shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Fade out the entire loading screen smoothly */
#loadingScreen.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* App Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
}

@media (min-width: 768px) {
  .app-layout {
    flex-direction: row;
  }
}

/* Screen Management */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: var(--bg-app);
}

/* --- MODERN LOGIN REDESIGN (Linear/Startup Style) --- */
.full-page-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background-color: #0d1117;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow-y: auto;
  color: #fff;
}

.login-container {
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  width: 100%;
  gap: 4rem;
  align-items: center;
  margin: auto;
}

@media (min-width: 992px) {
  .login-container {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
  }
}

/* LEFT SECTION: Branding */
.login-info {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  padding: 1rem;
}

.login-logo-container {
  display: inline-block;
  position: relative;
  margin-bottom: 0.5rem;
}

.login-hero-logo {
  max-width: 320px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 15px 35px rgba(0, 255, 135, 0.25));
  position: relative;
  z-index: 2;
  animation: float-logo 4s ease-in-out infinite;
}

@keyframes float-logo {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.sparkle-star {
  position: absolute;
  width: 28px;
  height: 28px;
  color: #34d399;
  /* Green accent */
  z-index: 1;
  opacity: 0;
  animation: pop-sparkle 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.8));
}

.star-1 {
  top: -10%;
  right: 15%;
  animation-delay: 0s;
}

.star-2 {
  bottom: 10%;
  left: -5%;
  width: 20px;
  height: 20px;
  animation-delay: 1.2s;
}

.star-3 {
  top: 40%;
  right: -10%;
  width: 24px;
  height: 24px;
  animation-delay: 2.5s;
}

@keyframes pop-sparkle {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }

  50% {
    transform: scale(1) rotate(45deg);
    opacity: 1;
  }

  100% {
    transform: scale(0) rotate(90deg);
    opacity: 0;
  }
}

/* Mobile specific scaling for login logo */
@media (max-width: 991px) {
  .login-container {
    gap: 1.5rem;
  }

  .login-hero-logo {
    max-width: 180px;
  }

  .sparkle-star {
    transform: scale(0.6);
  }

  .star-1 {
    transform: scale(0.6) translate(-10px, 10px);
  }

  .star-2 {
    transform: scale(0.6) translate(10px, -10px);
  }

  .star-3 {
    transform: scale(0.6) translate(-5px, -5px);
  }
}

.brand-hero .tagline {
  font-size: 1.5rem;
  color: #8b949e;
  margin-bottom: 3rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 450px;
}

.feature-item {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  text-align: left;
}

.feature-icon-minimal {
  width: 44px;
  height: 44px;
  background: rgba(0, 255, 135, 0.08);
  border: 1px solid rgba(0, 255, 135, 0.15);
  border-radius: 12px;
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.feature-item:hover .feature-icon-minimal {
  background: rgba(0, 255, 135, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 255, 135, 0.2);
}

.feature-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
  color: #f0f6fc;
  font-weight: 600;
}

.feature-item p {
  font-size: 0.95rem;
  color: #8b949e;
  line-height: 1.5;
}

/* RIGHT SECTION: Glassmorphism Card */
.login-card-right.minimalist-login {
  flex: 1;
  max-width: 440px;
  width: 100%;
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

/* Card Glow Effect */
.login-card-right.minimalist-login::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at center, rgba(0, 255, 135, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.total-users-badge {
  background: rgba(0, 255, 135, 0.08);
  color: #34d399;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 auto 2rem auto;
  border: 1px solid rgba(0, 255, 135, 0.15);
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #34d399;
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  background-color: #34d399;
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse-ring-new 2s cubic-bezier(0.25, 0, 0, 1) infinite;
}

@keyframes pulse-ring-new {
  0% {
    transform: scale(0.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.login-card-right h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.login-card-right .subtitle {
  font-size: 1rem;
  color: #8b949e;
  margin-bottom: 2.5rem;
  line-height: 1.5;
}

/* Terms Checkbox Customization */
.tos-agreement {
  margin-bottom: 1.5rem;
  text-align: center;
  display: flex;
  justify-content: center;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #8b949e;
  position: relative;
  user-select: none;
}

/* Hide default checkbox */
.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Custom Checkmark Base */
.checkmark {
  height: 20px;
  width: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.checkbox-container:hover .checkmark {
  border-color: rgba(0, 255, 135, 0.4);
  background: rgba(0, 255, 135, 0.05);
}

.checkbox-container input:checked~.checkmark {
  background: #34d399;
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.3);
}

.checkmark:after {
  content: "";
  display: none;
  width: 5px;
  height: 10px;
  border: solid #000;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.checkbox-container input:checked~.checkmark:after {
  display: block;
}

.tos-agreement a {
  color: #34d399;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.tos-agreement a:hover {
  filter: brightness(1.2);
  text-decoration: underline;
}

/* Login Button */
#loginBtn.primary-btn {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: #000;
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 0 0 rgba(0, 255, 135, 0);
}

#loginBtn.primary-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 255, 135, 0.4);
  filter: brightness(1.1);
}

#loginBtn.primary-btn:not(:disabled):active {
  transform: translateY(0);
}

#loginBtn.primary-btn:disabled {
  background: #30363d;
  color: #8b949e;
  cursor: not-allowed;
  opacity: 0.7;
}

.login-disclaimer {
  font-size: 0.75rem;
  color: #484f58;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* Mobile Adjustments */
@media (max-width: 991px) {
  .full-page-screen {
    padding: 1.5rem;
  }

  .login-container {
    gap: 3rem;
    text-align: center;
  }

  .login-info {
    text-align: center;
    align-items: center;
  }
}

/* Card Styles */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Hero/Login Card */
.hero {
  width: 100%;
  text-align: center;
}

/* Dashboard Grid */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.section-divider {
  border: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  margin: var(--sp-2) 0;
  border-radius: 2px;
  opacity: 0.8;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5), 0 0 20px rgba(52, 211, 153, 0.3);
  flex-shrink: 0;
}

/* Horizontal 3-Column on PC */
@media (min-width: 1024px) {
  .dashboard-grid {
    flex-direction: row;
    align-items: stretch;
  }

  .dashboard-card {
    flex: 1;
    min-width: 0;
    /* Prevent flex blowout */
  }

  .section-divider {
    height: auto;
    width: 2px;
    margin: 0 var(--sp-2);
    background: linear-gradient(180deg, transparent 0%, var(--accent) 50%, transparent 100%);
  }
}

.dashboard-card {
  min-height: 180px;
}

.welcome-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(0, 255, 135, 0.04) 100%);
  border: 1px solid var(--border-color);
}

.stats-row {
  display: flex;
  gap: var(--sp-6);
  margin: var(--sp-6) 0;
  justify-content: center;
}

.stat-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-lbl {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Buttons */
.primary-btn {
  background-color: var(--accent-dark);
  color: #fff;
  border: none;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn:hover {
  background-color: var(--accent);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 200, 83, 0.25);
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.danger-btn {
  background: rgba(248, 81, 73, 0.08);
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.15);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.danger-btn:hover {
  background: rgba(248, 81, 73, 0.15);
}

/* Chat Layout */
.chat-layout {
  height: 100%;
  width: 100%;
}

.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-surface);
  border-radius: 18px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Chat Topbar */
.chat-topbar {
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  background: var(--bg-surface);
}

.chat-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Standardize header buttons */
.chat-controls .danger-btn,
.chat-controls .secondary-btn,
.chat-controls .game-chat-btn {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sp-4);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  margin: 0;
  white-space: nowrap;
}

.partner-display {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.partner-avatar img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

/* Chat Messages Area */
.chat-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background-color: var(--bg-app);
}

/* Messages */
.message-row {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  max-width: 78%;
  animation: msgFadeIn 0.3s ease-out both;
}

@keyframes msgFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-row.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row.them {
  align-self: flex-start;
}

/* Message Bubbles — Soft & Friendly */
.message-bubble {
  padding: var(--sp-3) var(--sp-4);
  border-radius: 18px;
  word-wrap: break-word;
  max-width: 420px;
  position: relative;
  font-size: 0.93rem;
  line-height: 1.6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s ease;
}

.message-bubble:hover {
  transform: scale(1.01);
}

@media (min-width: 1024px) {
  .message-bubble {
    max-width: 500px;
  }
}

@media (min-width: 1440px) {
  .message-bubble {
    max-width: 420px;
  }
}

.me .message-bubble {
  background-color: var(--chat-bubble-me);
  color: var(--chat-text-me);
  border-bottom-right-radius: 6px;
}

.them .message-bubble {
  background-color: var(--chat-bubble-them);
  color: var(--chat-text-them);
  border-bottom-left-radius: 6px;
}

.msg-avatar {
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
  color: var(--text-muted);
  opacity: 0.7;
}

.message-time {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin: 0 var(--sp-2);
  align-self: center;
  opacity: 0.7;
}

/* Chat Input Bar — Soft & Rounded */
.chat-input-bar {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}

.chat-input-bar input {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  border-radius: 22px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 0.93rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-input-bar input::placeholder {
  color: var(--text-muted);
}

.chat-input-bar input:focus {
  outline: none;
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
  background: var(--bg-surface);
}

/* Mobile Menu */
.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--sp-2);
  position: relative;
}

.mobile-menu-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: white;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 14px;
  text-align: center;
}

/* Send Button — Friendly & Minimal */
.send-btn {
  background: var(--accent-muted);
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: all 0.2s ease;
}

.send-btn svg {
  width: 20px;
  height: 20px;
}

.send-btn:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.send-btn:active {
  transform: scale(0.97);
}

/* Mini-Games Button — Noticeable & Playful */
.game-chat-btn {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.game-chat-btn:hover {
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

.game-chat-btn:active {
  transform: scale(0.97);
}

.send-btn:disabled {
  color: var(--text-secondary);
  cursor: default;
}

.recording-pulse {
  color: #ff4444 !important;
  animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

input,
select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: inherit;
}

#programSearch {
  margin-bottom: 0.5rem;
}

#department {
  max-height: 300px;
  overflow-y: auto;
}

#department optgroup {
  font-weight: 600;
  color: var(--primary-color);
  padding: 0.5rem 0;
}

#department option {
  padding: 0.5rem;
  cursor: pointer;
}

#department option:hover {
  background: var(--bg-surface-hover);
}

#department option:checked {
  background: var(--primary-color) !important;
  color: white !important;
}

#department:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

#programSearch:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* UID Display */
.uid-display {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.uid-display input {
  flex: 1;
  background: var(--bg-surface);
  cursor: text;
}

.copy-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.copy-btn svg {
  display: block;
}

/* AVATAR CSS FIX - Replace lines 638-666 in styles.css with this */
/* 6 avatars per row on both mobile and desktop, spanning full width */

/* Avatar Selection */
.avatar-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 1rem !important;
  width: 100% !important;
  max-width: 700px !important;
  margin: 0 auto !important;
}

@media (max-width: 768px) {
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

.avatar-option {
  cursor: pointer;
  border: 2.5px solid transparent;
  border-radius: 12px;
  padding: 4px;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.03);
}

.avatar-option:hover {
  transform: scale(1.1);
  border-color: rgba(137, 114, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.avatar-option.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(137, 114, 255, 0.3);
  background: rgba(137, 114, 255, 0.1);
}

.avatar-option img {
  width: 100% !important;
  aspect-ratio: 1 !important;
  border-radius: 8px;
  display: block !important;
  object-fit: cover;
}

/* Queue Screen */
.center-card {
  max-width: 400px;
  margin: auto;
  text-align: center;
}

.loader-anim {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bg-surface-hover);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.queue-timer {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 1rem 0;
  color: var(--accent);
}

.queue-hint {
  min-height: 2.8rem;
  margin: 1rem 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  transition: opacity 0.3s ease;
  padding: 0 1rem;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
}



/* Credits Modern Wrapper */
.credits-modern-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  animation: fadeIn 0.6s ease-out;
}

/* Credits Hero */
.credits-hero {
  position: relative;
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  overflow: hidden;
  border-radius: 20px;
}

.hero-bg-anim {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.04) 0%, transparent 65%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.app-logo-large {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-5);
  background: var(--accent-dark);
  color: white;
  padding: 1rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.credits-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.version-tag {
  font-size: 0.78rem;
  vertical-align: middle;
  padding: 0.15rem 0.55rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  color: var(--text-muted);
  margin-left: 0.4rem;
  font-weight: 500;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: var(--sp-2);
}

/* Credits Grid */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--sp-5);
  width: 100%;
}

.credits-card-modern {
  padding: var(--sp-6);
  border-radius: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.credits-card-modern:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(52, 211, 153, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--sp-4);
}

.card-icon {
  font-size: 1.25rem;
}

.credits-card-modern h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.credits-card-modern p {
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.9rem;
}

/* Tech Pills — Soft Minimal */
.tech-stack-minimal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--sp-5);
  justify-content: flex-start;
}

.tech-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.tech-pill:hover {
  background: var(--accent-muted);
  border-color: rgba(52, 211, 153, 0.15);
  color: var(--accent);
}

/* Project Info */
.project-info {
  text-align: left;
  display: flex;
  flex-direction: column;
}

.project-info .card-header {
  justify-content: flex-start;
  width: 100%;
}

.project-info p {
  width: 100%;
  max-width: 850px;
}

/* Dev Profile */
.dev-profile {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dev-avatar-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto var(--sp-5);
}

.dev-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border: 3px solid var(--bg-surface);
  box-shadow: var(--shadow-md);
}

.dev-avatar-glow {
  display: none;
}

.dev-info-modern {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dev-role {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: var(--sp-3);
}

.dev-tags {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.dev-tag {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.social-links-modern {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  width: 100%;
}

.social-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-2px);
  color: white;
  box-shadow: var(--shadow-sm);
}

.social-icon.facebook:hover {
  background: #1877f2;
  border-color: #1877f2;
}

.social-icon.linkedin:hover {
  background: #0077b5;
  border-color: #0077b5;
}

.social-icon.email:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* Acknowledgments */
.acknowledgments {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.acknowledgments .card-header {
  justify-content: center;
  width: 100%;
}

.acknowledgments p {
  width: 100%;
  max-width: 550px;
  margin: 0 auto var(--sp-4);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
}

.credits-bottom-text {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .credits-hero h1 {
    font-size: 1.8rem;
  }

  .credits-grid {
    grid-template-columns: 1fr;
  }

  .credits-modern-wrapper {
    padding: var(--sp-3);
  }
}

/* Wide card variant */
.card.wide {
  max-width: 900px;
  margin: 0 auto;
}

/* Forum Post Styles */
.forum-post {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.forum-post:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.post-info {
  flex: 1;
}

.post-author {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.post-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.post-content {
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 0.95rem;
  word-wrap: break-word;
}

.post-reactions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.reaction-btn {
  background: rgba(160, 160, 160, 0.15);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.reaction-btn:hover {
  background: rgba(160, 160, 160, 0.25);
  border-color: var(--text-primary);
}

.reaction-btn.reacted {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.delete-post-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
  margin-left: auto;
}

.delete-post-btn:hover {
  background: rgba(220, 53, 69, 0.1);
}

/* Forum Header with Sorting */
.forum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.forum-header h2 {
  margin: 0;
}

.sort-dropdown {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  max-width: 140px;
}

.sort-dropdown:hover {
  border-color: var(--primary-color);
}

/* Post User Details */
.post-user-details {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Comments Section */
.post-comments-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.comment-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.comment-input {
  flex: 1;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.comment-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.comment-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-item {
  background: var(--bg-app);
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 2px solid var(--primary-color);
}

.comment-author {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.comment-text {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Load More Styles */
.load-more-container {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
  margin-top: 1rem;
}

.load-more-btn {
  padding: 0.75rem 2rem;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Mini Post Form (Home Screen) */
.mini-post-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mini-post-form .sm-btn {
  align-self: stretch;
  width: 100%;
  min-width: 100px;
}

.mini-post-form textarea {
  flex: 1;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: inherit;
  resize: none;
  min-height: 60px;
  font-size: 0.9rem;
}

.mini-post-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.sm-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

/* Secondary Button */
.secondary-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--primary-color);
}

.sm-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Mini Feed */
.mini-feed {
  max-height: 400px;
  overflow-y: auto;
}

.mini-feed .forum-post {
  padding: 1rem;
  font-size: 0.9rem;
}

.mini-feed .post-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
}

/* Form Row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 767px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Chat History Styles */
.history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.history-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
}

.history-nickname {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.history-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Floating Notification — Samsung/Apple Style */
.toast-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 10000;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  background: rgba(24, 29, 39, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.7rem 1.2rem;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
  animation: toastDropIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.toast-success {
  --toast-accent: #34d399;
}

.toast-error {
  --toast-accent: #f87171;
}

.toast-warning {
  --toast-accent: #fbbf24;
}

.toast-info {
  --toast-accent: #60a5fa;
}

.toast-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.toast-text {
  color: #f0f4f8;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
  flex: 1;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--toast-accent, var(--accent));
  width: 100%;
  transform-origin: left;
  animation: toastProgress 4s linear forwards;
  border-radius: 0 0 100px 100px;
  opacity: 0.6;
}

@keyframes toastDropIn {
  from {
    transform: translateY(-100%) scale(0.85);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastFadeOut {
  to {
    transform: translateY(-30%) scale(0.9);
    opacity: 0;
  }
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

.toast-fade-out {
  animation: toastFadeOut 0.35s ease forwards;
}

/* Global Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--sp-5);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Chat History Modal */
.chat-history-modal .modal-content.messenger-style {
  max-width: 700px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.chat-history-modal .messenger-header {
  background: var(--bg-surface);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-color);
}

.chat-history-modal .header-text h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0;
}

.chat-history-modal .messenger-body {
  background: transparent;
  padding: var(--sp-5);
}

.chat-history-modal .message-bubble {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
}

.chat-history-modal .message-wrapper.sent .message-bubble {
  background: var(--chat-bubble-me);
  border-bottom-right-radius: 4px;
}

.chat-history-modal .message-wrapper.received .message-bubble {
  background: var(--chat-bubble-them);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}

.chat-history-modal .modal-close {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.chat-history-modal .modal-close:hover {
  background: rgba(244, 67, 54, 0.15);
  color: #ff5252;
}

@media (max-width: 767px) {
  .chat-history-modal .modal-content.messenger-style {
    max-height: 92vh;
  }

  .message-wrapper {
    max-width: 85%;
  }
}

/* Messenger Features */

/* Context Banner (Reply/Edit Preview) */
.context-banner {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.context-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.context-title {
  font-weight: 600;
  color: var(--primary-color);
}

.context-text {
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.context-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.5rem;
}

.context-close-btn:hover {
  color: var(--text-primary);
}

/* Quotes in Messages */
.reply-quote {
  background: rgba(0, 0, 0, 0.05);
  /* Lighter background */
  border-left: 3px solid var(--primary-color);
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
  opacity: 0.7;
  /* Lower opacity for the whole quote block to highlight main message */
}

/* Chat Heads */
.chat-head-container {
  width: 35px;
  height: 35px;
  margin-right: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  /* Align avatar to bottom of message? Or top? Usually bottom in Messenger */
}

.chat-head-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Message Status */
.message-status {
  font-size: 0.7rem;
  margin-top: 2px;
  text-align: right;
  display: block;
}

.me .message-status {
  margin-right: 4px;
}

.them .message-status {
  display: none;
  /* Only show status for own messages */
}

.status-seen {
  color: var(--primary-color);
  font-weight: 500;
}

.status-delivered {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Message Reactions */
.message-reaction-indicator {
  position: absolute;
  bottom: -16px;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 0.8rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 5;
  display: flex;
  gap: 4px;
}

.me .message-reaction-indicator {
  left: 0;
  right: auto;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Action Menu Buttons */
.action-btn {
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  padding: 0.2rem 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Matchmaking Filters */
.year-level-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: var(--bg-surface-hover);
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
}

.me .reply-quote {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: white;
}

.reply-label {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 2px;
}

.quote-text {
  opacity: 0.9;
  /* Relative to the already opaque container */
  overflow-wrap: break-word;
  word-break: break-word;
  font-style: italic;
}

/* Edit Features */
.edited-tag {
  font-size: 0.7rem;
  font-style: italic;
  opacity: 0.7;
  margin-left: 0.5rem;
  cursor: help;
}

/* Message Actions Menu */
.message-actions-btn {
  opacity: 0;
  transition: opacity 0.2s;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 0.5rem;
  align-self: center;
  color: var(--text-secondary);
}

.message-row:hover .message-actions-btn {
  opacity: 1;
}

.message-actions-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--primary-color);
}

/* Adjust message row to accommodate actions */
.message-row {
  position: relative;
  /* For positioning */
}

/* Mobile: Always show or handle via long press logic in JS, 
   but for now we depend on hover or click. 
   On mobile, hover is sticky, so clicking the space might work. 
   Ideally we just make it visible on tap.
*/

/* Hideable Banners CSS */
.banner-dismissible {
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  max-height: 500px;
  /* arbitrary large max-height for transition */
}

.banner-dismissible.anim-collapse {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  opacity: 0;
  border-width: 0;
}

/* =============================================
   ANNOUNCEMENTS (Glassmorphism)
   ============================================= */
.announcement-card {
  background: rgba(25, 30, 36, 0.4);
  /* Translucent dark */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

/* =============================================
   ACCORDIONS
   ============================================= */
.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding-bottom: 0.5rem;
}

.accordion-arrow {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.3s ease;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accordion-arrow.rotated {
  transform: rotate(-90deg);
  /* points right when collapsed */
}

.accordion-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  max-height: 2000px;
  /* large enough for content */
  opacity: 1;
}

.accordion-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border: none;
}

.announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.announcement-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(0, 255, 135, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.announcement-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.announcement-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.announcement-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.announcement-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.announcement-delete-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 68, 68, 0.1);
  color: #ff4444;
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.announcement-delete-btn:hover {
  background: rgba(255, 68, 68, 0.25);
}

.dismiss-btn {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  background: rgba(255, 255, 255, 0.15);
  /* Make more visible */
  border: none;
  color: #fff;
  /* Brighter color */
  width: 32px;
  /* Increase hit area */
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  /* Larger icon */
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.dismiss-btn:hover {
  background: var(--danger);
  color: #fff;
  transform: scale(1.1);
}

.chat-wrapper {
  position: relative;
  /* For context banner to sit at bottom of scroll area or top of input */
}


/* Message Content Wrapper (Column for Bubble + Time) */
.message-content-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.me .message-content-wrapper {
  align-items: flex-end;
}

.them .message-content-wrapper {
  align-items: flex-start;
}

/* Update Message Time positioning */
.message-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
  opacity: 0.7;
  padding: 0 4px;
}

/* Nav Badge */
.nav-badge {
  background: #ff4d4d;
  /* Bright red */
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Friends Screen */
.friends-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  background: var(--bg-surface);
  border-radius: 24px;
}

.friends-header {
  margin-bottom: 2rem;
}

.friends-tabs {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  position: relative;
  transition: color 0.2s;
}

.tab-btn.active {
  color: var(--primary-color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-color);
}

.tab-badge {
  background: #ff4d4d;
  color: white;
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface-hover);
  border-radius: 16px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.friend-item:hover {
  border-color: var(--primary-color);
  transform: translateX(5px);
}

.friend-avatar {
  position: relative;
}

.friend-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.status-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface-hover);
}

.status-online {
  background: #4caf50;
  box-shadow: 0 0 8px #4caf50;
}

.status-offline {
  background: #9e9e9e;
}

.friend-info {
  flex: 1;
}

.friend-name {
  font-weight: 600;
  color: var(--text-primary);
}

.friend-status-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.friend-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Messages Screen */
/* Messages Screen Unified Layout */
.messages-layout {
  display: flex;
  height: calc(100vh - 4rem);
  gap: 0;
  padding: 0;
  margin: 1rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {

  /* Fix the sections themselves to the viewport on mobile */
  #chatScreen.active,
  #messagesScreen.active {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    height: calc(100dvh - 60px) !important;
    z-index: 100 !important;
    background: var(--bg-app) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  /* Ensure the children fill the fixed section exactly */
  .chat-wrapper,
  .messages-layout {
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .private-message-area,
  .pm-chat-container {
    height: 100% !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
  }

  /* Force body and main-content to not scroll when full-height screens are active on mobile */
  body:has(#chatScreen.active),
  body:has(#messagesScreen.active) {
    overflow: hidden !important;
  }

  /* Compact padding for chat areas on mobile */
  .chat-scroll-area,
  .pm-messages {
    padding: 0.75rem 0.5rem !important;
  }

  .chat-topbar,
  .pm-header {
    padding: 0.6rem 0.75rem !important;
  }

  .chat-input-bar,
  .pm-input-bar {
    padding: 0.6rem 0.75rem !important;
  }
}

.messages-sidebar {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 0;
  z-index: 10;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .messages-sidebar {
    flex: 1;
    width: 100%;
    max-width: 100%;
    border-right: none;
    height: 100%;
  }

  .messages-sidebar.hidden-mobile {
    display: none !important;
  }
}

.messages-sidebar h3 {
  padding: 0 1.5rem;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.private-chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 0.75rem;
  gap: 0.5rem;
}

.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-thread-item:hover {
  background: var(--bg-surface-hover);
}

.chat-thread-item.active {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid var(--primary-color);
}

.thread-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.thread-info {
  flex: 1;
  min-width: 0;
}

.thread-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-last-msg {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.thread-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.thread-badge {
  background: #ff4d4d;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.5);
}

.private-message-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  min-width: 0;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .private-message-area.hidden-mobile {
    display: none;
  }
}

/* Centered Empty States */
.empty-state,
.no-selection {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  gap: 1rem;
}

.no-selection-icon {
  font-size: 4rem;
  opacity: 0.3;
  animation: float 3s ease-in-out infinite;
}

/* PM Chat Instance */
.pm-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: transparent;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.pm-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  width: 100%;
}

.pm-messages {
  flex: 1;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-app);
  width: 100%;
  min-height: 0;
}

/* Desktop: Balanced padding for readability */
@media (min-width: 1024px) {
  .pm-messages {
    padding: 2rem 2rem;
  }
}

@media (min-width: 1920px) {
  .pm-messages {
    padding: 2rem 3rem;
  }
}

.pm-input-bar {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  background: var(--bg-surface);
  flex-shrink: 0;
  width: 100%;
}

.pm-input-bar input {
  flex: 1;
  min-width: 0;
}

/* Remove extra padding on desktop for edge-to-edge */
@media (min-width: 1024px) {
  .pm-input-bar {
    padding: 1rem;
  }
}

@media (min-width: 1920px) {
  .pm-input-bar {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .messages-layout {
    flex-direction: column;
  }

  .messages-sidebar {
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    flex: 0 0 auto;
  }

  .private-message-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
  }

  .pm-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
  }

  .pm-messages {
    padding: 1rem 0.5rem;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }

  .pm-input-bar {
    position: relative !important;
    bottom: auto;
    left: auto;
    right: auto;
    padding: 0.75rem;
    z-index: 10;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
  }

  .pm-input-bar input {
    font-size: 16px;
    /* Prevents iOS zoom on focus */
    min-height: 44px;
    /* Better touch target */
    -webkit-appearance: none;
    appearance: none;
  }

  .pm-input-bar button {
    min-width: 44px;
    /* Better touch target */
    min-height: 44px;
  }
}

/* Mobile Visibility Helpers */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.back-btn svg {
  width: 24px;
  height: 24px;
}

/* Typing Indicator - Chat Bubble Style */
.typing-indicator-message {
  animation: fadeIn 0.3s ease-in;
}

.typing-bubble {
  background-color: var(--chat-bubble-them) !important;
  padding: 1rem 1.25rem !important;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 60px;
  animation: bubbleWave 1.2s ease-in-out infinite;
}

.typing-bubble span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  display: inline-block;
  animation: typingDot 1.4s infinite ease-in-out;
}

.typing-bubble span:nth-child(1) {
  animation-delay: 0s;
}

.typing-bubble span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-bubble span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

@keyframes bubbleWave {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

/* Swipe-to-Reply Icon */
.swipe-reply-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 5;
}

.swipe-reply-icon svg {
  width: 100%;
  height: 100%;
  color: var(--primary-color);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Message Row Swipe Transform */
.message-row {
  position: relative;
  will-change: transform;
}

/* Minimalist Message Actions Button */
.message-actions-btn {
  opacity: 0;
  transition: opacity 0.2s;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 0.25rem;
  align-self: center;
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.message-row:hover .message-actions-btn {
  opacity: 1;
}

.message-actions-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

/* Action Menu - Minimalist Design */
.action-menu {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: background 0.2s;
}

.action-btn:hover {
  background: var(--bg-surface-hover);
}

.action-btn svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.action-btn:hover svg {
  color: var(--primary-color);
}

/* Reaction Bar - Minimalist */
.reaction-bar {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
  justify-content: space-around;
  border-top: 1px solid var(--border-color);
  margin-top: 0.25rem;
}

.reaction-bar button {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 8px;
  transition: all 0.2s;
  opacity: 0.7;
}

.reaction-bar button:hover {
  background: var(--bg-surface-hover);
  opacity: 1;
  transform: scale(1.2);
}

/* ============================================
   PROMO CARD
   ============================================ */
.promo-card {
  position: relative;
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(233, 30, 99, 0.08) 100%);
  border: 1px solid rgba(233, 30, 99, 0.2);
  text-align: center;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.promo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(233, 30, 99, 0.15);
}

.promo-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.promo-card p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.promo-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #E91E63, #FF5722);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.promo-btn {
  display: block;
  width: 100% !important;
  text-decoration: none;
  text-align: center;
  background: linear-gradient(135deg, #E91E63, #FF5722);
  transition: all 0.3s ease;
  margin-top: 1rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  color: white;
  box-sizing: border-box;
}

.promo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
}

/* ============================================
   BUG REPORT
   ============================================ */
.bug-report-btn {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  width: 100% !important;
  padding: 0.85rem 2rem;
  box-sizing: border-box;
  transition: all 0.2s;
}

.bug-report-btn:hover {
  opacity: 1;
}

.bug-contact-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bug-contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.bug-contact-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.bug-contact-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.bug-contact-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.bug-contact-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

/* ============================================
   COMPACT MOBILE LOGIN
   ============================================ */
@media (max-width: 767px) {
  .full-page-screen {
    padding: 0.5rem;
    align-items: center;
  }

  .login-card-right.card.hero {
    padding: 1.25rem;
  }

  .capybara {
    height: 90px;
    margin-bottom: 1rem;
  }

  .login-card-right h2 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
  }

  .login-card-right .subtitle {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .tos-agreement {
    margin-bottom: 0.75rem;
  }
}

/* ============================================
   PAGE TRANSITION & CONTENT ANIMATIONS
   ============================================ */

/* Screen fade-slide-in on navigation */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.active.animate-in {
  animation: fadeSlideIn 0.35s ease-out both;
}

/* Staggered entrance for content elements */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dashboard cards stagger */
.animate-in .dashboard-card:nth-child(1) {
  animation: fadeUp 0.4s ease-out 0.05s both;
}

.animate-in .dashboard-card:nth-child(2) {
  animation: fadeUp 0.4s ease-out 0.15s both;
}

.animate-in .dashboard-card:nth-child(3) {
  animation: fadeUp 0.4s ease-out 0.25s both;
}

.animate-in .dashboard-card:nth-child(4) {
  animation: fadeUp 0.4s ease-out 0.35s both;
}

/* Forum posts stagger */
.animate-in .forum-post:nth-child(1) {
  animation: fadeUp 0.35s ease-out 0.05s both;
}

.animate-in .forum-post:nth-child(2) {
  animation: fadeUp 0.35s ease-out 0.10s both;
}

.animate-in .forum-post:nth-child(3) {
  animation: fadeUp 0.35s ease-out 0.15s both;
}

.animate-in .forum-post:nth-child(4) {
  animation: fadeUp 0.35s ease-out 0.20s both;
}

.animate-in .forum-post:nth-child(5) {
  animation: fadeUp 0.35s ease-out 0.25s both;
}

.animate-in .forum-post:nth-child(6) {
  animation: fadeUp 0.35s ease-out 0.30s both;
}

.animate-in .forum-post:nth-child(7) {
  animation: fadeUp 0.35s ease-out 0.35s both;
}

.animate-in .forum-post:nth-child(8) {
  animation: fadeUp 0.35s ease-out 0.40s both;
}

.animate-in .forum-post:nth-child(9) {
  animation: fadeUp 0.35s ease-out 0.45s both;
}

.animate-in .forum-post:nth-child(10) {
  animation: fadeUp 0.35s ease-out 0.50s both;
}

/* Stats cards stagger */
.animate-in .stat-card:nth-child(1) {
  animation: fadeUp 0.4s ease-out 0.1s both;
}

.animate-in .stat-card:nth-child(2) {
  animation: fadeUp 0.4s ease-out 0.2s both;
}

.animate-in .stat-card:nth-child(3) {
  animation: fadeUp 0.4s ease-out 0.3s both;
}

.animate-in .stat-card:nth-child(4) {
  animation: fadeUp 0.4s ease-out 0.4s both;
}

/* Friend items stagger */
.animate-in .friend-item:nth-child(1) {
  animation: fadeUp 0.3s ease-out 0.05s both;
}

.animate-in .friend-item:nth-child(2) {
  animation: fadeUp 0.3s ease-out 0.10s both;
}

.animate-in .friend-item:nth-child(3) {
  animation: fadeUp 0.3s ease-out 0.15s both;
}

.animate-in .friend-item:nth-child(4) {
  animation: fadeUp 0.3s ease-out 0.20s both;
}

.animate-in .friend-item:nth-child(5) {
  animation: fadeUp 0.3s ease-out 0.25s both;
}

/* History items stagger */
.animate-in .history-item:nth-child(1) {
  animation: fadeUp 0.3s ease-out 0.05s both;
}

.animate-in .history-item:nth-child(2) {
  animation: fadeUp 0.3s ease-out 0.10s both;
}

.animate-in .history-item:nth-child(3) {
  animation: fadeUp 0.3s ease-out 0.15s both;
}

.animate-in .history-item:nth-child(4) {
  animation: fadeUp 0.3s ease-out 0.20s both;
}

.animate-in .history-item:nth-child(5) {
  animation: fadeUp 0.3s ease-out 0.25s both;
}

/* Credits cards stagger */
.animate-in .credits-card-modern:nth-child(1) {
  animation: fadeUp 0.45s ease-out 0.1s both;
}

.animate-in .credits-card-modern:nth-child(2) {
  animation: fadeUp 0.45s ease-out 0.25s both;
}

.animate-in .credits-card-modern:nth-child(3) {
  animation: fadeUp 0.45s ease-out 0.4s both;
}

/* Profile card entrance */
.animate-in .profile-card {
  animation: fadeUp 0.4s ease-out 0.05s both;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

  .screen.active.animate-in,
  .animate-in .dashboard-card,
  .animate-in .forum-post,
  .animate-in .stat-card,
  .animate-in .friend-item,
  .animate-in .history-item,
  .animate-in .credits-card-modern,
  .animate-in .profile-card,
  .anim-hidden,
  .anim-visible {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================
   SCROLL-TRIGGERED LAZY-LOAD ANIMATIONS
   (Used by animations.js IntersectionObserver)
   ============================================ */
@keyframes lazyFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.anim-hidden {
  opacity: 0;
  transform: translateY(24px) scale(0.97);
}

.anim-visible {
  animation: lazyFadeUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* ====== ANNOUNCEMENTS & ADMIN ====== */

/* Announcement Cards */
.announcements-card {
  overflow: hidden;
}

.announcements-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.announcements-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.announcement-card {
  position: relative;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  border-left: 4px solid;
  background: var(--bg-surface-hover);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: announcement-slide-in 0.3s ease-out both;
}

.announcement-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Type-based colors */
.announcement-info {
  border-left-color: #3b82f6;
}

.announcement-update {
  border-left-color: #8b5cf6;
}

.announcement-warning {
  border-left-color: #f59e0b;
}

.announcement-event {
  border-left-color: #10b981;
}

.announcement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.announcement-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.announcement-info .announcement-badge {
  color: #3b82f6;
}

.announcement-update .announcement-badge {
  color: #8b5cf6;
}

.announcement-warning .announcement-badge {
  color: #f59e0b;
}

.announcement-event .announcement-badge {
  color: #10b981;
}

.announcement-icon {
  font-size: 0.85rem;
}

.announcement-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.announcement-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.announcement-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.announcement-delete-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
  padding: 0.25rem;
}

.announcement-delete-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

@keyframes announcement-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Admin Form */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}

.admin-form textarea {
  min-height: 80px;
  resize: vertical;
}

.admin-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.admin-form-row select {
  flex: 1;
}

/* Admin Screen */
.admin-screen-header {
  text-align: center;
  margin-bottom: 2rem;
}

.admin-screen-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.admin-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.admin-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

@keyframes heart-pop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

.admin-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ====== FORUM REDESIGN ====== */

/* Post Creation Form */
.forum-create-post {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
}

.forum-create-post textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 60px;
}

.forum-create-post textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.forum-post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.image-upload-btn {
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.image-upload-btn:hover {
  background: var(--bg-surface);
}

.image-preview-wrapper {
  position: relative;
  display: inline-block;
  margin-top: 0.5rem;
}

.image-preview-wrapper img {
  max-height: 150px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.remove-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Post Footer (like + comment count) */
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.like-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reaction-summary {
  display: flex;
  gap: 0.25rem;
}

.reaction-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.35rem;
  background: var(--bg-surface-hover);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.comment-count-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.comment-count-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Post Image */
.post-image {
  margin-top: 0.75rem;
}

.post-image img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid var(--border-color);
}

/* Reaction Picker Popup (long-press) */
.reaction-picker-popup {
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: picker-pop-in 0.2s ease-out;
}

.picker-reaction-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 8px;
  transition: transform 0.15s, background 0.15s;
}

.picker-reaction-btn:hover {
  transform: scale(1.3);
  background: var(--bg-surface-hover);
}

.picker-reaction-btn.reacted {
  background: rgba(76, 175, 80, 0.15);
}

@keyframes picker-pop-in {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ====== POST DETAIL MODAL ====== */

.post-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.post-detail-modal.hidden {
  display: none !important;
}

.post-detail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.post-detail-panel {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modal-slide-up 0.3s ease-out;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-modal-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1;
}

.close-modal-btn:hover {
  background: var(--border-color);
}

/* ====== SEARCH MODAL ====== */
.search-panel {
  background: var(--bg-app);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
}

.search-header input::placeholder {
  color: var(--text-muted);
}

.search-tabs {
  display: flex;
  overflow-x: auto;
}

.search-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.search-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.search-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--bg-surface-hover);
}

.search-result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Modal post content */
.modal-post .post-header {
  margin-bottom: 1rem;
}

.modal-post .post-content {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-color);
}

.mention {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 4px;
  transition: all 0.2s;
}

.mention:hover {
  background: var(--accent-subtle);
  text-decoration: underline;
}

.modal-reactions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

/* ====== THREADED COMMENTS ====== */

.comments-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.modal-comments-section .comment-form {
  margin-bottom: 1rem;
}

.comment-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  animation: comment-fade-in 0.25s ease-out;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.comment-reply {
  margin-left: 2.5rem;
}

.comment-avatar {
  flex-shrink: 0;
}

.comment-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-bubble {
  background: var(--bg-surface-hover);
  padding: 0.5rem 0.8rem;
  border-radius: 14px;
  border-top-left-radius: 4px;
}

.comment-reply .comment-bubble {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
}

.comment-author {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
  color: var(--text-primary);
}

.comment-reply-tag {
  font-size: 0.7rem;
  color: var(--primary-color);
  margin-bottom: 0.15rem;
}

.comment-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-left: 0.5rem;
}

.comment-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.comment-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.comment-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.comment-react-btn {
  font-size: 0.75rem;
}

.comment-reactions-row {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
  padding-left: 0.5rem;
}

.comment-reaction-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.3rem;
  background: var(--bg-surface-hover);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: background 0.2s;
}

.comment-reaction-badge.reacted {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.3);
}

.comment-reaction-badge:hover {
  background: var(--bg-surface);
}

@keyframes comment-fade-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Clickable post in feed */
.forum-post {
  transition: background 0.2s, transform 0.15s;
}

/* ====== PROFILE VIEW MODAL ====== */

.profile-view-panel {
  text-align: center;
  padding: 2rem;
}

.profile-view-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem auto;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-view-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-view-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.profile-view-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
}

.campus-badge {
  background: rgba(76, 175, 80, 0.1);
  color: var(--primary-color);
  border-color: rgba(76, 175, 80, 0.2);
}

.profile-view-body {
  text-align: left;
}

.profile-section {
  margin-bottom: 1.5rem;
}

.profile-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-bio {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.profile-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-hover);
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.detail-item .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.detail-item .value {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Custom Profile Pic Upload UI */
.profile-pic-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface-hover);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.profile-pic-preview-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary-color);
  position: relative;
  flex-shrink: 0;
}

.profile-pic-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-pic-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.profile-pic-preview-container:hover .remove-pic-btn {
  opacity: 1;
}

.profile-pic-actions {
  flex: 1;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Bio Textarea Styling - Matches Input Fields */
#profileForm textarea {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
}

#profileForm textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Reactor List Modal Styling - Small avatars, list layout */
.reactor-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.reactor-item:last-child {
  border-bottom: none;
}

.reactor-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.reactor-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.reactor-name {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reactor-emoji {
  font-size: 1.1rem;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   SHOP SYSTEM
═══════════════════════════════════════════════════════════ */

/* ── Nav coin display ── */
.nav-coin {
  font-size: 0.7rem;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1a1a1a;
  border-radius: 20px;
  padding: 2px 8px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
  display: inline-block;
}

/* ── Shop Container ── */
.shop-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.shop-header {
  padding: 1.5rem 0 0.5rem;
}

.shop-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.shop-title-row h2 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shop-subtitle {
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.shop-coin-display {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Daily Reward Banner ── */
.shop-reward-banner {
  border-radius: 16px;
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.shop-reward-banner.reward-ready {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(96, 165, 250, 0.15));
  border-color: #a78bfa;
  animation: reward-pulse 2s ease-in-out infinite;
}

@keyframes reward-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.3);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(167, 139, 250, 0);
  }
}

.reward-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.reward-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.reward-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.reward-text strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.reward-text span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.claim-btn {
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  color: white;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.claim-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.4);
}

/* ── Earn Coins Bar ── */
.earn-coins-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.earn-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.earn-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.earn-pill {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #a78bfa;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 500;
}

/* ── Shop Categories ── */
.shop-categories {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.shop-loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 3rem;
}

.shop-category {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shop-category-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* ── Item Grid ── */
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

@media (max-width: 480px) {
  .shop-items-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Item Card ── */
.shop-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.shop-item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.shop-item-card.owned {
  border-color: rgba(167, 139, 250, 0.4);
  background: linear-gradient(135deg, var(--bg-surface), rgba(167, 139, 250, 0.05));
}

.shop-item-card.equipped {
  border-color: #a78bfa;
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.3);
}

.shop-item-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
}

.shop-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.shop-item-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.shop-item-footer {
  width: 100%;
  display: flex;
  justify-content: center;
}

.buy-btn {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1a1a1a;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.buy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.equip-btn {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.4);
  padding: 0.45rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  width: 100%;
  transition: background 0.2s;
}

.equip-btn:hover {
  background: rgba(167, 139, 250, 0.25);
}

.equipped-btn {
  background: rgba(167, 139, 250, 0.25);
  color: #a78bfa;
  cursor: default;
}

/* ── Color Swatch Preview ── */
.color-swatch {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── Avatar Border Preview ── */
.border-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.border-preview img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Effect Preview ── */
.effect-preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--bg-app);
  border: 2px solid var(--border-color);
}

/* ═══════════════════════════════════════════════════════════
   NAME COLOR CLASSES
═══════════════════════════════════════════════════════════ */

.nc-gold {
  color: #FFD700 !important;
}

.nc-rose {
  color: #FF6B9D !important;
}

.nc-ocean {
  color: #00B4D8 !important;
}

.nc-aurora {
  background: linear-gradient(90deg, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.nc-fire {
  background: linear-gradient(90deg, #ef4444, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════
   AVATAR BORDER CLASSES
   Applied as wrapper around avatar <img> elements
═══════════════════════════════════════════════════════════ */

.avatar-border-wrapper {
  border-radius: 50%;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Neon Glow - STATIC */
.ab-glow {
  background: #00f5ff;
  box-shadow: 0 0 12px #00f5ff;
}

/* Flame Ring - STATIC */
.ab-fire {
  background: conic-gradient(#ff4500, #ff8c00, #ffd700, #ff4500);
  box-shadow: 0 0 12px #ff4500;
}

/* Rainbow - STATIC */
.ab-rainbow {
  background: conic-gradient(red, orange, yellow, green, blue, violet, red);
}

/* Galaxy - STATIC */
.ab-galaxy {
  background: conic-gradient(#1a0533, #6d28d9, #7c3aed, #4c1d95, #1a0533);
  box-shadow: 0 0 16px rgba(109, 40, 217, 0.6);
}

/* Hologram - STATIC */
.ab-hologram {
  background: conic-gradient(#ff00ff, #00ffff, #ff00ff, #00ffff);
}

/* Removed ab-spin and ab-holo-shift keyframes */

/* ── Chat head with border ── */
.chat-head-container.has-border {
  padding: 3px;
  border-radius: 50%;
}

.chat-head-container.has-border .chat-head-img {
  border-radius: 50%;
}

/* ── Forum post avatar with border ── */
.post-avatar.has-border {
  padding: 3px;
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════
   FORUM POST EFFECT CLASSES
═══════════════════════════════════════════════════════════ */

/* Sparkle - STATIC */
.forum-post.fe-sparkle {
  border: 2px solid gold !important;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* Neon - STATIC */
.forum-post.fe-neon {
  border: 2px solid #39ff14;
  box-shadow: 0 0 10px #39ff14;
}

/* Rainbow - STATIC */
.forum-post.fe-rainbow {
  border: 3px solid transparent;
  background: linear-gradient(var(--bg-surface), var(--bg-surface)) padding-box,
    conic-gradient(red, orange, yellow, green, blue, violet, red) border-box;
}

/* Holographic - STATIC */
.forum-post.fe-holographic {
  border: 2px solid #00ffff;
  background: linear-gradient(var(--bg-surface), var(--bg-surface));
}

/* VIP Gold */
.forum-post.fe-vip {
  border: 1px solid #FFD700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.forum-post.fe-vip .post-author::before {
  content: '👑 ';
}

/* ═══════════════════════════════════════════════════════════
   CHAT BUBBLE THEME CLASSES
═══════════════════════════════════════════════════════════ */

/* Pastel */
.cb-pastel.me .message-bubble {
  background: linear-gradient(135deg, #fce4ec, #e8eaf6) !important;
  color: #4a4a6a !important;
}

/* Midnight */
.cb-midnight.me .message-bubble {
  background: linear-gradient(135deg, #0d1b2a, #1b2838) !important;
  color: #e0e8f0 !important;
  border: 1px solid rgba(100, 150, 200, 0.2);
}

/* Sakura */
.cb-sakura.me .message-bubble {
  background: linear-gradient(135deg, #ffd6e7, #ffb3c6) !important;
  color: #6b2d4a !important;
}

/* Galaxy */
.cb-galaxy.me .message-bubble {
  background: linear-gradient(135deg, #1a0533, #2d1b69) !important;
  color: #e0d0ff !important;
  border: 1px solid rgba(167, 139, 250, 0.3);
  animation: cb-galaxy-shimmer 4s ease-in-out infinite;
}

@keyframes cb-galaxy-shimmer {

  0%,
  100% {
    box-shadow: inset 0 0 10px rgba(167, 139, 250, 0.1);
  }

  50% {
    box-shadow: inset 0 0 20px rgba(167, 139, 250, 0.25);
  }
}

/* Retro */
.cb-retro.me .message-bubble {
  background: #0a0a0a !important;
  color: #00ff41 !important;
  border: 2px solid #00ff41 !important;
  border-radius: 4px !important;
  font-family: 'Courier New', monospace !important;
  image-rendering: pixelated;
}

/* ═══════════════════════════════════════════════════════════
   NAME CARD EFFECT CLASSES
═══════════════════════════════════════════════════════════ */

/* Aura Glow */
.profile-view-modal.nk-glow .profile-view-card {
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.5), 0 0 60px rgba(167, 139, 250, 0.2);
  animation: nk-glow-pulse 2s ease-in-out infinite;
}

@keyframes nk-glow-pulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
  }

  50% {
    box-shadow: 0 0 40px rgba(167, 139, 250, 0.7), 0 0 80px rgba(167, 139, 250, 0.3);
  }
}

/* Confetti */
.profile-view-modal.nk-confetti .profile-view-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle, #ff6b6b 2px, transparent 2px),
    radial-gradient(circle, #ffd93d 2px, transparent 2px),
    radial-gradient(circle, #6bcb77 2px, transparent 2px),
    radial-gradient(circle, #4d96ff 2px, transparent 2px);
  background-size: 60px 60px, 80px 80px, 70px 70px, 90px 90px;
  background-position: 0 0, 30px 30px, 15px 45px, 45px 15px;
  animation: nk-confetti-fall 4s linear infinite;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.4;
}

@keyframes nk-confetti-fall {
  0% {
    background-position: 0 -60px, 30px -30px, 15px -15px, 45px -45px;
  }

  100% {
    background-position: 0 60px, 30px 90px, 15px 75px, 45px 45px;
  }
}

/* Starfield */
.profile-view-modal.nk-stars .profile-view-card {
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0d0d1a 100%) !important;
  overflow: hidden;
}

/* Flame */
.profile-view-modal.nk-fire .profile-view-card {
  border: 2px solid #ff4500;
  box-shadow: 0 0 20px #ff4500, 0 0 40px rgba(255, 69, 0, 0.3);
  animation: nk-fire-flicker 0.5s ease-in-out infinite alternate;
}

@keyframes nk-fire-flicker {
  0% {
    box-shadow: 0 0 15px #ff4500, 0 0 30px rgba(255, 69, 0, 0.3);
  }

  100% {
    box-shadow: 0 0 25px #ff8c00, 0 0 50px rgba(255, 140, 0, 0.4);
  }
}

/* Hologram */
.profile-view-modal.nk-hologram .profile-view-card {
  border: 2px solid #00ffff;
  animation: nk-holo-scan 2s linear infinite;
  overflow: hidden;
}

.profile-view-modal.nk-hologram .profile-view-card::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(0, 255, 255, 0.08), transparent);
  animation: nk-scan-line 2s linear infinite;
  pointer-events: none;
}

@keyframes nk-scan-line {
  0% {
    top: -40%;
  }

  100% {
    top: 140%;
  }
}

@keyframes nk-holo-scan {

  0%,
  100% {
    filter: hue-rotate(0deg);
    border-color: #00ffff;
  }

  50% {
    filter: hue-rotate(180deg);
    border-color: #ff00ff;
  }
}

/* Sidebar Stats */
.sidebar-stats {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sidebar-stats .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-stats .stat-value {
  font-weight: bold;
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* Shop Previews */
.preview-box {
  width: 100%;
  height: 80px;
  background: var(--bg-surface);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  border: 1px solid var(--border-color);
}

.preview-avatar-container {
  width: 60px;
  height: 60px;
  position: relative;
  border-radius: 50%;
}

.preview-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Forum Post Previews */
.preview-box .forum-post {
  border-radius: 8px;
  box-sizing: border-box;
}

/* Name Card Previews */
.preview-box.profile-view-modal {
  background: transparent !important;
  position: static !important;
  z-index: 1;
}

.preview-text {
  color: white;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* PHASE 5: Full-Width Layout — Strip card containers from main screens      */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Forum screen */
#forumScreen>.card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 1rem 0.75rem;
  box-shadow: none;
}

/* Profile screen */
#profileScreen>.card.profile-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 1rem 0.75rem;
  box-shadow: none;
}

/* Friends screen */
#friendsScreen>.card.friends-layout {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* Home screen — dashboard cards */
#homeScreen .card.dashboard-card {
  border-radius: 12px;
  padding: 1rem;
  box-shadow: none;
  border: 1px solid var(--border-color);
}

/* Admin screen — keep minimal styling */
#adminScreen>.card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 1rem 0.75rem;
  box-shadow: none;
}

/* Chat History — dynamically rendered, strip card if present */
#historyScreen>.card,
#historyScreen .card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* PHASE 4: Mobile PM Input Fix — Keep input bar always visible              */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Constrain the entire PM chat container to viewport minus nav */
  .pm-chat-container {
    height: calc(100vh - 40px) !important;
    max-height: calc(100vh - 40px) !important;
    overflow: hidden;
  }

  /* Messages area fills remaining space above the fixed input bar */
  .pm-messages {
    max-height: calc(100vh - 220px) !important;
    padding-bottom: 70px !important;
  }

  /* Ensure screens themselves don't have excess padding */
  #forumScreen,
  #profileScreen,
  #friendsScreen,
  #homeScreen {
    padding: 0 !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* CREDITS INTERACTIVE PARTICLE CANVAS                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

.credits-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.credits-hero {
  cursor: crosshair;
}

/* Make hero respond to pointer for the canvas */
.credits-hero:hover .credits-particles {
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* HOME SCREEN UI/UX IMPROVEMENTS                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Welcome card gradient header */
#homeScreen .welcome-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), #64dd17);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

/* Stat bubbles — plain, no box */
#homeScreen .stat-bubble {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.25rem 0.5rem;
  box-shadow: none;
}

#homeScreen .stat-bubble:hover {
  transform: none;
  box-shadow: none;
}

#homeScreen .stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
}

/* Remove rounded card frames on home — flat with dividers */
#homeScreen .card.dashboard-card {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1rem 0.75rem !important;
  border-bottom: 1px solid var(--border-color) !important;
}

#homeScreen .card.dashboard-card:last-child {
  border-bottom: none !important;
}

/* Community card sections */
#homeScreen .community-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Forum card */
#homeScreen .forum-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#homeScreen .forum-card h3::before {
  content: '💬';
}

/* Glow button pulse */
#homeScreen .glow-btn {
  position: relative;
  overflow: hidden;
}

#homeScreen .glow-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

#homeScreen .glow-btn:hover::after {
  width: 300px;
  height: 300px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* CHAT HISTORY — FLAT LAYOUT                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Strip card container entirely */
#chatHistoryScreen>.card.wide {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.75rem !important;
}

#chatHistoryScreen>.card.wide h2 {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0.75rem 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 0.75rem;
}

/* History list items — no circular avatar frames */
#chatHistoryList .history-avatar {
  border-radius: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* FORUM POST BUTTON — COMPACT WIDTH                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

#forumScreen .forum-post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#forumScreen .forum-post-actions .primary-btn {
  width: auto;
  min-width: 80px;
  padding: 0.5rem 1.5rem;
}

/* =============================================
   GLOBAL CHAT — Floating Button & Panel
   ============================================= */

/* Floating Action Button */
.global-chat-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #10b981, #064e3b);
  /* Dark green theme */
  color: #fff;
  cursor: pointer;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(16, 185, 129, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
  animation: fab-pulse 2.5s ease-in-out infinite;
}

.global-chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}

.global-chat-fab.active {
  animation: none;
  background: #042f2e;
  /* Even darker when open */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
}

.chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ff4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 2px 10px rgba(255, 68, 68, 0.4);
  z-index: 10;
}

@keyframes fab-pulse {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  50% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 12px rgba(16, 185, 129, 0);
  }
}

/* Slide-Up Panel */
.global-chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 380px;
  max-height: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.global-chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Panel Header */
.global-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.global-chat-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.global-chat-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.global-chat-title span {
  font-size: 1.2rem;
}

.global-chat-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.global-chat-close-btn:hover {
  color: var(--text-color);
}

/* Message Feed */
.global-chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 200px;
  max-height: 350px;
}

.global-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 3rem 1rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Individual Message */
.global-msg {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  transition: background 0.15s;
}

.global-msg:hover {
  background: rgba(255, 255, 255, 0.04);
}

.global-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--bg-surface-hover);
}

.global-msg-body {
  flex: 1;
  min-width: 0;
}

.global-msg-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 2px;
}

.global-msg-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.global-msg-name:hover {
  text-decoration: underline;
}

.global-msg-time {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.7;
  white-space: nowrap;
}

.global-msg-text {
  font-size: 0.85rem;
  color: var(--text-color);
  word-break: break-word;
  line-height: 1.4;
  transition: all 0.2s;
}

/* Global Chat Bubble Base */
.global-msg-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  display: inline-block;
  margin-top: 4px;
  max-width: 100%;
  position: relative;
}

.global-msg-me {
  background: rgba(139, 92, 246, 0.06);
  border-radius: 12px;
}

/* Input Bar */
.global-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.global-chat-input-bar input {
  flex: 1;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.global-chat-input-bar input:focus {
  border-color: var(--primary-color);
}

.global-char-count {
  font-size: 0.7rem;
  color: var(--text-secondary);
  min-width: 28px;
  text-align: center;
}

.global-send-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.global-send-btn:hover {
  background: var(--accent-color, #7c3aed);
  transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .global-chat-fab {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }

  .global-chat-panel {
    bottom: 4.5rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-height: 60vh;
    border-radius: 16px;
  }

  .global-chat-feed {
    max-height: 45vh;
  }
}

/* Reply Preview Bar (above input) */
.global-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--bg-surface-hover);
  border-top: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  font-size: 0.78rem;
  color: var(--text-secondary);
  animation: replySlideIn 0.2s ease;
}

@keyframes replySlideIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reply-preview-content {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
}

.reply-preview-content strong {
  color: var(--accent);
}

.reply-cancel-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.reply-cancel-btn:hover {
  color: var(--text-primary);
}

/* Reply Reference in Message */
.global-msg-reply-ref {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  overflow: hidden;
}

.global-msg-reply-ref strong {
  color: var(--accent);
  white-space: nowrap;
}

.global-msg-reply-ref span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Reply Button on Message Hover */
.global-msg-reply-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
  margin-top: 2px;
}

.global-msg:hover .global-msg-reply-btn {
  display: inline-flex;
}

.global-msg-reply-btn:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* Typing Indicator */
.global-typing-indicator {
  padding: 0.25rem 1rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  min-height: 22px;
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease;
  animation: fadeIn 0.3s ease;
}

.global-typing-indicator.hidden {
  display: none;
}

/* Input Bar */
.global-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.global-chat-input-bar input {
  flex: 1;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.global-chat-input-bar input:focus {
  border-color: var(--primary-color);
}

.global-char-count {
  font-size: 0.7rem;
  color: var(--text-secondary);
  min-width: 28px;
  text-align: center;
}

.global-send-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.global-send-btn:hover {
  background: var(--accent-color, #7c3aed);
  transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .global-chat-fab {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }

  .global-chat-panel {
    bottom: 4.5rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-height: 60vh;
    border-radius: 16px;
  }

  .global-chat-feed {
    max-height: 45vh;
  }
}

/* Reply Preview Bar (above input) */
.global-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--bg-surface-hover);
  border-top: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  font-size: 0.78rem;
  color: var(--text-secondary);
  animation: replySlideIn 0.2s ease;
}

@keyframes replySlideIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reply-preview-content {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
}

.reply-preview-content strong {
  color: var(--accent);
}

.reply-cancel-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.reply-cancel-btn:hover {
  color: var(--text-primary);
}

/* Reply Reference in Message */
.global-msg-reply-ref {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  overflow: hidden;
}

.global-msg-reply-ref strong {
  color: var(--accent);
  white-space: nowrap;
}

.global-msg-reply-ref span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Reply Button on Message Hover */
.global-msg-reply-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
  margin-top: 2px;
}

.global-msg:hover .global-msg-reply-btn {
  display: inline-flex;
}

.global-msg-reply-btn:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* Typing Indicator */
.global-typing-indicator {
  padding: 0.25rem 1rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  min-height: 22px;
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease;
  animation: fadeIn 0.3s ease;
}

.global-typing-indicator.hidden {
  display: none;
}

/* Input Bar */
.global-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.global-chat-input-bar input {
  flex: 1;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.global-chat-input-bar input:focus {
  border-color: var(--primary-color);
}

.global-char-count {
  font-size: 0.7rem;
  color: var(--text-secondary);
  min-width: 28px;
  text-align: center;
}

.global-send-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.global-send-btn:hover {
  background: var(--accent-color, #7c3aed);
  transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .global-chat-fab {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }

  .global-chat-panel {
    bottom: 4.5rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-height: 60vh;
    border-radius: 16px;
  }

  .global-chat-feed {
    max-height: 45vh;
  }
}

/* Reply Preview Bar (above input) */
.global-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--bg-surface-hover);
  border-top: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  font-size: 0.78rem;
  color: var(--text-secondary);
  animation: replySlideIn 0.2s ease;
}

@keyframes replySlideIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reply-preview-content {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
}

.reply-preview-content strong {
  color: var(--accent);
}

.reply-cancel-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.reply-cancel-btn:hover {
  color: var(--text-primary);
}

/* Reply Reference in Message */
.global-msg-reply-ref {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  overflow: hidden;
}

.global-msg-reply-ref strong {
  color: var(--accent);
  white-space: nowrap;
}

.global-msg-reply-ref span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Reply Button on Message Hover */
.global-msg-reply-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
  margin-top: 2px;
}

.global-msg:hover .global-msg-reply-btn {
  display: inline-flex;
}

.global-msg-reply-btn:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* =============================================
   MINI-GAMES — Overlays, Boards, Results
   ============================================= */

/* Game Overlay (used for menu + invites) */
.game-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Game Menu Panel */
.game-menu-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.game-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.game-menu-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.game-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.game-close-btn:hover {
  background: var(--bg-surface-hover);
}

.game-menu-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

/* Game Cards Grid */
.game-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.8rem 0.5rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text-primary);
}

.game-card:hover {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-surface));
  transform: translateY(-2px);
}

.game-card-icon {
  font-size: 1.5rem;
}

.game-card-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.game-card-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Bet Section */
.game-bet-section {
  border-top: 1px solid var(--border-color);
  padding-top: 0.8rem;
}

.game-bet-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.game-bet-toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Modern Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 26px;
  transition: background 0.25s, border-color 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(21px);
  background: #fff;
}

/* Bet Input */
.game-bet-input-area {
  margin-top: 0.6rem;
}

.game-bet-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-bet-field input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.game-bet-field input:focus {
  border-color: var(--primary-color);
}

.bet-coins-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.bet-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

/* Game Invite Panel */
.game-invite-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  animation: slideUp 0.25s ease;
  max-width: 360px;
  width: 90%;
}

.game-invite-panel h3 {
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
}

.game-bet-info {
  color: #FFD700;
  font-weight: 600;
  margin: 0.5rem 0;
}

.game-invite-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

/* Waiting Message */
.game-waiting-static {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  margin: 0.25rem 0.5rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Game Container (inside chat) */
.game-container {
  margin: 0.5rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.game-title {
  font-weight: 600;
  font-size: 1rem;
}

.game-bet-badge {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

/* Game Board */
.game-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Game Result */
.game-result .game-result-content {
  text-align: center;
  padding: 1rem;
}

.game-result-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.game-result-text {
  margin: 0 0 0.5rem;
}

.game-coin-result {
  font-weight: 600;
  margin: 0.25rem 0;
}

.game-coin-result.win {
  color: #4CAF50;
}

.game-coin-result.lose {
  color: #FF5252;
}

.game-result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

/* =============================================
   1. TIC TAC TOE
   ============================================= */
.ttt-status {
  text-align: center;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
}

.ttt-cell {
  aspect-ratio: 1;
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  color: var(--text-primary);
}

.ttt-cell:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary-color) 15%, var(--bg-surface));
  transform: scale(1.05);
}

.ttt-cell:disabled {
  cursor: default;
}

.ttt-cell.taken {
  cursor: default;
}

/* =============================================
   2. CONNECT FOUR
   ============================================= */
.c4-status {
  text-align: center;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.c4-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

.c4-cell {
  aspect-ratio: 1;
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 50%;
}

.c4-cols {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 350px;
  margin: 0.4rem auto 0;
}

.c4-drop {
  background: var(--primary-color);
  border: none;
  border-radius: 8px;
  padding: 0.3rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #fff;
  transition: opacity 0.2s, transform 0.1s;
  font-family: inherit;
}

.c4-drop:hover:not(:disabled) {
  opacity: 0.85;
  transform: scale(1.1);
}

.c4-drop:disabled {
  opacity: 0.4;
  cursor: default;
}

/* =============================================
   3. ROCK PAPER SCISSORS
   ============================================= */
.rps-status {
  text-align: center;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.rps-scores {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.rps-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.rps-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.rps-player span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.rps-choice-display {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--bg-surface-hover);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  transition: all 0.3s;
}

.rps-choice-display.revealed {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-surface));
}

.rps-vs {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.rps-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.rps-btn {
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.rps-btn:hover {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-surface));
  transform: translateY(-2px);
}

/* =============================================
   4. NUMBER GUESS
   ============================================= */
.ng-status {
  text-align: center;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.ng-hint {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.ng-history {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
  padding: 0.3rem;
}

.ng-guess {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  background: var(--bg-surface-hover);
}

.ng-guess.correct {
  background: color-mix(in srgb, #4CAF50 20%, var(--bg-surface));
  color: #4CAF50;
  font-weight: 600;
}

.ng-input {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.ng-input input {
  width: 100px;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  outline: none;
}

.ng-input input:focus {
  border-color: var(--primary-color);
}

/* =============================================
   5. MEMORY MATCH
   ============================================= */
.mem-status {
  text-align: center;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.mem-scores {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.mem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.mem-card {
  aspect-ratio: 1;
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text-primary);
}

.mem-card:hover:not(:disabled):not(.matched) {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.mem-card.flipped {
  background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-surface));
  border-color: var(--primary-color);
}

.mem-card.matched {
  opacity: 0.5;
  cursor: default;
  background: color-mix(in srgb, #4CAF50 10%, var(--bg-surface));
  border-color: #4CAF50;
}

.mem-card:disabled {
  cursor: default;
}

/* =============================================
   6. REACTION SPEED
   ============================================= */
.reaction-info {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.game-reaction-btn {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  padding: 2rem;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary);
}

.game-reaction-btn.reaction-wait {
  background: color-mix(in srgb, #FF5252 15%, var(--bg-surface));
  border-color: #FF5252;
}

.game-reaction-btn.reaction-go {
  background: color-mix(in srgb, #4CAF50 20%, var(--bg-surface));
  border-color: #4CAF50;
  animation: pulse-go 0.5s ease infinite;
}

@keyframes pulse-go {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }
}

.game-reaction-btn.reaction-early {
  background: color-mix(in srgb, #FF5252 10%, var(--bg-surface));
  border-color: #FF5252;
  opacity: 0.7;
}

.game-reaction-btn.reaction-done {
  background: color-mix(in srgb, #4CAF50 10%, var(--bg-surface));
  border-color: #4CAF50;
}

.game-reaction-btn:disabled {
  cursor: default;
}

.reaction-results {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* =============================================
   7. DICE DUEL
   ============================================= */
.dice-status {
  text-align: center;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.dice-scores {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.dice-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.dice-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.dice-player span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dice-face {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--bg-surface-hover);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s;
}

.dice-face.rolled {
  border-color: var(--primary-color);
  animation: dice-bounce 0.4s ease;
}

@keyframes dice-bounce {
  0% {
    transform: scale(0.8) rotate(-10deg);
  }

  50% {
    transform: scale(1.15) rotate(5deg);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

.dice-vs {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.dice-roll-btn {
  display: block;
  margin: 0 auto;
  padding: 0.7rem 2rem;
  font-size: 1rem;
}

.dice-waiting {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* =============================================
   8. MATH DUEL
   ============================================= */
.math-status {
  text-align: center;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.math-scores {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.math-question {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
}

.math-input {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.math-input input {
  width: 120px;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: inherit;
  text-align: center;
  outline: none;
}

.math-input input:focus {
  border-color: var(--primary-color);
}

.math-waiting {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* =============================================
   MOBILE RESPONSIVE — All Games
   ============================================= */
@media (max-width: 600px) {
  .game-menu-panel {
    padding: 1rem;
  }

  .game-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }

  .game-card {
    padding: 0.6rem 0.4rem;
  }

  .game-card-icon {
    font-size: 1.3rem;
  }

  .game-card-name {
    font-size: 0.78rem;
  }

  .game-card-desc {
    font-size: 0.65rem;
  }

  .ttt-grid {
    max-width: 200px;
  }

  .ttt-cell {
    font-size: 1.4rem;
    min-height: 50px;
  }

  .c4-grid,
  .c4-cols {
    max-width: 280px;
  }

  .c4-cell {
    font-size: 0.9rem;
  }

  .rps-choice-display {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .rps-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .mem-grid {
    max-width: 240px;
  }

  .mem-card {
    font-size: 1.1rem;
  }

  .game-reaction-btn {
    padding: 1.5rem;
    font-size: 1.1rem;
  }

  .dice-face {
    width: 52px;
    height: 52px;
    font-size: 2rem;
  }

  .math-question {
    font-size: 1.5rem;
  }

  .game-bet-field input {
    font-size: 1rem;
    padding: 0.7rem 0.85rem;
  }
}

/* =============================================
   MESSAGE READ RECEIPTS
   ============================================= */
.message-status {
  font-size: 0.7rem;
  margin-left: 4px;
  color: var(--text-muted);
  display: inline-block;
  vertical-align: middle;
}

.status-read {
  color: #3b82f6;
  /* Blue checkmarks */
}


/* =============================================
   STREAK CUTSCENE ANIMATION
   ============================================= */
.streak-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.streak-candle {
  animation: streak-pulse 1.5s infinite alternate ease-in-out;
  margin-bottom: 2rem;
}

.streak-number {
  font-size: 5rem;
  font-weight: 800;
  color: #ff4b2b;
  text-shadow: 0 0 20px rgba(255, 75, 43, 0.8);
  font-family: 'Poppins', sans-serif;
  margin-bottom: 1rem;
}

.streak-text {
  font-size: 1.2rem;
  color: #fff;
  opacity: 0.8;
  font-family: 'Inter', sans-serif;
}

@keyframes streak-pulse {
  0% {
    transform: scale(0.95);
    filter: drop-shadow(0 0 10px #ff4b2b);
  }

  100% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 30px #ff4b2b);
  }
}