* { box-sizing: border-box; }

:root {
  --sidebar-w: 332px;
  --topbar-h: 52px;
  --opponent-h: 92px;
  --player-h: 250px;
  --bg-0: #0f0c09;
  --bg-1: #12151a;
  --bg-2: #0f1318;
  --line: #2d3440;
  --gold: #d4a956;
  --gold-soft: rgba(212,169,86,0.35);
  --text: #f2e7c7;
  --muted: #c7cfdb;
  --wow-gold: #d7b25a;
  --wow-gold-2: #f0d18a;
  --wow-gold-dark: #7a5a22;

  --wow-brown-1: #2b1d12;
  --wow-brown-2: #17110d;
  --wow-panel-top: rgba(45, 28, 12, 0.96);
  --wow-panel-bottom: rgba(12, 9, 8, 0.98);

  --wow-red-1: #8f1a16;
  --wow-red-2: #5b0f0d;
  --wow-red-border: #ae6f3d;

  --wow-blue-1: #43526b;
  --wow-blue-2: #273246;
  --wow-blue-border: #8b7347;

  --wow-gold-btn-1: #8f6a24;
  --wow-gold-btn-2: #5f4213;
  --wow-gold-btn-border: #d2ac5c;

  --wow-danger-1: #7f231e;
  --wow-danger-2: #4a120f;
  --wow-danger-border: #b67357;

  --wow-text: #f1e3bf;
  --wow-text-gold: #e1be67;
  --wow-shadow: 0 1px 0 rgba(0,0,0,0.95);
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  overflow: hidden;
  background:
    radial-gradient(circle at top center, rgba(112,78,28,0.18), transparent 30%),
    linear-gradient(180deg,#100d0a 0%,#17120d 40%,#0f0c09 100%);
}

button {
  background: #2f6fed;
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  min-height: 28px;
  cursor: none !important;
  font-weight: bold;
  font-size: 12px;
}

button.small {
  padding: 5px 9px;
  min-width: 34px;
}

button.alt {
  background: #4a5463;
}

input, select {
  background: #1b212b;
  color: white;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px;
}

.hidden { display: none !important; }

.auth-panel {
  position: fixed;
  inset: 0;
  z-index: 300000;
  display: block;
  pointer-events: none;
}

.auth-guest {
  pointer-events: auto;
}

.auth-columns {
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 360px));
  gap: 16px;
  justify-content: center;
  align-content: center;
  padding: 20px;
}

.auth-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(12, 16, 22, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}

.auth-box h2 { margin: 0 0 8px 0; }
.auth-box input { height: 34px; }

#game-shell {
  height: 100vh;
}

#layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  height: 100vh;
}

body.sidebar-collapsed #layout {
  grid-template-columns: minmax(0, 1fr) 0;
}

#main-area {
  display: grid;
  grid-template-rows: var(--topbar-h) var(--opponent-h) minmax(0, 1fr) var(--player-h);
  min-width: 0;
  min-height: 0;
  height: 100vh;
}

.topbar.topbar-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
  min-height: var(--topbar-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}

.topbar-main-row,
.topbar-left,
.topbar-right,
.topbar-quick-actions,
.turn-box,
.life-box,
.player-actions,
.meta-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-main-row {
  justify-content: space-between;
  width: 100%;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.player-strip {
  background: #0f1318;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.opponent-strip {
  overflow: hidden;
}

.player-strip.bottom {
  border-top: 1px solid var(--line);
  border-bottom: none;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: start;
  overflow: hidden;
}

.strip-header,
.resource-row,
.hand-strip-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hand-strip-label {
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}

#opponent-hand,
.opponent-hand {
  height: 48px;
  min-height: 48px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.opponent-card-back {
  width: 32px;
  height: 46px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  background-image: url("cards/Back.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex: 0 0 auto;
  position: relative;
}

.opponent-card-back::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
}


#table-area {
  min-height: 0;
  background: #182219;
  padding: 8px 10px;
  overflow: hidden;
}

#board-surface {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(212,169,86,0.28);
  background:
    radial-gradient(circle at 20% 18%, rgba(255,210,120,0.05), transparent 18%),
    radial-gradient(circle at 80% 82%, rgba(255,210,120,0.04), transparent 20%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.12)),
    linear-gradient(135deg, #3a2718 0%, #2a1d13 20%, #1b1510 50%, #251a12 80%, #3b2819 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    inset 0 10px 30px rgba(255,220,160,0.035),
    inset 0 -30px 60px rgba(0,0,0,0.28),
    0 12px 40px rgba(0,0,0,0.35);
  /*isolation: isolate;*/
}

#board-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 6px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.03) 0px, rgba(0,0,0,0.03) 1px, transparent 1px, transparent 8px);
  opacity: .28;
}

#board-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 140px rgba(0,0,0,0.42);
}

.zone-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.22);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.zone-label.top { top: 24px; }
.zone-label.bottom { bottom: 24px; }

.hand {
  height: 160px;
  min-height: 160px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 0 8px;
  scrollbar-width: thin;
}

.hand-card {
  width: 82px;
  height: 114px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.12);
  cursor: none !important;
  user-select: none;
  flex: 0 0 auto;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  background: #111;
  object-fit: cover;
}

.hand-card:hover {
  transform: translateY(-10px) scale(1.08);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  z-index: 20;
}

.table-card,
.token {
  position: absolute;
  user-select: none;
  cursor: none !important;
}

.table-card {
  width: 100px;
  height: 140px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.14);
  object-fit: cover;
  transform-origin: center center;
  transition: left 0.06s linear, top 0.06s linear, transform 0.12s ease, box-shadow 0.12s ease, opacity 0.18s ease;
  z-index: 10;
}
.table-card:hover { box-shadow: 0 12px 24px rgba(0,0,0,0.42); }
.table-card.selected { outline: 3px solid #f7d04a; outline-offset: 2px; }

.card-enter { animation: cardEnter .18s ease; }
@keyframes cardEnter { from { opacity:0; transform:scale(.92); } to { opacity:1; } }

.token {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  border: 2px solid rgba(255,255,255,0.22);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  z-index: 12;
}
.token.damage { background: #b73a3a; }
.token.heal { background: #2f9a57; }

#sidebar {
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  min-height: 0;
  overflow: hidden;
}

body.sidebar-collapsed #sidebar {
  padding: 0;
  border-left: 0;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.sidebar-auth-name {
  font-size: 13px;
  color: #dfe6f1;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
}
.panel > summary { list-style: none; }
.panel > summary::-webkit-details-marker { display: none; }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: none !important;
  user-select: none;
  margin: 0;
}
.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
}
.sidebar-action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-action-title {
  font-size: 12px;
  font-weight: 800;
  color: #f0d38a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sidebar-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sidebar-action-buttons .starting-player-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.stack-panel {
  min-height: 130px;
}
.stack-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-content: flex-start;
  min-height: 90px;
  max-height: 140px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
}
.stack-list img {
  width: 70px;
  height: 100px;
  border-radius: 8px;
}

.history-panel {
  min-height: 0;
}
.history-log {
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 13px;
  color: #d5dce8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  height: 100%;
  padding: 10px 12px;
  scrollbar-width: thin;
}
.history-entry {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-entry.alert {
  background: rgba(180, 40, 40, 0.18);
  border: 1px solid rgba(255, 90, 90, 0.35);
}
.history-time {
  font-size: 11px;
  color: #9fb0c7;
  opacity: 0.9;
}
.history-entry.alert .history-time { color: #ffd0d0; }
.history-text { font-size: 13px; color: #e8edf5; }
.history-entry.alert .history-text { color: #ffb3b3; font-weight: 700; }

.sidebar-reopen-btn {
  p/*osition: fixed;*/
  right: 12px;
  top: 82px;
  z-index: 300050;
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(20,26,34,0.96);
  color: #fff;
  font-weight: 700;
  cursor: none !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

body.sidebar-collapsed .sidebar-reopen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#zoom {
  position: fixed;
  right: calc(var(--sidebar-w) + 12px);
  top: 70px;
  width: 320px;
  min-height: 350px;
  background: rgba(9,12,16,0.94);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 10px;
  display: none;
  z-index: 200000;
  backdrop-filter: blur(6px);
}
#zoom img { width: 100%; border-radius: 12px; display: block; }
#zoom .caption { margin-top: 8px; font-size: 13px; color: #cfd7e3; }

#library-panel,
#deckbuilder-panel,
#discard-panel,
#deck-panel {
  position: fixed;
  z-index: 210000;
  background: rgba(9,12,16,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
#library-panel,
#deckbuilder-panel {
  left: 16px;
  top: 80px;
  bottom: 16px;
  width: 420px;
}
#deckbuilder-panel { width: min(1100px, calc(100vw - 32px)); }
#discard-panel,
#deck-panel {
  right: calc(var(--sidebar-w) + 8px);
  top: 100px;
  bottom: 20px;
  width: 380px;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.library-filters {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.library-filters select { flex: 1; }
#library-list,
#discard-panel-list,
#deck-panel-list {
  overflow-y: auto;
  padding: 12px;
  display: grid;
  gap: 12px;
}
.library-card,
.discard-card-row,
.deck-card-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px;
}
.library-card img,
.discard-card-row img,
.deck-card-row img {
  width: 72px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
}
.library-card-info { display: flex; flex-direction: column; gap: 6px; }
.library-card-title { font-weight: 700; }
.library-meta { font-size: 12px; color: var(--muted); }
.library-actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.deckbuilder-body { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; height: 100%; }
.deckbuilder-left,
.deckbuilder-right { padding: 12px; overflow: auto; }
.deckbuilder-left { border-right: 1px solid rgba(255,255,255,0.08); }
.deckbuilder-title { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 12px; font-weight: bold; }
cursor: none !important;
.deckbuilder-card-row:hover { background: rgba(255,255,255,0.08); }
#deckbuilder-library,
#deckbuilder-current { display: flex; flex-direction: column; gap: 8px; }
.deckbuilder-section { margin-bottom: 14px; }
.deckbuilder-section-title {
  font-weight: 700;
  font-size: 13px;
  color: #ffd36b;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.fixed-zone {
  position: absolute;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 15;
}
.fixed-zone.top-left { top: 18px; left: 18px; }
.fixed-zone.top-right { top: 18px; right: 18px; }
.fixed-zone.bottom-left { bottom: 18px; left: 18px; }
.fixed-zone.bottom-right { bottom: 18px; right: 18px; }
.fixed-zone-title,
.fixed-zone-count {
  font-size: 12px;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.pile-card {
  width: 76px;
  height: 106px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  background-size: cover;
  background-position: center;
}
.pile-card.back {
  background-image: url("cards/Back.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.pile-card.back::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
}

#end-turn-button { font-weight: 800; position: relative; }
#end-turn-button.active-turn {
  background: linear-gradient(180deg, #ffd34d 0%, #ff9f1a 100%);
  color: #1b1200;
  box-shadow: 0 0 0 2px rgba(255, 211, 77, 0.25), 0 0 18px rgba(255, 190, 40, 0.6), 0 0 32px rgba(255, 150, 20, 0.35);
  animation: pulseTurn 1.1s infinite alternate;
}
@keyframes pulseTurn {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.04); filter: brightness(1.08); }
}

.remote-pointer,
#remote-pointer,
#remote-pointer-p1,
#remote-pointer-p2 {
  position: absolute;
  z-index: 300000 !important;
  pointer-events: none;
}
.remote-pointer.hidden { display:none; }
.remote-pointer-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
.remote-pointer-icon.p1 { background: #4aa3ff; box-shadow: 0 0 8px rgba(74,163,255,0.8); }
.remote-pointer-icon.p2 { background: #ff5a5a; box-shadow: 0 0 8px rgba(255,90,90,0.8); }
.remote-pointer-label {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
}

.resource-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  min-height: 44px;
}
.resource-box { display: flex; align-items: center; gap: 8px; }
.bottom-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 34px;
}
.player-actions button { white-space: nowrap; }
#player-zone { overflow: hidden; }

.resource-zone {
  position: absolute;
  left: 110px;
  right: 110px;
  height: 77px;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(0,0,0,0.08);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}
.resource-zone.top { top: 2px; }
.resource-zone.bottom { bottom: 5px; }
.resource-zone-title { font-size: 12px; color: rgba(255,255,255,0.8); }
.resource-zone-cards {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 42px;
}
.resource-card {
  width: 42px;
  height: 58px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, #4b2a71 0%, #1f173a 100%) !important;
  position: relative;
  flex: 0 0 auto;
  box-shadow: 0 6px 12px rgba(0,0,0,0.24);
  overflow: hidden;
  transition: transform 0.12s ease;
}
.resource-card::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  pointer-events: none;
}
.resource-card.face-up { background: #111 !important; }
.resource-card.face-up::after { display:none; }
.resource-card img { width:100%; height:100%; object-fit:cover; display:block !important; }
.resource-card.tapped {
  transform: rotate(90deg);
  transform-origin: center center;
  margin-left: 12px;
  margin-right: 12px;
}

.table-card.owner-p1 {
  border-color: rgba(80, 170, 255, 0.95);
  box-shadow: 0 8px 18px rgba(0,0,0,0.35), 0 0 0 2px rgba(80, 170, 255, 0.22);
}
.table-card.owner-p2 {
  border-color: rgba(255, 120, 120, 0.95);
  box-shadow: 0 8px 18px rgba(0,0,0,0.35), 0 0 0 2px rgba(255, 120, 120, 0.22);
}
.player-color-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.player-color-badge.p1 { background: rgba(80, 170, 255, 0.22); border: 1px solid rgba(80, 170, 255, 0.65); }
.player-color-badge.p2 { background: rgba(255, 120, 120, 0.22); border: 1px solid rgba(255, 120, 120, 0.65); }
.table-card.no-transition,
.token.no-transition { transition:none !important; }

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 220000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
}
.help-modal-content {
  position: relative;
  width: min(1100px, calc(100vw - 40px));
  max-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, rgba(255,230,170,0.05), transparent 60%), linear-gradient(#1e1a14, #14110d);
  border: 2px solid #c9a65c;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), inset 0 0 20px rgba(0,0,0,0.7);
  color: #f2e7c7;
  overflow: hidden;
}
.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(#2d261b, #1b1610);
  border-bottom: 1px solid rgba(255,215,140,0.25);
}
.help-modal-header h2 { margin:0; font-size:22px; letter-spacing:.4px; }
.help-subtitle { font-size:13px; opacity:.7; margin-top:4px; }
.help-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}
.help-section {
  background: rgba(255,240,200,0.03);
  border: 1px solid rgba(255,215,140,0.15);
  border-radius: 10px;
  padding: 14px 16px;
}
.help-section h3 { margin-top:0; margin-bottom:10px; font-size:16px; color:#f6d78a; }
.help-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}
.help-row:first-of-type { border-top:none; padding-top:0; }
kbd {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 2px 2px 0;
  border-radius: 5px;
  border: 1px solid #caa85a;
  border-bottom: 2px solid #9e7f3d;
  background: linear-gradient(#3a3328, #1c1812);
  color: #f5e2b2;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}
.help-modal-body::-webkit-scrollbar,
.history-log::-webkit-scrollbar,
.stack-list::-webkit-scrollbar,
.hand::-webkit-scrollbar,
#opponent-hand::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.help-modal-body::-webkit-scrollbar-track,
.history-log::-webkit-scrollbar-track,
.stack-list::-webkit-scrollbar-track,
.hand::-webkit-scrollbar-track,
#opponent-hand::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.35);
}
.help-modal-body::-webkit-scrollbar-thumb,
.history-log::-webkit-scrollbar-thumb,
.stack-list::-webkit-scrollbar-thumb,
.hand::-webkit-scrollbar-thumb,
#opponent-hand::-webkit-scrollbar-thumb {
  background: linear-gradient(#caa85a, #8b6d2e);
  border-radius: 10px;
}
.help-modal-body::-webkit-scrollbar-thumb:hover,
.history-log::-webkit-scrollbar-thumb:hover,
.stack-list::-webkit-scrollbar-thumb:hover,
.hand::-webkit-scrollbar-thumb:hover,
#opponent-hand::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(#e0bf73, #a58236);
}

