/* ============================================================
   css/sharedStorage.css — Interfaz del Baúl Compartido
   Estilo consistente con el Trade (MU Online) del juego.
   ============================================================ */

/* ── Overlay general ── */
.ss-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(3px);
  font-family: 'Barlow', sans-serif;
}
.ss-overlay:not([style*="display: none"]) { animation: ss-overlay-in 0.25s ease; }
@keyframes ss-overlay-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Ventana principal ── */
.ss-window {
  position: relative;
  width: 880px;
  max-width: 96vw;
  height: min(720px, 92vh);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1b2333 0%, #121826 100%);
  border: 1px solid #c9a227;
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.55), 0 0 40px rgba(201, 162, 39, 0.25), 0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  color: #e2e8f0;
  animation: ss-win-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes ss-win-in { from { transform: translateY(24px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Header ── */
.ss-win-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #232b3d 0%, #3a2f1a 50%, #232b3d 100%);
  border-bottom: 1px solid #c9a227;
  cursor: move;
  user-select: none;
}
.ss-win-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201, 162, 39, 0.15);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 8px;
  color: #f5d76e;
  font-size: 1rem;
}
.ss-win-title-group { display: flex; flex-direction: column; min-width: 0; }
.ss-win-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 1px;
  color: #f5d76e;
  text-shadow: 0 0 12px rgba(245, 215, 110, 0.4);
  white-space: nowrap;
}
.ss-win-sub { color: #94a3b8; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-vault-select {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: #f5d76e;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 220px;
}
.ss-win-close {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.ss-win-close:hover { background: rgba(239, 68, 68, 0.4); transform: scale(1.05); }

/* ── Pestañas ── */
.ss-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}
.ss-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  color: #94a3b8;
  border-radius: 6px 6px 0 0;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.ss-tab:hover { color: #e2e8f0; background: rgba(255, 255, 255, 0.08); }
.ss-tab.active {
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(201, 162, 39, 0.45);
  color: #f5d76e;
  box-shadow: inset 0 2px 0 rgba(201, 162, 39, 0.6);
}

/* ── Panes ── */
.ss-pane { display: none; flex: 1; min-height: 0; padding: 10px 12px; }
.ss-pane.active { display: flex; flex-direction: column; }

/* ── Toolbar ── */
.ss-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ss-search-box {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.ss-search-box i {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.7rem;
}
.ss-search-box input {
  width: 100%;
  padding: 6px 10px 6px 28px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}
.ss-search-box input:focus { border-color: rgba(99, 102, 241, 0.6); }
.ss-sort-select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  outline: none;
}
.ss-spacer { flex: 1; }
.ss-deposit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.ss-deposit-btn:hover { background: rgba(59, 130, 246, 0.3); transform: translateY(-1px); }
.ss-deposit-btn.pokemon {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.4);
  color: #c4b5fd;
}
.ss-deposit-btn.pokemon:hover { background: rgba(167, 139, 250, 0.3); }
.ss-deposit-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Indicador de movimientos diarios ── */
.ss-daily-left {
  font-size: 0.68rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  padding: 5px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ss-daily-left.low { color: #fcd34d; border-color: rgba(252, 211, 77, 0.5); background: rgba(252, 211, 77, 0.08); }
.ss-daily-left.exhausted { color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.1); }

/* ── Grid de 150 slots ── */
.ss-grid-wrap { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
.ss-grid-wrap::-webkit-scrollbar { width: 8px; }
.ss-grid-wrap::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, 0.3); border-radius: 4px; }
.ss-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}
.ss-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 52px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px;
  overflow: hidden;
  cursor: default;
  transition: all 0.12s;
}
.ss-slot:hover { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.05); }
.ss-slot-idx {
  position: absolute;
  top: 2px; left: 5px;
  font-size: 0.55rem;
  color: #475569;
  font-family: monospace;
}
.ss-slot.filled { cursor: pointer; border-width: 1.5px; }
.ss-slot.filled:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }.ss-slot.pokemon { border-color: rgba(167, 139, 250, 0.5); background: rgba(167, 139, 250, 0.06); }
  .ss-slot.item { border-color: rgba(59, 130, 246, 0.45); background: rgba(59, 130, 246, 0.05); }
  .ss-slot.item.gold { border-color: rgba(251, 191, 36, 0.6); background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(59, 130, 246, 0.04)); }
  .ss-slot.item.gold .ss-slot-tag { color: #fde68a; }
  .ss-slot-emoji.gold { filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.7)); }
