/* ─── RESET & BASE ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #1a1a2e;
  --bg2:         #16213e;
  --bg3:         #0f3460;
  --accent:      #e94560;
  --gold:        #f5c518;
  --text:        #eaeaea;
  --text-muted:  #888;
  --light-sq:    #f0d9b5;
  --dark-sq:     #b58863;
  --selected:    #7fc97f;
  --hint:        rgba(127, 201, 127, 0.55);
  --reveal-hint: rgba(245, 197, 24, 0.65);
  --last-move:   rgba(100, 180, 255, 0.4);
  --border:      rgba(255,255,255,0.08);
  --radius:      10px;
  --sq-size:     clamp(48px, 9vmin, 76px);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── LANDING PAGE ─────────────────────────────────────────────────────── */
.landing-page {
  background: #000;
}

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2.5rem 1.5rem;
  gap: 1.4rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Logo image ── */
.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.2rem;
}

.hero-logo-img {
  width: 450px;
  height: auto;
  animation: logo-float 3.5s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35));
}

@keyframes logo-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ── Titres ── */
.title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  line-height: 1;
}

.subtitle {
  font-size: 0.75rem;
  letter-spacing: 6px;
  color: #c9a84c;
  text-transform: uppercase;
  margin-top: -0.8rem;
}

.tagline {
  color: #888;
  text-align: center;
  font-size: 1rem;
  line-height: 1.6;
}