.starting-player-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 211, 77, 0.16);
  border: 1px solid rgba(255, 211, 77, 0.45);
  color: #ffe38a;
  font-size: 12px;
  font-weight: 700;
}
.meta-box,
.fixed-zone-count,
.resource-zone-title { font-weight: 800; }
.fixed-zone-count,
#deck-count-top,
#deck-count-bottom,
#discard-count-top,
#discard-count-bottom,
#resources-count-top,
#resources-count-bottom,
#resources-zone-count-bottom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 13px;
  font-weight: 800;
  color: #fff4c2;
}
.link-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}
.card-link-line {
  stroke: rgba(255, 222, 89, 0.95);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 8 7;
  filter: drop-shadow(0 0 6px rgba(255, 222, 89, 0.35));
}
.card-marker-layer {
  position: absolute;
  width: 100px;
  min-height: 24px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: flex-start;
  pointer-events: none;
  transform: translate(0, -16px);
  z-index: 31;
}
.card-marker-badge {
  max-width: 96px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(#5a4318,#2f220d);
  color: #f8e5ba;
  border: 1px solid rgba(214,170,86,0.45);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.hero-zone {
  position: absolute;
  width: 102px;
  height: 140px;
  padding: 5px;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(214,170,86,0.55);
  background: linear-gradient(180deg, rgba(58,42,20,0.9), rgba(24,18,12,0.95));
  box-shadow: inset 0 1px 0 rgba(255,225,165,0.18), inset 0 0 18px rgba(255,205,120,0.06), 0 8px 22px rgba(0,0,0,0.38);
  z-index: 20;
}
.hero-zone.top { left: 160px; top: 20%; }
.hero-zone.bottom { left: 160px; bottom: 20%; }
.hero-zone-title {
  position: absolute;
  top: 4px;
  left: 10px;
  margin: 0;
  font-size: 11px;
  line-height: 1;
  color: #f0d38a;
  text-shadow: 0 0 4px rgba(255,220,120,0.35), 0 1px 2px rgba(0,0,0,0.7);
  pointer-events: none;
  z-index: 3;
}
.hero-slot {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-slot.empty {
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
}
.hero-placeholder {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  text-align: center;
}
.hero-card-image,
.hero-slot img {
  width: 78px;
  height: 108px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
.hero-attachments {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 35px;
  pointer-events: auto;
}
.hero-attachments .attached-card {
  width: 35px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(214,170,86,0.35);
  background: rgba(20,14,10,0.75);
  box-shadow: 0 0 6px rgba(255,210,120,0.35), 0 2px 6px rgba(0,0,0,0.35);
  cursor: none !important;
}
.hero-attachments .attached-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-attachments .attached-card:hover { transform: scale(1.15); z-index: 10; }
.hero-card-image.selected { outline: 3px solid #ffd54a; outline-offset: 2px; }
.hero-slot.hero-slot-drop-target {
  outline: 2px dashed #ffd54a;
  outline-offset: 2px;
  background: rgba(255, 213, 74, 0.12);
}

@media (max-width: 1100px) {
  #layout,
  body.sidebar-collapsed #layout {
    grid-template-columns: 1fr;
  }
  #sidebar { display:none; }
  .sidebar-reopen-btn { display:none !important; }
  #zoom { right: 16px; }
  .hint { display:none; }
  .auth-columns { grid-template-columns: 1fr; }
}

@media (max-height: 900px) {
  :root {
    --opponent-h: 84px;
    --player-h: 220px;
  }
  .hand { height: 146px; min-height: 146px; }
  .hand-card { width: 76px; height: 106px; }
  .pile-card { width: 70px; height: 98px; }
  .hero-zone.top { top: 60px; }
  .hero-zone.bottom { bottom: 60px; }
}

/* ===== FIX FINAL SIDEBAR SCROLL ===== */

#sidebar {
  display: grid !important;
  grid-template-rows: auto auto auto minmax(0, 1fr) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.sidebar-header {
  flex: 0 0 auto;
}

.sidebar-auth {
  flex: 0 0 auto;
}

.action-panel {
  flex: 0 0 auto !important;
}

.stack-panel {
  flex: 0 0 auto !important;
}

.history-panel {
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.history-panel .history-log {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-gutter: stable;
}

/* ===== FIX MAIN JOUEUR DU BAS ===== */

#main-area {
  grid-template-rows: 48px 78px minmax(260px, 1fr) 205px !important;
}

.player-strip.bottom {
  min-height: 205px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  display: grid !important;
  grid-template-rows: auto auto auto minmax(110px, 1fr) !important;
  gap: 4px !important;
  align-content: start !important;
}

.player-strip.bottom .strip-header {
  margin-bottom: 0 !important;
}

.player-strip.bottom .resource-row {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  gap: 6px !important;
}

.player-strip.bottom .hand-strip-label {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: 1.1 !important;
}

#hand,
.hand {
  height: 128px !important;
  min-height: 128px !important;
  max-height: 128px !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 2px 2px 0 0 !important;
}

#hand .hand-card,
.hand .hand-card,
#hand .card,
.hand .card {
  width: 86px !important;
  height: 120px !important;
  flex: 0 0 auto !important;
}

/* ===== COMPACT ACTIONS ===== */

.sidebar-actions {
  gap: 8px !important;
  padding: 8px 10px 10px !important;
}

.sidebar-action-group {
  gap: 6px !important;
}

.sidebar-action-title {
  font-size: 11px !important;
  margin: 0 !important;
}

.sidebar-action-buttons {
  gap: 6px !important;
}

.sidebar-action-buttons button {
  min-height: 24px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
}

.sidebar-action-buttons .starting-player-label {
  min-height: 24px !important;
  font-size: 11px !important;
  padding: 2px 8px !important;
}

/* ===== FIX FINAL SIDEBAR SANS PILE ===== */

#sidebar {
  display: grid !important;
  grid-template-rows: auto auto auto minmax(0, 1fr) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.sidebar-header,
.sidebar-auth,
.action-panel {
  min-height: 0;
}

.history-panel {
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.history-panel[open] {
  min-height: 0 !important;
}

.history-panel .panel-header {
  flex: 0 0 auto !important;
}

.history-panel .history-log {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-gutter: stable;
  padding: 10px 12px !important;
}

/* petit style scrollbar pour qu'on la voie bien */
.history-panel .history-log::-webkit-scrollbar {
  width: 10px;
}

.history-panel .history-log::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
}

.history-panel .history-log::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
}

/* ===== FIX MAIN BAS PLUS PROCHE ===== */

#main-area {
  grid-template-rows: 48px 74px minmax(260px, 1fr) 190px !important;
}

.player-strip.bottom {
  min-height: 190px !important;
  display: grid !important;
  grid-template-rows: auto auto auto minmax(118px, 1fr) !important;
  gap: 2px !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  align-content: start !important;
  overflow: hidden !important;
}

.player-strip.bottom .strip-header,
.player-strip.bottom .resource-row,
.player-strip.bottom .hand-strip-label {
  margin: 0 !important;
}

.player-strip.bottom .hand-strip-label {
  line-height: 1 !important;
  padding: 0 !important;
}

#hand,
.hand {
  height: 122px !important;
  min-height: 115px !important;
  max-height: 115px !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 0 !important;
  margin-top: -2px !important;
}

#hand .hand-card,
.hand .hand-card,
#hand .card,
.hand .card {
  width: 86px !important;
  height: 120px !important;
  flex: 0 0 auto !important;
}

/* ===== FIX POINTERS TOUJOURS AU-DESSUS ===== */

.remote-pointer,
#remote-pointer,
#remote-pointer-p1,
#remote-pointer-p2 {
  position: fixed !important;
  z-index: 2147483647 !important;
  pointer-events: none !important;
}

/* ===== COMPACT ACTIONS ===== */

.sidebar-actions {
  gap: 6px !important;
  padding: 8px 10px !important;
}

.sidebar-action-group {
  gap: 4px !important;
}

.sidebar-action-title {
  font-size: 11px !important;
  margin: 0 !important;
}

.sidebar-action-buttons {
  gap: 5px !important;
}

.sidebar-action-buttons button {
  min-height: 24px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
}

.sidebar-action-buttons .starting-player-label {
  min-height: 24px !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
}

/* =========================================================
   FINAL OVERRIDE UI STABLE
   À COLLER TOUT EN BAS DU style.css
   ========================================================= */




/* 3) topbar compacte */
.topbar,
.topbar.topbar-compact {
  min-height: 46px !important;
  height: 46px !important;
  padding: 4px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  overflow: hidden !important;
}

.topbar-main-row {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}


.history-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.history-panel[open] {
  min-height: 0 !important;
}

.history-panel .panel-header {
  flex: 0 0 auto !important;
}

#history-log,
.history-log {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 8px !important;
  scrollbar-gutter: stable !important;
}

/* scrollbar bien visible */
#history-log::-webkit-scrollbar,
.history-log::-webkit-scrollbar {
  width: 10px;
}

#history-log::-webkit-scrollbar-track,
.history-log::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
}

#history-log::-webkit-scrollbar-thumb,
.history-log::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
}

/* 8) actions plus compactes */
.sidebar-actions {
  padding: 8px !important;
  gap: 6px !important;
}

.sidebar-action-group {
  gap: 4px !important;
}

.sidebar-action-title {
  font-size: 11px !important;
  margin: 0 !important;
}

.sidebar-action-buttons {
  gap: 5px !important;
}

.sidebar-action-buttons button {
  min-height: 24px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
}

.sidebar-action-buttons .starting-player-label {
  min-height: 24px !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
}

/* 9) modale aide TOUJOURS AU-DESSUS */
.help-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
}

.help-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483001 !important;
  background: rgba(0,0,0,0.76) !important;
  backdrop-filter: blur(3px) !important;
}

.help-modal-content {
  position: fixed !important;
  z-index: 2147483002 !important;
  top: 40px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(1100px, calc(100vw - 40px)) !important;
  max-height: calc(100vh - 80px) !important;
  overflow: hidden !important;
}

.help-modal-body {
  overflow-y: auto !important;
  max-height: calc(100vh - 170px) !important;
}

/* le tapis ne doit jamais passer devant la modale */
#board-surface,
#board,
#table,
.table-card,
.card,
.hero-zone,
.fixed-zone,
.resource-zone,
.zone-label {
  z-index: auto !important;
}

/* 10) pointeurs toujours au-dessus du tapis,
   mais sous la modale d'aide */
.remote-pointer,
#remote-pointer,
#remote-pointer-p1,
#remote-pointer-p2 {
  position: fixed !important;
  z-index: 2147482000 !important;
  pointer-events: none !important;
}

/* 11) responsive */
@media (max-width: 1400px) {
  #layout {
    grid-template-columns: minmax(0, 1fr) 260px !important;
  }

  #main-area {
    grid-template-rows: 44px 54px minmax(0, 1fr) 158px !important;
  }

  .player-strip.bottom {
    min-height: 158px !important;
    max-height: 158px !important;
  }

  #hand,
  .hand {
    height: 110px !important;
    min-height: 110px !important;
    max-height: 110px !important;
  }

  #hand .card,
  #hand .hand-card,
  .hand .card,
  .hand .hand-card {
    width: 78px !important;
    height: 110px !important;
    min-width: 78px !important;
  }
}


/* ===== HISTORIQUE FIX VRAIMENT SCROLLABLE ===== */
#sidebar {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 8px !important;
  gap: 8px !important;
}

.sidebar-header,
.sidebar-auth,
.action-panel {
  flex: 0 0 auto !important;
}

.history-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.history-panel .panel-header {
  margin: 0 !important;
  padding: 12px !important;
}

#history-log {
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 8px !important;
  display: block !important;
  scrollbar-gutter: stable !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto !important;
  scrollbar-color: rgba(255,255,255,0.28) rgba(255,255,255,0.06) !important;
  position: relative !important;
  z-index: 20 !important;
  pointer-events: auto !important;
}

#history-log .history-entry {
  display: block !important;
  margin-bottom: 8px !important;
}

#history-log::-webkit-scrollbar {
  width: 12px !important;
}

#history-log::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.06) !important;
}

#history-log::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.28) !important;
  border-radius: 8px !important;
  border: 2px solid rgba(0,0,0,0) !important;
  background-clip: padding-box !important;
}

/* ===== SUMMARY STYLE (MENU DEPLOYABLE) ===== */

.panel > summary {
  list-style: none;
}

.panel > summary::-webkit-details-marker {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .3px;
  cursor: none !important;
  position: relative;
  transition: background .15s ease;
}

/* icône flèche */
.panel-header::before {
  content: "▸";
  font-size: 12px;
  color: #d4a956;
  transition: transform .18s ease;
}

/* rotation quand ouvert */
details[open] > .panel-header::before {
  transform: rotate(90deg);
}

/* hover */
.panel-header:hover {
  background: rgba(255,255,255,0.05);
}

#bottom-deck-zone.shuffle-anim .pile-card,
#bottom-deck-zone.shuffle-anim .pile-card.back {
  animation: deckShuffleFx 0.7s ease;
}

@keyframes deckShuffleFx {
  0% {
    transform: translateX(0) rotate(0deg) scale(1);
  }
  15% {
    transform: translateX(-8px) rotate(-6deg) scale(1.02);
  }
  30% {
    transform: translateX(10px) rotate(7deg) scale(1.03);
  }
  45% {
    transform: translateX(-6px) rotate(-4deg) scale(1.02);
  }
  60% {
    transform: translateX(8px) rotate(5deg) scale(1.02);
  }
  100% {
    transform: translateX(0) rotate(0deg) scale(1);
  }
}


.shuffle-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(255,220,120,0.08), rgba(0,0,0,0.18) 45%, rgba(0,0,0,0.36));
}

.shuffle-overlay.hidden {
  display: none;
}

.shuffle-fx-stack {
  position: relative;
  width: 420px;
  height: 280px;
  filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.45));
}

.shuffle-fx-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 168px;
  margin-left: -60px;
  margin-top: -84px;
  border-radius: 12px;
  overflow: hidden;
  transform-origin: center center;
  opacity: 0;
}

.shuffle-fx-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 12px;
}

.shuffle-overlay.play .shuffle-fx-card {
  animation: shuffleCenterFx 1.05s cubic-bezier(.22,.61,.36,1) both;
  animation-delay: calc(var(--i) * 0.045s);
}

.shuffle-overlay.play .shuffle-fx-card:nth-child(1) { --rotA: -26deg; --rotB: 12deg; --shiftX: -72px; --shiftY: -18px; }
.shuffle-overlay.play .shuffle-fx-card:nth-child(2) { --rotA: -14deg; --rotB: 18deg; --shiftX: -34px; --shiftY: 10px; }
.shuffle-overlay.play .shuffle-fx-card:nth-child(3) { --rotA: -8deg;  --rotB: -10deg; --shiftX: -8px;  --shiftY: -8px; }
.shuffle-overlay.play .shuffle-fx-card:nth-child(4) { --rotA: 8deg;   --rotB: 14deg; --shiftX: 18px;  --shiftY: 8px; }
.shuffle-overlay.play .shuffle-fx-card:nth-child(5) { --rotA: 18deg;  --rotB: -16deg; --shiftX: 48px; --shiftY: -6px; }
.shuffle-overlay.play .shuffle-fx-card:nth-child(6) { --rotA: 28deg;  --rotB: 8deg; --shiftX: 82px;  --shiftY: 12px; }

@keyframes shuffleCenterFx {
  0% {
    opacity: 0;
    transform: translate(-180px, 80px) rotate(var(--rotA, 0deg)) scale(0.78);
  }
  18% {
    opacity: 1;
    transform: translate(calc(var(--shiftX, 0px) * 1.2), calc(var(--shiftY, 0px) * 1.2)) rotate(var(--rotA, 0deg)) scale(1.02);
  }
  48% {
    opacity: 1;
    transform: translate(calc(var(--shiftX, 0px) * -0.7), calc(var(--shiftY, 0px) * -0.5)) rotate(var(--rotB, 0deg)) scale(1.04);
  }
  72% {
    opacity: 1;
    transform: translate(var(--shiftX, 0px), var(--shiftY, 0px)) rotate(calc(var(--rotA, 0deg) * -0.35)) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg) scale(0.82);
  }
}

.resource-zone-wrap {
  position: absolute;
  left: 110px;
  right: 110px;
  z-index: 2;
}

.resource-zone-wrap.top {
  top: 2px;
}

.resource-zone-wrap.bottom {
  bottom: 5px;
}

.resource-zone-wrap .resource-zone-title {
  margin-bottom: 4px;
  padding-left: 2px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  font-weight: 800;
  line-height: 1;
}

.resource-zone-wrap .resource-zone {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  height: 68px;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(0,0,0,0.08);
  padding: 2px 8px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.resource-zone-wrap .resource-zone-cards {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.resource-card {
  width: 42px;
  height: 58px;
  flex: 0 0 auto;
}
.resource-card.has-back-image {
  background: transparent !important;
}

.resource-card.has-back-image::after,
.resource-card.face-up::after {
  display: none;
}
.resource-zone-cards {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  overflow-x: auto;
  overflow-y: hidden;
}

.resource-card {
  width: 42px;
  height: 58px;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.resource-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

.resource-card::after {
  display: none !important;
}
.shuffle-fx-label {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f6e6b4;
font-family: "Cinzel", serif;
text-transform: uppercase;
  text-shadow:
    0 0 8px rgba(255, 200, 90, 0.8),
    0 0 18px rgba(255, 200, 90, 0.6),
    0 0 35px rgba(255, 200, 90, 0.3);
  animation: shuffleLabelPulse 1.1s ease-in-out infinite alternate;
  pointer-events: none;
  user-select: none;
}

@keyframes shuffleLabelPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 1;
  }
}
#deck-loader-panel {
  position: fixed;
  inset: 36px 48px;
  z-index: 2600;
  background: #1b1f24;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#deck-loader-panel.hidden {
  display: none !important;
}

#deck-loader-panel .deckbuilder-body {
  flex: 1;
  min-height: 0;
  padding: 16px;
}

#deck-loader-panel .deckbuilder-right {
  width: 100%;
}

#deck-loader-panel .library-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.turn-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(42, 49, 60, 0.95), rgba(24, 29, 37, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.06);
  font-weight: 700;
  color: #f5e7bf;
  min-height: 42px;
}

.turn-box span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#turn-player {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 211, 122, 0.12);
  color: #ffd37a;
  border: 1px solid rgba(255, 211, 122, 0.22);
  font-weight: 800;
}

#turn-number,
#turn-timer {
  color: #ffffff;
  font-size: 16px;
}

.turn-box.my-turn {
  box-shadow:
    0 0 0 1px rgba(107, 214, 130, 0.25),
    0 0 22px rgba(107, 214, 130, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.turn-box.my-turn #turn-player {
  background: rgba(107, 214, 130, 0.16);
  color: #9cf0aa;
  border-color: rgba(107, 214, 130, 0.30);
}

.turn-box.opponent-turn #turn-player {
  background: rgba(255, 115, 115, 0.12);
  color: #ffb3b3;
  border-color: rgba(255, 115, 115, 0.22);
}

.turn-box.timer-danger {
  animation: turnTimerPulse 0.9s ease-in-out infinite alternate;
}

@keyframes turnTimerPulse {
  0% {
    box-shadow:
      0 0 0 1px rgba(255, 110, 110, 0.22),
      0 0 10px rgba(255, 110, 110, 0.16),
      0 8px 18px rgba(0, 0, 0, 0.28);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 110, 110, 0.34),
      0 0 24px rgba(255, 110, 110, 0.28),
      0 8px 18px rgba(0, 0, 0, 0.28);
  }
}
.sound-toggle-btn {
  margin-left: 4px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #f5e7bf;
  cursor: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.sound-toggle-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
}

.sound-toggle-btn.muted {
  opacity: 0.72;
  background: rgba(255, 110, 110, 0.10);
  border-color: rgba(255, 110, 110, 0.22);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.topbar-room-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-room-input {
  width: 130px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #f5e7bf;
  outline: none;
  text-transform: uppercase;
}

.topbar-room-input::placeholder {
  color: rgba(245, 231, 191, 0.55);
}

.topbar-room-tools button {
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #f5e7bf;
  cursor: none !important;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.topbar-room-tools button:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
  transform: translateY(-1px);
}

.room-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(42, 49, 60, 0.95), rgba(24, 29, 37, 0.95));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.06);
  color: #f5e7bf;
}

.room-badge-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #aab3bf;
}

#room-code-display {
  font-size: 16px;
  color: #ffd37a;
  letter-spacing: 1px;
}

.room-badge-copy {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #f5e7bf;
  cursor: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.room-badge-copy:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
}


#board-surface {
  height: 583px;
}

.sound-toggle-btn.discord-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b5bac1;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  cursor: none !important;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.sound-toggle-btn.discord-toggle:hover {
  background: #2b2d31;
  color: #f2f3f5;
}

.sound-toggle-btn.discord-toggle:active {
  transform: scale(0.96);
}

.sound-toggle-btn.discord-toggle .discord-icon {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
}

.sound-toggle-btn.discord-toggle .discord-logo {
  fill: currentColor;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    fill 180ms ease;
}

.sound-toggle-btn.discord-toggle .discord-slash {
  stroke: #f23f43;
  stroke-width: 2.35;
  stroke-linecap: round;
  opacity: 0;
  transform-origin: center;
  transform: scale(0.7);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.sound-toggle-btn.discord-toggle.is-muted {
  color: #949ba4;
}

.sound-toggle-btn.discord-toggle.is-muted .discord-slash {
  opacity: 1;
  transform: scale(1);
}

.sound-toggle-btn.discord-toggle:focus-visible {
  outline: 2px solid #5865f2;
  outline-offset: 2px;
}

.room-status{
  margin-top:8px;
  font-size:13px;
  opacity:.9;
}

.room-status.hidden{
  display:none;
}

.ally-attached-card {
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  cursor: none !important;
}

.dice-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dice-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dice-box.hidden {
  display: none;
}

.dice-cube {
  width: 54px;
  height: 54px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.9s ease;
}

.dice-face {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  color: #fff;
  backface-visibility: hidden;
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

.dice-cube.p1 .dice-face {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

.dice-cube.p2 .dice-face {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
}

.face-1 { transform: rotateY(0deg) translateZ(27px); }
.face-2 { transform: rotateY(90deg) translateZ(27px); }
.face-3 { transform: rotateY(180deg) translateZ(27px); }
.face-4 { transform: rotateY(-90deg) translateZ(27px); }
.face-5 { transform: rotateX(90deg) translateZ(27px); }
.face-6 { transform: rotateX(-90deg) translateZ(27px); }

#dice-result-label {
  font-weight: 700;
  color: #fff;
}

#online-count {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 4px 10px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 700;

  color: #78dca0;

  background: linear-gradient(
    180deg,
    rgba(120, 220, 160, 0.12),
    rgba(120, 220, 160, 0.04)
  );

  border: 1px solid rgba(120, 220, 160, 0.3);

  box-shadow: 0 0 8px rgba(120, 220, 160, 0.15);

  white-space: nowrap;
}

#room-live-status {
  font-size: 13px;
  font-weight: 600;
  color: #f2bb57;
  margin-bottom: 10px;
  line-height: 1.4;
}

