/* ===== MODERN USER-APP DESIGN ===== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.12);
  --accent: #6c63ff;
  --accent-hover: #5a52d5;
  --accent-glow: rgba(108, 99, 255, 0.4);
  --accent-secondary: #00d2ff;
  --text-primary: #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted: #6a6a80;
  --danger: #ff4757;
  --success: #2ed573;
  --warning: #ffa502;
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus: rgba(108, 99, 255, 0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Animated Background --- */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 210, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255, 71, 87, 0.06) 0%, transparent 50%);
  animation: bgShift 40s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
}

@keyframes bgShift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-1%, 1%); }
  100% { transform: translate(1%, -0.5%); }
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 { font-size: 1.5rem; color: var(--text-primary); }
h3 { font-size: 1.25rem; color: var(--text-primary); }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-secondary); }

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 2rem;
}

.page-header p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

/* --- Glass Card --- */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card h2 {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2 .icon {
  font-size: 1.3rem;
}

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
  background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: var(--transition);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
  color: #fff;
}

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

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #e84118);
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.3);
  color: #fff;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
  margin-top: 1.5rem;
}

/* --- Messages --- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideDown 0.4s ease;
}

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

.alert-info {
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: #c4bfff;
}

.alert-success {
  background: rgba(46, 213, 115, 0.15);
  border: 1px solid rgba(46, 213, 115, 0.3);
  color: #7dffb0;
}

.alert-error {
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid rgba(255, 71, 87, 0.3);
  color: #ffa0a8;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  background: var(--glass);
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--glass-border);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* --- Profile Page --- */
.profile-hero {
  text-align: center;
  padding: 3rem 2rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.profile-name {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.profile-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Navbar --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.navbar-links a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}

.navbar-links a:hover { color: var(--text-primary); }

.navbar-balance {
  font-weight: 700;
  color: #2ed573;
  background: rgba(46,213,115,0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(46,213,115,0.3);
  font-size: 0.85rem;
  white-space: nowrap;
}

.profile-menu {
  position: relative;
}

.profile-menu-trigger {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.profile-menu-trigger:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

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

.profile-menu-avatar-fallback {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  min-width: 190px;
  background: rgba(12, 14, 28, 0.98);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.45rem;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: var(--transition);
  z-index: 220;
}

.profile-menu-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-menu-dropdown a {
  display: block;
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-weight: 600;
}

.profile-menu-username {
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-dropdown a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.profile-menu-dropdown a.profile-menu-logout {
  color: #ff6b6b;
}

.profile-menu-dropdown a.profile-menu-logout:hover {
  color: #ff8787;
  background: rgba(255, 107, 107, 0.14);
}

/* --- Errors list --- */
.error-list {
  list-style: none;
  padding: 0;
}

.error-list li {
  padding: 0.5rem 0;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-list li::before {
  content: '⚠';
  font-size: 0.85rem;
}

/* --- Result box --- */
.result-box {
  background: rgba(46, 213, 115, 0.1);
  border: 1px solid rgba(46, 213, 115, 0.3);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-box strong {
  color: var(--success);
}

/* --- Utilities --- */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }

/* --- Floating particles (decoration) --- */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: float linear infinite;
}

@keyframes float {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.3; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* --- Mini Games Section --- */
.games-section {
  margin-top: 3rem;
}

.games-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.75rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

/* game-card:hover disabled per user request */

.game-card-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
}

.game-card-header .game-icon {
  font-size: 1.5rem;
}

.game-card-header h3 {
  font-size: 1.1rem;
}

.game-card-body {
  padding: 1.5rem;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-card-body .game-start-btn {
  margin-top: 1rem;
}

/* --- Game-specific styles --- */

/* Tic-Tac-Toe */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  grid-template-rows: repeat(3, 70px);
  gap: 6px;
}

.ttt-cell {
  width: 70px;
  height: 70px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
}

.ttt-cell:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.ttt-cell.x { color: var(--accent); }
.ttt-cell.o { color: var(--accent-secondary); }

/* Memory Game */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 55px);
  grid-template-rows: repeat(4, 55px);
  gap: 6px;
}

.memory-card {
  width: 55px;
  height: 55px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.memory-card:hover { border-color: var(--accent); }
.memory-card.flipped { background: var(--accent); border-color: var(--accent); }
.memory-card.matched { background: rgba(46, 213, 115, 0.3); border-color: var(--success); }

/* Snake Game */
.snake-canvas {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.3);
}

/* Reaction Time */
.reaction-box {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.reaction-box.waiting   { background: var(--danger); color: #fff; }
.reaction-box.ready     { background: var(--success); color: #fff; }
.reaction-box.idle      { background: var(--input-bg); color: var(--text-secondary); border: 1px solid var(--glass-border); }
.reaction-box.result    { background: var(--accent); color: #fff; }

/* Number Guess */
.guess-input-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 250px;
}

.guess-input-row input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}

.guess-input-row input:focus { border-color: var(--accent); }

.guess-hint {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  min-height: 1.5em;
}

/* Whack-a-Mole */
.mole-grid {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  grid-template-rows: repeat(3, 70px);
  gap: 8px;
}

.mole-hole {
  width: 70px;
  height: 70px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  user-select: none;
}

.mole-hole:hover { background: var(--bg-card-hover); }
.mole-hole.active {
  background: rgba(108, 99, 255, 0.2);
  border-color: var(--accent);
  transform: scale(1.1);
}

/* --- Game status/score --- */
.game-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  text-align: center;
  min-height: 1.5em;
}

.game-score {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .container { padding: 1rem; }
  h1 { font-size: 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: 1fr; }
  .navbar { padding: 0.5rem 0.85rem; }
  .card { padding: 1.25rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .chat-layout { grid-template-columns: 1fr; }
  .navbar-links { gap: 0.75rem; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .ttt-board { grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 60px); }
  .ttt-cell { width: 60px; height: 60px; font-size: 1.5rem; }
  .memory-grid { grid-template-columns: repeat(4, 48px); grid-template-rows: repeat(4, 48px); }
  .memory-card { width: 48px; height: 48px; font-size: 1.2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==================================== */
/* DASHBOARD                            */
/* ==================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
}

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

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.profile-avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin: 0 auto 1.5rem;
  display: block;
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* User data grid */
.user-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}
.data-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0;
}
.data-value {
  font-weight: 600;
  margin: 0.15rem 0 0;
}

/* ==================================== */
/* ACHIEVEMENTS                         */
/* ==================================== */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.achievement-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.achievement-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ==================================== */
/* HIGHSCORES                           */
/* ==================================== */
.highscore-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.highscore-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.highscore-item:hover {
  border-color: var(--accent);
}

/* ==================================== */
/* ACTIVITY LOG                         */
/* ==================================== */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }

/* ==================================== */
/* NOTES                                */
/* ==================================== */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.note-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.note-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.note-card.done { opacity: 0.6; }
.note-card.done .note-title { text-decoration: line-through; }

.note-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.note-title { flex: 1; font-size: 0.95rem; margin: 0; }

.note-check {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.note-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 0;
}
.note-delete:hover { opacity: 1; }

.note-content {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre-wrap;
}

.note-preview-item {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--glass-border);
}
.note-preview-item.done { opacity: 0.5; text-decoration: line-through; }
.note-preview-item:last-child { border-bottom: none; }

/* Note colors */
.note-color-blue   { border-left: 4px solid #3b82f6; }
.note-color-green  { border-left: 4px solid #22c55e; }
.note-color-yellow { border-left: 4px solid #eab308; }
.note-color-red    { border-left: 4px solid #ef4444; }
.note-color-purple { border-left: 4px solid #a855f7; }

.color-picker {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--accent-glow); }

/* ==================================== */
/* CHAT / MESSAGES                      */
/* ==================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  min-height: 500px;
}

.chat-sidebar {
  max-height: 600px;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.25rem;
}

.conversation-item:hover { background: var(--bg-card-hover); }
.conversation-item.active { background: rgba(108, 99, 255, 0.15); border: 1px solid var(--accent); }

.conversation-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.conversation-info { flex: 1; min-width: 0; }

.chat-main {
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 1rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.chat-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  word-break: break-word;
}

.chat-bubble.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.received {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}

.chat-bubble p { margin: 0; font-size: 0.95rem; }

.chat-time {
  font-size: 0.7rem;
  opacity: 0.6;
  display: block;
  margin-top: 0.25rem;
}

.chat-input-area {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.chat-input-area input {
  flex: 1;
  padding: 0.65rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.chat-input-area input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
}

/* User list in modal */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 300px;
  overflow-y: auto;
}

.user-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
}

.user-list-item:hover { background: var(--bg-card-hover); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(5px);
}

.modal-content {
  width: 90%;
  max-width: 450px;
  max-height: 80vh;
  overflow-y: auto;
}

/* ==================================== */
/* BADGE                                */
/* ==================================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 0.25rem;
}

/* ==================================== */
/* THEME TOGGLE BUTTON                  */
/* ==================================== */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  line-height: 1;
  transition: var(--transition);
}

.btn-icon:hover { transform: scale(1.2); }

/* ==================================== */
/* WIDGET SYSTEM                        */
/* ==================================== */
.widget-card {
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.widget-card.dragging {
  opacity: 0.5;
  transform: scale(0.97);
  box-shadow: 0 0 20px rgba(108,99,255,0.5);
}
.widget-drag-bar {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  cursor: grab;
  font-size: 1.2rem;
  color: var(--text-muted);
  opacity: 0.3;
  transition: opacity 0.2s;
  user-select: none;
  line-height: 1;
}
.widget-card:hover .widget-drag-bar {
  opacity: 0.8;
}
.widget-drag-bar:active {
  cursor: grabbing;
}

/* Widget Settings */
.widget-settings {
  border: 1px dashed var(--accent);
}
.widget-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.widget-toggle-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  cursor: grab;
  transition: var(--transition);
  user-select: none;
}
.widget-toggle-item:hover {
  background: rgba(108,99,255,0.1);
  border-color: var(--accent);
}
.widget-toggle-item.dragging {
  opacity: 0.5;
  background: rgba(108,99,255,0.2);
}
.drag-handle {
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: grab;
}
.widget-toggle-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ==================================== */
/* CLOCK WIDGET                         */
/* ==================================== */
.clock-widget {
  text-align: center;
  padding: 1rem 0;
}
.clock-time {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.clock-date {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.clock-greeting {
  font-size: 1.1rem;
  margin-top: 0.6rem;
  font-weight: 500;
}

/* ==================================== */
/* CALENDAR WIDGET                      */
/* ==================================== */
.calendar-widget {
  padding: 0.5rem 0;
}
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  padding: 0.3rem;
  text-transform: uppercase;
}
.cal-day {
  padding: 0.35rem;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: background 0.2s;
}
.cal-day:not(.empty):hover {
  background: rgba(108,99,255,0.15);
  cursor: pointer;
}
.cal-day.today {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day.empty {
  opacity: 0;
}

/* Note preview in dashboard */
.note-preview-item {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9rem;
}
.note-preview-item.done {
  opacity: 0.6;
  text-decoration: line-through;
}
.note-preview-item:last-child {
  border-bottom: none;
}

/* Profile actions */
.profile-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ======================================================== */
/* EMOJI REACTIONS                                          */
/* ======================================================== */
.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  align-items: center;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.reaction-chip:hover {
  background: rgba(108,99,255,0.2);
  border-color: var(--accent);
  transform: scale(1.1);
}

.reaction-chip.active {
  background: rgba(108,99,255,0.25);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 8px var(--accent-glow);
}

.reaction-add-btn {
  background: none;
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  font-family: inherit;
  opacity: 0;
}

.chat-bubble:hover .reaction-add-btn {
  opacity: 1;
}

.reaction-add-btn:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent);
  color: var(--text-primary);
}

.emoji-picker-popup {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px 10px;
  position: fixed;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(108,99,255,0.3);
  animation: emojiPopIn 0.2s ease;
  white-space: nowrap;
}

@keyframes emojiPopIn {
  from { opacity: 0; transform: scale(0.8) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.emoji-pick-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
  line-height: 1;
}

.emoji-pick-btn:hover {
  background: rgba(108,99,255,0.2);
  transform: scale(1.3);
}

.chat-bubble {
  position: relative;
}

/* New message flash */
.new-message-flash {
  animation: msgFlash 0.6s ease;
}
@keyframes msgFlash {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: inset 0 0 30px rgba(108,99,255,0.3); }
}


/* ======================================================== */
/* 🪩 EXTREME DISCO DESIGN 🪩                               */
/* ======================================================== */

/* === DISCO STROBE BACKGROUND === */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(45deg,
    rgba(255,0,128,0) 0%,
    rgba(0,255,255,0) 50%,
    rgba(255,255,0,0) 100%);
  animation: discoStrobe 10s ease-in-out infinite alternate;
}

@keyframes discoStrobe {
  0%   { background: radial-gradient(circle at 20% 30%, rgba(255,0,128,0.15), transparent 60%),
                     radial-gradient(circle at 80% 70%, rgba(0,255,255,0.12), transparent 60%); }
  25%  { background: radial-gradient(circle at 50% 20%, rgba(255,255,0,0.15), transparent 60%),
                     radial-gradient(circle at 20% 80%, rgba(128,0,255,0.12), transparent 60%); }
  50%  { background: radial-gradient(circle at 80% 30%, rgba(0,255,128,0.15), transparent 60%),
                     radial-gradient(circle at 30% 60%, rgba(255,0,64,0.12), transparent 60%); }
  75%  { background: radial-gradient(circle at 40% 80%, rgba(0,128,255,0.18), transparent 60%),
                     radial-gradient(circle at 70% 20%, rgba(255,128,0,0.12), transparent 60%); }
  100% { background: radial-gradient(circle at 60% 50%, rgba(255,0,255,0.15), transparent 60%),
                     radial-gradient(circle at 20% 40%, rgba(0,255,64,0.12), transparent 60%); }
}

/* === DISCO SPOTLIGHT BEAMS === */
.disco-lights {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.disco-light-beam {
  position: absolute;
  top: -20%;
  width: 4px;
  height: 150%;
  opacity: 0.15;
  filter: blur(30px);
  transform-origin: top center;
  animation: beamSweep ease-in-out infinite;
}

.disco-light-beam:nth-child(1) {
  left: 10%;
  background: linear-gradient(to bottom, #ff0080, transparent 80%);
  animation-duration: 6s;
  animation-delay: 0s;
  width: 80px;
}
.disco-light-beam:nth-child(2) {
  left: 30%;
  background: linear-gradient(to bottom, #00ffff, transparent 80%);
  animation-duration: 7s;
  animation-delay: -1s;
  width: 60px;
}
.disco-light-beam:nth-child(3) {
  left: 50%;
  background: linear-gradient(to bottom, #ffff00, transparent 80%);
  animation-duration: 5s;
  animation-delay: -2s;
  width: 90px;
}
.disco-light-beam:nth-child(4) {
  left: 70%;
  background: linear-gradient(to bottom, #8000ff, transparent 80%);
  animation-duration: 8s;
  animation-delay: -0.5s;
  width: 70px;
}
.disco-light-beam:nth-child(5) {
  left: 90%;
  background: linear-gradient(to bottom, #00ff80, transparent 80%);
  animation-duration: 6.5s;
  animation-delay: -3s;
  width: 50px;
}

@keyframes beamSweep {
  0%   { transform: rotate(-25deg) scaleX(1); opacity: 0.12; }
  25%  { transform: rotate(15deg) scaleX(1.5); opacity: 0.2; }
  50%  { transform: rotate(-10deg) scaleX(0.8); opacity: 0.08; }
  75%  { transform: rotate(20deg) scaleX(1.3); opacity: 0.18; }
  100% { transform: rotate(-25deg) scaleX(1); opacity: 0.12; }
}

/* === DISCO BALL === */
.disco-ball {
  position: fixed;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(200,200,220,0.4) 50%, rgba(100,100,120,0.2)),
    repeating-conic-gradient(
      rgba(255,255,255,0.3) 0deg 10deg,
      rgba(180,180,200,0.1) 10deg 20deg
    );
  box-shadow:
    0 0 40px rgba(255,255,255,0.3),
    0 0 80px rgba(108,99,255,0.2),
    inset 0 0 20px rgba(255,255,255,0.3);
  animation: discoBallSpin 16s linear infinite,
             discoBallGlow 4s ease-in-out infinite alternate;
  z-index: 50;
  pointer-events: none;
}

.disco-ball::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), rgba(255,255,255,0.1));
}

/* Disco ball mirror reflections */
.disco-ball::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.8) 1px, transparent 2px),
    radial-gradient(circle at 75% 30%, rgba(255,255,255,0.6) 1px, transparent 2px),
    radial-gradient(circle at 50% 60%, rgba(255,255,255,0.7) 1px, transparent 2px),
    radial-gradient(circle at 30% 70%, rgba(255,255,255,0.5) 1px, transparent 2px),
    radial-gradient(circle at 65% 45%, rgba(255,255,255,0.6) 1px, transparent 2px),
    radial-gradient(circle at 40% 40%, rgba(255,255,255,0.4) 1px, transparent 2px);
  animation: mirrorShimmer 1.5s ease-in-out infinite alternate;
}

@keyframes discoBallSpin {
  from { transform: translateX(-50%) rotateY(0deg); }
  to   { transform: translateX(-50%) rotateY(360deg); }
}

@keyframes discoBallGlow {
  from { box-shadow: 0 0 40px rgba(255,255,255,0.3), 0 0 80px rgba(108,99,255,0.2), inset 0 0 20px rgba(255,255,255,0.3); }
  to   { box-shadow: 0 0 60px rgba(255,255,255,0.5), 0 0 120px rgba(0,255,255,0.3), inset 0 0 30px rgba(255,255,255,0.5); }
}

@keyframes mirrorShimmer {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

/* === FLOOR REFLECTIONS (scattered colored dots) === */
.disco-floor-reflections {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floor-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  filter: blur(6px);
  animation: floorDotPulse ease-in-out infinite;
}

@keyframes floorDotPulse {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.6; transform: scale(1.5); }
}

/* === BREAKDANCER (removed) === */
.breakdancer {
  display: none;
}

@keyframes breakdance {
  0%   { transform: rotate(0deg) scaleX(1); }
  12%  { transform: rotate(-30deg) scaleX(1) translateY(-10px); }
  25%  { transform: rotate(0deg) scaleX(-1); }
  37%  { transform: rotate(45deg) scaleX(-1) translateY(-15px); }
  50%  { transform: rotate(0deg) scaleX(1) translateY(-5px); }
  62%  { transform: rotate(-60deg) scaleX(1) translateY(-20px); }
  75%  { transform: rotate(0deg) scaleX(-1) translateY(0px); }
  87%  { transform: rotate(30deg) scaleX(-1) translateY(-8px); }
  100% { transform: rotate(0deg) scaleX(1); }
}

/* === RAINBOW NAVBAR (slowed) === */
.navbar {
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #ff0080, #ff8c00, #ffff00, #00ff80, #00ffff, #8000ff, #ff0080) 1;
  animation: navbarGlow 6s ease-in-out infinite alternate;
}

@keyframes navbarGlow {
  from { box-shadow: 0 2px 20px rgba(255,0,128,0.3); }
  to   { box-shadow: 0 2px 20px rgba(0,255,255,0.3); }
}

/* === PULSING CARDS (slowed) === */
.card {
  animation: cardPulse 8s ease-in-out infinite alternate;
}

@keyframes cardPulse {
  0%   { border-color: rgba(255,0,128,0.3); box-shadow: 0 0 20px rgba(255,0,128,0.1); }
  33%  { border-color: rgba(0,255,255,0.3); box-shadow: 0 0 20px rgba(0,255,255,0.1); }
  66%  { border-color: rgba(255,255,0,0.3); box-shadow: 0 0 20px rgba(255,255,0,0.1); }
  100% { border-color: rgba(128,0,255,0.3); box-shadow: 0 0 20px rgba(128,0,255,0.1); }
}

/* === DISCO TEXT GLOW on H1 (slowed) === */
h1 {
  animation: textDisco 5s ease-in-out infinite alternate !important;
}

@keyframes textDisco {
  0%   { filter: drop-shadow(0 0 10px rgba(255,0,128,0.8)); }
  25%  { filter: drop-shadow(0 0 15px rgba(0,255,255,0.8)); }
  50%  { filter: drop-shadow(0 0 12px rgba(255,255,0,0.8)); }
  75%  { filter: drop-shadow(0 0 18px rgba(128,0,255,0.8)); }
  100% { filter: drop-shadow(0 0 10px rgba(0,255,128,0.8)); }
}

/* === BUTTONS GLOW RAINBOW (slowed) === */
.btn-primary {
  animation: btnDisco 6s linear infinite;
}

@keyframes btnDisco {
  0%   { box-shadow: 0 0 15px rgba(255,0,128,0.5), 0 0 30px rgba(255,0,128,0.2); }
  25%  { box-shadow: 0 0 15px rgba(0,255,255,0.5), 0 0 30px rgba(0,255,255,0.2); }
  50%  { box-shadow: 0 0 15px rgba(255,255,0,0.5), 0 0 30px rgba(255,255,0,0.2); }
  75%  { box-shadow: 0 0 15px rgba(128,0,255,0.5), 0 0 30px rgba(128,0,255,0.2); }
  100% { box-shadow: 0 0 15px rgba(255,0,128,0.5), 0 0 30px rgba(255,0,128,0.2); }
}

/* === STROBOSCOPE removed — replaced with ambient color wash === */
.strobe-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  display: none;
}

