/* ══════════════════════════════════════════════
   NOTIFICATIONS HUD — flutuante, discreto
══════════════════════════════════════════════ */

/* Botão flutuante */
#notif-fab {
  position: fixed;
  bottom: calc(var(--navbar-h) + var(--safe-bottom) + 12px);
  right: 12px;
  width: 40px;
  height: 40px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: none;           /* mostrado após login */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 18px;
  user-select: none;
}
#notif-fab.show { display: flex; }
#notif-fab.has-new {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(0,212,255,0.3);
  animation: notifPulse 1.5s ease-in-out infinite;
}
@keyframes notifPulse {
  0%, 100% { box-shadow: 0 0 6px var(--accent), 0 0 12px rgba(0,212,255,0.2); }
  50%       { box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(0,212,255,0.5); }
}

#notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: white;
  font-family: 'Press Start 2P';
  font-size: 7px;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#notif-badge.show { display: flex; }

/* Painel de notificações */
#notif-panel {
  position: fixed;
  bottom: calc(var(--navbar-h) + var(--safe-bottom) + 60px);
  right: 12px;
  width: min(320px, calc(100vw - 24px));
  max-height: 420px;
  background: var(--panel);
  border: 2px solid var(--border2);
  display: none;
  flex-direction: column;
  z-index: 499;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
#notif-panel.open { display: flex; }

#notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-title {
  font-family: 'Press Start 2P';
  font-size: 7px;
  color: var(--accent);
  letter-spacing: 1px;
}
.notif-clear-all {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dark);
  font-family: 'Press Start 2P';
  font-size: 6px;
  padding: 3px 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.notif-clear-all:hover { color: var(--red); border-color: var(--red); }

#notif-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.notif-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dark);
  font-size: 14px;
}

/* Item de notificação */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  animation: notifSlideIn 0.2s ease;
}
.notif-item:hover { background: rgba(0,212,255,0.04); }
.notif-item.unread { background: rgba(0,212,255,0.06); }
@keyframes notifSlideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Convite de batalha — destaque especial */
.notif-item.battle-invite {
  border-left: 3px solid var(--red);
  background: rgba(255,68,102,0.06);
}
.notif-item.battle-invite:hover { background: rgba(255,68,102,0.1); }

.notif-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-family: 'Press Start 2P';
  font-size: 6px;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.4;
}
.notif-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.notif-time {
  font-size: 11px;
  color: var(--text-dark);
  margin-top: 3px;
  font-family: 'Share Tech Mono';
}
.notif-close {
  background: none; border: none;
  color: var(--text-dark); cursor: pointer;
  font-size: 14px; padding: 2px 4px;
  line-height: 1; flex-shrink: 0;
  transition: color 0.12s;
}
.notif-close:hover { color: var(--red); }

/* Timer de convite de batalha */
.notif-invite-timer {
  font-family: 'Press Start 2P';
  font-size: 7px;
  color: var(--orange);
  margin-top: 4px;
}
.notif-invite-actions {
  display: flex; gap: 6px; margin-top: 6px;
}
.notif-btn-accept {
  background: var(--green); color: var(--bg);
  border: none; font-family: 'Press Start 2P'; font-size: 6px;
  padding: 5px 8px; cursor: pointer;
}
.notif-btn-decline {
  background: none; border: 2px solid var(--red);
  color: var(--red); font-family: 'Press Start 2P'; font-size: 6px;
  padding: 5px 8px; cursor: pointer;
}