#ready-status {
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
}

.ready-on {
  color: #78dca0; /* vert */
}

.ready-off {
  color: #ffb3b3; /* rouge */
}

#ready-btn {
  background: linear-gradient(180deg, #f2bb57, #d38a19);
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 800;
  cursor: none !important;
  transition: 0.15s;
}

#ready-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

#ready-btn.active {
  background: linear-gradient(180deg, #78dca0, #2fa86c);
  color: #0b0f14;
}

.game-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-room-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}




.auth-shell {
  position: relative;
  z-index: 2;
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  padding: 42px 0;
  pointer-events: auto;
}

.auth-hero {
  color: #f6e7c2;
  padding: 24px 8px 24px 0;
}

.auth-hero-logo {
  display: inline-block;
  font-family: "Cinzel", serif;
  font-weight: 800;
  font-size: 20px;
  color: #ffd37a;
  margin-bottom: 20px;
  text-shadow: 0 0 16px rgba(242,187,87,0.18);
}

.auth-hero-title {
  margin: 0 0 16px;
  font-family: "Cinzel", serif;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
  color: #ffd37a;
  text-shadow:
    0 0 18px rgba(242,187,87,0.14),
    0 4px 18px rgba(0,0,0,0.45);
}

.auth-hero-text {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.75;
  color: #d8dee6;
  margin-bottom: 26px;
}

.auth-hero-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hero-info-card {
  border-radius: 18px;
  padding: 18px 16px;
  background: rgba(14, 19, 27, 0.62);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 34px rgba(0,0,0,0.28);
  backdrop-filter: blur(6px);
}

.hero-info-title {
  color: #ffd37a;
  font-weight: 800;
  margin-bottom: 10px;
}

.hero-info-card p {
  margin: 0;
  color: #d8dee6;
  line-height: 1.65;
  font-size: 14px;
}

.auth-side {
  display: flex;
  justify-content: center;
}

.auth-side-panel {
  width: 100%;
  max-width: 560px;
  border-radius: 26px;
  padding: 26px;
  background: rgba(10, 14, 20, 0.74);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 22px 55px rgba(0,0,0,0.42);
  backdrop-filter: blur(10px);
}

.auth-side-header h2 {
  margin: 0 0 8px;
  font-family: "Cinzel", serif;
  color: #ffd37a;
  font-size: 30px;
}

.auth-side-header p {
  margin: 0 0 18px;
  color: #c9d2de;
  line-height: 1.65;
}

.auth-columns-modern {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.auth-box-modern {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 18px;
}

.auth-box-modern h3 {
  margin: 0 0 14px;
  color: #fff0c2;
  font-size: 20px;
}

.auth-box-modern input {
  width: 100%;
  margin-bottom: 10px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #f4e7bd;
  padding: 0 14px;
  outline: none;
}

.auth-box-modern input::placeholder {
  color: rgba(244,231,189,0.52);
}

.auth-box-modern button,
.lobby-action-grid button,
.join-room-box button {
  border: none;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
  cursor: none !important;
  color: #1b1105;
  background: linear-gradient(180deg, #f2bb57, #d38a19);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.auth-box-modern button:hover,
.lobby-action-grid button:hover,
.join-room-box button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.lobby-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.lobby-small-note {
  color: #b8c2cf;
  margin-bottom: 18px;
}

.lobby-join-card {
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.join-room-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.join-room-box input {
  grid-column: 1 / -1;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #f4e7bd;
  padding: 0 14px;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px 0 36px;
  }

  .auth-hero {
    padding-right: 0;
  }

  .auth-hero-cards {
    grid-template-columns: 1fr;
  }

  .auth-columns-modern {
    grid-template-columns: 1fr;
  }
}


.auth-screen-bg {
  position: absolute;
  inset: 0;
  background-image: url("/images/wow-login-bg.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center 28%;
  transform: scale(1.04);
  transform-origin: center center;
  filter: brightness(0.72) saturate(1.05) contrast(1.05);
  z-index: 0;
}

.auth-screen-bg,
.auth-screen-overlay {
  pointer-events: none;
}


.changelog-modal-content {
  max-width: 980px;
}

.changelog-modal-body {
  max-height: 72vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.patch-hero-card {
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(242,187,87,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(242,187,87,0.18);
  box-shadow: 0 12px 26px rgba(0,0,0,0.24);
}

.patch-hero-card h3 {
  margin: 10px 0 8px;
  color: #ffd37a;
  font-family: "Cinzel", serif;
  font-size: 26px;
}

.patch-hero-card p {
  margin: 0;
  color: #d8dee6;
  line-height: 1.7;
}

.patch-version-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #ffd37a;
  background: rgba(242,187,87,0.10);
  border: 1px solid rgba(242,187,87,0.22);
}

.patch-section {
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.patch-section h3 {
  margin: 0 0 12px;
  color: #ffd37a;
  font-family: "Cinzel", serif;
  font-size: 22px;
}

.patch-entry {
  border-radius: 14px;
  padding: 14px 14px 4px;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.06);
}

.patch-entry strong {
  display: block;
  margin-bottom: 10px;
  color: #fff1c8;
  font-size: 16px;
}

.patch-entry ul {
  margin: 0 0 10px 18px;
  padding: 0;
  color: #dbe3ec;
  line-height: 1.7;
}

.turn-banner {
  position: absolute;
  top: 68px; /* 🔥 important : descend sous la topbar */
  left: 51%;
  transform: translateX(-50%);
  z-index: 10;

  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(16, 20, 24, 0.85);
  border: 1px solid rgba(255, 211, 122, 0.6);
  color: #ffd37a;
  font-weight: 700;
}

.player-strip.active-turn {
  border: 1px solid rgba(255, 211, 122, 0.95);
  box-shadow:
    0 0 0 2px rgba(255, 211, 122, 0.75),
    0 0 18px rgba(255, 211, 122, 0.25);
  animation: activeTurnPulse 1.8s ease-in-out infinite;
}

.player-strip.active-turn span {
  color: #ffd37a;
  font-weight: 700;
}

@keyframes activeTurnPulse {
  0% {
    box-shadow:
      0 0 0 2px rgba(255, 211, 122, 0.65),
      0 0 10px rgba(255, 211, 122, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 211, 122, 0.95),
      0 0 28px rgba(255, 211, 122, 0.42);
  }
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 211, 122, 0.65),
      0 0 10px rgba(255, 211, 122, 0.18);
  }
}

.turn-banner.flash-turn-change {
  animation: turnBannerFlash 0.8s ease;
}

@keyframes turnBannerFlash {
  0% {
    transform: translateX(-50%) scale(0.96);
    opacity: 0.35;
  }
  40% {
    transform: translateX(-50%) scale(1.08);
    opacity: 1;
    box-shadow: 0 0 30px rgba(255, 211, 122, 0.55);
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  }
}

.player-strip.turn-flash {
  animation: playerTurnFlash 0.7s ease;
}

@keyframes playerTurnFlash {
  0% {
    box-shadow: 0 0 0 rgba(255, 211, 122, 0);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 211, 122, 0.95),
      0 0 36px rgba(255, 211, 122, 0.45);
  }
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 211, 122, 0.75),
      0 0 18px rgba(255, 211, 122, 0.25);
  }
}

.auth-screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 48%, rgba(255, 196, 92, 0.10), transparent 28%),
    radial-gradient(circle at 72% 38%, rgba(80, 40, 10, 0.18), transparent 34%),
    linear-gradient(
      90deg,
      rgba(5, 8, 12, 0.68) 0%,
      rgba(10, 12, 18, 0.26) 30%,
      rgba(8, 10, 16, 0.16) 50%,
      rgba(5, 8, 12, 0.58) 100%
    ),
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.18) 0%,
      rgba(0, 0, 0, 0.05) 28%,
      rgba(0, 0, 0, 0.35) 100%
    );
}

.auth-panel::after,
#room-lobby::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.34) 100%);
}

.auth-side-panel {
  position: relative;
  z-index: 3;
  background: rgba(12, 14, 22, 0.38);
  border: 1px solid rgba(255, 211, 122, 0.14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-hero {
  position: relative;
  z-index: 3;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(0, 0, 0, 0.18);
}


.auth-screen-bg {
  position: absolute;
  inset: 0;
  background-image: url("/images/wow-login-bg.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: 50% 0%;
  transform: scale(1.00);
  transform-origin: center center;
  filter: brightness(0.68) saturate(1.08) contrast(1.08);
  z-index: 0;
}

.auth-screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 32% 44%, rgba(255, 205, 120, 0.10), transparent 24%),
    linear-gradient(90deg, rgba(6, 8, 12, 0.70) 0%, rgba(10, 12, 18, 0.18) 40%, rgba(6, 8, 12, 0.62) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.32) 100%);
}

.auth-panel::after,
#room-lobby::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 44%, rgba(0, 0, 0, 0.34) 100%);
}

.danger-btn {
  background: linear-gradient(180deg, #c94b4b, #962d2d);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}

.danger-btn:hover {
  filter: brightness(1.08);
}

#leaderboard-list,
#profile-content,
#match-history-list {
  padding: 12px;
  overflow-y: auto;
  max-height: 70vh;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.rank-row {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.rank-row.top {
  color: #ffd37a;
  font-weight: bold;
}

.match-row {
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

#leaderboard-panel,
#profile-panel,
#match-history-panel {
  position: fixed;
  inset: 0;
  z-index: 220000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  border: none;
  background: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

#leaderboard-list,
#profile-content,
#match-history-list {
  padding: 14px;
  overflow-y: auto;
  max-height: calc(100% - 56px);
}

.rank-row,
.match-row,
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.rank-row.top {
  color: #ffd37a;
  font-weight: 700;
}

#match-end-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-end-content {
  background: #12141c;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  width: 320px;
}

.win { color: #2ecc71; }
.lose { color: #e74c3c; }

.match-row {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  margin-bottom: 6px;
}

.match-row.win {
  background: rgba(46, 204, 113, 0.08);
  border-left: 3px solid #2ecc71;
}

.match-row.lose {
  background: rgba(231, 76, 60, 0.08);
  border-left: 3px solid #e74c3c;
}

.elo-win {
  color: #2ecc71;
  font-weight: bold;
}

.elo-lose {
  color: #e74c3c;
  font-weight: bold;
}

.rank-row {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.rank-row:hover {
  transform: scale(1.02);
}

/* TOP 3 glow */
.rank-row.top {
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

/* RANK COLORS */
.rank-row.bronze {
  background: rgba(205, 127, 50, 0.1);
  border-left: 4px solid #cd7f32;
}

.rank-row.silver {
  background: rgba(192, 192, 192, 0.1);
  border-left: 4px solid #c0c0c0;
}

.rank-row.gold {
  background: rgba(255, 215, 0, 0.1);
  border-left: 4px solid #ffd700;
}

.rank-row.diamond {
  background: rgba(0, 255, 255, 0.1);
  border-left: 4px solid #00ffff;
}

/* TOP 1 spécial */
.rank-row:nth-child(1) {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.match-end-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.match-end-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
}

.match-end-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: #121922;
  padding: 30px;
  border-radius: 20px;
  width: 320px;
  text-align: center;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
  animation: matchEndEnter 0.4s ease forwards;
}

@keyframes matchEndEnter {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.match-end-card.win {
  box-shadow: 0 0 30px rgba(80,255,150,0.4);
  border: 2px solid rgba(80,255,150,0.5);
}

.match-end-card.lose {
  box-shadow: 0 0 30px rgba(255,80,80,0.4);
  border: 2px solid rgba(255,80,80,0.5);
}

.match-end-title {
  font-size: 28px;
  margin-bottom: 10px;
}

.match-end-title.win {
  color: #4cff9a;
}

.match-end-title.lose {
  color: #ff6b6b;
}

.match-end-details {
  margin-top: 10px;
  font-size: 16px;
}

.match-end-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.match-end-actions button {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: none !important;
}

.match-end-actions .primary {
  background: #f2bb57;
  color: #000;
  font-weight: bold;
}

/* ✨ Glow joueur actif */
.active-player-glow {
  box-shadow: 0 0 20px rgba(255, 200, 80, 0.6);
  border: 2px solid rgba(255, 200, 80, 0.7);
}

/* 🟢 Carte sélectionnée */
.card-selected {
  outline: 2px solid #4cff9a;
  box-shadow: 0 0 12px rgba(76,255,154,0.6);
}

/* 🎯 Drop target */
.card-drop-target {
  outline: 2px dashed #f2bb57;
  box-shadow: 0 0 12px rgba(242,187,87,0.6);
}

/* 🔥 Buff animation */
.card-buff {
  animation: buffPulse 0.6s ease;
}

@keyframes buffPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(76,255,154,0); }
  50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(76,255,154,0.8); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(76,255,154,0); }
}

.active-player-glow {
  animation: activePulse 1.5s infinite;
}

@keyframes activePulse {
  0% { box-shadow: 0 0 10px rgba(255,200,80,0.4); }
  50% { box-shadow: 0 0 20px rgba(255,200,80,0.9); }
  100% { box-shadow: 0 0 10px rgba(255,200,80,0.4); }
}

.active-card {
  filter: drop-shadow(0 0 6px rgba(80, 200, 255, 0.6));
  transition: all 0.2s ease;
}

.active-card:hover {
  filter: drop-shadow(0 0 12px rgba(80, 200, 255, 1));
  transform: scale(1.03);
}

.owner-p1.active-card {
  filter: drop-shadow(0 0 10px rgba(80, 150, 255, 0.8));
}

.owner-p2.active-card {
  filter: drop-shadow(0 0 10px rgba(255, 80, 80, 0.8));
}

.card-hit {
  animation: cardHitFlash 0.45s ease;
}

.card-buff {
  animation: cardBuffPulse 0.55s ease;
}

.card-targeted {
  animation: cardTargetGlow 0.6s ease;
}

@keyframes cardHitFlash {
  0% {
    box-shadow: 0 0 0 rgba(255, 80, 80, 0);
    transform: scale(1);
  }
  30% {
    box-shadow: 0 0 24px rgba(255, 80, 80, 0.95);
    transform: scale(1.04);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 80, 80, 0);
    transform: scale(1);
  }
}

@keyframes cardBuffPulse {
  0% {
    box-shadow: 0 0 0 rgba(76, 255, 154, 0);
    transform: scale(1);
  }
  40% {
    box-shadow: 0 0 24px rgba(76, 255, 154, 0.95);
    transform: scale(1.06);
  }
  100% {
    box-shadow: 0 0 0 rgba(76, 255, 154, 0);
    transform: scale(1);
  }
}

@keyframes cardTargetGlow {
  0% {
    box-shadow: 0 0 0 rgba(242, 187, 87, 0);
  }
  50% {
    box-shadow: 0 0 22px rgba(242, 187, 87, 0.95);
  }
  100% {
    box-shadow: 0 0 0 rgba(242, 187, 87, 0);
  }
}

.elo-value {
  margin-left: 8px;
  font-weight: bold;
}

.rank-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rank-left {
  display: flex;
  align-items: center;
  gap: 10px; /* 🔥 c'est ça la clé */
}

.rank-elo {
  background: rgba(242, 187, 87, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: bold;
}

.rank-name {
  font-weight: 600;
}

.rank-elo {
  font-size: 13px;
}

.table-card.hover-target {
  outline: 2px solid rgba(255, 200, 80, 0.8);
  box-shadow: 0 0 12px rgba(255, 200, 80, 0.6);
}

.card-enter {
  animation: cardDrop 0.25s ease;
}

@keyframes cardDrop {
  from {
    transform: scale(0.8) translateY(-10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.dragging-board-card {
  opacity: 0.72;
  filter: drop-shadow(0 0 10px rgba(242, 187, 87, 0.55));
  cursor: none !important;
}

.attach-success {
  animation: attachPulse 0.25s ease;
}

@keyframes attachPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.dragging-board-card {
  opacity: 0.68;
  filter: drop-shadow(0 0 12px rgba(242, 187, 87, 0.55));
  cursor: none !important;
}
.table-card {
  cursor: none !important;
}
.table-card.dragging-board-card {
  cursor: none !important;
}

body.discard-open #zoom {
  right: 38%;
}

body.deck-open #zoom {
  right: 38%;
}
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.confirm-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px));
  background: linear-gradient(180deg, #18212c, #121922);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  padding: 22px;
  color: #f3e7c0;
}

.confirm-box h3 {
  margin: 0 0 10px;
  color: #f2bb57;
  font-size: 22px;
}

.confirm-box p {
  margin: 0;
  color: #dfe6ef;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.confirm-actions button {
  min-width: 110px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: none !important;
  font-weight: 700;
}

.confirm-actions .alt {
  background: #202a36;
  color: #dfe6ef;
}

.confirm-actions .primary {
  background: #f2bb57;
  color: #111;
}

.confirm-modal.hidden {
  display: none;
}

.link-btn {
  background: transparent;
  border: 0;
  color: #9ecbff;
  padding: 4px 0;
  text-align: left;
  font-size: 12px;
  cursor: none !important;
}

.link-btn:hover {
  text-decoration: underline;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(3px);
}

.modal-card {
  width: min(440px, calc(100vw - 32px));
  background: rgba(12, 16, 22, 0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.small-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-message {
  font-size: 13px;
  color: #d8dfeb;
  min-height: 18px;
  white-space: pre-wrap;
}

.toast-container {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 500000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 240px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(12,16,22,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  animation: toastIn .18s ease;
}

.toast.success { border-color: rgba(70, 190, 110, 0.45); }
.toast.error { border-color: rgba(220, 80, 80, 0.45); }

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

#reset-login-btn {
  margin-top: 10px;
  background: linear-gradient(180deg, #4CAF50, #2e7d32);
}

.password-strength {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-top: -2px;
  margin-bottom: 6px;
}

.password-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.18s ease, background 0.18s ease;
  background: #666;
}

.password-strength-text,
.password-confirm-text {
  font-size: 12px;
  min-height: 18px;
  color: #d7dce5;
}

.password-confirm-text.ok {
  color: #67d98a;
}

.password-confirm-text.bad {
  color: #ff7a7a;
}

#reset-login-btn {
  margin-top: 10px;
  background: linear-gradient(180deg, #4CAF50, #2e7d32);
}



#match-history-list {
  overflow-y: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.match-history-card {
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-history-card.win {
  border-color: rgba(70, 190, 110, 0.35);
  box-shadow: inset 0 0 0 1px rgba(70, 190, 110, 0.08);
}

.match-history-card.lose {
  border-color: rgba(220, 90, 90, 0.35);
  box-shadow: inset 0 0 0 1px rgba(220, 90, 90, 0.08);
}

.match-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.match-history-result {
  font-weight: 800;
  font-size: 16px;
}

.match-history-result.win {
  color: #67d98a;
}

.match-history-result.lose {
  color: #ff8686;
}

.match-history-elo {
  font-weight: 800;
  font-size: 14px;
}

.elo-win {
  color: #67d98a;
}

.elo-lose {
  color: #ff8686;
}

.elo-neutral {
  color: #cfd6e4;
}

.match-history-vs {
  font-size: 15px;
  color: #f2e7c7;
}

.match-history-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  font-size: 13px;
  color: #d6deea;
}

.match-history-meta span {
  opacity: 0.72;
  margin-right: 6px;
}

.match-history-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #9fb0c7;
  opacity: 0.9;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.match-history-empty,
.match-history-loading {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: #d5dce8;
  text-align: center;
}

@media (max-width: 700px) {
  .match-history-meta {
    grid-template-columns: 1fr;
  }

  .match-history-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

.profile-loading,
.profile-empty {
  padding: 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: #d5dce8;
  text-align: center;
}

.profile-summary-card,
.profile-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.profile-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-username {
  font-size: 22px;
  font-weight: 800;
  color: #f5e7bf;
}

.profile-rank {
  margin-top: 4px;
  color: #d4c28a;
  font-size: 14px;
  font-weight: 700;
}

.profile-elo-box {
  text-align: right;
}

.profile-elo-current {
  font-size: 22px;
  font-weight: 800;
  color: #ffd37a;
}

.profile-elo-best {
  margin-top: 4px;
  font-size: 13px;
  color: #b9c4d6;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.profile-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #f0d38a;
  margin-bottom: 10px;
}

.profile-hero-table,
.profile-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-hero-row,
.profile-recent-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.profile-hero-row {
  grid-template-columns: minmax(0, 1.6fr) 110px 110px 80px;
  align-items: center;
}

.profile-hero-name {
  font-weight: 700;
  color: #f4e8c8;
}

.profile-hero-meta {
  color: #cfd6e4;
  font-size: 13px;
}

.profile-hero-winrate {
  font-weight: 800;
  color: #67d98a;
  text-align: right;
}

.profile-recent-row.win {
  border-left: 4px solid #2ecc71;
}

.profile-recent-row.lose {
  border-left: 4px solid #e74c3c;
}

.profile-recent-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #f3e8c9;
}

.profile-recent-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  font-size: 13px;
  color: #cfd6e4;
}

@media (max-width: 760px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero-row {
    grid-template-columns: 1fr;
  }

  .profile-recent-meta {
    grid-template-columns: 1fr;
  }

  .profile-elo-box {
    text-align: left;
  }
}

.auth-error-message {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: #ff8e8e;
  font-weight: 600;
}

#matchmaking-status {
  margin-top: 8px;
  font-size: 12px;
  color: #d8d8d8;
  min-height: 18px;
}

.matchmaking-modal {
  position: fixed;
  inset: 0;
  z-index: 450000;
}

.matchmaking-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
}

.matchmaking-modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  background: rgba(18, 25, 34, 0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 26px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.matchmaking-modal-card h2 {
  margin: 0 0 12px;
  color: #ffd37a;
}

.matchmaking-opponent {
  font-size: 22px;
  font-weight: 800;
  color: #f5e7bf;
  margin-bottom: 6px;
}

.matchmaking-elo {
  font-size: 14px;
  color: #cfd6e4;
  margin-bottom: 18px;
}

.matchmaking-countdown {
  font-size: 64px;
  font-weight: 800;
  color: #4cff9a;
  line-height: 1;
  margin-bottom: 10px;
}

.matchmaking-subtext {
  font-size: 13px;
  color: #b9c4d6;
}

.matchmaking-meta {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #d8d8d8;
  min-height: 48px;
}

.matchmaking-meta strong {
  color: #ffd37a;
}

.mulligan-selected {
  outline: 3px solid #f2bb57;
  box-shadow: 0 0 18px rgba(242, 187, 87, 0.45);
  transform: translateY(-8px);
}

#mulligan-mode-btn.hidden,
#mulligan-confirm-btn.hidden,
#mulligan-cancel-btn.hidden {
  display: none !important;
}

.lang-switcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.lang-switcher select {
  min-width: 84px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 20, 0.92);
  color: #f5e7bf;
  font-weight: 700;
  font-size: 12px;
  outline: none;
  cursor: none !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.lang-switcher select:hover {
  border-color: rgba(242, 187, 87, 0.45);
}

.lang-switcher select option {
  color: #111;
}

/* Quand la sidebar est ouverte, on décale un peu à gauche */
body.in-game:not(.sidebar-collapsed) .lang-switcher {
  right: 300px;
  bottom: 16px;
}

/* Quand la sidebar est fermée */
body.in-game.sidebar-collapsed .lang-switcher {
  right: 18px;
  bottom: 16px;
}

/* Hors jeu */
body:not(.in-game) .lang-switcher {
  right: 18px;
  bottom: 18px;
}

/* Responsive */
@media (max-width: 1100px) {
  .lang-switcher {
    right: 12px;
    bottom: 12px;
  }

  .lang-switcher select {
    min-width: 76px;
    height: 30px;
    font-size: 11px;
    padding: 0 8px;
  }

  body.in-game:not(.sidebar-collapsed) .lang-switcher {
    right: 250px;
  }
}

.lang-switcher select {
  opacity: 0.9;
}

.lang-switcher select:hover,
.lang-switcher select:focus {
  opacity: 1;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 60px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  opacity: 0.98;
}

.toast.success {
  background: rgba(46, 204, 113, 0.92);
}

.toast.error {
  background: rgba(200, 75, 75, 0.94);
}

.toast.info {
  background: rgba(60, 90, 160, 0.94);
}

.ranked-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3e7c0;
  font-size: 14px;
  font-weight: 600;
  cursor: none !important;
}

