/* ─────────────────────────────────────────────────────────────────────────────
   CUENTA, CONEXIÓN Y SINCRONIZACIÓN (js/ui/account-screen.js, connection-indicator.js)
   Una hoja por zona, como js/ui/screens/. Ver "Estilos (CSS)" en AGENTS.md.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── CUENTA (account-screen.js) ────────────────────────────────────────────── */
/* Botón de cuenta arriba a la derecha del título: INICIAR SESIÓN, o nombre +
   estado de sincronización con sesión. Abre el modal de cuenta. */
.title-account {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  max-width: 45%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-pixel);
  color: var(--white);
  text-shadow: 2px 2px 0 var(--red-dark);
  cursor: pointer;
}
.title-account:hover  { transform: translate(-1px, -1px); }
.title-account:active { transform: translate(1px, 1px); }
.title-account__name,
.title-account__sync {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.title-account__name { font-size: 8px; line-height: 1.4; }
.title-account__sync { font-size: var(--fs-5); line-height: 1.4; opacity: .8; }
.title-account__sync:empty { display: none; }
.title-account__sync[data-state="error"] { color: var(--yellow); opacity: 1; }

/* Estado de red arriba a la izquierda: icono sin conexión + spinner de envío
   (connection-indicator.js / account-screen.js). Compacto para no tapar el HUD
   del rival en combate (top: 30px). No captura clics salvo el tooltip del icono. */
.net-status {
  position: fixed;
  top: 6px;
  left: 6px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
/* En el título, a la derecha de las insignias de Experto (64px cada una + 6px de hueco) */
body:has(.kanto-expert-badge) .net-status { left: 84px; }
body:has(.kanto-expert-badge + .kanto-expert-badge) .net-status { left: 154px; }
body:has(.kanto-expert-badge + .kanto-expert-badge + .kanto-expert-badge) .net-status { left: 224px; }

.connection-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  border-radius: 5px;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--yellow);
  line-height: 0;
  cursor: help;
  pointer-events: auto;
}
.connection-indicator[hidden] { display: none; }

.sync-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: var(--white);
  border-radius: 50%;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.8));
  animation: spin .7s linear infinite;
}
.sync-spinner[hidden] { display: none; }

.account-sheet { max-height: 100%; overflow-y: auto; }

.account-tabs { display: flex; gap: var(--sp-sm); }
.account-tab {
  flex: 1;
  font-family: var(--font-pixel);
  font-size: var(--fs-7);
  padding: 10px 4px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--grey);
  cursor: pointer;
}
.account-tab--active { background: var(--blue); color: var(--white); }

.account-form { display: flex; flex-direction: column; gap: 10px; }

.account-field { display: flex; flex-direction: column; gap: 6px; }
.account-field__label {
  font-family: var(--font-pixel);
  font-size: var(--fs-6);
  color: var(--grey-dark);
}
.account-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px; /* ≥16px evita el zoom automático en iOS */
  font-weight: 700;
  padding: 8px 10px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--black);
  outline: none;
}
.account-input:focus { border-color: var(--blue); }

.account-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: var(--fs-6);
  color: var(--grey-dark);
  line-height: 1.6;
  cursor: pointer;
}
.account-check input { width: 18px; height: 18px; flex-shrink: 0; }

.account-msg {
  font-family: var(--font-pixel);
  font-size: var(--fs-6);
  line-height: 1.8;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.account-msg[hidden] { display: none; }
.account-msg[data-kind="error"] { color: var(--red-dark); background: #fde0dc; border: 1px solid var(--red); }
.account-msg[data-kind="ok"]    { color: var(--green-dark); background: #e0f5e3; border: 1px solid var(--green); }

/* ── AVISO BREVE (AccountScreen._toast) ─────────────────────────────────────── */
.toast {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  pointer-events: none;
}
.toast__box { padding: 14px 24px; border-radius: 8px; box-shadow: var(--shadow-md); }