.ss-slot-img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.ss-slot-emoji { font-size: 1.2rem; }
.ss-slot-tag {
  font-size: 0.55rem;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Leyenda ── */
.ss-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.68rem;
  color: #94a3b8;
}
.ss-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.ss-dot.pokemon { background: #a78bfa; }
.ss-dot.item { background: #3b82f6; }
.ss-hint { margin-left: auto; color: #64748b; }

/* ── Cuentas ── */
.ss-accounts { flex: 1; overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 6px; }
.ss-accounts::-webkit-scrollbar { width: 8px; }
.ss-accounts::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, 0.3); border-radius: 4px; }
.ss-acc-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f5d76e;
  margin: 8px 0 4px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  padding-bottom: 4px;
}
.ss-acc-section-title:first-child { margin-top: 0; }
.ss-member-row, .ss-invite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 8px 10px;
}
.ss-member-row.owner { background: rgba(201, 162, 39, 0.07); border-color: rgba(201, 162, 39, 0.3); }
.ss-member-avatar, .ss-invite-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.ss-member-row.owner .ss-member-avatar { background: rgba(201, 162, 39, 0.18); color: #f5d76e; }
.ss-member-info { flex: 1; min-width: 0; }
.ss-member-name { font-size: 0.82rem; font-weight: 700; color: #e2e8f0; }
.ss-member-sub { font-size: 0.66rem; color: #64748b; }
.ss-invite-info { flex: 1; }
.ss-invite-name { font-size: 0.82rem; font-weight: 700; color: #c4b5fd; }
.ss-invite-sub { font-size: 0.66rem; color: #64748b; }
.ss-invite-btns { display: flex; gap: 6px; }

/* ── Botones genéricos ── */
.ss-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
}
.ss-btn:hover { transform: translateY(-1px); filter: brightness(1.15); }
.ss-btn-green { background: rgba(74, 222, 128, 0.12); border-color: #4ade80; color: #4ade80; }
.ss-btn-red { background: rgba(239, 68, 68, 0.12); border-color: #ef4444; color: #f87171; }
.ss-btn-gold { background: rgba(201, 162, 39, 0.15); border-color: #c9a227; color: #f5d76e; }
.ss-btn-sm { padding: 4px 8px; font-size: 0.65rem; }

.ss-invite-form { display: flex; gap: 8px; }
.ss-invite-form input {
  flex: 1;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.75rem;
  outline: none;
}
.ss-invite-form input:focus { border-color: rgba(201, 162, 39, 0.7); }
.ss-note { font-size: 0.68rem; color: #64748b; margin-top: 4px; }

/* ── Historial ── */
.ss-history-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f5d76e;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  padding-bottom: 6px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.ss-history { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.ss-history::-webkit-scrollbar { width: 8px; }
.ss-history::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, 0.3); border-radius: 4px; }
.ss-history-row {
  display: grid;
  grid-template-columns: 130px 120px 90px 1fr;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 0.7rem;
}
.ss-history-date { color: #64748b; font-family: monospace; }
.ss-history-player { font-weight: 700; color: #e2e8f0; }
.ss-history-action { font-weight: 600; }
.ss-history-action.deposit { color: #4ade80; }
.ss-history-action.withdraw { color: #f59e0b; }
.ss-history-action.member_add { color: #38bdf8; }
.ss-history-action.member_remove { color: #f87171; }
.ss-history-action.organize { color: #a78bfa; }
.ss-history-label { color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-empty {
  text-align: center;
  color: #64748b;
  font-size: 0.75rem;
  padding: 30px 0;
}

/* ── Picker (depósito) ── */
.ss-picker {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 15, 0.6);
  font-family: 'Barlow', sans-serif;
}
.ss-picker-card {
  width: 480px;
  max-width: 94vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1b2333, #121826);
  border: 1px solid #c9a227;
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.55), 0 0 40px rgba(201, 162, 39, 0.25);
  overflow: hidden;
  color: #e2e8f0;
  animation: ss-win-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.ss-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(90deg, #232b3d, #3a2f1a, #232b3d);
  border-bottom: 1px solid #c9a227;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  color: #f5d76e;
  font-size: 0.9rem;
  letter-spacing: 1px;
}
.ss-picker-close {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
}
.ss-picker-tabs { display: flex; gap: 4px; padding: 8px 12px 0; }
.ss-picker-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border-radius: 6px 6px 0 0;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.ss-picker-tab.active { background: rgba(201, 162, 39, 0.14); border-color: rgba(201, 162, 39, 0.45); color: #f5d76e; }
.ss-picker-list { flex: 1; overflow-y: auto; padding: 10px 12px; min-height: 200px; }
.ss-picker-list::-webkit-scrollbar { width: 8px; }
.ss-picker-list::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, 0.3); border-radius: 4px; }
.ss-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
}
.ss-picker-row:hover { background: rgba(255, 255, 255, 0.06); }
.ss-picker-img { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; }
.ss-picker-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  font-size: 1.1rem;
}
.ss-picker-info { flex: 1; min-width: 0; }
.ss-picker-name { font-size: 0.8rem; font-weight: 700; color: #e2e8f0; }
.ss-picker-sub { font-size: 0.68rem; color: #94a3b8; }
.ss-picker-add {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid #4ade80;
  color: #4ade80;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.ss-picker-add:hover { background: rgba(74, 222, 128, 0.3); transform: scale(1.08); }
.ss-picker-empty { text-align: center; color: #64748b; font-size: 0.75rem; padding: 30px 0; }

/* ── Toast ── */
.ss-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 6000;
  background: linear-gradient(180deg, #2a2433, #1b2333);
  border: 1px solid #c9a227;
  color: #f5d76e;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5), 0 0 30px rgba(201, 162, 39, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}
.ss-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Ítems regalados (kit de bienvenida): no depositables en el baúl ── */
.ss-picker-row.gifted { opacity: 0.55; }
.ss-picker-row.gifted .ss-picker-sub { color: #f87171; }
.ss-picker-add.locked {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #64748b;
  cursor: not-allowed;
}
.ss-picker-add.locked:hover { background: rgba(148, 163, 184, 0.08); transform: none; }


/* ══════════════════════════════════════════════════
   MOBILE RESPONSIVE (.device-mobile)
   ══════════════════════════════════════════════════ */
.device-mobile .ss-window {
  width: min(94vw, 420px) !important;
  height: auto !important;
  max-height: var(--mob-avail-h, 80vh) !important;
}
.device-mobile .ss-grid {
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 4px !important;
}
.device-mobile .ss-slot {
  min-height: 44px !important;
}
.device-mobile .ss-history-row {
  grid-template-columns: 1fr !important;
  gap: 2px !important;
  padding: 6px !important;
}
.device-mobile .ss-history-date,
.device-mobile .ss-history-player,
.device-mobile .ss-history-action {
  font-size: 0.65rem !important;
}
.device-mobile .ss-picker-card {
  width: min(94vw, 400px) !important;
}
.device-mobile .ss-tabs {
  overflow-x: auto !important;
  flex-wrap: nowrap !important;
  -webkit-overflow-scrolling: touch !important;
}
.device-mobile .ss-tab {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  font-size: 0.68rem !important;
  padding: 6px 10px !important;
}
.device-mobile .ss-toolbar {
  gap: 4px !important;
}
.device-mobile .ss-search-box {
  min-width: 120px !important;
}
.device-mobile .ss-win-header {
  padding: 8px 10px !important;
  gap: 8px !important;
}
.device-mobile .ss-member-row {
  padding: 6px 8px !important;
  gap: 8px !important;
}
.device-mobile .ss-deposit-btn {
  font-size: 0.68rem !important;
  padding: 6px 10px !important;
  min-height: 44px !important;
}