.ranked-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: none !important;
  accent-color: #d9a441;
}

.ranked-toggle-row span {
  user-select: none;
}


:root {
  --wow-cursor: url("/ui/cursor.webp") 27 27, auto;
  --wow-cursor-hover: url("/ui/cursor-hover.webp") 27 27, pointer;
}

/* Curseur global */
html,
body,
button,
label,
summary,
.panel-header,
.sidebar,
.sidebar * {
  cursor: none;
}

/* Curseur "hover / cliquable" */
a,
button,
input[type="checkbox"],
select,
summary,
[onclick],
.table-card,
.hero-card-image,
.hand-card,
.resource-card,
.attached-card,
.ally-attached-card,
.room-badge-copy {
  cursor: none;
}

/* Si tu veux garder le texte sélectionnable avec l'ibeam normal */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  cursor: text;
}

/* ===== WOW SIDEBAR ===== */

#sidebar {
  position: relative;
  background:
    radial-gradient(circle at top, rgba(255, 196, 83, 0.06), transparent 26%),
    linear-gradient(180deg, var(--wow-panel-top), var(--wow-panel-bottom));
  border-left: 1px solid rgba(215, 178, 90, 0.22);
  box-shadow:
    inset 1px 0 0 rgba(255, 223, 140, 0.06),
    inset 0 0 40px rgba(255, 183, 77, 0.035),
    -10px 0 24px rgba(0, 0, 0, 0.42);
}

#sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 214, 122, 0.04), transparent 12%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.18), transparent 25%);
}

.sidebar-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid rgba(215, 178, 90, 0.14);
  padding-bottom: 10px;
}

.sidebar-header strong {
  color: var(--wow-text-gold);
  text-shadow: 0 1px 0 #000, 0 0 8px rgba(255, 183, 77, 0.08);
  font-weight: 800;
}

.panel {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(35, 26, 19, 0.84), rgba(16, 14, 14, 0.92));
  border: 1px solid rgba(194, 149, 67, 0.26);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 176, 0.06),
    inset 0 0 20px rgba(255, 188, 92, 0.025),
    0 8px 24px rgba(0, 0, 0, 0.22);
}

.panel-header {
  color: var(--wow-text-gold);
  font-weight: 800;
  text-shadow: var(--wow-shadow);
}

.sidebar-action-title {
  color: var(--wow-text-gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: var(--wow-shadow);
  margin-bottom: 6px;
}

#room-live-status,
.starting-player-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(73, 56, 25, 0.95), rgba(50, 38, 17, 0.95));
  border: 1px solid rgba(214, 171, 87, 0.55);
  color: #ffd978;
  font-weight: 700;
  text-shadow: 0 1px 0 #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 241, 179, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* ===== WOW BUTTONS ===== */

.sidebar-action-buttons button,
.sidebar-header .alt,
.game-controls button,
.dice-panel button {
  position: relative;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 9px;
  border: 1px solid var(--wow-blue-border);
  background:
    linear-gradient(180deg, var(--wow-blue-1) 0%, #34445d 30%, var(--wow-blue-2) 100%);
  color: var(--wow-text-gold);
  font-weight: 800;
  letter-spacing: 0.15px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 234, 192, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 216, 125, 0.06),
    0 0 0 1px rgba(58, 42, 20, 0.18);
  transition:
    filter 0.12s ease,
    transform 0.08s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.sidebar-action-buttons button::before,
.sidebar-header .alt::before,
.game-controls button::before,
.dice-panel button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  border: 1px solid rgba(255, 224, 168, 0.06);
  pointer-events: none;
}

.sidebar-action-buttons button:hover,
.sidebar-header .alt:hover,
.game-controls button:hover,
.dice-panel button:hover {
  filter: brightness(1.07);
  border-color: #d0ab5a;
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 205, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(208, 171, 90, 0.1),
    0 0 10px rgba(255, 190, 90, 0.12);
}

.sidebar-action-buttons button:active,
.sidebar-header .alt:active,
.game-controls button:active,
.dice-panel button:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}

/* bouton ready doré */
#ready-btn {
  border-color: var(--wow-gold-btn-border);
  background:
    linear-gradient(180deg, #b58a31 0%, var(--wow-gold-btn-1) 38%, var(--wow-gold-btn-2) 100%);
  color: #fff1c1;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 204, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 0 8px rgba(255, 194, 69, 0.12);
}

#ready-btn:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 204, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 0 12px rgba(255, 194, 69, 0.18);
}

/* nouvelle partie en rouge wow */
button[data-i18n="sidebar_new_game"] {
  border-color: var(--wow-red-border);
  background:
    linear-gradient(180deg, #a5221d 0%, var(--wow-red-1) 38%, var(--wow-red-2) 100%);
  color: #f6e8c6;
}

/* danger */
.danger-btn {
  border-color: var(--wow-danger-border) !important;
  background:
    linear-gradient(180deg, #9b2f29 0%, var(--wow-danger-1) 38%, var(--wow-danger-2) 100%) !important;
  color: #ffe0d4 !important;
}

/* boutons "secondaires" plus acier sombre */
button[data-i18n="sidebar_reset_table"],
button[data-i18n="sidebar_p1_start"],
button[data-i18n="sidebar_p2_start"],
button[data-i18n="sidebar_export"],
button[data-i18n="sidebar_import"],
button[data-i18n="sidebar_deckbuilder"],
button[data-i18n="sidebar_load_deck"],
button[data-i18n="sidebar_fullscreen"],
button[data-i18n="sidebar_help"],
button[data-i18n="sidebar_how_to_play"],
button[data-i18n="sidebar_rules"],
button[data-i18n="sidebar_changelog"],
button[data-i18n="sidebar_roll_dice"],
button[data-i18n="sidebar_leaderboard"],
button[data-i18n="sidebar_profile"],
button[data-i18n="sidebar_match_history"],
#mulligan-btn {
  border-color: #8b7347;
  background:
    linear-gradient(180deg, #4a5870 0%, #334056 36%, #222c3d 100%);
  color: #f0d18a;
}

.ranked-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(53, 41, 21, 0.95), rgba(31, 24, 15, 0.95));
  border: 1px solid rgba(210, 172, 92, 0.4);
  color: var(--wow-text-gold);
  font-weight: 800;
  text-shadow: 0 1px 0 #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 188, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.ranked-toggle-row:hover {
  border-color: rgba(226, 185, 94, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 188, 0.06),
    0 0 10px rgba(255, 190, 90, 0.08);
}

.ranked-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #d4a441;
}

.history-entry {
  background:
    linear-gradient(180deg, rgba(42, 31, 20, 0.82), rgba(19, 16, 14, 0.9));
  border: 1px solid rgba(182, 132, 55, 0.14);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 227, 172, 0.03);
}

.history-entry.alert {
  background:
    linear-gradient(180deg, rgba(70, 25, 22, 0.86), rgba(39, 16, 15, 0.92));
  border-color: rgba(201, 89, 72, 0.38);
}

.history-time {
  color: #b99d68;
  text-shadow: 0 1px 0 #000;
}

.history-text {
  color: #f0e2c5;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

details.panel summary::before {
  content: "▾";
  display: inline-block;
  margin-right: 8px;
  color: var(--wow-text-gold);
  text-shadow: 0 1px 0 #000;
}

details.panel:not([open]) summary::before {
  content: "▸";
}

.history-panel:not([open]) {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
}

.history-panel:not([open]) #history-log {
  display: none !important;
}

.history-panel[open] {
  flex: 1 1 auto;
  min-height: 0;
}

:root {
  --wow-classic-gold: #d8b15b;
  --wow-classic-gold-light: #f1d79a;
  --wow-classic-gold-dark: #6f4f1f;

  --wow-classic-red-top: #9d1e17;
  --wow-classic-red-mid: #7c1511;
  --wow-classic-red-bot: #4f0d0a;

  --wow-classic-red-top-hover: #b1261d;
  --wow-classic-red-mid-hover: #8f1a14;
  --wow-classic-red-bot-hover: #5a100c;

  --wow-classic-panel-top: rgba(51, 28, 12, 0.96);
  --wow-classic-panel-mid: rgba(25, 16, 10, 0.96);
  --wow-classic-panel-bot: rgba(10, 8, 8, 0.98);

  --wow-classic-border: rgba(204, 151, 52, 0.45);
  --wow-classic-shadow: 0 1px 0 rgba(0, 0, 0, 0.95);
}

/* ===== SIDEBAR CLASSIC ===== */

#sidebar {
  position: relative;
  background:
    radial-gradient(circle at top, rgba(255, 187, 74, 0.08), transparent 22%),
    linear-gradient(180deg, var(--wow-classic-panel-top) 0%, var(--wow-classic-panel-mid) 40%, var(--wow-classic-panel-bot) 100%);
  border-left: 1px solid rgba(210, 158, 58, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 214, 140, 0.04),
    inset 0 0 30px rgba(255, 183, 77, 0.03),
    -10px 0 24px rgba(0, 0, 0, 0.35);
}

#sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 216, 131, 0.035), transparent 18%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.16), transparent 20%);
}

.sidebar-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid rgba(216, 177, 91, 0.14);
  padding-bottom: 10px;
}

.sidebar-header strong {
  color: var(--wow-classic-gold-light);
  text-shadow: 0 1px 0 #000, 0 0 10px rgba(255, 191, 74, 0.08);
  font-weight: 800;
}

/* panels */
.panel {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(42, 26, 14, 0.86), rgba(20, 14, 12, 0.94));
  border: 1px solid rgba(206, 151, 52, 0.22);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 224, 156, 0.05),
    inset 0 0 18px rgba(255, 176, 70, 0.025),
    0 8px 22px rgba(0, 0, 0, 0.18);
}

.panel-header {
  color: var(--wow-classic-gold-light);
  font-weight: 800;
  text-shadow: var(--wow-classic-shadow);
  letter-spacing: 0.2px;
}

details.panel summary {
  list-style: none;
}

details.panel summary::-webkit-details-marker {
  display: none;
}

details.panel summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--wow-classic-gold);
  text-shadow: 0 1px 0 #000;
  transform: translateY(-1px);
}

details.panel[open] summary::before {
  content: "▾";
}

/* titles */
.sidebar-action-title {
  color: var(--wow-classic-gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: var(--wow-classic-shadow);
  margin-bottom: 6px;
}

/* topbar language */
.wow-sidebar-topbar {
  margin-bottom: 10px;
}

.wow-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(61, 41, 19, 0.92), rgba(31, 22, 15, 0.95));
  border: 1px solid rgba(214, 171, 87, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 188, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.wow-lang-label {
  color: var(--wow-classic-gold-light);
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 0 #000;
}

.wow-lang-row select {
  min-width: 98px;
  height: 28px;
  padding: 2px 26px 2px 8px;
  border-radius: 8px;
  border: 1px solid #8f6c34;
  background:
    linear-gradient(180deg, #3d2d19 0%, #261a12 100%);
  color: var(--wow-classic-gold-light);
  font-weight: 700;
  text-shadow: 0 1px 0 #000;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, 0.06),
    0 1px 0 rgba(0, 0, 0, 0.4);
}

.wow-lang-row select:hover,
.wow-lang-row select:focus {
  border-color: #cda355;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, 0.08),
    0 0 10px rgba(255, 183, 77, 0.1);
}

/* room badges */
#room-live-status,
.starting-player-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(72, 56, 25, 0.95), rgba(44, 34, 17, 0.95));
  border: 1px solid rgba(213, 167, 74, 0.52);
  color: #ffd56e;
  font-weight: 700;
  text-shadow: 0 1px 0 #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 239, 182, 0.07),
    0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* ===== WOW CLASSIC BUTTONS ===== */

#sidebar .sidebar-action-buttons button,
#sidebar .game-controls button,
#sidebar .dice-panel button,
#sidebar .sidebar-header .alt {
  position: relative;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #9d6f36 !important;
  background:
    linear-gradient(180deg, var(--wow-classic-red-top) 0%, var(--wow-classic-red-mid) 44%, var(--wow-classic-red-bot) 100%) !important;
  color: var(--wow-classic-gold-light) !important;
  font-weight: 800;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 203, 203, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 213, 120, 0.04);
  transition:
    filter 0.12s ease,
    transform 0.08s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

#sidebar .sidebar-action-buttons button::before,
#sidebar .game-controls button::before,
#sidebar .dice-panel button::before,
#sidebar .sidebar-header .alt::before {
  content: none;
}

#sidebar .sidebar-action-buttons button:hover,
#sidebar .game-controls button:hover,
#sidebar .dice-panel button:hover,
#sidebar .sidebar-header .alt:hover {
  background:
    linear-gradient(180deg, var(--wow-classic-red-top-hover) 0%, var(--wow-classic-red-mid-hover) 44%, var(--wow-classic-red-bot-hover) 100%) !important;
  border-color: #c9944e !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 220, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 0 12px rgba(255, 176, 70, 0.12);
}

#sidebar .sidebar-action-buttons button:active,
#sidebar .game-controls button:active,
#sidebar .dice-panel button:active,
#sidebar .sidebar-header .alt:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}

/* Ready in gold */
#sidebar #ready-btn {
  border-color: #cda355 !important;
  background:
    linear-gradient(180deg, #b98b31 0%, #8c6621 44%, #5a3f13 100%) !important;
  color: #fff0c4 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 202, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32),
    0 0 10px rgba(255, 197, 84, 0.12);
}

#sidebar #ready-btn:hover {
  background:
    linear-gradient(180deg, #c79836 0%, #9d7426 44%, #674a16 100%) !important;
}

