/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--tap-target);
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.05s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover,
.btn:focus-visible {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-on);
  border-color: var(--primary);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--cherry-700);
  border-color: var(--cherry-700);
  color: var(--primary-on);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--bg-elev);
  border-color: var(--cherry-700);
}

.btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn--danger:hover,
.btn--danger:focus-visible {
  background: #c84a56;
  border-color: #c84a56;
}

.btn--full {
  width: 100%;
}

.btn--sm {
  height: 36px;
  padding: 0 var(--space-3);
  font-size: 0.9em;
}

/* Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-group label {
  font-size: 0.9em;
  color: var(--text-muted);
  font-weight: 500;
}

.input-group .hint {
  font-size: 0.8em;
  color: var(--text-muted);
}

.input-group input,
.input-group textarea {
  height: var(--tap-target);
  padding: 0 var(--space-3);
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.input-group textarea {
  height: auto;
  padding: var(--space-2) var(--space-3);
  min-height: 100px;
  resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--cherry-500);
  box-shadow: 0 0 0 3px rgba(255, 201, 207, 0.25);
}

.input-group input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* Card */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-md);
}

.card--auth {
  max-width: 420px;
  width: 100%;
}

.card__title {
  margin-bottom: var(--space-4);
  text-align: center;
}

.card__footer {
  margin-top: var(--space-4);
  text-align: center;
  font-size: 0.9em;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-3);
  gap: var(--space-3);
}

.topbar__left,
.topbar__center,
.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar__center {
  flex: 1;
  justify-content: center;
}

/* Sur petit écran, on cache le label de marque pour faire de la place
   et on garde le solde visible (info la plus importante). La balance-pill
   se compacte sur mobile via sa propre règle plus bas. */
@media (max-width: 480px) {
  .topbar__center {
    flex: 0 0 auto;
  }
  .balance-pill {
    padding: 4px var(--space-2);
    font-size: 0.85em;
  }
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  color: var(--text);
  text-decoration: none;
}

.brand__logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand__name {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

@media (max-width: 480px) {
  .brand__name {
    display: none;
  }
}

.brand--lg .brand__logo {
  width: 72px;
  height: 72px;
}

.brand--lg .brand__name {
  font-size: 1.4rem;
  display: inline;
}

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--cherry-700);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85em;
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar--lg {
  width: 96px;
  height: 96px;
  font-size: 2rem;
}

/* Balance pill */
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px var(--space-3);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95em;
  white-space: nowrap;
}

.balance-pill__icon {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--gold);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 700;
}

/* Form feedback */
.form-error {
  color: var(--danger);
  font-size: 0.9em;
  margin-top: var(--space-2);
  display: none;
}

.form-error.is-visible {
  display: block;
}

.form-success {
  color: var(--success);
  font-size: 0.9em;
  margin-top: var(--space-2);
  display: none;
}

.form-success.is-visible {
  display: block;
}

/* Placeholder content — désormais avec animation shimmer pour signaler le chargement. */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95em;
  background: var(--bg-elev-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  position: relative;
  overflow: hidden;
}
.placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .placeholder::after { animation: none; }
}

/* Variante "skeleton" : barres rectangulaires (pour préfigurer du contenu). */
.skeleton {
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton--line { height: 14px; margin-bottom: 8px; }
.skeleton--line:last-child { margin-bottom: 0; }
.skeleton--avatar { width: 36px; height: 36px; border-radius: var(--radius-full); }
.skeleton--card { height: 60px; }

/* Section heading */
.section-title {
  margin-bottom: var(--space-3);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  z-index: 200;
  transition: opacity 0.15s ease;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__title {
  margin-bottom: var(--space-3);
}

.modal__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  justify-content: flex-end;
}

/* Inline editable */
.inline-edit {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  min-height: var(--tap-target);
}

.inline-edit__value {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  padding: 0;
  height: 100%;
}

.inline-edit__value:focus {
  outline: none;
}

/* Avatar control row */
.avatar-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* File input hidden */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Stats rows */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
  border-bottom: none;
}

/* "Continuer à jouer" — carte large mise en avant. */
.continue-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  background: var(--bg-elev);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.continue-card:hover,
.continue-card:focus-visible {
  text-decoration: none;
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  border-color: var(--cherry-700);
}
.continue-card__thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}
.continue-card__thumb--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev-2);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.6rem;
}
.continue-card__body {
  flex: 1;
  min-width: 0;
}
.continue-card__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.continue-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-card__arrow {
  font-size: 1.4rem;
  color: var(--primary);
  flex-shrink: 0;
  padding-right: var(--space-2);
}

/* Game strip — carrousel auto-défilant. Pas de scroll-snap (conflit avec
   l'auto-scroll en rAF). Pas de scroll-behavior smooth global (sinon les
   .scrollLeft += dx mini-saccadent) — le smooth est activé ponctuellement
   par scrollBy({behavior:'smooth'}) sur les flèches. */
.game-strip {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--cherry-700) transparent;
  position: relative;
}

