/* ════════════════════════════════════════════════════════════════════
   DB-CUENTA — estilos de la barra de cuenta y diálogos.
   Estética alineada con battlemon: fuente del juego, colores oscuros,
   botones con relieve.
   ════════════════════════════════════════════════════════════════════ */

.cuenta-bar {
  position: fixed; top: 10px; right: 12px; z-index: 900;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end; max-width: 92vw;
  padding: 6px 10px; font-family: var(--game, 'Rajdhani', sans-serif);
  background: rgba(12, 16, 22, .6); border: 1px solid rgba(60, 74, 92, .5);
  border-radius: 12px; backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.cuenta-info, .cuenta-nombre {
  color: #cdd6e0; font-weight: 600; font-size: .95rem; letter-spacing: .3px;
}
.cuenta-nombre { color: #fff; }

.cuenta-btn {
  font-family: var(--game, 'Rajdhani', sans-serif);
  font-weight: 700; font-size: .9rem; letter-spacing: .4px;
  color: #fff; background: #2a3340; border: 1px solid #3d4a5c;
  border-radius: 8px; padding: 5px 14px; cursor: pointer;
  box-shadow: 0 2px 0 #1b222c; transition: transform .1s, background .15s;
}
.cuenta-btn:hover { background: #34404f; }
.cuenta-btn:active { transform: translateY(2px); box-shadow: 0 0 0 #1b222c; }
.cuenta-entrar, .cuenta-ok { background: #2f6d4f; border-color: #3f8a64; box-shadow: 0 2px 0 #1d4632; }
.cuenta-entrar:hover, .cuenta-ok:hover { background: #387f5c; }
.cuenta-crear { background: #2f5a8a; border-color: #3f72ad; box-shadow: 0 2px 0 #1d3a5c; }
.cuenta-crear:hover { background: #386ba3; }
.cuenta-salir { background: #6d2f2f; border-color: #8a3f3f; box-shadow: 0 2px 0 #461d1d; }
.cuenta-guardar:disabled { opacity: .6; cursor: default; }

/* ── Diálogos (entrar / crear / conflicto) ── */
.cuenta-ov {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(6, 9, 14, .72); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.cuenta-card {
  width: 100%; max-width: 360px; background: #18202b;
  border: 1px solid #2c3744; border-radius: 16px; padding: 22px;
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
  font-family: var(--game, 'Rajdhani', sans-serif);
}
.cuenta-card h3 { margin: 0 0 6px; color: #fff; font-size: 1.4rem; letter-spacing: .5px; }
.cuenta-sub { margin: 0 0 16px; color: #9fb0c0; font-size: .92rem; line-height: 1.35; }
.cuenta-sub b { color: #cfe0ef; }
.cuenta-in {
  width: 100%; box-sizing: border-box; margin-bottom: 10px;
  font-family: var(--game, 'Rajdhani', sans-serif); font-size: 1rem;
  color: #fff; background: #0f1620; border: 1px solid #2c3744;
  border-radius: 9px; padding: 11px 13px; outline: none;
}
.cuenta-in:focus { border-color: #3f8a64; }
.cuenta-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.cuenta-cancel { background: #2a3340; }
.cuenta-switch {
  display: block; width: 100%; margin-top: 14px; padding: 6px;
  background: none; border: none; color: #6fa8dc; cursor: pointer;
  font-family: var(--game, 'Rajdhani', sans-serif); font-size: .9rem;
}
.cuenta-switch:hover { color: #8fc0ef; text-decoration: underline; }

.cuenta-conf-acts { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.cuenta-conf-acts .cuenta-btn { width: 100%; padding: 11px; font-size: .98rem; }

/* ── Buzón de regalos ── */
.cuenta-buzon { background: #5a4a8a; border-color: #6f5cad; box-shadow: 0 2px 0 #3a2f5c; }
.cuenta-buzon:hover { background: #6a58a3; }
.buzon-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; max-height: 50vh; overflow-y: auto; }
.buzon-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #0f1620; border: 1px solid #2c3744; border-radius: 10px; padding: 10px 12px;
}
.buzon-cinfo { color: #fff; font-size: 1rem; display: flex; flex-direction: column; }
.buzon-de { color: #9fb0c0; font-size: .82rem; }
.buzon-acts { display: flex; gap: 6px; flex-shrink: 0; }
.buzon-acts .cuenta-btn { padding: 5px 11px; font-size: .85rem; }

/* ── Buzón tipo correo ── */
.buzon-card { max-width: 440px; }
.buzon-tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.buzon-tab {
  flex: 1; font-family: var(--game, 'Rajdhani', sans-serif); font-weight: 700; font-size: .95rem;
  color: #9fb0c0; background: #131b25; border: 1px solid #2c3744; border-radius: 9px;
  padding: 8px; cursor: pointer;
}
.buzon-tab.on { color: #fff; background: #2a3a52; border-color: #3f72ad; }
.buzon-sec .buzon-list { max-height: 46vh; overflow-y: auto; }
.buzon-item .buzon-icon { font-size: 1.4rem; flex-shrink: 0; }
.buzon-item { display: flex; align-items: center; gap: 10px; }
.buzon-rechazar { background: #6d2f2f; border-color: #8a3f3f; padding: 5px 10px !important; }
.buzon-vacio { color: #8194a6; text-align: center; padding: 20px; font-size: .92rem; }
.buzon-nuevo-msg { width: 100%; margin-top: 10px; }

/* Mensajes */
.buzon-msg {
  background: #0f1620; border: 1px solid #2c3744; border-radius: 10px;
  padding: 9px 11px; margin-bottom: 8px;
}
.buzon-msg.no-leido { border-color: #3f72ad; box-shadow: 0 0 0 1px rgba(63,114,173,.4); }
.buzon-msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.buzon-msg-head b { color: #cfe0ef; font-size: .92rem; }
.buzon-msg-fecha { color: #8194a6; font-size: .76rem; margin-left: auto; }
.buzon-msg-del { background: none; border: none; color: #8194a6; cursor: pointer; font-size: .9rem; padding: 2px 4px; }
.buzon-msg-del:hover { color: #e0484b; }
.buzon-msg-texto { color: #d8e2ec; font-size: .95rem; line-height: 1.35; word-break: break-word; }
.cuenta-textarea { resize: vertical; min-height: 80px; font-family: var(--game, 'Rajdhani', sans-serif); }

/* ── Animación: carta volando a su hueco del álbum al reclamar ── */
.rewards-fly-card {
  position: fixed; z-index: 10000; border-radius: 10px; pointer-events: none;
  background-size: cover; background-position: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.6), 0 0 24px rgba(79,209,122,.6);
}
/* Destello en la celda al recibir la carta. */
.rewards-cell-pop { animation: rewardsCellPop .7s ease; }
@keyframes rewardsCellPop {
  0% { box-shadow: 0 0 0 0 rgba(79,209,122,.9); transform: scale(1); }
  40% { box-shadow: 0 0 22px 8px rgba(79,209,122,.85); transform: scale(1.12); }
  100% { box-shadow: 0 0 0 0 rgba(79,209,122,0); transform: scale(1); }
}

/* ── Badge rojo de notificaciones en el botón Buzón ── */
.cuenta-buzon { position: relative; }
.cuenta-badge {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px;
  padding: 0 4px; border-radius: 9px; background: #e0484b; color: #fff;
  font-size: .72rem; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px #18202b, 0 0 8px rgba(224,72,75,.7);
}

/* ── Banner "Tienes un regalo de X" ── */
.cuenta-banner {
  position: fixed; top: 64px; left: 50%; transform: translate(-50%, -120%);
  z-index: 9500; display: flex; align-items: center; gap: 10px;
  background: #14241a; border: 1.5px solid #4fd17a; border-radius: 14px;
  padding: 10px 14px; color: #eaffef; font-family: var(--game, 'Rajdhani', sans-serif);
  font-weight: 700; box-shadow: 0 0 22px rgba(79,209,122,.55), 0 8px 30px rgba(0,0,0,.5);
  opacity: 0; transition: transform .4s cubic-bezier(.2,.8,.3,1), opacity .4s;
  max-width: 90vw;
}
.cuenta-banner.on { transform: translate(-50%, 0); opacity: 1; }
.cuenta-banner-ico { font-size: 1.3rem; }
.cuenta-banner-ver {
  margin-left: 4px; font-family: var(--game, 'Rajdhani', sans-serif); font-weight: 800;
  color: #04210f; background: #4fd17a; border: none; border-radius: 8px;
  padding: 5px 12px; cursor: pointer;
}

/* ── Cuadrícula de regalos recibidos ── */
.rg-card { max-width: 540px; }
.rg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px; max-height: 60vh; overflow-y: auto; padding: 6px 2px; margin-bottom: 12px;
}
.rg-cell {
  position: relative; border-radius: 12px; padding: 8px 6px 6px; text-align: center;
  border: 2px solid transparent;
}
.rg-nueva { border-color: #4fd17a; box-shadow: 0 0 16px rgba(79,209,122,.55); background: rgba(79,209,122,.07); }
.rg-repe  { border-color: #e0484b; box-shadow: 0 0 14px rgba(224,72,75,.45); background: rgba(224,72,75,.06); }
.rg-badge {
  font-weight: 800; font-size: .72rem; letter-spacing: .5px; margin-bottom: 5px;
  font-family: var(--game, 'Rajdhani', sans-serif);
}
.rg-nueva .rg-badge { color: #4fd17a; }
.rg-repe .rg-badge { color: #ff7a7c; }
.rg-face { transform: scale(.92); }
.rg-name { font-size: .8rem; color: #cfe0ef; margin-top: 4px; font-family: var(--game, 'Rajdhani', sans-serif); }
.buzon-reclamar-todo { width: 100%; margin-bottom: 10px; font-size: 1rem; }
.buzon-ir-enviar { width: 100%; margin-top: 10px; background: #2f5a8a; border-color: #3f72ad; }

/* Botón "Enviar" en la sección de duplicados de la colección. */
.dup-send { background: #2f5a8a !important; border-color: #3f72ad !important; color: #fff !important; }
.dup-send:hover { background: #386ba3 !important; }
.dup-bulk-send { background: #2f5a8a; border-color: #3f72ad; color: #fff; }
.dup-bulk-send:hover { background: #386ba3; }
.dup-bulk-send:disabled { opacity: .5; cursor: default; }
.dup-bulk-cancel { background: #3a4250; }

/* Modo selección múltiple de duplicados. */
.dup-cell-sel { outline: 3px solid #4fd17a; outline-offset: 2px; border-radius: 10px; }
.dup-sel-check {
  width: 26px; height: 26px; margin: 4px auto 0; border-radius: 50%;
  border: 2px solid #4fd17a; color: #0c1118; background: transparent;
  display: flex; align-items: center; justify-content: center; font-weight: 900;
}
.dup-sel-check.on { background: #4fd17a; }

/* ── Envío: contactos recientes y aviso de usuario inexistente ── */
.cuenta-chips-wrap { margin: 2px 0 12px; }
.cuenta-chips-lbl { display: block; color: #9fb0c0; font-size: .82rem; margin-bottom: 5px; }
.cuenta-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cuenta-chip {
  display: inline-flex; align-items: center; background: #1c2734;
  border: 1px solid #33445a; border-radius: 20px; overflow: hidden;
}
.cuenta-chip-nom {
  font-family: var(--game, 'Rajdhani', sans-serif); font-weight: 700; font-size: .85rem;
  color: #cfe0ef; background: none; border: none; padding: 4px 4px 4px 12px; cursor: pointer;
}
.cuenta-chip:hover { background: #26384c; }
.cuenta-chip-x {
  background: none; border: none; color: #8194a6; cursor: pointer;
  font-size: .8rem; padding: 4px 9px 4px 4px;
}
.cuenta-chip-x:hover { color: #e0484b; }
/* Campo con error (usuario no existe): glow rojo. */
.cuenta-in-err {
  border-color: #e0484b !important;
  box-shadow: 0 0 0 2px rgba(224,72,75,.35), 0 0 14px 2px rgba(224,72,75,.5) !important;
  animation: cuentaErrShake .3s;
}
.cuenta-para-err { color: #ff8f8f; font-size: .85rem; min-height: 0; margin: -6px 0 8px; display: none; }
.cuenta-para-err.on { display: block; }
@keyframes cuentaErrShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ── Filtros de Duplicados (generación / rareza) ── */
.dup-filters { display: flex; gap: 8px; padding: 8px 12px 0; flex-wrap: wrap; }
.dup-filter-sel {
  font-family: var(--game, 'Rajdhani', sans-serif); font-weight: 700; font-size: .9rem;
  color: #fff; background: #1c2734; border: 1px solid #33445a; border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
}
.dup-filter-sel:focus { outline: none; border-color: #4a90d9; }

/* En móvil, barra más compacta para no tapar el título. Y bajada por debajo del
   notch / Dynamic Island con safe-area-inset (iPhone con notch). Solo móvil. */
@media (max-width: 560px) {
  .cuenta-bar { top: calc(env(safe-area-inset-top, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px); gap: 5px; padding: 4px 7px; }
  .cuenta-bar .cuenta-info { display: none; }   /* ocultar "Juega sin cuenta o" */
  .cuenta-btn { padding: 4px 9px; font-size: .8rem; }

  /* Simplificar el desplegable de usuario: SOLO nombre + Online, pegado a la
     derecha. Se ocultan los contadores (trofeos, trofeos shiny, cartas, cartas
     shiny) que amontonan y tapan el logo. Solo móvil. */
  .cuenta-bar .acc-stats { display: none !important; }
  .cuenta-bar .acc-wrap { gap: 6px; }
  /* La barra pegada al borde derecho, sin ocupar de más para no tapar el logo. */
  .cuenta-bar { left: auto !important; max-width: none; width: auto;
    position: fixed !important; z-index: 950 !important; }
  .acc-online-tx { font-size: .72rem; }
  .acc-name-tx { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── Sprite de perfil (s276) ── */
.acc-spr-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; }
.acc-spr-prev { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #22304e, #101624); border: 1px solid #2d3a5a;
  display: flex; align-items: center; justify-content: center; }
.acc-spr-prev img { width: 130%; height: 130%; object-fit: contain; margin: -15%; image-rendering: pixelated; }
.acc-spr-prev.on { border-color: #4f7cd6; box-shadow: 0 0 10px rgba(79,124,214,.4); }
.acc-spr-in { flex: 1; min-width: 0; margin: 0 !important; }
.acc-spr-shiny { display: flex; align-items: center; gap: 3px; font-size: 15px; cursor: pointer; flex-shrink: 0; }
.acc-spr-ok { flex-shrink: 0; padding: 8px 14px !important; }

/* Mensaje de error del diálogo de cuenta (rojo, visible) */
.cuenta-err {
  display: none;
  color: #ff6a6a;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  margin: 4px 0 2px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 90, 90, 0.4);
}
.cuenta-err.cuenta-err-on { display: block; }
@keyframes cuentaShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.cuenta-card.cuenta-shake { animation: cuentaShake 0.4s ease; }