/* New game slightly more important */
#sidebar button[data-i18n="sidebar_new_game"] {
  border-color: #d0a25a !important;
}

/* danger darker red */
#sidebar .danger-btn {
  border-color: #c28b78 !important;
  background:
    linear-gradient(180deg, #8a241d 0%, #671611 44%, #3d0c09 100%) !important;
  color: #ffe2d3 !important;
}

/* ranked toggle */
.ranked-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(58, 42, 20, 0.95), rgba(30, 21, 14, 0.95));
  border: 1px solid rgba(211, 168, 83, 0.38);
  color: var(--wow-classic-gold-light);
  font-weight: 800;
  text-shadow: 0 1px 0 #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 179, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.24);
}

.ranked-toggle-row:hover {
  border-color: rgba(222, 180, 90, 0.5);
  box-shadow: 0 0 10px rgba(255, 183, 77, 0.07);
}

.ranked-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #d5a540;
}

/* history */
.history-entry {
  background:
    linear-gradient(180deg, rgba(46, 31, 17, 0.82), rgba(20, 15, 13, 0.92));
  border: 1px solid rgba(187, 136, 56, 0.14);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 168, 0.03);
}

.history-entry.alert {
  background:
    linear-gradient(180deg, rgba(71, 24, 21, 0.86), rgba(40, 15, 14, 0.94));
  border-color: rgba(200, 92, 73, 0.36);
}

.history-time {
  color: #b99861;
  text-shadow: 0 1px 0 #000;
}

.history-text {
  color: #f0e2c2;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}

button.small,
#life_top,
#life_bottom {
  position: relative;
  z-index: 30;
  pointer-events: auto;
}

.top-bar::before,
.top-bar::after,
.player-bar::before,
.player-bar::after {
  pointer-events: none;
}

.life-controls,
.player-life-controls,
.top-player-life,
.bottom-player-life {
  position: relative;
  z-index: 40;
}

button.small {
  position: relative;
  z-index: 50;
  pointer-events: auto;
}

button.small::before,
button.small::after {
  pointer-events: none;
}

#life_top,
#life_bottom {
  position: relative;
  z-index: 50;
}




#playmat-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transition: opacity 0.2s ease, background-image 0.2s ease;
  filter: saturate(0.95) contrast(1.02);
}



.playmat-controls select {
  width: 100%;
  max-width: 100%;
}

.playmat-opacity-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0 2px;
}

.playmat-opacity-box label {
  font-size: 12px;
  font-weight: 700;
  color: var(--wow-classic-gold-light, #f1d79a);
  text-shadow: 0 1px 0 #000;
}

.playmat-opacity-box input[type="range"] {
  width: 100%;
  accent-color: #d5a540;
}

#playmat-opacity-value {
  font-size: 12px;
  font-weight: 700;
  color: #e9d09a;
}

.playmat-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 2px;
}

.playmat-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  min-height: unset !important;
  border-radius: 10px !important;
  overflow: hidden;
  border: 1px solid rgba(214, 171, 87, 0.35) !important;
  background:
    linear-gradient(180deg, rgba(58, 42, 20, 0.95), rgba(26, 18, 12, 0.95)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 229, 173, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.22);
}

.playmat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.92;
}

.playmat-thumb-label {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--wow-classic-gold-light, #f1d79a);
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 1px 0 #000;
}

.playmat-thumb:hover {
  border-color: rgba(233, 190, 94, 0.65) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 184, 0.08),
    0 0 10px rgba(255, 183, 77, 0.14);
  transform: translateY(-1px);
}

.playmat-thumb.active {
  border-color: #d7b25a !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 173, 0.08),
    0 0 0 1px rgba(215, 178, 90, 0.24),
    0 0 12px rgba(255, 190, 90, 0.2);
}

.playmat-thumb.active::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255, 224, 168, 0.18);
  pointer-events: none;
}

.playmat-opacity-inline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(48, 33, 17, 0.86), rgba(26, 18, 12, 0.9));
  border: 1px solid rgba(214, 171, 87, 0.16);
}

.playmat-opacity-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--wow-classic-gold-light, #f1d79a);
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}

.playmat-opacity-range {
  width: 100%;
  min-width: 0;
  accent-color: #d5a540;
}

.playmat-opacity-value {
  min-width: 38px;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: #e7cf97;
  text-shadow: 0 1px 0 #000;
}

.life-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* Nom joueur */
.life-player-name {
  font-weight: 700;
  color: #e7cf97;
  text-shadow: 0 1px 0 #000;
}

/* Badge */
.player-color-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, #3b5fa8, #1c2f5a);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

/* Bloc PV */
.life-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;

  background:
    linear-gradient(180deg, rgba(60,40,20,0.9), rgba(20,14,8,0.95));
  border: 1px solid rgba(214,171,87,0.35);
  border-radius: 10px;

  padding: 2px 4px;

  box-shadow:
    inset 0 1px 0 rgba(255,230,180,0.08),
    0 0 6px rgba(0,0,0,0.3);
}

/* Valeur PV */
.life-value {
  min-width: 26px;
  text-align: center;
  font-weight: 900;
  font-size: 14px;
  color: #ffd86b;
  text-shadow:
    0 1px 0 #000,
    0 0 4px rgba(255,200,80,0.4);
}

/* Boutons */
.life-btn {
  width: 20px;
  height: 20px;
  padding: 0;

  border-radius: 6px;
  border: 1px solid rgba(214,171,87,0.4);

  background:
    linear-gradient(180deg, #5a3a1c, #2a1b0e);

  color: #f3d28a;
  font-weight: 900;
  font-size: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow:
    inset 0 1px 0 rgba(255,230,180,0.1),
    0 1px 2px rgba(0,0,0,0.4);

  cursor: none !important;
}

.life-btn:hover {
  background:
    linear-gradient(180deg, #7a4e26, #3a2412);
  border-color: #d6a857;
}

.life-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.5);
}

/* couleurs spécifiques */
.life-btn.minus {
  color: #ff9a9a;
}

.life-btn.plus {
  color: #9aff9a;
}

.life-value.flash {
  animation: lifeFlash 0.25s ease;
}

@keyframes lifeFlash {
  0% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.life-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.life-player-name {
  font-weight: 700;
  color: #e7cf97;
  text-shadow: 0 1px 0 #000;
}

.life-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(60,40,20,0.9), rgba(20,14,8,0.95));
  border: 1px solid rgba(214,171,87,0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,230,180,0.08),
    0 0 6px rgba(0,0,0,0.3);
}

.life-heart {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  margin-right: 4px;
  background: linear-gradient(180deg, #ff6b6b 0%, #d11919 100%);
  clip-path: path("M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z");
  transform: scale(0.78);
  transform-origin: center;
  filter: drop-shadow(0 0 4px rgba(255, 40, 40, 0.35));
}

.life-value {
  min-width: 24px;
  text-align: center;
  font-weight: 900;
  font-size: 14px;
  color: #ffd86b;
  text-shadow:
    0 1px 0 #000,
    0 0 4px rgba(255,200,80,0.35);
}

.life-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  min-height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(214,171,87,0.4);
  background: linear-gradient(180deg, #5a3a1c, #2a1b0e);
  color: #f3d28a;
  font-weight: 900;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255,230,180,0.1),
    0 1px 2px rgba(0,0,0,0.4);
  cursor: none !important;
}

.life-btn:hover {
  background: linear-gradient(180deg, #7a4e26, #3a2412);
  border-color: #d6a857;
}

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

.life-btn.minus {
  color: #ffb0b0;
}

.life-btn.plus {
  color: #a9ffad;
}

/* états selon PV */
.life-controls.hp-high .life-heart {
  transform: scale(0.78);
  filter: drop-shadow(0 0 5px rgba(255, 70, 70, 0.35));
}

.life-controls.hp-mid .life-heart {
  transform: scale(0.68);
  filter: brightness(0.95);
}

.life-controls.hp-low .life-heart {
  transform: scale(0.58);
  background: linear-gradient(180deg, #ff4e4e 0%, #a10d0d 100%);
  filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.5));
}

.life-controls.hp-critical .life-heart {
  transform: scale(0.48);
  background: linear-gradient(180deg, #ff2020 0%, #7d0000 100%);
  animation: lifeHeartPulse 0.7s infinite;
}

@keyframes lifeHeartPulse {
  0%   { transform: scale(0.48); }
  50%  { transform: scale(0.58); }
  100% { transform: scale(0.48); }
}

.wow-auth-box {
  position: relative;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(54, 35, 17, 0.96), rgba(20, 13, 10, 0.96));
  border: 1px solid rgba(202, 159, 77, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 229, 163, 0.08),
    inset 0 0 18px rgba(255, 187, 77, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.28);
}

.wow-auth-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 217, 133, 0.05), transparent 22%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.16), transparent 28%);
}

.wow-auth-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.wow-auth-faction {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 223, 145, 0.16), rgba(0,0,0,0.16));
  border: 1px solid rgba(214, 170, 86, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 4px 10px rgba(0,0,0,0.22);
}

.wow-faction-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 6px rgba(255, 196, 90, 0.18));
}

.wow-auth-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wow-auth-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #c9a86a;
  font-weight: 800;
  text-shadow: 0 1px 0 #000;
}

.wow-auth-userline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wow-auth-username {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Cinzel", serif;
  font-size: 18px;
  color: #f4dfae;
  text-shadow:
    0 1px 0 #000,
    0 0 8px rgba(255, 195, 90, 0.08);
}

.wow-auth-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wow-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.2px;
  cursor: none !important;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  border: 1px solid transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,0.7);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.28),
    0 4px 12px rgba(0,0,0,0.18);
}

.wow-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.wow-btn:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.wow-btn-gold {
  color: #fff2c7;
  border-color: #cda355;
  background:
    linear-gradient(180deg, #b98b31 0%, #8c6621 44%, #5a3f13 100%);
}

.wow-btn-gold:hover {
  background:
    linear-gradient(180deg, #c79836 0%, #9d7426 44%, #674a16 100%);
}

.wow-btn-danger {
  color: #ffe2d3;
  border-color: #b98273;
  background:
    linear-gradient(180deg, #8a241d 0%, #671611 44%, #3d0c09 100%);
}

.wow-btn-danger:hover {
  background:
    linear-gradient(180deg, #9a2a22 0%, #751913 44%, #47100c 100%);
}

.wow-auth-subline {
  font-size: 12px;
  color: #d7c39a;
  opacity: 0.9;
}

.wow-auth-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a1a0f, #140c08);
  border: 1px solid rgba(202, 159, 77, 0.35);
}

/* icone faction */
.wow-faction-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 180, 80, 0.3));
}

/* texte */
.wow-auth-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

/* label */
.wow-auth-label {
  color: #c9a86a;
  font-weight: 700;
}

/* pseudo */
.wow-auth-username {
  font-family: "Cinzel", serif;
  color: #f4dfae;
  font-size: 14px;
}

/* petit sous-titre */
.wow-auth-subline {
  font-size: 10px;
  color: #a88b5c;
  opacity: 0.8;
}

/* boutons petits */
.wow-btn.small {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.wow-player-frame {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.15);
}

/* couleur équipe */
.wow-player-frame.p1 {
  border-color: rgba(80, 160, 255, 0.4);
}

.wow-player-frame.p2 {
  border-color: rgba(255, 80, 80, 0.4);
}

/* icône faction */
.wow-player-faction {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.8));
}

/* texte */
.wow-player-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.wow-player-name {
  font-weight: bold;
  font-size: 13px;
  color: #ffd100;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.4);
}

.wow-player-role {
  font-size: 11px;
  opacity: 0.7;
}

/* test barre dragon flight */
/* ═══ BOUTIQUE & HAUTS-FAITS ════════════════════════════════ */

.shop-modal-content {
  width: min(1100px, 92vw);
  max-width: 1100px;
}

.shop-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  max-height: 68vh;
}

.shop-gold-banner {
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(80, 60, 20, 0.9), rgba(40, 28, 10, 0.95));
  border: 1px solid rgba(212, 170, 86, 0.45);
  color: #ffd37a;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}





.shop-item.owned {
  border-color: rgba(46, 204, 113, 0.4);
  background: rgba(46, 204, 113, 0.06);
}

.shop-item-icon  { font-size: 32px; }
.shop-item-label { font-weight: 700; color: #f2e7c7; font-size: 13px; }
.shop-owned      { color: #67d98a; font-size: 13px; font-weight: 700; }

.shop-buy-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212,170,86,0.5);
  background: linear-gradient(180deg, #8c6621, #5a3f13);
  color: #f4dfae;
  font-weight: 800;
  cursor: none !important;
  transition: filter 0.15s ease;
}
.shop-buy-btn:hover { filter: brightness(1.1); }

.shop-loading {
  text-align: center;
  color: #d5dce8;
  padding: 24px;
}

/* ── Hauts-faits ── */

.ach-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffd37a;
  padding: 6px 0 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 4px;
}

.locked-title { color: #8a9ab5; }

.ach-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 0.15s ease;
}

.ach-card.unlocked {
  border-color: rgba(212,170,86,0.35);
  background: rgba(212,170,86,0.06);
}

.ach-card.locked { opacity: 0.55; }