.game-strip::-webkit-scrollbar {
  height: 8px;
}
.game-strip::-webkit-scrollbar-track {
  background: transparent;
}
.game-strip::-webkit-scrollbar-thumb {
  background: var(--cherry-700);
  border-radius: var(--radius-full);
}
.game-strip::-webkit-scrollbar-thumb:hover {
  background: var(--cherry-500);
}

/* Mobile : on cache la scrollbar (le swipe touch suffit) */
@media (max-width: 719px) {
  .game-strip {
    scrollbar-width: none;
  }
  .game-strip::-webkit-scrollbar {
    display: none;
  }
}

.game-strip > * {
  flex: 0 0 auto;
}

/* Wrapper avec fades + flèches pour signaler le scroll horizontal sur PC */
.game-strip-wrap {
  position: relative;
}
.game-strip-wrap::before,
.game-strip-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: var(--space-3);
  width: 32px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.game-strip-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}
.game-strip-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}
.game-strip-wrap.has-overflow-left::before  { opacity: 1; }
.game-strip-wrap.has-overflow-right::after  { opacity: 1; }

.game-strip-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.15s ease;
  font-size: 1.1rem;
  font-weight: 700;
}
.game-strip-nav:hover { background: var(--bg-elev-2); border-color: var(--cherry-700); }
.game-strip-nav--prev { left: -10px; }
.game-strip-nav--next { right: -10px; }
.game-strip-wrap.has-overflow-left  .game-strip-nav--prev { opacity: 1; }
.game-strip-wrap.has-overflow-right .game-strip-nav--next { opacity: 1; }

/* Pas de flèches sur mobile (tactile = swipe) */
@media (max-width: 719px) {
  .game-strip-nav { display: none; }
}

.game-card {
  width: 180px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.game-card:hover,
.game-card:focus-visible {
  border-color: var(--cherry-700);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
}

.game-card__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
  display: block;
  object-fit: cover;
  overflow: hidden;
}

.game-card__thumb--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cherry-500);
  font-weight: 700;
  font-size: 2rem;
}

.game-card__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.game-card__tagline {
  font-size: 0.85em;
  color: var(--text-muted);
  line-height: 1.3;
  flex: 1;
}

.game-card__cta {
  margin-top: var(--space-2);
}

@media (min-width: 720px) {
  .game-card {
    width: 220px;
  }
}

/* Roi du jour */
@keyframes king-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(230, 179, 74, 0.30); }
  50%      { box-shadow: 0 0 0 2px var(--gold), 0 0 28px rgba(230, 179, 74, 0.55); }
}

.king-frame {
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(230,179,74,0.10), rgba(230,179,74,0.02));
  animation: king-pulse 3s ease-in-out infinite;
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.king-frame__crown {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--gold);
}

.king-frame__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.king-frame__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.king-frame__balance {
  font-size: 0.95em;
  color: var(--gold);
  font-weight: 600;
}

.king-frame__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--cherry-700);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--gold);
}

.king-frame__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.king-frame__empty {
  color: var(--text-muted);
  font-style: italic;
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  min-height: var(--tap-target);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-row--me {
  background: var(--bg-elev-2);
  border-left-color: var(--cherry-500);
}

.leaderboard-row__rank {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--cherry-700);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9em;
  flex-shrink: 0;
}

.leaderboard-row__rank--gold {
  background: var(--gold);
  color: var(--ink);
}

.leaderboard-row__rank--silver {
  background: #b8b8c2;
  color: var(--ink);
}

.leaderboard-row__rank--bronze {
  background: #b07744;
  color: #fff;
}

.leaderboard-row__trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 26px;
  height: 22px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.leaderboard-row__trend--up {
  color: var(--success);
  background: rgba(107, 158, 90, 0.15);
}
.leaderboard-row__trend--down {
  color: var(--danger);
  background: rgba(227, 93, 106, 0.15);
}
.leaderboard-row__trend--flat {
  color: var(--text-muted);
}
.leaderboard-row__trend--new {
  color: var(--gold);
}

.leaderboard-row__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--cherry-700);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8em;
  overflow: hidden;
  flex-shrink: 0;
}

.leaderboard-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.leaderboard-row__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row__balance {
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leaderboard-row__more {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: var(--tap-target);
  height: var(--tap-target);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.leaderboard-row__more:hover,
.leaderboard-row__more:focus-visible {
  background: var(--bg-elev-2);
  color: var(--text);
}

/* Top-wins modal */
.top-wins-modal .modal__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.top-wins-modal .modal__title .avatar {
  width: 40px;
  height: 40px;
}

.top-wins-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.top-wins-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.top-wins-row__ratio {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  min-width: 90px;
}

.top-wins-row__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9em;
}

.top-wins-row__line {
  color: var(--text);
}

.top-wins-row__sub {
  color: var(--text-muted);
  font-size: 0.85em;
}

.top-wins-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-3);
}

/* Bonus / coinflip cards */
.bonus-card,
.coinflip-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bonus-card__amount {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
}

.bonus-card__next {
  font-size: 0.9em;
  color: var(--text-muted);
}

.coinflip-card__result {
  font-weight: 600;
  text-align: center;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
}

.coinflip-card__result--win {
  color: var(--gold);
  border: 1px solid var(--gold);
}

