/* game.css — Style de la table et du canvas uniquement (Dev A) */

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

body {
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #e0e0e0;
  user-select: none;
}

/* ─── Conteneur principal ────────────────────────────────────────────────── */
#game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
}

/* ─── HUD (infos au-dessus du canvas) ────────────────────────────────────── */
#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 900px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  letter-spacing: 0.03em;
}

/* ─── Bouton retour dans le HUD ────────────────────────────────────────────── */
.back-home-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.back-home-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
  color: white;
  transform: translateY(-1px);
}

.back-home-btn:active {
  transform: translateY(0);
}

#hud .hud-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 120px;
}

#hud .hud-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #7a8ca0;
  letter-spacing: 0.08em;
}

#hud .hud-value {
  font-size: 15px;
  font-weight: 600;
  color: #e8f4fd;
}

#hud .hud-value.active-player {
  color: #4fc3f7;
}

#hud .hud-value.group-solids  { color: #f5c518; }
#hud .hud-value.group-stripes { color: #c084fc; }
#hud .hud-value.group-none    { color: #94a3b8; }

#difficulty-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#difficulty-badge.easy   { background: #166534; color: #bbf7d0; }
#difficulty-badge.medium { background: #854d0e; color: #fef08a; }
#difficulty-badge.hard   { background: #7f1d1d; color: #fecaca; }

/* ─── Canvas ─────────────────────────────────────────────────────────────── */
#game-canvas {
  display: block;
  border-radius: 6px;
  box-shadow:
    0 0 0 3px #5c3a1e,
    0 0 0 7px #3b2410,
    0 8px 40px rgba(0, 0, 0, 0.7),
    0 2px 8px  rgba(0, 0, 0, 0.5);
  cursor: crosshair;
}

#game-canvas.no-interact {
  cursor: not-allowed;
}

/* ─── Message d'état ─────────────────────────────────────────────────────── */
#status-bar {
  width: 900px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  min-height: 24px;
  color: #cbd5e1;
  transition: color 0.3s;
}

#status-bar.fault   { color: #f87171; }
#status-bar.success { color: #4ade80; }
#status-bar.info    { color: #60a5fa; }
#status-bar.ai      { color: #c084fc; }

/* ─── Overlay de fin de partie ───────────────────────────────────────────── */
#end-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 25, 0.82);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#end-overlay.visible {
  display: flex;
}

#end-card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 16px;
  padding: 48px 64px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

#end-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

#end-title.win  { color: #4ade80; }
#end-title.lose { color: #f87171; }

#end-subtitle {
  font-size: 16px;
  color: #94a3b8;
}

/* ─── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.1s, box-shadow 0.1s;
}

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

.btn-primary {
  background: #0f3460;
  color: #e8f4fd;
  box-shadow: 0 4px 14px rgba(15, 52, 96, 0.5);
}
.btn-primary:hover {
  background: #1a4f8a;
  box-shadow: 0 6px 18px rgba(15, 52, 96, 0.6);
}

/* ─── Indicateur de puissance (sous le canvas) ───────────────────────────── */
#power-bar-container {
  width: 900px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #7a8ca0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.2s;
}

#power-bar-container.visible { opacity: 1; }

#power-bar-track {
  flex: 1;
  height: 6px;
  background: #1e2d40;
  border-radius: 3px;
  overflow: hidden;
}

#power-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #22c55e 0%, #f59e0b 60%, #ef4444 100%);
  transition: width 0.05s;
}