.ach-card-icon   { font-size: 28px; flex: 0 0 36px; text-align: center; }
.ach-card-body   { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ach-card-body strong { color: #f2e7c7; font-size: 14px; }
.ach-card-body small  { color: #9fb0c7; font-size: 12px; }
.ach-date        { font-size: 11px; color: #7a9a6a; margin-top: 2px; }
.ach-card-reward { font-weight: 800; color: #ffd37a; white-space: nowrap; font-size: 13px; }

/* ── Popup fin de partie enrichie ── */

.reward-grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.reward-elo, .reward-gold {
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 20px;
}

.reward-elo  { color: #ffd37a; background: rgba(212,170,86,0.14); border: 1px solid rgba(212,170,86,0.35); }
.reward-gold { color: #a0e090; background: rgba(70,180,80,0.12);  border: 1px solid rgba(70,180,80,0.3); }

.reward-achievements-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffd37a;
  margin: 12px 0 6px;
}

.reward-achievement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(212,170,86,0.08);
  border: 1px solid rgba(212,170,86,0.22);
  margin-bottom: 6px;
}

.ach-icon  { font-size: 22px; }
.ach-text  { flex: 1; display: flex; flex-direction: column; }
.ach-text strong { color: #f2e7c7; font-size: 13px; }
.ach-text small  { color: #9fb0c7; font-size: 11px; }
.ach-gold  { font-weight: 800; color: #ffd37a; font-size: 13px; white-space: nowrap; }

/* ── Verrou playmat ── */

.playmat-thumb {
  position: relative;
}

.playmat-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}




.shop-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255, 196, 70, 0.18);
  border-radius: 14px;
  padding: 14px 16px;
}

.shop-item-left {
  flex: 1;
  min-width: 0;
}

.shop-playmat-img {
  display: block;
  width: 100%;
  max-width: 420px;
  /*height: 110px;*/
  height: 190px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

.shop-item-right {
  width: 170px;
  flex-shrink: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.shop-item-label {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #f3e7c1;
}

.shop-item-price {
  display: flex;
  justify-content: center;
  width: 100%;
}

.shop-buy-btn {
  min-width: 110px;
}

.shop-item.owned {
  opacity: 0.8;
}

.shop-modal-content {
  width: min(1100px, 92vw);
  max-width: 1100px;
}

.shop-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  max-height: 68vh;
}

.shop-gold-banner {
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(80, 60, 20, 0.9), rgba(40, 28, 10, 0.95));
  border: 1px solid rgba(212, 170, 86, 0.45);
  color: #ffd37a;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,170,86,0.18);
}

.shop-item.owned {
  border-color: rgba(46, 204, 113, 0.35);
  background: rgba(46, 204, 113, 0.06);
}

.shop-item-left {
  flex: 1;
  min-width: 0;
}

.shop-playmat-img {
  display: block;
  width: 100%;
  max-width: 700px;
  height: 270px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

.shop-item-right {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.shop-item-label {
  font-weight: 700;
  color: #f2e7c7;
  font-size: 22px;
  text-align: center;
}

.shop-item-price {
  display: flex;
  justify-content: center;
  width: 100%;
}

.shop-owned {
  color: #67d98a;
  font-size: 14px;
  font-weight: 700;
}

.shop-buy-btn {
  padding: 10px 18px;
  min-width: 120px;
  border-radius: 10px;
  border: 1px solid rgba(212,170,86,0.5);
  background: linear-gradient(180deg, #8c6621, #5a3f13);
  color: #f4dfae;
  font-weight: 800;
  cursor: none !important;
  transition: filter 0.15s ease;
}

.shop-buy-btn:hover {
  filter: brightness(1.1);
}

.shop-loading {
  text-align: center;
  color: #d5dce8;
  padding: 24px;
}

#toast-container {
  z-index: 9999999;
}

.toast {
  min-width: 240px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(12,16,22,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  animation: toastIn .18s ease;
}

.toast.success { border-color: rgba(70, 190, 110, 0.45); }
.toast.error { border-color: rgba(220, 80, 80, 0.45); }
.toast.info { background: rgba(60, 90, 160, 0.94); }

:root {
  --sidebar-w: 400px;
}

/* ───────── SIDEBAR GLOBAL ───────── */
#sidebar {
  background:
    radial-gradient(circle at top, rgba(255, 196, 83, 0.08), transparent 25%),
    linear-gradient(180deg, #2a1a10 0%, #17110d 55%, #0f0c09 100%);
  border-left: 1px solid rgba(215, 178, 90, 0.25);
  box-shadow:
    inset 1px 0 0 rgba(255, 223, 140, 0.08),
    inset 0 0 40px rgba(255, 183, 77, 0.05),
    -10px 0 24px rgba(0,0,0,0.45);

  padding: 8px;
  gap: 8px;
}

/* ───────── PANELS WOW STYLE ───────── */
.panel {
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(58, 39, 24, 0.95), rgba(20, 14, 10, 0.98));
  border: 1px solid rgba(212,169,86,0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 165, 0.05),
    inset 0 -1px 0 rgba(0,0,0,0.3);
}

.panel-header {
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #f1cf7a;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid rgba(212,169,86,0.12);
}

/* ───────── ACTIONS COMPACTES ───────── */
.sidebar-actions {
  padding: 8px;
  gap: 6px;
}

.sidebar-action-group {
  gap: 5px;
}

.sidebar-action-title {
  font-size: 10px;
  color: #e1be67;
  letter-spacing: 0.6px;
}

/* boutons en grille compacte */
.sidebar-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

/* boutons style WoW */
.sidebar-action-buttons button {
  min-height: 22px;
  padding: 3px 6px;
  font-size: 10px;
  border-radius: 7px;

  background: linear-gradient(180deg, #8f6a24, #5f4213);
  border: 1px solid rgba(210,172,92,0.45);
  color: #f4dfae;
  font-weight: 800;
}

.sidebar-action-buttons button:hover {
  filter: brightness(1.1);
}

/* ───────── PLAYMAT COMPACT ───────── */
.playmat-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.playmat-thumb {
  position: relative;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(212,169,86,0.25);
  background: rgba(0,0,0,0.3);
}

.playmat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playmat-thumb.active {
  border-color: #f0c96b;
  box-shadow: 0 0 10px rgba(255,200,90,0.2);
}

/* ───────── HISTORY PLUS COMPACT ───────── */
.history-log {
  font-size: 12px;
  gap: 6px;
  padding: 8px;
}

.history-entry {
  padding: 6px 8px;
  border-radius: 7px;
}

.shop-buy-btn.free {
  background: linear-gradient(180deg, #5f8f24, #3f5f13);
  border-color: rgba(170, 220, 120, 0.5);
  color: #eef7d2;
}

/* =====================================================
   WoW TCG SIDEBAR — THÈME WORLD OF WARCRAFT
   À ajouter APRÈS style.css dans votre index.html
   ===================================================== */

   @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

   /* ── Variables WoW enrichies ── */
   :root {
     --wow-sidebar-bg-top:    #1c1208;
     --wow-sidebar-bg-bot:    #0a0704;
     --wow-frame-border:      #c9a045;
     --wow-frame-border-soft: rgba(201,160,69,0.35);
     --wow-frame-inner:       rgba(201,160,69,0.12);
     --wow-corner-glow:       rgba(255,210,100,0.18);
     --wow-panel-bg:          rgba(14,9,4,0.85);
     --wow-panel-border:      rgba(180,130,40,0.4);
     --wow-title-color:       #f5d87a;
     --wow-title-shadow:      0 0 8px rgba(245,216,122,0.45), 0 1px 3px rgba(0,0,0,0.9);
     --wow-btn-grad-top:      #4a3210;
     --wow-btn-grad-bot:      #1e1408;
     --wow-btn-border:        #c49a3c;
     --wow-btn-hover-top:     #6b4a18;
     --wow-btn-hover-bot:     #2e1e0c;
     --wow-btn-glow:          rgba(212,160,60,0.35);
     --wow-danger-top:        #5c1510;
     --wow-danger-bot:        #250907;
     --wow-danger-border:     #c04040;
     --wow-log-bg:            rgba(8,5,2,0.7);
     --wow-log-entry:         rgba(40,28,10,0.6);
     --wow-log-border:        rgba(140,100,30,0.3);
     --wow-separator:         linear-gradient(90deg, transparent, rgba(201,160,69,0.5) 20%, rgba(255,210,100,0.7) 50%, rgba(201,160,69,0.5) 80%, transparent);
   }
   
   /* ── Sidebar container principal ── */
   #sidebar {
     background:
       radial-gradient(ellipse at top center, rgba(80,50,10,0.25) 0%, transparent 55%),
       radial-gradient(ellipse at bottom center, rgba(0,0,0,0.5) 0%, transparent 60%),
       linear-gradient(180deg, var(--wow-sidebar-bg-top) 0%, #110b04 40%, var(--wow-sidebar-bg-bot) 100%) !important;
     border-left: 1px solid var(--wow-frame-border) !important;
     box-shadow:
       inset 1px 0 0 rgba(255,220,120,0.08),
       inset 0 0 60px rgba(0,0,0,0.6),
       -4px 0 20px rgba(0,0,0,0.5) !important;
     font-family: 'Crimson Text', Georgia, serif !important;
     position: relative;
   }
   
   /* Bordure dorée intérieure */
   #sidebar::before {
     content: "";
     position: absolute;
     inset: 3px;
     border: 1px solid rgba(201,160,69,0.15);
     pointer-events: none;
     z-index: 0;
   }
   
   /* ── En-tête sidebar ── */
   .sidebar-header {
     padding: 10px 14px 8px !important;
     background: linear-gradient(180deg, rgba(60,38,10,0.9), rgba(25,15,4,0.95)) !important;
     border-bottom: 1px solid var(--wow-frame-border) !important;
     box-shadow: 0 2px 12px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,220,100,0.1) !important;
     position: relative;
   }
   
   .sidebar-header::after {
     content: "";
     position: absolute;
     bottom: 0; left: 8px; right: 8px; height: 1px;
     background: var(--wow-separator);
   }
   
   .sidebar-header strong {
     font-family: 'Cinzel', serif !important;
     font-size: 13px !important;
     font-weight: 700 !important;
     color: var(--wow-title-color) !important;
     text-shadow: var(--wow-title-shadow) !important;
     letter-spacing: 1.5px !important;
     text-transform: uppercase !important;
   }
   
   /* Bouton masquer */
   .sidebar-header button.alt {
     background: linear-gradient(180deg, #2e2010, #120c06) !important;
     border: 1px solid rgba(180,130,40,0.5) !important;
     color: #c9a045 !important;
     font-family: 'Cinzel', serif !important;
     font-size: 10px !important;
     font-weight: 600 !important;
     letter-spacing: 0.5px !important;
     border-radius: 4px !important;
     padding: 4px 8px !important;
     text-shadow: 0 1px 2px rgba(0,0,0,0.8) !important;
     transition: all 0.15s ease !important;
   }
   .sidebar-header button.alt:hover {
     background: linear-gradient(180deg, #3e2c14, #1c1008) !important;
     border-color: var(--wow-frame-border) !important;
     box-shadow: 0 0 8px var(--wow-btn-glow) !important;
   }
   
   /* ── Panneaux (details/summary) ── */
   .panel {
     background: var(--wow-panel-bg) !important;
     border: 1px solid var(--wow-panel-border) !important;
     border-radius: 6px !important;
     box-shadow:
       inset 0 1px 0 rgba(255,220,120,0.06),
       inset 0 0 20px rgba(0,0,0,0.4),
       0 2px 8px rgba(0,0,0,0.4) !important;
     overflow: hidden !important;
   }
   
   .panel-header {
     background: linear-gradient(180deg, rgba(55,34,8,0.9), rgba(22,13,4,0.95)) !important;
     border-bottom: 1px solid rgba(180,130,40,0.3) !important;
     padding: 7px 12px !important;
     font-family: 'Cinzel', serif !important;
     font-size: 11px !important;
     font-weight: 700 !important;
     color: var(--wow-title-color) !important;
     text-shadow: var(--wow-title-shadow) !important;
     letter-spacing: 1.2px !important;
     text-transform: uppercase !important;
     cursor: none !important;
     user-select: none !important;
     position: relative !important;
   }
   
   .panel-header::after {
     content: "▾";
     font-family: Arial, sans-serif;
     font-size: 10px;
     color: var(--wow-frame-border);
     opacity: 0.8;
     transition: transform 0.2s ease;
   }
   
   details.panel:not([open]) .panel-header::after {
     transform: rotate(-90deg);
   }
   
   /* ── Titres de section ── */
   .sidebar-action-title {
     font-family: 'Cinzel', serif !important;
     font-size: 10px !important;
     font-weight: 700 !important;
     color: var(--wow-frame-border) !important;
     text-shadow: 0 0 6px rgba(201,160,69,0.4) !important;
     letter-spacing: 1.8px !important;
     text-transform: uppercase !important;
     margin: 4px 0 2px !important;
     padding-bottom: 4px !important;
     position: relative !important;
   }
   
   .sidebar-action-title::after {
     content: "";
     position: absolute;
     bottom: 0; left: 0; right: 0; height: 1px;
     background: linear-gradient(90deg, transparent, rgba(201,160,69,0.4), transparent);
   }
   
   /* ── Boutons WoW (tous) ── */
   .sidebar-action-buttons button,
   .sidebar-actions button,
   .dice-panel button {
     background: linear-gradient(180deg, var(--wow-btn-grad-top) 0%, var(--wow-btn-grad-bot) 100%) !important;
     border: 1px solid var(--wow-btn-border) !important;
     border-bottom-color: rgba(100,70,15,0.8) !important;
     border-radius: 4px !important;
     color: #f0d88a !important;
     font-family: 'Cinzel', serif !important;
     font-size: 10px !important;
     font-weight: 600 !important;
     letter-spacing: 0.3px !important;
     text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(200,150,40,0.2) !important;
     padding: 5px 8px !important;
     min-height: 26px !important;
     cursor: none !important;
     position: relative !important;
     overflow: hidden !important;
     transition: all 0.12s ease !important;
     box-shadow: inset 0 1px 0 rgba(255,220,120,0.12), 0 2px 4px rgba(0,0,0,0.5) !important;
   }
   
   .sidebar-action-buttons button::before,
   .sidebar-actions button::before,
   .dice-panel button::before {
     content: "";
     position: absolute;
     top: 0; left: 0; right: 0;
     height: 40%;
     background: linear-gradient(180deg, rgba(255,220,120,0.08), transparent);
     pointer-events: none;
   }
   
   .sidebar-action-buttons button:hover,
   .sidebar-actions button:hover,
   .dice-panel button:hover {
     background: linear-gradient(180deg, var(--wow-btn-hover-top), var(--wow-btn-hover-bot)) !important;
     border-color: #e0b84a !important;
     color: #fff5c8 !important;
     box-shadow: 0 0 10px var(--wow-btn-glow), inset 0 1px 0 rgba(255,220,120,0.18), 0 2px 6px rgba(0,0,0,0.6) !important;
     transform: translateY(-1px) !important;
   }
   
   .sidebar-action-buttons button:active,
   .sidebar-actions button:active,
   .dice-panel button:active {
     transform: translateY(0px) !important;
     box-shadow: inset 0 2px 4px rgba(0,0,0,0.4) !important;
   }
   
   /* Bouton READY spécial */
   #ready-btn {
     background: linear-gradient(180deg, #1a4a1a, #0a200a) !important;
     border-color: #3a7a3a !important;
     color: #90e890 !important;
     text-shadow: 0 0 8px rgba(80,220,80,0.4) !important;
   }
   #ready-btn:hover {
     background: linear-gradient(180deg, #254a25, #122012) !important;
     box-shadow: 0 0 10px rgba(80,200,80,0.35) !important;
   }
   
   /* Bouton Concéder — danger */
   button.danger-btn,
   .sidebar-action-buttons button[onclick*="concede"],
   .sidebar-action-buttons button[data-i18n="sidebar_concede"] {
     background: linear-gradient(180deg, var(--wow-danger-top), var(--wow-danger-bot)) !important;
     border-color: var(--wow-danger-border) !important;
     color: #ffaaaa !important;
     text-shadow: 0 0 6px rgba(255,80,80,0.35) !important;
   }
   button.danger-btn:hover,
   .sidebar-action-buttons button[onclick*="concede"]:hover,
   .sidebar-action-buttons button[data-i18n="sidebar_concede"]:hover {
     background: linear-gradient(180deg, #7a1c18, #320c0a) !important;
     box-shadow: 0 0 10px rgba(200,60,60,0.35) !important;
   }
   
   /* Bouton Mulligan */
   #mulligan-btn {
     background: linear-gradient(180deg, #2a1a5a, #100a28) !important;
     border-color: #6a4aaa !important;
     color: #c8aaff !important;
     text-shadow: 0 0 6px rgba(160,100,255,0.35) !important;
   }
   #mulligan-btn:hover {
     background: linear-gradient(180deg, #3a2470, #180e3a) !important;
     box-shadow: 0 0 10px rgba(140,80,255,0.3) !important;
   }
   
   /* ── Checkbox ranked toggle ── */
   .ranked-toggle-row {
     display: flex !important;
     align-items: center !important;
     gap: 6px !important;
     font-family: 'Crimson Text', serif !important;
     font-size: 13px !important;
     color: #c4a868 !important;
     cursor: none !important;
   }
   .ranked-toggle-row input[type="checkbox"] {
     accent-color: #c9a045 !important;
     width: 14px !important;
     height: 14px !important;
   }
   
   /* ── Playmat picker ── */
   .playmat-picker {
     display: flex !important;
     flex-wrap: wrap !important;
     gap: 5px !important;
     padding: 6px !important;
     background: rgba(0,0,0,0.4) !important;
     border: 1px solid rgba(180,130,40,0.2) !important;
     border-radius: 5px !important;
   }
   
   .playmat-thumb {
     width: 42px !important;
     height: 30px !important;
     border-radius: 3px !important;
     border: 1px solid rgba(180,130,40,0.35) !important;
     background: linear-gradient(180deg, #2a1c0c, #110c06) !important;
     padding: 0 !important;
     overflow: hidden !important;
     cursor: none !important;
     transition: all 0.15s ease !important;
     min-height: unset !important;
     font-size: 11px !important;
     color: #c9a045 !important;
     box-shadow: inset 0 1px 0 rgba(255,220,120,0.08) !important;
   }
   
   .playmat-thumb img {
     width: 100% !important;
     height: 100% !important;
     object-fit: cover !important;
     display: block !important;
   }
   
   .playmat-thumb:hover {
     border-color: var(--wow-frame-border) !important;
     box-shadow: 0 0 6px var(--wow-btn-glow) !important;
     transform: scale(1.08) !important;
   }
   
   .playmat-thumb.active {
     border: 2px solid var(--wow-frame-border) !important;
     box-shadow: 0 0 8px var(--wow-btn-glow), inset 0 0 4px rgba(255,200,80,0.1) !important;
   }
   
   /* Opacité playmat */
   .playmat-opacity-inline {
     display: flex !important;
     align-items: center !important;
     gap: 6px !important;
   }
   .playmat-opacity-label {
     font-family: 'Crimson Text', serif !important;
     font-size: 12px !important;
     color: #9a8060 !important;
     min-width: 40px !important;
   }
   .playmat-opacity-range {
     flex: 1 !important;
     accent-color: #c9a045 !important;
     background: transparent !important;
     border: none !important;
     padding: 0 !important;
     height: 16px !important;
   }
   .playmat-opacity-value {
     font-family: 'Cinzel', serif !important;
     font-size: 10px !important;
     color: var(--wow-frame-border) !important;
     min-width: 30px !important;
     text-align: right !important;
   }
   
   /* ── Sélecteur langue ── */
   .wow-sidebar-topbar {
     margin-bottom: 4px !important;
   }
   .wow-lang-row {
     display: flex !important;
     align-items: center !important;
     gap: 6px !important;
   }
   .wow-lang-label {
     font-family: 'Cinzel', serif !important;
     font-size: 10px !important;
     color: #9a8060 !important;
     letter-spacing: 0.5px !important;
   }
   #language-select {
     background: linear-gradient(180deg, #2a1c0c, #110c06) !important;
     border: 1px solid rgba(180,130,40,0.4) !important;
     border-radius: 4px !important;
     color: #e0c070 !important;
     font-size: 14px !important;
     padding: 2px 4px !important;
     cursor: none !important;
   }
   
   /* ── Dé 3D ── */
   .dice-panel {
     padding: 4px 0 !important;
   }
   .dice-box {
     background: rgba(8,5,2,0.85) !important;
     border: 1px solid rgba(180,130,40,0.3) !important;
     border-radius: 6px !important;
     padding: 10px !important;
     margin-top: 6px !important;
     box-shadow: inset 0 0 20px rgba(0,0,0,0.5) !important;
   }
   .dice-result-label {
     font-family: 'Cinzel', serif !important;
     font-size: 13px !important;
     color: var(--wow-title-color) !important;
     text-shadow: var(--wow-title-shadow) !important;
     text-align: center !important;
   }
   
   /* Faces du dé */
   .dice-face {
     background: linear-gradient(135deg, #3a2810, #1c1208) !important;
     border: 1px solid rgba(180,130,40,0.5) !important;
     color: #f0d070 !important;
     text-shadow: 0 0 6px rgba(240,208,112,0.4) !important;
   }
   
   /* ── Historique ── */
   .history-panel {
     background: var(--wow-log-bg) !important;
     border-color: rgba(140,100,30,0.25) !important;
   }
   
   .history-log {
     scrollbar-color: rgba(180,130,40,0.4) rgba(0,0,0,0.3) !important;
   }
   
   .history-entry {
     background: var(--wow-log-entry) !important;
     border: 1px solid var(--wow-log-border) !important;
     border-radius: 4px !important;
   }
   
   .history-entry.alert {
     background: rgba(100,20,18,0.5) !important;
     border-color: rgba(180,60,60,0.4) !important;
   }
   
   .history-time {
     font-family: 'Cinzel', serif !important;
     font-size: 9px !important;
     color: rgba(180,140,50,0.6) !important;
     letter-spacing: 0.5px !important;
   }
   
   .history-text {
     font-family: 'Crimson Text', serif !important;
     font-size: 13px !important;
     color: #d4c298 !important;
     line-height: 1.4 !important;
   }
   
   .history-entry.alert .history-text {
     color: #ffb0a0 !important;
   }
   
   /* ── Auth sidebar ── */
   .sidebar-auth {
     background: rgba(20,12,4,0.8) !important;
     border: 1px solid rgba(180,130,40,0.25) !important;
     border-radius: 5px !important;
   }
   .sidebar-auth-name {
     font-family: 'Cinzel', serif !important;
     font-size: 11px !important;
     color: var(--wow-title-color) !important;
     text-shadow: 0 0 5px rgba(240,200,80,0.3) !important;
   }
   
   /* ── Status salle ── */
   #room-live-status {
     font-family: 'Crimson Text', serif !important;
     font-size: 13px !important;
     color: #a0c888 !important;
   }
   
   /* ── Scrollbar dorée ── */
   #sidebar ::-webkit-scrollbar { width: 6px; height: 6px; }
   #sidebar ::-webkit-scrollbar-track { background: rgba(0,0,0,0.4); border-radius: 3px; }
   #sidebar ::-webkit-scrollbar-thumb {
     background: linear-gradient(180deg, #c9a045, #7a5a1a);
     border-radius: 3px;
   }
   #sidebar ::-webkit-scrollbar-thumb:hover {
     background: linear-gradient(180deg, #e0b855, #9a7025);
   }
   
   /* ── Bouton rouvrir sidebar ── */
   .sidebar-reopen-btn {
     background: linear-gradient(180deg, #3a2810, #1a1006) !important;
     border: 1px solid var(--wow-btn-border) !important;
     color: #f0d070 !important;
     font-family: 'Cinzel', serif !important;
     font-size: 11px !important;
     box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 8px rgba(200,150,40,0.2) !important;
   }
   
   /* ── Animations d'ornements ── */
   @keyframes wowGlow {
     0%, 100% { opacity: 0.6; }
     50% { opacity: 1; }
   }
   
   .sidebar-action-title {
     animation: wowGlow 3s ease-in-out infinite;
   }

   /* ============================================================
   PATCH 1 — READY STATUS : bouton + badges P1/P2 propres
   ============================================================ */

/* Conteneur du bloc ready */
.game-controls {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  width: 100% !important;
}

/* Bouton READY — pleine largeur, bien visible */
#ready-btn {
  width: 100% !important;
  min-height: 30px !important;
  padding: 6px 10px !important;
  font-family: 'Cinzel', serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  background: linear-gradient(180deg, #1a4a1a, #0a200a) !important;
  border: 1px solid #3a7a3a !important;
  border-radius: 4px !important;
  color: #90e890 !important;
  text-shadow: 0 0 8px rgba(80,220,80,0.4) !important;
  box-shadow: inset 0 1px 0 rgba(120,255,120,0.1), 0 2px 4px rgba(0,0,0,0.5) !important;
  cursor: none !important;
  transition: all 0.15s ease !important;
}
#ready-btn:hover {
  background: linear-gradient(180deg, #254a25, #122012) !important;
  box-shadow: 0 0 10px rgba(80,200,80,0.3), inset 0 1px 0 rgba(120,255,120,0.15) !important;
}

/* Zone statut P1 / P2 — deux badges côte à côte */
#ready-status {
  display: flex !important;
  gap: 5px !important;
  width: 100% !important;

  /* Le JS met du texte brut : on le cache et on affiche
     via les pseudo-éléments quand les classes sont présentes.
     MAIS comme le JS écrit du texte (pas des classes), on stylise
     directement le span comme une barre de statut lisible. */
  font-family: 'Cinzel', serif !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  color: #c4a868 !important;
  background: rgba(0,0,0,0.35) !important;
  border: 1px solid rgba(180,130,40,0.2) !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  text-align: center !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: 22px !important;
  line-height: 1.4 !important;
  white-space: pre-wrap !important;   /* garde les espaces/sauts du JS */
  word-break: break-word !important;
}

/* ============================================================
   PATCH 2 — DRAWER HISTORIQUE (aside coulissant)
   ============================================================ */

/* L'aside historique : un panneau qui glisse par-dessus le jeu,
   ancré sur le côté droit (bord gauche de la sidebar).
   Position: fixed pour ne pas perturber le layout.           */

#history-drawer {
  position: fixed !important;
  top: 0 !important;
  right: var(--sidebar-w, 332px) !important;  /* collé à gauche de la sidebar */
  width: 320px !important;
  height: 100vh !important;
  z-index: 190000 !important;
  display: flex !important;
  flex-direction: column !important;
  pointer-events: none !important;

  /* Glisse vers la droite quand fermé (hors écran à gauche) */
  transform: translateX(0) !important;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity  0.22s ease !important;
  opacity: 1 !important;
}

/* État fermé */
#history-drawer.drawer-closed {
  transform: translateX(100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Fond du drawer */
#history-drawer-inner {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  pointer-events: auto !important;

  background:
    radial-gradient(ellipse at top, rgba(60,38,10,0.18), transparent 50%),
    linear-gradient(180deg, #1c1208 0%, #0e0904 100%) !important;
  border-left: 1px solid var(--wow-frame-border, #c9a045) !important;
  border-right: 1px solid rgba(201,160,69,0.2) !important;
  box-shadow:
    -6px 0 24px rgba(0,0,0,0.6),
    inset 1px 0 0 rgba(255,220,120,0.06) !important;
}

/* Header du drawer */
#history-drawer-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 14px !important;
  background: linear-gradient(180deg, rgba(60,38,10,0.95), rgba(22,13,4,0.98)) !important;
  border-bottom: 1px solid var(--wow-frame-border, #c9a045) !important;
  flex: 0 0 auto !important;
  position: relative !important;
}

#history-drawer-header::after {
  content: "" !important;
  position: absolute !important;
  bottom: 0; left: 10px; right: 10px; height: 1px !important;
  background: linear-gradient(90deg, transparent, rgba(255,210,100,0.5) 50%, transparent) !important;
}

#history-drawer-title {
  font-family: 'Cinzel', serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #f5d87a !important;
  text-shadow: 0 0 8px rgba(245,216,122,0.45), 0 1px 3px rgba(0,0,0,0.9) !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
}

#history-drawer-close {
  font-family: 'Cinzel', serif !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  color: #c9a045 !important;
  background: linear-gradient(180deg, #2e2010, #120c06) !important;
  border: 1px solid rgba(180,130,40,0.5) !important;
  border-radius: 3px !important;
  padding: 3px 8px !important;
  cursor: none !important;
  transition: all 0.12s !important;
  min-height: unset !important;
}
#history-drawer-close:hover {
  border-color: #c9a045 !important;
  box-shadow: 0 0 6px rgba(201,160,69,0.3) !important;
}

/* Log dans le drawer */
#history-drawer .history-log {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 10px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(180,130,40,0.4) rgba(0,0,0,0.3) !important;
}

#history-drawer .history-log::-webkit-scrollbar { width: 6px; }
#history-drawer .history-log::-webkit-scrollbar-track { background: rgba(0,0,0,0.4); }
#history-drawer .history-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c9a045, #7a5a1a);
  border-radius: 3px;
}

/* Bouton "Ouvrir l'historique" dans la sidebar */
#history-toggle-btn {
  width: 100% !important;
  text-align: center !important;
  background: linear-gradient(180deg, #2a1a08, #100a04) !important;
  border: 1px solid rgba(180,130,40,0.45) !important;
  border-radius: 4px !important;
  color: #c9a045 !important;
  font-family: 'Cinzel', serif !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.8px !important;
  padding: 6px 10px !important;
  min-height: 28px !important;
  cursor: none !important;
  transition: all 0.15s !important;
  text-shadow: 0 0 5px rgba(201,160,69,0.35) !important;
  box-shadow: inset 0 1px 0 rgba(255,220,120,0.08) !important;
}
#history-toggle-btn:hover {
  background: linear-gradient(180deg, #3a2810, #180e06) !important;
  border-color: #c9a045 !important;
  box-shadow: 0 0 8px rgba(201,160,69,0.25), inset 0 1px 0 rgba(255,220,120,0.1) !important;
}
#history-toggle-btn.drawer-open {
  background: linear-gradient(180deg, #1a1a3a, #0a0a18) !important;
  border-color: #6a6aaa !important;
  color: #aaaaff !important;
  text-shadow: 0 0 5px rgba(150,150,255,0.35) !important;
}

/* Backdrop semi-transparent derrière le drawer (optionnel,
   cliquer dessus ferme le drawer) */
#history-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 189999 !important;
  background: rgba(0,0,0,0) !important;  /* transparent, juste pour catcher les clics */
  pointer-events: none !important;
  transition: background 0.22s ease !important;
}
#history-drawer-backdrop.active {
  pointer-events: auto !important;
}

/* Sur écrans < 1100px la sidebar disparaît :
   le drawer s'ancre alors à droite de l'écran */
@media (max-width: 1100px) {
  #history-drawer {
    right: 0 !important;
  }
}

/* Quand la sidebar est collapsed, right: 0 */
body.sidebar-collapsed #history-drawer {
  right: 0 !important;
}

/* ============================================================
   CACHE le history-panel original dans la sidebar
   (on le déplace dans le drawer via JS)
   ============================================================ */
.history-panel-in-sidebar {
  display: none !important;
}

 /* ── Layout : 3 colonnes quand historique ouvert ──────── */
 #layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) var(--sidebar-w, 332px);
  transition: grid-template-columns 0.28s ease;
}
body.sidebar-collapsed #layout {
  grid-template-columns: minmax(0,1fr) 0;
}
/* Le history-aside est en dehors du grid, positionné en fixed */

/* ── Aside Historique ─────────────────────────────────── */
#history-aside {
  position: fixed;
  top: 0;
  right: var(--sidebar-w, 332px);
  width: 320px;
  height: 100vh;
  z-index: 190000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1c1208 0%, #0e0904 100%);
  border-left: 1px solid #c9a045;
  box-shadow: -6px 0 24px rgba(0,0,0,0.65), inset 1px 0 0 rgba(255,220,120,0.06);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#history-aside.history-aside-closed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body.sidebar-collapsed #history-aside {
  right: 0;
}
@media (max-width: 1100px) {
  #history-aside { right: 0 !important; }
}

