/* ============================================================
   1. RESET & BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

a { color: #bb86fc; text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.error  { color: #ef5350; font-size: .9rem; margin-top: .5rem; }
.loading, .empty { text-align: center; padding: 2rem; opacity: .6; }


/* ============================================================
   2. LAYOUT & NAVIGATION
   ============================================================ */

#navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .8rem 2rem;
  background: #1a1a2e;
  border-bottom: 2px solid #bb86fc;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand { font-size: 1.4rem; font-weight: 700; color: #bb86fc; text-decoration: none; }

.nav-tourn-banner {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 1000;
  display: block;
  max-width: min(340px, 90vw);
  text-align: center;
  padding: .7rem 1.2rem;
  border-radius: 10px;
  font-weight: 530;
  font-size: .95rem;
  color: #1c1917;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.nav-tourn-banner:hover { opacity: .92; }
.nav-tourn-banner strong { font-weight: 600; }
.nav-tourn-banner-invite  { background: #bb86fc; }
.nav-tourn-banner-winner  { background: #ffd54f; }

.nav-links  { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: #e0e0e0; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: #bb86fc; text-decoration: none; }

/* Sous-menus navbar */
.nav-dropdown { position: relative; }

.nav-dropdown-btn {
  background: none;
  border: none;
  color: #e0e0e0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  transition: color .2s;
}
.nav-dropdown-btn:hover { color: #bb86fc; }
.nav-dropdown-btn::after {
  content: '▾';
  font-size: 0.62em;
  display: inline-block;
  transition: transform .2s;
}
.nav-dropdown.open .nav-dropdown-btn { color: #bb86fc; }
.nav-dropdown.open .nav-dropdown-btn::after { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e2e;
  border: 1px solid rgba(187,134,252,0.22);
  border-radius: 8px;
  padding: 0.3rem 0;
  min-width: 148px;
  z-index: 200;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 1.1rem;
  color: #e0e0e0;
  font-weight: 500;
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.nav-dropdown-menu a:hover {
  color: #bb86fc;
  background: rgba(187,134,252,0.08);
}

/* Cloche de notifications */
.nav-bell-btn { font-size: 1.05rem; }
.nav-bell-btn::after { display: none; }

.nav-notif-menu {
  left: auto;
  right: 0;
  transform: none;
  min-width: 280px;
  max-width: 340px;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.3rem;
}

.nav-notif-empty {
  padding: 0.8rem 1rem;
  color: #888;
  font-size: 0.85rem;
  text-align: center;
  white-space: normal;
}

.nav-notif-item {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s;
}
.nav-notif-item:hover { background: rgba(187,134,252,0.08); }
.nav-notif-item--unread { border-left-color: #bb86fc; background: rgba(187,134,252,0.05); }

.nav-notif-msg {
  font-size: 0.85rem;
  color: #e0e0e0;
  white-space: normal;
  line-height: 1.35;
}

.nav-notif-date {
  display: block;
  font-size: 0.7rem;
  color: #888;
  margin-top: 0.2rem;
}

/* Hamburger — masqué sur desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: #e0e0e0;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* Animation croix quand ouvert */
#navbar.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
#navbar.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
#navbar.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

#page { padding: 2rem; max-width: 1100px; margin: 0 auto; }
h1    { font-size: 2rem; margin-bottom: 1.5rem; text-align: center; }


/* ============================================================
   3. UTILITIES
   ============================================================ */

.loading-text,
.error-text {
  text-align: center;
  padding: 2rem;
  color: #aaa;
}

.error-text { color: #e74c3c; }

.success-msg {
  background: #1b5e20;
  color: #a5d6a7;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-top: 1rem;
  text-align: center;
}

.error-msg {
  background: #b71c1c;
  color: #ffcdd2;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-top: 1rem;
  text-align: center;
}


/* ============================================================
   4. ANIMATIONS & KEYFRAMES
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; }
}

@keyframes rainbow-border {
  0%   { border-color: #ff6b6b; box-shadow: 0 0 12px #ff6b6b; }
  25%  { border-color: #ffd93d; box-shadow: 0 0 12px #ffd93d; }
  50%  { border-color: #4d96ff; box-shadow: 0 0 12px #4d96ff; }
  75%  { border-color: #6bcb77; box-shadow: 0 0 12px #6bcb77; }
  100% { border-color: #ff6b6b; box-shadow: 0 0 12px #ff6b6b; }
}

@keyframes card-shine {
  0%   { transform: translateX(-100%) rotate(25deg); }
  50%  { transform: translateX(200%) rotate(25deg); }
  100% { transform: translateX(200%) rotate(25deg); }
}

@keyframes modalScale {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes fighter-enter {
  from { opacity: 0; transform: translateY(-12px) scale(0.85); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mini-log-appear {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pokemon-ko {
  0%   { opacity: 1;    transform: translateY(0)    rotate(0deg);   filter: drop-shadow(0 0 4px rgba(255,255,255,0.15)); }
  30%  { opacity: 0.8;  transform: translateY(-8px) rotate(-8deg);  filter: drop-shadow(0 0 8px rgba(244, 67, 54, 0.6)); }
  60%  { opacity: 0.5;  transform: translateY(4px)  rotate(12deg);  filter: drop-shadow(0 0 6px rgba(244, 67, 54, 0.4)); }
  100% { opacity: 0.15; transform: translateY(10px) rotate(15deg);  filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); }
}

@keyframes ko-label-appear {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes reel-spin {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-120px); }
}

@keyframes winner-pulse {
  from { box-shadow: 0 0 8px #bb86fc66; }
  to   { box-shadow: 0 0 24px #bb86fccc; }
}


/* ============================================================
   5. COMPONENTS — Cards
   ============================================================ */

.card {
  padding: 8px 4px;
  box-sizing: border-box;
  align-items: center;
  text-align: center;
  background: #1a1a2e;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #333;
  transition: transform .2s;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  width: 110px;
}

.card:hover { transform: translateY(-4px); }

.card-image {
  width: 100%;
  height: 80px;
  aspect-ratio: unset;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 5%;
  box-sizing: border-box;
  background: #1a1a2e;
  image-rendering: auto;
  transform: translateZ(0);
}

.card-image.unknown {
  background: #0f0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #444;
  aspect-ratio: 3/4;
}

.card-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  gap: 4px;
}

.card-name {
  width: 100%;
  font-size: 0.8rem;
  font-weight: bold;
  margin: 5px 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.card-qty {
  display: block;
  font-size: .75rem;
  color: #ffa726;
  margin-top: .2rem;
}

.card-hidden {
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back {
  font-size: 3rem;
  color: #444;
  user-select: none;
}

.card-unknown {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-unknown-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.25;
}

.card-unknown-icon  { font-size: 2rem; }
.card-unknown-label { font-size: 0.85rem; letter-spacing: 0.2em; font-weight: bold; }

/* Rareté — bordures et effets */
.card.card-legendary {
  border-color: #f9a825;
  box-shadow: 0 0 14px rgba(249, 168, 37, .5);
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.card-legendary::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 200, 50, 0.4) 50%, transparent 70%);
  transform: translateX(-100%) rotate(25deg);
  animation: none;
  will-change: transform;
}

.card-legendary.revealed::after {
  animation: card-shine 2.5s ease-in-out infinite;
}

.card.card-legendary:hover { transform: translateY(-4px); }

.card-rare,
.card-epic {
  border: 3px solid transparent;
  transition: border-color 0.3s ease;
}

.card-epic {
  border-color: #e1bee7;
  box-shadow: 0 0 12px rgba(225, 190, 231, 0.4);
}

.card-rare {
  border-color: #b3e5fc;
  box-shadow: 0 0 12px rgba(179, 229, 252, 0.4);
}

.card-alt {
  position: relative;
  overflow: hidden;
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, .4);
}

.card-alt::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: translateX(-100%) rotate(25deg);
  animation: none;
  will-change: transform;
}

.card-alt.revealed::after {
  animation: card-shine 2.5s ease-in-out infinite;
  opacity: 0.7;
  transform: scale(1.1) translateX(-100%) rotate(25deg);
  transform-origin: center;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.card-new-discovery {
  border: 2px solid #ff6b6b !important;
  animation: rainbow-border 2s linear infinite !important;
}

/* Biome badges */
.biome-badge {
  display: inline-block;
  max-width: 82px;
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 8px;
  font-size: 0.7rem;
  border-radius: 12px;
  margin: 0 auto;
}

.biome-plaines   { background: #388e3c; }
.biome-lac       { background: #0288d1; }
.biome-mer       { background: #1565c0; }
.biome-foret     { background: #1b5e20; }
.biome-desert    { background: #e65100; }
.biome-ville     { background: #546e7a; }
.biome-tundra    { background: #0277bd; }
.biome-montagnes { background: #616161; }
.biome-cave      { background: #37474f; }
.biome-leg       { background: #f9a825; color: #1a1a1a; }


/* ============================================================
   6. COMPONENTS — Buttons
   ============================================================ */

.btn-spin {
  margin-top: 1.5rem;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #bb86fc, #8c52d4);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .1s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(187, 134, 252, .4);
  width: 100%;
  max-width: 600px;
}
.btn-spin:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(187, 134, 252, .6); }
.btn-spin:disabled { opacity: .5; cursor: not-allowed; }

.btn-spin--multi { margin-top: 0; margin-bottom: 1.5rem; }

.multi-roulette-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.multi-roulette-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

/* Rangée commune des cartes obtenues : déplacées hors de chaque roulette
   pour s'aligner sur une même ligne plutôt que de séparer les bandes */
.multi-roulette-results {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  margin-top: 2rem;
}
.multi-roulette-results .roulette-result {
  width: auto;
  min-height: 0;
  margin-top: 0;
  flex: 0 1 auto;
}
.multi-roulette-results .roulette-result h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.multi-roulette-results .result-card-wrap {
  width: auto;
  min-height: 0;
  margin-top: 0;
}

.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #bb86fc, #8c52d4);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 16px rgba(187, 134, 252, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(187, 134, 252, 0.5);
}

.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-confirm { background: #cf6679; color: white; }
.btn-cancel  { background: #333; color: white; }


/* ============================================================
   7. COMPONENTS — Forms & Toggle
   ============================================================ */

.reveal-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.reveal-mode-selector {
  display: flex;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.reveal-mode-btn {
  flex: 1;
  padding: 0.4rem 0.9rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.reveal-mode-btn:hover:not(.active) { color: #e0e0e0; }
.reveal-mode-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.reveal-mode-btn.active {
  background: #bb86fc;
  color: #0f0f1a;
  font-weight: 600;
}

.toggle-hint { font-size: 0.8rem; color: #666; text-align: center; max-width: 360px; }

/* ── Sélecteur de biome ── */
.biome-accordion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.biome-toggle {
  background: transparent;
  border: 1px solid #3a3a5a;
  color: #aaa;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.biome-toggle:hover {
  border-color: #6a6a9a;
  color: #e0e0e0;
}

.biome-toggle--active {
  border-color: #bb86fc;
  color: #bb86fc;
  background: #bb86fc18;
}

.biome-toggle--active:hover {
  background: #bb86fc28;
}

.biome-toggle-icon {
  font-size: 1rem;
  line-height: 1;
  font-weight: 300;
  opacity: 0.8;
}

.biome-panel {
  display: none;
  width: 100%;
  justify-content: center;
}

.biome-panel--open { display: flex; }

/* ── Ligne regroupant le filtre biome/ticket et le mode de tirage ── */
.selector-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  width: 100%;
}

.selector-row .biome-accordion,
.selector-row .ticket-slot-active {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.roll-mode-compact {
  display: flex;
  flex-shrink: 0;
  align-self: center;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.roll-mode-compact-btn {
  padding: 0.3rem 0.6rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #888;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.roll-mode-compact-btn:hover:not(.active) { color: #e0e0e0; }
.roll-mode-compact-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.roll-mode-compact-btn.active {
  background: #bb86fc;
  color: #0f0f1a;
  font-weight: 600;
}

.biome-btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 560px;
  padding: 0.25rem 0;
}

.biome-btn {
  --biome-color: #4a4a6a;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--biome-color);
  border-radius: 8px;
  background: color-mix(in srgb, var(--biome-color) 12%, transparent);
  color: color-mix(in srgb, var(--biome-color) 70%, #e0e0e0);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.biome-btn-label { font-weight: 500; }

.biome-btn-meta {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  background: #1a1a2e;
  border: 1px solid #3a3a5a;
  border-radius: 6px;
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.biome-btn:hover .biome-btn-meta { opacity: 1; }

.biome-btn:hover:not(.active) {
  background: color-mix(in srgb, var(--biome-color) 25%, transparent);
  color: #e0e0e0;
}

.biome-btn.active {
  background: var(--biome-color);
  color: #fff;
  font-weight: 600;
}

/* Couleurs par biome */
.biome-btn--lac       { --biome-color: #0288d1; }
.biome-btn--mer       { --biome-color: #1565c0; }
.biome-btn--foret     { --biome-color: #2e7d32; }
.biome-btn--montagnes { --biome-color: #757575; }
.biome-btn--ville     { --biome-color: #546e7a; }
.biome-btn--plaines   { --biome-color: #388e3c; }
.biome-btn--desert    { --biome-color: #e65100; }
.biome-btn--cave      { --biome-color: #5d4037; }
.biome-btn--tundra    { --biome-color: #0277bd; }

.biome-cost { color: #fbbf24; }

.biome-progress { color: rgba(255,255,255,0.55); }
.biome-progress--full { color: #4ade80; }

.biome-btn.active .biome-cost    { color: #fde68a; }
.biome-btn.active .biome-progress { color: rgba(255,255,255,0.75); }
.biome-btn.active .biome-progress--full { color: #86efac; }

.biome-btn:disabled,
.biome-toggle:disabled { opacity: 0.35; cursor: not-allowed; }


/* ============================================================
   8. COMPONENTS — Modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #1e1e1e;
  border: 2px solid #bb86fc;
  border-radius: 15px;
  padding: 25px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  box-shadow: 0 0 30px rgba(187, 134, 252, 0.2);
  animation: modalScale 0.2s ease-out;
}

.modal-content h3 { color: #bb86fc; margin-top: 0; }
.modal-content p  { margin: 15px 0; line-height: 1.5; }

.sell-price-display {
  display: block;
  font-size: 1.4rem;
  color: #ffd700;
  font-weight: bold;
  margin: 10px 0;
}
.sell-price-display--charme {
  color: #40e0d0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.sell-charme-hint {
  font-size: 0.78rem;
  color: #8888aa;
  margin: -4px 0 8px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-btn:hover { opacity: 0.8; }


/* ============================================================
   9. COMPONENTS — Roulette
   ============================================================ */

.roulette-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
}

.roulette-viewport {
  width: 100%;
  height: 200px;
  overflow: hidden;
  border: 3px solid #bb86fc;
  border-radius: 12px;
  background: #1a1a2e;
  position: relative;
  display: flex;
  align-items: center;
}

.roulette-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 0;
  will-change: transform;
}

.roulette-pointer {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: #ff5252;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
}

.roulette-pointer::before,
.roulette-pointer::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}
.roulette-pointer::before { top: 0;    border-top:    10px solid #ff5252; }
.roulette-pointer::after  { bottom: 0; border-bottom: 10px solid #ff5252; }

.roulette-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.roulette-card {
  flex-shrink: 0;
  width: 130px;
  backface-visibility: hidden;
  transform-origin: center center;
}

.roulette-card.neighbor-border-gold {
  border: 3px solid #FFD700;
  border-radius: 10px;
  box-shadow: 0 0 10px #FFD700;
}

.roulette-card.neighbor-border-silver {
  border: 3px solid #C0C0C0;
  border-radius: 10px;
  box-shadow: 0 0 10px #C0C0C0;
}

.roulette-card.winning-card-highlight {
  border: 3px solid #FF4500;
  border-radius: 10px;
  box-shadow: 0 0 15px #FF4500;
  transform: perspective(600px) scale(1.05);
}

.roulette-card.winning-card-highlight[style*="rotateY"] {
  transform: perspective(600px) rotateY(90deg) !important;
}

.roulette-card.revealed { border-radius: 10px; }

.roulette-card.revealed.roulette-card--common {
  border: 2px solid #3a3a50;
  box-shadow: none;
}

.roulette-card.revealed.winning-card-highlight {
  border-color: #FF4500;
  box-shadow: 0 0 15px #FF4500;
}

.roulette-card > .card {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 8px;
}

.roulette-card.unknown,
.roulette-card > .card-hidden {
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: #444;
  border: 2px solid #3a3a50;
  border-radius: 10px;
  width: 100%;
  height: 100%;
}

.roulette-card.card-rare { border-color: #4fc3f7; }
.roulette-card.card-epic { border-color: #ab47bc; }

/* Résultat de roulette */
.roulette-result {
  margin-top: 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.roulette-result h3 { margin-bottom: 1rem; font-size: 1.5rem; }

.result-card-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 200px;
  margin-top: 1rem;
}

.result-card-wrap .card {
  transform: none !important;
  transition: none !important;
  width: 110px !important;
  min-height: 180px !important;
}


/* ============================================================
   10. PAGE — Auth (Login / Register / Mot de passe oublié)
   ============================================================ */

.page-auth {
  max-width: 400px;
  margin: 4rem auto;
  background: #1a1a2e;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
}

.auth-form { display: flex; flex-direction: column; gap: .8rem; margin: 1.5rem 0; }

.auth-form input {
  padding: .7rem 1rem;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: 1rem;
}

.auth-form button {
  padding: .8rem;
  background: #bb86fc;
  color: #0f0f1a;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
}

.auth-form button:hover { background: #d4a9ff; }

/* Forgot / Reset password */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.auth-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(187, 134, 252, 0.1);
}

.auth-title {
  font-size: 1.6rem;
  color: #bb86fc;
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-subtitle {
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.auth-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.auth-card .form-group label {
  font-size: 0.85rem;
  color: #b0b0b0;
  font-weight: 600;
}

.auth-card .form-group input {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #2a2a4a;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-card .form-group input:focus {
  outline: none;
  border-color: #bb86fc;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.15);
}

.auth-links {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.auth-links a { color: #bb86fc; transition: color 0.2s; }
.auth-links a:hover { color: #d4a9ff; }


/* ============================================================
   11. PAGE — Home
   ============================================================ */

.page-home { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
#roulette-container { width: 100%; }

.user-info {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: #1a1a2e;
  padding: .4rem 1.5rem .4rem .4rem;
  border-radius: 30px;
  font-size: 1rem;
}

/* Avatar Pokémon */
.avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.avatar-poke {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0d0d1f;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.avatar-btn:hover .avatar-poke { border-color: #bb86fc; box-shadow: 0 0 8px rgba(187,134,252,0.5); }

.avatar-poke img    { width: 36px; height: 36px; object-fit: contain; }
.avatar-poke.shiny  { border-color: #9a6fcc; box-shadow: 0 0 6px rgba(192,160,255,0.4); }
.avatar-poke.legendary { border-color: #c0a000; box-shadow: 0 0 6px rgba(255,215,0,0.35); }

.avatar-poke-placeholder {
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin-top: -4px;
}

/* Avatar miniature (classement) */
.avatar-poke-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0d0d1f;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-poke-sm img              { width: 24px; height: 24px; object-fit: contain; }
.avatar-poke-sm.shiny            { border-color: #9a6fcc; }
.avatar-poke-sm.legendary        { border-color: #c0a000; }
.avatar-poke-sm .avatar-poke-placeholder { font-size: 0.9rem; }

/* Modal avatar picker */
.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 0.5rem;
  max-height: 55vh;
  overflow-y: auto;
  padding: 0.25rem;
}

.avatar-picker-item {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: #1a1a2e;
  border: 2px solid #bb86fc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.avatar-picker-item img          { width: 44px; height: 44px; object-fit: contain; }
.avatar-picker-item:hover        { border-color: #bb86fc; }
.avatar-picker-item.selected     { border-color: #bb86fc; box-shadow: 0 0 10px rgba(187,134,252,0.5); }
.avatar-picker-item.shiny        { border-color: #bb86fc; box-shadow: 0 0 6px rgba(187,134,252,0.5); }
.avatar-picker-item.legendary    { border-color: #b08800; }

.avatar-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.avatar-modal {
  background: #1e1e2e;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 1.5rem;
  width: min(480px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.avatar-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #bb86fc;
}

.avatar-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.avatar-tab-bar {
  display: flex;
  gap: 0.5rem;
}

.avatar-tab {
  flex: 1;
  padding: 0.45rem 0;
  border: 1px solid #444;
  border-radius: 8px;
  background: #2a2a3e;
  color: #aaa;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.avatar-tab:hover { background: #333; color: #ddd; }

.avatar-tab.active {
  background: #bb86fc22;
  border-color: #bb86fc;
  color: #bb86fc;
}

.coin-icon { color: #ffa726; }


/* ============================================================
   PATCH NOTES MODAL
   ============================================================ */

.pn-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.pn-modal {
  background: #1e1e2e;
  border: 1px solid #444;
  border-radius: 16px;
  width: min(540px, 92vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  animation: modalScale 0.2s ease;
}

.pn-header {
  padding: 1rem 1.4rem 0.85rem;
  border-bottom: 1px solid #2a2a3e;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pn-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #bb86fc;
}

.pn-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pn-version-tag {
  background: #bb86fc22;
  border: 1px solid #bb86fc66;
  color: #bb86fc;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 20px;

}

.pn-version-date { font-size: 0.75rem; color: #555; }

.pn-body {
  overflow-y: auto;
  padding: 0.9rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* ── Sections ── */
.pn-section { display: flex; flex-direction: column; gap: 0.6rem; }

.pn-section + .pn-section {
  padding-top: 1rem;
  border-top: 1px solid #2a2a3e;
}

.pn-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.pn-section-icon { font-size: 1rem; }

.pn-section-new     .pn-section-title { color: #a5d6a7; }
.pn-section-fix     .pn-section-title { color: #90caf9; }
.pn-section-roadmap .pn-section-title { color: #ffcc80; }

/* ── Groups ── */
.pn-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #888;
  margin-top: 0.35rem;
  letter-spacing: 0.03em;
}

.pn-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding-left: 0.5rem;
}

.pn-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.855rem;
  line-height: 1.5;
}

.pn-bullet { color: #555; flex-shrink: 0; margin-top: 0.05rem; }
.pn-text   { color: #ccc; }

.pn-section-new     .pn-text { color: #ddd; }
.pn-section-fix     .pn-text { color: #ddd; }
.pn-section-roadmap .pn-text { color: #aaa; font-style: italic; }

.pn-footer {
  padding: 0.85rem 1.4rem;
  border-top: 1px solid #2a2a3e;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.pn-close-btn {
  padding: 0.5rem 1.4rem;
  border: none;
  border-radius: 8px;
  background: #bb86fc;
  color: #0f0f1a;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.pn-close-btn:hover { opacity: 0.85; }


/* ============================================================
   12. PAGE — Collection / Pokédex
   ============================================================ */

.page-collection h1 { margin-bottom: 1rem; }

.collection-stats {
  text-align: center;
  margin-bottom: 1rem;
  color: #bb86fc;
  font-size: 1rem;
}

.filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.filter-row--biomes,
.filter-row--types,
.filter-row--sort {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Filtre type Pokémon */
.type-filter-btn {
  --type-color: #4a4a6a;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--type-color) 60%, transparent);
  background: color-mix(in srgb, var(--type-color) 10%, transparent);
  color: color-mix(in srgb, var(--type-color) 90%, #e0e0e0);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.type-filter-btn:hover:not(.active) {
  background: color-mix(in srgb, var(--type-color) 28%, transparent);
}
.type-filter-btn.active {
  background: var(--type-color);
  color: #fff;
  border-color: var(--type-color);
}
.type-filter-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
}

/* Bandeau combo tickets dans la collection */
.collection-combo-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: #1a2a1a;
  border: 1px solid #4CAF5055;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #6ecb6e;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.combo-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  border: 1px solid #4CAF5088;
  background: transparent;
  color: #6ecb6e;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
.combo-preview-btn:hover,
.combo-preview-btn.active { background: #4CAF5022; border-color: #4CAF50; }
.combo-type-icon { width: 14px; height: 14px; object-fit: contain; vertical-align: middle; }

.filter-btn {
  padding: .4rem 1rem;
  border-radius: 20px;
  border: 2px solid #333;
  background: transparent;
  color: #e0e0e0;
  cursor: pointer;
  font-size: .85rem;
  transition: all .2s;
}

.filter-btn.active,
.filter-btn:hover { background: #bb86fc; border-color: #bb86fc; color: #0f0f1a; }

.biome-filter-btn {
  --biome-color: #4a4a6a;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--biome-color);
  background: color-mix(in srgb, var(--biome-color) 10%, transparent);
  color: color-mix(in srgb, var(--biome-color) 80%, #e0e0e0);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.biome-filter-btn:hover:not(.active) {
  background: color-mix(in srgb, var(--biome-color) 28%, transparent);
}

.biome-filter-btn.active {
  background: var(--biome-color);
  color: #fff;
  border-color: var(--biome-color);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 1rem;
  align-items: start;
}

.card-actions {
  display: flex;
  width: 100%;
  gap: 4px;
  padding-top: 8px;
  box-sizing: border-box;
  margin-top: auto;
}

.card-actions button:only-child { flex: 1; }

.card.not-owned {
  justify-content: center;
  opacity: 0.6;
  filter: grayscale(30%);
}

.card.not-owned .card-info {
  margin-top: 15px;
  flex-grow: 0;
}

.card:not(.not-owned) { justify-content: flex-start; }


/* ============================================================
   13. PAGE — Fusion (Merge)
   ============================================================ */

.merge-message {
  text-align: center;
  padding: .7rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
  animation: fadeIn .3s ease;
}

.merge-message.success { background: #1b5e20; color: #a5d6a7; }
.merge-message.error   { background: #b71c1c; color: #ffcdd2; }

.merge-btn, .sell-btn {
  flex: 1;
  height: 30px;
  border: none;
  border-radius: 6px;
  padding: 0;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.merge-btn {
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  color: white;
}

.merge-btn:hover {
  background: linear-gradient(135deg, #66BB6A, #43A047);
  filter: brightness(1.1);
  transform: translateY(-1px);
  opacity: 0.8;
}

.merge-btn:active, .sell-btn:active { transform: scale(0.95); }

.sell-btn { background: #ffd700; color: #1a1a1a; }

.sell-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  opacity: 0.8;
}


/* ============================================================
   14. PAGE — Règles
   ============================================================ */

.page-rules {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem;
  color: #e0e0e0;
}

.page-rules h1 {
  text-align: center;
  color: #bb86fc;
  margin-bottom: .5rem;
}

.rules-intro {
  text-align: center;
  color: #666;
  font-size: .85rem;
  margin-bottom: 1.5rem;
}

/* ── Boîte à idées / Roadmap (tableau Kanban) ────────────────────────────── */

.page-suggestions {
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem;
  color: #e0e0e0;
}

.page-suggestions h1 { text-align: center; color: #bb86fc; margin-bottom: .5rem; }

.sugg-intro {
  text-align: center;
  color: #999;
  font-size: .9rem;
  margin-bottom: 1.2rem;
}

.sugg-form {
  max-width: 680px;
  margin: 0 auto 2rem;
}

.sugg-form textarea {
  padding: .7rem 1rem;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.sugg-form select {
  padding: .6rem 1rem;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: .95rem;
  font-family: inherit;
}

.sugg-roadmap-form { border: 2px dashed #bb86fc; border-radius: 10px; padding: 1rem; }
.sugg-roadmap-title { margin: 0; font-size: 1rem; color: #bb86fc; }

/* Le plateau : une colonne par statut, défilement horizontal si besoin */
.sugg-board {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: .5rem .25rem 1.5rem;
}

.sugg-column {
  scroll-snap-align: start;
  flex: 1 1 220px;
  max-width: 340px;
  background: #16161f;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  padding: .8rem;
}

@media (max-width: 768px) {
  .page-suggestions { padding: 1.3rem .9rem; }

  .sugg-board {
    flex-direction: column;
    overflow-x: visible;
    scroll-snap-type: none;
    gap: 1.2rem;
  }

  .sugg-column { flex: 1 1 auto; width: 100%; }

  .sugg-column-cards {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sugg-card { flex: 1 1 260px; }
}

.sugg-column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ddd;
  font-size: .92rem;
  margin: 0 0 .7rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #2a2a3a;
}

.sugg-column-count {
  background: #2a2a3a;
  color: #aaa;
  font-size: .72rem;
  padding: .1rem .5rem;
  border-radius: 10px;
}

.sugg-column-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sugg-column-empty {
  color: #555;
  font-size: .82rem;
  text-align: center;
  padding: .8rem 0;
}

/* Cartes en style post-it : papier coloré, légère rotation, ombre */
.sugg-card {
  background: #fff59d;
  color: #2a2414;
  border-radius: 3px;
  padding: .8rem .9rem;
  box-shadow: 2px 3px 6px rgba(0,0,0,.35);
  transition: transform .15s, box-shadow .15s;
}
.sugg-card:hover {
  box-shadow: 3px 5px 10px rgba(0,0,0,.45);
  transform: rotate(0deg) scale(1.02) !important;
  z-index: 1;
}

.sugg-column-cards .sugg-card:nth-child(3n+1) { transform: rotate(-1.4deg); }
.sugg-column-cards .sugg-card:nth-child(3n+2) { transform: rotate(1.1deg); }
.sugg-column-cards .sugg-card:nth-child(3n)   { transform: rotate(-0.4deg); }

.sugg-col--proposed    .sugg-card { background: #fff59d; }
.sugg-col--planned     .sugg-card { background: #90caf9; }
.sugg-col--in_progress .sugg-card { background: #ffcc80; }
.sugg-col--done        .sugg-card { background: #a5d6a7; }
.sugg-col--rejected    .sugg-card { background: #ef9a9a; }
.sugg-col--archived    .sugg-card { background: #cfd8dc; }

.sugg-text { margin-bottom: .4rem; white-space: pre-wrap; font-size: .92rem; }

.sugg-meta { font-size: .74rem; color: #4a4430; opacity: .75; }

.sugg-card--official { border: 2px solid #2a2414; }

.sugg-official-badge {
  display: inline-block;
  background: #2a2414;
  color: #fff59d;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 10px;
  margin-bottom: .45rem;
}

.sugg-title { margin: 0 0 .35rem; font-size: 1.02rem; font-weight: 700; }

.sugg-admin-note {
  margin-top: .5rem;
  padding-top: .4rem;
  border-top: 1px dashed rgba(0,0,0,.25);
  font-size: .82rem;
  color: #3a3420;
  font-style: italic;
  white-space: pre-wrap;
}

.sugg-admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .6rem;
  padding-top: .6rem;
  border-top: 1px dashed rgba(0,0,0,.25);
}

.sugg-admin-controls select,
.sugg-admin-controls textarea,
.sugg-admin-controls input[type="text"] {
  padding: .4rem .6rem;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,.25);
  background: rgba(255,255,255,.55);
  color: #2a2414;
  font-size: .82rem;
  font-family: inherit;
}

.sugg-admin-controls textarea,
.sugg-admin-controls input[type="text"] { flex-basis: 100%; resize: vertical; }

.sugg-admin-controls button {
  padding: .4rem .9rem;
  background: #2a2414;
  color: #fff59d;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
}
.sugg-admin-controls button:hover { background: #443c20; }

.sugg-save-feedback { color: #b71c1c; font-size: .78rem; align-self: center; }

.sugg-vote-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .5rem 0;
}

.sugg-vote-label { font-size: .76rem; color: #4a4430; }

.sugg-vote-btn {
  background: rgba(255,255,255,.4);
  border: 1px solid rgba(0,0,0,.25);
  color: #2a2414;
  padding: .25rem .6rem;
  border-radius: 16px;
  font-size: .78rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.sugg-vote-btn:hover { border-color: #2a2414; }
.sugg-vote-btn--active-up   { border-color: #1b5e20; color: #1b5e20; background: rgba(255,255,255,.7); }
.sugg-vote-btn--active-down { border-color: #b71c1c; color: #b71c1c; background: rgba(255,255,255,.7); }

.sugg-note-vote-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: #3a3420;
  flex-basis: 100%;
}

/* ── Tchat temps réel ─────────────────────────────────────────────────────── */

.page-chat {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}

.page-chat h1 { text-align: center; color: #bb86fc; margin-bottom: 1rem; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  background: #16161f;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  padding: .8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.chat-msg {
  background: #1e1e2f;
  border-radius: 8px;
  padding: .5rem .8rem;
}

.chat-msg-user { font-weight: 600; color: #bb86fc; font-size: .85rem; }
.chat-msg-time { font-size: .72rem; color: #777; margin-left: .5rem; }
.chat-msg-text { margin-top: .15rem; font-size: .92rem; white-space: pre-wrap; word-break: break-word; }

.chat-ban-btn {
  background: none;
  border: none;
  color: #777;
  font-size: .8rem;
  cursor: pointer;
  float: right;
  opacity: .6;
  transition: opacity .15s;
}
.chat-ban-btn:hover { opacity: 1; }

.chat-admin-panel {
  background: #1e1e2f;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  padding: .6rem .8rem;
  margin-bottom: .8rem;
  font-size: .82rem;
}

.chat-admin-title { color: #bb86fc; font-weight: 600; margin-bottom: .4rem; }
.chat-admin-empty { color: #888; }

.chat-banned-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #2a1a1a;
  border: 1px solid #4a2a2a;
  color: #ef9a9a;
  border-radius: 14px;
  padding: .25rem .5rem .25rem .8rem;
  margin: .2rem .3rem .2rem 0;
}

.chat-unban-btn {
  background: #ef9a9a;
  color: #2a1414;
  border: none;
  border-radius: 10px;
  padding: .15rem .5rem;
  font-size: .72rem;
  cursor: pointer;
}
.chat-unban-btn:hover { background: #f4baba; }

.chat-form {
  display: flex;
  gap: .6rem;
  margin-top: 1rem;
}

.chat-form input {
  flex: 1;
  padding: .7rem 1rem;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: 1rem;
  font-family: inherit;
}

.chat-form button {
  padding: .7rem 1.2rem;
  background: #bb86fc;
  color: #0f0f1a;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.chat-form button:hover { background: #d4a9ff; }

/* ── Ligue des 4 ──────────────────────────────────────────────────────────── */

.page-league {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
  color: #e0e0e0;
}

.page-league h1 { text-align: center; color: #bb86fc; margin-bottom: 1rem; }

.league-locked, .league-intro {
  text-align: center;
  color: #aaa;
  font-size: .92rem;
  line-height: 1.5;
  margin-bottom: 1.2rem;
}

.page-league > .btn { display: block; margin: 0 auto 1rem; }

.league-stage { margin-bottom: .8rem; }

.league-reward {
  margin-top: 1.5rem;
  text-align: center;
}

.league-reward-title { text-align: center; color: #e0e0e0; margin-bottom: .2rem; }

.league-reward-choice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  margin-top: .8rem;
}

.league-reward-card {
  position: relative;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.4rem 1.1rem 1.2rem;
  border-radius: 12px;
  background: #16161f;
  border: 1px solid #2a2a3a;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.league-reward-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  flex: 1;
  justify-content: center;
  width: 100%;
}

.league-reward-card--safe {
  border-color: #2e7d4f;
}
.league-reward-card--clickable.league-reward-card--safe:hover {
  transform: translateY(-3px);
  border-color: #4caf50;
  box-shadow: 0 0 0 2px rgba(76,175,80,.35), 0 8px 20px rgba(76,175,80,.25);
}
.league-reward-card--clickable.league-reward-card--safe:active {
  transform: translateY(-1px);
}

.league-reward-card--risky {
  border-color: #7038F8;
}
.league-reward-card--clickable.league-reward-card--risky:hover {
  transform: translateY(-3px);
  border-color: #bb86fc;
  box-shadow: 0 0 0 2px rgba(187,134,252,.35), 0 8px 20px rgba(187,134,252,.3);
}
.league-reward-card--clickable.league-reward-card--risky:active {
  transform: translateY(-1px);
}

.league-reward-card--clickable {
  cursor: pointer;
  user-select: none;
}
.league-reward-card--clickable:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.league-reward-card--disabled {
  pointer-events: none;
  opacity: .55;
  cursor: default;
}

.league-reward-card-hint {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #888;
  text-align: center;
  margin: .2rem 0 0;
}
.league-reward-card--safe .league-reward-card-hint { color: #6fcf8e; }
.league-reward-card--risky .league-reward-card-hint { color: #c9a3ff; }

.league-reward-card-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #2e7d4f;
  color: #d7ffe4;
}
.league-reward-card-badge--risky {
  background: #5b2bb8;
  color: #ecdcff;
}

.league-reward-card-icon { font-size: 2.1rem; line-height: 1; margin-top: .3rem; }

.league-reward-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.league-reward-card-desc {
  font-size: .8rem;
  color: #999;
  text-align: center;
  line-height: 1.4;
  margin: 0;
  min-height: 2.4em;
}

.league-legendary-select {
  width: 100%;
  padding: .5rem .6rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #0f0f1a;
  color: #e0e0e0;
  font-family: inherit;
  font-size: .85rem;
}

.league-legendary-capture-pct {
  font-size: .78rem;
  color: #aaa;
  text-align: center;
  margin: 0;
}

.league-reward-done {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffd54f;
  text-align: center;
  margin-top: 1rem;
}

/* ── Widget de tchat flottant ─────────────────────────────────────────────── */

#chat-widget {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 1500;
}

.chat-bubble {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #bb86fc;
  color: #0f0f1a;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  position: relative;
}
.chat-bubble:hover { background: #d4a9ff; }
.chat-bubble .nav-badge { position: absolute; top: 4px; right: 4px; }

.chat-panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 320px;
  max-width: calc(100vw - 36px);
  height: 420px;
  background: #16161f;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .9rem;
  background: #1e1e2f;
  color: #bb86fc;
  font-weight: 600;
  border-bottom: 1px solid #2a2a3a;
}

.chat-panel-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1rem;
}
.chat-panel-close:hover { color: #e0e0e0; }

#chat-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: .6rem .7rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

#chat-widget-form {
  display: flex;
  gap: .4rem;
  padding: .6rem;
  border-top: 1px solid #2a2a3a;
}
#chat-widget-form input {
  flex: 1;
  padding: .5rem .7rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: .88rem;
  font-family: inherit;
}
#chat-widget-form button {
  padding: .5rem .8rem;
  background: #bb86fc;
  color: #0f0f1a;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
#chat-widget-form button:hover { background: #d4a9ff; }

.rule-group-title {
  margin: 1.8rem 0 .6rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid #333;
  color: #888;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.rule-group-title:first-of-type { margin-top: 0; }

.rule-accordion {
  background: #1e1e2f;
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: .6rem;
  overflow: hidden;
}

.rule-accordion[open] {
  border-color: #bb86fc55;
}

.rule-accordion__title {
  list-style: none;
  padding: .9rem 1.2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #bb86fc;
  display: flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
}
.rule-accordion__title::-webkit-details-marker { display: none; }
.rule-accordion__title::after {
  content: '▸';
  margin-left: auto;
  font-size: .8rem;
  color: #666;
  transition: transform .2s;
}
.rule-accordion[open] .rule-accordion__title::after {
  transform: rotate(90deg);
}
.rule-accordion__title:hover { background: rgba(187,134,252,.06); }

.rule-accordion__body {
  padding: .2rem 1.2rem 1rem;
  border-top: 1px solid #2a2a3f;
}

.rule-accordion__body ul {
  margin: .6rem 0 0;
  padding-left: 1.2rem;
}

.rule-accordion__body li {
  margin-bottom: .5rem;
  line-height: 1.5;
  color: #ccc;
  font-size: .9rem;
}

.rule-subsection-title {
  margin: .9rem 0 .3rem;
  font-weight: 600;
  color: #e0e0e0;
  font-size: .9rem;
}

.rule-note {
  margin-top: .8rem;
  font-size: .8rem;
  color: #666;
  font-style: italic;
}


/* ============================================================
   15. PAGE — Classement (Leaderboard)
   ============================================================ */

.page-leaderboard {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.leaderboard-desc {
  color: #b0bec5;
  margin-bottom: 2rem;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(187, 134, 252, 0.15);
}

.leaderboard-table th {
  background-color: #2c2c2c;
  color: #bb86fc;
  padding: 1rem;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.leaderboard-table td {
  padding: 1rem;
  border-bottom: 1px solid #2c2c2c;
  color: #e0e0e0;
}

.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:hover { background-color: #252525; }

.rank { font-weight: bold; font-size: 1.2rem; }
.player-name { font-weight: bold; color: #ffffff; }
.legendary-count { color: #ffb300; }
.shiny-count { color: #bb86fc; text-shadow: 0 0 5px rgba(187, 134, 252, 0.4); font-weight: bold; }
.lb-count-gold { color: #ffd700; text-shadow: 0 0 5px rgba(255, 215, 0, 0.5); font-weight: bold; }

.leaderboard-separator {
  text-align: center;
  padding: 1rem 0 0.5rem;
  color: #555;
  font-size: 1.2rem;
  letter-spacing: 0.4rem;
}

.leaderboard-separator-label {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: #bb86fc;
  margin-top: 0.25rem;
  text-transform: uppercase;
}

.current-player-row {
  background-color: rgba(187, 134, 252, 0.12) !important;
  outline: 1px solid rgba(187, 134, 252, 0.4);
}

.current-player-row .player-name { color: #bb86fc; font-weight: bold; }

/* Classement tricheurs */
.lb-badges-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
  max-width: 78px;
}

.lb-badge-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
  transition: transform 0.15s;
}

.lb-badge-img:hover { transform: scale(1.4); }

.lb-player-name-wrap { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.lb-player-name-text { flex: 1; }


.leaderboard-cheater-wrap { margin-top: 2rem; text-align: center; }

.leaderboard-cheater-btn {
  background: transparent;
  border: 1px solid #555;
  color: #888;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.2s, border-color 0.2s;
}

.leaderboard-cheater-btn:hover { color: #cf6679; border-color: #cf6679; }

.leaderboard-cheater-header { margin-bottom: 1.5rem; }

.leaderboard-cheater-title {
  color: #cf6679;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.leaderboard-cheater-desc {
  color: #888;
  font-size: 0.9rem;
  max-width: 600px;
}

.leaderboard-cheater-table tr td { opacity: 0.75; }

.leaderboard-back-wrap { margin-top: 1.5rem; }

.leaderboard-back-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.2s, border-color 0.2s;
}

.leaderboard-back-btn:hover { color: #bb86fc; border-color: #bb86fc; }

/* Shiny feed */
.shiny-feed-section {
  margin-top: 3rem;
  text-align: left;
}

.shiny-feed-title {
  font-size: 1.2rem;
  color: #bb86fc;
  margin-bottom: 1rem;
  text-align: center;
}

.shiny-feed-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shiny-feed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #1e1e2e;
  border: 1px solid #3a2060;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
}

.shiny-feed-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(187, 134, 252, 0.5));
}

.shiny-feed-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.shiny-feed-name {
  font-weight: 700;
  color: #e0b0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shiny-feed-player {
  font-size: 0.8rem;
  color: #888;
}

.shiny-feed-date {
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.shiny-feed-item--legendary {
  border-color: #6b4f00;
  background: #1e1a0e;
}
.shiny-feed-item--legendary .shiny-feed-img {
  filter: drop-shadow(0 0 6px rgba(255, 196, 0, 0.55));
}
.shiny-feed-item--legendary .shiny-feed-name {
  color: #ffd966;
}
.shiny-feed-item--miss {
  opacity: 0.55;
}

.slot-feeds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
  align-self: stretch;
  margin-top: 0.5rem;
}

.slot-feed-col {
  min-width: 0;
}

.slot-feed-col-title {
  font-size: 1rem;
  font-weight: 700;
  color: #bb86fc;
  margin-bottom: 0.75rem;
  text-align: center;
}

@media (max-width: 600px) {
  .slot-feeds-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   16. PAGE — Mon Équipe
   ============================================================ */

.team-page {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Roulette d'équipe */
.team-roulette-section {
  background: #1e1e2e;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #333;
}

.team-roulette-section h2 { margin-bottom: 0.5rem; color: #bb86fc; }
.team-roulette-section .roulette-wrapper { max-width: 100%; }
.team-roulette-section .btn-spin { max-width: 100%; }

.team-roulette-warning {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #b0853a;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.25);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  text-align: center;
  line-height: 1.5;
}

/* Roulette dans l'équipe — spécifique */
.roulette-card.roulette-winner {
  border-color: #bb86fc;
  box-shadow: 0 0 12px #bb86fc;
  transform: scale(1.05);
}

.roulette-card.rarity-commun    { border-color: #888; }
.roulette-card.rarity-rare      { border-color: #5b9bd5; }
.roulette-card.rarity-épique    { border-color: #bb86fc; }
.roulette-card.rarity-légendaire { border-color: #ffd700; }

.roulette-reel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  will-change: transform;
}

.roulette-reel--spinning { animation: reel-spin 0.4s linear infinite; }

.roulette-reel--result {
  animation: none;
  justify-content: center;
  width: 100%;
  padding: 0;
}

.roulette-card--placeholder { color: #555; font-size: 1.5rem; }

.roulette-card--winner {
  border-color: #bb86fc;
  box-shadow: 0 0 16px #bb86fc88;
  animation: winner-pulse 0.6s ease-in-out infinite alternate;
}

.roulette-card__type-icon,
.card-type-icon {
  height: 18px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
  margin-top: 2px;
}

/* Disposition équipe + badges */
.team-and-badges {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.team-left-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.team-right-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

/* Slots */
.team-slots-section {
  background: #1e1e2e;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #333;
}

.team-slots-section h2 { color: #bb86fc; margin-bottom: 1rem; }

.team-slots-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.team-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.team-slot--empty,
.team-slot.empty {
  height: 180px;
  min-height: 180px;
  border: 2px dashed #444;
  border-radius: 10px;
  background: #12121c;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 1.5rem;
}

.team-slot--filled { border-color: #555; }

.team-slot.occupied {
  border: 2px solid #bb86fc44;
  border-radius: 10px;
  background: #12121c;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.2s;
}

.team-slot.occupied:hover { border-color: #bb86fc; }

.team-slot.team-slot--filled {
  border-radius: 12px;
  background: #12121c;
  padding: 0.75rem 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  border: 2px solid #444;
}

.team-slot.team-slot--filled:hover {
  box-shadow: 0 0 12px rgba(187, 134, 252, 0.2);
}

/* Bordures de rareté */
.rarity-border-commun     { border-color: #9e9e9e; }
.rarity-border-rare       { border-color: #2196f3; }
.rarity-border-épique     { border-color: #bb86fc; }
.rarity-border-légendaire { border-color: #ffd700; }

/* Contenu du slot */
.team-slot__img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}

.team-slot__name {
  font-weight: bold;
  font-size: 0.82rem;
  color: #eee;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.team-slot__type {
  display: flex;
  align-items: center;
  gap: 4px;
  transform: scale(0.8);
}

.team-slot__type-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 22px;
}

.team-slot__type-icon {
  height: 20px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.team-slot__type-text {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #333;
  color: #ccc;
  text-transform: capitalize;
}

/* Bouton retirer */
.team-slot__remove-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 0.7rem;
  background: transparent;
  color: #aaa;
  border: 1px solid #444;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  width: 100%;
  justify-content: center;
}

.team-slot__remove-btn:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: #e74c3c;
  color: #e74c3c;
}

.remove-icon  { font-size: 0.65rem; opacity: 0.7; }
.remove-label { font-weight: 600; }
.remove-cost  { color: #ffa726; font-weight: 500; }

/* Bouton vider l'équipe */
.team-clear-wrapper { display: flex; justify-content: center; }

.team-clear-btn {
  background: transparent;
  border: 1px solid #cf6679;
  color: #cf6679;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}

.team-clear-btn:hover { background: #cf6679; color: #1a1a2e; }
.clear-cost { opacity: 0.7; font-size: 0.8em; }

/* Réorganisation */
.team-reorder-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: color 0.2s, border-color 0.2s;
}

.team-reorder-btn:hover { color: #bb86fc; border-color: #bb86fc; }

.team-reorder-btn--active { color: #4caf50; border-color: #4caf50; }
.team-reorder-btn--active:hover { color: #66bb6a; border-color: #66bb6a; }

.team-reorder-banner {
  background: rgba(187, 134, 252, 0.08);
  border: 1px solid rgba(187, 134, 252, 0.25);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: #bb86fc;
  margin-bottom: 1rem;
  text-align: center;
}

.team-slot--reorder { cursor: pointer; }

.team-slot--reorder:hover {
  border-color: #bb86fc !important;
  background: rgba(187, 134, 252, 0.06);
}

.team-slot--selected {
  border-color: #bb86fc !important;
  background: rgba(187, 134, 252, 0.14) !important;
  box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.4);
}

.team-slot__swap-icon { font-size: 1.1rem; color: #bb86fc; margin-top: 0.25rem; }
.team-slot--selected .team-slot__swap-icon { color: #4caf50; }

/* Types */
.type-feu      { background: #c0392b; }
.type-eau      { background: #2980b9; }
.type-plante   { background: #27ae60; }
.type-électrik { background: #f39c12; color: #111; }
.type-psy      { background: #8e44ad; }
.type-roche    { background: #7f8c8d; }
.type-sol      { background: #a0522d; }
.type-poison   { background: #6c3483; }
.type-normal   { background: #555; }
.type-vol      { background: #5499c7; }
.type-glace    { background: #85c1e9; color: #111; }
.type-dragon   { background: #1a5276; }
.type-combat   { background: #922b21; }
.type-insecte  { background: #1e8449; }
.type-spectre  { background: #4a235a; }

/* Badges */
.team-badges-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-badges-section h2 {
  font-size: 1rem;
  text-align: center;
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.team-badges-section .badges-grid {
  grid-template-columns: repeat(2, 60px);
  justify-content: center;
}

.badge-slot {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.badge-slot.locked {
  height: 80px;
  border: 2px dashed #333;
  border-radius: 10px;
  background: #12121c;
}

.badge-slot.obtained {
  position: relative;
  border: 2px solid #ffd70066;
  border-radius: 10px;
  background: #12121c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  cursor: default;
  transition: border-color 0.2s;
}

.badge-slot.obtained:hover { border-color: #ffd700; }

.badge-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px #ffd70088);
}

.badge-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e1e;
  border: 1px solid #bb86fc;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
  font-size: 0.8rem;
  z-index: 10;
  pointer-events: none;
}

.badge-slot:hover .badge-tooltip {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-slot--empty {
  background: #2a2a2a;
  border: 2px dashed #444;
  &::after { content: '?'; color: #555; font-size: 1.2rem; }
}

.badge-slot--obtained {
  background: radial-gradient(circle, #3a2f1a, #1a1a1a);
  border: 2px solid #bb86fc;
  box-shadow: 0 0 8px #bb86fc66;
}

.badge-slot__img { width: 48px; height: 48px; object-fit: contain; }

/* Modale intro équipe */
.team-intro-modal p { margin: 0 0 1rem; color: #ccc; line-height: 1.5; }

.team-intro-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.team-intro-list li {
  padding: 0.6rem 0.75rem;
  background: #2a2a2a;
  border-left: 3px solid #bb86fc;
  border-radius: 6px;
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.4;
}

.team-intro-list li strong { color: #fff; }

.team-intro-list li:nth-child(2),
.team-intro-list li:nth-child(3) { border-left-color: #cf6679; }


/* ============================================================
   17. PAGE — Arènes (Gym)
   ============================================================ */

.gyms-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Barre de progression badges */
.badges-progress-bar {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.badges-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #ccc;
}

.badges-daily-bonus { color: #ffd700; font-weight: bold; }

.badges-progress-track {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.badge-pip {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 2px solid #444;
  transition: transform 0.2s;
}

.badge-pip--obtained {
  border-color: #ffd700;
  background: #1a1400;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.badge-pip--obtained:hover { transform: scale(1.12); }

.badge-pip--empty { border-color: #333; background: #111; color: #444; font-size: 1.1rem; }

.badge-pip img { width: 38px; height: 38px; object-fit: contain; }

/* Carte arène */
.gym-card {
  background: #1e1e1e;
  border: 1px solid var(--gym-color, #bb86fc);
  border-radius: 16px;
  overflow: hidden;
}

.gym-card-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--gym-color, #bb86fc) 12%, #111);
  border-bottom: 1px solid var(--gym-color, #bb86fc);
  flex-wrap: wrap;
}

.gym-type-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 80px;
}

.gym-type-img { width: 64px; height: 64px; object-fit: contain; }

.gym-title h2 { margin: 0 0 0.25rem; color: #fff; font-size: 1.4rem; }

.gym-badge-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: #ccc;
  font-size: 0.9rem;
}

.gym-badge-preview { width: 28px; height: 28px; object-fit: contain; }

/* Équipe du champion */
.gym-champion-section { padding: 1.5rem; border-bottom: 1px solid #333; }
.gym-champion-section h3 { margin: 0 0 1rem; color: #bb86fc; }

.gym-champion-team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.champion-pokemon-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  transition: border-color 0.2s;
}

.champion-pokemon-card:hover { border-color: var(--gym-color, #bb86fc); }

.champion-pokemon-card--ko {
  opacity: 0.35;
  filter: grayscale(1);
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.gym-recommended-types {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.gym-recommended-types__label { color: #aaa; font-size: 0.9rem; }

.gym-recommended-types__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gym-recommended-type {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--type-color, #bb86fc);
  background: color-mix(in srgb, var(--type-color, #bb86fc) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--type-color, #bb86fc) 40%, transparent);
}

.gym-recommended-type__img { width: 18px; height: 18px; object-fit: contain; }

.champion-pokemon-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
}

.champion-pokemon-name { font-size: 0.8rem; color: #eee; font-weight: 600; }

/* Zone action combat */
.gym-battle-action {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.gym-battle-hint { color: #aaa; font-size: 0.9rem; text-align: center; max-width: 480px; margin: 0; }
.gym-battle-btn  { font-size: 1.05rem; padding: 0.75rem 2.5rem; }
.gym-battle-error { color: #f44336; font-size: 0.9rem; margin: 0; }

.gym-cooldown { padding: 1.5rem; text-align: center; color: #aaa; }
.gym-cooldown strong { color: #ffd700; }

/* Résultat de combat */
.battle-result {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.battle-result--win  { border-top: 3px solid #4caf50; }
.battle-result--lose { border-top: 3px solid #f44336; }

.battle-result-title { text-align: center; }
.battle-result-title h3 { margin: 0 0 0.5rem; font-size: 1.5rem; }

.battle-badge-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.battle-teams-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
}

.battle-vs { font-size: 1.4rem; font-weight: bold; color: #888; padding-top: 1rem; }

.battle-team-col h4 { margin: 0 0 0.75rem; color: #bb86fc; text-align: center; }

.team-summary { display: flex; flex-direction: column; gap: 0.4rem; }

.team-summary-pokemon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #111;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  position: relative;
}

.team-summary-pokemon img { width: 36px; height: 36px; object-fit: contain; }

.team-summary-pokemon--ko { opacity: 0.4; filter: grayscale(1); }

.ko-label {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: bold;
  color: #f44336;
  background: #2a0000;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

/* Log de combat */
.battle-log-details { background: #111; border-radius: 8px; padding: 0.75rem 1rem; }
.battle-log-details summary { cursor: pointer; color: #bb86fc; font-size: 0.9rem; padding: 0.25rem 0; }

.battle-log {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.battle-log-round {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  border-left: 3px solid transparent;
}

.battle-log-round--player   { background: #0a1a0a; border-left-color: #4caf50; }
.battle-log-round--champion { background: #1a0a0a; border-left-color: #f44336; }

.battle-log-num     { color: #666; font-size: 0.75rem; font-weight: bold; }
.battle-log-matchup { color: #ccc; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.battle-log-arrow   { color: #555; }
.battle-log-proba   { color: #888; font-size: 0.78rem; white-space: nowrap; }

.battle-result-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Tous badges obtenus */
.gym-all-done { padding: 3rem 2rem; text-align: center; }
.gym-all-done h2 { color: #ffd700; margin-bottom: 1rem; }
.gym-all-done p  { color: #ccc; margin-bottom: 1.5rem; }
.gym-no-team     { color: #666; font-style: italic; }

/* Animation combat — scène de duel */
.battle-arena {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.battle-arena-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #bb86fc;
  margin-bottom: 1.2rem;
  letter-spacing: 1px;
}

.duel-stage {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  min-height: 200px;
}

.duel-round-label {
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #aaa;
  margin-bottom: 1rem;
}

.duel-fighters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.duel-fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 100px;
}

.duel-fighter--player   { align-items: flex-end; }
.duel-fighter--champion { align-items: flex-start; }

.duel-fighter-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.15));
  animation: fighter-enter 0.4s ease-out both;
}

.duel-fighter-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e0e0e0;
  text-align: center;
  animation: fighter-enter 0.4s ease-out both;
}

.duel-gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.duel-gauge-svg { width: 160px; height: 90px; overflow: visible; }

.duel-gauge-legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.68rem;
  color: #aaa;
}

.duel-gauge-legend--win  { color: #4caf50; }
.duel-gauge-legend--lose { color: #f44336; }

.duel-outcome {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.5rem;
  margin-top: 0.8rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-height: 2rem;
}

.duel-outcome--pending       { color: #555; }
.duel-outcome--player-wins   { color: #4caf50; background: rgba(76, 175, 80, 0.12); }
.duel-outcome--champion-wins { color: #f44336; background: rgba(244, 67, 54, 0.12); }

/* Mini-log */
.battle-mini-log {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.mini-log-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  border-left: 3px solid transparent;
  animation: mini-log-appear 0.3s ease;
}

.mini-log-line--player   { background: rgba(76, 175, 80, 0.08); border-color: #4caf50; }
.mini-log-line--champion { background: rgba(244, 67, 54, 0.08); border-color: #f44336; }

.mini-log-num   { color: #888; min-width: 24px; font-size: 0.75rem; }
.mini-log-icon  { font-size: 0.85rem; }
.mini-log-names { flex: 1; }
.mini-log-arrow { color: #666; margin: 0 0.2rem; }
.mini-log-pct   { color: #aaa; font-size: 0.75rem; min-width: 32px; text-align: right; }

/* Animation K.O. */
.duel-fighter-img--ko { animation: pokemon-ko 0.6s ease-out forwards; }

.duel-ko-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f44336;
  letter-spacing: 0.05em;
  animation: ko-label-appear 0.3s ease-out both;
}

/* Estimation de victoire */
.win-estimate {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px auto 16px;
  max-width: 480px;
  width: 100%;
}

.win-estimate__label { font-size: 0.85rem; color: #aaa; }

.win-estimate__bar-wrapper {
  position: relative;
  background: #333;
  border-radius: 8px;
  height: 26px;
  overflow: hidden;
}

.win-estimate__bar { height: 100%; border-radius: 8px; transition: width 0.8s ease; }

.win-estimate__value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
  font-size: 0.85rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.win-estimate__details { font-size: 0.8rem; color: #aaa; margin-top: 4px; }
.win-estimate__details ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.win-estimate__matchup {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
  border-radius: 4px;
  background: #1e1e1e;
}

.win-estimate__vs { color: #666; margin: 0 6px; }
.win-estimate__matchup-pct { font-weight: bold; min-width: 38px; text-align: right; }

/* Historique global des combats */
.gym-history {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 1.5rem;
}

.gym-history-title {
  color: #bb86fc;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.gh-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gh-entry {
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  overflow: hidden;
}

.gh-entry--win  { border-left: 3px solid #4caf50; }
.gh-entry--lose { border-left: 3px solid #f44336; }

.gh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: #161616;
  flex-wrap: wrap;
}

.gh-gym-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gh-badge-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px #ffd70066);
  flex-shrink: 0;
}

.gh-badge-order {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: bold;
  color: #aaa;
  flex-shrink: 0;
}

.gh-gym-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.gh-gym-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #eee;
}

.gh-date {
  font-size: 0.75rem;
  color: #666;
}

.gh-result {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.gh-entry--win  .gh-result { color: #4caf50; }
.gh-entry--lose .gh-result { color: #f44336; }

.gh-team {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: #111;
}

.gh-pokemon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 52px;
}

.gh-pokemon-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.gh-pokemon-name {
  font-size: 0.6rem;
  color: #888;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.gh-no-team {
  font-size: 0.8rem;
  color: #555;
  font-style: italic;
}

/* Modale intro arènes */
.gyms-intro-modal p { margin: 0 0 1rem; color: #ccc; line-height: 1.5; }

.gyms-intro-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gyms-intro-list li {
  padding: 0.6rem 0.75rem;
  background: #2a2a2a;
  border-left: 3px solid #bb86fc;
  border-radius: 6px;
  color: #ddd;
  font-size: 0.9rem;
  line-height: 1.4;
}

.gyms-intro-list li:nth-child(5) { border-left-color: #4caf50; }


/* ============================================================
   18. ENTRAÎNEMENT QUOTIDIEN
   ============================================================ */

.training-panel {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(187, 134, 252, 0.3);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}

.training-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: .8rem;
}

.training-panel__title {
  font-size: 1rem;
  font-weight: 700;
  color: #e0e0e0;
}

.training-panel__subtitle {
  font-size: .85rem;
  color: #bb86fc;
  font-weight: 600;
}

.training-bonus-bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .7rem;
}

.training-bonus-bar__track {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,.1);
  border-radius: 6px;
  overflow: hidden;
}

.training-bonus-bar__fill {
  height: 100%;
  border-radius: 6px;
  transition: width .5s ease;
}

.training-bonus-bar__label {
  font-size: .8rem;
  color: #9e9e9e;
  white-space: nowrap;
  min-width: 56px;
  text-align: right;
}

.training-reset-note {
  display: block;
  font-size: .75rem;
  color: #666;
  margin-bottom: .7rem;
}

.training-panel__action {
  margin-top: .8rem;
}

.btn-training {
  background: linear-gradient(135deg, #7b2ff7, #bb86fc);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .55rem 1.2rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.btn-training:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.btn-training:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.training-result {
  padding: .6rem .9rem;
  border-radius: 8px;
  font-size: .9rem;
  margin-bottom: .7rem;
}
.training-result--win  { background: rgba(76,175,80,.15); border: 1px solid rgba(76,175,80,.4); color: #81c784; }
.training-result--lose { background: rgba(244,67,54,.1);  border: 1px solid rgba(244,67,54,.3); color: #e57373; }

.training-log-details {
  margin-top: .6rem;
  font-size: .82rem;
  color: #9e9e9e;
}
.training-log-details summary {
  cursor: pointer;
  color: #bb86fc;
  font-size: .8rem;
}

.win-estimate__bonus-hint {
  display: block;
  font-size: .78rem;
  color: #bb86fc;
  margin-top: .3rem;
  margin-bottom: .4rem;
}

/* ============================================================
   19. RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  #page { padding: 1rem; }

  /* Navbar */
  #navbar { padding: .8rem 1rem; flex-wrap: wrap; position: sticky; }
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding: 0.5rem 0 0.75rem;
  }

  .nav-links a {
    width: 100%;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 1rem;
  }

  .nav-links a:last-child { border-bottom: none; }

  #navbar.nav-open .nav-links { display: flex; }

  /* Sous-menus en accordéon sur mobile */
  .nav-dropdown { width: 100%; }

  .nav-dropdown-btn {
    width: 100%;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 1rem;
    justify-content: space-between;
  }
  .nav-dropdown.open .nav-dropdown-btn { border-bottom: none; }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    background: rgba(187,134,252,0.05);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .nav-dropdown-menu a {
    padding: 0.55rem 0.25rem 0.55rem 1.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.95rem;
  }
  .nav-dropdown-menu a:last-child { border-bottom: none; }

  /* Roulette */
  .roulette-wrapper { width: 100%; }
  .roulette-viewport { height: 180px; }
  .roulette-strip { padding: 8px 0; }
  .roulette-card { width: 110px; height: 164px; min-height: 0; }

  .btn-spin { padding: 0.9rem 2rem; font-size: 1.1rem; width: 100%; }

  .result-card-wrap .card { width: 110px !important; min-height: 180px !important; }

  /* Home */
  .user-info { gap: 1rem; padding: .6rem 1.2rem; font-size: 0.9rem; }

  /* Collection */
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); gap: 0.8rem; }

  /* Leaderboard */
  .leaderboard-table th,
  .leaderboard-table td { padding: 0.7rem 0.5rem; font-size: 0.85rem; }

  /* Colonnes Standards, Légendaires, Shiny masquées sur tablette */
  .leaderboard-table th:nth-child(3),
  .leaderboard-table td:nth-child(3),
  .leaderboard-table th:nth-child(4),
  .leaderboard-table td:nth-child(4),
  .leaderboard-table th:nth-child(5),
  .leaderboard-table td:nth-child(5) { display: none; }

  /* Équipe */
  .team-and-badges { grid-template-columns: 1fr; }
  .team-right-col  { max-width: 100%; align-items: center; }
  .team-badges-section { align-items: center; }
  .team-slots-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .team-and-badges { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  /* Équipes côte à côte dans le résultat de combat */
  .battle-teams-summary { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .battle-vs { display: none; }

  .battle-log-round { grid-template-columns: 44px 1fr; gap: 0.4rem; font-size: 0.78rem; }
  .battle-log-proba { grid-column: 2; }

  .gym-champion-team { grid-template-columns: repeat(3, 1fr); }

  /* Équipe */
  .team-slots-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  /* Layout vertical duel : joueur → jauge → champion */
  .battle-arena { padding: 1rem 0.6rem; }

  .duel-stage { padding: 0.75rem 0.5rem; min-height: unset; }

  .duel-fighters {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
  }

  .duel-fighter {
    flex: none;
    flex-direction: row;
    align-items: center !important;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
  }

  .duel-fighter-img { width: 56px; height: 56px; }
  .duel-fighter-name { font-size: 0.9rem; text-align: left; }

  .duel-gauge-wrapper { width: 100%; align-items: center; }
  .duel-gauge-svg { width: 220px; height: 124px; }

  .mini-log-names { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
  .mini-log-line  { font-size: 0.75rem; gap: 0.3rem; padding: 0.25rem 0.4rem; }

  .team-summary-pokemon { font-size: 0.78rem; padding: 0.25rem 0.4rem; }
  .team-summary-pokemon img { width: 28px; height: 28px; }

  .battle-result-actions { flex-direction: column; align-items: center; }

  /* Le mini-log de la modal de replay prend trop de place sur petit écran */
  .replay-modal .battle-mini-log { display: none; }
}

@media (max-width: 480px) {
  #page { padding: 0.8rem; }
  #navbar { padding: .6rem 0.8rem; }
  .nav-brand { font-size: 1.1rem; }

  .roulette-viewport { height: 160px; }
  .roulette-card { width: 100px; height: 144px; }
  .btn-spin { padding: 0.8rem 1.5rem; font-size: 1rem; }

  .result-card-wrap .card { width: 110px !important; min-height: 180px !important; }

  .user-info { flex-direction: column; align-items: center; gap: 0.5rem; padding: .5rem 1rem; font-size: 0.85rem; }

  h1 { font-size: 1.6rem; }

  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.6rem; }
  .cards-grid .card { width: 100%; min-height: 170px; }

  .page-auth { margin: 2rem auto; padding: 1.5rem; }

  .page-leaderboard { padding: 1rem; }
  .leaderboard-table th,
  .leaderboard-table td { padding: 0.6rem 0.3rem; font-size: 0.8rem; }
  .rank { font-size: 1rem; }

  .modal-content { width: 95%; padding: 20px; }
}

/* ═══════════════════════════════════════════════════
   PAGE STATS
   ═══════════════════════════════════════════════════ */

.page-stats {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}
.page-stats h1 { margin-bottom: 0.3rem; }
.stats-desc {
  color: var(--text-muted, #8888aa);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}
.stats-desc--subtle {
  font-size: 0.72rem;
  opacity: 0.5;
  margin-bottom: 1.8rem;
  text-align: center;
}

/* ── Sections ── */
.stats-section { margin-bottom: 2.2rem; }
.stats-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #8888aa);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stats-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border, #2e2e52);
}

/* ── Block (carte conteneur) ── */
.stats-block {
  background: var(--card-bg, #16162a);
  border: 1px solid var(--card-border, #2e2e52);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
}
.stats-block-legend {
  font-size: 0.75rem;
  color: var(--text-muted, #8888aa);
  margin-bottom: 0.75rem;
}

/* ── KPIs globaux ── */
.stats-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}
.stats-kpi {
  background: var(--card-bg, #16162a);
  border: 1px solid var(--card-border, #2e2e52);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stats-kpi-icon  { font-size: 1.2rem; }
.stats-kpi-value { font-size: 1.65rem; font-weight: 800; line-height: 1.1; }
.stats-kpi-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8888aa);
}
.stats-kpi-sub   { font-size: 0.67rem; color: var(--text-muted, #8888aa); line-height: 1.4; margin-top: 0.15rem; }
.stats-kpi-shiny    { color: #c0a0ff; }
.stats-kpi-legendary { color: #ff9d3a; }

/* ── Arènes ── */
.stats-gym-list { display: flex; flex-direction: column; gap: 0.4rem; }
.stats-gym-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg-deep, #1e1e36);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
}
.stats-gym-row--empty { opacity: 0.5; }
.stats-gym-badge-img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.stats-gym-info  { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.stats-gym-name  { font-size: 0.84rem; font-weight: 600; }
.stats-gym-type  { display: flex; align-items: center; }
.stats-gym-type-img { width: 100px; height: 18px; object-fit: contain; }
.stats-gym-holders   { text-align: right; }
.stats-gym-count       { display: block; font-size: 1.05rem; font-weight: 800; color: var(--accent, #7c6aff); }
.stats-gym-count-label { display: block; font-size: 0.62rem; color: var(--text-muted, #8888aa); }

/* ── Stats joueur ── */
.stats-field  { margin-bottom: 0.85rem; }
.stats-label  { display: block; font-size: 0.77rem; color: var(--text-muted, #8888aa); margin-bottom: 0.35rem; }
.stats-select {
  background: var(--bg-deep, #1e1e36);
  color: var(--text, #e8e8f0);
  border: 1px solid var(--card-border, #2e2e52);
  border-radius: 8px;
  padding: 0.48rem 0.75rem;
  font-size: 0.87rem;
  width: 100%;
  appearance: none;
  cursor: pointer;
}
.stats-select:focus { outline: 2px solid var(--accent, #7c6aff); }
.stats-empty { color: var(--text-muted, #8888aa); font-size: 0.85rem; }

.stats-pstats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.stats-pstats-spin-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.stats-pstat {
  background: var(--bg-deep, #1e1e36);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.stats-pstat-val   { font-size: 1.3rem; font-weight: 800; }
.stats-pstat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8888aa);
}

.stats-prog-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.stats-prog-row  { display: flex; align-items: center; gap: 0.65rem; }
.stats-prog-label { font-size: 0.76rem; width: 140px; flex-shrink: 0; }
.stats-prog-track {
  flex: 1;
  height: 8px;
  background: var(--bg-deep, #1e1e36);
  border-radius: 4px;
  overflow: hidden;
}
.stats-prog-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent, #7c6aff);
  transition: width 0.5s ease;
}
.stats-prog-fill--shiny {
  background: linear-gradient(90deg, #c0a0ff, #ff6a9b);
}
.stats-prog-pct { font-size: 0.76rem; color: var(--text-muted, #8888aa); width: 34px; text-align: right; }

/* ── Probabilités ── */
.stats-proba-tabs { display: flex; gap: 0.45rem; margin-bottom: 1rem; }
.stats-proba-tab {
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--card-border, #2e2e52);
  background: var(--bg-deep, #1e1e36);
  color: var(--text-muted, #8888aa);
  transition: background 0.15s, color 0.15s;
}
.stats-proba-tab--active {
  background: var(--accent, #7c6aff);
  color: #fff;
  border-color: var(--accent, #7c6aff);
}
.stats-proba-panel { display: none; }
.stats-proba-panel--active { display: block; }

.stats-wb-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.8rem 0; }
.stats-wb-row  { display: flex; align-items: center; gap: 0.65rem; }
.stats-wb-row--active .stats-wb-label { color: var(--text, #e8e8f0); font-weight: 700; }
.stats-wb-row--active .stats-wb-pct   { color: var(--text, #e8e8f0); font-weight: 700; }
.stats-wb-dot   { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.stats-wb-label { font-size: 0.8rem; width: 90px; }
.stats-wb-track {
  flex: 1;
  height: 7px;
  background: var(--bg-deep, #1e1e36);
  border-radius: 4px;
  overflow: hidden;
}
.stats-wb-fill  { height: 100%; border-radius: 4px; }
.stats-wb-pct   { font-size: 0.72rem; color: var(--text-muted, #8888aa); width: 48px; text-align: right; }

.stats-proba-result {
  background: var(--bg-deep, #1e1e36);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--accent, #7c6aff);
  margin-top: 0.8rem;
}
.stats-proba-result--hidden { display: none; }
.stats-proba-main   { font-size: 1.9rem; font-weight: 800; }
.stats-proba-detail {
  font-size: 0.77rem;
  color: var(--text-muted, #8888aa);
  margin-top: 0.3rem;
  line-height: 1.55;
}

/* ── Anecdotes ── */
.stats-anec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}
.stats-anec-card {
  background: var(--card-bg, #16162a);
  border: 1px solid var(--card-border, #2e2e52);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
}
.stats-anec-ico   { font-size: 1.6rem; margin-bottom: 0.3rem; }
.stats-anec-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #8888aa);
  margin-bottom: 0.3rem;
}
.stats-anec-val { font-size: 1.05rem; font-weight: 800; }
.stats-anec-sub { font-size: 0.75rem; color: var(--text-muted, #8888aa); margin-top: 0.2rem; line-height: 1.4; }

/* ── Responsive stats ── */
@media (max-width: 680px) {
  .stats-kpi-row      { grid-template-columns: repeat(2, 1fr); }
  .stats-pstats-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .stats-kpi-row { grid-template-columns: 1fr 1fr; }
  .stats-prog-label { width: 110px; font-size: 0.7rem; }
}

/* ═══════════════════════════════════════════════════
   ÉVÉNEMENT SPÉCIAL — carte, résultat, modale choix
   ═══════════════════════════════════════════════════ */

/* Carte événement dans la bande */
.card-event {
  background: #1a1a2e;
  border: 2px solid #333;
  position: relative;
  animation: event-shadow 2.5s ease-in-out infinite;
}
@keyframes event-shadow {
  0%   { box-shadow: 0 0 8px 2px #ffd700; }
  50%  { box-shadow: 0 0 8px 2px #c0a0ff; }
  100% { box-shadow: 0 0 8px 2px #ffd700; }
}
.card-event-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.card-event-icon       { width: 75px; height: 75px; object-fit: contain; }
.card-event-pokeball   { font-size: 3.5rem; }

/* Face révélée */
.card-event-reveal-icon   { font-size: 2.8rem; line-height: 1; }
.card-event-reveal-amount { font-size: 1.3rem; font-weight: 800; color: var(--gold, #ffd700); }
.card-event-reveal-arrows { font-size: 2rem; letter-spacing: 0.15em; }
.card-event-reveal-label  { font-size: 0.72rem; color: var(--text-muted, #8888aa); text-align: center; }

/* Résultat événement (coins / charme) */
.event-result {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.5rem; padding: 1.2rem; border-radius: 12px;
  background: var(--card-bg, #16162a); border: 1px solid var(--card-border, #2e2e52);
  margin-top: 0.8rem;
}
.event-result--coins { border-color: #ffd700; }
.event-result--charme { border-color: #c0a0ff; }
.event-result--pending { border-color: #6a6a8a; opacity: 0.85; }
.event-result-icon { font-size: 2.5rem; }
.event-result-text { font-size: 1.3rem; font-weight: 800; }
.event-result-sub  { font-size: 0.78rem; color: var(--text-muted, #8888aa); text-align: center; }

/* Charme actif sur la page home */
#charme-status { text-align: center; margin: 0.3rem 0; }
#charme-status.hidden { display: none; }
.charme-active {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(192,160,255,0.07);
  border: 1px solid rgba(192,160,255,0.25);
  border-radius: 20px; padding: 0.2rem 0.75rem 0.2rem 0.25rem;
}
.charme-icon-wrap {
  width: 50px; height: 50px; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.charme-icon-img   { width: 140px; height: 140px; object-fit: contain; }
.charme-active-text { font-size: 0.72rem; color: rgba(192,160,255,0.7); }

/* Modale choix de carte */
.card-choice-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.card-choice-modal {
  background: var(--card-bg, #16162a);
  border: 1px solid #c0a0ff;
  border-radius: 16px; padding: 1.5rem 1.8rem;
  max-width: 500px; width: 100%; text-align: center;
}
.card-choice-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.3rem; }
.card-choice-sub   { font-size: 0.8rem; color: var(--text-muted, #8888aa); margin-bottom: 1.2rem; }
.card-choice-grid  { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.card-choice-item  {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  cursor: pointer; border-radius: 10px; padding: 0.6rem;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}
.card-choice-item:hover { border-color: #c0a0ff; transform: translateY(-3px); }
.card-choice-name { font-size: 0.78rem; font-weight: 600; }

/* Inventaire dans la collection */
.inventory-panel {
  background: var(--card-bg, #16162a);
  border: 1px solid var(--card-border, #2e2e52);
  border-radius: 12px; padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}
.inventory-title {
  font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted, #8888aa); margin-bottom: 0.8rem;
}
.inventory-list { display: flex; flex-direction: column; gap: 0.6rem; }
.inv-item {
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--bg-deep, #1e1e36); border-radius: 8px;
  padding: 0.6rem 0.9rem;
}
.inv-item-icon  { font-size: 1.5rem; flex-shrink: 0; }
.inv-item-icon-wrap { width: 50px; height: 50px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.inv-item-img           { width: 140px; height: 140px; object-fit: contain; }
.inv-item-img--small    { width: 30px;  height: 30px;  object-fit: contain; }
.inv-item-info  { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.inv-item-name  { font-size: 0.88rem; font-weight: 700; }
.inv-item-desc  { font-size: 0.72rem; color: var(--text-muted, #8888aa); }
.inv-item-btn {
  background: #7c6aff; color: #fff; border: none;
  border-radius: 8px; padding: 0.38rem 0.85rem;
  font-size: 0.8rem; font-weight: 700; cursor: pointer;
  transition: opacity 0.12s;
}
.inv-item-btn:hover    { opacity: 0.85; }
.inv-item-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.inv-item-confirm { font-size: 0.75rem; color: #6ecb6e; margin-left: 0.5rem; }
.inv-item-error   { font-size: 0.75rem; color: #f44336; margin-left: 0.5rem; }

.inv-item-emoji { font-size: 1.8rem; display: flex; align-items: center; justify-content: center; }

/* Item actif dans la modale */
.inv-item--active { background: #1a2a1a; border: 1px solid #4CAF5066; border-radius: 8px; }
.inv-active-badge { font-size: 0.7rem; color: #6ecb6e; font-weight: 600; margin-left: 0.3rem; }
.inv-item-btn--deactivate { background: #2a1a1a; border-color: #f4433666; color: #f44336; }
.inv-item-btn--deactivate:hover { opacity: 0.85; }

/* Barre tickets actifs — page d'accueil */
.ticket-active-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.3rem 0;
}
.ticket-active-tag {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: #1a2e1a;
  border: 1px solid #4CAF5066;
  border-radius: 20px;
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
  color: #6ecb6e;
}
.ticket-deactivate-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 0.1rem;
  line-height: 1;
  transition: color 0.15s;
}
.ticket-deactivate-btn:hover { color: #f44336; }
.ticket-active-hint { font-size: 0.75rem; color: #666; }
/* Ticket actif à la place du sélecteur de biome */
.ticket-slot-active {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.8rem;
  background: #1a2a1a;
  border: 1px solid #4CAF5066;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #6ecb6e;
}
.ticket-slot-emoji { font-size: 1.1rem; }
.ticket-slot-type-icon { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.ticket-slot-label { flex: 1; }
.ticket-slot-deactivate {
  background: none;
  border: 1px solid #f4433655;
  color: #f44336;
  font-size: 0.78rem;
  border-radius: 12px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.ticket-slot-deactivate:hover { background: #f4433618; }

/* Roulette bloquée par combo impossible */
.roulette--blocked {
  position: relative;
  pointer-events: none;
  opacity: 0.45;
}
.roulette--blocked::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: not-allowed;
}
.roulette-combo-warning {
  pointer-events: all;
  opacity: 1;
  position: relative;
  z-index: 11;
  background: #2a1a1a;
  border: 1px solid #f4433666;
  border-radius: 8px;
  color: #f44336;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  text-align: center;
}
.ticket-type-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }

/* Bouton inventaire — page d'accueil */
.home-inventory-btn {
  background: transparent;
  border: 1px solid #bb86fc55;
  color: #bb86fc;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.home-inventory-btn:hover { background: #bb86fc18; border-color: #bb86fc; }

/* Barre inventaire + toggle filtres */
#inventory-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.inv-open-btn,
.filters-toggle-btn {
  background: transparent;
  border: 1px solid #bb86fc55;
  color: #bb86fc;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.inv-open-btn:hover,
.filters-toggle-btn:hover { background: #bb86fc18; border-color: #bb86fc; }

.sort-qty-btn {
  background: transparent;
  border: none;
  color: #e0e0e088;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.2s;
}
.sort-qty-btn:hover { color: #bb86fc; }
.sort-qty-btn.active { color: #bb86fc; font-weight: 600; }

/* Filtres repliés */
.filters--collapsed { display: none; }

/* Groupes biome/type dans la modale */
.inv-group {
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.inv-group-title {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #bb86fc;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inv-group-title::after { content: '▸'; font-size: 0.7rem; color: #666; margin-left: auto; transition: transform 0.2s; }
.inv-group[open] > .inv-group-title::after { transform: rotate(90deg); }
.inv-group-count { font-size: 0.75rem; color: #888; font-weight: normal; }
.inv-group-body { padding: 0.3rem 0; }

.inv-ticket-result {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #1a2a1a;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #6ecb6e;
  width: 100%;
  animation: fadeInUp 0.3s ease both;
}

.inv-ticket-card-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
}

/* ============================================================
   ROULETTE LÉGENDAIRE
   ============================================================ */

.slot-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.slot-title  { font-size: 2rem; font-weight: 700; color: #FFD700; text-align: center; margin-bottom: 0; }
.slot-user-info { justify-content: center; }
.slot-subtitle { color: #aaa; text-align: center; font-size: 0.95rem; }
.slot-show-more-btn {
  display: block;
  margin: 0.6rem auto 0;
  background: none;
  border: 1px solid #ffffff33;
  color: #aaa;
  border-radius: 20px;
  padding: .3rem 1rem;
  font-size: .85rem;
  cursor: pointer;
}
.slot-show-more-btn:hover { border-color: #ffffff66; color: #fff; }

/* ── Cadre de la machine ─────────────────────────────── */

.slot-machine-frame {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #12122a;
  border: 3px solid #bb86fc;
  border-radius: 20px;
  padding: 1.2rem 1rem;
  box-shadow: 0 0 30px #bb86fc33, inset 0 0 40px #00000066;
  position: relative;
}

/* Reflet lustré en haut */
.slot-machine-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 40%);
  pointer-events: none;
}

/* ── Indicateurs latéraux ────────────────────────────── */

.slot-side {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 240px;
  justify-content: space-around;
  align-items: center;
}

.side-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  color: #333;
  background: #1e1e40;
  border: 2px solid #333;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.side-num.active { color: #bb86fc; border-color: #bb86fc; background: #bb86fc22; }
.side-num.win    { color: #FFD700; border-color: #FFD700; background: #FFD70022; }

/* ── Rouleaux ────────────────────────────────────────── */

.slot-reels-wrap {
  position: relative;
  display: flex;
  gap: 8px;
}

.reel-viewport {
  width: 90px;
  height: 240px;      /* 3 cellules × 80 px */
  overflow: hidden;
  border-radius: 8px;
  background: #0a0a1a;
  border: 2px solid #2a2a4a;
  position: relative;
  /* Dégradé pour l'effet "profondeur" en haut/bas */
  box-shadow:
    inset 0  16px 20px #0a0a1a,
    inset 0 -16px 20px #0a0a1a;
}

.reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.reel-cell {
  width: 90px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  flex-shrink: 0;
  user-select: none;
}

.reel-cell.cell-win {
  animation: cellPop 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ── Carte légendaire dans la roulette ──────────────────── */

.reel-card-wrap {
  width: 52px;
  height: 70px;
  perspective: 600px;
}

.reel-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.reel-card-inner.reel-card-flipped {
  transform: rotateY(180deg);
}

.reel-card-back,
.reel-card-front {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  backface-visibility: hidden;
  overflow: hidden;
}

/* Dos : cadre légendaire face cachée */
.reel-card-back {
  background: radial-gradient(ellipse at 50% 30%, #2a1500, #0d0800);
  border: 2px solid #FFD700;
  box-shadow: 0 0 10px #FFD70055, inset 0 0 14px #FFD70018;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #FFD700;
  text-shadow: 0 0 8px #FFD700;
}

/* Face : image du Pokémon, pas de texte */
.reel-card-front {
  transform: rotateY(180deg);
  background: #000;
  border: 2px solid #FFD700;
  box-shadow: 0 0 10px #FFD70055;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Emoji biome dans une cellule rouleau */
.reel-biome-emoji {
  font-size: 2.4rem;
  display: block;
}

.reel-biome-reveal {
  animation: biomeReveal 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes biomeReveal {
  0%   { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  60%  { opacity: 1; transform: scale(1.2) rotate(4deg); }
  100% { opacity: 1; transform: scale(1)   rotate(0deg); }
}

/* Icône de type dans une cellule rouleau */
.reel-type-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Charme Chroma dans une cellule rouleau */
.reel-charme-img {
  max-width: 180%;
  max-height: 180%;
  object-fit: contain;
}


/* Transition de révélation au moment de la victoire */
.reel-type-img.reel-type-reveal {
  animation: typeReveal 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes typeReveal {
  0%   { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Glow turquoise pour le Charme Chroma — pop immédiat en turquoise puis état statique */
.cell-charme-glow {
  transform: scale(1.05);
  filter: brightness(1.1) drop-shadow(0 0 5px #00CED1);
  animation: charme-pop 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes charme-pop {
  0%   { transform: scale(1);    filter: brightness(1); }
  30%  { transform: scale(1.28); filter: brightness(1.3) drop-shadow(0 0 10px #00CED1); }
  60%  { transform: scale(0.95); filter: brightness(1.1) drop-shadow(0 0  6px #00CED1); }
  100% { transform: scale(1.05); filter: brightness(1.1) drop-shadow(0 0  5px #00CED1); }
}

/* Glow alternant pour plusieurs types sur la même cellule */
.cell-glow-multi {
  transform: scale(1.05);
  animation: glow-multi 1.4s ease infinite !important;
}

@keyframes glow-multi {
  0%,  29% { filter: brightness(1.2) drop-shadow(0 0 10px var(--glow1)); }
  33%, 62% { filter: brightness(1.2) drop-shadow(0 0 10px var(--glow2)); }
  66%, 95% { filter: brightness(1.2) drop-shadow(0 0 10px var(--glow3, var(--glow1))); }
  100%     { filter: brightness(1.2) drop-shadow(0 0 10px var(--glow1)); }
}

@keyframes cellPop {
  0%   { transform: scale(1);    filter: brightness(1); }
  30%  { transform: scale(1.28); filter: brightness(1.6) drop-shadow(0 0 10px currentColor); }
  60%  { transform: scale(0.95); filter: brightness(1.3) drop-shadow(0 0  6px currentColor); }
  100% { transform: scale(1.05); filter: brightness(1.2) drop-shadow(0 0  6px currentColor); }
}

/* ── Barres de lignes (overlay sur les rouleaux) ──── */

.lines-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.line-bar {
  flex: 1;
  border-top:    2px solid transparent;
  border-bottom: 2px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.line-bar.active { border-color: #bb86fc44; }
.line-bar.win    { border-color: #FFD700aa; background: #FFD70010; }

/* ── Diagonales SVG ─────────────────────────────────── */

.diag-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.diag-line {
  fill: none;
  stroke: #bb86fc;
  stroke-width: 2.5;
  stroke-dasharray: 10 5;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.25s, stroke 0.25s;
}

.diag-line.active { opacity: 0.35; }
.diag-line.win    { opacity: 1; stroke: #FFD700; stroke-dasharray: none; stroke-width: 3; }

/* ── Contrôles ───────────────────────────────────────── */

.slot-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
}

.slot-line-selector {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.line-btn {
  flex: 1;
  padding: 0.6rem 0.3rem;
  border: 2px solid #333;
  border-radius: 8px;
  background: #1a1a2e;
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.line-btn.active { border-color: #bb86fc; color: #bb86fc; background: #bb86fc18; }
.line-btn:hover:not(.active):not(:disabled) { border-color: #555; color: #ccc; }
.line-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.spin-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 20px #bb86fc55;
}

/* Modale inventaire */
.slot-inv-modal {
  max-width: 480px;
  width: 95%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.slot-inv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #2a2a4a;
}
.slot-inv-header h3 { margin: 0; font-size: 1.1rem; }

.slot-inv-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.2s;
}
.slot-inv-close:hover { color: #fff; }

.slot-inv-body {
  overflow-y: auto;
  padding: 1rem;
  flex: 1;
}

.spin-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px #bb86fc77;
}

.spin-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Résultats ─────────────────────────────────────── */

.slot-results { width: 100%; }

.slot-result-box {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeInUp 0.3s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slot-result-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.result-win  { background: #1a2e1a; color: #6ecb6e; }
.result-miss { background: #18181e; color: #555; }

.result-line-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: #bb86fc;
  min-width: 3.8rem;
}

.slot-result-cost {
  font-size: 0.8rem;
  color: #666;
  text-align: right;
  margin-top: 0.15rem;
}

.slot-result-error {
  background: #2a1a1a;
  color: #ef5350;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* ── Table des récompenses ───────────────────────── */

.slot-prize-table {
  width: 100%;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
}

.slot-prize-table summary {
  cursor: pointer;
  color: #bb86fc;
  font-weight: 600;
  padding: 0.2rem 0;
  user-select: none;
}

.slot-prize-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
}

.slot-prize-table th,
.slot-prize-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid #1e1e30;
}

.slot-prize-table th          { color: #bb86fc; font-size: 0.78rem; }
.slot-prize-table td:last-child { color: #777; text-align: right; }

.prize-card-icon {
  color: #FFD700;
  font-size: 1rem;
  text-shadow: 0 0 6px #FFD700;
  vertical-align: middle;
  position: relative;
  top: -3px;
}

.slot-prize-note {
  margin-top: 0.7rem;
  color: #555;
  font-size: 0.78rem;
  line-height: 1.55;
}

/* Icône de type dans la table des récompenses */
.prize-type-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

/* Charme Chroma dans la table des récompenses (image naturellement petite) */
.prize-charme-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  transform: scale(4.5);
  position: relative;
  top: -2px;
}

/* ─── Tournoi de Dresseurs ──────────────────────────────────────────────────── */

.tourn-page { max-width: 860px; margin: 0 auto; padding: 1rem 0 3rem; }
.tourn-page h1 { text-align: center; color: #bb86fc; margin-bottom: 1.5rem; }

/* Bannière statut */
.tourn-banner {
  background: #1a1a2e;
  border: 1px solid #bb86fc33;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.tourn-status {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.status--open      { background: #1b4d1b; color: #66bb6a; }
.status--closed    { background: #4a3900; color: #ffb300; }
.status--running   { background: #1a237e; color: #7986cb; }
.status--done      { background: #2d1b4e; color: #bb86fc; }
.status--cancelled { background: #3e1a1a; color: #ef5350; }
.tourn-date   { font-size: 1.25rem; margin: 0.3rem 0 0.5rem; }
.tourn-deadline { color: #888; font-size: 0.88rem; margin: 0.2rem 0; }
.tourn-pool   { color: #ccc; font-size: 0.95rem; margin-top: 0.4rem; }
.tourn-pool strong { color: #FFA726; }

/* Inscription */
.tourn-register-box {
  text-align: center;
  margin-bottom: 1.5rem;
}
.tourn-already-in { color: #66bb6a; font-weight: 600; font-size: 1rem; }
.tourn-register-btn {
  background: #bb86fc;
  color: #0d0d1a;
  border: none;
  border-radius: 24px;
  padding: 0.65rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.tourn-register-btn:hover   { background: #ce9fff; }
.tourn-register-btn:active  { transform: scale(0.97); }
.tourn-register-btn:disabled{ opacity: 0.5; cursor: not-allowed; }
.tourn-register-note { color: #666; font-size: 0.82rem; margin-top: 0.5rem; }
.tourn-error { color: #ef5350; font-size: 0.88rem; margin-top: 0.5rem; }

/* Sections */
.tourn-section { margin-bottom: 2rem; }
.tourn-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #bb86fc;
  border-bottom: 1px solid #bb86fc33;
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}
.tourn-empty { color: #555; text-align: center; padding: 1rem 0; }

/* Podium résultats */
.tourn-podium {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.tourn-podium-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: #1a1a2e;
  border: 1px solid #bb86fc22;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  min-width: 110px;
}
.tourn-medal { font-size: 1.6rem; }
.tourn-podium-name { font-weight: 600; font-size: 0.95rem; }
.tourn-podium-prize { color: #FFA726; font-weight: 700; font-size: 0.9rem; }

/* Avatars */
.tourn-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #bb86fc44;
}
.tourn-avatar--shiny { border-color: #00e5ff; }
.tourn-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a1a4a;
  color: #bb86fc;
  font-weight: 700;
  font-size: 1rem;
}

/* Participants */
.tourn-participants {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tourn-participant {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: #141420;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.tourn-participant-info { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.tourn-participant-name { font-weight: 600; font-size: 0.92rem; }
.tourn-team {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tourn-team-card {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  background: #0d0d1a;
}
.tourn-card--shiny { filter: drop-shadow(0 0 3px #00e5ff); }
.tourn-no-team { color: #444; font-size: 0.82rem; font-style: italic; }

/* Bracket */
.tourn-bracket {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.tourn-round-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #9575cd;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.tourn-round-matches {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.tourn-match {
  background: #1a1a2e;
  border: 1px solid #bb86fc22;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  flex: 1 1 200px;
  min-width: 0;
}
.tourn-match--bye {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #555;
  font-size: 0.85rem;
}
.tourn-match-bye { font-style: italic; }
.tourn-match-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88rem;
  text-align: center;
}
.tourn-match-row.tourn-match--winner {
  color: #66bb6a;
  font-weight: 700;
}
.tourn-match-row.tourn-match--loser { color: #555; }
.tourn-match-vs {
  text-align: center;
  font-size: 0.72rem;
  color: #444;
  padding: 1px 0;
}

/* ─── Admin tournoi ─────────────────────────────────────────────────────────── */
.admin-section {
  background: #111120;
  border: 1px solid #bb86fc22;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.admin-section h2 { color: #bb86fc; font-size: 1rem; margin: 0 0 .75rem; }
.admin-section h3 { font-size: .85rem; }
.adm-btn {
  background: #bb86fc; color: #0d0d1a; border: none; border-radius: 20px;
  padding: .35rem 1rem; font-size: .85rem; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.adm-btn:hover { background: #ce9fff; }
.adm-btn:disabled { opacity: .45; cursor: not-allowed; }
.adm-btn--secondary { background: #2a2a3e; color: #bb86fc; border: 1px solid #bb86fc44; }
.adm-btn--secondary:hover { background: #3a3a5e; }
.adm-btn--danger { background: #3e1a1a; color: #ef5350; border: 1px solid #ef535044; font-size:.78rem; padding:.2rem .6rem; }
.adm-btn--danger:hover { background: #5a2020; }
.adm-btn--add { background: #1b4d1b; color: #66bb6a; border: 1px solid #66bb6a44; font-size:.78rem; padding:.2rem .6rem; }
.adm-btn--add:hover { background: #2a6e2a; }
.adm-btn--run { background: #1a237e; color: #7986cb; border: 1px solid #7986cb44; }
.adm-btn--run:hover { background: #283593; }
.adm-info { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: .9rem; color: #aaa; }
.adm-info strong { color: #e0e0e0; }
.adm-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.adm-player {
  display: flex; justify-content: space-between; align-items: center;
  padding: .3rem .5rem; border-radius: 5px; font-size: .88rem;
  margin-bottom: .25rem; background: #0d0d1a;
}
.adm-match {
  display: flex; gap: .75rem; align-items: center;
  padding: .3rem .5rem; border-radius: 5px; margin-bottom: .2rem;
  font-size: .88rem; background: #0d0d1a;
}
.adm-winner { color: #66bb6a; font-weight: 700; }
.adm-loser  { color: #555; }
@media (max-width: 600px) { .adm-columns { grid-template-columns: 1fr; } }

/* ─── Analyse tournoi ───────────────────────────────────────────────────────── */
.tourn-analysis { border-color: #bb86fc44; }
.tourn-analysis-label {
  font-size: .78rem; font-weight: 700; color: #9575cd;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 0 0 .5rem;
}
.tourn-my-team { margin-bottom: 1rem; }
.tourn-my-team .tourn-team-card { width: 44px; height: 44px; }

.tourn-strengths-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-bottom: 1.25rem;
}
.tourn-strength-col { display: flex; flex-direction: column; gap: .35rem; }
.tourn-strength-row { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.tourn-strength-count { color: #888; font-size: .78rem; }

.tourn-type-badge {
  display: inline-block; padding: .1rem .45rem; border-radius: 10px;
  font-size: .75rem; font-weight: 700; border: 1px solid;
}

/* Matchups */
.tourn-matchups { display: flex; flex-direction: column; gap: .55rem; }
.tourn-matchup {
  display: grid;
  grid-template-columns: 130px 1fr 38px auto;
  align-items: center;
  gap: .6rem;
  background: #0d0d1a; border-radius: 7px; padding: .4rem .6rem;
}
.tourn-matchup-player { display: flex; align-items: center; gap: .4rem; overflow: hidden; }
.tourn-matchup-player .tourn-avatar { width: 28px; height: 28px; flex-shrink: 0; }
.tourn-matchup-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tourn-matchup-bar-wrap {
  background: #1a1a2e; border-radius: 4px; height: 8px; overflow: hidden;
  display: flex;
}
.tourn-matchup-bar { height: 100%; transition: width .4s ease; }
.tourn-matchup-bar--me  { border-radius: 4px 0 0 4px; }
.tourn-matchup-bar--opp { border-radius: 0 4px 4px 0; opacity: .35; }
.tourn-matchup-pct { font-size: .82rem; font-weight: 700; text-align: right; white-space: nowrap; }
.tourn-matchup-team { display: flex; gap: 2px; }
.tourn-matchup-team .tourn-team-card { width: 26px; height: 26px; }

/* Participant mis en avant */
.tourn-participant--me {
  background: #1e1230;
  border: 1px solid #bb86fc55;
}
.tourn-me-badge {
  display: inline-block; padding: .05rem .35rem; border-radius: 8px;
  background: #bb86fc22; color: #bb86fc; font-size: .72rem; font-weight: 700;
  vertical-align: middle; margin-left: .3rem;
}

@media (max-width: 600px) {
  .tourn-strengths-wrap { grid-template-columns: 1fr; }
  .tourn-matchup { grid-template-columns: 1fr 80px 32px; grid-template-rows: auto auto; }
  .tourn-matchup-team { grid-column: 1 / -1; }
}

/* ─── Cartes avec couleur de type ───────────────────────────────────────────── */
.tourn-card-wrap {
  display: inline-flex;
  border-radius: 5px;
  border-bottom: 2.5px solid var(--type-color, transparent);
  cursor: default;
}

/* ─── Pokémon forts/faibles ─────────────────────────────────────────────────── */
.tourn-poke-highlights {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: .6rem 0 1rem;
}
.tourn-poke-hl { display: flex; align-items: center; gap: .5rem; }
.tourn-poke-hl-label { font-size: .8rem; color: #999; white-space: nowrap; }
.tourn-poke-hl .tourn-team-card { width: 36px; height: 36px; }

/* ─── Grille de types compacte ──────────────────────────────────────────────── */
.tourn-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .2rem;
}

.tourn-teams-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .1rem .5rem;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: .4rem;
}
.tourn-teams-tag--live   { background: #3e1a1a; color: #ef5350; }
.tourn-teams-tag--locked { background: #1b2a1b; color: #66bb6a; }

/* ─── Podium ────────────────────────────────────────────────────────────────── */
.tourn-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 1rem;
}
.tourn-podium-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  min-width: 110px;
}

.tourn-podium-base {
  width: 100%;
  border-radius: 4px 4px 0 0;
  margin-top: .5rem;
}
.tourn-podium-base--1st { height: 70px; background: #FFD70033; border: 1px solid #FFD70066; }
.tourn-podium-base--2nd { height: 50px; background: #aaaaaa22; border: 1px solid #aaaaaa55; }
.tourn-podium-base--3rd { height: 35px; background: #cd7f3222; border: 1px solid #cd7f3255; }

.tourn-podium-entry--1st .tourn-medal { font-size: 2rem; }
.tourn-podium-entry--2nd .tourn-medal,
.tourn-podium-entry--3rd .tourn-medal { font-size: 1.5rem; }
.tourn-podium-entry--1st .tourn-avatar { width: 52px; height: 52px; }

/* ─── Log de combat ─────────────────────────────────────────────────────────── */
.tourn-match-log {
  margin-top: .4rem;
  border-top: 1px solid #bb86fc22;
  padding-top: .3rem;
}
.tourn-match-log summary {
  font-size: .75rem;
  color: #9575cd;
  cursor: pointer;
  list-style: none;
  padding: .15rem 0;
}
.tourn-match-log summary::-webkit-details-marker { display: none; }
.tourn-match-log summary::before { content: '▶ '; font-size: .65rem; }
details[open] .tourn-match-log summary::before,
.tourn-match-log[open] summary::before { content: '▼ '; }

.tourn-duel-log { display: flex; flex-direction: column; gap: .2rem; margin-top: .4rem; }
.tourn-duel {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  padding: .2rem .3rem;
  border-radius: 4px;
  background: #0d0d1a;
}
.duel-num   { color: #555; min-width: 1.2rem; text-align: right; font-size: .7rem; }
.duel-winner{ color: #66bb6a; font-weight: 600; }
.duel-loser { color: #555; }
.duel-arrow { color: #444; }
.duel-type  { font-size: .68rem; opacity: .75; }
.duel-prob  { margin-left: auto; color: #777; font-size: .72rem; white-space: nowrap; }

/* ─── Replay de combat (modal) ──────────────────────────────────────────────── */
.tourn-replay-btn {
  display: block;
  width: 100%;
  margin-top: .5rem;
  background: #1a1a2e;
  border: 1px solid #bb86fc44;
  color: #bb86fc;
  border-radius: 6px;
  padding: .35rem .6rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
}
.tourn-replay-btn:hover { background: #2a1a4a; }

.replay-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.replay-modal {
  background: #121220;
  border: 1px solid #bb86fc33;
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.replay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid #bb86fc22;
}
.replay-title { font-weight: 700; color: #bb86fc; }
.replay-close {
  background: none;
  border: 1px solid #555;
  color: #aaa;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
}
.replay-close:disabled { opacity: .3; cursor: not-allowed; }
.replay-close:not(:disabled):hover { border-color: #ef5350; color: #ef5350; }

.replay-result {
  text-align: center;
  padding: .75rem 1rem;
  background: #1a1a2e;
  border-top: 1px solid #bb86fc22;
  font-size: 1rem;
  color: #e0e0e0;
}

/* ─── Mon parcours ──────────────────────────────────────────────────────────── */
.journey-matches { display: flex; flex-direction: column; gap: .6rem; }

.journey-match {
  background: #0d0d1a;
  border: 1px solid #bb86fc22;
  border-radius: 8px;
  overflow: hidden;
}
.journey-match[open] { border-color: #bb86fc55; }

.journey-match-summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .85rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.journey-match-summary::-webkit-details-marker { display: none; }

.journey-round {
  font-size: .78rem;
  font-weight: 700;
  color: #9575cd;
  text-transform: uppercase;
  letter-spacing: .04em;
  min-width: 100px;
}
.journey-vs { flex: 1; color: #ccc; font-size: .9rem; }
.journey-reveal { font-size: .75rem; color: #555; margin-left: auto; }
.journey-match[open] .journey-reveal { display: none; }

.journey-match-body { padding: .6rem .85rem .85rem; border-top: 1px solid #bb86fc22; }

.journey-result {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .6rem;
}
.journey-result--win  { color: #66bb6a; }
.journey-result--loss { color: #ef5350; }

.journey-replay-btn { margin-top: .6rem; }

/* ─── Spoiler complet ───────────────────────────────────────────────────────── */
.tourn-spoiler { margin-top: 1rem; }
.tourn-spoiler-summary {
  display: block;
  width: 100%;
  cursor: pointer;
  list-style: none;
  background: #bb86fc;
  color: #0d0d1a;
  border: none;
  border-radius: 20px;
  padding: .45rem 1.2rem;
  font-size: .88rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: .75rem;
  user-select: none;
  transition: background .15s;
}
.tourn-spoiler-summary:hover { background: #ce9fff; }
.tourn-spoiler-summary::-webkit-details-marker { display: none; }

.journey-step-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.journey-progress {
  margin-left: auto;
  font-size: .75rem;
  color: #555;
}
.journey-reveal-btn {
  display: block;
  width: 100%;
  background: #1a1a2e;
  border: 1px dashed #bb86fc55;
  color: #bb86fc;
  border-radius: 8px;
  padding: .65rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-align: center;
}
.journey-reveal-btn:hover { background: #2a1a4a; border-color: #bb86fc; }

.journey-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.journey-next-btn {
  flex: 1;
  background: #bb86fc;
  color: #0d0d1a;
  border: none;
  border-radius: 20px;
  padding: .45rem 1.2rem;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.journey-next-btn:hover { background: #ce9fff; }

/* Tous les avatars de la page tournoi ont la bordure shiny */
.tourn-page .avatar-poke,
.replay-modal .avatar-poke {
  border-color: #9a6fcc;
  box-shadow: 0 0 6px rgba(192,160,255,0.4);
}

.replay-skip-btn {
  background: #2a2a3e;
  border: 1px solid #555;
  color: #aaa;
  border-radius: 12px;
  padding: .2rem .7rem;
  font-size: .8rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.replay-skip-btn:hover { border-color: #bb86fc; color: #bb86fc; }

/* ── Capture légendaire ───────────────────────────────────────────────────── */

.capture-modal { max-width: 420px; }

.capture-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: 1.8rem 1rem 1rem;
  min-height: 220px;
  position: relative;
}

.capture-pokemon-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
.capture-pokemon-img.hidden { display: none; }

.capture-pokemon-img--vanish {
  animation: capture-vanish .5s ease-in forwards;
}
@keyframes capture-vanish {
  0%   { transform: scale(1); opacity: 1; }
  60%  { transform: scale(1.1); opacity: .5; }
  100% { transform: scale(0); opacity: 0; }
}

.capture-pokemon-img--escape {
  animation: capture-escape .6s ease-out forwards;
}
@keyframes capture-escape {
  0%   { transform: scale(.05) translateY(0); opacity: 0; }
  40%  { transform: scale(1.15) translateY(-10px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.capture-pokeball-wrap { width: 72px; height: 72px; position: relative; }
.capture-pokeball-wrap.hidden { display: none; }
.capture-pokeball-wrap img { width: 100%; height: 100%; object-fit: contain; }

.capture-pokeball--throwing img {
  animation: capture-throw .9s cubic-bezier(.4, .1, .3, 1) forwards;
}
@keyframes capture-throw {
  0%   { transform: translate(130px, 90px) scale(.45) rotate(0deg); opacity: 0; }
  15%  { opacity: 1; }
  55%  { transform: translate(-8px, -70px) scale(.95) rotate(380deg); }
  80%  { transform: translate(0, 8px) scale(1.08) rotate(470deg); }
  100% { transform: translate(0, 0) scale(1) rotate(470deg); }
}

.capture-pokeball--shake-once img {
  animation: capture-shake .5s ease-in-out 1;
}
@keyframes capture-shake {
  0%, 100% { transform: rotate(0deg); }
  20%      { transform: rotate(-18deg); }
  40%      { transform: rotate(14deg); }
  60%      { transform: rotate(-10deg); }
  80%      { transform: rotate(6deg); }
}

.capture-pokeball--opening img {
  animation: capture-ball-open .6s ease-in-out;
}
@keyframes capture-ball-open {
  0%   { filter: drop-shadow(0 0 0px #fff); transform: scale(1); }
  40%  { filter: drop-shadow(0 0 18px #fff) brightness(1.8); transform: scale(1.15); }
  100% { filter: drop-shadow(0 0 0px #fff); transform: scale(1); }
}

.capture-pokeball--success img {
  animation: capture-sparkle .8s ease-out;
}
@keyframes capture-sparkle {
  0%   { filter: drop-shadow(0 0 0px #ffd54f); }
  50%  { filter: drop-shadow(0 0 14px #ffd54f); }
  100% { filter: drop-shadow(0 0 4px #ffd54f); }
}

/* Même traitement visuel qu'un pokémon KO en combat : légère rotation + grisé. */
.capture-pokeball--failed img {
  animation: capture-ball-fail .6s ease-out forwards;
}
@keyframes capture-ball-fail {
  0%   { opacity: 1;   transform: rotate(0deg);   filter: grayscale(0)   drop-shadow(0 0 4px rgba(255,255,255,.15)); }
  30%  { opacity: .85; transform: rotate(-10deg); filter: grayscale(.4)  drop-shadow(0 0 6px rgba(244,67,54,.5)); }
  60%  { opacity: .7;  transform: rotate(8deg);   filter: grayscale(.7)  drop-shadow(0 0 4px rgba(244,67,54,.3)); }
  100% { opacity: .55; transform: rotate(10deg);  filter: grayscale(1)   drop-shadow(0 0 2px rgba(0,0,0,.3)); }
}

.capture-stars {
  position: absolute;
  inset: -45px;
  pointer-events: none;
}
.capture-stars.hidden { display: none; }

.capture-star {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 1.3rem;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

.capture-stars--burst .capture-star {
  animation: capture-star-burst .9s ease-out forwards;
}
@keyframes capture-star-burst {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  30%  { opacity: 1; transform: translate(calc(-50% + var(--dx) * .4), calc(-50% + var(--dy) * .4)) scale(1.2); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.6); }
}

.capture-star--1 { --dx: 0px;   --dy: -55px; animation-delay: 0s; }
.capture-star--2 { --dx: 45px;  --dy: -30px; animation-delay: .05s; }
.capture-star--3 { --dx: 48px;  --dy: 28px;  animation-delay: .1s; }
.capture-star--4 { --dx: 0px;   --dy: 55px;  animation-delay: .15s; }
.capture-star--5 { --dx: -48px; --dy: 28px;  animation-delay: .08s; }
.capture-star--6 { --dx: -45px; --dy: -30px; animation-delay: .03s; }

.capture-message {
  text-align: center;
  padding: 0 1.3rem 1rem;
  color: #ddd;
  font-size: .92rem;
  line-height: 1.5;
  min-height: 1.5em;
}
.capture-result { font-size: 1.1rem; font-weight: 700; margin: 0; }
.capture-result--win  { color: #ffd54f; }
.capture-result--lose { color: #ff8a80; }

.capture-actions {
  display: flex;
  justify-content: center;
  padding-bottom: 1.3rem;
  min-height: 2.6rem;
}

.replay-speed-control {
  display: flex;
  gap: .25rem;
  background: #1a1a26;
  border-radius: 10px;
  padding: .15rem;
}
.replay-speed-btn {
  background: transparent;
  border: none;
  color: #888;
  border-radius: 8px;
  padding: .2rem .5rem;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.replay-speed-btn:hover { color: #ddd; }
.replay-speed-btn.active { background: #bb86fc; color: #0f0f1a; }

.tourn-match-actions {
  display: flex;
  gap: .4rem;
  margin-top: .5rem;
}
.tourn-summary-btn {
  flex: 1;
  background: #1a1a2e;
  border: 1px solid #bb86fc33;
  color: #9575cd;
  border-radius: 6px;
  padding: .3rem .5rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
}
.tourn-summary-btn:hover { background: #2a1a4a; }
.tourn-match-actions .tourn-replay-btn { flex: 1; margin-top: 0; }

@media (max-width: 600px) {
  .tourn-match { flex-basis: calc(50% - 0.8rem); } /* 2 par ligne sur petit écran */
}

/* ─── Historique des tournois ───────────────────────────────────────────────── */
.tourn-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.tourn-page-header h1 { margin: 0; flex: 1; text-align: center; }
.tourn-history-btn {
  background: transparent;
  border: 1px solid #bb86fc44;
  color: #bb86fc;
  padding: .35rem 1rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.tourn-history-btn:hover { background: #bb86fc18; }

.tourn-history-body { padding: .75rem 1rem; max-height: 70vh; overflow-y: auto; }

.hist-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .5rem;
  border-bottom: 1px solid #1e1e2e;
  gap: .5rem;
}
.hist-entry--done .hist-date { color: #e0e0e0; }
.hist-info { display: flex; flex-direction: column; gap: .15rem; }
.hist-date  { font-weight: 600; font-size: .9rem; color: #888; }
.hist-status { font-size: .75rem; color: #666; }
.hist-pool  { font-size: .78rem; color: #FFA726; }
.hist-view-btn {
  background: #bb86fc22;
  border: 1px solid #bb86fc44;
  color: #bb86fc;
  border-radius: 14px;
  padding: .25rem .75rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.hist-view-btn:hover { background: #bb86fc44; }

.nav-badge {
  display: inline-block;
  width: 7px; height: 7px;
  background: #ef5350;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.nav-badge.hidden { display: none; }

.nav-dropdown-btn .nav-badge { top: 1px; }

@media (max-width: 768px) {
  #nav-social-badge { display: none; }
}

/* ─── Modal intro tournoi ───────────────────────────────────────────────────── */
.tourn-intro-modal { max-width: 520px; }
.tourn-intro-body  { padding: 1.25rem 1.25rem 1rem; }
.tourn-intro-lead  {
  color: #ccc;
  font-size: .95rem;
  margin: 0 0 1.1rem;
  line-height: 1.55;
}
.tourn-intro-block {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  margin-bottom: .9rem;
}
.tourn-intro-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: .1rem; }
.tourn-intro-block strong { color: #e0e0e0; }
.tourn-intro-block p { margin: 0; font-size: .88rem; color: #aaa; line-height: 1.5; }

.pn-version-tag--major {
  background: #FFD70022;
  border-color: #FFD70088;
  color: #FFD700;
  text-shadow: 0 0 6px #FFD70066;
}

.home-top-btns {
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.home-patchnote-btn {
  background: transparent;
  border: 1px solid #bb86fc55;
  color: #bb86fc;
  padding: .4rem 1.2rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  position: relative;
}
.home-patchnote-btn:hover { background: #bb86fc18; border-color: #bb86fc; }
.home-patchnote-btn .nav-badge { position: relative; top: -2px; }

/* Entrées de l'historique patchnotes */
.pn-history-entry {
  background: #111120;
  border: 1px solid #bb86fc22;
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.pn-history-summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.pn-history-summary::-webkit-details-marker { display: none; }
.pn-history-date { color: #666; font-size: .82rem; }
.pn-history-body { padding: .25rem 1rem 1rem; border-top: 1px solid #bb86fc22; }

.nav-version {
  font-size: .72rem;
  font-weight: 700;
  color: #bb86fc88;
  text-decoration: none;
  margin-left: .35rem;
  position: relative;
  top: -1px;
  transition: color .2s;
  white-space: nowrap;
}
.nav-version:hover { color: #bb86fc; }
.nav-version .nav-badge { top: -2px; }

.nav-brand-wrap { display: flex; align-items: baseline; gap: .3rem; }

.inv-biome-notice {
  font-size: .82rem;
  color: #888;
  background: #1a1a2e;
  border-left: 3px solid #bb86fc44;
  padding: .4rem .7rem;
  border-radius: 4px;
  margin-bottom: .5rem;
}

/* Espace entre le bouton inventaire et les badges d'arène */
.team-right-col .inv-open-btn { margin-bottom: 3rem; }

.team-roulette-section .ticket-slot-active { margin-bottom: .5rem; }

/* ══════════════════════════════════════════════════════════════
   PAGE SPIN
   ══════════════════════════════════════════════════════════════ */

.spin-page {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.spin-header { text-align: center; }

.spin-title {
  font-size: 2rem;
  margin: 0 0 0.3rem;
  color: #e0e0e0;
}

.spin-subtitle {
  color: #888;
  font-size: 0.95rem;
  margin: 0;
}

.spin-card {
  background: #12121e;
  border: 1px solid #2a2a4a;
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.spin-loading { color: #666; text-align: center; }

.spin-description p { color: #aaa; margin: 0 0 0.8rem; line-height: 1.6; }

.spin-rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.spin-rules-list li {
  font-size: 0.88rem;
  color: #999;
  line-height: 1.5;
}

.spin-status {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #3a3a5a;
  background: #1a1a2e;
}

.spin-status--locked {
  border-color: #f4433644;
  background: #1a0e0e;
  color: #f47;
}

.spin-status--locked p { color: #f47; font-size: 0.85rem; margin: 0.3rem 0 0; }
.spin-status--locked strong { color: #ff6677; }

.spin-status-icon { font-size: 1.5rem; flex-shrink: 0; }

.spin-week-note {
  font-size: 0.85rem;
  color: #777;
  margin: 0;
  padding: 0.5rem 0.8rem;
  border-left: 3px solid #3a3a5a;
  border-radius: 0 6px 6px 0;
}

.spin-week-note--available {
  border-left-color: #4caf50;
  color: #6ecb6e;
}

.spin-pity-boost {
  color: #ffd24d;
  font-weight: bold;
}

.spin-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.spin-launch-btn {
  background: linear-gradient(135deg, #7c4dff, #bb86fc);
  color: #0f0f1a;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 2rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.spin-launch-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.spin-launch-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.spin-launch-hint { font-size: 0.78rem; color: #555; margin: 0; }

.spin-error {
  font-size: 0.82rem;
  color: #f44336;
  margin: 0;
  min-height: 1em;
}


/* Spin overlay (full-screen iframe) */
.spin-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: #0f0f1a;
}

.spin-overlay-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  height: 44px;
  flex-shrink: 0;
  background: #1a1a2e;
  border-bottom: 2px solid #bb86fc;
}

.spin-overlay-close {
  background: none;
  border: 1px solid #bb86fc;
  color: #bb86fc;
  padding: 0.2rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background 0.15s;
}

.spin-overlay-close:hover { background: rgba(187, 134, 252, 0.15); }

.spin-overlay-title {
  font-size: 0.95rem;
  color: #e0e0e0;
  font-weight: 600;
}

.spin-overlay-iframe {
  flex: 1;
  border: none;
  width: 100%;
  min-height: 0;
}

/* ============================================================
   ÉCHANGES
   ============================================================ */

.btn-secondary {
  padding: 0.85rem;
  background: transparent;
  color: #bb86fc;
  border: 2px solid #bb86fc;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover:not(:disabled) { background: rgba(187, 134, 252, 0.12); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.trades-intro { opacity: .75; font-size: .9rem; line-height: 1.5; margin-bottom: 1.5rem; }

.trades-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }

.trade-card {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 1rem;
}
.trade-card--action { border-color: #bb86fc; }
.trade-card--history {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  padding: .6rem 1rem;
  font-size: .9rem;
  opacity: .85;
}

.trade-card-actions { display: flex; gap: .75rem; margin-top: .75rem; }
.trade-card-actions .btn { width: auto; flex: 1; }

.trade-status { font-weight: 700; }
.trade-date { margin-left: auto; opacity: .6; font-size: .8rem; }

.trades-history summary { cursor: pointer; color: #bb86fc; margin-bottom: .75rem; }

.trades-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 1rem;
}

.trades-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .75rem .5rem;
  border-radius: 10px;
  background: #1e1e1e;
  border: 1px solid #333;
  cursor: pointer;
  transition: border-color .2s, transform .1s;
  text-align: center;
}
.trades-player:hover { border-color: #bb86fc; transform: translateY(-2px); }
.trades-player--disabled { opacity: .45; cursor: not-allowed; }
.trades-player--disabled:hover { border-color: #333; transform: none; }

.trades-player-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.trades-player-avatar--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: #333; color: #bb86fc; font-weight: 700;
}
.trades-player-name { font-size: .85rem; font-weight: 600; }
.trades-player-hint { font-size: .7rem; opacity: .6; }

.trade-picker { max-width: 700px; max-height: 85vh; overflow-y: auto; }

.trade-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}

.trade-picker-card {
  position: relative;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: .5rem;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  text-align: center;
}
.trade-picker-card:hover { border-color: #bb86fc; }
.trade-picker-card--disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.trade-picker-card--missing {
  border: 2px solid #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}
.trade-picker-card-new {
  position: absolute;
  top: -8px; right: -6px;
  background: #ffd700;
  color: #1e1e1e;
  font-size: .62rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 10px;
  white-space: nowrap;
}
.trade-picker-card img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.trade-picker-card p { margin: .35rem 0 .15rem; font-size: .8rem; font-weight: 600; }
.trade-picker-card-rarity { display: block; font-size: .7rem; opacity: .7; }
.trade-picker-card-qty { display: block; font-size: .7rem; color: #bb86fc; }

.trades-ineligible {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 8px;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
}