.coinflip-card__result--lose {
  color: var(--danger);
  border: 1px solid var(--danger);
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--gold);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--error {
  border-color: var(--danger);
  color: var(--danger);
}
.toast--success {
  border-color: var(--success);
  color: var(--success);
}

/* Toolbar minimaliste pour pages d'auth (login/register/set-password) :
   uniquement le bouton de thème en haut à droite, par-dessus le contenu. */
.auth-toolbar {
  position: fixed;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 10;
}

/* Chips de mise grisés au-delà du tier débloqué — pattern partagé entre jeux. */
.is-tier-locked {
  opacity: 0.32 !important;
  cursor: not-allowed !important;
  position: relative;
  pointer-events: none;
}
.is-tier-locked::after {
  content: '🔒';
  position: absolute;
  top: -4px;
  right: -2px;
  font-size: 0.55rem;
  opacity: 0.8;
  pointer-events: none;
}

/* Bouton icône générique (topbar : toggle thème, mute, etc.) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--bg-elev-2);
  border-color: var(--primary);
}

/* Admin link in topbar (caché par défaut, révélé par JS si admin) */
.topbar__admin-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85em;
  text-decoration: none;
  white-space: nowrap;
}

.topbar__admin-link:hover,
.topbar__admin-link:focus-visible {
  background: rgba(230, 179, 74, 0.12);
  color: var(--gold);
  text-decoration: none;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3);
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 0.95em;
  -webkit-tap-highlight-color: transparent;
}

.tab:hover,
.tab:focus-visible {
  color: var(--text);
}

.tab--active {
  color: var(--cherry-500);
  border-bottom-color: var(--cherry-500);
}

.tab-panel[hidden] {
  display: none;
}

/* Admin table */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  background: var(--bg-elev);
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table thead th {
  background: var(--bg-elev-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table tbody tr:hover {
  background: var(--bg-elev-2);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.amount-pos { color: var(--success); font-variant-numeric: tabular-nums; }
.amount-neg { color: var(--danger); font-variant-numeric: tabular-nums; }

.user-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.user-cell__name {
  font-weight: 600;
}

.user-cell__id {
  font-size: 0.8em;
}

/* Badges */
.badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75em;
  font-weight: 600;
  background: var(--bg-elev-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge--admin {
  background: rgba(230, 179, 74, 0.15);
  color: var(--gold);
  border-color: var(--gold);
}

.badge--banned {
  background: rgba(227, 93, 106, 0.15);
  color: var(--danger);
  border-color: var(--danger);
}

.badge--no-pred {
  background: var(--bg-elev-2);
  color: var(--text-muted);
}

/* Action row (buttons inline) */
.action-row {
  display: inline-flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.action-row .btn--sm {
  height: 32px;
  padding: 0 10px;
  font-size: 0.85em;
  min-width: 32px;
}

/* Danger zone */
.danger-zone {
  border: 1px solid var(--danger);
  background: rgba(227, 93, 106, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.danger-zone h3 {
  margin-top: 0;
  color: var(--danger);
}

/* Confirm input (RESET) */
.confirm-input {
  letter-spacing: 0.2em;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Banword list */
.banword-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.banword-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 4px 4px var(--space-3);
  font-size: 0.9em;
}

.banwords-form,
.audit-filters {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
  flex-wrap: wrap;
}

.banwords-form .input-group,
.audit-filters .input-group {
  flex: 1 1 200px;
}

.audit-filters select {
  height: var(--tap-target);
  padding: 0 var(--space-3);
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  width: 100%;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ------- Bandeau prédictions défilant ------- */
.predictions-marquee {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(90deg,
    rgba(212, 36, 58, 0.18) 0%,
    rgba(20, 8, 12, 0.55) 40%,
    rgba(20, 8, 12, 0.55) 60%,
    rgba(212, 36, 58, 0.18) 100%);
  border: 1px solid rgba(212, 36, 58, 0.35);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.85rem;
  min-height: 36px;
}

.predictions-marquee__label {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(212, 36, 58, 0.85);
  color: #fff4d8;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  white-space: nowrap;
}

.predictions-marquee__viewport {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
}

.predictions-marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: predictions-marquee-scroll linear infinite;
  will-change: transform;
}

.predictions-marquee:hover .predictions-marquee__track {
  animation-play-state: paused;
}

@keyframes predictions-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.predictions-marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  color: inherit;
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.predictions-marquee__item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.predictions-marquee__title {
  font-weight: 600;
  max-width: 36ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.predictions-marquee__pot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: Georgia, "Times New Roman", serif;
}

.predictions-marquee__pot-label {
  opacity: 0.7;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.predictions-marquee__pot-value {
  font-weight: 700;
  color: #ffd166;
}

.predictions-marquee__bolt {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.18);
  color: #ffd166;
  font-size: 0.75rem;
  font-weight: 700;
}

.predictions-marquee__bolt.is-pending {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #b8a8ad);
}

@media (max-width: 540px) {
  .predictions-marquee__label { padding: 0 8px; font-size: 0.75rem; }
  .predictions-marquee__title { max-width: 22ch; }
}