.history-aside-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(60,38,10,0.97), rgba(22,13,4,0.99));
  border-bottom: 1px solid #c9a045;
  position: relative;
}
.history-aside-header::after {
  content: "";
  position: absolute;
  bottom: 0; left: 10px; right: 10px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,210,100,0.5) 50%, transparent);
}
.history-aside-header strong {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: #f5d87a;
  text-shadow: 0 0 8px rgba(245,216,122,0.45), 0 1px 3px rgba(0,0,0,0.9);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.history-aside-header .alt {
  font-family: 'Cinzel', serif !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  color: #c9a045 !important;
  background: linear-gradient(180deg, #2e2010, #120c06) !important;
  border: 1px solid rgba(180,130,40,0.5) !important;
  border-radius: 3px !important;
  padding: 4px 9px !important;
  min-height: unset !important;
  letter-spacing: 0.5px !important;
}
.history-aside-header .alt:hover {
  border-color: #c9a045 !important;
  box-shadow: 0 0 6px rgba(201,160,69,0.3) !important;
}
#history-aside .history-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(180,130,40,0.4) rgba(0,0,0,0.3);
}
#history-aside .history-log::-webkit-scrollbar { width: 6px; }
#history-aside .history-log::-webkit-scrollbar-track { background: rgba(0,0,0,0.4); }
#history-aside .history-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c9a045, #7a5a1a);
  border-radius: 3px;
}

/* ── Boutons topbar ───────────────────────────────────── */
.topbar-panel-btn {
  min-height: 30px !important;
  padding: 5px 10px !important;
  border-radius: 8px !important;
  border: 1px solid #9d6f36 !important;
  background: linear-gradient(180deg, var(--wow-classic-red-top,#6b1f1f) 0%, var(--wow-classic-red-mid,#4a1515) 44%, var(--wow-classic-red-bot,#2d0d0d) 100%) !important;
  color: var(--wow-classic-gold-light, #f5d87a) !important;
  font-family: 'Cinzel', serif !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  text-shadow: 0 1px 0 rgba(0,0,0,0.95) !important;
  box-shadow: inset 0 1px 0 rgba(255,203,203,0.16), inset 0 -1px 0 rgba(0,0,0,0.35) !important;
  transition: filter 0.12s ease, transform 0.08s ease !important;
  cursor: none !important;
}
.topbar-panel-btn:hover {
  filter: brightness(1.15) !important;
  transform: translateY(-1px) !important;
}
/* Le bouton "Actions" est masqué quand le sidebar est visible */
#sidebar-reopen-btn {
  display: none;
}
body.sidebar-collapsed #sidebar-reopen-btn {
  display: inline-flex !important;
  align-items: center !important;
}
/* Le bouton Historique lui est TOUJOURS visible */
#history-topbar-btn {
  display: inline-flex !important;
  align-items: center !important;
}
#history-topbar-btn.history-open {
  background: linear-gradient(180deg, #1a1a3a, #0a0a18) !important;
  border-color: #6a6aaa !important;
  color: #aaaaee !important;
}



/* Empêche le curseur natif (main, texte, etc.) de remplacer le custom cursor */
*,
*::before,
*::after {
  cursor: none !important;
}

a,
button,
input[type="checkbox"],
input[type="radio"],
select,
summary,
[onclick],
[role="button"],
.table-card,
.hero-card-image,
.hand-card,
.resource-card,
.attached-card,
.ally-attached-card,
.room-badge-copy,
.playmat-thumb,
label {
  cursor: none !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
  cursor: text !important;
}

/* ===== ASIDE HISTORIQUE & LOG ===== */
#history-aside {
  position: fixed;
  top: var(--topbar-h, 52px);
  right: 0;
  width: 320px;
  height: calc(100vh - var(--topbar-h, 52px));
  background:
    radial-gradient(circle at top, rgba(255, 196, 83, 0.06), transparent 26%),
    linear-gradient(180deg, var(--wow-panel-top), var(--wow-panel-bottom));
  border-left: 1px solid rgba(212, 169, 86, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 900;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.6);
}

#history-aside.hidden {
  display: none;
}

.history-aside-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(212, 169, 86, 0.2);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.history-aside-header strong {
  color: var(--wow-gold, #d4a956);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#history-aside .history-panel {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#history-aside .history-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

/* Bouton Historique & Log dans la topbar */
#history-aside-btn {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #9d6f36 !important;
  background: linear-gradient(180deg, var(--wow-classic-red-top, #8f1a16) 0%, var(--wow-classic-red-mid, #6b1210) 44%, var(--wow-classic-red-bot, #3e0b0a) 100%) !important;
  color: var(--wow-classic-gold-light, #f0d18a) !important;
  font-weight: 800;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 203, 203, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 213, 120, 0.04);
  transition: filter 0.12s ease, transform 0.08s ease;
}


*,
*::before,
*::after {
  cursor: none !important;
}

a,
button,
input[type="checkbox"],
input[type="radio"],
select,
summary,
[onclick],
[role="button"],
.table-card,
.hero-card-image,
.hand-card,
.resource-card,
.attached-card,
.ally-attached-card,
.room-badge-copy,
.playmat-thumb,
label {
  cursor: none !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
  cursor: text !important;
}

*, *::before, *::after {
  cursor: none !important;
}

/* ===== CUSTOM CURSOR FINAL — NE PAS MODIFIER ===== */
*, *::before, *::after { cursor: none !important; }


/* ===== MODALES WOW — LEADERBOARD / PROFIL / HISTORIQUE ===== */


.wow-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
}

.wow-modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top, rgba(255, 230, 170, 0.05), transparent 60%),
    linear-gradient(180deg, #1e1a14, #14110d);
  border: 2px solid #c9a65c;
  border-radius: 14px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.7),
    inset 0 0 20px rgba(0, 0, 0, 0.7);
  color: #f2e7c7;
  overflow: hidden;
}

.wow-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(180deg, #2d261b, #1b1610);
  border-bottom: 1px solid rgba(255, 215, 140, 0.25);
  flex-shrink: 0;
}

.wow-modal-header strong {
  font-size: 18px;
  font-weight: 800;
  color: #f1d79a;
  text-shadow: 0 1px 0 #000;
  letter-spacing: 0.4px;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
}

.wow-modal-header button {
  min-width: 32px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #9d6f36 !important;
  background: linear-gradient(180deg, #9d1e17, #7c1511 44%, #4f0d0a) !important;
  color: #f1d79a !important;
  font-weight: 800;
  font-size: 14px;
}

.wow-modal-header button:hover {
  filter: brightness(1.2);
}

.wow-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.wow-modal-body::-webkit-scrollbar { width: 10px; }
.wow-modal-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.35); }
.wow-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(#caa85a, #8b6d2e);
  border-radius: 10px;
}
.wow-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(#e0bf73, #a58236);
}

/* ===== MATCH END — STYLE WOW ===== */
.match-end-card {
  background:
    radial-gradient(circle at top, rgba(255, 230, 170, 0.05), transparent 60%),
    linear-gradient(180deg, #1e1a14, #14110d);
  border: 2px solid #c9a65c;
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    inset 0 0 20px rgba(0, 0, 0, 0.6);
  color: #f2e7c7;
  padding: 36px 40px;
}

.match-end-card.win {
  border-color: #4cff9a;
  box-shadow: 0 0 40px rgba(80, 255, 150, 0.3), 0 20px 60px rgba(0,0,0,0.8);
}

.match-end-card.lose {
  border-color: #ff6b6b;
  box-shadow: 0 0 40px rgba(255, 80, 80, 0.3), 0 20px 60px rgba(0,0,0,0.8);
}

.match-end-actions button {
  border: 1px solid #9d6f36 !important;
  background: linear-gradient(180deg, #9d1e17, #7c1511 44%, #4f0d0a) !important;
  color: #f1d79a !important;
  font-weight: 800;
  border-radius: 8px;
  padding: 8px 20px;
}

.match-end-actions button:hover {
  filter: brightness(1.2);
}

/* ===== OPPONENT HAND INFO BAR ===== */
#opponent-hand-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--wow-classic-gold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 0 #000;
  opacity: 0.85;
}

#opponent-hand-count {
  font-size: 11px;
  font-weight: 800;
  color: #f2e7c7;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 1px 8px;
}

.meta-box {
  font-size: 11px;
  color: var(--muted);
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 2px 10px;
  letter-spacing: 0.2px;
}

.meta-box span[id] {
  color: #fff4c2;
  font-weight: 800;
}

/* ===== TURN BOX & ROOM BADGE — STYLE WOW CLASSIC ===== */
.turn-box {
  background:
    radial-gradient(circle at top, rgba(255, 196, 83, 0.07), transparent 70%),
    linear-gradient(180deg, var(--wow-classic-panel-top), var(--wow-classic-panel-bot));
  border: 1px solid rgba(210, 158, 58, 0.35);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 4px 16px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255, 220, 140, 0.07);
  border-radius: 10px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--wow-classic-gold-light);
  text-shadow: 0 1px 0 #000;
  gap: 10px;
  padding: 0 12px;
}

#turn-number {
  color: #fff8e1;
  font-size: 14px;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 220, 100, 0.4), 0 1px 0 #000;
}

#turn-player {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(212, 169, 86, 0.12);
  border: 1px solid rgba(212, 169, 86, 0.3);
  color: var(--wow-classic-gold-light);
  text-shadow: 0 1px 0 #000;
  letter-spacing: 0.3px;
}

.turn-box.my-turn {
  border-color: rgba(107, 214, 130, 0.4);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 0 18px rgba(107, 214, 130, 0.15),
    0 4px 16px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(107, 214, 130, 0.06);
}

.turn-box.my-turn #turn-player {
  background: rgba(107, 214, 130, 0.14);
  border-color: rgba(107, 214, 130, 0.35);
  color: #9cf0aa;
}

.turn-box.opponent-turn #turn-player {
  background: rgba(255, 100, 100, 0.12);
  border-color: rgba(255, 100, 100, 0.28);
  color: #ffb3b3;
}

/* Son & Discord */
.sound-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(210, 158, 58, 0.25) !important;
  background: linear-gradient(180deg, rgba(51, 35, 14, 0.9), rgba(25, 17, 8, 0.95)) !important;
  color: var(--wow-classic-gold) !important;
  font-size: 14px;
  transition: filter 0.12s ease, transform 0.08s ease;
}

.sound-toggle-btn:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(71, 50, 18, 0.95), rgba(38, 25, 10, 0.98)) !important;
}

.sound-toggle-btn.muted {
  opacity: 0.6;
  border-color: rgba(255, 80, 80, 0.3) !important;
}

.sound-toggle-btn.discord-toggle {
  background: linear-gradient(180deg, rgba(51, 35, 14, 0.9), rgba(25, 17, 8, 0.95)) !important;
  border: 1px solid rgba(210, 158, 58, 0.25) !important;
  color: var(--wow-classic-gold) !important;
  border-radius: 8px !important;
}

.sound-toggle-btn.discord-toggle:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.sound-toggle-btn.discord-toggle.is-muted {
  opacity: 0.6;
  border-color: rgba(255, 80, 80, 0.3) !important;
  color: #ff9090 !important;
}

/* Room badge */
.room-badge {
  background:
    radial-gradient(circle at top, rgba(255, 196, 83, 0.07), transparent 70%),
    linear-gradient(180deg, var(--wow-classic-panel-top), var(--wow-classic-panel-bot));
  border: 1px solid rgba(210, 158, 58, 0.35);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 4px 16px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255, 220, 140, 0.07);
  border-radius: 10px;
  gap: 6px;
  padding: 0 12px;
}

.room-badge-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--wow-classic-gold);
  text-shadow: 0 1px 0 #000;
  opacity: 0.8;
}

#room-code-display {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 900;
  color: #fff8e1;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255, 220, 100, 0.3), 0 1px 0 #000;
}

.room-badge-copy {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(210, 158, 58, 0.25) !important;
  background: linear-gradient(180deg, rgba(51, 35, 14, 0.9), rgba(25, 17, 8, 0.95)) !important;
  font-size: 12px;
  transition: filter 0.12s ease, transform 0.08s ease;
}

.room-badge-copy:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
  border-color: rgba(210, 158, 58, 0.5) !important;
}