/* === NEON BORDER GLOW on inputs (slowed) === */
body.rgb-mode .form-group input:focus,
body.rgb-mode .form-group textarea:focus,
body.rgb-mode .chat-input-area input:focus {
  animation: neonInputGlow 3s ease-in-out infinite alternate;
}

@keyframes neonInputGlow {
  from { box-shadow: 0 0 5px var(--accent), 0 0 15px rgba(255,0,128,0.3); border-color: #ff0080; }
  to   { box-shadow: 0 0 5px var(--accent), 0 0 15px rgba(0,255,255,0.3); border-color: #00ffff; }
}

/* === WIGGLE on conversation items === */
.conversation-item:hover {
  animation: wiggle 0.3s ease;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

/* === DISCO BADGE PULSE (slowed) === */
.badge {
  animation: badgePulse 2s ease-in-out infinite alternate;
}

@keyframes badgePulse {
  from { transform: scale(1); box-shadow: 0 0 5px rgba(255,71,87,0.5); }
  to   { transform: scale(1.2); box-shadow: 0 0 15px rgba(255,71,87,0.8); }
}

/* === CHAT BUBBLE — no entrance animation (prevents re-trigger on poll) === */
/* Only new bubbles get animated via JS class .bubble-new */
.chat-bubble.bubble-new {
  animation: bubbleSlideIn 0.35s ease-out;
}

@keyframes bubbleSlideIn {
  from { opacity: 0; transform: translateY(18px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* === SENT BUBBLE NEON GLOW (slowed) === */
.chat-bubble.sent {
  box-shadow: 0 2px 15px rgba(108,99,255,0.3);
  animation: sentBubbleGlow 8s ease-in-out infinite alternate;
}
.chat-bubble.sent.bubble-new {
  animation: bubbleSlideIn 0.35s ease-out, sentBubbleGlow 8s ease-in-out 0.35s infinite alternate;
}

@keyframes sentBubbleGlow {
  0%   { box-shadow: 0 2px 15px rgba(255,0,128,0.3); }
  33%  { box-shadow: 0 2px 20px rgba(0,255,255,0.4); }
  66%  { box-shadow: 0 2px 20px rgba(255,255,0,0.35); }
  100% { box-shadow: 0 2px 20px rgba(139,92,246,0.5); }
}

/* === RECEIVED BUBBLE RGB BORDER GLOW (slowed) === */
.chat-bubble.received {
  animation: receivedBubbleGlow 8s ease-in-out infinite alternate;
}
.chat-bubble.received.bubble-new {
  animation: bubbleSlideIn 0.35s ease-out, receivedBubbleGlow 8s ease-in-out 0.35s infinite alternate;
}

@keyframes receivedBubbleGlow {
  0%   { border-color: rgba(255,0,128,0.25); }
  50%  { border-color: rgba(0,255,255,0.25); }
  100% { border-color: rgba(128,0,255,0.25); }
}

/* === COLOR-SHIFTING SCROLLBAR (slowed) === */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: linear-gradient(180deg, #ff0080, #00ffff, #ffff00, #8000ff);
  background-size: 100% 400%;
  animation: scrollbarRainbow 8s linear infinite;
}

@keyframes scrollbarRainbow {
  0%   { background-position: 0% 0%; }
  100% { background-position: 0% 100%; }
}

/* === PROFILE AVATAR DISCO RING (slowed) === */
.profile-avatar,
.profile-avatar-img {
  animation: avatarDisco 5s linear infinite;
}

@keyframes avatarDisco {
  0%   { box-shadow: 0 0 20px rgba(255,0,128,0.5); }
  25%  { box-shadow: 0 0 20px rgba(0,255,255,0.5); }
  50%  { box-shadow: 0 0 20px rgba(255,255,0,0.5); }
  75%  { box-shadow: 0 0 20px rgba(128,0,255,0.5); }
  100% { box-shadow: 0 0 20px rgba(255,0,128,0.5); }
}

/* === STAT CARDS (subtle) === */
.stat-card {
  animation: none;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.45s; }
.stat-card:nth-child(5) { animation-delay: 0.6s; }
.stat-card:nth-child(6) { animation-delay: 0.75s; }

@keyframes statDance {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* === GAME CARDS RAINBOW HOVER (disabled) === */

@keyframes gameCardRainbow {
  0%   { border-color: #ff0080; box-shadow: 0 0 25px rgba(255,0,128,0.3); }
  25%  { border-color: #00ffff; box-shadow: 0 0 25px rgba(0,255,255,0.3); }
  50%  { border-color: #ffff00; box-shadow: 0 0 25px rgba(255,255,0,0.3); }
  75%  { border-color: #8000ff; box-shadow: 0 0 25px rgba(128,0,255,0.3); }
  100% { border-color: #ff0080; box-shadow: 0 0 25px rgba(255,0,128,0.3); }
}

/* === NOTE CARDS COLOR PARTY (slowed) === */
.note-card {
  animation: noteColorShift 10s ease-in-out infinite;
}

.note-card:nth-child(odd)  { animation-delay: -1s; }
.note-card:nth-child(even) { animation-delay: -3s; }

@keyframes noteColorShift {
  0%   { border-color: rgba(255,0,128,0.25); }
  33%  { border-color: rgba(0,255,255,0.25); }
  66%  { border-color: rgba(255,255,0,0.25); }
  100% { border-color: rgba(255,0,128,0.25); }
}

/* === CURSOR (default) === */
body {
  cursor: default;
}

/* === PARTY MODE KEYFRAMES FOR SPECIFIC PAGES === */
.page-header h1 {
  text-shadow: 0 0 10px rgba(255,0,128,0.5);
}

.page-header p {
  animation: subtitleGlow 6s ease-in-out infinite alternate;
}

@keyframes subtitleGlow {
  from { color: var(--text-secondary); text-shadow: none; }
  to   { color: #ff80bf; text-shadow: 0 0 8px rgba(255,0,128,0.4); }
}

/* ======================================================== */
/* MEGA RGB EXTENSIONS                                      */
/* ======================================================== */

/* === RGB BORDER on EVERYTHING (slowed) === */
.card, .game-card, .note-card, .stat-card, .achievement-item, .highscore-item {
  border-image: linear-gradient(var(--rgb-angle, 0deg), #ff0080, #ff8c00, #ffff00, #00ff80, #00ffff, #8000ff, #ff0080) 1;
  border-width: 1px;
  border-style: solid;
  animation: rgbAngle 10s linear infinite, cardPulse 8s ease-in-out infinite alternate;
}

@property --rgb-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rgbAngle {
  to { --rgb-angle: 360deg; }
}

/* === FLOATING RGB ORB === */
.rgb-orb {
  position: fixed;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  opacity: 0.35;
}

.rgb-orb:nth-child(1) {
  top: 10%;
  left: 5%;
  background: #ff0080;
  animation: orbFloat1 16s ease-in-out infinite alternate;
}
.rgb-orb:nth-child(2) {
  top: 60%;
  right: 10%;
  background: #00ffff;
  animation: orbFloat2 20s ease-in-out infinite alternate;
}
.rgb-orb:nth-child(3) {
  bottom: 10%;
  left: 40%;
  background: #ffff00;
  animation: orbFloat3 14s ease-in-out infinite alternate;
}
.rgb-orb:nth-child(4) {
  top: 30%;
  right: 30%;
  background: #8000ff;
  animation: orbFloat4 18s ease-in-out infinite alternate;
}
.rgb-orb:nth-child(5) {
  top: 80%;
  left: 15%;
  background: #00ff80;
  animation: orbFloat5 22s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  0%   { transform: translate(0, 0) scale(1); background: #ff0080; }
  50%  { transform: translate(100px, 50px) scale(1.3); background: #ff8c00; }
  100% { transform: translate(-50px, 100px) scale(0.8); background: #ffff00; }
}
@keyframes orbFloat2 {
  0%   { transform: translate(0, 0) scale(1); background: #00ffff; }
  50%  { transform: translate(-80px, -60px) scale(1.2); background: #8000ff; }
  100% { transform: translate(60px, -80px) scale(0.9); background: #ff0080; }
}
@keyframes orbFloat3 {
  0%   { transform: translate(0, 0) scale(1); background: #ffff00; }
  50%  { transform: translate(70px, -40px) scale(1.4); background: #00ff80; }
  100% { transform: translate(-60px, 30px) scale(0.7); background: #00ffff; }
}
@keyframes orbFloat4 {
  0%   { transform: translate(0, 0) scale(1); background: #8000ff; }
  50%  { transform: translate(-50px, 80px) scale(1.1); background: #ff0080; }
  100% { transform: translate(40px, -60px) scale(1.3); background: #00ffff; }
}
@keyframes orbFloat5 {
  0%   { transform: translate(0, 0) scale(1); background: #00ff80; }
  50%  { transform: translate(60px, -70px) scale(1.2); background: #ffff00; }
  100% { transform: translate(-80px, 40px) scale(0.8); background: #ff0080; }
}

/* === RAINBOW BORDER GLOW on NAVBAR === */
.navbar {
  background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
              linear-gradient(90deg, #ff0080, #ff8c00, #ffff00, #00ff80, #00ffff, #8000ff, #ff0080) border-box !important;
  border-bottom: 2px solid transparent !important;
  border-image: none !important;
}

/* === RGB FLOATING TEXT (slowed) === */
.navbar-brand {
  animation: rgbText 8s linear infinite !important;
}

@keyframes rgbText {
  0%   { filter: hue-rotate(0deg) drop-shadow(0 0 8px rgba(255,0,128,0.6)); }
  100% { filter: hue-rotate(360deg) drop-shadow(0 0 8px rgba(0,255,255,0.6)); }
}

/* === RAINBOW UNDERLINE ON NAV LINKS === */
.navbar-links a {
  position: relative;
}
.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #ff0080, #00ffff, #ffff00, #8000ff);
  background-size: 200% 100%;
  transform: scaleX(0);
  transition: transform 0.3s ease;
  animation: rainbowShift 2s linear infinite;
}
.navbar-links a:hover::after {
  transform: scaleX(1);
}

@keyframes rainbowShift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* === MORPHING BLOB BEHIND CARDS (slowed) === */
.card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from var(--rgb-angle, 0deg), #ff0080, #ff8c00, #ffff00, #00ff80, #00ffff, #8000ff, #ff0080);
  z-index: -1;
  opacity: 0.08;
  filter: blur(15px);
  animation: rgbAngle 10s linear infinite;
}

/* === WAVE ANIMATION on PAGE HEADER (simplified) === */
.page-header h1 {
  animation: textDisco 5s ease-in-out infinite alternate !important;
}

@keyframes textWobble {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.02) rotate(-0.5deg); }
  75% { transform: scale(0.98) rotate(0.5deg); }
}

/* === PULSING PARTICLES (gentler) === */
.particle {
  box-shadow: 0 0 4px currentColor;
  animation: float linear infinite !important;
}

@keyframes particlePulse {
  from { filter: brightness(1); }
  to   { filter: brightness(2.5); }
}

/* === GLITCH EFFECT on H2 (slowed) === */
h2 {
  animation: h2Glow 8s ease-in-out infinite alternate;
}

@keyframes h2Glow {
  0%   { text-shadow: 0 0 5px rgba(255,0,128,0.3); }
  33%  { text-shadow: 0 0 8px rgba(0,255,255,0.3); }
  66%  { text-shadow: 0 0 6px rgba(255,255,0,0.3); }
  100% { text-shadow: 0 0 8px rgba(128,0,255,0.3); }
}

/* === TAB BUTTONS RGB (slowed) === */
.tab-btn.active {
  background: linear-gradient(135deg, #ff0080, #8000ff, #00ffff) !important;
  background-size: 200% 200% !important;
  animation: tabRGB 5s ease-in-out infinite;
}

@keyframes tabRGB {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === RGB FORM LABELS (disabled for readability) === */
.form-group label {
  animation: none;
}

@keyframes labelRGB {
  0%   { color: var(--text-secondary); }
  25%  { color: #ff80bf; }
  50%  { color: #80ffff; }
  75%  { color: #ffff80; }
  100% { color: var(--text-secondary); }
}

/* === RAINBOW SHADOW ON BUTTONS === */
.btn {
  transition: all 0.3s ease;
}
.btn:hover {
  filter: hue-rotate(30deg) brightness(1.1);
}

/* === SPINNING EMOJI ICONS (slowed) === */
.icon {
  display: inline-block;
  animation: iconSpin 12s linear infinite;
}

@keyframes iconSpin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(5deg) scale(1.1); }
  50% { transform: rotate(0deg) scale(1); }
  75% { transform: rotate(-5deg) scale(1.1); }
}

/* === BREATHING CONTAINER (disabled) === */
.container {
  animation: none;
}

@keyframes containerBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.003); }
}

/* === RGB CHAT INPUT === */
body.rgb-mode .chat-input-area input {
  border-image: linear-gradient(90deg, #ff0080, #00ffff, #ffff00, #8000ff) 1;
  border-width: 1px;
  border-style: solid;
}

/* === FLOATING SECOND BREAKDANCER (removed) === */
.breakdancer-2 {
  display: none;
}

@keyframes breakdance2 {
  0%   { transform: rotate(0deg) scaleX(-1); }
  14%  { transform: rotate(25deg) scaleX(-1) translateY(-12px); }
  28%  { transform: rotate(0deg) scaleX(1); }
  42%  { transform: rotate(-40deg) scaleX(1) translateY(-18px); }
  57%  { transform: rotate(0deg) scaleX(-1) translateY(-8px); }
  71%  { transform: rotate(50deg) scaleX(-1) translateY(-22px); }
  85%  { transform: rotate(0deg) scaleX(1) translateY(0px); }
  100% { transform: rotate(0deg) scaleX(-1); }
}

/* === LASER GRID OVERLAY (disabled) === */
.laser-grid {
  display: none;
}

@keyframes laserMove {
  from { transform: translate(0, 0); }
  to   { transform: translate(60px, 60px); }
}

/* === RGB SCROLLBAR (enhanced, slowed) === */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff0080, #ff8c00, #ffff00, #00ff80, #00ffff, #8000ff, #ff0080) !important;
  background-size: 100% 800% !important;
  animation: scrollbarRainbow 6s linear infinite !important;
}

/* === MODAL — readable override (no RGB background) === */
.modal-content {
  border: 2px solid var(--glass-border) !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  backdrop-filter: none !important;
  animation: none !important;
}
.modal-content .user-list-item {
  color: var(--text-primary) !important;
}
.modal-content .user-list-item:hover {
  background: var(--bg-card-hover) !important;
}
.modal-content h3,
.modal-content p,
.modal-content label,
.modal-content span {
  color: var(--text-primary) !important;
}

/* === LINK RGB GLOW === */
a:hover {
  text-shadow: 0 0 10px currentColor;
  filter: brightness(1.3);
}

/* ======================================================================== */
/* 🎆 CLICK EFFECTS ANIMATIONS                                             */
/* ======================================================================== */

@keyframes clickRingBurst {
  0%   { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

@keyframes clickParticleExplode {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

@keyframes clickEmojiFloat {
  0%   { transform: translate(0, 0) scale(0.3) rotate(0deg); opacity: 1; }
  50%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(360deg); opacity: 0; }
}

@keyframes clickTextPop {
  0%   { transform: translateY(0) scale(0.5); opacity: 1; }
  100% { transform: translateY(-60px) scale(1.5); opacity: 0; }
}

/* ======================================================================== */
/* 🎮 NEW GAME STYLES                                                       */
/* ======================================================================== */

/* Game Filter Tabs */
.game-filter-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.game-filter-btn {
  padding: 0.5rem 1.2rem;
  border: 2px solid var(--glass-border);
  border-radius: 50px;
  background: var(--glass);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.game-filter-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(108,99,255,0.3);
}

.game-filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 20px rgba(108,99,255,0.5);
}

/* Simon Says Grid */
.simon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 140px;
  margin: 0 auto;
}

.simon-btn {
  width: 65px;
  height: 65px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 2px solid rgba(255,255,255,0.1);
}

.simon-btn:hover { filter: brightness(1.2); }
.simon-btn:active { transform: scale(0.95); }

/* 2048 Grid */
.grid-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 4px;
  max-width: 220px;
  margin: 0 auto;
}

.tile-2048 {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 4px;
  transition: all 0.1s ease;
}

/* Puzzle Slider Grid */
.slider-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  max-width: 200px;
  margin: 0 auto;
}

.slider-tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.slider-tile:hover:not(.empty) { transform: scale(1.05); filter: brightness(1.2); }
.slider-tile.empty { background: transparent; cursor: default; }

/* ======================================================================== */
/* 🏆 LEADERBOARD STYLES                                                    */
/* ======================================================================== */

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.leaderboard-table th {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.leaderboard-table tr:hover td {
  background: rgba(108,99,255,0.05);
}

.leaderboard-table .rank-1 { color: #ffd700; font-weight: 800; }
.leaderboard-table .rank-2 { color: #c0c0c0; font-weight: 700; }
.leaderboard-table .rank-3 { color: #cd7f32; font-weight: 700; }

.leaderboard-game-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.lb-tab {
  padding: 0.4rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  background: var(--glass);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lb-tab:hover { border-color: var(--accent); }
.lb-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ======================================================================== */
/* 🎖️ ACHIEVEMENT TOAST — Unified                                           */
/* ======================================================================== */

.achievement-toast {
  position: fixed;
  right: -420px;
  z-index: 99999;
  background: linear-gradient(135deg, rgba(200,50,150,0.92), rgba(140,40,200,0.92));
  color: #fff;
  padding: 1rem 1.5rem 1rem 1.2rem;
  border-radius: 18px 0 0 18px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 36px rgba(200,50,150,0.45), 0 0 60px rgba(140,40,200,0.15);
  width: 370px;
  max-width: 90vw;
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-right: none;
  transition: right 0.55s cubic-bezier(.22,.68,.36,1.1), opacity 0.4s ease;
  opacity: 0;
  font-family: inherit;
}
.achievement-toast.show {
  right: 0;
  opacity: 1;
}
.achievement-toast .toast-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.achievement-toast .toast-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.achievement-toast .toast-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.85;
}
.achievement-toast .toast-title {
  font-weight: 800;
  font-size: 1.05rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.achievement-toast .toast-reward {
  font-size: 0.85rem;
  color: #2ed573;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(46,213,115,0.4);
}
.achievement-toast .toast-close {
  position: absolute;
  top: 6px;
  left: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 5px;
  border-radius: 50%;
  transition: color 0.2s;
}
.achievement-toast .toast-close:hover {
  color: #fff;
}

/* ── Diamond tier special ─────────────────────────────── */
.achievement-toast.diamond {
  background: linear-gradient(135deg, rgba(30,60,180,0.95), rgba(80,0,220,0.95), rgba(30,180,220,0.90));
  background-size: 200% 200%;
  animation: diamondShimmer 3s ease-in-out infinite;
  border-color: rgba(120,200,255,0.4);
  box-shadow:
    0 8px 40px rgba(80,0,220,0.5),
    0 0 80px rgba(30,180,220,0.2),
    inset 0 0 30px rgba(120,200,255,0.06);
}
.achievement-toast.diamond .toast-label {
  background: linear-gradient(90deg, #7dd3fc, #c084fc, #7dd3fc);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: diamondTextShimmer 2s linear infinite;
}
.achievement-toast.diamond .toast-title {
  background: linear-gradient(90deg, #fff, #c4b5fd, #7dd3fc, #fff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: diamondTextShimmer 3s linear infinite;
}
.achievement-toast.diamond .toast-reward {
  color: #7dd3fc;
  text-shadow: 0 0 12px rgba(125,211,252,0.5);
}
.achievement-toast.diamond::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 18px 0 0 18px;
  padding: 2px;
  background: linear-gradient(135deg, #7dd3fc, #c084fc, #38bdf8, #a78bfa);
  background-size: 300% 300%;
  animation: diamondBorder 4s ease-in-out infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}
/* Diamond sparkle particles */
.achievement-toast.diamond .diamond-sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkleFloat 1.8s ease-out forwards;
  box-shadow: 0 0 6px 2px rgba(125,211,252,0.6);
}

@keyframes diamondShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes diamondTextShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes diamondBorder {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}
@keyframes sparkleFloat {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--sx, 20px), var(--sy, -30px)) scale(0); }
}

/* ── RGB mode override ────────────────────────────────── */
body.rgb-mode .achievement-toast:not(.diamond) {
  animation: achievementRgb 2s linear infinite;
}
@keyframes achievementRgb {
  0%   { background: linear-gradient(135deg, rgba(255,0,0,0.92), rgba(200,0,100,0.92)); }
  33%  { background: linear-gradient(135deg, rgba(0,200,0,0.92), rgba(0,100,200,0.92)); }
  66%  { background: linear-gradient(135deg, rgba(0,100,255,0.92), rgba(180,0,255,0.92)); }
  100% { background: linear-gradient(135deg, rgba(255,0,0,0.92), rgba(200,0,100,0.92)); }
}

/* ======================================================================== */
/* 🌊 EXTRA MOVEMENT EFFECTS                                                */
/* ======================================================================== */

/* Floating action button pulse */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.btn-primary:active::after {
  width: 300px;
  height: 300px;
}

/* Hover lift on game cards (disabled) */

/* Magnetic hover effect on stat cards */
.stat-card {
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px) rotate(2deg);
  box-shadow: 0 15px 40px rgba(108,99,255,0.2);
}

/* Wobble animation on achievement items */
.achievement-item:hover {
  animation: achieveWobble 0.5s ease;
}

@keyframes achieveWobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg) scale(1.05); }
  75% { transform: rotate(3deg) scale(1.05); }
}

/* Pulsing game score numbers (disabled) */
.game-score {
  display: inline-block;
  animation: none;
}

@keyframes scorePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); text-shadow: 0 0 15px var(--accent); }
}

/* RGB border on focused inputs */
body.rgb-mode input:focus,
body.rgb-mode textarea:focus {
  border-image: linear-gradient(90deg, #ff0080, #00ffff, #ffff00, #8000ff, #ff0080) 1 !important;
  box-shadow: 0 0 20px rgba(108,99,255,0.3) !important;
}

/* Neon glow text for page headers (slowed) */
.page-header h1 {
  animation: neonGlow 6s ease-in-out infinite alternate;
}

@keyframes neonGlow {
  0% { text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent), 0 0 30px var(--accent); }
  50% { text-shadow: 0 0 20px #ff0080, 0 0 40px #ff0080, 0 0 60px #ff0080; }
  100% { text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 40px #00ffff; }
}

/* Slide-up reveal animation */
.card, .game-card, .stat-card {
  animation: slideUpReveal 0.6s ease-out both;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

@keyframes slideUpReveal {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hover ripple on buttons */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: var(--ripple-y, 50%);
  left: var(--ripple-x, 50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

/* Animated navbar underline */
.navbar-links a {
  position: relative;
}

.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff0080, #00ffff);
  transition: width 0.3s ease, left 0.3s ease;
  border-radius: 2px;
}

.navbar-links a:hover::after {
  width: 100%;
  left: 0;
}

/* ======================================================================== */
/* 🎡 ROULETTE GAME                                                         */
/* ======================================================================== */

.roulette-balance-bar {
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
  background: rgba(46,213,115,0.08);
  border: 1px solid rgba(46,213,115,0.2);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.roulette-controls {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.roulette-bet-input {
  width: 100% !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  text-align: center;
}

.roulette-quick-bets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Result display */
.roulette-wheel-area {
  text-align: center;
  padding: 1.5rem 0;
}

.roulette-result-display {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--glass);
  border: 4px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.roulette-result-display.spinning {
  animation: rouletteSpinGlow 0.3s ease-in-out infinite alternate;
}

.roulette-result-display.result.red {
  border-color: #e74c3c;
  background: rgba(231,76,60,0.15);
  box-shadow: 0 0 30px rgba(231,76,60,0.4);
}

.roulette-result-display.result.black {
  border-color: #333;
  background: rgba(0,0,0,0.3);
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
}

.roulette-result-display.result.green {
  border-color: #2ed573;
  background: rgba(46,213,115,0.15);
  box-shadow: 0 0 30px rgba(46,213,115,0.4);
}

.roulette-result-display.green {
  border-color: #2ed573;
}
.roulette-result-display.red {
  border-color: #e74c3c;
}
.roulette-result-display.black {
  border-color: #555;
}

@keyframes rouletteSpinGlow {
  0% { box-shadow: 0 0 15px rgba(108,99,255,0.5); transform: scale(1); }
  100% { box-shadow: 0 0 30px rgba(255,0,128,0.5); transform: scale(1.05); }
}

.roulette-result-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Number grid */
.roulette-number-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin: 0 auto;
}

.roulette-num {
  padding: 0.5rem 0.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
  font-family: inherit;
  text-align: center;
}

.roulette-num.red { background: #c0392b; }
.roulette-num.black { background: #2c3e50; }
.roulette-num.green {
  background: #27ae60;
  grid-column: 1 / -1;
}

.roulette-num:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
  filter: brightness(1.2);
}

.roulette-num:active {
  transform: translateY(0);
}

/* Bet type tabs */
.roulette-bet-tabs {
  display: flex;
  gap: 0;
  background: var(--glass);
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--glass-border);
  margin-bottom: 1rem;
}

.roulette-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  font-size: 0.9rem;
}

.roulette-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.roulette-tab:hover:not(.active) {
  background: rgba(255,255,255,0.05);
}

/* Outside bets grid */
.roulette-outside-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin: 0 auto;
}

.roulette-outside-btn {
  padding: 0.75rem 1rem;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.roulette-outside-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(108,99,255,0.2);
}

.roulette-outside-btn.red-bg {
  background: rgba(231,76,60,0.2);
  border-color: rgba(231,76,60,0.4);
}
.roulette-outside-btn.red-bg:hover {
  background: rgba(231,76,60,0.35);
  border-color: #e74c3c;
}

.roulette-outside-btn.black-bg {
  background: rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.15);
}
.roulette-outside-btn.black-bg:hover {
  background: rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.3);
}

/* Spin result messages */
.spin-msg-win { color: #2ed573 !important; font-weight: 700; font-size: 1.1rem !important; }
.spin-msg-lose { color: #ff4757 !important; font-weight: 600; }
.spin-msg-error { color: #ff4757 !important; }
.spin-msg-spinning { color: var(--accent) !important; animation: pulse 0.5s ease-in-out infinite alternate; }

@keyframes pulse {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* Spin history */
.roulette-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.roulette-history-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  transition: all 0.3s ease;
  animation: chipAppear 0.3s ease-out;
}

.roulette-history-chip.red { background: #c0392b; }
.roulette-history-chip.black { background: #2c3e50; }
.roulette-history-chip.green { background: #27ae60; }
.roulette-history-chip.won { box-shadow: 0 0 8px rgba(46,213,115,0.6); border: 2px solid #2ed573; }

@keyframes chipAppear {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ======================================================================== */
/* 🎖️ ACHIEVEMENTS PAGE                                                     */
/* ======================================================================== */

.achievements-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ach-section h2 {
  font-size: 1.3rem;
}

.achievement-item.locked {
  opacity: 0.55;
}

.achievement-item.locked .achievement-icon {
  filter: grayscale(1);
}

.achievement-item.earned {
  border-color: rgba(108,99,255,0.3);
  background: rgba(108,99,255,0.05);
}

.ach-reward {
  font-weight: 700;
  color: #2ed573;
  font-size: 0.9rem;
  white-space: nowrap;
  background: rgba(46, 213, 115, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(46, 213, 115, 0.25);
  display: inline-block;
}

.achievement-item.locked .ach-reward {
  color: var(--text-muted);
  background: var(--input-bg);
  border-color: var(--glass-border);
}

/* Progress bar */
.ach-progress-bar {
  width: 100%;
  height: 12px;
  background: var(--input-bg);
  border-radius: 6px;
  overflow: hidden;
}

.ach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #2ed573);
  border-radius: 6px;
  transition: width 0.8s ease;
  min-width: 2%;
}

@media (max-width: 768px) {
  .roulette-number-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .roulette-outside-grid {
    grid-template-columns: 1fr 1fr;
  }
  .roulette-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ======================================================== */
/* ⚡ PERFORMANCE MODE (default – RGB disabled)             */
/* ======================================================== */

/* --- Navbar left group for brand + toggle --- */
.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Visual Mode Dropdown + legacy RGB toggle --- */
.visual-mode-dropdown {
  position: relative;
  z-index: 220;
}

.visual-mode-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.34rem 0.65rem;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(18, 24, 40, 0.88);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  min-width: 150px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.visual-mode-trigger:hover {
  border-color: rgba(108, 99, 255, 0.5);
  background: rgba(24, 31, 50, 0.96);
  transform: translateY(-1px);
}

.visual-mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.visual-mode-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  min-width: 0;
}

.visual-mode-kicker {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.visual-mode-current {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-primary);
}

.visual-mode-caret {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: transform 0.18s ease;
}

.visual-mode-dropdown.open .visual-mode-caret {
  transform: rotate(180deg);
}

.visual-mode-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 270px;
  max-width: min(320px, calc(100vw - 2rem));
  padding: 0.5rem;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: rgba(11, 16, 30, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.visual-mode-dropdown.open .visual-mode-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.visual-mode-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.visual-mode-option:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(1px);
}

.visual-mode-option.is-active {
  border-color: rgba(108, 99, 255, 0.45);
  background: rgba(108, 99, 255, 0.16);
}

.visual-mode-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1rem;
}

.visual-mode-option-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.visual-mode-option-title {
  font-size: 0.84rem;
  font-weight: 800;
}

.visual-mode-option-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.visual-mode-option-check {
  font-size: 0.9rem;
  color: #2ed573;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.visual-mode-option.is-active .visual-mode-option-check {
  opacity: 1;
}

.visual-mode-option[data-mode="performance"] .visual-mode-option-icon {
  background: rgba(46, 213, 115, 0.15);
}

.visual-mode-option[data-mode="normal"] .visual-mode-option-icon {
  background: rgba(108, 99, 255, 0.14);
}

.visual-mode-option[data-mode="rgb"] .visual-mode-option-icon {
  background: linear-gradient(135deg, rgba(255, 0, 128, 0.2), rgba(0, 255, 255, 0.2));
}

.rgb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.rgb-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

body.rgb-mode .rgb-toggle {
  background: linear-gradient(135deg, rgba(255,0,128,0.2), rgba(0,255,255,0.2));
  border-color: rgba(255,0,128,0.5);
  color: #fff;
  animation: rgbToggleGlow 3s ease-in-out infinite;
}

@keyframes rgbToggleGlow {
  0%, 100% { border-color: rgba(255,0,128,0.5); box-shadow: 0 0 8px rgba(255,0,128,0.2); }
  50% { border-color: rgba(0,255,255,0.5); box-shadow: 0 0 8px rgba(0,255,255,0.2); }
}

/* --- Hide all heavy visual elements when NOT in RGB mode --- */
body:not(.rgb-mode) .disco-ball,
body:not(.rgb-mode) .disco-lights,
body:not(.rgb-mode) .disco-floor-reflections,
body:not(.rgb-mode) .strobe-overlay,
body:not(.rgb-mode) .rgb-orb,
body:not(.rgb-mode) #cursor-glow,
body:not(.rgb-mode) .particles {
  display: none !important;
}

/* Disable animated strobe background */
body:not(.rgb-mode)::after {
  animation: none !important;
  background: none !important;
}

/* Keep subtle gradient but stop its animation */
body:not(.rgb-mode)::before {
  animation: none !important;
}

/* --- Reset navbar to clean solid style --- */
body:not(.rgb-mode) .navbar {
  border-image: none !important;
  border-bottom: 1px solid var(--glass-border) !important;
  background: var(--glass) !important;
  animation: none !important;
  box-shadow: none !important;
}

body:not(.rgb-mode) .navbar-brand {
  animation: none !important;
  filter: none !important;
}

/* --- Disable ALL heavy animations site-wide --- */
body:not(.rgb-mode) h1,
body:not(.rgb-mode) h2,
body:not(.rgb-mode) .card,
body:not(.rgb-mode) .game-card,
body:not(.rgb-mode) .note-card,
body:not(.rgb-mode) .stat-card,
body:not(.rgb-mode) .achievement-item,
body:not(.rgb-mode) .highscore-item,
body:not(.rgb-mode) .btn-primary,
body:not(.rgb-mode) .badge,
body:not(.rgb-mode) .chat-bubble.sent,
body:not(.rgb-mode) .chat-bubble.received,
body:not(.rgb-mode) .profile-avatar,
body:not(.rgb-mode) .profile-avatar-img,
body:not(.rgb-mode) .page-header h1,
body:not(.rgb-mode) .page-header p,
body:not(.rgb-mode) .icon,
body:not(.rgb-mode) .tab-btn.active {
  animation: none !important;
}

/* --- Reset rainbow/RGB borders to clean glass borders --- */
body:not(.rgb-mode) .card,
body:not(.rgb-mode) .game-card,
body:not(.rgb-mode) .note-card,
body:not(.rgb-mode) .stat-card,
body:not(.rgb-mode) .achievement-item,
body:not(.rgb-mode) .highscore-item {
  border-image: none !important;
  border: 1px solid var(--glass-border) !important;
}

/* Remove conic-gradient blob behind cards */
body:not(.rgb-mode) .card::before {
  display: none !important;
}

/* --- Reset button visuals --- */
body:not(.rgb-mode) .btn-primary {
  box-shadow: 0 4px 15px var(--accent-glow) !important;
}

body:not(.rgb-mode) .btn:hover {
  filter: none !important;
}

/* --- Clean scrollbar --- */
body:not(.rgb-mode) ::-webkit-scrollbar-thumb {
  animation: none !important;
  background: var(--text-muted) !important;
}

/* --- Reset text glow/shadow --- */
body:not(.rgb-mode) h1 {
  filter: none !important;
  text-shadow: none !important;
}

body:not(.rgb-mode) .page-header h1 {
  text-shadow: none !important;
}

/* --- Reset nav link rainbow underline --- */
body:not(.rgb-mode) .navbar-links a::after {
  background: var(--accent) !important;
  animation: none !important;
}

/* --- Reset form focus effects --- */
body:not(.rgb-mode) .form-group input:focus,
body:not(.rgb-mode) .form-group textarea:focus,
body:not(.rgb-mode) .chat-input-area input:focus {
  animation: none !important;
  box-shadow: 0 0 0 3px var(--input-focus) !important;
  border-color: var(--accent) !important;
}

body:not(.rgb-mode) input:focus,
body:not(.rgb-mode) textarea:focus,
body:not(.rgb-mode) select:focus {
  border-image: none !important;
  box-shadow: 0 0 0 3px var(--input-focus) !important;
  border-color: var(--accent) !important;
}

body:not(.rgb-mode) .chat-input-area input {
  border-image: none !important;
  border: 1px solid var(--input-border) !important;
}

/* --- Dedicated performance mode overrides --- */
html.performance-mode {
  scroll-behavior: auto;
}

body.performance-mode {
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --glass: rgba(255, 255, 255, 0.035);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent-glow: rgba(108, 99, 255, 0.14);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  --transition: 0.12s linear;
}

body.performance-mode::before,
body.performance-mode::after {
  content: none !important;
  animation: none !important;
  background: none !important;
}

body.performance-mode .particles,
body.performance-mode .disco-ball,
body.performance-mode .disco-lights,
body.performance-mode .disco-floor-reflections,
body.performance-mode .strobe-overlay,
body.performance-mode .rgb-orb,
body.performance-mode #cursor-glow {
  display: none !important;
}

body.performance-mode .navbar,
body.performance-mode .card,
body.performance-mode .game-card,
body.performance-mode .note-card,
body.performance-mode .stat-card,
body.performance-mode .achievement-item,
body.performance-mode .highscore-item,
body.performance-mode .global-chat-panel,
body.performance-mode .global-chat-header,
body.performance-mode .emoji-picker-popup,
body.performance-mode .modal,
body.performance-mode .modal-content,
body.performance-mode .spectator-bar,
body.performance-mode .visual-mode-menu,
body.performance-mode .visual-mode-trigger {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

body.performance-mode .navbar {
  background: #121828 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.performance-mode .card,
body.performance-mode .game-card,
body.performance-mode .note-card,
body.performance-mode .stat-card,
body.performance-mode .achievement-item,
body.performance-mode .highscore-item {
  border-image: none !important;
}

body.performance-mode .card::before {
  display: none !important;
}

body.performance-mode h1,
body.performance-mode h2,
body.performance-mode .page-header h1,
body.performance-mode .page-header p,
body.performance-mode .badge,
body.performance-mode .profile-avatar,
body.performance-mode .profile-avatar-img,
body.performance-mode .chat-bubble.sent,
body.performance-mode .chat-bubble.received,
body.performance-mode .conversation-item,
body.performance-mode .new-message-flash,
body.performance-mode .game-card,
body.performance-mode .note-card,
body.performance-mode .stat-card,
body.performance-mode .achievement-item,
body.performance-mode .highscore-item {
  animation: none !important;
  filter: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

body.performance-mode .btn,
body.performance-mode .btn-primary,
body.performance-mode .btn-secondary,
body.performance-mode .btn-danger,
body.performance-mode .tab-btn,
body.performance-mode .reaction-chip,
body.performance-mode .reaction-add-btn,
body.performance-mode .navbar-brand,
body.performance-mode .navbar-links a,
body.performance-mode .widget-card,
body.performance-mode .widget-toggle-item {
  animation: none !important;
  filter: none !important;
  box-shadow: none !important;
  transition: border-color 0.12s linear, background-color 0.12s linear, color 0.12s linear !important;
}

body.performance-mode .btn:hover,
body.performance-mode .card:hover,
body.performance-mode .game-card:hover,
body.performance-mode .widget-card:hover,
body.performance-mode .widget-toggle-item:hover {
  transform: none !important;
  box-shadow: none !important;
}

body.performance-mode .form-group input:focus,
body.performance-mode .form-group textarea:focus,
body.performance-mode .chat-input-area input:focus,
body.performance-mode input:focus,
body.performance-mode textarea:focus,
body.performance-mode select:focus {
  animation: none !important;
  box-shadow: 0 0 0 2px var(--input-focus) !important;
  border-color: var(--accent) !important;
}

body.performance-mode ::-webkit-scrollbar-thumb {
  animation: none !important;
  background: var(--text-muted) !important;
}

body.performance-mode [class*="roulette-"],
body.performance-mode [class*="plinko-"],
body.performance-mode [class*="mines-"],
body.performance-mode [class*="chicken-"],
body.performance-mode [class*="blackjack-"],
body.performance-mode [class*="dice-"],
body.performance-mode [class*="rps-"],
body.performance-mode [class*="wheel-"],
body.performance-mode [class*="trop-"],
body.performance-mode [class*="rs-"] {
  filter: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

body.performance-mode .bucket.mult-mega,
body.performance-mode .bucket.hit,
body.performance-mode .trop-history-item.current,
body.performance-mode .trop-action-btn.cashout,
body.performance-mode .trop-multiplier,
body.performance-mode .trop-multiplier.running,
body.performance-mode .trop-multiplier.high,
body.performance-mode .trop-multiplier.mega,
body.performance-mode .rs-cell.spinning,
body.performance-mode .rs-cell.win-highlight,
body.performance-mode .rs-cell.mystery-cell,
body.performance-mode .rs-cell.golden-cell,
body.performance-mode .rs-cell.reveal-anim,
body.performance-mode .rs-spin-btn.spinning,
body.performance-mode .rs-win-display.has-win,
body.performance-mode .rs-bigwin-title,
body.performance-mode .rs-bigwin-tier,
body.performance-mode .rs-bigwin-amount,
body.performance-mode .rs-bigwin-hint {
  animation: none !important;
}

body.performance-mode.tropicana-page {
  background: linear-gradient(180deg, #0b2941 0%, #113a55 100%) !important;
}

body.performance-mode .trop-cloud,
body.performance-mode .trop-wave,
body.performance-mode .trop-seaweed,
body.performance-mode .trop-fish,
body.performance-mode .trop-bubble,
body.performance-mode .trop-birds,
body.performance-mode .trop-flamingo,
body.performance-mode .trop-splash,
body.performance-mode .trop-confetti,
body.performance-mode .rs-bubbles,
body.performance-mode .rs-bigwin-rays {
  display: none !important;
  animation: none !important;
}

body.performance-mode .rs-bigwin-overlay {
  background: rgba(2, 8, 18, 0.92) !important;
}

/* --- Responsive: compact visual mode menu on small screens --- */
@media (max-width: 768px) {
  .visual-mode-trigger {
    min-width: auto;
    padding-right: 0.65rem;
  }

  .visual-mode-kicker,
  .visual-mode-option-desc,
  .rgb-toggle .rgb-label {
    display: none;
  }

  .visual-mode-menu {
    min-width: min(240px, calc(100vw - 1.25rem));
  }
}

/* ======================================================================== */
/* 💬 GLOBAL GAME CHAT PANEL                                                */
/* ======================================================================== */

/* Game pages get a wrapper so the game shifts left and chat sits right */
.game-page-with-chat {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

.game-page-with-chat > .container {
  flex: 1;
  min-width: 0;
  max-width: 1100px;
}

/* Chat panel itself — fixed right sidebar */
.global-chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  padding-top: var(--navbar-h, 62px);
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 30, 0.97);
  border-left: 1px solid var(--glass-border);
  border-radius: var(--radius) 0 0 var(--radius);
  z-index: 99;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.3s ease;
}

.global-chat-panel.collapsed {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

/* Make room for chat: push content left; center when closed */
body.has-global-chat .container {
  margin-left: auto;
  margin-right: auto;
  transform: translateX(calc(-1 * var(--global-chat-shift, 0px)));
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}
body.has-global-chat.chat-hidden .container {
  transform: translateX(0);
}

/* Header */
.global-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: var(--radius) 0 0 0;
  flex-shrink: 0;
}

.global-chat-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.global-chat-toggle {
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.global-chat-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(108,99,255,0.1);
}

/* Message area */
.global-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.global-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.global-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.global-chat-messages::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 2px;
}

.global-chat-loading,
.global-chat-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 2rem 0.5rem;
}

/* Single message */
.gc-msg {
  display: flex;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  transition: background 0.2s, border-color 0.2s;
}
.gc-msg:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.18);
}
.gc-msg.gc-mine {
  background: rgba(108, 99, 255, 0.08);
  border-color: rgba(108, 99, 255, 0.2);
}

.gc-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  background: var(--bg-secondary);
}

.gc-msg-body {
  flex: 1;
  min-width: 0;
}

.gc-msg-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}

.gc-msg-user {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent);
}
.gc-msg.gc-mine .gc-msg-user {
  color: #2ed573;
}

.gc-msg-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

.gc-msg-text {
  font-size: 0.84rem;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

/* Input area */
.global-chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: 0 0 0 var(--radius);
  flex-shrink: 0;
}

.global-chat-input-area input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.global-chat-input-area input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--input-focus);
}

.global-chat-input-area button#global-chat-send {
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.global-chat-input-area button#global-chat-send:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 0 12px var(--accent-glow);
}
.global-chat-input-area button#global-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}
#gc-attach-btn:hover {
  color: var(--accent) !important;
}

/* FAB (floating action button) to reopen */
.global-chat-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: 2px solid var(--glass-border);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 901;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.global-chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(108,99,255,0.6);
}

/* ── RGB Mode — Chat ── */
body.rgb-mode .global-chat-panel {
  border-left-color: transparent;
  border-image: linear-gradient(180deg, #ff0080, #00ffff, #ff0080) 1;
}

body.rgb-mode .global-chat-header {
  background: linear-gradient(135deg, rgba(255,0,128,0.08), rgba(0,255,255,0.08));
}

body.rgb-mode .global-chat-title {
  background: linear-gradient(90deg, #ff0080, #00ffff, #ff0080);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rgbTextShift 3s linear infinite;
}

@keyframes rgbTextShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

body.rgb-mode .gc-msg-user {
  animation: rgbTextShift 4s linear infinite;
  background: linear-gradient(90deg, #ff0080, #00ffff, #ffa502, #2ed573, #ff0080);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.rgb-mode .gc-msg.gc-mine {
  border-color: rgba(255,0,128,0.2);
  background: linear-gradient(135deg, rgba(255,0,128,0.06), rgba(0,255,255,0.06));
}

body.rgb-mode .global-chat-input-area input[type="text"]:focus {
  border-color: #ff0080;
  box-shadow: 0 0 0 2px rgba(255,0,128,0.3);
  animation: rgbBorderPulse 2s ease infinite;
}

@keyframes rgbBorderPulse {
  0%, 100% { border-color: #ff0080; box-shadow: 0 0 0 2px rgba(255,0,128,0.3); }
  33% { border-color: #00ffff; box-shadow: 0 0 0 2px rgba(0,255,255,0.3); }
  66% { border-color: #ffa502; box-shadow: 0 0 0 2px rgba(255,165,2,0.3); }
}

body.rgb-mode .global-chat-input-area button#global-chat-send {
  background: linear-gradient(135deg, #ff0080, #6c63ff, #00ffff);
  background-size: 200% 200%;
  animation: rgbBtnShift 3s ease infinite;
}

@keyframes rgbBtnShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body.rgb-mode .global-chat-fab {
  background: linear-gradient(135deg, #ff0080, #6c63ff, #00ffff);
  background-size: 200% 200%;
  animation: rgbBtnShift 3s ease infinite;
  box-shadow: 0 4px 20px rgba(255,0,128,0.4);
}
body.rgb-mode .global-chat-fab:hover {
  box-shadow: 0 6px 28px rgba(0,255,255,0.5);
}

body.rgb-mode .global-chat-toggle:hover {
  border-color: #ff0080;
  background: rgba(255,0,128,0.1);
}

/* ── Performance mode reset for chat ── */
body:not(.rgb-mode) .global-chat-panel {
  border-image: none !important;
}
body:not(.rgb-mode) .global-chat-title {
  background: none !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}
body:not(.rgb-mode) .gc-msg-user {
  background: none !important;
  -webkit-text-fill-color: var(--accent) !important;
}
body:not(.rgb-mode) .gc-msg.gc-mine .gc-msg-user {
  -webkit-text-fill-color: #2ed573 !important;
}

/* ── Global Chat: Reactions ── */
.gc-msg .gc-reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
  align-items: center;
}
.gc-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.gc-reaction-chip:hover {
  background: rgba(108,99,255,0.15);
  border-color: rgba(108,99,255,0.3);
}
.gc-reaction-chip.active {
  background: rgba(108,99,255,0.18);
  border-color: rgba(108,99,255,0.35);
  color: var(--text-primary);
}
.gc-react-add {
  background: none;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.68rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  font-family: inherit;
  opacity: 0;
  position: relative;
  z-index: 2;
}
.gc-msg:hover .gc-react-add {
  opacity: 1;
}
.gc-react-add:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Global Chat: Emoji picker (scoped so it doesn't conflict) */
.gc-emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: rgba(15,15,30,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 5px 6px;
  position: fixed;
  z-index: 10000;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  animation: emojiPopIn 0.15s ease;
  max-width: 210px;
  backdrop-filter: blur(12px);
}
.gc-emoji-picker button {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
  transition: background 0.1s;
  line-height: 1;
}
.gc-emoji-picker button:hover {
  background: rgba(108,99,255,0.2);
}

/* Global Chat: Reply banner */
.gc-reply-banner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-top: 1px solid rgba(108,99,255,0.15);
  background: rgba(108,99,255,0.05);
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
  animation: gcSlideUp 0.15s ease;
}
@keyframes gcSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gc-reply-banner .gc-reply-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.gc-reply-banner .gc-reply-user {
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.3rem;
}
.gc-reply-banner .gc-reply-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  border-radius: 50%;
  transition: color 0.2s;
}
.gc-reply-banner .gc-reply-close:hover {
  color: var(--text-primary);
}

/* Reply quote inside message */
.gc-reply-quote {
  background: rgba(255,255,255,0.03);
  border-left: 2px solid rgba(108,99,255,0.5);
  border-radius: 0 4px 4px 0;
  padding: 2px 6px;
  margin-bottom: 3px;
  font-size: 0.68rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.35;
}
.gc-reply-quote:hover {
  background: rgba(108,99,255,0.1);
}
.gc-reply-quote .gc-reply-quote-user {
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.25rem;
  font-size: 0.68rem;
}

/* Global Chat: Image */
.gc-msg-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 160px;
  max-height: 120px;
  border-radius: 6px;
  margin-top: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
  border: 1px solid rgba(255,255,255,0.08);
  object-fit: cover;
}
.gc-msg-image:hover {
  opacity: 0.85;
}

/* Image preview in input */
.gc-image-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(46,213,115,0.06);
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  animation: gcSlideUp 0.2s ease;
  max-height: 48px;
  overflow: hidden;
}
.gc-image-preview img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.gc-image-preview .gc-img-remove {
  background: none;
  border: none;
  color: #ff4757;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* @Mention highlight in messages */
.gc-mention {
  color: #ff4757;
  font-weight: 700;
  cursor: pointer;
}
.gc-mention:hover {
  text-decoration: underline;
}

/* @Mention autocomplete dropdown */
.gc-mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 8px 8px 0 0;
  max-height: 200px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
  animation: gcSlideUp 0.15s ease;
}
.gc-mention-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.82rem;
}
.gc-mention-item:hover, .gc-mention-item.active {
  background: rgba(108,99,255,0.15);
}
.gc-mention-item img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* Message action buttons (reply) */
.gc-msg-actions {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 3;
}
.gc-msg:hover .gc-msg-actions {
  opacity: 1;
}
.gc-msg-actions button {
  background: rgba(15,15,30,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.65rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  line-height: 1.2;
  backdrop-filter: blur(6px);
}
.gc-msg-actions button:hover {
  background: rgba(108,99,255,0.25);
  color: var(--text-primary);
  border-color: rgba(108,99,255,0.3);
}

/* Make gc-msg position relative for actions */
.gc-msg {
  position: relative;
}

/* Mention notification toast (red variant) */
.mention-toast {
  position: fixed;
  right: -420px;
  z-index: 99999;
  background: linear-gradient(135deg, rgba(255,71,87,0.95), rgba(200,30,60,0.95));
  color: #fff;
  padding: 0.8rem 1.2rem 0.8rem 1rem;
  border-radius: 18px 0 0 18px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 8px 36px rgba(255,71,87,0.45), 0 0 60px rgba(200,30,60,0.15);
  width: 340px;
  max-width: 90vw;
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-right: none;
  transition: right 0.55s cubic-bezier(.22,.68,.36,1.1), opacity 0.4s ease;
  opacity: 0;
  font-family: inherit;
}
.mention-toast.show {
  right: 0;
  opacity: 1;
}
.mention-toast .mention-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.mention-toast .mention-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.mention-toast .mention-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.85;
}
.mention-toast .mention-user {
  font-weight: 800;
  font-size: 0.95rem;
}
.mention-toast .mention-text {
  font-size: 0.78rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mention-toast .mention-close {
  position: absolute;
  top: 4px;
  left: 6px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
  border-radius: 50%;
}
.mention-toast .mention-close:hover {
  color: #fff;
}

/* Image lightbox */
.gc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: gcFadeIn 0.2s ease;
}
@keyframes gcFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.gc-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* Global chat input area — relative for mention dropdown */
.global-chat-input-area {
  position: relative;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .global-chat-panel {
    width: 280px;
  }
}

@media (max-width: 900px) {
  .global-chat-panel {
    width: 100%;
    top: auto;
    bottom: 0;
    height: 50vh;
    padding-top: 0;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .global-chat-header {
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .global-chat-input-area {
    border-radius: 0;
  }
  body.has-global-chat .container {
    margin-right: auto;
    padding-bottom: 52vh;
    transform: none;
  }
  body.has-global-chat.chat-hidden .container {
    padding-bottom: 2rem;
    transform: none;
  }
}
