/* history.css — Styles de l'onglet Historique et toast de sauvegarde */

/* ---------- LIGNE PSEUDO ---------- */
.history-pseudo-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: var(--gold-bg);
  border: 1px solid var(--gold-border); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 10px; cursor: pointer;
  text-align: left; transition: background 0.15s;
}
.history-pseudo-row:active { background: rgba(200,156,60,0.2); }
@keyframes pseudoPulse {
  0%, 100% { background: var(--gold-bg); border-color: var(--gold-border); }
  50%       { background: rgba(200,156,60,0.3); border-color: rgba(200,156,60,0.75); }
}
.history-pseudo-row--pulse { animation: pseudoPulse 0.4s ease 2; }
.history-pseudo-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--gold); flex-shrink: 0;
}
.history-pseudo-value {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--cream);
}
.history-pseudo-empty { color: rgba(232,212,184,0.35); font-style: italic; font-weight: 400; }
.history-pseudo-icon {
  font-size: 12px; color: rgba(232,212,184,0.35); flex-shrink: 0;
}

/* ---------- TOOLBAR (export / import) ---------- */
.hist-btn--blocked { opacity: 0.4; cursor: not-allowed; }
.history-toolbar { display: flex; gap: 8px; margin: 8px 0 12px; }
.history-toolbar .hist-btn { flex: 1; padding: 10px; font-size: 12px; text-align: center; }
.history-import-label { cursor: pointer; }

/* ---------- LISTE DES MAINS ---------- */
.history-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 52vh; overflow-y: auto; padding-right: 2px;
  scrollbar-width: none;
}
.history-list::-webkit-scrollbar { display: none; }
.history-empty {
  text-align: center; color: var(--cream); opacity: 0.45;
  font-size: 13px; padding: 32px 0; line-height: 1.6;
}

/* ---------- ÉLÉMENT DE LISTE ---------- */
.history-item {
  background: var(--s2);
  border: 1px solid var(--b);
  border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 7px;
  transition: border-color 0.15s;
}
.history-item--win        { border-left-color: var(--win); }
.history-item--tie        { border-left-color: var(--tie); }
.history-item--lose       { border-left-color: var(--fold); }
.history-item--incomplete { border-left-color: var(--grey); }

.history-item-header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.history-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.history-date { font-size: 10px; font-weight: 600; color: rgba(232,212,184,0.45); }
.history-blinds {
  font-size: 10px; font-weight: 700; color: var(--gold);
  background: var(--gold-bg); border: 1px solid var(--gold-border);
  border-radius: 4px; padding: 2px 6px;
}
.history-delete-btn {
  background: none; border: 1px solid transparent; border-radius: 6px;
  color: rgba(232,212,184,0.28); font-size: 13px; cursor: pointer;
  padding: 4px 8px; flex-shrink: 0; line-height: 1; transition: all 0.15s;
}
.history-delete-btn:active {
  background: rgba(211,47,47,0.2); color: #ef9a9a; border-color: rgba(211,47,47,0.5);
}

.history-summary {
  font-size: 13px; font-weight: 600; color: var(--cream); line-height: 1.3;
}

/* ---------- CARTES EN APERÇU ---------- */
.history-cards-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.history-card-group { display: flex; gap: 3px; }
.history-board-group { border-left: 1px solid var(--b); padding-left: 8px; }

/* ---------- STREETS PAR MAIN ---------- */
.hs-streets {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--s1); border-radius: 6px; padding: 6px 8px;
  border: 1px solid var(--b);
}
.hs-street {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 5px; line-height: 1.4; font-size: 11px;
}
.hs-label {
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em;
  color: var(--ink); background: var(--gold);
  border-radius: 3px; padding: 1px 5px;
  text-transform: uppercase; flex-shrink: 0;
}
.hs-cards { display: flex; gap: 2px; flex-shrink: 0; align-items: center; }
.hs-actions { color: rgba(255,255,255,0.55); word-break: break-word; }
.hs-fold { opacity: 0.38; }

/* ---------- TOGGLE UNITÉ (Tks / BB) ---------- */
.history-unit-toggle {
  display: flex; gap: 4px;
}
.history-unit-btn {
  background: var(--s3); border: 1px solid var(--b);
  color: rgba(232,212,184,0.45); padding: 6px 12px; border-radius: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.history-unit-btn.active {
  background: var(--gold); color: var(--ink); border-color: var(--gold);
}
.history-unit-btn:not(.active):active {
  background: var(--s4); color: var(--cream);
}

/* ---------- TOAST DE SAUVEGARDE ---------- */
.toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(46,125,50,0.95); color: white;
  padding: 7px 16px; border-radius: 20px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s; white-space: nowrap;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