/* ── Règles ── */
.rules-box {
  background: #0d0d0d;
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.rule {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: #999;
  line-height: 1.4;
}

.rule-num {
  background: #c9a84c;
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Share box ── */
.share-box {
  background: #0d0d0d;
  border: 1px solid #c9a84c;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
}

.share-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.game-code {
  font-family: 'Courier New', monospace;
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 6px;
  text-shadow: 0 0 12px rgba(255,255,255,0.2);
}

.waiting-text {
  font-size: 0.82rem;
  color: #555;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ─── SECTION LABEL ───────────────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #555;
  text-align: center;
  margin-bottom: 0.6rem;
}

/* ─── BOUTONS COULEUR ──────────────────────────────────────────────────── */
.color-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

.btn-color {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 1.4rem;
  border-radius: 10px;
  border: 2px solid #333;
  background: #111;
  color: #ccc;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  min-width: 90px;
}
.btn-color:hover {
  border-color: #c9a84c;
  color: #c9a84c;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.25);
}
.btn-color .color-pawn { font-size: 2rem; line-height: 1; }

/* Blanc : fond clair */
#btn-white { border-color: #555; }
#btn-white:hover { background: #1a1a1a; border-color: #f5f5f0; color: #f5f5f0; box-shadow: 0 6px 20px rgba(245,245,240,0.2); }

/* Noir */
.btn-color-black { border-color: #444; }
.btn-color-black:hover { background: #1a1a1a; }

/* Aléatoire */
.btn-color-random { border-color: #444; }
.btn-color-random:hover { border-color: #e94560; color: #e94560; box-shadow: 0 6px 20px rgba(233,69,96,0.25); }

/* ─── BOUTONS ──────────────────────────────────────────────────────────── */
.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c23152);
  color: white;
  box-shadow: 0 4px 15px rgba(233,69,96,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233,69,96,0.6);
}

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #1a4a80; }

.btn-copy {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  border-radius: 6px;
}
.btn-copy:hover { background: rgba(245,197,24,0.1); }

.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-danger { background: #c0392b; color: white; }
.btn-danger:hover { background: #e74c3c; }

/* ─── BOUTONS TIMER ────────────────────────────────────────────────────── */
.time-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
.btn-time {
  padding: 0.28rem 0.72rem;
  border-radius: 20px;
  border: 1px solid #2a2a2a;
  background: #111;
  color: #777;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-time:hover  { border-color: #c9a84c; color: #c9a84c; }
.btn-time.active { background: #c9a84c;   color: #000; border-color: #c9a84c; }

/* ─── JOIN / SHARE ─────────────────────────────────────────────────────── */
.buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.divider {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.join-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.join-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: monospace;
}
.join-row input:focus { outline: none; border-color: var(--accent); }

.share-box {
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
}

.game-code {
  font-family: monospace;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 4px;
}

.waiting-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.error {
  background: rgba(233,69,96,0.2);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.hidden { display: none !important; }

/* ─── GAME PAGE ────────────────────────────────────────────────────────── */
.game-container {
  display: flex;
  min-height: 100vh;
  gap: 0;
}

/* ─── SIDEBAR ──────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-width: 190px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.8rem;
  gap: 0.8rem;
}

.logo-small {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.3rem 0;
}

.logo-small-img {
  width: 162px;
  height: auto;
  display: inline-block;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}

/* ── Player cards ── */
.player-card {
  background: var(--bg3);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.card-white { border-color: rgba(255,255,255,0.15); }
.card-black { border-color: rgba(201,168,76,0.25); }

.pc-color-bar { width: 5px; flex-shrink: 0; }
.bar-white { background: linear-gradient(180deg, #fff 0%, #ccc 100%); }
.bar-black { background: linear-gradient(180deg, var(--gold) 0%, #8a6c2a 100%); }

.pc-body { flex: 1; padding: 0.45rem 0.65rem; display: flex; flex-direction: column; gap: 0.2rem; }
.pc-row1 { display: flex; align-items: center; gap: 0.4rem; }
.pc-row2 { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.color-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-white { background: rgba(255,255,255,0.12); color: #eee;          border: 1px solid #555; }
.badge-black { background: rgba(201,168,76,0.15);  color: var(--gold);   border: 1px solid rgba(201,168,76,0.4); }

.player-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.player-dot.active {
  background: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.captured-pieces {
  font-size: 0.72rem;
  flex: 1;
  letter-spacing: 1px;
}

/* ── Horloge ── */
.clock {
  margin-left: auto;
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 44px;
  text-align: right;
  color: var(--text-muted);
  transition: color 0.3s;
}
.clock.clock-active   { color: var(--text); }
.clock.clock-warning  { color: #e8a020; }
.clock.clock-critical { color: var(--accent); animation: tick-flash 0.5s ease-in-out infinite alternate; }
@keyframes tick-flash { from { opacity: 1; } to { opacity: 0.4; } }

.move-history {
  flex: 1;
  background: var(--bg);
  border-radius: 8px;
  overflow-y: auto;
  min-height: 100px;
}

.mh-header {
  padding: 0.5rem 0.8rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.mh-row {
  display: grid;
  grid-template-columns: 22px 1fr 1fr;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.6rem;
  font-size: 0.8rem;
  font-family: monospace;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mh-row:hover { background: rgba(255,255,255,0.05); }
.mh-num  { color: var(--text-muted); font-size: 0.7rem; }
.mh-cell {
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  color: #ffffff;
}
.mh-cell:hover { background: rgba(255,255,255,0.1); }
.mh-white { color: #ffffff; }
.mh-black { color: #ffffff; }
.mh-active {
  background: rgba(201,168,76,0.28) !important;
  color: var(--gold) !important;
  outline: 1px solid rgba(201,168,76,0.55);
}

.sidebar-actions {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ─── RESIGN FLAG BUTTON ─────────────────────────────────────────────── */
.btn-resign-flag {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  line-height: 1;
}
.btn-resign-flag:hover {
  border-color: #c0392b;
  background: rgba(192,57,43,0.18);
  color: #ff6b6b;
}
.btn-resign-flag::after {
  content: "Resign";
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.btn-resign-flag:hover::after { opacity: 1; }

/* ─── REVIEW NAV ─────────────────────────────────────────────────────── */
.review-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  background: var(--bg);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
}

.btn-rnav {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
}
.btn-rnav:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-rnav:disabled {
  opacity: 0.3;
  cursor: default;
}
.btn-rnav-live {
  border-color: rgba(46,204,113,0.3);
  color: #2ecc71;
}
.btn-rnav-live:hover:not(:disabled) {
  border-color: #2ecc71;
  background: rgba(46,204,113,0.1);
  color: #2ecc71;
}

.review-nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  min-width: 36px;
  text-align: center;
}

/* ─── BOARD AREA ──────────────────────────────────────────────────────── */
.board-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  gap: 0.8rem;
}

/* ─── STATUS BAR ─────────────────────────────────────────────────────── */
.status-bar {
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s;
  border: 1px solid transparent;
  text-align: center;
}
.status-bar.my-turn  { background: rgba(46,204,113,0.15); border-color: #2ecc71; color: #2ecc71; }
.status-bar.wait     { background: var(--bg2); color: var(--text-muted); }
.status-bar.check    { background: rgba(233,69,96,0.12); border-color: rgba(233,69,96,0.5); color: var(--accent); }
.status-bar.win      { background: rgba(245,197,24,0.2); border-color: var(--gold); color: var(--gold); }
.status-bar.loss     { background: rgba(100,100,100,0.2); border-color: var(--text-muted); }
.status-bar.draw     { background: rgba(100,180,255,0.1); border-color: #64b4ff; color: #64b4ff; }
.status-bar.setup    { background: rgba(100,100,255,0.15); border-color: #8888ff; color: #aaaaff; }


/* ─── PLATEAU ────────────────────────────────────────────────────────── */
.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.board-with-ranks {
  display: flex;
  gap: 0;
}

.coords-ranks {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 20px;
  padding-bottom: 4px;
}

.coords-ranks div, .coords-files div {
  color: var(--text-muted);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.coords-files {
  display: flex;
  justify-content: space-around;
  padding-left: 22px;
  height: 18px;
}
.coords-files div { width: var(--sq-size); }

.board {
  display: grid;
  grid-template-columns: repeat(8, var(--sq-size));
  grid-template-rows:    repeat(8, var(--sq-size));
  border: 3px solid var(--bg3);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.square {
  width: var(--sq-size);
  height: var(--sq-size);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.square.light { background: var(--light-sq); }
.square.dark  { background: var(--dark-sq); }

.square.selected { background: var(--selected) !important; }
.square.last-move { background-color: var(--last-move) !important; }

.square.hint::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(30,30,30,0.35);
}
.square.hint.has-piece::after {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
  border: 4px solid rgba(30,30,30,0.35);
  border-radius: 50%;
}
.square.reveal-hint::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(245, 197, 24, 0.6);
  box-shadow: 0 0 8px var(--gold);
}

/* ─── PIÈCES LICHESS (SVG merida) ────────────────────────────────────── */
.piece {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}
.square:hover .piece { transform: scale(1.08); }

.piece-img {
  width:  calc(var(--sq-size) * 0.88);
  height: calc(var(--sq-size) * 0.88);
  pointer-events: none;
  user-select: none;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

/* Case du roi en échec */
.square.in-check {
  background: rgba(210, 40, 40, 0.55) !important;
  box-shadow: inset 0 0 0 3px rgba(255, 60, 60, 0.8);
  animation: check-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes check-pulse {
  from { background: rgba(210, 40, 40, 0.4) !important; }
  to   { background: rgba(210, 40, 40, 0.75) !important; }
}

/* ─── BANNIÈRE SETUP (non-bloquante, au-dessus du plateau) ───────────── */
.setup-banner {
  background: linear-gradient(135deg, rgba(100,100,255,0.12), rgba(201,168,76,0.12));
  border: 1px solid rgba(201,168,76,0.5);
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  color: #c9a84c;
  text-align: center;
  animation: banner-pulse 2s ease-in-out infinite alternate;
  pointer-events: none; /* ne bloque JAMAIS les clics */
}
.setup-banner strong { color: #f5c518; }
.setup-banner-icon { margin-right: 0.5rem; }

@keyframes banner-pulse {
  from { border-color: rgba(201,168,76,0.3); }
  to   { border-color: rgba(201,168,76,0.8); box-shadow: 0 0 12px rgba(201,168,76,0.2); }
}

/* ─── OVERLAY FIN DE PARTIE ──────────────────────────────────────────── */
.end-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
  backdrop-filter: blur(3px);
}

.end-msg {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.setup-icon, .end-icon {
  font-size: 3.5rem;
  animation: glow 2s infinite alternate;
}

.end-logo {
  width: 202px;
  height: auto;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
  animation: logo-float 3.5s ease-in-out infinite;
}

.end-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.setup-msg h2, .end-msg h2 { font-size: 1.4rem; }
.setup-msg p,  .end-msg p  { color: var(--text-muted); line-height: 1.5; }

/* ─── ÉTOILE REINE CACHÉE ────────────────────────────────────────────── */
.hq-star {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.5rem;
  color: var(--gold);
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 0 5px rgba(245,197,24,0.9);
}

/* ─── REVEAL PANEL ──────────────────────────────────────────────────── */
.reveal-panel {
  background: rgba(245,197,24,0.1);
  border: 1px solid var(--gold);
  border-radius: 50px;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  color: var(--gold);
  text-align: center;
}

/* ─── SALLE D'ATTENTE (LOBBY) ───────────────────────────────────────── */
.lobby-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(6px);
}

.lobby-box {
  background: var(--bg2);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 16px;
  padding: 2.5rem 2.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 40px rgba(201,168,76,0.08);
}

.lobby-icon {
  animation: mask-float 3s ease-in-out infinite;
}

.lobby-logo-img {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.4));
}

.lobby-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
}

.lobby-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  margin: 0;
}

.lobby-link-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.lobby-code {
  font-family: monospace;
  font-size: 1.9rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 6px;
  text-shadow: 0 0 12px rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  text-align: center;
  width: 100%;
}

.lobby-copy-btn {
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 0.4rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
}
.lobby-copy-btn:hover { background: rgba(255,255,255,0.1); }

.lobby-players {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.lobby-player-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.lp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lp-ok   { background: #2ecc71; box-shadow: 0 0 8px #2ecc71; }
.lp-wait { background: #555; animation: tick-flash 1s ease-in-out infinite alternate; }

.lp-waiting-txt {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── SETUP PAWN HIGHLIGHT ───────────────────────────────────────────── */
/* Pendant la phase setup, les pions du joueur sont mis en évidence */
.square.setup-pawn {
  outline: 3px solid #c9a84c;
  outline-offset: -3px;
  cursor: pointer;
}
.square.setup-pawn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(201,168,76,0.18);
  pointer-events: none;
  animation: setup-pawn-pulse 1.4s ease-in-out infinite alternate;
}
@keyframes setup-pawn-pulse {
  from { background: rgba(201,168,76,0.10); }
  to   { background: rgba(201,168,76,0.30); }
}

/* ─── COUNTDOWN OVERLAY ──────────────────────────────────────────────── */
.countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(6px);
}

.countdown-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.countdown-num {
  font-size: 9rem;
  font-weight: 900;
  color: #c9a84c;
  line-height: 1;
  text-shadow: 0 0 40px rgba(201,168,76,0.6), 0 0 80px rgba(201,168,76,0.3);
  animation: countdown-pop 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.countdown-label {
  font-size: 1.05rem;
  color: #aaa;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

@keyframes countdown-pop {
  0%   { transform: scale(1.9); opacity: 0; }
  60%  { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── MODAL PROMOTION ───────────────────────────────────────────────── */
.promo-modal {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.promo-box {
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.promo-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.promo-choices {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.promo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.78rem;
  transition: border-color 0.15s, transform 0.1s;
}

.promo-btn:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .game-container { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; min-height: unset; border-right: none; border-bottom: 1px solid var(--border); padding: 0.5rem; gap: 0.5rem; }
  .sidebar .player-card { flex: 1; min-width: 140px; }
  .pc-color-bar { width: 4px; }
  .move-history { max-height: 120px; }
  :root { --sq-size: clamp(38px, 11vw, 56px); }
}
