/* ==================== LOGO ==================== */
.logo-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-on-accent);
}

.logo-mark--lg {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  font-size: 1.6rem;
}

.logo-mark__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.logo-mark__glow {
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: var(--accent-gradient);
  filter: blur(14px);
  opacity: 0.55;
  z-index: -1;
}

/* ==================== NAV LINKS (topbar) ==================== */
.nav-link {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link[aria-current="page"] {
  color: var(--text-on-accent);
  background: var(--accent-gradient);
  box-shadow: var(--shadow-glow-primary);
}

/* ==================== ICON / AVATAR BUTTONS ==================== */
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 1.05rem;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--border-medium);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.avatar-btn:hover {
  border-color: var(--accent-secondary);
  transform: translateY(-1px);
}

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

.wallet-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--accent-secondary-soft);
  border: 1px solid rgba(0, 229, 199, 0.25);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-secondary);
}

/* ==================== BOUTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), filter var(--transition-fast);
  white-space: nowrap;
}

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

.btn--primary {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-glow-primary);
}

.btn--primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

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

.btn--secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

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

.btn--ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn--block {
  width: 100%;
}

.btn--lg {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.btn--discord {
  background: #5865f2;
  color: #ffffff;
}

.btn--discord:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn--discord:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

/* ==================== CARTES ==================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.card--interactive {
  cursor: pointer;
}

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

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--soon {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
}

.badge--live {
  background: rgba(53, 214, 138, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(53, 214, 138, 0.3);
}

/* ==================== BARRE DE PROGRESSION (XP) ==================== */
.progress-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-bar__fill {
  position: relative;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width var(--transition-slow);
}

.progress-bar__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 2.4s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ==================== AVATAR AVEC ANNEAU DE NIVEAU ==================== */
.avatar-ring {
  position: relative;
  border-radius: var(--radius-full);
  padding: 4px;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-glow-primary);
}

.avatar-ring img {
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-base);
}

.level-pill {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-base);
  border: 1px solid var(--accent-secondary);
  color: var(--accent-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ==================== STAT ITEM ==================== */
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.stat-tile__value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-tile__label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==================== MODALE ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 7, 12, 0.72);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 26px;
}

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

.modal-header h3 {
  font-size: 1.15rem;
}

.modal-close {
  flex-shrink: 0;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==================== FORMULAIRES ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.form-input--code {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.form-error {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid rgba(255, 92, 122, 0.3);
  color: var(--color-danger);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Segmented control (ex: partie publique / privée) */
.segmented {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
}

.segmented__btn {
  flex: 1;
  padding: 10px;
  border-radius: calc(var(--radius-md) - 4px);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.segmented__btn.is-active {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.empty-state__icon {
  font-size: 2.6rem;
  opacity: 0.6;
}

/* ==================== STATUT DE PRÉSENCE (amis) ==================== */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-dot--online {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(53, 214, 138, 0.7);
}

.status-dot--ingame {
  background: var(--color-warning);
  box-shadow: 0 0 6px rgba(255, 200, 87, 0.7);
}

.status-dot--offline {
  background: var(--text-tertiary);
}

/* ==================== NOTIFICATION D'INVITATION À JOUER ==================== */
.invite-toast-stack {
  position: fixed;
  top: calc(var(--topbar-height) + 16px);
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(360px, calc(100vw - 32px));
}

.invite-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.invite-toast__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.invite-toast__body {
  flex: 1;
  min-width: 0;
}

.invite-toast__title {
  font-size: 0.85rem;
}

.invite-toast__game {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.invite-toast__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invite-toast__actions .btn {
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* ==================== CHAT (global + lobby) ==================== */
.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-panel__messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
  min-height: 160px;
  overflow-y: auto;
  padding: 4px 2px;
}

.chat-panel__empty {
  margin: auto;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  text-align: center;
}

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

.chat-panel__form .form-input {
  flex: 1;
}

.chat-panel__hint {
  color: var(--color-danger);
  font-size: 0.78rem;
  text-align: center;
}

.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-message__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.chat-message__body {
  flex: 1;
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.chat-message--me .chat-message__body {
  background: var(--accent-primary-soft);
  border-color: var(--border-accent);
}

.chat-message__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-message__author {
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-message__time {
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

.chat-message__content {
  font-size: 0.88rem;
  word-break: break-word;
  white-space: pre-wrap;
}

/* ==================== BULLE DE CHAT GLOBAL ==================== */
.global-chat-bubble {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 150;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-glow-primary), var(--shadow-lg);
  transition: transform var(--transition-fast);
}

.global-chat-bubble:hover {
  transform: translateY(-3px) scale(1.03);
}

@media (max-width: 860px) {
  .global-chat-bubble {
    bottom: calc(var(--bottom-nav-height) + 16px);
  }
}

/* ==================== CLOCHE DE NOTIFICATIONS ==================== */
.notif-bell {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: var(--text-primary);
  font-size: 0.65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-base);
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-align: left;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.notif-item:hover {
  border-color: var(--border-medium);
}

.notif-item--unread {
  border-color: var(--border-accent);
  background: var(--accent-primary-soft);
}

.notif-item__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.notif-item__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.notif-item__text {
  font-size: 0.86rem;
  line-height: 1.4;
}

.notif-item__time {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

/* ==================== AVATAR COSMÉTIQUE (emoji) ==================== */
.avatar-ring .cosmetic-avatar-emoji {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  border-radius: 50%;
  border: 3px solid var(--bg-base);
  background: var(--bg-elevated);
}

/* ==================== EFFETS DE PROFIL (cosmétiques) ==================== */
.effect-sparkle {
  animation: effect-sparkle-pulse 2s ease-in-out infinite;
}
@keyframes effect-sparkle-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(255, 255, 255, 0.15); }
  50% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.45); }
}

.effect-aurora {
  animation: effect-aurora-glow 6s ease-in-out infinite;
}
@keyframes effect-aurora-glow {
  0% { box-shadow: 0 0 30px rgba(124, 92, 255, 0.4); }
  33% { box-shadow: 0 0 30px rgba(0, 229, 199, 0.4); }
  66% { box-shadow: 0 0 30px rgba(255, 92, 122, 0.4); }
  100% { box-shadow: 0 0 30px rgba(124, 92, 255, 0.4); }
}

.effect-embers {
  animation: effect-embers-glow 2.4s ease-in-out infinite;
}
@keyframes effect-embers-glow {
  0%, 100% { box-shadow: 0 0 26px rgba(255, 140, 66, 0.25); }
  50% { box-shadow: 0 0 42px rgba(255, 92, 122, 0.5); }
}