/* ===== DISCORD JOIN BUTTON ===== */
.discord-join-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 0 #000;
  color: #c9d1ff;
  background:
    radial-gradient(circle at top, rgba(88, 101, 242, 0.15), transparent 70%),
    linear-gradient(180deg, rgba(40, 43, 80, 0.95), rgba(20, 22, 48, 0.98));
  border: 1px solid rgba(88, 101, 242, 0.45);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 4px 16px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(140, 150, 255, 0.08);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.discord-join-btn:hover {
  filter: brightness(1.25);
  transform: translateY(-1px);
  border-color: rgba(88, 101, 242, 0.7);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 0 16px rgba(88, 101, 242, 0.25),
    0 6px 18px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(140, 150, 255, 0.1);
}

.discord-join-btn:active {
  transform: translateY(0px);
  filter: brightness(1.05);
}

.discord-join-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: #8891f2;
  transition: fill 0.15s ease;
  filter: drop-shadow(0 0 4px rgba(88, 101, 242, 0.5));
}

.discord-join-btn:hover .discord-join-icon {
  fill: #aab3ff;
  filter: drop-shadow(0 0 6px rgba(88, 101, 242, 0.8));
}

/* ===== PAYPAL DONATE BUTTON ===== */
.paypal-donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 14px;
  border-radius: 8px;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 0 #000;
  color: #ffe4a0;
  background:
    radial-gradient(circle at top, rgba(255, 196, 57, 0.15), transparent 70%),
    linear-gradient(180deg, rgba(60, 45, 10, 0.95), rgba(30, 22, 5, 0.98));
  border: 1px solid rgba(255, 180, 30, 0.45);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 4px 16px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255, 220, 100, 0.08);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.paypal-donate-btn:hover {
  filter: brightness(1.25);
  transform: translateY(-1px);
  border-color: rgba(255, 180, 30, 0.7);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 0 16px rgba(255, 180, 30, 0.25),
    0 6px 18px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255, 220, 100, 0.1);
}

.paypal-donate-btn:active {
  transform: translateY(0px);
  filter: brightness(1.05);
}

.paypal-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: #f0a500;
  transition: fill 0.15s ease;
  filter: drop-shadow(0 0 4px rgba(255, 180, 30, 0.5));
}

.paypal-donate-btn:hover .paypal-icon {
  fill: #ffc844;
  filter: drop-shadow(0 0 6px rgba(255, 180, 30, 0.8));
}

/* ===== MATCH START BANNER ===== */
.match-start-banner {
  position: fixed;
  inset: 0;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.7) 0%, transparent 70%);
  animation: matchBannerFadeIn 0.4s ease forwards;
}

.match-start-banner.hiding {
  animation: matchBannerFadeOut 0.7s ease forwards;
}

@keyframes matchBannerFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes matchBannerFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.match-start-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: matchBannerSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes matchBannerSlideUp {
  from { transform: translateY(30px) scale(0.92); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.match-start-pvp {
  width: 120px;
  height: auto;
  filter:
    drop-shadow(0 0 18px rgba(255, 180, 30, 0.7))
    drop-shadow(0 0 40px rgba(255, 120, 0, 0.4));
  animation: matchPvpPulse 1.5s ease-in-out infinite alternate;
}

@keyframes matchPvpPulse {
  from { filter: drop-shadow(0 0 18px rgba(255, 180, 30, 0.7)) drop-shadow(0 0 40px rgba(255, 120, 0, 0.4)); }
  to   { filter: drop-shadow(0 0 28px rgba(255, 200, 60, 0.95)) drop-shadow(0 0 60px rgba(255, 140, 0, 0.6)); }
}

.match-start-title {
  font-family: 'Cinzel', serif;
  font-size: 42px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #fff8e1;
  text-shadow:
    0 0 20px rgba(255, 200, 60, 0.8),
    0 0 50px rgba(255, 140, 0, 0.5),
    0 2px 0 #000;
}

.match-start-sub {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--wow-classic-gold);
  text-shadow: 0 1px 0 #000, 0 0 12px rgba(255, 180, 30, 0.4);
  opacity: 0.9;
}

/* ===== TURN BANNER WOW ===== */
.turn-banner {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px 4px 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(40, 28, 10, 0.92), rgba(18, 12, 4, 0.95));
  border: 1px solid rgba(210, 158, 58, 0.5);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.5),
    0 2px 10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255, 220, 140, 0.07);
  color: var(--wow-classic-gold-light);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 0 #000;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  opacity: 0.88;
  transition: opacity 0.2s ease;
}

.turn-banner:hover {
  opacity: 1;
}

.turn-banner.turn-banner-hidden {
  display: none;
}

.turn-banner-close {
  width: 16px !important;
  height: 16px !important;
  min-height: unset !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1px solid rgba(210, 158, 58, 0.3) !important;
  background: rgba(0,0,0,0.3) !important;
  color: rgba(255, 220, 140, 0.6) !important;
  font-size: 9px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.15s, color 0.15s !important;
  flex-shrink: 0;
}

.turn-banner-close:hover {
  background: rgba(180, 60, 60, 0.5) !important;
  color: #fff !important;
  border-color: rgba(255, 80, 80, 0.4) !important;
}

body.sidebar-collapsed #zoom {
  right: 12px;
}

#history-aside:not(.hidden) ~ * #zoom,
body:has(#history-aside:not(.hidden)) #zoom {
  right: calc(320px + 12px);
}

/* ===== MAIN EN ÉVENTAIL ===== */
#hand {
  width: 100% !important;
  height: 140px !important;
  min-height: 115px !important;
  max-height: 115px !important;
  overflow: visible !important;
  position: relative !important;
  display: block !important;
}

#player-zone {
  overflow: visible !important;
}

.hand-strip-label {
  position: relative;
  z-index: 1;
}

#hand {
  overflow: visible !important;
  position: relative !important;
  z-index: 2;
}

.player-strip.bottom {
  overflow: visible !important;
  position: relative;
  z-index: 10;
}

#layout {
  overflow: hidden;
}

/* ===== XP BAR ===== */
.xp-bar-container {
  width: 100%;
  /*padding: 4px 12px 6px;*/
  padding: 2px 10px 0px;
  background: linear-gradient(180deg, rgba(15, 10, 5, 0.9), rgba(8, 5, 2, 0.95));
  border-top: 1px solid rgba(210, 158, 58, 0.2);
}

.xp-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xp-level-badge {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--wow-classic-gold-light);
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
  min-width: 50px;
}

.xp-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  border: 1px solid rgba(210, 158, 58, 0.25);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b6914, #d4a017, #f0cc60, #d4a017, #8b6914);
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  animation: xpBarShimmer 2s linear infinite;
  box-shadow: 0 0 8px rgba(255, 200, 60, 0.4);
}

@keyframes xpBarShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.xp-bar-text {
  font-size: 10px;
  font-weight: 700;
  color: rgba(241, 215, 154, 0.75);
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

/* Toast XP */
.xp-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(180deg, rgba(40, 28, 10, 0.95), rgba(18, 12, 4, 0.98));
  border: 1px solid rgba(210, 158, 58, 0.5);
  border-radius: 999px;
  padding: 6px 18px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--wow-classic-gold-light);
  text-shadow: 0 1px 0 #000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 12px rgba(255, 200, 60, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999999;
  pointer-events: none;
}

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

#xp-bar-container {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.auth-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--wow-classic-gold);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(210, 158, 58, 0.35);
  border-radius: 999px;
  padding: 1px 8px;
  text-shadow: 0 1px 0 #000;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.3px;
}

.auth-level-badge strong {
  color: #fff8e1;
  font-size: 11px;
}

.profile-xp-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(210, 158, 58, 0.2);
}

.profile-xp-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.profile-xp-level {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--wow-classic-gold-light);
  text-shadow: 0 1px 0 #000;
}

.profile-xp-text {
  font-size: 11px;
  font-weight: 700;
  color: rgba(241, 215, 154, 0.7);
}

.profile-xp-track {
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  border: 1px solid rgba(210, 158, 58, 0.25);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}

.profile-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b6914, #d4a017, #f0cc60, #d4a017, #8b6914);
  background-size: 200% 100%;
  border-radius: 999px;
  animation: xpBarShimmer 2s linear infinite;
  box-shadow: 0 0 8px rgba(255, 200, 60, 0.4);
  transition: width 0.6s ease;
}
.match-end-xp {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(210, 158, 58, 0.2);
}

.reward-xp-label {
  display: flex;
  justify-content: space-between;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--wow-classic-gold-light);
  text-shadow: 0 1px 0 #000;
  margin-bottom: 6px;
}

.reward-xp-track {
  height: 10px;
  background: rgba(0,0,0,0.5);
  border-radius: 999px;
  border: 1px solid rgba(210, 158, 58, 0.25);
  overflow: hidden;
  margin-bottom: 4px;
}

.reward-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b6914, #d4a017, #f0cc60, #d4a017, #8b6914);
  background-size: 200% 100%;
  border-radius: 999px;
  animation: xpBarShimmer 2s linear infinite;
  box-shadow: 0 0 8px rgba(255,200,60,0.4);
  transition: width 0.8s cubic-bezier(0.22,1,0.36,1);
}

.reward-xp-text {
  font-size: 10px;
  color: rgba(241,215,154,0.7);
  text-align: right;
  font-weight: 700;
}

.rank-level {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--wow-classic-gold);
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(210, 158, 58, 0.3);
  border-radius: 999px;
  padding: 1px 7px;
  text-shadow: 0 1px 0 #000;
}

/* ================================
   BOUTON QUÊTE WOW (?)
   ================================ */

   .wow-quest-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
  }
  
  /* Cadre extérieur sculpté */
  .wow-quest-btn-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
  
    background:
      linear-gradient(180deg, #6a4b1f 0%, #2a1a0c 100%);
  
    border: 0.5px solid #caa85a;
  
    box-shadow:
      inset 0 2px 3px rgba(255, 220, 140, 0.25),
      inset 0 -3px 6px rgba(0, 0, 0, 0.7),
      0 4px 10px rgba(0,0,0,0.5);
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    transition: all 0.15s ease;
  }
  
  /* contour lumineux WoW */
  .wow-quest-btn-inner::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 6px;
  
    border: 1px solid rgba(255, 220, 140, 0.35);
    box-shadow:
      inset 0 0 8px rgba(255, 210, 120, 0.25),
      0 0 6px rgba(255, 200, 100, 0.15);
  }
  
  /* icône ? */
  .wow-quest-icon {
    font-family: 'Cinzel', serif;
    font-size: 26px;
    font-weight: 900;
    color: #f4d27a;
  
    text-shadow:
      0 1px 0 #000,
      0 0 6px rgba(255, 210, 120, 0.4);
  
    transform: translateY(-1px);
  }
  
  /* HOVER (effet glow WoW) */
  .wow-quest-btn:hover .wow-quest-btn-inner {
    border-color: #ffd97a;
  
    box-shadow:
      inset 0 2px 3px rgba(255, 230, 160, 0.35),
      inset 0 -3px 6px rgba(0, 0, 0, 0.7),
      0 0 0 1px rgba(255, 215, 120, 0.2),
      0 6px 16px rgba(0,0,0,0.6),
      0 0 18px rgba(255, 200, 80, 0.3);
  }
  
  /* ACTIVE (pression) */
  .wow-quest-btn:active .wow-quest-btn-inner {
    transform: translateY(1px) scale(0.96);
  }
  .online-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.4);
    color: #d1ffd1;
    font-weight: 500;
    width: fit-content;
  }

  .hero-info-card {
    padding: 8px 10px;
    font-size: 13px;
    max-width: 180px;
  }
  
  .hero-info-title {
    font-size: 12px;
    margin-bottom: 2px;
  }
  
  .hero-info-card p {
    margin: 0;
    font-size: 13px;
  }
  .deckbuilder-search {
    width: 100%;
    max-width: 320px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.35);
    color: #fff;
    margin-bottom: 10px;
  }
  
  .deckbuilder-search::placeholder {
    color: rgba(255,255,255,0.6);
  }

  #zoom {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
  
    z-index: 9999;
  
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
  
    background: rgba(0,0,0,0.6);
    padding: 10px;
    border-radius: 12px;
    backdrop-filter: blur(6px);
  }
  
  #zoom.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }

  #zoom img {
    width: 260px;
    border-radius: 10px;
    box-shadow:
      0 10px 30px rgba(0,0,0,0.7),
      0 0 15px rgba(255,255,255,0.15);
  }

  .hero-card-image.hero-hit {
    animation: heroHit 0.28s ease;
  }
  
  .hero-card-image.hero-heal {
    animation: heroHeal 0.28s ease;
  }
  
  @keyframes heroHit {
    0% {
      transform: scale(1);
      filter: brightness(1);
    }
    30% {
      transform: scale(1.05);
      filter: brightness(1.35) saturate(1.2);
    }
    100% {
      transform: scale(1);
      filter: brightness(1);
    }
  }
  
  @keyframes heroHeal {
    0% {
      transform: scale(1);
      filter: brightness(1);
    }
    30% {
      transform: scale(1.05);
      filter: brightness(1.2) saturate(1.45);
    }
    100% {
      transform: scale(1);
      filter: brightness(1);
    }
  }

  .hero-card-image.hero-hit {
    animation: heroHit 0.32s ease;
  }
  
  .hero-card-image.hero-heal {
    animation: heroHeal 0.32s ease;
  }
  
  @keyframes heroHit {
    0% {
      transform: scale(1);
      filter: brightness(1) drop-shadow(0 0 0 rgba(255, 0, 0, 0));
    }
    35% {
      transform: scale(1.05);
      filter: brightness(1.15) drop-shadow(0 0 12px rgba(255, 60, 60, 0.95));
    }
    100% {
      transform: scale(1);
      filter: brightness(1) drop-shadow(0 0 0 rgba(255, 0, 0, 0));
    }
  }
  
  @keyframes heroHeal {
    0% {
      transform: scale(1);
      filter: brightness(1) drop-shadow(0 0 0 rgba(0, 255, 120, 0));
    }
    35% {
      transform: scale(1.05);
      filter: brightness(1.15) drop-shadow(0 0 12px rgba(0, 255, 120, 0.95));
    }
    100% {
      transform: scale(1);
      filter: brightness(1) drop-shadow(0 0 0 rgba(0, 255, 120, 0));
    }
  }

  .hero-slot {
    position: relative;
  }

  .hero-float-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-weight: 900;
    font-size: 34px;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
  
    /* lisibilité 🔥 */
    -webkit-text-stroke: 1px black;
    text-shadow:
      0 0 8px rgba(0,0,0,0.9),
      0 2px 6px rgba(0,0,0,0.8);
  
    animation: heroFloatText 0.8s cubic-bezier(.2,1.4,.4,1) forwards;
  }
  
  .hero-float-text.damage {
    color: #ff3b3b;
    text-shadow:
      0 0 10px rgba(255, 60, 60, 1),
      0 0 20px rgba(255, 0, 0, 0.8),
      0 2px 6px rgba(0,0,0,0.9);
  }
  
  .hero-float-text.heal {
    color: #3dff88;
    text-shadow:
      0 0 10px rgba(0, 255, 120, 1),
      0 0 20px rgba(0, 255, 120, 0.7),
      0 2px 6px rgba(0,0,0,0.9);
  }
  
  @keyframes heroFloatText {
    0% {
      opacity: 0;
      transform: translate(-50%, -10%) scale(0.5);
    }
    20% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1.25);
    }
    60% {
      transform: translate(-50%, -90%) scale(1);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -140%) scale(0.9);
    }
  }

  .hero-card-image.hero-hit {
    animation: heroShake 0.25s ease;
  }
  
  .hero-card-image.hero-heal {
    animation: heroPulse 0.35s ease;
  }
  
  @keyframes heroShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
  }
  
  @keyframes heroPulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.4) saturate(1.6); }
    100% { filter: brightness(1); }
  }

  .hero-card-image.hero-hit {
    animation: heroHitCard 0.32s ease;
  }
  
  .hero-card-image.hero-heal {
    animation: heroHealCard 0.32s ease;
  }
  
  @keyframes heroHitCard {
    0% {
      box-shadow: 0 0 0 rgba(255, 0, 0, 0);
      outline: 0px solid rgba(255, 60, 60, 0);
      filter: brightness(1);
    }
    35% {
      box-shadow:
        0 0 12px rgba(255, 40, 40, 0.95),
        0 0 24px rgba(255, 0, 0, 0.75);
      outline: 3px solid rgba(255, 70, 70, 0.95);
      filter: brightness(1.08) contrast(1.08);
    }
    100% {
      box-shadow: 0 0 0 rgba(255, 0, 0, 0);
      outline: 0px solid rgba(255, 60, 60, 0);
      filter: brightness(1);
    }
  }
  
  @keyframes heroHealCard {
    0% {
      box-shadow: 0 0 0 rgba(0, 255, 120, 0);
      outline: 0px solid rgba(0, 255, 120, 0);
      filter: brightness(1);
    }
    35% {
      box-shadow:
        0 0 12px rgba(0, 255, 120, 0.95),
        0 0 24px rgba(0, 255, 120, 0.75);
      outline: 3px solid rgba(80, 255, 140, 0.95);
      filter: brightness(1.08) contrast(1.08);
    }
    100% {
      box-shadow: 0 0 0 rgba(0, 255, 120, 0);
      outline: 0px solid rgba(0, 255, 120, 0);
      filter: brightness(1);
    }
  }

  .hero-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 55;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: heroParticleBurst 0.7s ease-out forwards;
  }
  
  .hero-particle.damage {
    background: radial-gradient(circle, #ff8a8a 0%, #ff2a2a 60%, rgba(255, 42, 42, 0) 100%);
    box-shadow: 0 0 10px rgba(255, 50, 50, 0.9);
  }
  
  .hero-particle.heal {
    background: radial-gradient(circle, #b8ffd2 0%, #2dff7a 60%, rgba(45, 255, 122, 0) 100%);
    box-shadow: 0 0 10px rgba(45, 255, 122, 0.9);
  }
  
  @keyframes heroParticleBurst {
    0% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
    100% {
      opacity: 0;
      transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.4);
    }
  }

  .table-card.card-played {
    animation: cardPlayedPop 0.28s ease;
  }
  
  @keyframes cardPlayedPop {
    0% {
      transform: scale(0.82);
      opacity: 0.2;
      filter: brightness(1.25);
    }
    60% {
      transform: scale(1.06);
      opacity: 1;
      filter: brightness(1.1);
    }
    100% {
      transform: scale(1);
      opacity: 1;
      filter: brightness(1);
    }
  }

  .dragging-card .table-card:hover,
  .dragging-card .hand-card:hover {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
  }

  .dragging {
    pointer-events: none !important;
  }

  .active-player {
    outline: 3px solid #ffd54f;
    box-shadow: 0 0 20px rgba(255, 213, 79, 0.8);
  }



#ui-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483647;
  pointer-events: none;

  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;

  color: #f8e7b5;
  background: linear-gradient(180deg, rgba(34, 25, 16, 0.98), rgba(18, 12, 8, 0.98));
  border: 1px solid rgba(214, 168, 77, 0.55);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 220, 140, 0.08) inset;

  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

#ui-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.lobby-action-btn-join {
  border: none;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
  cursor: none !important;
  color: #1b1105;
  background: linear-gradient(180deg, #f2bb57, #19d321);
  transition: transform 0.15s 
ease, filter 0.15s 
ease;
}